• Yinghai Lu's avatar
    sparc/PCI: Add mem64 resource parsing for root bus · 0be16cc3
    Yinghai Lu authored
    commit af86fa40 upstream.
    
    David reported that a T5-8 sparc system failed to boot with:
    
      pci_sun4v f02dbcfc: PCI host bridge to bus 0000:00
      pci_bus 0000:00: root bus resource [io  0x804000000000-0x80400fffffff] (bus address [0x0000-0xfffffff])
      pci_bus 0000:00: root bus resource [mem 0x800000000000-0x80007effffff] (bus address [0x00000000-0x7effffff])
      pci 0000:00:01.0: can't claim BAR 15 [mem 0x100000000-0x4afffffff pref]: no compatible bridge window
    
    Note that we don't know about a host bridge aperture that contains
    BAR 15.  OF does report a MEM64 aperture, but before this patch,
    pci_determine_mem_io_space() ignored it.
    
    Add support for host bridge apertures with 64-bit PCI addresses.  Also
    set IORESOURCE_MEM_64 for PCI device and bridge resources in PCI 64-bit
    memory space.
    
    Sparc doesn't actually print the device and bridge resources, but after
    this patch, we should have the equivalent of this:
    
      pci_sun4v f02dbcfc: PCI host bridge to bus 0000:00
      pci_bus 0000:00: root bus resource [io  0x804000000000-0x80400fffffff] (bus address [0x0000-0xfffffff])
      pci_bus 0000:00: root bus resource [mem 0x800000000000-0x80007effffff] (bus address [0x00000000-0x7effffff])
      pci_bus 0000:00: root bus resource [mem 0x800100000000-0x8007ffffffff] (bus address [0x100000000-0x7ffffffff])
      pci 0000:00:01.0:   bridge window [mem 0x800100000000-0x8004afffffff 64bit pref]
    
    [bhelgaas: changelog, URL to David's report]
    Fixes: d63e2e1f ("sparc/PCI: Clip bridge windows to fit in upstream windows")
    Link: http://lkml.kernel.org/r/5514391F.2030300@oracle.comReported-by: default avatarDavid Ahern <david.ahern@oracle.com>
    Tested-by: default avatarDavid Ahern <david.ahern@oracle.com>
    Tested-by: default avatarKhalid Aziz <khalid.aziz@oracle.com>
    Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
    0be16cc3
pci_common.c 13 KB