All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] misc/GenWQE: fix pci_enable_msi usage
@ 2014-07-09 10:46 Sebastian Ott
  2014-07-09 11:34 ` Alexander Gordeev
  2014-07-16 21:10 ` Bjorn Helgaas
  0 siblings, 2 replies; 8+ messages in thread
From: Sebastian Ott @ 2014-07-09 10:46 UTC (permalink / raw)
  To: Frank Haverkamp, Bjorn Helgaas
  Cc: Greg Kroah-Hartman, Alexander Gordeev, linux-kernel

GenWQE used to call pci_enable_msi_block to allocate a desired number
of MSI's. If that was not possible pci_enable_msi_block returned with a
smaller number which might be possible to allocate. GenWQE then called
pci_enable_msi_block with that number.

Since commit a30d0108b
"GenWQE: Use pci_enable_msi_exact() instead of pci_enable_msi_block()"
pci_enable_msi_exact is used which fails if the desired number of MSI's
was not possible to allocate. Change GenWQE to use pci_enable_msi_range
to restore the old behavior.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
---
 drivers/misc/genwqe/card_ddcb.c  |  4 +---
 drivers/misc/genwqe/card_utils.c | 10 ++++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/misc/genwqe/card_ddcb.c b/drivers/misc/genwqe/card_ddcb.c
index c8046db..f66d43d 100644
--- a/drivers/misc/genwqe/card_ddcb.c
+++ b/drivers/misc/genwqe/card_ddcb.c
@@ -1237,9 +1237,7 @@ int genwqe_setup_service_layer(struct genwqe_dev *cd)
 	}
 
 	rc = genwqe_set_interrupt_capability(cd, GENWQE_MSI_IRQS);
-	if (rc > 0)
-		rc = genwqe_set_interrupt_capability(cd, rc);
-	if (rc != 0) {
+	if (rc) {
 		rc = -ENODEV;
 		goto stop_kthread;
 	}
diff --git a/drivers/misc/genwqe/card_utils.c b/drivers/misc/genwqe/card_utils.c
index 62cc6bb..6abc437 100644
--- a/drivers/misc/genwqe/card_utils.c
+++ b/drivers/misc/genwqe/card_utils.c
@@ -718,10 +718,12 @@ 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_exact(pci_dev, count);
-	if (rc == 0)
-		cd->flags |= GENWQE_FLAG_MSI_ENABLED;
-	return rc;
+	rc = pci_enable_msi_range(pci_dev, 1, count);
+	if (rc < 0)
+		return rc;
+
+	cd->flags |= GENWQE_FLAG_MSI_ENABLED;
+	return 0;
 }
 
 /**
-- 
1.9.3


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

end of thread, other threads:[~2014-07-21 18:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-09 10:46 [PATCH] misc/GenWQE: fix pci_enable_msi usage Sebastian Ott
2014-07-09 11:34 ` Alexander Gordeev
2014-07-09 11:44   ` Sebastian Ott
2014-07-16 13:38     ` Frank Haverkamp
2014-07-16 21:10 ` Bjorn Helgaas
2014-07-17 15:48   ` Frank Haverkamp
2014-07-18  8:46     ` Sebastian Ott
2014-07-21 18:24       ` Bjorn Helgaas

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.