alistair23-linux/arch/alpha/kernel
Bjorn Helgaas 237865f195 PCI: Revert "PCI: Call pci_read_bridge_bases() from core instead of arch code"
Revert dff22d2054 ("PCI: Call pci_read_bridge_bases() from core instead
of arch code").

Reading PCI bridge windows is not arch-specific in itself, but there is PCI
core code that doesn't work correctly if we read them too early.  For
example, Hannes found this case on an ARM Freescale i.mx6 board:

  pci_bus 0000:00: root bus resource [mem 0x01000000-0x01efffff]
  pci 0000:00:00.0: PCI bridge to [bus 01-ff]
  pci 0000:00:00.0: BAR 8: no space for [mem size 0x01000000] (mem window)
  pci 0000:01:00.0: BAR 2: failed to assign [mem size 0x00200000]
  pci 0000:01:00.0: BAR 1: failed to assign [mem size 0x00004000]
  pci 0000:01:00.0: BAR 0: failed to assign [mem size 0x00000100]

The 00:00.0 mem window needs to be at least 3MB: the 01:00.0 device needs
0x204100 of space, and mem windows are megabyte-aligned.

Bus sizing can increase a bridge window size, but never *decrease* it (see
d65245c329 ("PCI: don't shrink bridge resources")).  Prior to
dff22d2054, ARM didn't read bridge windows at all, so the "original size"
was zero, and we assigned a 3MB window.

After dff22d2054, we read the bridge windows before sizing the bus.  The
firmware programmed a 16MB window (size 0x01000000) in 00:00.0, and since
we never decrease the size, we kept 16MB even though we only needed 3MB.
But 16MB doesn't fit in the host bridge aperture, so we failed to assign
space for the window and the downstream devices.

I think this is a defect in the PCI core: we shouldn't rely on the firmware
to assign sensible windows.

Ray reported a similar problem, also on ARM, with Broadcom iProc.

Issues like this are too hard to fix right now, so revert dff22d2054.

Reported-by: Hannes <oe5hpm@gmail.com>
Reported-by: Ray Jui <rjui@broadcom.com>
Link: http://lkml.kernel.org/r/CAAa04yFQEUJm7Jj1qMT57-LG7ZGtnhNDBe=PpSRa70Mj+XhW-A@mail.gmail.com
Link: http://lkml.kernel.org/r/55F75BB8.4070405@broadcom.com
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
2015-09-15 13:18:04 -05:00
..
.gitignore
alpha_ksyms.c alpha: Eliminate compiler warning from memset macro 2013-11-16 16:33:09 -08:00
asm-offsets.c
audit.c alpha: Enable system-call auditing support. 2014-01-31 09:21:55 -08:00
binfmt_loader.c get rid of pt_regs argument of ->load_binary() 2012-11-28 21:53:38 -05:00
console.c TTY:vt: convert remain take_over_console's users to do_take_over_console 2013-05-20 22:29:27 -07:00
core_apecs.c
core_cia.c
core_irongate.c PCI: Remove unnecessary #includes of <asm/pci.h> 2015-06-08 07:56:09 -05:00
core_lca.c
core_marvel.c
core_mcpcia.c
core_polaris.c
core_t2.c
core_titan.c
core_tsunami.c
core_wildfire.c
entry.S alpha: Enable system-call auditing support. 2014-01-31 09:21:55 -08:00
err_common.c
err_ev6.c alpha: delete non-required instances of <linux/init.h> 2015-05-26 10:01:48 -07:00
err_ev7.c
err_impl.h
err_marvel.c
err_titan.c
es1888.c
gct.c
head.S
io.c
irq.c alpha/irq: Use access helper irq_data_get_affinity_mask() 2015-07-27 13:36:37 +02:00
irq_alpha.c alpha: Use qemu+cserve provided high-res clock and alarm. 2013-11-16 16:33:21 -08:00
irq_i8259.c
irq_impl.h
irq_pyxis.c
irq_srm.c
machvec_impl.h alpha: Reorganize rtc handling 2013-11-16 16:33:16 -08:00
Makefile alpha: Enable system-call auditing support. 2014-01-31 09:21:55 -08:00
module.c
osf_sys.c alpha: Fix jiffies based cputime assumption 2015-07-29 15:44:58 +02:00
pc873xx.c
pc873xx.h
pci-noop.c dma-mapping: consolidate dma_set_mask 2015-09-10 13:29:01 -07:00
pci-sysfs.c PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev 2013-12-21 10:06:10 -07:00
pci.c PCI: Revert "PCI: Call pci_read_bridge_bases() from core instead of arch code" 2015-09-15 13:18:04 -05:00
pci_impl.h
pci_iommu.c dma-mapping: consolidate dma_set_mask 2015-09-10 13:29:01 -07:00
perf_event.c alpha: Replace __get_cpu_var 2014-08-26 13:45:53 -04:00
process.c alpha: copy_thread(): rename 'arg' argument to 'kthread_arg' 2015-05-26 10:01:49 -07:00
proto.h alpha: Use qemu+cserve provided high-res clock and alarm. 2013-11-16 16:33:21 -08:00
ptrace.c ARCH: AUDIT: audit_syscall_entry() should not require the arch 2014-09-23 16:21:26 -04:00
rtc.c alpha, rtc: Change to use rtc_class_ops's set_mmss64() 2015-04-03 08:18:30 +02:00
setup.c alpha: Allow HZ to be configured 2013-11-16 16:33:13 -08:00
signal.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
smc37c93x.c
smc37c669.c alpha: remove mysterious if zero-ed out includes 2012-07-30 17:25:11 -07:00
smp.c smp, alpha: kill SMP single function call interrupt 2015-05-26 10:01:46 -07:00
srm_env.c srm_env: don't bother with pointer to srm_env_t 2013-04-09 14:13:33 -04:00
srmcons.c alpha: don't use module_init for non-modular core code 2015-05-26 10:01:47 -07:00
sys_alcor.c
sys_cabriolet.c
sys_dp264.c alpha: Don't if-out dp264_device_interrupt. 2013-07-19 13:54:26 -07:00
sys_eb64p.c
sys_eiger.c PCI: Remove unnecessary #includes of <asm/pci.h> 2015-06-08 07:56:09 -05:00
sys_jensen.c alpha: Reorganize rtc handling 2013-11-16 16:33:16 -08:00
sys_marvel.c alpha: clean up unnecessary MSI/MSI-X capability find 2015-05-26 10:01:44 -07:00
sys_miata.c
sys_mikasa.c
sys_nautilus.c PCI: Remove unnecessary #includes of <asm/pci.h> 2015-06-08 07:56:09 -05:00
sys_noritake.c
sys_rawhide.c
sys_ruffian.c
sys_rx164.c
sys_sable.c
sys_sio.c
sys_sx164.c
sys_takara.c
sys_titan.c alpha: irq: remove deprecated use of IRQF_DISABLED 2013-04-07 12:59:30 -07:00
sys_wildfire.c
systbls.S alpha: Wire up all missing implemented syscalls 2015-05-26 10:01:50 -07:00
time.c alpha/time: Migrate to new 'set-state' interface 2015-08-10 11:40:58 +02:00
traps.c alpha: delete non-required instances of <linux/init.h> 2015-05-26 10:01:48 -07:00
vmlinux.lds.S