All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/input/misc/iqs626a.c:1645:12: warning: stack frame size of 2560 bytes in function 'iqs626_probe'
@ 2021-06-06  4:37 ` kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2021-06-06  4:37 UTC (permalink / raw)
  To: Jeff LaBundy; +Cc: kbuild-all, clang-built-linux, linux-kernel, Dmitry Torokhov

[-- Attachment #1: Type: text/plain, Size: 4598 bytes --]

Hi Jeff,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f5b6eb1e018203913dfefcf6fa988649ad11ad6e
commit: f1d2809de97adc422967b6de59f0f6199769eb93 Input: Add support for Azoteq IQS626A
date:   2 months ago
config: powerpc-randconfig-r023-20210606 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 551a697c5cf33275b66add4fc467fcf59084cffb)
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 >>):

   In file included from drivers/input/misc/iqs626a.c:13:
   In file included from include/linux/completion.h:12:
   In file included from include/linux/swait.h:5:
   In file included from include/linux/list.h:9:
   In file included from include/linux/kernel.h:11:
   In file included from include/linux/bitops.h:32:
   In file included from arch/powerpc/include/asm/bitops.h:62:
   arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
   #define __lwsync()      __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
           ^
   <built-in>:310:9: note: previous definition is here
   #define __lwsync __builtin_ppc_lwsync
           ^
>> drivers/input/misc/iqs626a.c:1645:12: warning: stack frame size of 2560 bytes in function 'iqs626_probe' [-Wframe-larger-than=]
   static int iqs626_probe(struct i2c_client *client)
              ^
   2 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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25409 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* drivers/input/misc/iqs626a.c:1645:12: warning: stack frame size of 2560 bytes in function 'iqs626_probe'
@ 2021-06-06  4:37 ` kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2021-06-06  4:37 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4720 bytes --]

Hi Jeff,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f5b6eb1e018203913dfefcf6fa988649ad11ad6e
commit: f1d2809de97adc422967b6de59f0f6199769eb93 Input: Add support for Azoteq IQS626A
date:   2 months ago
config: powerpc-randconfig-r023-20210606 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 551a697c5cf33275b66add4fc467fcf59084cffb)
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 >>):

   In file included from drivers/input/misc/iqs626a.c:13:
   In file included from include/linux/completion.h:12:
   In file included from include/linux/swait.h:5:
   In file included from include/linux/list.h:9:
   In file included from include/linux/kernel.h:11:
   In file included from include/linux/bitops.h:32:
   In file included from arch/powerpc/include/asm/bitops.h:62:
   arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
   #define __lwsync()      __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
           ^
   <built-in>:310:9: note: previous definition is here
   #define __lwsync __builtin_ppc_lwsync
           ^
