Re: [peterz-queue:locking/core 21/21] drivers/net/usb/r8152.c:7474:13: warning: stack frame size (9568) exceeds limit (8192) in function 'r8156b_hw_phy_cfg'

From: Mark Rutland
Date: Mon Jul 19 2021 - 06:07:26 EST


On Mon, Jul 19, 2021 at 05:24:25PM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git locking/core
> head: cf3ee3c8c29dc349b2cf52e5e72e8cb805ff5e57
> commit: cf3ee3c8c29dc349b2cf52e5e72e8cb805ff5e57 [21/21] locking/atomic: add generic arch_*() bitops
> config: riscv-randconfig-r002-20210719 (attached as .config)
> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 5d5b08761f944d5b9822d582378333cc4b36a0a7)
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # install riscv cross compiling tool for clang build
> # apt-get install binutils-riscv64-linux-gnu
> # https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=cf3ee3c8c29dc349b2cf52e5e72e8cb805ff5e57
> git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
> git fetch --no-tags peterz-queue locking/core
> git checkout cf3ee3c8c29dc349b2cf52e5e72e8cb805ff5e57
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>
> All warnings (new ones prefixed by >>):
>
> >> drivers/net/usb/r8152.c:7474:13: warning: stack frame size (9568) exceeds limit (8192) in function 'r8156b_hw_phy_cfg' [-Wframe-larger-than]
> static void r8156b_hw_phy_cfg(struct r8152 *tp)
> ^
> 1 warning generated.
>
>
> vim +/r8156b_hw_phy_cfg +7474 drivers/net/usb/r8152.c

> 195aae321c829d Hayes Wang 2021-04-16 7866 rtl_green_en(tp, test_bit(GREEN_ETHERNET, &tp->flags));

>From local testing, it looks like this test_bit() really confuses the
compiler and forces it to spill much more than it should otherwise need
to.

The good news is that Marco's suggestion of avoiding
instrumened-non-atomic.h (when using plain accesses) sidesteps this, so
I reckon we should go with that.

Should I send that as a fixup, or should I send a new version of the
whole series?

Thanks,
Mark.