Skip to contentSkip to conversation

genwqe: use pci_irq_allocate_vectors

PATCH In review Gabriel Krisman Bertazi 2 participants 3 messages Oct 4, 2016 – Oct 7, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 genwqe: use pci_irq_allocate_vectors

From: Christoph Hellwig <[email protected]>

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.

---
 drivers/misc/genwqe/card_base.h  |  1 -
 drivers/misc/genwqe/card_utils.c | 12 ++----------
 2 files changed, 2 insertions(+), 11 deletions(-)
drivers/misc/genwqe/card_base.h +0 -1
index cb851c14ca4b..5813b5f25006 100644
@@ -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 */
drivers/misc/genwqe/card_utils.c +2 -10
index 8a679ecc8fd1..be79f78da8f8 100644
@@ -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);
 }
 
 /**
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 MAINTAINERS: Add entry for genwqe driver

Frank and I maintain this

---
 MAINTAINERS | 6 ++++++
 1 file changed, 6 insertions(+)
MAINTAINERS +6 -0
index bd69bc0ed717..db20c3204606 100644
@@ -5220,6 +5220,12 @@ M:	Joe Perches <[email protected]>
 S:	Maintained
 F:	scripts/get_maintainer.pl
 
+GENWQE (IBM Generic Workqueue Card)
+M:	Frank Haverkamp <[email protected]>
+M:	Gabriel Krisman Bertazi <[email protected]>
+S:	Supported
+F:	drivers/misc/genwqe/
+
 GFS2 FILE SYSTEM
 M:	Steven Whitehouse <[email protected]>
 M:	Bob Peterson <[email protected]>
Signature · 1 line
2.7.4
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] MAINTAINERS: Add entry for genwqe driver

Hi Gabriel,

Quoted 24 lines · Gabriel Krisman Bertazi

Frank and I maintain this

---
MAINTAINERS | 6 ++++++

1 file changed, 6 insertions(+)
MAINTAINERS +0 -0
index bd69bc0ed717..db20c3204606 100644
@@ -5220,6 +5220,12 @@ M:	Joe Perches <[email protected]>

S: Maintained
F: scripts/get_maintainer.pl

MAINTAINERS +6 -0
+GENWQE (IBM Generic Workqueue Card)
+M:	Frank Haverkamp <[email protected]>
+M:	Gabriel Krisman Bertazi <[email protected]>
+S:	Supported
+F:	drivers/misc/genwqe/
+
Quoted 6 lines

GFS2 FILE SYSTEM
M: Steven Whitehouse <[email protected]>
M: Bob Peterson <[email protected]>

Signature · 1 line
2.7.4

Agreed.