>> drivers/input/misc/iqs626a.c:1645:12: warning: stack frame size of 2560 bytes in function 'iqs626_probe' [-Wframe-larger-than=]
   static int iqs626_probe(struct i2c_client *client)
              ^
   2 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(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 25409 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/input/misc/iqs626a.c:1645:12: warning: stack frame size of 2560 bytes in function 'iqs626_probe'
  2021-06-06  4:37 ` kernel test robot
@ 2021-06-06  4:43   ` Dmitry Torokhov
  -1 siblings, 0 replies; 10+ messages in thread
From: Dmitry Torokhov @ 2021-06-06  4:43 UTC (permalink / raw)
  To: kernel test robot
  Cc: Jeff LaBundy, kbuild-all, clang-built-linux, linux-kernel

On Sun, Jun 06, 2021 at 12:37:43PM +0800, kernel test robot wrote:
> Hi Jeff,
> 
> FYI, the error/warning still remains.

I have no idea how it happens... 

> > 1645	static int iqs626_probe(struct i2c_client *client)
>   1646	{
>   1647		struct iqs626_ver_info ver_info;

This is 4 bytes.

>   1648		struct iqs626_private *iqs626;

This is 4 or 8.

>   1649		int error;

And another 4. And that is it. The bloat must be coming from elsewhere.

>   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	

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/input/misc/iqs626a.c:1645:12: warning: stack frame size of 2560 bytes in function 'iqs626_probe'
@ 2021-06-06  4:43   ` Dmitry Torokhov
  0 siblings, 0 replies; 10+ messages in thread
From: Dmitry Torokhov @ 2021-06-06  4:43 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2645 bytes --]

On Sun, Jun 06, 2021 at 12:37:43PM +0800, kernel test robot wrote:
> Hi Jeff,
> 
> FYI, the error/warning still remains.

I have no idea how it happens... 

> > 1645	static int iqs626_probe(struct i2c_client *client)
>   1646	{
>   1647		struct iqs626_ver_info ver_info;

This is 4 bytes.

>   1648		struct iqs626_private *iqs626;

This is 4 or 8.

>   1649		int error;

And another 4. And that is it. The bloat must be coming from elsewhere.

>   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	

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/input/misc/iqs626a.c:1645:12: warning: stack frame size of 2560 bytes in function 'iqs626_probe'
  2021-06-06  4:43   ` Dmitry Torokhov
@ 2021-06-06  4:55     ` Randy Dunlap
  -1 siblings, 0 replies; 10+ messages in thread
From: Randy Dunlap @ 2021-06-06  4:55 UTC (permalink / raw)
  To: Dmitry Torokhov, kernel test robot
  Cc: Jeff LaBundy, kbuild-all, clang-built-linux, linux-kernel

On 6/5/21 9:43 PM, Dmitry Torokhov wrote:
> On Sun, Jun 06, 2021 at 12:37:43PM +0800, kernel test robot wrote:
>> Hi Jeff,
>>
>> FYI, the error/warning still remains.
> 
> I have no idea how it happens... 
> 
>>> 1645	static int iqs626_probe(struct i2c_client *client)
>>   1646	{
>>   1647		struct iqs626_ver_info ver_info;
> 
> This is 4 bytes.
> 
>>   1648		struct iqs626_private *iqs626;
> 
> This is 4 or 8.
> 
>>   1649		int error;
> 
> And another 4. And that is it. The bloat must be coming from elsewhere.

In my experience, this stack usage comes from a compiler deciding to
inline some called function(s) that has(have) more stack usage...

Aha, I see that Paul just referred another stack frame size report to
a commit that uses 'noinline' for some called function(s):

https://lore.kernel.org/lkml/20210606044926.GJ4397@paulmck-ThinkPad-P17-Gen-1/T/#m4a6ab160a5d9d974cf9ac524836a6292d73128e2


>>   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	
> 
> Thanks.
> 


-- 
~Randy


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/input/misc/iqs626a.c:1645:12: warning: stack frame size of 2560 bytes in function 'iqs626_probe'
@ 2021-06-06  4:55     ` Randy Dunlap
  0 siblings, 0 replies; 10+ messages in thread
From: Randy Dunlap @ 2021-06-06  4:55 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3194 bytes --]

On 6/5/21 9:43 PM, Dmitry Torokhov wrote:
> On Sun, Jun 06, 2021 at 12:37:43PM +0800, kernel test robot wrote:
>> Hi Jeff,
>>
>> FYI, the error/warning still remains.
> 
> I have no idea how it happens... 
> 
>>> 1645	static int iqs626_probe(struct i2c_client *client)
>>   1646	{
>>   1647		struct iqs626_ver_info ver_info;
> 
> This is 4 bytes.
> 
>>   1648		struct iqs626_private *iqs626;
> 
> This is 4 or 8.
> 
>>   1649		int error;
> 
> And another 4. And that is it. The bloat must be coming from elsewhere.

In my experience, this stack usage comes from a compiler deciding to
inline some called function(s) that has(have) more stack usage...

Aha, I see that Paul just referred another stack frame size report to
a commit that uses 'noinline' for some called function(s):

https://lore.kernel.org/lkml/20210606044926.GJ4397(a)paulmck-ThinkPad-P17-Gen-1/T/#m4a6ab160a5d9d974cf9ac524836a6292d73128e2


>>   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	
> 
> Thanks.
> 


-- 
~Randy

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/input/misc/iqs626a.c:1645:12: warning: stack frame size of 2560 bytes in function 'iqs626_probe'
  2021-06-06  4:55     ` Randy Dunlap
@ 2021-06-06  4:58       ` Dmitry Torokhov
  -1 siblings, 0 replies; 10+ messages in thread
From: Dmitry Torokhov @ 2021-06-06  4:58 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: kernel test robot, Jeff LaBundy, kbuild-all, clang-built-linux,
	linux-kernel

On Sat, Jun 05, 2021 at 09:55:14PM -0700, Randy Dunlap wrote:
> On 6/5/21 9:43 PM, Dmitry Torokhov wrote:
> > On Sun, Jun 06, 2021 at 12:37:43PM +0800, kernel test robot wrote:
> >> Hi Jeff,
> >>
> >> FYI, the error/warning still remains.
> > 
> > I have no idea how it happens... 
> > 
> >>> 1645	static int iqs626_probe(struct i2c_client *client)
> >>   1646	{
> >>   1647		struct iqs626_ver_info ver_info;
> > 
> > This is 4 bytes.
> > 
> >>   1648		struct iqs626_private *iqs626;
> > 
> > This is 4 or 8.
> > 
> >>   1649		int error;
> > 
> > And another 4. And that is it. The bloat must be coming from elsewhere.
> 
> In my experience, this stack usage comes from a compiler deciding to
> inline some called function(s) that has(have) more stack usage...

Right, however from the driver's perspective there is nothing that can
be done here.

> 
> Aha, I see that Paul just referred another stack frame size report to
> a commit that uses 'noinline' for some called function(s):
> 
> https://lore.kernel.org/lkml/20210606044926.GJ4397@paulmck-ThinkPad-P17-Gen-1/T/#m4a6ab160a5d9d974cf9ac524836a6292d73128e2
> 
> 
> >>   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	
> > 
> > Thanks.
> > 
> 
> 
> -- 
> ~Randy
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/input/misc/iqs626a.c:1645:12: warning: stack frame size of 2560 bytes in function 'iqs626_probe'
@ 2021-06-06  4:58       ` Dmitry Torokhov
  0 siblings, 0 replies; 10+ messages in thread
From: Dmitry Torokhov @ 2021-06-06  4:58 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3565 bytes --]

On Sat, Jun 05, 2021 at 09:55:14PM -0700, Randy Dunlap wrote:
> On 6/5/21 9:43 PM, Dmitry Torokhov wrote:
> > On Sun, Jun 06, 2021 at 12:37:43PM +0800, kernel test robot wrote:
> >> Hi Jeff,
> >>
> >> FYI, the error/warning still remains.
> > 
> > I have no idea how it happens... 
> > 
> >>> 1645	static int iqs626_probe(struct i2c_client *client)
> >>   1646	{
> >>   1647		struct iqs626_ver_info ver_info;
> > 
> > This is 4 bytes.
> > 
> >>   1648		struct iqs626_private *iqs626;
> > 
> > This is 4 or 8.
> > 
> >>   1649		int error;
> > 
> > And another 4. And that is it. The bloat must be coming from elsewhere.
> 
> In my experience, this stack usage comes from a compiler deciding to
> inline some called function(s) that has(have) more stack usage...

Right, however from the driver's perspective there is nothing that can
be done here.

> 
> Aha, I see that Paul just referred another stack frame size report to
> a commit that uses 'noinline' for some called function(s):
> 
> https://lore.kernel.org/lkml/20210606044926.GJ4397(a)paulmck-ThinkPad-P17-Gen-1/T/#m4a6ab160a5d9d974cf9ac524836a6292d73128e2
> 
> 
> >>   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	
> > 
> > Thanks.
> > 
> 
> 
> -- 
> ~Randy
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/input/misc/iqs626a.c:1645:12: warning: stack frame size of 2560 bytes in function 'iqs626_probe'
  2021-06-06  4:43   ` Dmitry Torokhov
@ 2021-06-06  5:04     ` Jeff LaBundy
  -1 siblings, 0 replies; 10+ messages in thread
From: Jeff LaBundy @ 2021-06-06  5:04 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: kernel test robot, kbuild-all, clang-built-linux, linux-kernel

Hi Dmitry,

On Sat, Jun 05, 2021 at 09:43:46PM -0700, Dmitry Torokhov wrote:
> On Sun, Jun 06, 2021 at 12:37:43PM +0800, kernel test robot wrote:
> > Hi Jeff,
> > 
> > FYI, the error/warning still remains.
> 
> I have no idea how it happens... 
> 
> > > 1645	static int iqs626_probe(struct i2c_client *client)
> >   1646	{
> >   1647		struct iqs626_ver_info ver_info;
> 
> This is 4 bytes.
> 
> >   1648		struct iqs626_private *iqs626;
> 
> This is 4 or 8.
> 
> >   1649		int error;
> 
> And another 4. And that is it. The bloat must be coming from elsewhere.

Agreed; in fact I am suspicious if this is part of some fallout from a recent
change in Clang. There seems to be a smattering of similar warnings as in [1]
which are preceded by the same warning about __lwsync().

I see there is a patch [2] to address the issue with __lwsync(); perhaps this
is related.

[1] https://lkml.org/lkml/2021/6/6/7
[2] https://lkml.org/lkml/2021/5/28/690

> 
> >   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	
> 
> Thanks.
> 
> -- 
> Dmitry

Kind regards,
Jeff LaBundy

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: drivers/input/misc/iqs626a.c:1645:12: warning: stack frame size of 2560 bytes in function 'iqs626_probe'
@ 2021-06-06  5:04     ` Jeff LaBundy
  0 siblings, 0 replies; 10+ messages in thread
From: Jeff LaBundy @ 2021-06-06  5:04 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3327 bytes --]

Hi Dmitry,

On Sat, Jun 05, 2021 at 09:43:46PM -0700, Dmitry Torokhov wrote:
> On Sun, Jun 06, 2021 at 12:37:43PM +0800, kernel test robot wrote:
> > Hi Jeff,
> > 
> > FYI, the error/warning still remains.
> 
> I have no idea how it happens... 
> 
> > > 1645	static int iqs626_probe(struct i2c_client *client)
> >   1646	{
> >   1647		struct iqs626_ver_info ver_info;
> 
> This is 4 bytes.
> 
> >   1648		struct iqs626_private *iqs626;
> 
> This is 4 or 8.
> 
> >   1649		int error;
> 
> And another 4. And that is it. The bloat must be coming from elsewhere.

Agreed; in fact I am suspicious if this is part of some fallout from a recent
change in Clang. There seems to be a smattering of similar warnings as in [1]
which are preceded by the same warning about __lwsync().

I see there is a patch [2] to address the issue with __lwsync(); perhaps this
is related.

[1] https://lkml.org/lkml/2021/6/6/7
[2] https://lkml.org/lkml/2021/5/28/690

> 
> >   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	
> 
> Thanks.
> 
> -- 
> Dmitry

Kind regards,
Jeff LaBundy

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-06-06  5:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-06  4:37 drivers/input/misc/iqs626a.c:1645:12: warning: stack frame size of 2560 bytes in function 'iqs626_probe' kernel test robot
2021-06-06  4:37 ` kernel test robot
2021-06-06  4:43 ` Dmitry Torokhov
2021-06-06  4:43   ` Dmitry Torokhov
2021-06-06  4:55   ` Randy Dunlap
2021-06-06  4:55     ` Randy Dunlap
2021-06-06  4:58     ` Dmitry Torokhov
2021-06-06  4:58       ` Dmitry Torokhov
2021-06-06  5:04   ` Jeff LaBundy
2021-06-06  5:04     ` Jeff LaBundy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.