summaryrefslogtreecommitdiff
path: root/arch/arm/mach-u300
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2015-10-07 23:05:49 +0300
committerArnd Bergmann <arnd@arndb.de>2015-10-08 17:32:48 +0300
commit498a92d42596a7a32c042319eb62a4c3d8081cf1 (patch)
treefa0a3daef1c40033e224400de2a9ef4d9bc54ed9 /arch/arm/mach-u300
parent049e6dde7e57f0054fdc49102e7ef4830c698b46 (diff)
downloadlinux-498a92d42596a7a32c042319eb62a4c3d8081cf1.tar.xz
ARM: cns3xxx: pci: avoid potential stack overflow
The cns3xxx_pcie_hw_init function uses excessive kernel stack space because of a hack that puts a fake struct pci_sys_data and struct pci_bus on the stack in order to call the generic pci_bus_read_config accessors, which causes a warning in ARM allmodconfig builds: arch/arm/mach-cns3xxx/pcie.c:266:1: warning: the frame size of 1080 bytes is larger than 1024 bytes I've spent a few hours trying to find out what exactly this code is wants to achieve here. The obvious part is setting up the host_regs using config space accessors, and this can simply be changed to use direct MMIO accesses, as I do in this patch. The second part is how the driver sets up the Max_Read_Request_Size value for the first device/function on bus 1, i.e. the device plugged directly into the PCIe root port. For all I can tell, this is in fact incomplete, as it does not perform the same setting on devices attached to a PCIe switch, or multi-function devices. The solution for this part fortunately is even easier: if we just set the global pcie_bus_config variable to PCIE_BUS_PEER2PEER, all PCIe devices in the system are limited to 128 byte MPS, which in turn limits the MRRS to 128 bytes for all devices, and we no longer even need to touch any devices. With those two changes in place, we no longer need the fake pci_sys_data/pci_bus structures for faking config space writes, and the stack usage goes down as well. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Krzysztof Halasa <khalasa@piap.pl>
Diffstat (limited to 'arch/arm/mach-u300')
0 files changed, 0 insertions, 0 deletions