From: Christoph Hellwig <hch@lst.de>
To: hans.verkuil@cisco.com, brking@us.ibm.com,
haver@linux.vnet.ibm.com, ching2048@areca.com.tw, axboe@fb.com,
alex.williamson@redhat.com
Cc: kvm@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-block@vger.kernel.org, linux-media@vger.kernel.org,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 5/6] genwqe: use pci_irq_allocate_vectors
Date: Sun, 11 Sep 2016 15:31:27 +0200 [thread overview]
Message-ID: <1473600688-24043-6-git-send-email-hch@lst.de> (raw)
In-Reply-To: <1473600688-24043-1-git-send-email-hch@lst.de>
Simply the interrupt setup by using the new PCI layer helpers.
One odd thing about this driver is that it looks like it could request
multiple MSI vectors, but it will then only ever use a single one.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/misc/genwqe/card_base.h | 1 -
drivers/misc/genwqe/card_utils.c | 12 ++----------
2 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/misc/genwqe/card_base.h b/drivers/misc/genwqe/card_base.h
index cb851c1..5813b5f 100644
--- a/drivers/misc/genwqe/card_base.h
+++ b/drivers/misc/genwqe/card_base.h
@@ -41,7 +41,6 @@
#include "genwqe_driver.h"
#define GENWQE_MSI_IRQS 4 /* Just one supported, no MSIx */
-#define GENWQE_FLAG_MSI_ENABLED (1 << 0)
#define GENWQE_MAX_VFS 15 /* maximum 15 VFs are possible */
#define GENWQE_MAX_FUNCS 16 /* 1 PF and 15 VFs */
diff --git a/drivers/misc/genwqe/card_utils.c b/drivers/misc/genwqe/card_utils.c
index 222367c..da424c2 100644
--- a/drivers/misc/genwqe/card_utils.c
+++ b/drivers/misc/genwqe/card_utils.c
@@ -730,13 +730,10 @@ int genwqe_read_softreset(struct genwqe_dev *cd)
int genwqe_set_interrupt_capability(struct genwqe_dev *cd, int count)
{
int rc;
- struct pci_dev *pci_dev = cd->pci_dev;
- rc = pci_enable_msi_range(pci_dev, 1, count);
+ rc = pci_alloc_irq_vectors(cd->pci_dev, 1, count, PCI_IRQ_MSI);
if (rc < 0)
return rc;
-
- cd->flags |= GENWQE_FLAG_MSI_ENABLED;
return 0;
}
@@ -746,12 +743,7 @@ int genwqe_set_interrupt_capability(struct genwqe_dev *cd, int count)
*/
void genwqe_reset_interrupt_capability(struct genwqe_dev *cd)
{
- struct pci_dev *pci_dev = cd->pci_dev;
-
- if (cd->flags & GENWQE_FLAG_MSI_ENABLED) {
- pci_disable_msi(pci_dev);
- cd->flags &= ~GENWQE_FLAG_MSI_ENABLED;
- }
+ pci_free_irq_vectors(cd->pci_dev);
}
/**
--
2.1.4
next prev parent reply other threads:[~2016-09-11 13:31 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-11 13:31 replace pci_enable_msi_{exact_range} with pci_alloc_irq_vectors Christoph Hellwig
2016-09-11 13:31 ` [PATCH 1/6] arcmsr: use pci_alloc_irq_vectors Christoph Hellwig
2016-09-19 20:45 ` Martin K. Petersen
2016-10-11 20:16 ` Martin K. Petersen
2016-09-11 13:31 ` [PATCH 2/6] ipr: use pci_irq_allocate_vectors Christoph Hellwig
2016-09-19 20:44 ` Martin K. Petersen
2016-09-29 14:01 ` Brian King
2016-09-29 15:32 ` Christoph Hellwig
2016-10-11 20:18 ` Martin K. Petersen
2016-09-11 13:31 ` [PATCH 3/6] skd: use pci_alloc_irq_vectors Christoph Hellwig
2016-09-11 13:31 ` [PATCH 4/6] vfio_pci: use pci_irq_allocate_vectors Christoph Hellwig
2016-09-29 18:42 ` Christoph Hellwig
2016-09-29 19:21 ` Alex Williamson
2016-09-29 19:24 ` Christoph Hellwig
2016-09-29 19:27 ` Alex Williamson
2016-09-11 13:31 ` Christoph Hellwig [this message]
2016-09-29 18:28 ` [PATCH 5/6] genwqe: " Gabriel Krisman Bertazi
2016-09-29 18:37 ` Christoph Hellwig
2016-09-29 18:45 ` Gabriel Krisman Bertazi
2016-09-29 18:48 ` Christoph Hellwig
2016-09-29 18:51 ` Gabriel Krisman Bertazi
2016-09-11 13:31 ` [PATCH 6/6] media/cobalt: " Christoph Hellwig
2016-09-16 8:01 ` Hans Verkuil
2016-09-16 8:31 ` Christoph Hellwig
2016-12-14 10:29 ` Christoph Hellwig
2016-12-14 10:37 ` Hans Verkuil
2016-12-14 10:47 ` Christoph Hellwig
2016-12-14 10:52 ` Hans Verkuil
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=1473600688-24043-6-git-send-email-hch@lst.de \
--to=hch@lst.de \
--cc=alex.williamson@redhat.com \
--cc=axboe@fb.com \
--cc=brking@us.ibm.com \
--cc=ching2048@areca.com.tw \
--cc=hans.verkuil@cisco.com \
--cc=haver@linux.vnet.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-scsi@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).