diff options
author | Alexander Gordeev <agordeev@redhat.com> | 2014-08-18 02:01:50 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-09-16 12:09:56 -0400 |
commit | 6b73352134d9cd6ff1af1962799b738b4de604be (patch) | |
tree | 42c407873affc747db9f67d66a7be9eeddf74d37 | |
parent | c6b9bad280674a51f42929fc1fe6964ac3528dc8 (diff) |
csiostor: Use pci_enable_msix_range() instead of pci_enable_msix()
As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range() or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | drivers/scsi/csiostor/csio_hw.h | 2 | ||||
-rw-r--r-- | drivers/scsi/csiostor/csio_isr.c | 22 |
2 files changed, 10 insertions, 14 deletions
diff --git a/drivers/scsi/csiostor/csio_hw.h b/drivers/scsi/csiostor/csio_hw.h index 49b1daa4476e..5db2d85195b1 100644 --- a/drivers/scsi/csiostor/csio_hw.h +++ b/drivers/scsi/csiostor/csio_hw.h | |||
@@ -94,7 +94,7 @@ enum { | |||
94 | }; | 94 | }; |
95 | 95 | ||
96 | struct csio_msix_entries { | 96 | struct csio_msix_entries { |
97 | unsigned short vector; /* Vector assigned by pci_enable_msix */ | 97 | unsigned short vector; /* Assigned MSI-X vector */ |
98 | void *dev_id; /* Priv object associated w/ this msix*/ | 98 | void *dev_id; /* Priv object associated w/ this msix*/ |
99 | char desc[24]; /* Description of this vector */ | 99 | char desc[24]; /* Description of this vector */ |
100 | }; | 100 | }; |
diff --git a/drivers/scsi/csiostor/csio_isr.c b/drivers/scsi/csiostor/csio_isr.c index 91ba91dac675..a8c748a35f9c 100644 --- a/drivers/scsi/csiostor/csio_isr.c +++ b/drivers/scsi/csiostor/csio_isr.c | |||
@@ -499,7 +499,7 @@ csio_reduce_sqsets(struct csio_hw *hw, int cnt) | |||
499 | static int | 499 | static int |
500 | csio_enable_msix(struct csio_hw *hw) | 500 | csio_enable_msix(struct csio_hw *hw) |
501 | { | 501 | { |
502 | int rv, i, j, k, n, min, cnt; | 502 | int i, j, k, n, min, cnt; |
503 | struct csio_msix_entries *entryp; | 503 | struct csio_msix_entries *entryp; |
504 | struct msix_entry *entries; | 504 | struct msix_entry *entries; |
505 | int extra = CSIO_EXTRA_VECS; | 505 | int extra = CSIO_EXTRA_VECS; |
@@ -521,19 +521,15 @@ csio_enable_msix(struct csio_hw *hw) | |||
521 | 521 | ||
522 | csio_dbg(hw, "FW supp #niq:%d, trying %d msix's\n", hw->cfg_niq, cnt); | 522 | csio_dbg(hw, "FW supp #niq:%d, trying %d msix's\n", hw->cfg_niq, cnt); |
523 | 523 | ||
524 | while ((rv = pci_enable_msix(hw->pdev, entries, cnt)) >= min) | 524 | cnt = pci_enable_msix_range(hw->pdev, entries, min, cnt); |
525 | cnt = rv; | 525 | if (cnt < 0) { |
526 | if (!rv) { | ||
527 | if (cnt < (hw->num_sqsets + extra)) { | ||
528 | csio_dbg(hw, "Reducing sqsets to %d\n", cnt - extra); | ||
529 | csio_reduce_sqsets(hw, cnt - extra); | ||
530 | } | ||
531 | } else { | ||
532 | if (rv > 0) | ||
533 | csio_info(hw, "Not using MSI-X, remainder:%d\n", rv); | ||
534 | |||
535 | kfree(entries); | 526 | kfree(entries); |
536 | return -ENOMEM; | 527 | return cnt; |
528 | } | ||
529 | |||
530 | if (cnt < (hw->num_sqsets + extra)) { | ||
531 | csio_dbg(hw, "Reducing sqsets to %d\n", cnt - extra); | ||
532 | csio_reduce_sqsets(hw, cnt - extra); | ||
537 | } | 533 | } |
538 | 534 | ||
539 | /* Save off vectors */ | 535 | /* Save off vectors */ |