linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/fsl_pci: Fix pci stack build bug with FRAME_WARN
@ 2015-01-20 20:03 Kim Phillips
  2015-01-21  0:31 ` Scott Wood
  0 siblings, 1 reply; 7+ messages in thread
From: Kim Phillips @ 2015-01-20 20:03 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Scott Wood, Wang Dongsheng, Anton Blanchard, Himangi Saraogi,
	Aaron Sierra
  Cc: linuxppc-dev, linux-kernel

Fix this:

  CC      arch/powerpc/sysdev/fsl_pci.o
arch/powerpc/sysdev/fsl_pci.c: In function 'fsl_pcie_check_link':
arch/powerpc/sysdev/fsl_pci.c:91:1: error: the frame size of 1360 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

when configuring FRAME_WARN, by converting the allocation from the
stack to the heap.  We use GFP_ATOMIC since this function can be
called with interrupts disabled.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
 arch/powerpc/sysdev/fsl_pci.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 6455c1e..635d743 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -69,11 +69,13 @@ static int fsl_pcie_check_link(struct pci_controller *hose)
 
 	if (hose->indirect_type & PPC_INDIRECT_TYPE_FSL_CFG_REG_LINK) {
 		if (hose->ops->read == fsl_indirect_read_config) {
-			struct pci_bus bus;
-			bus.number = hose->first_busno;
-			bus.sysdata = hose;
-			bus.ops = hose->ops;
-			indirect_read_config(&bus, 0, PCIE_LTSSM, 4, &val);
+			struct pci_bus *bus;
+			bus = kmalloc(sizeof(*bus), GFP_ATOMIC);
+			bus->number = hose->first_busno;
+			bus->sysdata = hose;
+			bus->ops = hose->ops;
+			indirect_read_config(bus, 0, PCIE_LTSSM, 4, &val);
+			kfree(bus);
 		} else
 			early_read_config_dword(hose, 0, 0, PCIE_LTSSM, &val);
 		if (val < PCIE_LTSSM_L0)
-- 
2.2.2

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

end of thread, other threads:[~2015-01-23  1:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-20 20:03 [PATCH] powerpc/fsl_pci: Fix pci stack build bug with FRAME_WARN Kim Phillips
2015-01-21  0:31 ` Scott Wood
2015-01-22  2:48   ` Kim Phillips
2015-01-22  3:02     ` Scott Wood
2015-01-23  0:20       ` Kim Phillips
2015-01-23  0:43         ` Scott Wood
2015-01-23  1:05           ` [PATCH v2] " Kim Phillips

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