]> git.itanic.dy.fi Git - linux-stable/commitdiff
staging: mt7621-dts: fix pci address for PCI memory range
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Mon, 14 Jun 2021 10:06:17 +0000 (12:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Jun 2021 13:24:29 +0000 (15:24 +0200)
Driver code call 'devm_of_pci_get_host_bridge_resources'
to get resources and properly fill 'bridge->windows' and
'bridge->dma_ranges'. After parsing the ranges and store
as resources, at the end it makes a call to pci function
'pci_add_resource_offset' to set the offset for the
memory resource. To calculate offset, resource start address
subtracts pci address of the range. MT7621 does not need
any offset for the memory resource. Moreover, setting an
offset got into 'WARN_ON' calls from pci devices driver code.
Until now memory range pci_addr was being '0x00000000' and
res->start is '0x60000000' but becase pci controller driver
was manually setting resources and adding them using pci function
'pci_add_resource' where a zero is passed as offset, things
was properly working. Since PCI_IOBASE is defined now for
ralink we don't set nothing manually anymore so we have to
properly fix PCI address for this range to make things work
and the new pci address must be set to '0x60000000'. Doing
in this way the subtract result obtain zero as offset
and pci device driver code properly works.

Fixes: d59578da2bb8 ("staging: mt7621-dts: add dts files")
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210614100617.28753-4-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/mt7621-dts/mt7621.dtsi

index ecfe2f2cf75ab9ce54611c42cf357ce84d9d0237..f15ea61851b2963d287bef915946927c9b6b001c 100644 (file)
@@ -489,7 +489,7 @@ pcie: pcie@1e140000 {
 
                device_type = "pci";
 
-               ranges = <0x02000000 0 0x00000000 0x60000000 0 0x10000000>, /* pci memory */
+               ranges = <0x02000000 0 0x60000000 0x60000000 0 0x10000000>, /* pci memory */
                         <0x01000000 0 0x00000000 0x1e160000 0 0x00010000>; /* io space */
 
                #interrupt-cells = <1>;