From: Scott Wood <scottwood@freescale.com>
To: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Cc: <bhelgaas@google.com>, <linux-pci@vger.kernel.org>,
<linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH][upstream] PCI: Add PCI_DEV_FLAGS_USE_NON_MSI_INTX_IRQ to enable non MSI/INTx interrupt
Date: Thu, 12 Jul 2012 11:07:59 -0500 [thread overview]
Message-ID: <4FFEF65F.7080709@freescale.com> (raw)
In-Reply-To: <1342087342-14748-1-git-send-email-Shengzhou.Liu@freescale.com>
On 07/12/2012 05:02 AM, Shengzhou Liu wrote:
> 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 for port service driver to have
> AER, Hot-plug, etc, services to work. (i.e. there is the shared error interrupt
> on platform P1010/P3041/P4080 etc)
>
> Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
> ---
> drivers/pci/pcie/portdrv_core.c | 10 ++++++++--
> drivers/pci/quirks.c | 12 ++++++++++++
> include/linux/pci.h | 5 +++++
> 3 files changed, 25 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
> index 75915b3..837ad15 100644
> --- a/drivers/pci/pcie/portdrv_core.c
> +++ b/drivers/pci/pcie/portdrv_core.c
> @@ -212,8 +212,14 @@ 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.
> + * Eventually, 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->pin || ((dev->dev_flags &
> + PCI_DEV_FLAGS_USE_NON_MSI_INTX_IRQ) && dev->irq))
> irq = dev->irq;
I'd still like to hear someone say what specifically would go wrong if
we just did s/dev->pin/dev->irq/ (and even that much seems to be only
because the code is using a non-standard indicator of an invalid IRQ).
When would dev->irq contain a non-zero value that is not usable?
-Scott
WARNING: multiple messages have this Message-ID (diff)
From: Scott Wood <scottwood@freescale.com>
To: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH][upstream] PCI: Add PCI_DEV_FLAGS_USE_NON_MSI_INTX_IRQ to enable non MSI/INTx interrupt
Date: Thu, 12 Jul 2012 11:07:59 -0500 [thread overview]
Message-ID: <4FFEF65F.7080709@freescale.com> (raw)
In-Reply-To: <1342087342-14748-1-git-send-email-Shengzhou.Liu@freescale.com>
On 07/12/2012 05:02 AM, Shengzhou Liu wrote:
> 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 for port service driver to have
> AER, Hot-plug, etc, services to work. (i.e. there is the shared error interrupt
> on platform P1010/P3041/P4080 etc)
>
> Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
> ---
> drivers/pci/pcie/portdrv_core.c | 10 ++++++++--
> drivers/pci/quirks.c | 12 ++++++++++++
> include/linux/pci.h | 5 +++++
> 3 files changed, 25 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
> index 75915b3..837ad15 100644
> --- a/drivers/pci/pcie/portdrv_core.c
> +++ b/drivers/pci/pcie/portdrv_core.c
> @@ -212,8 +212,14 @@ 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.
> + * Eventually, 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->pin || ((dev->dev_flags &
> + PCI_DEV_FLAGS_USE_NON_MSI_INTX_IRQ) && dev->irq))
> irq = dev->irq;
I'd still like to hear someone say what specifically would go wrong if
we just did s/dev->pin/dev->irq/ (and even that much seems to be only
because the code is using a non-standard indicator of an invalid IRQ).
When would dev->irq contain a non-zero value that is not usable?
-Scott
next prev parent reply other threads:[~2012-07-12 16:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-12 10:02 [PATCH][upstream] PCI: Add PCI_DEV_FLAGS_USE_NON_MSI_INTX_IRQ to enable non MSI/INTx interrupt Shengzhou Liu
2012-07-12 10:02 ` Shengzhou Liu
2012-07-12 12:16 ` Kumar Gala
2012-07-12 12:16 ` Kumar Gala
2012-07-12 16:07 ` Scott Wood [this message]
2012-07-12 16:07 ` Scott Wood
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=4FFEF65F.7080709@freescale.com \
--to=scottwood@freescale.com \
--cc=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 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.