From: Keith Busch <keith.busch@intel.com>
To: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@01.org, linux-pci@vger.kernel.org,
Bjorn Helgaas <bhelgaas@google.com>,
Jon Derrick <jonathan.derrick@intel.com>,
Wei Zhang <wzhang@fb.com>
Subject: Re: [PATCHv2 2/4] pci: No config access for removed devices
Date: Wed, 7 Sep 2016 12:28:59 -0400 [thread overview]
Message-ID: <20160907162859.GA28381@localhost.localdomain> (raw)
In-Reply-To: <201609072050.VbWFO505%fengguang.wu@intel.com>
On Wed, Sep 07, 2016 at 08:03:32PM +0800, kbuild test robot wrote:
> All errors (new ones prefixed by >>):
>
> arch/mips/txx9/generic/pci.c: In function 'early_read_config_word':
> >> arch/mips/txx9/generic/pci.c:49:1: error: the frame size of 1528 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
> }
> ^
>
> cc1: all warnings being treated as errors
>
> vim +49 arch/mips/txx9/generic/pci.c
>
> 89d63fe1 Atsushi Nemoto 2008-07-11 33 struct pci_bus fake_bus;
> 89d63fe1 Atsushi Nemoto 2008-07-11 34
> 89d63fe1 Atsushi Nemoto 2008-07-11 35 fake_dev.bus = &fake_bus;
> 89d63fe1 Atsushi Nemoto 2008-07-11 36 fake_dev.sysdata = hose;
> 89d63fe1 Atsushi Nemoto 2008-07-11 37 fake_dev.devfn = devfn;
> 89d63fe1 Atsushi Nemoto 2008-07-11 38 fake_bus.number = bus;
> 89d63fe1 Atsushi Nemoto 2008-07-11 39 fake_bus.sysdata = hose;
> 89d63fe1 Atsushi Nemoto 2008-07-11 40 fake_bus.ops = hose->pci_ops;
> 89d63fe1 Atsushi Nemoto 2008-07-11 41
> 89d63fe1 Atsushi Nemoto 2008-07-11 42 if (bus != top_bus)
> 89d63fe1 Atsushi Nemoto 2008-07-11 43 /* Fake a parent bus structure. */
> 89d63fe1 Atsushi Nemoto 2008-07-11 44 fake_bus.parent = &fake_bus;
> 89d63fe1 Atsushi Nemoto 2008-07-11 45 else
> 89d63fe1 Atsushi Nemoto 2008-07-11 46 fake_bus.parent = NULL;
> 89d63fe1 Atsushi Nemoto 2008-07-11 47
> 89d63fe1 Atsushi Nemoto 2008-07-11 48 return pci_read_config_word(&fake_dev, offset, value);
> 89d63fe1 Atsushi Nemoto 2008-07-11 @49 }
Hmm, why is this function allocating such large structures on the
stack? It looks like the size of struct pci_dev and struct pci_bus
already exceeded 1024 bytes.
I have no hardware to test this, but it looks to me there is no reason to
have struct pci_dev and the following should save quite a bite of space:
---
diff --git a/arch/mips/txx9/generic/pci.c b/arch/mips/txx9/generic/pci.c
index 1f6bc9a..285d84e 100644
--- a/arch/mips/txx9/generic/pci.c
+++ b/arch/mips/txx9/generic/pci.c
@@ -29,12 +29,8 @@ static int __init
early_read_config_word(struct pci_controller *hose,
int top_bus, int bus, int devfn, int offset, u16 *value)
{
- struct pci_dev fake_dev;
struct pci_bus fake_bus;
- fake_dev.bus = &fake_bus;
- fake_dev.sysdata = hose;
- fake_dev.devfn = devfn;
fake_bus.number = bus;
fake_bus.sysdata = hose;
fake_bus.ops = hose->pci_ops;
@@ -45,7 +41,7 @@ early_read_config_word(struct pci_controller *hose,
else
fake_bus.parent = NULL;
- return pci_read_config_word(&fake_dev, offset, value);
+ return pci_bus_read_config_word(&fake_bus, devfn, offset, value);
}
int __init txx9_pci66_check(struct pci_controller *hose, int top_bus,
--
next prev parent reply other threads:[~2016-09-07 16:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-06 22:00 [PATCHv2 0/4] Limiting pci access requsets Keith Busch
2016-09-06 22:00 ` [PATCHv2 1/4] pci: Add is_removed state Keith Busch
2016-09-07 11:14 ` Lukas Wunner
2016-09-17 8:35 ` Lukas Wunner
2016-09-19 17:47 ` Keith Busch
2016-09-06 22:00 ` [PATCHv2 2/4] pci: No config access for removed devices Keith Busch
2016-09-07 12:03 ` kbuild test robot
2016-09-07 16:28 ` Keith Busch [this message]
2016-09-06 22:00 ` [PATCHv2 3/4] pcie/aer: Cache capability position Keith Busch
2016-09-07 11:30 ` Lukas Wunner
2016-09-13 22:07 ` Bjorn Helgaas
2016-09-06 22:00 ` [PATCHv2 4/4] pci/msix: Skip disabling removed devices Keith Busch
2016-09-07 13:28 ` [PATCHv2 0/4] Limiting pci access requsets Lukas Wunner
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=20160907162859.GA28381@localhost.localdomain \
--to=keith.busch@intel.com \
--cc=bhelgaas@google.com \
--cc=jonathan.derrick@intel.com \
--cc=kbuild-all@01.org \
--cc=linux-pci@vger.kernel.org \
--cc=lkp@intel.com \
--cc=wzhang@fb.com \
/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 NNTP newsgroup(s).