Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/fsl_pci: Fix pci stack build bug with FRAME_WARN

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 refactoring indirect_read_config()
to take hose and bus number instead of the 1344-byte struct pci_bus.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>

authored by

Kim Phillips and committed by
Scott Wood
6d5f6a0e 31494cf3

+25 -15
+4
arch/powerpc/include/asm/pci-bridge.h
··· 119 119 extern int indirect_read_config(struct pci_bus *bus, unsigned int devfn, 120 120 int offset, int len, u32 *val); 121 121 122 + extern int __indirect_read_config(struct pci_controller *hose, 123 + unsigned char bus_number, unsigned int devfn, 124 + int offset, int len, u32 *val); 125 + 122 126 extern int indirect_write_config(struct pci_bus *bus, unsigned int devfn, 123 127 int offset, int len, u32 val); 124 128
+4 -7
arch/powerpc/sysdev/fsl_pci.c
··· 68 68 u32 val = 0; 69 69 70 70 if (hose->indirect_type & PPC_INDIRECT_TYPE_FSL_CFG_REG_LINK) { 71 - if (hose->ops->read == fsl_indirect_read_config) { 72 - struct pci_bus bus; 73 - bus.number = hose->first_busno; 74 - bus.sysdata = hose; 75 - bus.ops = hose->ops; 76 - indirect_read_config(&bus, 0, PCIE_LTSSM, 4, &val); 77 - } else 71 + if (hose->ops->read == fsl_indirect_read_config) 72 + __indirect_read_config(hose, hose->first_busno, 0, 73 + PCIE_LTSSM, 4, &val); 74 + else 78 75 early_read_config_dword(hose, 0, 0, PCIE_LTSSM, &val); 79 76 if (val < PCIE_LTSSM_L0) 80 77 return 1;
+17 -8
arch/powerpc/sysdev/indirect_pci.c
··· 20 20 #include <asm/pci-bridge.h> 21 21 #include <asm/machdep.h> 22 22 23 - int indirect_read_config(struct pci_bus *bus, unsigned int devfn, 24 - int offset, int len, u32 *val) 23 + int __indirect_read_config(struct pci_controller *hose, 24 + unsigned char bus_number, unsigned int devfn, 25 + int offset, int len, u32 *val) 25 26 { 26 - struct pci_controller *hose = pci_bus_to_host(bus); 27 27 volatile void __iomem *cfg_data; 28 28 u8 cfg_type = 0; 29 29 u32 bus_no, reg; 30 30 31 31 if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK) { 32 - if (bus->number != hose->first_busno) 32 + if (bus_number != hose->first_busno) 33 33 return PCIBIOS_DEVICE_NOT_FOUND; 34 34 if (devfn != 0) 35 35 return PCIBIOS_DEVICE_NOT_FOUND; 36 36 } 37 37 38 38 if (ppc_md.pci_exclude_device) 39 - if (ppc_md.pci_exclude_device(hose, bus->number, devfn)) 39 + if (ppc_md.pci_exclude_device(hose, bus_number, devfn)) 40 40 return PCIBIOS_DEVICE_NOT_FOUND; 41 41 42 42 if (hose->indirect_type & PPC_INDIRECT_TYPE_SET_CFG_TYPE) 43 - if (bus->number != hose->first_busno) 43 + if (bus_number != hose->first_busno) 44 44 cfg_type = 1; 45 45 46 - bus_no = (bus->number == hose->first_busno) ? 47 - hose->self_busno : bus->number; 46 + bus_no = (bus_number == hose->first_busno) ? 47 + hose->self_busno : bus_number; 48 48 49 49 if (hose->indirect_type & PPC_INDIRECT_TYPE_EXT_REG) 50 50 reg = ((offset & 0xf00) << 16) | (offset & 0xfc); ··· 75 75 break; 76 76 } 77 77 return PCIBIOS_SUCCESSFUL; 78 + } 79 + 80 + int indirect_read_config(struct pci_bus *bus, unsigned int devfn, 81 + int offset, int len, u32 *val) 82 + { 83 + struct pci_controller *hose = pci_bus_to_host(bus); 84 + 85 + return __indirect_read_config(hose, bus->number, devfn, offset, len, 86 + val); 78 87 } 79 88 80 89 int indirect_write_config(struct pci_bus *bus, unsigned int devfn,