From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: kernel test robot <lkp@intel.com>,
Jeff LaBundy <jeff@labundy.com>,
kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
linux-kernel@vger.kernel.org
Subject: Re: drivers/input/misc/iqs626a.c:1645:12: warning: stack frame size of 2560 bytes in function 'iqs626_probe'
Date: Sat, 5 Jun 2021 21:58:21 -0700 [thread overview]
Message-ID: <YLxV7cyZ5Mh2WoXA@google.com> (raw)
In-Reply-To: <365f58ae-d6c5-c9b3-631b-7e9266e91db5@infradead.org>
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
next prev parent reply other threads:[~2021-06-06 4:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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:43 ` Dmitry Torokhov
2021-06-06 4:55 ` Randy Dunlap
2021-06-06 4:58 ` Dmitry Torokhov [this message]
2021-06-06 5:04 ` Jeff LaBundy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YLxV7cyZ5Mh2WoXA@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=clang-built-linux@googlegroups.com \
--cc=jeff@labundy.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=rdunlap@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).