From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:48782 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751357AbdJBNxt (ORCPT ); Mon, 2 Oct 2017 09:53:49 -0400 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Subject: Re: [v4, 1/9] brcmsmac: make some local variables 'static const' to reduce stack size From: Kalle Valo In-Reply-To: <20170922212930.620249-2-arnd@arndb.de> References: <20170922212930.620249-2-arnd@arndb.de> To: Arnd Bergmann Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Arnd Bergmann , Mauro Carvalho Chehab , Jiri Pirko , "David S. Miller" , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Masahiro Yamada , Michal Marek , Andrew Morton , Kees Cook , Geert Uytterhoeven , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, kasan-dev@googlegroups.com, linux-kbuild@vger.kernel.org, Jakub Jelinek , =?UTF-8?q?Martin=20Li=C5=A1ka?= Message-Id: <20171002135348.7AFA560AFB@smtp.codeaurora.org> (sfid-20171002_155708_279251_06CE656B) Date: Mon, 2 Oct 2017 13:53:48 +0000 (UTC) Sender: linux-wireless-owner@vger.kernel.org List-ID: Arnd Bergmann wrote: > With KASAN and a couple of other patches applied, this driver is one > of the few remaining ones that actually use more than 2048 bytes of > kernel stack: > > broadcom/brcm80211/brcmsmac/phy/phy_n.c: In function 'wlc_phy_workarounds_nphy_gainctrl': > broadcom/brcm80211/brcmsmac/phy/phy_n.c:16065:1: warning: the frame size of 3264 bytes is larger than 2048 bytes [-Wframe-larger-than=] > broadcom/brcm80211/brcmsmac/phy/phy_n.c: In function 'wlc_phy_workarounds_nphy': > broadcom/brcm80211/brcmsmac/phy/phy_n.c:17138:1: warning: the frame size of 2864 bytes is larger than 2048 bytes [-Wframe-larger-than=] > > Here, I'm reducing the stack size by marking as many local variables as > 'static const' as I can without changing the actual code. > > This is the first of three patches to improve the stack usage in this > driver. It would be good to have this backported to stabl kernels > to get all drivers in 'allmodconfig' below the 2048 byte limit so > we can turn on the frame warning again globally, but I realize that > the patch is larger than the normal limit for stable backports. > > The other two patches do not need to be backported. > > Cc: > Acked-by: Arend van Spriel > Signed-off-by: Arnd Bergmann Patch applied to wireless-drivers.git, thanks. c503dd38f850 brcmsmac: make some local variables 'static const' to reduce stack size -- https://patchwork.kernel.org/patch/9967145/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kalle Valo Subject: Re: [v4, 1/9] brcmsmac: make some local variables 'static const' to reduce stack size Date: Mon, 2 Oct 2017 13:53:48 +0000 (UTC) Message-ID: <20171002135348.7AFA560AFB@smtp.codeaurora.org> References: <20170922212930.620249-2-arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Arnd Bergmann , Mauro Carvalho Chehab , Jiri Pirko , "David S. Miller" , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Masahiro Yamada , Michal Marek , Andrew Morton , Kees Cook , Geert Uytterhoeven , Greg Kroah-Hartman , linux-media@vger.ke To: Arnd Bergmann Return-path: In-Reply-To: <20170922212930.620249-2-arnd@arndb.de> Sender: linux-kbuild-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Arnd Bergmann wrote: > With KASAN and a couple of other patches applied, this driver is one > of the few remaining ones that actually use more than 2048 bytes of > kernel stack: > > broadcom/brcm80211/brcmsmac/phy/phy_n.c: In function 'wlc_phy_workarounds_nphy_gainctrl': > broadcom/brcm80211/brcmsmac/phy/phy_n.c:16065:1: warning: the frame size of 3264 bytes is larger than 2048 bytes [-Wframe-larger-than=] > broadcom/brcm80211/brcmsmac/phy/phy_n.c: In function 'wlc_phy_workarounds_nphy': > broadcom/brcm80211/brcmsmac/phy/phy_n.c:17138:1: warning: the frame size of 2864 bytes is larger than 2048 bytes [-Wframe-larger-than=] > > Here, I'm reducing the stack size by marking as many local variables as > 'static const' as I can without changing the actual code. > > This is the first of three patches to improve the stack usage in this > driver. It would be good to have this backported to stabl kernels > to get all drivers in 'allmodconfig' below the 2048 byte limit so > we can turn on the frame warning again globally, but I realize that > the patch is larger than the normal limit for stable backports. > > The other two patches do not need to be backported. > > Cc: > Acked-by: Arend van Spriel > Signed-off-by: Arnd Bergmann Patch applied to wireless-drivers.git, thanks. c503dd38f850 brcmsmac: make some local variables 'static const' to reduce stack size -- https://patchwork.kernel.org/patch/9967145/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.codeaurora.org ([198.145.29.96]:48782 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751357AbdJBNxt (ORCPT ); Mon, 2 Oct 2017 09:53:49 -0400 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [v4, 1/9] brcmsmac: make some local variables 'static const' to reduce stack size From: Kalle Valo In-Reply-To: <20170922212930.620249-2-arnd@arndb.de> References: <20170922212930.620249-2-arnd@arndb.de> Message-Id: <20171002135348.7AFA560AFB@smtp.codeaurora.org> Date: Mon, 2 Oct 2017 13:53:48 +0000 (UTC) Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Arnd Bergmann Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Mauro Carvalho Chehab , Jiri Pirko , "David S. Miller" , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Masahiro Yamada , Michal Marek , Andrew Morton , Kees Cook , Geert Uytterhoeven , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, kasan-dev@googlegroups.com, linux-kbuild@vger.kernel.org, Jakub Jelinek , =?UTF-8?q?Martin=20Li=C5=A1ka?= Arnd Bergmann wrote: > With KASAN and a couple of other patches applied, this driver is one > of the few remaining ones that actually use more than 2048 bytes of > kernel stack: > > broadcom/brcm80211/brcmsmac/phy/phy_n.c: In function 'wlc_phy_workarounds_nphy_gainctrl': > broadcom/brcm80211/brcmsmac/phy/phy_n.c:16065:1: warning: the frame size of 3264 bytes is larger than 2048 bytes [-Wframe-larger-than=] > broadcom/brcm80211/brcmsmac/phy/phy_n.c: In function 'wlc_phy_workarounds_nphy': > broadcom/brcm80211/brcmsmac/phy/phy_n.c:17138:1: warning: the frame size of 2864 bytes is larger than 2048 bytes [-Wframe-larger-than=] > > Here, I'm reducing the stack size by marking as many local variables as > 'static const' as I can without changing the actual code. > > This is the first of three patches to improve the stack usage in this > driver. It would be good to have this backported to stabl kernels > to get all drivers in 'allmodconfig' below the 2048 byte limit so > we can turn on the frame warning again globally, but I realize that > the patch is larger than the normal limit for stable backports. > > The other two patches do not need to be backported. > > Cc: > Acked-by: Arend van Spriel > Signed-off-by: Arnd Bergmann Patch applied to wireless-drivers.git, thanks. c503dd38f850 brcmsmac: make some local variables 'static const' to reduce stack size -- https://patchwork.kernel.org/patch/9967145/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches