All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Tomasz Nowicki <tn@semihalf.com>
Cc: linux-pci@vger.kernel.org,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Gabriele Paoloni <gabriele.paoloni@huawei.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Duc Dang <dhdang@apm.com>, Sinan Kaya <okaya@codeaurora.org>,
	Christopher Covington <cov@codeaurora.org>,
	Dongdong Liu <liudongdong3@huawei.com>
Subject: Re: [PATCH v10 12/12] PCI: Add MCFG quirks for Cavium ThunderX pass1.x host controller
Date: Thu, 1 Dec 2016 14:24:16 -0600	[thread overview]
Message-ID: <20161201202416.GB8263@bhelgaas-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <acb37ba2-e92e-f35b-d650-798193f7c9a5@semihalf.com>

On Thu, Dec 01, 2016 at 08:02:29PM +0100, Tomasz Nowicki wrote:
> On 01.12.2016 09:31, Bjorn Helgaas wrote:
> >From: Tomasz Nowicki <tn@semihalf.com>
> >
> >ThunderX pass1.x requires to emulate the EA headers for on-chip devices
> >hence it has to use custom pci_thunder_ecam_ops for accessing PCI config
> >space (pci-thuner-ecam.c). Add new entries to MCFG quirk array where it can
> >be applied while probing ACPI based PCI host controller.
> >
> >ThunderX pass1.x is using the same way for accessing off-chip devices
> >(so-called PEM) as silicon pass-2.x so we need to add PEM quirk entries
> >too.
> >
> >Quirk is considered for ThunderX silicon pass1.x only which is identified
> >via MCFG revision 2.
> >
> >[bhelgaas: change Makefile/ifdefs so quirk doesn't depend on
> >CONFIG_PCI_HOST_THUNDER_ECAM]
> >Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
> >Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> >---
> > drivers/acpi/pci_mcfg.c             |   15 +++++++++++++++
> > drivers/pci/host/Makefile           |    2 +-
> > drivers/pci/host/pci-thunder-ecam.c |    9 ++++++++-
> > include/linux/pci-ecam.h            |    1 +
> > 4 files changed, 25 insertions(+), 2 deletions(-)
> >
> >diff --git a/drivers/acpi/pci_mcfg.c b/drivers/acpi/pci_mcfg.c
> >index a48b508..cdceaf5 100644
> >--- a/drivers/acpi/pci_mcfg.c
> >+++ b/drivers/acpi/pci_mcfg.c
> >@@ -93,6 +93,21 @@ static struct mcfg_fixup mcfg_quirks[] = {
> > 	/* SoC pass2.x */
> > 	THUNDER_PEM_QUIRK(1, 0UL),
> > 	THUNDER_PEM_QUIRK(1, 1UL),
> >+
> >+#define THUNDER_ECAM_QUIRK(rev, node)					\
> >+	{ "CAVIUM", "THUNDERX", rev, node, MCFG_BUS_ANY,		\
> >+	&pci_thunder_ecam_ops },
> 
> Nit: 0-3 and 10-11 are segment ranges:
> 
> +#define THUNDER_ECAM_QUIRK(rev, seg)			\
> +	{ "CAVIUM", "THUNDERX", rev, seg, MCFG_BUS_ANY,	\
> +	&pci_thunder_ecam_ops },

> > extern struct pci_ecam_ops thunder_pem_ecam_ops; /* Cavium ThunderX 2.x */
> >+extern struct pci_ecam_ops pci_thunder_ecam_ops; /* Cavium ThunderX 1.x */
> 
> nit: thunder_pem_ecam_ops is also valid for ThunderX pass1.x too. We
> add relevant entries to mcfg_quirks array above. Also we use passY.X
> for SoC version.
> 
> extern struct pci_ecam_ops thunder_pem_ecam_ops; /* Cavium ThunderX
> pass2.x and pass1.x */
> extern struct pci_ecam_ops pci_thunder_ecam_ops; /* Cavium ThunderX
> pass1.x */

I updated these with the following incremental diff.  I hope this is what
you meant!

diff --git a/drivers/acpi/pci_mcfg.c b/drivers/acpi/pci_mcfg.c
index f4e9c1c..d34d196 100644
--- a/drivers/acpi/pci_mcfg.c
+++ b/drivers/acpi/pci_mcfg.c
@@ -95,7 +95,7 @@ static struct mcfg_fixup mcfg_quirks[] = {
 	THUNDER_PEM_QUIRK(1, 1UL),
 
 #define THUNDER_ECAM_QUIRK(rev, seg)					\
-	{ "CAVIUM", "THUNDERX", rev, seg, MCFG_BUS_ANY,		\
+	{ "CAVIUM", "THUNDERX", rev, seg, MCFG_BUS_ANY,			\
 	&pci_thunder_ecam_ops }
 	/* SoC pass1.x */
 	THUNDER_PEM_QUIRK(2,  0),	/* off-chip devices */
diff --git a/include/linux/pci-ecam.h b/include/linux/pci-ecam.h
index 2afa70b..00eb8eb 100644
--- a/include/linux/pci-ecam.h
+++ b/include/linux/pci-ecam.h
@@ -62,7 +62,7 @@ extern struct pci_ecam_ops pci_generic_ecam_ops;
 #if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)
 extern struct pci_ecam_ops pci_32b_ops;		/* 32-bit accesses only */
 extern struct pci_ecam_ops hisi_pcie_ops;	/* HiSilicon */
-extern struct pci_ecam_ops thunder_pem_ecam_ops; /* Cavium ThunderX 2.x */
+extern struct pci_ecam_ops thunder_pem_ecam_ops; /* Cavium ThunderX 1.x & 2.x */
 extern struct pci_ecam_ops pci_thunder_ecam_ops; /* Cavium ThunderX 1.x */
 #endif
 

  reply	other threads:[~2016-12-01 20:24 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-01  8:29 [PATCH v10 00/12] PCI: ARM64 ECAM quirks Bjorn Helgaas
2016-12-01  8:29 ` [PATCH v10 01/12] ACPI: Add acpi_resource_consumer() to find device that claims a resource Bjorn Helgaas
2016-12-01 13:17   ` Rafael J. Wysocki
2016-12-01 16:35     ` Bjorn Helgaas
2016-12-01  8:29 ` [PATCH v10 02/12] PCI: Search ACPI namespace to ensure ECAM space is reserved Bjorn Helgaas
2016-12-01 14:17   ` Lorenzo Pieralisi
2016-12-01 18:05     ` Bjorn Helgaas
2016-12-01  8:29 ` [PATCH v10 03/12] x86/PCI: Use acpi_resource_consumer() to search ACPI namespace for MMCFG Bjorn Helgaas
2016-12-01  8:29 ` [PATCH v10 04/12] arm64: PCI: Manage controller-specific data on per-controller basis Bjorn Helgaas
2016-12-01  8:30 ` [PATCH v10 05/12] PCI/ACPI: Extend pci_mcfg_lookup() to return ECAM config accessors Bjorn Helgaas
2016-12-01  8:30 ` [PATCH v10 06/12] PCI/ACPI: Check for platform-specific MCFG quirks Bjorn Helgaas
2016-12-01  8:30 ` [PATCH v10 07/12] PCI/ACPI: Provide acpi_get_rc_resources() for ARM64 platform Bjorn Helgaas
2016-12-01  8:30 ` [PATCH v10 08/12] PCI: Add MCFG quirks for Qualcomm QDF2432 host controller Bjorn Helgaas
2016-12-01  8:30 ` [PATCH v10 09/12] PCI: Add MCFG quirks for HiSilicon Hip05/06/07 host controllers Bjorn Helgaas
2016-12-01  8:30 ` [PATCH v10 10/12] PCI: thunder-pem: Factor out resource lookup Bjorn Helgaas
2016-12-01  8:30 ` [PATCH v10 11/12] PCI: Add MCFG quirks for Cavium ThunderX pass2.x host controller Bjorn Helgaas
2016-12-02 17:35   ` Bjorn Helgaas
2016-12-05  8:32     ` Tomasz Nowicki
2016-12-01  8:31 ` [PATCH v10 12/12] PCI: Add MCFG quirks for Cavium ThunderX pass1.x " Bjorn Helgaas
2016-12-01 19:02   ` Tomasz Nowicki
2016-12-01 20:24     ` Bjorn Helgaas [this message]
2016-12-01 13:02 ` [PATCH v10 00/12] PCI: ARM64 ECAM quirks Dongdong Liu
2016-12-01 14:04   ` Dongdong Liu
2016-12-01 16:31     ` Bjorn Helgaas
2016-12-02  3:46       ` Dongdong Liu
2016-12-02  8:15         ` Hanjun Guo
2016-12-02 21:22           ` Bjorn Helgaas
2016-12-01 18:01 ` Bjorn Helgaas
2016-12-02 11:42   ` Dongdong Liu
2016-12-01 21:53 ` Gabriele Paoloni
2016-12-02 14:20 ` Tomasz Nowicki
2016-12-02 21:57   ` Bjorn Helgaas
2016-12-05 12:36     ` Tomasz Nowicki
2016-12-06 18:56       ` 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=20161201202416.GB8263@bhelgaas-glaptop.roam.corp.google.com \
    --to=helgaas@kernel.org \
    --cc=cov@codeaurora.org \
    --cc=dhdang@apm.com \
    --cc=gabriele.paoloni@huawei.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=liudongdong3@huawei.com \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=okaya@codeaurora.org \
    --cc=rafael@kernel.org \
    --cc=tn@semihalf.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.