Re: [PATCH v10 02/59] sparc/PCI: Use correct bus address to resource offset

From: David Miller
Date: Thu Mar 10 2016 - 14:48:03 EST

From: Bjorn Helgaas <helgaas@xxxxxxxxxx>
Date: Thu, 10 Mar 2016 12:24:40 -0600

> Hi Yinghai,
> On Wed, Feb 24, 2016 at 06:11:53PM -0800, Yinghai Lu wrote:
>> After we add 64bit mmio parsing, we got some "no compatible bridge window"
>> warning on anther new model that support 64bit resource.
>> It turns out that we can not use mem_space.start as 64bit mem space
>> offset, aka there is mem_space.start != offset.
>> Use child_phys_addr to calculate exact offset and record offset in
>> pbm.
>> After patch we get correct offset.
>> /pci@305: PCI IO [io 0x2007e00000000-0x2007e0fffffff] offset 2007e00000000
>> /pci@305: PCI MEM [mem 0x2000000100000-0x200007effffff] offset 2000000000000
>> /pci@305: PCI MEM64 [mem 0x2000100000000-0x2000dffffffff] offset 2000000000000
>> ...
>> pci_sun4v f02ae7f8: PCI host bridge to bus 0000:00
>> pci_bus 0000:00: root bus resource [io 0x2007e00000000-0x2007e0fffffff] (bus address [0x0000-0xfffffff])
> Just double-checking that your ioport space really contains 256M ports.
> It's fine if it does; it's just a little unusual.

It should be 16MB, but we trust the OF properties in the 'pci' device
node to determine these ranges and the above must be what it is
advertising there.