Commit 6d5f6a0e authored by Kim Phillips's avatar Kim Phillips Committed by Scott Wood

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: default avatarKim Phillips <kim.phillips@freescale.com>
Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
parent 31494cf3
...@@ -119,6 +119,10 @@ extern void setup_indirect_pci(struct pci_controller* hose, ...@@ -119,6 +119,10 @@ extern void setup_indirect_pci(struct pci_controller* hose,
extern int indirect_read_config(struct pci_bus *bus, unsigned int devfn, extern int indirect_read_config(struct pci_bus *bus, unsigned int devfn,
int offset, int len, u32 *val); int offset, int len, u32 *val);
extern int __indirect_read_config(struct pci_controller *hose,
unsigned char bus_number, unsigned int devfn,
int offset, int len, u32 *val);
extern int indirect_write_config(struct pci_bus *bus, unsigned int devfn, extern int indirect_write_config(struct pci_bus *bus, unsigned int devfn,
int offset, int len, u32 val); int offset, int len, u32 val);
......
...@@ -68,13 +68,10 @@ static int fsl_pcie_check_link(struct pci_controller *hose) ...@@ -68,13 +68,10 @@ static int fsl_pcie_check_link(struct pci_controller *hose)
u32 val = 0; u32 val = 0;
if (hose->indirect_type & PPC_INDIRECT_TYPE_FSL_CFG_REG_LINK) { if (hose->indirect_type & PPC_INDIRECT_TYPE_FSL_CFG_REG_LINK) {
if (hose->ops->read == fsl_indirect_read_config) { if (hose->ops->read == fsl_indirect_read_config)
struct pci_bus bus; __indirect_read_config(hose, hose->first_busno, 0,
bus.number = hose->first_busno; PCIE_LTSSM, 4, &val);
bus.sysdata = hose; else
bus.ops = hose->ops;
indirect_read_config(&bus, 0, PCIE_LTSSM, 4, &val);
} else
early_read_config_dword(hose, 0, 0, PCIE_LTSSM, &val); early_read_config_dword(hose, 0, 0, PCIE_LTSSM, &val);
if (val < PCIE_LTSSM_L0) if (val < PCIE_LTSSM_L0)
return 1; return 1;
......
...@@ -20,31 +20,31 @@ ...@@ -20,31 +20,31 @@
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
#include <asm/machdep.h> #include <asm/machdep.h>
int indirect_read_config(struct pci_bus *bus, unsigned int devfn, int __indirect_read_config(struct pci_controller *hose,
unsigned char bus_number, unsigned int devfn,
int offset, int len, u32 *val) int offset, int len, u32 *val)
{ {
struct pci_controller *hose = pci_bus_to_host(bus);
volatile void __iomem *cfg_data; volatile void __iomem *cfg_data;
u8 cfg_type = 0; u8 cfg_type = 0;
u32 bus_no, reg; u32 bus_no, reg;
if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK) { if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK) {
if (bus->number != hose->first_busno) if (bus_number != hose->first_busno)
return PCIBIOS_DEVICE_NOT_FOUND; return PCIBIOS_DEVICE_NOT_FOUND;
if (devfn != 0) if (devfn != 0)
return PCIBIOS_DEVICE_NOT_FOUND; return PCIBIOS_DEVICE_NOT_FOUND;
} }
if (ppc_md.pci_exclude_device) if (ppc_md.pci_exclude_device)
if (ppc_md.pci_exclude_device(hose, bus->number, devfn)) if (ppc_md.pci_exclude_device(hose, bus_number, devfn))
return PCIBIOS_DEVICE_NOT_FOUND; return PCIBIOS_DEVICE_NOT_FOUND;
if (hose->indirect_type & PPC_INDIRECT_TYPE_SET_CFG_TYPE) if (hose->indirect_type & PPC_INDIRECT_TYPE_SET_CFG_TYPE)
if (bus->number != hose->first_busno) if (bus_number != hose->first_busno)
cfg_type = 1; cfg_type = 1;
bus_no = (bus->number == hose->first_busno) ? bus_no = (bus_number == hose->first_busno) ?
hose->self_busno : bus->number; hose->self_busno : bus_number;
if (hose->indirect_type & PPC_INDIRECT_TYPE_EXT_REG) if (hose->indirect_type & PPC_INDIRECT_TYPE_EXT_REG)
reg = ((offset & 0xf00) << 16) | (offset & 0xfc); reg = ((offset & 0xf00) << 16) | (offset & 0xfc);
...@@ -77,6 +77,15 @@ int indirect_read_config(struct pci_bus *bus, unsigned int devfn, ...@@ -77,6 +77,15 @@ int indirect_read_config(struct pci_bus *bus, unsigned int devfn,
return PCIBIOS_SUCCESSFUL; return PCIBIOS_SUCCESSFUL;
} }
int indirect_read_config(struct pci_bus *bus, unsigned int devfn,
int offset, int len, u32 *val)
{
struct pci_controller *hose = pci_bus_to_host(bus);
return __indirect_read_config(hose, bus->number, devfn, offset, len,
val);
}
int indirect_write_config(struct pci_bus *bus, unsigned int devfn, int indirect_write_config(struct pci_bus *bus, unsigned int devfn,
int offset, int len, u32 val) int offset, int len, u32 val)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment