lkml.org 
[lkml]   [2021]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: drivers/input/misc/iqs626a.c:1645:12: warning: stack frame size (2384) exceeds limit (2048) in function 'iqs626_probe'
+ Nathan, Nick and Michael

Hi all,

On Mon, Jul 26, 2021 at 02:20:40PM +0800, kernel test robot wrote:
> Hi Jeff,
>
> FYI, the error/warning still remains.
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: ff1176468d368232b684f75e82563369208bc371
> commit: f1d2809de97adc422967b6de59f0f6199769eb93 Input: Add support for Azoteq IQS626A
> date: 4 months ago
> config: powerpc-randconfig-r011-20210718 (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 powerpc cross compiling tool for clang build
> # apt-get install binutils-powerpc-linux-gnu
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f1d2809de97adc422967b6de59f0f6199769eb93
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout f1d2809de97adc422967b6de59f0f6199769eb93
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
> __do_insb
> ^
> arch/powerpc/include/asm/io.h:556:56: note: expanded from macro '__do_insb'
> #define __do_insb(p, b, n) readsb((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
> ~~~~~~~~~~~~~~~~~~~~~^
> In file included from drivers/input/misc/iqs626a.c:20:
> In file included from include/linux/interrupt.h:11:
> In file included from include/linux/hardirq.h:10:
> In file included from arch/powerpc/include/asm/hardirq.h:6:
> In file included from include/linux/irq.h:20:
> In file included from include/linux/io.h:13:
> In file included from arch/powerpc/include/asm/io.h:619:
> arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
> DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
> __do_##name al; \
> ^~~~~~~~~~~~~~
> <scratch space>:12:1: note: expanded from here
> __do_insw
> ^
> arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw'
> #define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
> ~~~~~~~~~~~~~~~~~~~~~^
> In file included from drivers/input/misc/iqs626a.c:20:
> In file included from include/linux/interrupt.h:11:
> In file included from include/linux/hardirq.h:10:
> In file included from arch/powerpc/include/asm/hardirq.h:6:
> In file included from include/linux/irq.h:20:
> In file included from include/linux/io.h:13:
> In file included from arch/powerpc/include/asm/io.h:619:
> arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
> DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
> __do_##name al; \
> ^~~~~~~~~~~~~~
> <scratch space>:16:1: note: expanded from here
> __do_insl
> ^
> arch/powerpc/include/asm/io.h:558:56: note: expanded from macro '__do_insl'
> #define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
> ~~~~~~~~~~~~~~~~~~~~~^
> In file included from drivers/input/misc/iqs626a.c:20:
> In file included from include/linux/interrupt.h:11:
> In file included from include/linux/hardirq.h:10:
> In file included from arch/powerpc/include/asm/hardirq.h:6:
> In file included from include/linux/irq.h:20:
> In file included from include/linux/io.h:13:
> In file included from arch/powerpc/include/asm/io.h:619:
> arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
> DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
> __do_##name al; \
> ^~~~~~~~~~~~~~
> <scratch space>:20:1: note: expanded from here
> __do_outsb
> ^
> arch/powerpc/include/asm/io.h:559:58: note: expanded from macro '__do_outsb'
> #define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
> ~~~~~~~~~~~~~~~~~~~~~^
> In file included from drivers/input/misc/iqs626a.c:20:
> In file included from include/linux/interrupt.h:11:
> In file included from include/linux/hardirq.h:10:
> In file included from arch/powerpc/include/asm/hardirq.h:6:
> In file included from include/linux/irq.h:20:
> In file included from include/linux/io.h:13:
> In file included from arch/powerpc/include/asm/io.h:619:
> arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
> DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
> __do_##name al; \
> ^~~~~~~~~~~~~~
> <scratch space>:24:1: note: expanded from here
> __do_outsw
> ^
> arch/powerpc/include/asm/io.h:560:58: note: expanded from macro '__do_outsw'
> #define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
> ~~~~~~~~~~~~~~~~~~~~~^
> In file included from drivers/input/misc/iqs626a.c:20:
> In file included from include/linux/interrupt.h:11:
> In file included from include/linux/hardirq.h:10:
> In file included from arch/powerpc/include/asm/hardirq.h:6:
> In file included from include/linux/irq.h:20:
> In file included from include/linux/io.h:13:
> In file included from arch/powerpc/include/asm/io.h:619:
> arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
> DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
> __do_##name al; \
> ^~~~~~~~~~~~~~
> <scratch space>:28:1: note: expanded from here
> __do_outsl
> ^
> arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl'
> #define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
> ~~~~~~~~~~~~~~~~~~~~~^
> >> drivers/input/misc/iqs626a.c:1645:12: warning: stack frame size (2384) exceeds limit (2048) in function 'iqs626_probe' [-Wframe-larger-than]
> static int iqs626_probe(struct i2c_client *client)
> ^
> 14 warnings generated.
>
>
> vim +/iqs626_probe +1645 drivers/input/misc/iqs626a.c
>
> 1644
> > 1645 static int iqs626_probe(struct i2c_client *client)
> 1646 {
> 1647 struct iqs626_ver_info ver_info;
> 1648 struct iqs626_private *iqs626;
> 1649 int error;
> 1650
> 1651 iqs626 = devm_kzalloc(&client->dev, sizeof(*iqs626), GFP_KERNEL);
> 1652 if (!iqs626)
> 1653 return -ENOMEM;
> 1654
> 1655 i2c_set_clientdata(client, iqs626);
> 1656 iqs626->client = client;
> 1657
> 1658 iqs626->regmap = devm_regmap_init_i2c(client, &iqs626_regmap_config);
> 1659 if (IS_ERR(iqs626->regmap)) {
> 1660 error = PTR_ERR(iqs626->regmap);
> 1661 dev_err(&client->dev, "Failed to initialize register map: %d\n",
> 1662 error);
> 1663 return error;
> 1664 }
> 1665
> 1666 init_completion(&iqs626->ati_done);
> 1667
> 1668 error = regmap_raw_read(iqs626->regmap, IQS626_VER_INFO, &ver_info,
> 1669 sizeof(ver_info));
> 1670 if (error)
> 1671 return error;
> 1672
> 1673 if (ver_info.prod_num != IQS626_VER_INFO_PROD_NUM) {
> 1674 dev_err(&client->dev, "Unrecognized product number: 0x%02X\n",
> 1675 ver_info.prod_num);
> 1676 return -EINVAL;
> 1677 }
> 1678
> 1679 error = iqs626_parse_prop(iqs626);
> 1680 if (error)
> 1681 return error;
> 1682
> 1683 error = iqs626_input_init(iqs626);
> 1684 if (error)
> 1685 return error;
> 1686
> 1687 error = devm_request_threaded_irq(&client->dev, client->irq,
> 1688 NULL, iqs626_irq, IRQF_ONESHOT,
> 1689 client->name, iqs626);
> 1690 if (error) {
> 1691 dev_err(&client->dev, "Failed to request IRQ: %d\n", error);
> 1692 return error;
> 1693 }
> 1694
> 1695 if (!wait_for_completion_timeout(&iqs626->ati_done,
> 1696 msecs_to_jiffies(2000))) {
> 1697 dev_err(&client->dev, "Failed to complete ATI\n");
> 1698 return -ETIMEDOUT;
> 1699 }
> 1700
> 1701 /*
> 1702 * The keypad may include one or more switches and is not registered
> 1703 * until ATI is complete and the initial switch states are read.
> 1704 */
> 1705 error = input_register_device(iqs626->keypad);
> 1706 if (error)
> 1707 dev_err(&client->dev, "Failed to register keypad: %d\n", error);
> 1708
> 1709 return error;
> 1710 }
> 1711
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

This function has elicited previous stack frame warnings using clang with
powerpc, the last being [1]. In each case the warning is preceded by many
others in arch/powerpc/include/asm/ so I'm curious if the warning here is
simply fallout from something else.

Do you have any insight? The stack size should be well under 2 kB in this
case. I see some other similar warnings throughout the mailing list which
are preceded by DEF_PCI_AC_NORET as well. If I have misunderstood or this
driver is indeed doing something nefarious, please let me know.

Kind regards,
Jeff LaBundy

[1] https://lkml.org/lkml/2021/6/6/10

\
 
 \ /
  Last update: 2021-07-26 22:27    [W:0.061 / U:1.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site