From 301c7ed52263b5e3f93ea22d064291cb38f741cd Mon Sep 17 00:00:00 2001 From: Sergio Paracuellos Date: Mon, 23 Nov 2020 10:36:33 +0100 Subject: [PATCH] staging: mt7621-pci: add comment to clarify IO resource in this driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Because IO_SPACE_LIMIT for mips is 0xFFFF but this platform uses PĈI IO resource at 0x001e160000. Hence instead of directly use some more accurate functions from the PCI kernel for this driver some things must be done in a different way to make things work. Add this explanation as a comment where the IO resource is parsed and virtually mapped into memory. Signed-off-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20201123093637.8300-4-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/mt7621-pci/pci-mt7621.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index 219b359372858..1f9e75db52981 100644 --- a/drivers/staging/mt7621-pci/pci-mt7621.c +++ b/drivers/staging/mt7621-pci/pci-mt7621.c @@ -298,6 +298,13 @@ static int mt7621_pci_parse_request_of_pci_ranges(struct mt7621_pcie *pcie) return -EINVAL; } + /* + * IO_SPACE_LIMIT for MIPS is 0xffff but this platform uses IO at + * upper address 0x001e160000 so we have to get the resource from + * the DT because when it has been requested it failed and has been + * removed from bridge->dma_ranges and bridge->windows. So parse it + * and remap it manually to make things work. + */ for_each_of_pci_range(&parser, &range) { switch (range.flags & IORESOURCE_TYPE_BITS) { case IORESOURCE_IO: -- 2.30.2