linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shengzhou Liu <Shengzhou.Liu@freescale.com>
To: <bhelgaas@google.com>
Cc: <linux-pci@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
	Shengzhou Liu <Shengzhou.Liu@freescale.com>
Subject: [PATCH] PCI: Add pcie_irq=other to enable non MSI/INTx interrupt for port service driver
Date: Mon, 9 Jul 2012 18:49:30 +0800	[thread overview]
Message-ID: <1341830970-12779-1-git-send-email-Shengzhou.Liu@freescale.com> (raw)

On some platforms, in RC mode, root port has neither MSI/MSI-X nor INTx
interrupt generated, which are available only in EP mode on those platform.
In this case, we try to use other interrupt if supported (i.e. there is the
shared error interrupt on platform P1010, P3041, P4080, etc) to have AER,
Hot-plug, etc, services to work.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
---
 Documentation/kernel-parameters.txt |    4 ++++
 drivers/pci/pcie/portdrv_core.c     |   19 +++++++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index a92c5eb..af97c81 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2218,6 +2218,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 		nomsi	Do not use MSI for native PCIe PME signaling (this makes
 			all PCIe root ports use INTx for all services).
 
+	pcie_irq=	[PCIE] Native PCIe root port interrupt options:
+		other	Try to use other interrupt when root port has
+			neither MSI/MSI-X nor INTx support.
+
 	pcmv=		[HW,PCMCIA] BadgePAD 4
 
 	pd.		[PARIDE]
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index 75915b3..653679e 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -30,6 +30,17 @@ static int __init pciehp_setup(char *str)
 }
 __setup("pcie_hp=", pciehp_setup);
 
+bool port_other_interrupt_enabled;
+
+static int __init portservice_setup(char *str)
+{
+	if (!strncmp(str, "other", 5))
+		port_other_interrupt_enabled = true;
+
+	return 1;
+}
+__setup("pcie_irq=", portservice_setup);
+
 /**
  * release_pcie_device - free PCI Express port service device structure
  * @dev: Port service device to release
@@ -216,6 +227,14 @@ static int init_service_irqs(struct pci_dev *dev, int *irqs, int mask)
 	if (!pci_enable_msi(dev) || dev->pin)
 		irq = dev->irq;
 
+	/*
+	 * On some platforms, root port has neither MSI/MSI-X nor INTx
+	 * interrupt support in RC mode, so try to use other interrupt(i.e.
+	 * shared interrupt if supported).
+	 */
+	else if (port_other_interrupt_enabled && dev->irq)
+		irq = dev->irq;
+
  no_msi:
 	for (i = 0; i < PCIE_PORT_DEVICE_MAXSERVICES; i++)
 		irqs[i] = irq;
-- 
1.6.4



             reply	other threads:[~2012-07-09 11:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-09 10:49 Shengzhou Liu [this message]
2012-07-09 16:39 ` [PATCH] PCI: Add pcie_irq=other to enable non MSI/INTx interrupt for port service driver Scott Wood
2012-07-10  6:13   ` Liu Shengzhou-B36685
2012-07-10 15:31     ` Scott Wood
2012-07-10 15:49       ` Kumar Gala
2012-07-11 11:29         ` Liu Shengzhou-B36685

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=1341830970-12779-1-git-send-email-Shengzhou.Liu@freescale.com \
    --to=shengzhou.liu@freescale.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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).