diff mbox

[PATCHv3,1/5] mips/pci: Reduce stack frame usage

Message ID 1475007815-28354-2-git-send-email-keith.busch@intel.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Keith Busch Sept. 27, 2016, 8:23 p.m. UTC
The struct pci_dev is too large to allocate on the stack. This patch
removes the fake pci device in early config access and instead uses the
pci bus to get the same functionality.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Ralf Baechle <ralf@linux-mips.org>
---
Got the 'ok' (link below), but I don't see this is merged yet. That's
okay, since I need to include it in this series to avoid 0'day build
failure. If this is ok with everyone, perhaps this can go through 'pci'.

  https://www.linux-mips.org/archives/linux-mips/2016-09/msg00255.html

 arch/mips/txx9/generic/pci.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Atsushi Nemoto Sept. 28, 2016, 1:43 p.m. UTC | #1
On Tue, 27 Sep 2016 16:23:31 -0400, Keith Busch <keith.busch@intel.com> wrote:
> The struct pci_dev is too large to allocate on the stack. This patch
> removes the fake pci device in early config access and instead uses the
> pci bus to get the same functionality.
> 
> Signed-off-by: Keith Busch <keith.busch@intel.com>
> Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> ---
> Got the 'ok' (link below), but I don't see this is merged yet. That's
> okay, since I need to include it in this series to avoid 0'day build
> failure. If this is ok with everyone, perhaps this can go through 'pci'.
> 
>   https://www.linux-mips.org/archives/linux-mips/2016-09/msg00255.html

Sorry, I had missed the patch.  Looks good.  Thank you.

Reviewed-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

---
Atsushi Nemoto
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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,