Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-11 Thread Arnd Bergmann
On Thursday 11 September 2014 14:11:05 Phil Edworthy wrote: > On 10 September 2014 19:20, Arnd wrote: > > On Tuesday 09 September 2014 12:20:54 Catalin Marinas wrote: > > > > > > We can assume that if a domain is not specified and there is a single > > > top level PCIe node, the domain defaults to

RE: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-11 Thread Phil Edworthy
Hi, On 10 September 2014 19:20, Arnd wrote: > On Tuesday 09 September 2014 12:20:54 Catalin Marinas wrote: > > > > We can assume that if a domain is not specified and there is a single > > top level PCIe node, the domain defaults to 0. Are there any arm32 > > platforms that require multiple

RE: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-11 Thread Phil Edworthy
Hi, On 10 September 2014 19:20, Arnd wrote: On Tuesday 09 September 2014 12:20:54 Catalin Marinas wrote: We can assume that if a domain is not specified and there is a single top level PCIe node, the domain defaults to 0. Are there any arm32 platforms that require multiple domains (and

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-11 Thread Arnd Bergmann
On Thursday 11 September 2014 14:11:05 Phil Edworthy wrote: On 10 September 2014 19:20, Arnd wrote: On Tuesday 09 September 2014 12:20:54 Catalin Marinas wrote: We can assume that if a domain is not specified and there is a single top level PCIe node, the domain defaults to 0. Are

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-10 Thread Arnd Bergmann
On Tuesday 09 September 2014 12:20:54 Catalin Marinas wrote: > > We can assume that if a domain is not specified and there is a single > top level PCIe node, the domain defaults to 0. Are there any arm32 > platforms that require multiple domains (and do not specify a number in > the DT)? In

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-10 Thread Jason Gunthorpe
On Tue, Sep 09, 2014 at 09:44:56PM -0500, Rob Herring wrote: > On Tue, Sep 9, 2014 at 10:41 AM, Jason Gunthorpe > wrote: > > On Tue, Sep 09, 2014 at 08:26:19AM -0600, Bjorn Helgaas wrote: > > > >> So as long as the DT tells you the ECAM information for each host > >> bridge, that should be

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-10 Thread Catalin Marinas
On Tue, Sep 09, 2014 at 10:16:04AM +0100, Arnd Bergmann wrote: > On Tuesday 09 September 2014 09:46:21 Liviu Dudau wrote: > > On Tue, Sep 09, 2014 at 06:54:21AM +0100, Yijing Wang wrote: > > > >>> on new requests. This function gets called quite a lot and I'm trying > > > >>> not to > > > >>>

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-10 Thread Liviu Dudau
is function seems a bit broken to me. It is overloaded with too many > > >> different outcomes. Think about how this would work if you have > > >> multiple PCI buses and a mixture of having pci-domain aliases or not. > > >> Aren't domain numbers global? Allocatio

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-10 Thread Liviu Dudau
! / --- ¯\_(ツ)_/¯From 77257fceaa8fbd74d6132fcf57c3af14bd48c0ae Mon Sep 17 00:00:00 2001 From: Liviu Dudau liviu.du...@arm.com Date: Mon, 4 Aug 2014 17:03:04 +0100 Subject: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr Add of_pci_get_domain_nr() to retrieve

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-10 Thread Catalin Marinas
On Tue, Sep 09, 2014 at 10:16:04AM +0100, Arnd Bergmann wrote: On Tuesday 09 September 2014 09:46:21 Liviu Dudau wrote: On Tue, Sep 09, 2014 at 06:54:21AM +0100, Yijing Wang wrote: on new requests. This function gets called quite a lot and I'm trying not to make it too heavy

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-10 Thread Jason Gunthorpe
On Tue, Sep 09, 2014 at 09:44:56PM -0500, Rob Herring wrote: On Tue, Sep 9, 2014 at 10:41 AM, Jason Gunthorpe jguntho...@obsidianresearch.com wrote: On Tue, Sep 09, 2014 at 08:26:19AM -0600, Bjorn Helgaas wrote: So as long as the DT tells you the ECAM information for each host bridge,

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-10 Thread Arnd Bergmann
On Tuesday 09 September 2014 12:20:54 Catalin Marinas wrote: We can assume that if a domain is not specified and there is a single top level PCIe node, the domain defaults to 0. Are there any arm32 platforms that require multiple domains (and do not specify a number in the DT)? In theory, I

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Rob Herring
On Tue, Sep 9, 2014 at 10:41 AM, Jason Gunthorpe wrote: > On Tue, Sep 09, 2014 at 08:26:19AM -0600, Bjorn Helgaas wrote: > >> So as long as the DT tells you the ECAM information for each host >> bridge, that should be sufficient. The domain number is then just a >> Linux convenience and is not

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Yijing Wang
>> OK. Sorry, I have one last question, because domain will be used to >> calculate the address used to >> access PCI hardware config registers. So if DTS file doesn't report the >> domain, how do we know >> we would access the right registers when we use the auto increment domain >> vaule ? >>

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Yijing Wang
>> OK. Sorry, I have one last question, because domain will be used to >> calculate the address used to >> access PCI hardware config registers. So if DTS file doesn't report the >> domain, how do we know >> we would access the right registers when we use the auto increment domain >> vaule ? >

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Jason Gunthorpe
On Tue, Sep 09, 2014 at 08:26:19AM -0600, Bjorn Helgaas wrote: > So as long as the DT tells you the ECAM information for each host > bridge, that should be sufficient. The domain number is then just a > Linux convenience and is not tied to the platform as it is on ia64. I think this is right

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Bjorn Helgaas
On Tue, Sep 9, 2014 at 3:30 AM, Yijing Wang wrote: > On 2014/9/9 16:46, Liviu Dudau wrote: >> On Tue, Sep 09, 2014 at 06:54:21AM +0100, Yijing Wang wrote: >> on new requests. This function gets called quite a lot and I'm trying >> not to >> make it too heavy weight. > >

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Bjorn Helgaas
On Tue, Sep 9, 2014 at 3:16 AM, Arnd Bergmann wrote: > On Tuesday 09 September 2014 09:46:21 Liviu Dudau wrote: >> On Tue, Sep 09, 2014 at 06:54:21AM +0100, Yijing Wang wrote: >> > PCI domain(or named segment) is provided by firmware, in ACPI system, we >> > evaluated it >> > by method "_SEG".

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Liviu Dudau
On Tue, Sep 09, 2014 at 10:30:51AM +0100, Yijing Wang wrote: > On 2014/9/9 16:46, Liviu Dudau wrote: > > On Tue, Sep 09, 2014 at 06:54:21AM +0100, Yijing Wang wrote: > > on new requests. This function gets called quite a lot and I'm trying > > not to > > make it too heavy weight. >

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Yijing Wang
On 2014/9/9 16:46, Liviu Dudau wrote: > On Tue, Sep 09, 2014 at 06:54:21AM +0100, Yijing Wang wrote: > on new requests. This function gets called quite a lot and I'm trying not > to > make it too heavy weight. Generally, nothing should be accessing the same DT value

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Arnd Bergmann
On Tuesday 09 September 2014 09:46:21 Liviu Dudau wrote: > On Tue, Sep 09, 2014 at 06:54:21AM +0100, Yijing Wang wrote: > > >>> on new requests. This function gets called quite a lot and I'm trying > > >>> not to > > >>> make it too heavy weight. > > >> > > >> Generally, nothing should be

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Liviu Dudau
On Tue, Sep 09, 2014 at 06:54:21AM +0100, Yijing Wang wrote: > >>> on new requests. This function gets called quite a lot and I'm trying not > >>> to > >>> make it too heavy weight. > >> > >> Generally, nothing should be accessing the same DT value frequently. > >> It should get cached somewhere.

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Liviu Dudau
On Tue, Sep 09, 2014 at 06:54:21AM +0100, Yijing Wang wrote: on new requests. This function gets called quite a lot and I'm trying not to make it too heavy weight. Generally, nothing should be accessing the same DT value frequently. It should get cached somewhere. The problem

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Arnd Bergmann
On Tuesday 09 September 2014 09:46:21 Liviu Dudau wrote: On Tue, Sep 09, 2014 at 06:54:21AM +0100, Yijing Wang wrote: on new requests. This function gets called quite a lot and I'm trying not to make it too heavy weight. Generally, nothing should be accessing the same DT value

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Yijing Wang
On 2014/9/9 16:46, Liviu Dudau wrote: On Tue, Sep 09, 2014 at 06:54:21AM +0100, Yijing Wang wrote: on new requests. This function gets called quite a lot and I'm trying not to make it too heavy weight. Generally, nothing should be accessing the same DT value frequently. It should get

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Liviu Dudau
On Tue, Sep 09, 2014 at 10:30:51AM +0100, Yijing Wang wrote: On 2014/9/9 16:46, Liviu Dudau wrote: On Tue, Sep 09, 2014 at 06:54:21AM +0100, Yijing Wang wrote: on new requests. This function gets called quite a lot and I'm trying not to make it too heavy weight. Generally, nothing

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Bjorn Helgaas
On Tue, Sep 9, 2014 at 3:16 AM, Arnd Bergmann a...@arndb.de wrote: On Tuesday 09 September 2014 09:46:21 Liviu Dudau wrote: On Tue, Sep 09, 2014 at 06:54:21AM +0100, Yijing Wang wrote: PCI domain(or named segment) is provided by firmware, in ACPI system, we evaluated it by method _SEG. in

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Bjorn Helgaas
On Tue, Sep 9, 2014 at 3:30 AM, Yijing Wang wangyij...@huawei.com wrote: On 2014/9/9 16:46, Liviu Dudau wrote: On Tue, Sep 09, 2014 at 06:54:21AM +0100, Yijing Wang wrote: on new requests. This function gets called quite a lot and I'm trying not to make it too heavy weight. Generally,

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Jason Gunthorpe
On Tue, Sep 09, 2014 at 08:26:19AM -0600, Bjorn Helgaas wrote: So as long as the DT tells you the ECAM information for each host bridge, that should be sufficient. The domain number is then just a Linux convenience and is not tied to the platform as it is on ia64. I think this is right for

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Yijing Wang
OK. Sorry, I have one last question, because domain will be used to calculate the address used to access PCI hardware config registers. So if DTS file doesn't report the domain, how do we know we would access the right registers when we use the auto increment domain vaule ? That's a

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Yijing Wang
OK. Sorry, I have one last question, because domain will be used to calculate the address used to access PCI hardware config registers. So if DTS file doesn't report the domain, how do we know we would access the right registers when we use the auto increment domain vaule ? Has there a

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-09 Thread Rob Herring
On Tue, Sep 9, 2014 at 10:41 AM, Jason Gunthorpe jguntho...@obsidianresearch.com wrote: On Tue, Sep 09, 2014 at 08:26:19AM -0600, Bjorn Helgaas wrote: So as long as the DT tells you the ECAM information for each host bridge, that should be sufficient. The domain number is then just a Linux

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-08 Thread Yijing Wang
>>> on new requests. This function gets called quite a lot and I'm trying not to >>> make it too heavy weight. >> >> Generally, nothing should be accessing the same DT value frequently. >> It should get cached somewhere. >> > > The problem appears for DTs that don't have the pci-domain info. Then

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-08 Thread Jason Gunthorpe
On Mon, Sep 08, 2014 at 04:59:31PM +0100, Liviu Dudau wrote: > > I don't really understand how domains are used so it's hard to provide > > a recommendation here. Do domains even belong in the DT? > > ACPI calls them segments and the way Bjorn explained it to me at some moment > was > that it

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-08 Thread Liviu Dudau
On Mon, Sep 08, 2014 at 04:27:36PM +0100, Rob Herring wrote: > On Mon, Sep 8, 2014 at 9:54 AM, Liviu Dudau wrote: > > On Mon, Sep 08, 2014 at 03:27:56PM +0100, Rob Herring wrote: > >> On Mon, Sep 8, 2014 at 8:54 AM, Liviu Dudau wrote: > >> > Add of_pci_get_domain_nr() to retrieve the PCI domain

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-08 Thread Rob Herring
On Mon, Sep 8, 2014 at 9:54 AM, Liviu Dudau wrote: > On Mon, Sep 08, 2014 at 03:27:56PM +0100, Rob Herring wrote: >> On Mon, Sep 8, 2014 at 8:54 AM, Liviu Dudau wrote: >> > Add of_pci_get_domain_nr() to retrieve the PCI domain number >> > of a given device from DT. If the information is not

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-08 Thread Liviu Dudau
On Mon, Sep 08, 2014 at 03:27:56PM +0100, Rob Herring wrote: > On Mon, Sep 8, 2014 at 8:54 AM, Liviu Dudau wrote: > > Add of_pci_get_domain_nr() to retrieve the PCI domain number > > of a given device from DT. If the information is not present, > > the function can be requested to allocate a new

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-08 Thread Rob Herring
On Mon, Sep 8, 2014 at 8:54 AM, Liviu Dudau wrote: > Add of_pci_get_domain_nr() to retrieve the PCI domain number > of a given device from DT. If the information is not present, > the function can be requested to allocate a new domain number. > > Cc: Bjorn Helgaas > Cc: Arnd Bergmann > Cc:

[PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-08 Thread Liviu Dudau
Add of_pci_get_domain_nr() to retrieve the PCI domain number of a given device from DT. If the information is not present, the function can be requested to allocate a new domain number. Cc: Bjorn Helgaas Cc: Arnd Bergmann Cc: Grant Likely Cc: Rob Herring Reviewed-by: Catalin Marinas

[PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-08 Thread Liviu Dudau
Add of_pci_get_domain_nr() to retrieve the PCI domain number of a given device from DT. If the information is not present, the function can be requested to allocate a new domain number. Cc: Bjorn Helgaas bhelg...@google.com Cc: Arnd Bergmann a...@arndb.de Cc: Grant Likely grant.lik...@linaro.org

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-08 Thread Rob Herring
On Mon, Sep 8, 2014 at 8:54 AM, Liviu Dudau liviu.du...@arm.com wrote: Add of_pci_get_domain_nr() to retrieve the PCI domain number of a given device from DT. If the information is not present, the function can be requested to allocate a new domain number. Cc: Bjorn Helgaas

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-08 Thread Liviu Dudau
On Mon, Sep 08, 2014 at 03:27:56PM +0100, Rob Herring wrote: On Mon, Sep 8, 2014 at 8:54 AM, Liviu Dudau liviu.du...@arm.com wrote: Add of_pci_get_domain_nr() to retrieve the PCI domain number of a given device from DT. If the information is not present, the function can be requested to

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-08 Thread Rob Herring
On Mon, Sep 8, 2014 at 9:54 AM, Liviu Dudau liviu.du...@arm.com wrote: On Mon, Sep 08, 2014 at 03:27:56PM +0100, Rob Herring wrote: On Mon, Sep 8, 2014 at 8:54 AM, Liviu Dudau liviu.du...@arm.com wrote: Add of_pci_get_domain_nr() to retrieve the PCI domain number of a given device from DT.

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-08 Thread Liviu Dudau
On Mon, Sep 08, 2014 at 04:27:36PM +0100, Rob Herring wrote: On Mon, Sep 8, 2014 at 9:54 AM, Liviu Dudau liviu.du...@arm.com wrote: On Mon, Sep 08, 2014 at 03:27:56PM +0100, Rob Herring wrote: On Mon, Sep 8, 2014 at 8:54 AM, Liviu Dudau liviu.du...@arm.com wrote: Add of_pci_get_domain_nr()

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-08 Thread Jason Gunthorpe
On Mon, Sep 08, 2014 at 04:59:31PM +0100, Liviu Dudau wrote: I don't really understand how domains are used so it's hard to provide a recommendation here. Do domains even belong in the DT? ACPI calls them segments and the way Bjorn explained it to me at some moment was that it was an

Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr

2014-09-08 Thread Yijing Wang
on new requests. This function gets called quite a lot and I'm trying not to make it too heavy weight. Generally, nothing should be accessing the same DT value frequently. It should get cached somewhere. The problem appears for DTs that don't have the pci-domain info. Then the cached