diff mbox

PCI: use dev->irq instead of dev->pin to enable non MSI/INTx interrupt

Message ID 1342492551-13766-1-git-send-email-Shengzhou.Liu@freescale.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Shengzhou Liu July 17, 2012, 2:35 a.m. UTC
On some platforms, root port has neither MSI/MSI-X nor INTx interrupt
generated in RC mode. In this case, we have to use other interrupt(i.e.
system shared interrupt) for port service irq to have AER, Hot-plug, etc,
services to work.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
---
 drivers/pci/pcie/portdrv_core.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

Comments

Scott Wood July 17, 2012, 5:41 p.m. UTC | #1
On 07/16/2012 09:35 PM, Shengzhou Liu wrote:
> On some platforms, root port has neither MSI/MSI-X nor INTx interrupt
> generated in RC mode. In this case, we have to use other interrupt(i.e.
> system shared interrupt) for port service irq to have AER, Hot-plug, etc,
> services to work.
> 
> Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
> ---
>  drivers/pci/pcie/portdrv_core.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
> index 75915b3..a855254 100644
> --- a/drivers/pci/pcie/portdrv_core.c
> +++ b/drivers/pci/pcie/portdrv_core.c
> @@ -212,8 +212,13 @@ static int init_service_irqs(struct pci_dev *dev, int *irqs, int mask)
>  	if (!pcie_port_enable_msix(dev, irqs, mask))
>  		return 0;
>  
> -	/* We're not going to use MSI-X, so try MSI and fall back to INTx */
> -	if (!pci_enable_msi(dev) || dev->pin)
> +	/*
> +	 * We're not going to use MSI-X, so try MSI and fall back to INTx.
> +	 * If neither MSI/MSI-X nor INTx available, try other interrupt. (On
> +	 * some platforms, root port doesn't support generating MSI/MSI-X/INTx
> +	 * in RC mode)
> +	 */
> +	if (!pci_enable_msi(dev) || dev->irq)
>  		irq = dev->irq;

What about the other usage of dev->pin a few lines up?

-Scott

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Liu Shengzhou-B36685 July 18, 2012, 6:36 a.m. UTC | #2
> -----Original Message-----

> From: Wood Scott-B07421

> Sent: Wednesday, July 18, 2012 1:42 AM

> To: Liu Shengzhou-B36685

> Cc: bhelgaas@google.com; linux-pci@vger.kernel.org; linuxppc-

> dev@lists.ozlabs.org

> Subject: Re: [PATCH] PCI: use dev->irq instead of dev->pin to enable non

> MSI/INTx interrupt

> 

> On 07/16/2012 09:35 PM, Shengzhou Liu wrote:

> > On some platforms, root port has neither MSI/MSI-X nor INTx interrupt

> > generated in RC mode. In this case, we have to use other interrupt(i.e.

> > system shared interrupt) for port service irq to have AER, Hot-plug,

> > etc, services to work.

> >

> > Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>

> > ---

> >  drivers/pci/pcie/portdrv_core.c |    9 +++++++--

> >  1 files changed, 7 insertions(+), 2 deletions(-)

> >

> > diff --git a/drivers/pci/pcie/portdrv_core.c

> > b/drivers/pci/pcie/portdrv_core.c index 75915b3..a855254 100644

> > --- a/drivers/pci/pcie/portdrv_core.c

> > +++ b/drivers/pci/pcie/portdrv_core.c

> > @@ -212,8 +212,13 @@ static int init_service_irqs(struct pci_dev *dev, int

> *irqs, int mask)

> >  	if (!pcie_port_enable_msix(dev, irqs, mask))

> >  		return 0;

> >

> > -	/* We're not going to use MSI-X, so try MSI and fall back to INTx */

> > -	if (!pci_enable_msi(dev) || dev->pin)

> > +	/*

> > +	 * We're not going to use MSI-X, so try MSI and fall back to INTx.

> > +	 * If neither MSI/MSI-X nor INTx available, try other interrupt. (On

> > +	 * some platforms, root port doesn't support generating MSI/MSI-X/INTx

> > +	 * in RC mode)

> > +	 */

> > +	if (!pci_enable_msi(dev) || dev->irq)

> >  		irq = dev->irq;

> 

> What about the other usage of dev->pin a few lines up?

> 

> -Scott

Yes, it should be consistent with bottom, done in v2.
Thanks,
Shengzhou
diff mbox

Patch

diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index 75915b3..a855254 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -212,8 +212,13 @@  static int init_service_irqs(struct pci_dev *dev, int *irqs, int mask)
 	if (!pcie_port_enable_msix(dev, irqs, mask))
 		return 0;
 
-	/* We're not going to use MSI-X, so try MSI and fall back to INTx */
-	if (!pci_enable_msi(dev) || dev->pin)
+	/*
+	 * We're not going to use MSI-X, so try MSI and fall back to INTx.
+	 * If neither MSI/MSI-X nor INTx available, try other interrupt. (On
+	 * some platforms, root port doesn't support generating MSI/MSI-X/INTx
+	 * in RC mode)
+	 */
+	if (!pci_enable_msi(dev) || dev->irq)
 		irq = dev->irq;
 
  no_msi: