From: Christoph Hellwig <hch@lst.de>
To: linux-pci@vger.kernel.org, helgaas@kernel.org, agordeev@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] pci: call pci_intx when using legacy interrupts in pci_alloc_irq_vectors
Date: Thu, 11 Aug 2016 07:11:05 -0700 [thread overview]
Message-ID: <1470924665-25860-3-git-send-email-hch@lst.de> (raw)
In-Reply-To: <1470924665-25860-1-git-send-email-hch@lst.de>
ahci currently insists on an explicit call to pci_intx before falling back
from MSI or MSI-X to legacy irqs. As pci_intx is a no-op if the command
register already contains the right value is seems safe and useful to add
this call to pci_alloc_irq_vectors so that ahci can just use
pci_alloc_irq_vectors.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/pci/msi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 9233e7f..593698e 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -1200,8 +1200,11 @@ int pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
}
/* use legacy irq if allowed */
- if ((flags & PCI_IRQ_LEGACY) && min_vecs == 1)
+ if ((flags & PCI_IRQ_LEGACY) && min_vecs == 1) {
+ pci_intx(dev, 1);
return 1;
+ }
+
return vecs;
}
EXPORT_SYMBOL(pci_alloc_irq_vectors);
--
2.1.4
next prev parent reply other threads:[~2016-08-11 14:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-11 14:11 two pci_alloc_irq_vectors improvements Christoph Hellwig
2016-08-11 14:11 ` [PATCH 1/2] pci: use positive flags in pci_alloc_irq_vectors Christoph Hellwig
2016-08-18 8:46 ` Alexander Gordeev
2016-08-11 14:11 ` Christoph Hellwig [this message]
2016-08-18 9:20 ` [PATCH 2/2] pci: call pci_intx when using legacy interrupts " Alexander Gordeev
2016-08-18 10:33 ` Alexander Gordeev
2016-08-18 15:26 ` Christoph Hellwig
2016-08-22 11:02 ` Alexander Gordeev
2016-08-14 15:14 ` two pci_alloc_irq_vectors improvements Christoph Hellwig
2016-08-16 19:34 ` Bjorn Helgaas
2016-08-17 0:48 ` Christoph Hellwig
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=1470924665-25860-3-git-send-email-hch@lst.de \
--to=hch@lst.de \
--cc=agordeev@redhat.com \
--cc=helgaas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.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).