* [PATCH] mips/pci: Reduce stack frame usage
@ 2016-09-13 15:21 Keith Busch
2016-09-19 14:20 ` Ralf Baechle
0 siblings, 1 reply; 2+ messages in thread
From: Keith Busch @ 2016-09-13 15:21 UTC (permalink / raw)
To: Ralf Baechle, linux-mips; +Cc: Keith Busch
This patch removes creating a fake pci device in MIPS early config
access and instead just uses the pci bus to get the same functionality.
The struct pci_dev is too large to allocate on the stack, and was relying
on compiler optimizations to remove its usage.
Signed-off-by: Keith Busch <keith.busch@intel.com>
---
While I don't have any hardware to test this, the change should be
exactly the same as before, taking the direct route to the config read
instead of letting the compiler optimize this.
This patch is preparing to add surprise removed device handling to the
pci_read_config_*, which makes the compiler optimization that currently
removes the excessive stack usage impossible.
arch/mips/txx9/generic/pci.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
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,
--
2.7.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] mips/pci: Reduce stack frame usage
2016-09-13 15:21 [PATCH] mips/pci: Reduce stack frame usage Keith Busch
@ 2016-09-19 14:20 ` Ralf Baechle
0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2016-09-19 14:20 UTC (permalink / raw)
To: Keith Busch; +Cc: linux-mips, Atsushi Nemoto
On Tue, Sep 13, 2016 at 09:21:47AM -0600, Keith Busch wrote:
> This patch removes creating a fake pci device in MIPS early config
> access and instead just uses the pci bus to get the same functionality.
> The struct pci_dev is too large to allocate on the stack, and was relying
> on compiler optimizations to remove its usage.
>
> Signed-off-by: Keith Busch <keith.busch@intel.com>
> ---
>
> While I don't have any hardware to test this, the change should be
> exactly the same as before, taking the direct route to the config read
> instead of letting the compiler optimize this.
>
> This patch is preparing to add surprise removed device handling to the
> pci_read_config_*, which makes the compiler optimization that currently
> removes the excessive stack usage impossible.
Looks ok so I've applied it. Atsushi?
Ralf
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-19 14:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-13 15:21 [PATCH] mips/pci: Reduce stack frame usage Keith Busch
2016-09-19 14:20 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox