From: Bjorn Helgaas <bhelgaas@google.com> To: Liviu Dudau <Liviu.Dudau@arm.com> Cc: Catalin Marinas <Catalin.Marinas@arm.com>, Will Deacon <Will.Deacon@arm.com>, Benjamin Herrenschmidt <benh@kernel.crashing.org>, Arnd Bergmann <arnd@arndb.de>, Russell King <linux@arm.linux.org.uk>, Tanmay Inamdar <tinamdar@apm.com>, Grant Likely <grant.likely@secretlab.ca>, Sinan Kaya <okaya@codeaurora.org>, Jingoo Han <jg1.han@samsung.com>, Kukjin Kim <kgene.kim@samsung.com>, Suravee Suthikulanit <suravee.suthikulpanit@amd.com>, linux-pci <linux-pci@vger.kernel.org>, linux-arch <linux-arch@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>, Device Tree ML <devicetree@vger.kernel.org>, LAKML <linux-arm-kernel@lists.infradead.org>, Linus Walleij <linus.walleij@linaro.org> Subject: Re: [PATCH v9 06/12] ARM: integrator: Correct usage of of_pci_range_to_resource() Date: Fri, 5 Sep 2014 16:08:20 -0600 [thread overview] Message-ID: <20140905220820.GI8080@google.com> (raw) In-Reply-To: <1407860725-25202-7-git-send-email-Liviu.Dudau@arm.com> [+cc Linus] On Tue, Aug 12, 2014 at 05:25:19PM +0100, Liviu Dudau wrote: > Previously, of_pci_range_to_resource() would return a resource > that contained physical addresses of the IO space even if the > IORESOURCE_IO flags mandate a logical port set of values. Now > that the function has been fixed we need to update the drivers > that were taking advantage of the old behaviour. > > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Arnd Bergmann <arnd@arndb.de> > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Russell King <linux@arm.linux.org.uk> > Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com> Something's wrong with the CC: list. You list Linus here in the changelog, but I don't see him in the CC: headers. > --- > arch/arm/mach-integrator/pci_v3.c | 24 +++++++++++++----------- > 1 file changed, 13 insertions(+), 11 deletions(-) > > diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c > index 05e1f73..193b7f8 100644 > --- a/arch/arm/mach-integrator/pci_v3.c > +++ b/arch/arm/mach-integrator/pci_v3.c > @@ -660,6 +660,7 @@ static void __init pci_v3_preinit(void) > { > unsigned long flags; > unsigned int temp; > + phys_addr_t io_address = pci_pio_to_address(io_mem.start); > > pcibios_min_mem = 0x00100000; > > @@ -701,7 +702,7 @@ static void __init pci_v3_preinit(void) > /* > * Setup window 2 - PCI IO > */ > - v3_writel(V3_LB_BASE2, v3_addr_to_lb_base2(io_mem.start) | > + v3_writel(V3_LB_BASE2, v3_addr_to_lb_base2(io_address) | > V3_LB_BASE_ENABLE); > v3_writew(V3_LB_MAP2, v3_addr_to_lb_map2(0)); > > @@ -742,6 +743,7 @@ static void __init pci_v3_preinit(void) > static void __init pci_v3_postinit(void) > { > unsigned int pci_cmd; > + phys_addr_t io_address = pci_pio_to_address(io_mem.start); > > pci_cmd = PCI_COMMAND_MEMORY | > PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE; > @@ -758,7 +760,7 @@ static void __init pci_v3_postinit(void) > "interrupt: %d\n", ret); > #endif > > - register_isa_ports(non_mem.start, io_mem.start, 0); > + register_isa_ports(non_mem.start, io_address, 0); > } > > /* > @@ -867,33 +869,33 @@ static int __init pci_v3_probe(struct platform_device *pdev) > > for_each_of_pci_range(&parser, &range) { > if (!range.flags) { > - of_pci_range_to_resource(&range, np, &conf_mem); > + ret = of_pci_range_to_resource(&range, np, &conf_mem); > conf_mem.name = "PCIv3 config"; > } > if (range.flags & IORESOURCE_IO) { > - of_pci_range_to_resource(&range, np, &io_mem); > + ret = of_pci_range_to_resource(&range, np, &io_mem); > + dev_info(&pdev->dev, "IO PCI range converted\n"); > io_mem.name = "PCIv3 I/O"; > } > if ((range.flags & IORESOURCE_MEM) && > !(range.flags & IORESOURCE_PREFETCH)) { > non_mem_pci = range.pci_addr; > non_mem_pci_sz = range.size; > - of_pci_range_to_resource(&range, np, &non_mem); > + ret = of_pci_range_to_resource(&range, np, &non_mem); > non_mem.name = "PCIv3 non-prefetched mem"; > } > if ((range.flags & IORESOURCE_MEM) && > (range.flags & IORESOURCE_PREFETCH)) { > pre_mem_pci = range.pci_addr; > pre_mem_pci_sz = range.size; > - of_pci_range_to_resource(&range, np, &pre_mem); > + ret = of_pci_range_to_resource(&range, np, &pre_mem); > pre_mem.name = "PCIv3 prefetched mem"; > } > - } > > - if (!conf_mem.start || !io_mem.start || > - !non_mem.start || !pre_mem.start) { > - dev_err(&pdev->dev, "missing ranges in device node\n"); > - return -EINVAL; > + if (ret < 0) { > + dev_err(&pdev->dev, "missing ranges in device node\n"); > + return -EINVAL; > + } > } > > pci_v3.map_irq = of_irq_parse_and_map_pci; > -- > 2.0.4 >
WARNING: multiple messages have this Message-ID (diff)
From: bhelgaas@google.com (Bjorn Helgaas) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v9 06/12] ARM: integrator: Correct usage of of_pci_range_to_resource() Date: Fri, 5 Sep 2014 16:08:20 -0600 [thread overview] Message-ID: <20140905220820.GI8080@google.com> (raw) In-Reply-To: <1407860725-25202-7-git-send-email-Liviu.Dudau@arm.com> [+cc Linus] On Tue, Aug 12, 2014 at 05:25:19PM +0100, Liviu Dudau wrote: > Previously, of_pci_range_to_resource() would return a resource > that contained physical addresses of the IO space even if the > IORESOURCE_IO flags mandate a logical port set of values. Now > that the function has been fixed we need to update the drivers > that were taking advantage of the old behaviour. > > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Arnd Bergmann <arnd@arndb.de> > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Russell King <linux@arm.linux.org.uk> > Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com> Something's wrong with the CC: list. You list Linus here in the changelog, but I don't see him in the CC: headers. > --- > arch/arm/mach-integrator/pci_v3.c | 24 +++++++++++++----------- > 1 file changed, 13 insertions(+), 11 deletions(-) > > diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c > index 05e1f73..193b7f8 100644 > --- a/arch/arm/mach-integrator/pci_v3.c > +++ b/arch/arm/mach-integrator/pci_v3.c > @@ -660,6 +660,7 @@ static void __init pci_v3_preinit(void) > { > unsigned long flags; > unsigned int temp; > + phys_addr_t io_address = pci_pio_to_address(io_mem.start); > > pcibios_min_mem = 0x00100000; > > @@ -701,7 +702,7 @@ static void __init pci_v3_preinit(void) > /* > * Setup window 2 - PCI IO > */ > - v3_writel(V3_LB_BASE2, v3_addr_to_lb_base2(io_mem.start) | > + v3_writel(V3_LB_BASE2, v3_addr_to_lb_base2(io_address) | > V3_LB_BASE_ENABLE); > v3_writew(V3_LB_MAP2, v3_addr_to_lb_map2(0)); > > @@ -742,6 +743,7 @@ static void __init pci_v3_preinit(void) > static void __init pci_v3_postinit(void) > { > unsigned int pci_cmd; > + phys_addr_t io_address = pci_pio_to_address(io_mem.start); > > pci_cmd = PCI_COMMAND_MEMORY | > PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE; > @@ -758,7 +760,7 @@ static void __init pci_v3_postinit(void) > "interrupt: %d\n", ret); > #endif > > - register_isa_ports(non_mem.start, io_mem.start, 0); > + register_isa_ports(non_mem.start, io_address, 0); > } > > /* > @@ -867,33 +869,33 @@ static int __init pci_v3_probe(struct platform_device *pdev) > > for_each_of_pci_range(&parser, &range) { > if (!range.flags) { > - of_pci_range_to_resource(&range, np, &conf_mem); > + ret = of_pci_range_to_resource(&range, np, &conf_mem); > conf_mem.name = "PCIv3 config"; > } > if (range.flags & IORESOURCE_IO) { > - of_pci_range_to_resource(&range, np, &io_mem); > + ret = of_pci_range_to_resource(&range, np, &io_mem); > + dev_info(&pdev->dev, "IO PCI range converted\n"); > io_mem.name = "PCIv3 I/O"; > } > if ((range.flags & IORESOURCE_MEM) && > !(range.flags & IORESOURCE_PREFETCH)) { > non_mem_pci = range.pci_addr; > non_mem_pci_sz = range.size; > - of_pci_range_to_resource(&range, np, &non_mem); > + ret = of_pci_range_to_resource(&range, np, &non_mem); > non_mem.name = "PCIv3 non-prefetched mem"; > } > if ((range.flags & IORESOURCE_MEM) && > (range.flags & IORESOURCE_PREFETCH)) { > pre_mem_pci = range.pci_addr; > pre_mem_pci_sz = range.size; > - of_pci_range_to_resource(&range, np, &pre_mem); > + ret = of_pci_range_to_resource(&range, np, &pre_mem); > pre_mem.name = "PCIv3 prefetched mem"; > } > - } > > - if (!conf_mem.start || !io_mem.start || > - !non_mem.start || !pre_mem.start) { > - dev_err(&pdev->dev, "missing ranges in device node\n"); > - return -EINVAL; > + if (ret < 0) { > + dev_err(&pdev->dev, "missing ranges in device node\n"); > + return -EINVAL; > + } > } > > pci_v3.map_irq = of_irq_parse_and_map_pci; > -- > 2.0.4 >
next prev parent reply other threads:[~2014-09-05 22:08 UTC|newest] Thread overview: 112+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-08-12 16:25 [PATCH v9 00/12] Support for creating generic PCI host bridges from DT Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-12 16:25 ` [PATCH v9 01/12] Fix ioport_map() for !CONFIG_GENERIC_IOMAP cases Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-12 16:25 ` [PATCH v9 02/12] PCI: OF: Parse and map the IRQ when adding the PCI device Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-14 14:58 ` Wei Yang 2014-08-14 14:58 ` Wei Yang 2014-08-14 15:49 ` Liviu Dudau 2014-08-14 15:49 ` Liviu Dudau 2014-08-15 8:56 ` Wei Yang 2014-08-15 8:56 ` Wei Yang 2014-08-15 10:30 ` Liviu Dudau 2014-08-15 10:30 ` Liviu Dudau 2014-08-15 10:30 ` Liviu Dudau 2014-08-18 1:44 ` Wei Yang 2014-08-18 1:44 ` Wei Yang 2014-08-18 21:26 ` Liviu Dudau 2014-08-18 21:26 ` Liviu Dudau 2014-08-18 14:25 ` Catalin Marinas 2014-08-18 14:25 ` Catalin Marinas 2014-08-18 21:30 ` Liviu Dudau 2014-08-18 21:30 ` Liviu Dudau 2014-08-18 22:09 ` Catalin Marinas 2014-08-18 22:09 ` Catalin Marinas 2014-08-19 12:39 ` Arnd Bergmann 2014-08-19 12:39 ` Arnd Bergmann 2014-08-19 1:44 ` Wei Yang 2014-08-19 1:44 ` Wei Yang 2014-08-19 12:05 ` Liviu Dudau 2014-08-19 12:05 ` Liviu Dudau 2014-08-12 16:25 ` [PATCH v9 03/12] PCI: Introduce helper functions to deal with PCI I/O ranges Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-18 14:26 ` Catalin Marinas 2014-08-18 14:26 ` Catalin Marinas 2014-08-18 14:26 ` Catalin Marinas 2014-08-18 21:34 ` Liviu Dudau 2014-08-18 21:34 ` Liviu Dudau 2014-08-18 21:52 ` Catalin Marinas 2014-08-18 21:52 ` Catalin Marinas 2014-08-22 4:59 ` Rob Herring 2014-08-22 4:59 ` Rob Herring 2014-08-22 4:59 ` Rob Herring 2014-09-02 3:43 ` Yijing Wang 2014-09-02 3:43 ` Yijing Wang 2014-08-12 16:25 ` [PATCH v9 04/12] PCI: OF: Fix the conversion of IO ranges into IO resources Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-22 4:08 ` Rob Herring 2014-08-22 4:08 ` Rob Herring 2014-08-22 4:08 ` Rob Herring 2014-08-22 13:06 ` Liviu Dudau 2014-08-22 13:06 ` Liviu Dudau 2014-08-24 23:27 ` Rob Herring 2014-08-24 23:27 ` Rob Herring 2014-09-05 22:11 ` Bjorn Helgaas 2014-09-05 22:11 ` Bjorn Helgaas 2014-08-12 16:25 ` [PATCH v9 05/12] ARM: Define PCI_IOBASE as the base of virtual PCI IO space Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-12 16:25 ` [PATCH v9 06/12] ARM: integrator: Correct usage of of_pci_range_to_resource() Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-09-05 22:08 ` Bjorn Helgaas [this message] 2014-09-05 22:08 ` Bjorn Helgaas 2014-09-08 12:25 ` Liviu Dudau 2014-09-08 12:25 ` Liviu Dudau 2014-09-22 12:47 ` Linus Walleij 2014-09-22 12:47 ` Linus Walleij 2014-09-22 13:36 ` Liviu Dudau 2014-09-22 13:36 ` Liviu Dudau 2014-08-12 16:25 ` [PATCH v9 07/12] PCI: Create pci_host_bridge before its associated bus in pci_create_root_bus Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-12 16:25 ` [PATCH v9 08/12] PCI: Introduce generic domain handling for PCI busses Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-12 16:25 ` [PATCH v9 09/12] OF: Introduce helper function for getting PCI domain_nr Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-12 16:25 ` [PATCH v9 10/12] OF: PCI: Add support for creating a generic host_bridge from DT Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-12 16:25 ` [PATCH v9 11/12] arm64: Add pgprot_device() interface for device mappings Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-13 9:59 ` Catalin Marinas 2014-08-13 9:59 ` Catalin Marinas 2014-08-12 16:25 ` [PATCH v9 12/12] PCI: Introduce pci_remap_iospace() for remapping PCI I/O bus resources into CPU space Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-12 16:25 ` Liviu Dudau 2014-08-13 10:01 ` Catalin Marinas 2014-08-13 10:01 ` Catalin Marinas 2014-08-13 10:33 ` Liviu Dudau 2014-08-13 10:33 ` Liviu Dudau 2014-08-13 10:53 ` Catalin Marinas 2014-08-13 10:53 ` Catalin Marinas 2014-08-22 4:16 ` Rob Herring 2014-08-22 4:16 ` Rob Herring 2014-08-22 4:16 ` Rob Herring 2014-08-22 12:43 ` Liviu Dudau 2014-08-22 12:43 ` Liviu Dudau 2014-08-23 16:57 ` Rob Herring 2014-08-23 16:57 ` Rob Herring 2014-08-23 16:57 ` Rob Herring 2014-08-18 14:26 ` [PATCH v9 00/12] Support for creating generic PCI host bridges from DT Catalin Marinas 2014-08-18 14:26 ` Catalin Marinas 2014-08-18 21:35 ` Liviu Dudau 2014-08-18 21:35 ` Liviu Dudau 2014-08-27 16:24 ` Robert Richter 2014-08-27 16:24 ` Robert Richter 2014-08-27 16:24 ` Robert Richter
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20140905220820.GI8080@google.com \ --to=bhelgaas@google.com \ --cc=Catalin.Marinas@arm.com \ --cc=Liviu.Dudau@arm.com \ --cc=Will.Deacon@arm.com \ --cc=arnd@arndb.de \ --cc=benh@kernel.crashing.org \ --cc=devicetree@vger.kernel.org \ --cc=grant.likely@secretlab.ca \ --cc=jg1.han@samsung.com \ --cc=kgene.kim@samsung.com \ --cc=linus.walleij@linaro.org \ --cc=linux-arch@vger.kernel.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-pci@vger.kernel.org \ --cc=linux@arm.linux.org.uk \ --cc=okaya@codeaurora.org \ --cc=suravee.suthikulpanit@amd.com \ --cc=tinamdar@apm.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.