All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Covington <cov@codeaurora.org>
To: Gabriele Paoloni <gabriele.paoloni@huawei.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	"liudongdong (C)" <liudongdong3@huawei.com>
Cc: Tomasz Nowicki <tn@semihalf.com>,
	"helgaas@kernel.org" <helgaas@kernel.org>,
	"will.deacon@arm.com" <will.deacon@arm.com>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"rafael@kernel.org" <rafael@kernel.org>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"hanjun.guo@linaro.org" <hanjun.guo@linaro.org>,
	"okaya@codeaurora.org" <okaya@codeaurora.org>,
	"jchandra@broadcom.com" <jchandra@broadcom.com>,
	"dhdang@apm.com" <dhdang@apm.com>,
	"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
	"robert.richter@caviumnetworks.com"
	<robert.richter@caviumnetworks.com>,
	"mw@semihalf.com" <mw@semihalf.com>,
	"Liviu.Dudau@arm.com" <Liviu.Dudau@arm.com>,
	"ddaney@caviumnetworks.com" <ddaney@caviumnetworks.com>,
	Wangyijing <wangyijing@huawei.com>, "msalter@redhat.com" <msa>
Subject: Re: [PATCH V6 2/5] PCI/ACPI: Check platform specific ECAM quirks
Date: Fri, 16 Sep 2016 08:27:40 -0400	[thread overview]
Message-ID: <42c3f965-b40c-f2bb-e12c-34da6af1a4b7@codeaurora.org> (raw)
In-Reply-To: <EE11001F9E5DDD47B7634E2F8A612F2E1F8730EA@lhreml507-mbx>

On 09/16/2016 05:02 AM, Gabriele Paoloni wrote:
> Hi Lorenzo and Tomasz
> 
> Many Thanks for looking at this
> 
>> -----Original Message-----
>> From: Lorenzo Pieralisi [mailto:lorenzo.pieralisi@arm.com]
>> Sent: 15 September 2016 11:59
>> To: liudongdong (C)
>> Cc: Tomasz Nowicki; helgaas@kernel.org; will.deacon@arm.com;
>> catalin.marinas@arm.com; rafael@kernel.org; arnd@arndb.de;
>> hanjun.guo@linaro.org; okaya@codeaurora.org; jchandra@broadcom.com;
>> cov@codeaurora.org; dhdang@apm.com; ard.biesheuvel@linaro.org;
>> robert.richter@caviumnetworks.com; mw@semihalf.com;
>> Liviu.Dudau@arm.com; ddaney@caviumnetworks.com; Wangyijing;
>> msalter@redhat.com; linux-pci@vger.kernel.org; linux-arm-
>> kernel@lists.infradead.org; linaro-acpi@lists.linaro.org;
>> jcm@redhat.com; andrea.gallo@linaro.org; jeremy.linton@arm.com;
>> Gabriele Paoloni; jhugo@codeaurora.org; linux-acpi@vger.kernel.org;
>> linux-kernel@vger.kernel.org
>> Subject: Re: [PATCH V6 2/5] PCI/ACPI: Check platform specific ECAM
>> quirks
>>
>> On Tue, Sep 13, 2016 at 07:38:39PM +0800, Dongdong Liu wrote:
>>
>> [...]
>>
>>> Our host bridge is non ECAM only for the RC bus config space;
>>> for any other bus underneath the root bus we support ECAM access.
>>>
>>> RC config resource with hardcode as DEFINE_RES_MEM(0xb0070000,
>> SZ_4K),
>>> EP config resource we get it from MCFG table.
>>> So we need to override ops, but config resource we only need to
>> hardcode with RC config resource.
>>>
>>> Our host controller ACPI support patch can be found:
>>> https://lkml.org/lkml/2016/8/31/340
>>
>> Sorry I misread your code. IIUC you create an array of resources that
>> represent non-ECAM config space (and incidentally contain debug
>> registers to check the link status - that you need to check for every
>> given config access (?)), but you still need to have an MCFG entry that
> 
> The link status check is inherited from the designware framework (see
> http://lxr.free-electrons.com/source/drivers/pci/host/pcie-designware.c#L678)
> 
> However I think that in this case we can just check the link status
> in our init function and return an error if the link is down
> 
>> covers the bus number subject to quirk to make sure this mechanism
>> works. Correct ?
> 
> Well we need the quirks for the root bus numbers but if read this v6
> quirk mechanism correctly even if we do not specify an mcfg entry for
> bus 0 oci_mcfg_match_quirks() is called anyway and we can set our
> special configuration space addresses for the root buses (i.e. I think
> we can have a clean MCFG table with entries only for those bus ranges
> that are really ECAM)  
> 
>>
>> This also means that, with the MCFG tables you have and current
>> mainline kernel you are able to probe a root bridge (because the MCFG
>> table covers the bus number that is not ECAM), with enumeration
>> going haywire because it is trying to carry out ECAM accesses on
>> non-ECAM space.
> 
> Yes correct, we cannot access the host controller configuration space
> with our current MCFG table and current Linux mainline
> 
>>
>> Is my reading correct ?
>>
>> Anyway, that's not stricly related to this discussion, it is time we
>> converge on this patchset, we can add a domain range if that
>> simplifies things.
> 
> IMO it would be better to have the domain range to avoid
> a very large and repetitive static quirk array

The v6 framework requires what, 21 additional lines of quirk data? What
if you were to define some preprocessor macros to slim it down? I think
something like the following would bring it down to roughly 7 additional
lines.

#define PCI_ACPI_QUIRK_QUAD_DOM(rev, dom, ops) \
    { "HISI ", rev, 0, dom+0, MCFG_BUS_ANY, ops,
      MCFG_RES_EMPTY}, \
    { "HISI ", rev, 0, dom+1, MCFG_BUS_ANY, ops,
      MCFG_RES_EMPTY}, \
    { "HISI ", rev, 0, dom+2, MCFG_BUS_ANY, ops,
      MCFG_RES_EMPTY}, \
    { "HISI ", rev, 0, dom+3, MCFG_BUS_ANY, ops,
      MCFG_RES_EMPTY},

PCI_ACPI_QUIRK_QUAD_DOM("HIP05 ", 0, &hisi_pcie_hip05_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP06 ", 0, &hisi_pcie_hip05_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 0, &hisi_pcie_hip06_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 4, &hisi_pcie_hip07_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 8, &hisi_pcie_hip07_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 12, &hisi_pcie_hip07_ops)

Cov
-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code
Aurora Forum, a Linux Foundation Collaborative Project.

WARNING: multiple messages have this Message-ID (diff)
From: Christopher Covington <cov@codeaurora.org>
To: Gabriele Paoloni <gabriele.paoloni@huawei.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	"liudongdong (C)" <liudongdong3@huawei.com>
Cc: Tomasz Nowicki <tn@semihalf.com>,
	"helgaas@kernel.org" <helgaas@kernel.org>,
	"will.deacon@arm.com" <will.deacon@arm.com>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"rafael@kernel.org" <rafael@kernel.org>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"hanjun.guo@linaro.org" <hanjun.guo@linaro.org>,
	"okaya@codeaurora.org" <okaya@codeaurora.org>,
	"jchandra@broadcom.com" <jchandra@broadcom.com>,
	"dhdang@apm.com" <dhdang@apm.com>,
	"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
	"robert.richter@caviumnetworks.com" 
	<robert.richter@caviumnetworks.com>,
	"mw@semihalf.com" <mw@semihalf.com>,
	"Liviu.Dudau@arm.com" <Liviu.Dudau@arm.com>,
	"ddaney@caviumnetworks.com" <ddaney@caviumnetworks.com>,
	Wangyijing <wangyijing@huawei.com>,
	"msalter@redhat.com" <msalter@redhat.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linaro-acpi@lists.linaro.org" <linaro-acpi@lists.linaro.org>,
	"jcm@redhat.com" <jcm@redhat.com>,
	"andrea.gallo@linaro.org" <andrea.gallo@linaro.org>,
	"jeremy.linton@arm.com" <jeremy.linton@arm.com>,
	"jhugo@codeaurora.org" <jhugo@codeaurora.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V6 2/5] PCI/ACPI: Check platform specific ECAM quirks
Date: Fri, 16 Sep 2016 08:27:40 -0400	[thread overview]
Message-ID: <42c3f965-b40c-f2bb-e12c-34da6af1a4b7@codeaurora.org> (raw)
In-Reply-To: <EE11001F9E5DDD47B7634E2F8A612F2E1F8730EA@lhreml507-mbx>

On 09/16/2016 05:02 AM, Gabriele Paoloni wrote:
> Hi Lorenzo and Tomasz
> 
> Many Thanks for looking at this
> 
>> -----Original Message-----
>> From: Lorenzo Pieralisi [mailto:lorenzo.pieralisi@arm.com]
>> Sent: 15 September 2016 11:59
>> To: liudongdong (C)
>> Cc: Tomasz Nowicki; helgaas@kernel.org; will.deacon@arm.com;
>> catalin.marinas@arm.com; rafael@kernel.org; arnd@arndb.de;
>> hanjun.guo@linaro.org; okaya@codeaurora.org; jchandra@broadcom.com;
>> cov@codeaurora.org; dhdang@apm.com; ard.biesheuvel@linaro.org;
>> robert.richter@caviumnetworks.com; mw@semihalf.com;
>> Liviu.Dudau@arm.com; ddaney@caviumnetworks.com; Wangyijing;
>> msalter@redhat.com; linux-pci@vger.kernel.org; linux-arm-
>> kernel@lists.infradead.org; linaro-acpi@lists.linaro.org;
>> jcm@redhat.com; andrea.gallo@linaro.org; jeremy.linton@arm.com;
>> Gabriele Paoloni; jhugo@codeaurora.org; linux-acpi@vger.kernel.org;
>> linux-kernel@vger.kernel.org
>> Subject: Re: [PATCH V6 2/5] PCI/ACPI: Check platform specific ECAM
>> quirks
>>
>> On Tue, Sep 13, 2016 at 07:38:39PM +0800, Dongdong Liu wrote:
>>
>> [...]
>>
>>> Our host bridge is non ECAM only for the RC bus config space;
>>> for any other bus underneath the root bus we support ECAM access.
>>>
>>> RC config resource with hardcode as DEFINE_RES_MEM(0xb0070000,
>> SZ_4K),
>>> EP config resource we get it from MCFG table.
>>> So we need to override ops, but config resource we only need to
>> hardcode with RC config resource.
>>>
>>> Our host controller ACPI support patch can be found:
>>> https://lkml.org/lkml/2016/8/31/340
>>
>> Sorry I misread your code. IIUC you create an array of resources that
>> represent non-ECAM config space (and incidentally contain debug
>> registers to check the link status - that you need to check for every
>> given config access (?)), but you still need to have an MCFG entry that
> 
> The link status check is inherited from the designware framework (see
> http://lxr.free-electrons.com/source/drivers/pci/host/pcie-designware.c#L678)
> 
> However I think that in this case we can just check the link status
> in our init function and return an error if the link is down
> 
>> covers the bus number subject to quirk to make sure this mechanism
>> works. Correct ?
> 
> Well we need the quirks for the root bus numbers but if read this v6
> quirk mechanism correctly even if we do not specify an mcfg entry for
> bus 0 oci_mcfg_match_quirks() is called anyway and we can set our
> special configuration space addresses for the root buses (i.e. I think
> we can have a clean MCFG table with entries only for those bus ranges
> that are really ECAM)  
> 
>>
>> This also means that, with the MCFG tables you have and current
>> mainline kernel you are able to probe a root bridge (because the MCFG
>> table covers the bus number that is not ECAM), with enumeration
>> going haywire because it is trying to carry out ECAM accesses on
>> non-ECAM space.
> 
> Yes correct, we cannot access the host controller configuration space
> with our current MCFG table and current Linux mainline
> 
>>
>> Is my reading correct ?
>>
>> Anyway, that's not stricly related to this discussion, it is time we
>> converge on this patchset, we can add a domain range if that
>> simplifies things.
> 
> IMO it would be better to have the domain range to avoid
> a very large and repetitive static quirk array

The v6 framework requires what, 21 additional lines of quirk data? What
if you were to define some preprocessor macros to slim it down? I think
something like the following would bring it down to roughly 7 additional
lines.

#define PCI_ACPI_QUIRK_QUAD_DOM(rev, dom, ops) \
    { "HISI ", rev, 0, dom+0, MCFG_BUS_ANY, ops,
      MCFG_RES_EMPTY}, \
    { "HISI ", rev, 0, dom+1, MCFG_BUS_ANY, ops,
      MCFG_RES_EMPTY}, \
    { "HISI ", rev, 0, dom+2, MCFG_BUS_ANY, ops,
      MCFG_RES_EMPTY}, \
    { "HISI ", rev, 0, dom+3, MCFG_BUS_ANY, ops,
      MCFG_RES_EMPTY},

PCI_ACPI_QUIRK_QUAD_DOM("HIP05 ", 0, &hisi_pcie_hip05_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP06 ", 0, &hisi_pcie_hip05_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 0, &hisi_pcie_hip06_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 4, &hisi_pcie_hip07_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 8, &hisi_pcie_hip07_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 12, &hisi_pcie_hip07_ops)

Cov
-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code
Aurora Forum, a Linux Foundation Collaborative Project.

WARNING: multiple messages have this Message-ID (diff)
From: Christopher Covington <cov@codeaurora.org>
To: Gabriele Paoloni <gabriele.paoloni@huawei.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	"liudongdong (C)" <liudongdong3@huawei.com>
Cc: Tomasz Nowicki <tn@semihalf.com>,
	"helgaas@kernel.org" <helgaas@kernel.org>,
	"will.deacon@arm.com" <will.deacon@arm.com>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"rafael@kernel.org" <rafael@kernel.org>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"hanjun.guo@linaro.org" <hanjun.guo@linaro.org>,
	"okaya@codeaurora.org" <okaya@codeaurora.org>,
	"jchandra@broadcom.com" <jchandra@broadcom.com>,
	"dhdang@apm.com" <dhdang@apm.com>,
	"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
	"robert.richter@caviumnetworks.com"
	<robert.richter@caviumnetworks.com>,
	"mw@semihalf.com" <mw@semihalf.com>,
	"Liviu.Dudau@arm.com" <Liviu.Dudau@arm.com>,
	"ddaney@caviumnetworks.com" <ddaney@caviumnetworks.com>,
	Wangyijing <wangyijing@huawei.com>,
	"msalter@redhat.com" <msalter@redhat.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linaro-acpi@lists.linaro.org" <linaro-acpi@lists.linaro.org>,
	"jcm@redhat.com" <jcm@redhat.com>,
	"andrea.gallo@linaro.org" <andrea.gallo@linaro.org>,
	"jeremy.linton@arm.com" <jeremy.linton@arm.com>,
	"jhugo@codeaurora.org" <jhugo@codeaurora.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V6 2/5] PCI/ACPI: Check platform specific ECAM quirks
Date: Fri, 16 Sep 2016 08:27:40 -0400	[thread overview]
Message-ID: <42c3f965-b40c-f2bb-e12c-34da6af1a4b7@codeaurora.org> (raw)
In-Reply-To: <EE11001F9E5DDD47B7634E2F8A612F2E1F8730EA@lhreml507-mbx>

On 09/16/2016 05:02 AM, Gabriele Paoloni wrote:
> Hi Lorenzo and Tomasz
> 
> Many Thanks for looking at this
> 
>> -----Original Message-----
>> From: Lorenzo Pieralisi [mailto:lorenzo.pieralisi@arm.com]
>> Sent: 15 September 2016 11:59
>> To: liudongdong (C)
>> Cc: Tomasz Nowicki; helgaas@kernel.org; will.deacon@arm.com;
>> catalin.marinas@arm.com; rafael@kernel.org; arnd@arndb.de;
>> hanjun.guo@linaro.org; okaya@codeaurora.org; jchandra@broadcom.com;
>> cov@codeaurora.org; dhdang@apm.com; ard.biesheuvel@linaro.org;
>> robert.richter@caviumnetworks.com; mw@semihalf.com;
>> Liviu.Dudau@arm.com; ddaney@caviumnetworks.com; Wangyijing;
>> msalter@redhat.com; linux-pci@vger.kernel.org; linux-arm-
>> kernel@lists.infradead.org; linaro-acpi@lists.linaro.org;
>> jcm@redhat.com; andrea.gallo@linaro.org; jeremy.linton@arm.com;
>> Gabriele Paoloni; jhugo@codeaurora.org; linux-acpi@vger.kernel.org;
>> linux-kernel@vger.kernel.org
>> Subject: Re: [PATCH V6 2/5] PCI/ACPI: Check platform specific ECAM
>> quirks
>>
>> On Tue, Sep 13, 2016 at 07:38:39PM +0800, Dongdong Liu wrote:
>>
>> [...]
>>
>>> Our host bridge is non ECAM only for the RC bus config space;
>>> for any other bus underneath the root bus we support ECAM access.
>>>
>>> RC config resource with hardcode as DEFINE_RES_MEM(0xb0070000,
>> SZ_4K),
>>> EP config resource we get it from MCFG table.
>>> So we need to override ops, but config resource we only need to
>> hardcode with RC config resource.
>>>
>>> Our host controller ACPI support patch can be found:
>>> https://lkml.org/lkml/2016/8/31/340
>>
>> Sorry I misread your code. IIUC you create an array of resources that
>> represent non-ECAM config space (and incidentally contain debug
>> registers to check the link status - that you need to check for every
>> given config access (?)), but you still need to have an MCFG entry that
> 
> The link status check is inherited from the designware framework (see
> http://lxr.free-electrons.com/source/drivers/pci/host/pcie-designware.c#L678)
> 
> However I think that in this case we can just check the link status
> in our init function and return an error if the link is down
> 
>> covers the bus number subject to quirk to make sure this mechanism
>> works. Correct ?
> 
> Well we need the quirks for the root bus numbers but if read this v6
> quirk mechanism correctly even if we do not specify an mcfg entry for
> bus 0 oci_mcfg_match_quirks() is called anyway and we can set our
> special configuration space addresses for the root buses (i.e. I think
> we can have a clean MCFG table with entries only for those bus ranges
> that are really ECAM)  
> 
>>
>> This also means that, with the MCFG tables you have and current
>> mainline kernel you are able to probe a root bridge (because the MCFG
>> table covers the bus number that is not ECAM), with enumeration
>> going haywire because it is trying to carry out ECAM accesses on
>> non-ECAM space.
> 
> Yes correct, we cannot access the host controller configuration space
> with our current MCFG table and current Linux mainline
> 
>>
>> Is my reading correct ?
>>
>> Anyway, that's not stricly related to this discussion, it is time we
>> converge on this patchset, we can add a domain range if that
>> simplifies things.
> 
> IMO it would be better to have the domain range to avoid
> a very large and repetitive static quirk array

The v6 framework requires what, 21 additional lines of quirk data? What
if you were to define some preprocessor macros to slim it down? I think
something like the following would bring it down to roughly 7 additional
lines.

#define PCI_ACPI_QUIRK_QUAD_DOM(rev, dom, ops) \
    { "HISI ", rev, 0, dom+0, MCFG_BUS_ANY, ops,
      MCFG_RES_EMPTY}, \
    { "HISI ", rev, 0, dom+1, MCFG_BUS_ANY, ops,
      MCFG_RES_EMPTY}, \
    { "HISI ", rev, 0, dom+2, MCFG_BUS_ANY, ops,
      MCFG_RES_EMPTY}, \
    { "HISI ", rev, 0, dom+3, MCFG_BUS_ANY, ops,
      MCFG_RES_EMPTY},

PCI_ACPI_QUIRK_QUAD_DOM("HIP05 ", 0, &hisi_pcie_hip05_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP06 ", 0, &hisi_pcie_hip05_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 0, &hisi_pcie_hip06_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 4, &hisi_pcie_hip07_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 8, &hisi_pcie_hip07_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 12, &hisi_pcie_hip07_ops)

Cov
-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code
Aurora Forum, a Linux Foundation Collaborative Project.

WARNING: multiple messages have this Message-ID (diff)
From: cov@codeaurora.org (Christopher Covington)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V6 2/5] PCI/ACPI: Check platform specific ECAM quirks
Date: Fri, 16 Sep 2016 08:27:40 -0400	[thread overview]
Message-ID: <42c3f965-b40c-f2bb-e12c-34da6af1a4b7@codeaurora.org> (raw)
In-Reply-To: <EE11001F9E5DDD47B7634E2F8A612F2E1F8730EA@lhreml507-mbx>

On 09/16/2016 05:02 AM, Gabriele Paoloni wrote:
> Hi Lorenzo and Tomasz
> 
> Many Thanks for looking at this
> 
>> -----Original Message-----
>> From: Lorenzo Pieralisi [mailto:lorenzo.pieralisi at arm.com]
>> Sent: 15 September 2016 11:59
>> To: liudongdong (C)
>> Cc: Tomasz Nowicki; helgaas at kernel.org; will.deacon at arm.com;
>> catalin.marinas at arm.com; rafael at kernel.org; arnd at arndb.de;
>> hanjun.guo at linaro.org; okaya at codeaurora.org; jchandra at broadcom.com;
>> cov at codeaurora.org; dhdang at apm.com; ard.biesheuvel at linaro.org;
>> robert.richter at caviumnetworks.com; mw at semihalf.com;
>> Liviu.Dudau at arm.com; ddaney at caviumnetworks.com; Wangyijing;
>> msalter at redhat.com; linux-pci at vger.kernel.org; linux-arm-
>> kernel at lists.infradead.org; linaro-acpi at lists.linaro.org;
>> jcm at redhat.com; andrea.gallo at linaro.org; jeremy.linton at arm.com;
>> Gabriele Paoloni; jhugo at codeaurora.org; linux-acpi at vger.kernel.org;
>> linux-kernel at vger.kernel.org
>> Subject: Re: [PATCH V6 2/5] PCI/ACPI: Check platform specific ECAM
>> quirks
>>
>> On Tue, Sep 13, 2016 at 07:38:39PM +0800, Dongdong Liu wrote:
>>
>> [...]
>>
>>> Our host bridge is non ECAM only for the RC bus config space;
>>> for any other bus underneath the root bus we support ECAM access.
>>>
>>> RC config resource with hardcode as DEFINE_RES_MEM(0xb0070000,
>> SZ_4K),
>>> EP config resource we get it from MCFG table.
>>> So we need to override ops, but config resource we only need to
>> hardcode with RC config resource.
>>>
>>> Our host controller ACPI support patch can be found:
>>> https://lkml.org/lkml/2016/8/31/340
>>
>> Sorry I misread your code. IIUC you create an array of resources that
>> represent non-ECAM config space (and incidentally contain debug
>> registers to check the link status - that you need to check for every
>> given config access (?)), but you still need to have an MCFG entry that
> 
> The link status check is inherited from the designware framework (see
> http://lxr.free-electrons.com/source/drivers/pci/host/pcie-designware.c#L678)
> 
> However I think that in this case we can just check the link status
> in our init function and return an error if the link is down
> 
>> covers the bus number subject to quirk to make sure this mechanism
>> works. Correct ?
> 
> Well we need the quirks for the root bus numbers but if read this v6
> quirk mechanism correctly even if we do not specify an mcfg entry for
> bus 0 oci_mcfg_match_quirks() is called anyway and we can set our
> special configuration space addresses for the root buses (i.e. I think
> we can have a clean MCFG table with entries only for those bus ranges
> that are really ECAM)  
> 
>>
>> This also means that, with the MCFG tables you have and current
>> mainline kernel you are able to probe a root bridge (because the MCFG
>> table covers the bus number that is not ECAM), with enumeration
>> going haywire because it is trying to carry out ECAM accesses on
>> non-ECAM space.
> 
> Yes correct, we cannot access the host controller configuration space
> with our current MCFG table and current Linux mainline
> 
>>
>> Is my reading correct ?
>>
>> Anyway, that's not stricly related to this discussion, it is time we
>> converge on this patchset, we can add a domain range if that
>> simplifies things.
> 
> IMO it would be better to have the domain range to avoid
> a very large and repetitive static quirk array

The v6 framework requires what, 21 additional lines of quirk data? What
if you were to define some preprocessor macros to slim it down? I think
something like the following would bring it down to roughly 7 additional
lines.

#define PCI_ACPI_QUIRK_QUAD_DOM(rev, dom, ops) \
    { "HISI ", rev, 0, dom+0, MCFG_BUS_ANY, ops,
      MCFG_RES_EMPTY}, \
    { "HISI ", rev, 0, dom+1, MCFG_BUS_ANY, ops,
      MCFG_RES_EMPTY}, \
    { "HISI ", rev, 0, dom+2, MCFG_BUS_ANY, ops,
      MCFG_RES_EMPTY}, \
    { "HISI ", rev, 0, dom+3, MCFG_BUS_ANY, ops,
      MCFG_RES_EMPTY},

PCI_ACPI_QUIRK_QUAD_DOM("HIP05 ", 0, &hisi_pcie_hip05_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP06 ", 0, &hisi_pcie_hip05_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 0, &hisi_pcie_hip06_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 4, &hisi_pcie_hip07_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 8, &hisi_pcie_hip07_ops)
PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 12, &hisi_pcie_hip07_ops)

Cov
-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code
Aurora Forum, a Linux Foundation Collaborative Project.

  reply	other threads:[~2016-09-16 12:28 UTC|newest]

Thread overview: 234+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-09 19:24 [PATCH V6 0/5] ECAM quirks handling for ARM64 platforms Tomasz Nowicki
2016-09-09 19:24 ` Tomasz Nowicki
2016-09-09 19:24 ` [PATCH V6 1/5] PCI/ACPI: Extend pci_mcfg_lookup() responsibilities Tomasz Nowicki
2016-09-09 19:24   ` Tomasz Nowicki
2016-09-09 19:24 ` [PATCH V6 2/5] PCI/ACPI: Check platform specific ECAM quirks Tomasz Nowicki
2016-09-09 19:24   ` Tomasz Nowicki
2016-09-12 22:24   ` Duc Dang
2016-09-12 22:24     ` Duc Dang
2016-09-12 22:24     ` Duc Dang
2016-09-12 22:47     ` Duc Dang
2016-09-12 22:47       ` Duc Dang
2016-09-12 22:47       ` Duc Dang
2016-09-13  5:58       ` Tomasz Nowicki
2016-09-13  5:58         ` Tomasz Nowicki
2016-09-13  5:58         ` Tomasz Nowicki
2016-09-13  6:37     ` Tomasz Nowicki
2016-09-13  6:37       ` Tomasz Nowicki
2016-09-13  6:37       ` Tomasz Nowicki
2016-09-13  2:36   ` Dongdong Liu
2016-09-13  2:36     ` Dongdong Liu
2016-09-13  2:36     ` Dongdong Liu
2016-09-13  6:32     ` Tomasz Nowicki
2016-09-13  6:32       ` Tomasz Nowicki
2016-09-13 11:38       ` Dongdong Liu
2016-09-13 11:38         ` Dongdong Liu
2016-09-13 11:38         ` Dongdong Liu
2016-09-14 12:40         ` Lorenzo Pieralisi
2016-09-14 12:40           ` Lorenzo Pieralisi
2016-09-15 10:58         ` Lorenzo Pieralisi
2016-09-15 10:58           ` Lorenzo Pieralisi
2016-09-16  9:02           ` Gabriele Paoloni
2016-09-16  9:02             ` Gabriele Paoloni
2016-09-16  9:02             ` Gabriele Paoloni
2016-09-16  9:02             ` Gabriele Paoloni
2016-09-16 12:27             ` Christopher Covington [this message]
2016-09-16 12:27               ` Christopher Covington
2016-09-16 12:27               ` Christopher Covington
2016-09-16 12:27               ` Christopher Covington
2016-09-16 13:42               ` Gabriele Paoloni
2016-09-16 13:42                 ` Gabriele Paoloni
2016-09-16 13:42                 ` Gabriele Paoloni
2016-09-16 13:42                 ` Gabriele Paoloni
2016-09-09 19:24 ` [PATCH V6 3/5] PCI: thunder-pem: Allow to probe PEM-specific register range for ACPI case Tomasz Nowicki
2016-09-09 19:24   ` Tomasz Nowicki
2016-09-19 18:09   ` Bjorn Helgaas
2016-09-19 18:09     ` Bjorn Helgaas
2016-09-20  7:23     ` Tomasz Nowicki
2016-09-20  7:23       ` Tomasz Nowicki
2016-09-20 13:33       ` Bjorn Helgaas
2016-09-20 13:33         ` Bjorn Helgaas
2016-09-20 13:33         ` Bjorn Helgaas
2016-09-20 13:40         ` Ard Biesheuvel
2016-09-20 13:40           ` Ard Biesheuvel
2016-09-20 13:40           ` Ard Biesheuvel
2016-09-20 13:40           ` Ard Biesheuvel
2016-09-20 14:05           ` Bjorn Helgaas
2016-09-20 14:05             ` Bjorn Helgaas
2016-09-20 14:05             ` Bjorn Helgaas
2016-09-20 14:05             ` Bjorn Helgaas
2016-09-20 15:09             ` Ard Biesheuvel
2016-09-20 15:09               ` Ard Biesheuvel
2016-09-20 15:09               ` Ard Biesheuvel
2016-09-20 15:09               ` Ard Biesheuvel
2016-09-20 19:17               ` Bjorn Helgaas
2016-09-20 19:17                 ` Bjorn Helgaas
2016-09-20 19:17                 ` Bjorn Helgaas
2016-09-20 19:17                 ` Bjorn Helgaas
2016-09-21 14:05                 ` Lorenzo Pieralisi
2016-09-21 14:05                   ` Lorenzo Pieralisi
2016-09-21 14:05                   ` Lorenzo Pieralisi
2016-09-21 14:05                   ` Lorenzo Pieralisi
2016-09-21 18:04                   ` Bjorn Helgaas
2016-09-21 18:04                     ` Bjorn Helgaas
2016-09-21 18:04                     ` Bjorn Helgaas
2016-09-21 18:04                     ` Bjorn Helgaas
2016-09-21 18:58                     ` Duc Dang
2016-09-21 18:58                       ` Duc Dang
2016-09-21 18:58                       ` Duc Dang
2016-09-21 18:58                       ` Duc Dang
2016-09-21 19:18                       ` Bjorn Helgaas
2016-09-21 19:18                         ` Bjorn Helgaas
2016-09-21 19:18                         ` Bjorn Helgaas
2016-09-21 19:18                         ` Bjorn Helgaas
2016-09-23 10:53                         ` Tomasz Nowicki
2016-09-23 10:53                           ` Tomasz Nowicki
2016-09-23 10:53                           ` Tomasz Nowicki
2016-09-23 10:53                           ` Tomasz Nowicki
2016-09-22  9:49                     ` Lorenzo Pieralisi
2016-09-22  9:49                       ` Lorenzo Pieralisi
2016-09-22  9:49                       ` Lorenzo Pieralisi
2016-09-22  9:49                       ` Lorenzo Pieralisi
2016-09-22 11:10                       ` Gabriele Paoloni
2016-09-22 11:10                         ` Gabriele Paoloni
2016-09-22 11:10                         ` Gabriele Paoloni
2016-09-22 11:10                         ` Gabriele Paoloni
2016-09-22 12:44                         ` Lorenzo Pieralisi
2016-09-22 12:44                           ` Lorenzo Pieralisi
2016-09-22 12:44                           ` Lorenzo Pieralisi
2016-09-22 12:44                           ` Lorenzo Pieralisi
2016-09-22 18:31                           ` Bjorn Helgaas
2016-09-22 18:31                             ` Bjorn Helgaas
2016-09-22 18:31                             ` Bjorn Helgaas
2016-09-22 18:31                             ` Bjorn Helgaas
2016-09-22 22:10                             ` Bjorn Helgaas
2016-09-22 22:10                               ` Bjorn Helgaas
2016-09-22 22:10                               ` Bjorn Helgaas
2016-09-22 22:10                               ` Bjorn Helgaas
2016-09-23 10:11                               ` Lorenzo Pieralisi
2016-09-23 10:11                                 ` Lorenzo Pieralisi
2016-09-23 10:11                                 ` Lorenzo Pieralisi
2016-09-23 10:11                                 ` Lorenzo Pieralisi
2016-09-23 10:58                                 ` Gabriele Paoloni
2016-09-23 10:58                                   ` Gabriele Paoloni
2016-09-23 10:58                                   ` Gabriele Paoloni
2016-09-23 10:58                                   ` Gabriele Paoloni
2017-09-14 14:06                                   ` Ard Biesheuvel
2017-09-14 14:06                                     ` Ard Biesheuvel
2017-09-14 14:06                                     ` Ard Biesheuvel
2017-09-26  8:23                                     ` Gabriele Paoloni
2017-09-26  8:23                                       ` Gabriele Paoloni
2017-09-26  8:23                                       ` Gabriele Paoloni
2017-09-26  8:23                                       ` Gabriele Paoloni
2016-09-22 14:20                       ` Christopher Covington
2016-09-22 14:20                         ` Christopher Covington
2016-09-22 14:20                         ` Christopher Covington
2016-09-22 14:20                         ` Christopher Covington
2016-09-21 14:10                 ` Gabriele Paoloni
2016-09-21 14:10                   ` Gabriele Paoloni
2016-09-21 14:10                   ` Gabriele Paoloni
2016-09-21 14:10                   ` Gabriele Paoloni
2016-09-21 18:59                   ` Bjorn Helgaas
2016-09-21 18:59                     ` Bjorn Helgaas
2016-09-21 18:59                     ` Bjorn Helgaas
2016-09-21 18:59                     ` Bjorn Helgaas
2016-09-22 11:12                     ` Gabriele Paoloni
2016-09-22 11:12                       ` Gabriele Paoloni
2016-09-22 11:12                       ` Gabriele Paoloni
2016-09-22 11:12                       ` Gabriele Paoloni
2016-09-09 19:24 ` [PATCH V6 4/5] PCI: thunder: Enable ACPI PCI controller for ThunderX pass2.x silicon version Tomasz Nowicki
2016-09-09 19:24   ` Tomasz Nowicki
2016-09-19 15:45   ` Bjorn Helgaas
2016-09-19 15:45     ` Bjorn Helgaas
2016-09-20  7:06     ` Tomasz Nowicki
2016-09-20  7:06       ` Tomasz Nowicki
2016-09-20 13:08       ` Bjorn Helgaas
2016-09-20 13:08         ` Bjorn Helgaas
2016-09-20 13:08         ` Bjorn Helgaas
2016-09-21  8:05         ` Tomasz Nowicki
2016-09-21  8:05           ` Tomasz Nowicki
2016-09-09 19:24 ` [PATCH V6 5/5] PCI: thunder: Enable ACPI PCI controller for ThunderX pass1.x " Tomasz Nowicki
2016-09-09 19:24   ` Tomasz Nowicki
2016-09-09 19:30 ` [PATCH V6 0/5] ECAM quirks handling for ARM64 platforms Tomasz Nowicki
2016-09-09 19:30   ` Tomasz Nowicki
2016-09-20 19:26 ` Bjorn Helgaas
2016-09-20 19:26   ` Bjorn Helgaas
2016-09-21  1:15   ` cov
2016-09-21  1:15     ` cov at codeaurora.org
2016-09-21 13:11     ` Bjorn Helgaas
2016-09-21 13:11       ` Bjorn Helgaas
2016-09-21 14:07       ` Sinan Kaya
2016-09-21 14:07         ` Sinan Kaya
2016-09-21 17:31         ` Bjorn Helgaas
2016-09-21 17:31           ` Bjorn Helgaas
2016-09-21 17:31           ` Bjorn Helgaas
2016-09-21 17:34           ` Sinan Kaya
2016-09-21 17:34             ` Sinan Kaya
2016-09-21 22:38           ` [PATCHv2] PCI: QDF2432 32 bit config space accessors Christopher Covington
2016-09-21 22:38             ` Christopher Covington
2016-10-31 21:48             ` Bjorn Helgaas
2016-10-31 21:48               ` Bjorn Helgaas
2016-11-01 13:06               ` cov
2016-11-01 13:06                 ` cov at codeaurora.org
2016-11-02 16:08                 ` Bjorn Helgaas
2016-11-02 16:08                   ` Bjorn Helgaas
2016-11-02 16:36                   ` Sinan Kaya
2016-11-02 16:36                     ` Sinan Kaya
2016-11-03 14:00                     ` Bjorn Helgaas
2016-11-03 14:00                       ` Bjorn Helgaas
2016-11-03 16:58                       ` Sinan Kaya
2016-11-03 16:58                         ` Sinan Kaya
2016-11-03 17:06                         ` Sinan Kaya
2016-11-03 17:06                           ` Sinan Kaya
2016-11-03 20:43                         ` Bjorn Helgaas
2016-11-03 20:43                           ` Bjorn Helgaas
2016-11-03 23:49                           ` Sinan Kaya
2016-11-03 23:49                             ` Sinan Kaya
2016-12-02  4:58                       ` Jon Masters
2016-12-02  4:58                         ` Jon Masters
2016-11-02 16:41                   ` Bjorn Helgaas
2016-11-02 16:41                     ` Bjorn Helgaas
2016-11-09 19:25                   ` Christopher Covington
2016-11-09 19:25                     ` Christopher Covington
2016-11-09 20:06                     ` Bjorn Helgaas
2016-11-09 20:06                       ` Bjorn Helgaas
2016-11-09 20:29                       ` Ard Biesheuvel
2016-11-09 20:29                         ` Ard Biesheuvel
2016-11-09 20:29                         ` Ard Biesheuvel
2016-11-09 20:29                         ` Ard Biesheuvel
2016-11-09 22:49                         ` Bjorn Helgaas
2016-11-09 22:49                           ` Bjorn Helgaas
2016-11-09 22:49                           ` Bjorn Helgaas
2016-11-09 22:49                           ` Bjorn Helgaas
2016-11-10 10:25                           ` Ard Biesheuvel
2016-11-10 10:25                             ` Ard Biesheuvel
2016-11-10 10:25                             ` Ard Biesheuvel
2016-11-10 10:25                             ` Ard Biesheuvel
2016-11-10 13:57                             ` Lorenzo Pieralisi
2016-11-10 13:57                               ` Lorenzo Pieralisi
2016-11-10 13:57                               ` Lorenzo Pieralisi
2016-11-10 13:57                               ` Lorenzo Pieralisi
2016-11-10 17:42                             ` Bjorn Helgaas
2016-11-10 17:42                               ` Bjorn Helgaas
2016-11-10 17:42                               ` Bjorn Helgaas
2016-11-10 17:42                               ` Bjorn Helgaas
2016-12-02  5:12                               ` Jon Masters
2016-12-02  5:12                                 ` Jon Masters
2016-12-02  5:12                                 ` Jon Masters
2016-12-02  5:12                                 ` Jon Masters
2016-09-21 22:40       ` [PATCH V6 0/5] ECAM quirks handling for ARM64 platforms Christopher Covington
2016-09-21 22:40         ` Christopher Covington
2016-09-22 23:08         ` Bjorn Helgaas
2016-09-22 23:08           ` Bjorn Helgaas
2016-09-23 18:41           ` Christopher Covington
2016-09-23 18:41             ` Christopher Covington
2016-09-23 19:17             ` Bjorn Helgaas
2016-09-23 19:17               ` Bjorn Helgaas
2016-09-23 19:17               ` Bjorn Helgaas
2016-09-23 19:22               ` Christopher Covington
2016-09-23 19:22                 ` Christopher Covington
2016-09-28 16:44               ` Christopher Covington
2016-11-24 11:05 ` [PATCH V6 1/1] ARM64/PCI: Manage controller-specific information on the host controller basis Tomasz Nowicki
2016-11-24 11:05   ` Tomasz Nowicki
2016-11-29 23:40   ` Bjorn Helgaas
2016-11-29 23:40     ` Bjorn Helgaas

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=42c3f965-b40c-f2bb-e12c-34da6af1a4b7@codeaurora.org \
    --to=cov@codeaurora.org \
    --cc=Liviu.Dudau@arm.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=ddaney@caviumnetworks.com \
    --cc=dhdang@apm.com \
    --cc=gabriele.paoloni@huawei.com \
    --cc=hanjun.guo@linaro.org \
    --cc=helgaas@kernel.org \
    --cc=jchandra@broadcom.com \
    --cc=liudongdong3@huawei.com \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mw@semihalf.com \
    --cc=okaya@codeaurora.org \
    --cc=rafael@kernel.org \
    --cc=robert.richter@caviumnetworks.com \
    --cc=tn@semihalf.com \
    --cc=wangyijing@huawei.com \
    --cc=will.deacon@arm.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 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.