linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] PCI: use dev->irq instead of dev->pin to enable non MSI/INTx interrupt
@ 2012-07-18  6:06 Shengzhou Liu
  2012-07-26  3:45 ` Liu Shengzhou-B36685
  0 siblings, 1 reply; 5+ messages in thread
From: Shengzhou Liu @ 2012-07-18  6:06 UTC (permalink / raw)
  To: bhelgaas, linux-pci; +Cc: linuxppc-dev, Shengzhou Liu

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(e.g.
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 |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index 75915b3..49acf72 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -200,10 +200,13 @@ static int init_service_irqs(struct pci_dev *dev, int *irqs, int mask)
 {
 	int i, irq = -1;
 
-	/* We have to use INTx if MSI cannot be used for PCIe PME or pciehp. */
+	/*
+	 * We have to use INTx or other interrupts(e.g. system shared interrupt)
+	 * if MSI cannot be used for PCIe PME or pciehp.
+	 */
 	if (((mask & PCIE_PORT_SERVICE_PME) && pcie_pme_no_msi()) ||
 	    ((mask & PCIE_PORT_SERVICE_HP) && pciehp_no_msi())) {
-		if (dev->pin)
+		if (dev->irq)
 			irq = dev->irq;
 		goto no_msi;
 	}
@@ -212,8 +215,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:
-- 
1.6.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH v2] PCI: use dev->irq instead of dev->pin to enable non MSI/INTx interrupt
  2012-07-18  6:06 [PATCH v2] PCI: use dev->irq instead of dev->pin to enable non MSI/INTx interrupt Shengzhou Liu
@ 2012-07-26  3:45 ` Liu Shengzhou-B36685
  2012-08-07  3:45   ` Zang Roy-R61911
  0 siblings, 1 reply; 5+ messages in thread
From: Liu Shengzhou-B36685 @ 2012-07-26  3:45 UTC (permalink / raw)
  To: bhelgaas, linux-pci, akpm
  Cc: linuxppc-dev, Kumar Gala, Wood Scott-B07421, Liu Shengzhou-B36685

Hello, 

A gentle reminder!
Any comments are appreciated.


Regards,
Shengzhou


> -----Original Message-----
> From: Liu Shengzhou-B36685
> Sent: Wednesday, July 18, 2012 2:07 PM
> To: bhelgaas@google.com; linux-pci@vger.kernel.org
> Cc: linuxppc-dev@lists.ozlabs.org; Liu Shengzhou-B36685
> Subject: [PATCH v2] PCI: use dev->irq instead of dev->pin to enable non
> MSI/INTx interrupt
> 
> 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(e.g.
> 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 |   16 ++++++++++++----
>  1 files changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
> index 75915b3..49acf72 100644
> --- a/drivers/pci/pcie/portdrv_core.c
> +++ b/drivers/pci/pcie/portdrv_core.c
> @@ -200,10 +200,13 @@ static int init_service_irqs(struct pci_dev *dev, int
> *irqs, int mask)  {
>  	int i, irq = -1;
> 
> -	/* We have to use INTx if MSI cannot be used for PCIe PME or pciehp. */
> +	/*
> +	 * We have to use INTx or other interrupts(e.g. system shared interrupt)
> +	 * if MSI cannot be used for PCIe PME or pciehp.
> +	 */
>  	if (((mask & PCIE_PORT_SERVICE_PME) && pcie_pme_no_msi()) ||
>  	    ((mask & PCIE_PORT_SERVICE_HP) && pciehp_no_msi())) {
> -		if (dev->pin)
> +		if (dev->irq)
>  			irq = dev->irq;
>  		goto no_msi;
>  	}
> @@ -212,8 +215,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:
> --
> 1.6.4



^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH v2] PCI: use dev->irq instead of dev->pin to enable non MSI/INTx interrupt
  2012-07-26  3:45 ` Liu Shengzhou-B36685
@ 2012-08-07  3:45   ` Zang Roy-R61911
  2012-09-07 22:08     ` Bjorn Helgaas
  0 siblings, 1 reply; 5+ messages in thread
From: Zang Roy-R61911 @ 2012-08-07  3:45 UTC (permalink / raw)
  To: Liu Shengzhou-B36685, bhelgaas, linux-pci, akpm, Kumar Gala
  Cc: Wood Scott-B07421, linuxppc-dev, Liu Shengzhou-B36685



> -----Original Message-----
> From: Linuxppc-dev [mailto:linuxppc-dev-bounces+tie-
> fei.zang=freescale.com@lists.ozlabs.org] On Behalf Of Liu Shengzhou-B36685
> Sent: Thursday, July 26, 2012 11:45 AM
> To: bhelgaas@google.com; linux-pci@vger.kernel.org; akpm@linux-
> foundation.org
> Cc: Wood Scott-B07421; linuxppc-dev@lists.ozlabs.org; Liu Shengzhou-B36685
> Subject: RE: [PATCH v2] PCI: use dev->irq instead of dev->pin to enable non
> MSI/INTx interrupt
> 
> Hello,
> 
> A gentle reminder!
> Any comments are appreciated.

Who can help to review and pick up this patch?
Thanks.
Roy


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] PCI: use dev->irq instead of dev->pin to enable non MSI/INTx interrupt
  2012-08-07  3:45   ` Zang Roy-R61911
@ 2012-09-07 22:08     ` Bjorn Helgaas
  2012-09-09 14:42       ` Kumar Gala
  0 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2012-09-07 22:08 UTC (permalink / raw)
  To: Zang Roy-R61911
  Cc: Liu Shengzhou-B36685, linux-pci, akpm, Kumar Gala,
	Wood Scott-B07421, linuxppc-dev

On Mon, Aug 6, 2012 at 8:45 PM, Zang Roy-R61911 <r61911@freescale.com> wrote:
>
>
>> -----Original Message-----
>> From: Linuxppc-dev [mailto:linuxppc-dev-bounces+tie-
>> fei.zang=freescale.com@lists.ozlabs.org] On Behalf Of Liu Shengzhou-B36685
>> Sent: Thursday, July 26, 2012 11:45 AM
>> To: bhelgaas@google.com; linux-pci@vger.kernel.org; akpm@linux-
>> foundation.org
>> Cc: Wood Scott-B07421; linuxppc-dev@lists.ozlabs.org; Liu Shengzhou-B36685
>> Subject: RE: [PATCH v2] PCI: use dev->irq instead of dev->pin to enable non
>> MSI/INTx interrupt
>>
>> Hello,
>>
>> A gentle reminder!
>> Any comments are appreciated.
>
> Who can help to review and pick up this patch?

I merged this to a staging branch and will merge it to my "next"
branch as soon as it gets a build/smoke test by Fengguang.  Thanks!

Bjorn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] PCI: use dev->irq instead of dev->pin to enable non MSI/INTx interrupt
  2012-09-07 22:08     ` Bjorn Helgaas
@ 2012-09-09 14:42       ` Kumar Gala
  0 siblings, 0 replies; 5+ messages in thread
From: Kumar Gala @ 2012-09-09 14:42 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Zang Roy-R61911, Liu Shengzhou-B36685, linux-pci, akpm,
	Wood Scott-B07421, linuxppc-dev


On Sep 7, 2012, at 5:08 PM, Bjorn Helgaas wrote:

> On Mon, Aug 6, 2012 at 8:45 PM, Zang Roy-R61911 <r61911@freescale.com> wrote:
>> 
>> 
>>> -----Original Message-----
>>> From: Linuxppc-dev [mailto:linuxppc-dev-bounces+tie-
>>> fei.zang=freescale.com@lists.ozlabs.org] On Behalf Of Liu Shengzhou-B36685
>>> Sent: Thursday, July 26, 2012 11:45 AM
>>> To: bhelgaas@google.com; linux-pci@vger.kernel.org; akpm@linux-
>>> foundation.org
>>> Cc: Wood Scott-B07421; linuxppc-dev@lists.ozlabs.org; Liu Shengzhou-B36685
>>> Subject: RE: [PATCH v2] PCI: use dev->irq instead of dev->pin to enable non
>>> MSI/INTx interrupt
>>> 
>>> Hello,
>>> 
>>> A gentle reminder!
>>> Any comments are appreciated.
>> 
>> Who can help to review and pick up this patch?
> 
> I merged this to a staging branch and will merge it to my "next"
> branch as soon as it gets a build/smoke test by Fengguang.  Thanks!
> 
> Bjorn

Thanks

- k

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-09 14:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-18  6:06 [PATCH v2] PCI: use dev->irq instead of dev->pin to enable non MSI/INTx interrupt Shengzhou Liu
2012-07-26  3:45 ` Liu Shengzhou-B36685
2012-08-07  3:45   ` Zang Roy-R61911
2012-09-07 22:08     ` Bjorn Helgaas
2012-09-09 14:42       ` Kumar Gala

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).