diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2014-07-09 06:46:39 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-09 17:16:48 -0400 |
commit | 7276883f1f98cd0a92fdc049f69bdc0912f7fc16 (patch) | |
tree | 6cd012e0005b3128c6034a5eb57c2dd95419b14a /drivers/misc | |
parent | d584f69d3217fb4336e58f14afca07d709b1c205 (diff) |
misc/GenWQE: fix pci_enable_msi usage
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>
Reviewed-by: Alexander Gordeev <agordeev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/genwqe/card_ddcb.c | 4 | ||||
-rw-r--r-- | 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 f0de6153bea2..dc9851a5540e 100644 --- a/drivers/misc/genwqe/card_ddcb.c +++ b/drivers/misc/genwqe/card_ddcb.c | |||
@@ -1251,9 +1251,7 @@ int genwqe_setup_service_layer(struct genwqe_dev *cd) | |||
1251 | } | 1251 | } |
1252 | 1252 | ||
1253 | rc = genwqe_set_interrupt_capability(cd, GENWQE_MSI_IRQS); | 1253 | rc = genwqe_set_interrupt_capability(cd, GENWQE_MSI_IRQS); |
1254 | if (rc > 0) | 1254 | if (rc) { |
1255 | rc = genwqe_set_interrupt_capability(cd, rc); | ||
1256 | if (rc != 0) { | ||
1257 | rc = -ENODEV; | 1255 | rc = -ENODEV; |
1258 | goto stop_kthread; | 1256 | goto stop_kthread; |
1259 | } | 1257 | } |
diff --git a/drivers/misc/genwqe/card_utils.c b/drivers/misc/genwqe/card_utils.c index 4a500582eef0..a6400f09229c 100644 --- a/drivers/misc/genwqe/card_utils.c +++ b/drivers/misc/genwqe/card_utils.c | |||
@@ -728,10 +728,12 @@ int genwqe_set_interrupt_capability(struct genwqe_dev *cd, int count) | |||
728 | int rc; | 728 | int rc; |
729 | struct pci_dev *pci_dev = cd->pci_dev; | 729 | struct pci_dev *pci_dev = cd->pci_dev; |
730 | 730 | ||
731 | rc = pci_enable_msi_exact(pci_dev, count); | 731 | rc = pci_enable_msi_range(pci_dev, 1, count); |
732 | if (rc == 0) | 732 | if (rc < 0) |
733 | cd->flags |= GENWQE_FLAG_MSI_ENABLED; | 733 | return rc; |
734 | return rc; | 734 | |
735 | cd->flags |= GENWQE_FLAG_MSI_ENABLED; | ||
736 | return 0; | ||
735 | } | 737 | } |
736 | 738 | ||
737 | /** | 739 | /** |