From: Liviu Dudau <Liviu.Dudau@arm.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Catalin Marinas <Catalin.Marinas@arm.com>,
linux-pci <linux-pci@vger.kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
Will Deacon <Will.Deacon@arm.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
linaro-kernel <linaro-kernel@lists.linaro.org>,
LKML <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
LAKML <linux-arm-kernel@lists.infradead.org>,
Tanmay Inamdar <tinamdar@apm.com>,
Grant Likely <grant.likely@secretlab.ca>
Subject: Re: [PATCH v7 3/3] arm64: Add architecture support for PCI
Date: Thu, 20 Mar 2014 11:38:21 +0000 [thread overview]
Message-ID: <20140320113820.GH6457@e106497-lin.cambridge.arm.com> (raw)
In-Reply-To: <201403201217.22339.arnd@arndb.de>
On Thu, Mar 20, 2014 at 11:17:22AM +0000, Arnd Bergmann wrote:
> On Thursday 20 March 2014, Liviu Dudau wrote:
> > On Wed, Mar 19, 2014 at 06:37:51PM +0000, Arnd Bergmann wrote:
> > > On Wednesday 19 March 2014 17:21:41 Liviu Dudau wrote:
> > > >
> > > > My ultimate point is that no matter how long we argue about the shape of the functions that
> > > > I've added into arch/arm64/kernel/pci.c I don't think we can get away without having that
> > > > file, or at least not in the first phase if we want speedy integration into mainline.
> > >
> > > Let me simplify the discussion here:
> > >
> > > NAK to adding yet another architecture specific implementation.
> >
> > So what would be your approach for handling pci_address_to_pio() in a non-arch specific way?
> >
> > unsigned long __weak pci_address_to_pio(phys_addr_t address)
> > {
> > #ifdef ARCH_HAS_IOSPACE
> > if (address > IO_SPACE_LIMIT)
> > return (unsigned long)-1;
> >
> > return (unsigned long) address;
> > #else
> > struct ioresource *res;
> >
> > list_for_each_entry(res, &io_list, list) {
> > if (address >= res->start &&
> > address < res->start + res->size) {
> > return res->start - address;
> > }
> > }
> >
> > return (unsigned long)-1;
> > #endif
> > }
> >
> >
> > Either that, or you have more magic rabbits than me.
>
> I don't even understand why you want to create a generic pci_address_to_pio
> implementation, when we don't need that for arm64 at all. Unless I'm
> missing something important, that function is only called in case of
> PCI_PROBE_DEVTREE with pci_of_scan on PowerPC. I don't expect any
> architecture to do the same thing, and the only other architecture that
> needs something like it (sparc) has a different implementation.
Because in my [v7 2/6]* patch for the generic host bridge support I start
using pci_address_to_pio to fix the conversion of PCI ranges to resources.
That requires an arm64 (or more correctly, an arch with memory mapped IO
specific) version of pci_address_to_pio().
Best regards,
Liviu
>
> The regular (non-DEVTREE) PCI bus scan should just be able to translate
> the BUS I/O addresses into Linux I/O port numbers using io_offset,
> without going through an intermediate step of translating into a CPU
> physical address first, so the entire lookup method won't get used.
>
> The reason why PowerPC needs it is that they traditionally don't
> use PCI config space access to assign or look at resources, but
> instead rely on the firmware to have set it up in advance and then
> put matching information into DT and the BARs. For Solaris and AIX,
> it's probably easier to use the information from DT, but in Linux,
> we already need to implement the manual bus scan, e.g. to do
> PCI device hotplugging if nothing else.
>
> Arnd
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
next prev parent reply other threads:[~2014-03-20 11:38 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 15:34 [PATCH v7 0/3] Add support for PCI in AArch64 Liviu Dudau
2014-03-14 15:34 ` [PATCH v7 1/3] Fix ioport_map() for !CONFIG_GENERIC_IOMAP cases Liviu Dudau
2014-03-14 15:34 ` [PATCH v7 2/3] arm64: Extend the PCI I/O space to 16MB Liviu Dudau
2014-03-14 15:34 ` [PATCH v7 3/3] arm64: Add architecture support for PCI Liviu Dudau
2014-03-14 17:14 ` Catalin Marinas
2014-03-14 17:38 ` Arnd Bergmann
2014-03-14 18:05 ` Liviu Dudau
2014-03-14 19:10 ` Arnd Bergmann
2014-03-16 6:22 ` Benjamin Herrenschmidt
2014-03-17 17:38 ` Catalin Marinas
2014-03-17 18:05 ` Liviu Dudau
2014-03-19 13:56 ` Catalin Marinas
2014-03-19 17:21 ` Liviu Dudau
2014-03-19 17:53 ` Rob Herring
2014-03-19 18:36 ` Arnd Bergmann
2014-03-19 18:37 ` Arnd Bergmann
2014-03-20 9:46 ` Liviu Dudau
2014-03-20 11:17 ` Arnd Bergmann
2014-03-20 11:38 ` Liviu Dudau [this message]
2014-03-20 12:26 ` Arnd Bergmann
2014-03-20 12:50 ` Liviu Dudau
2014-03-17 16:05 ` Rob Herring
2014-03-17 16:22 ` Liviu Dudau
2014-04-07 23:58 ` Bjorn Helgaas
2014-04-08 9:52 ` Liviu Dudau
2014-04-22 8:58 ` [PATCH v7 0/3] Add support for PCI in AArch64 Sandeepa Prabhu
2014-04-22 10:11 ` Liviu Dudau
2014-04-22 11:50 ` Sandeepa Prabhu
2014-04-22 12:34 ` Liviu Dudau
2014-04-23 20:32 ` Tanmay Inamdar
2014-04-24 3:08 ` Sandeepa Prabhu
2014-05-16 10:33 ` Sunil Kovvuri
2014-05-16 13:24 ` Liviu Dudau
2014-05-16 17:42 ` Sunil Kovvuri
2014-05-21 11:15 ` Sunil Kovvuri
2014-05-21 11:34 ` Liviu Dudau
2014-05-21 17:06 ` Jason Gunthorpe
2014-05-19 13:01 ` Arnd Bergmann
2014-05-20 4:22 ` Sunil Kovvuri
2014-05-20 8:44 ` Arnd Bergmann
2014-05-20 8:55 ` Sunil Kovvuri
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=20140320113820.GH6457@e106497-lin.cambridge.arm.com \
--to=liviu.dudau@arm.com \
--cc=Catalin.Marinas@arm.com \
--cc=Will.Deacon@arm.com \
--cc=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=bhelgaas@google.com \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@secretlab.ca \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®