LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: bp@suse.de, linux-edac@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Johannes Thumshirn <jthumshirn@suse.de>
Subject: [PATCH] edac: Don't call mpc85xx_pci_err_probe() from fsl_pci_probe()
Date: Wed,  9 Dec 2015 16:59:16 +0100	[thread overview]
Message-ID: <1449676756-22633-1-git-send-email-jthumshirn@suse.de> (raw)
In-Reply-To: <1449657167.17265.4.camel@ellerman.id.au>

Don't call mpc85xx_pci_err_probe() from fsl_pci_probe() but instantiate the
PCI EDAC driver via the OpenFirmware interface.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---

Patch is untested due to lack of hardware and against Boris' for-next branch,
please test.
Thanks,
	Johannes


 arch/powerpc/sysdev/fsl_pci.c |  2 --
 arch/powerpc/sysdev/fsl_pci.h |  9 ---------
 drivers/edac/mpc85xx_edac.c   | 35 +++++++++++++++++++++++++++++++++--
 3 files changed, 33 insertions(+), 13 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 610f472..5c59037 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -1263,8 +1263,6 @@ static int fsl_pci_probe(struct platform_device *pdev)
 	node = pdev->dev.of_node;
 	ret = fsl_add_bridge(pdev, fsl_pci_primary == node);
 
-	mpc85xx_pci_err_probe(pdev);
-
 	return 0;
 }
 
diff --git a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h
index c1cec77..1515885 100644
--- a/arch/powerpc/sysdev/fsl_pci.h
+++ b/arch/powerpc/sysdev/fsl_pci.h
@@ -130,15 +130,6 @@ void fsl_pci_assign_primary(void);
 static inline void fsl_pci_assign_primary(void) {}
 #endif
 
-#ifdef CONFIG_EDAC_MPC85XX
-int mpc85xx_pci_err_probe(struct platform_device *op);
-#else
-static inline int mpc85xx_pci_err_probe(struct platform_device *op)
-{
-	return -ENOTSUPP;
-}
-#endif
-
 #ifdef CONFIG_FSL_PCI
 extern int fsl_pci_mcheck_exception(struct pt_regs *);
 #else
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index 3eab063..c6fc8d5 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -238,7 +238,7 @@ static irqreturn_t mpc85xx_pci_isr(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-int mpc85xx_pci_err_probe(struct platform_device *op)
+static int mpc85xx_pci_err_probe(struct platform_device *op)
 {
 	struct edac_pci_ctl_info *pci;
 	struct mpc85xx_pci_pdata *pdata;
@@ -386,7 +386,37 @@ err:
 	devres_release_group(&op->dev, mpc85xx_pci_err_probe);
 	return res;
 }
-EXPORT_SYMBOL(mpc85xx_pci_err_probe);
+
+static const struct of_device_id mpc85xx_pci_err_of_match[] = {
+	{ .compatible = "fsl,mpc8540-pci", },
+	{ .compatible = "fsl,mpc8548-pcie", },
+	{ .compatible = "fsl,mpc8610-pci", },
+	{ .compatible = "fsl,mpc8641-pcie", },
+	{ .compatible = "fsl,qoriq-pcie", },
+	{ .compatible = "fsl,qoriq-pcie-v2.1", },
+	{ .compatible = "fsl,qoriq-pcie-v2.2", },
+	{ .compatible = "fsl,qoriq-pcie-v2.3", },
+	{ .compatible = "fsl,qoriq-pcie-v2.4", },
+	{ .compatible = "fsl,qoriq-pcie-v3.0", },
+
+	/*
+	 * The following entries are for compatibility with older device
+	 * trees.
+	 */
+	{ .compatible = "fsl,p1022-pcie", },
+	{ .compatible = "fsl,p4080-pcie", },
+
+	{},
+};
+MODULE_DEVICE_TABLE(of, mpc85xx_pci_err_of_match);
+
+static struct platform_driver mpc85xx_pci_err_driver = {
+	.driver = {
+		.name = "mpc85xx_edac_pci",
+		.of_match_table = mpc85xx_pci_err_of_match,
+	},
+	.probe = mpc85xx_pci_err_probe,
+};
 
 #endif				/* CONFIG_PCI */
 
@@ -1211,6 +1241,7 @@ static void __init mpc85xx_mc_clear_rfxe(void *data)
 static struct platform_driver * const drivers[] = {
 	&mpc85xx_mc_err_driver,
 	&mpc85xx_l2_err_driver,
+	&mpc85xx_pci_err_driver,
 };
 
 static int __init mpc85xx_mc_init(void)
-- 
2.6.3


      parent reply	other threads:[~2015-12-09 15:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08  4:49 linux-next: Tree for Dec 8 Stephen Rothwell
2015-12-09 10:32 ` Crash caused by "EDAC: Rip out the edac_subsys reference counting" (was Re: linux-next: Tree for Dec 8) Michael Ellerman
2015-12-09 11:17   ` Borislav Petkov
2015-12-09 16:03     ` Borislav Petkov
2015-12-09 16:50       ` Scott Wood
2015-12-09 17:38         ` Borislav Petkov
2015-12-09 17:57           ` Scott Wood
2015-12-09 19:20             ` Borislav Petkov
2015-12-09 15:59   ` Johannes Thumshirn [this message]

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=1449676756-22633-1-git-send-email-jthumshirn@suse.de \
    --to=jthumshirn@suse.de \
    --cc=bp@suse.de \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    /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;
as well as URLs for NNTP newsgroup(s).