Commit 6b733521 authored by Alexander Gordeev's avatar Alexander Gordeev Committed by Christoph Hellwig

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: default avatarAlexander Gordeev <agordeev@redhat.com>
Reviewed-by: default avatarTomas Henzl <thenzl@redhat.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent c6b9bad2
...@@ -94,7 +94,7 @@ enum { ...@@ -94,7 +94,7 @@ enum {
}; };
struct csio_msix_entries { struct csio_msix_entries {
unsigned short vector; /* Vector assigned by pci_enable_msix */ unsigned short vector; /* Assigned MSI-X vector */
void *dev_id; /* Priv object associated w/ this msix*/ void *dev_id; /* Priv object associated w/ this msix*/
char desc[24]; /* Description of this vector */ char desc[24]; /* Description of this vector */
}; };
......
...@@ -499,7 +499,7 @@ csio_reduce_sqsets(struct csio_hw *hw, int cnt) ...@@ -499,7 +499,7 @@ csio_reduce_sqsets(struct csio_hw *hw, int cnt)
static int static int
csio_enable_msix(struct csio_hw *hw) csio_enable_msix(struct csio_hw *hw)
{ {
int rv, i, j, k, n, min, cnt; int i, j, k, n, min, cnt;
struct csio_msix_entries *entryp; struct csio_msix_entries *entryp;
struct msix_entry *entries; struct msix_entry *entries;
int extra = CSIO_EXTRA_VECS; int extra = CSIO_EXTRA_VECS;
...@@ -521,20 +521,16 @@ csio_enable_msix(struct csio_hw *hw) ...@@ -521,20 +521,16 @@ csio_enable_msix(struct csio_hw *hw)
csio_dbg(hw, "FW supp #niq:%d, trying %d msix's\n", hw->cfg_niq, cnt); csio_dbg(hw, "FW supp #niq:%d, trying %d msix's\n", hw->cfg_niq, cnt);
while ((rv = pci_enable_msix(hw->pdev, entries, cnt)) >= min) cnt = pci_enable_msix_range(hw->pdev, entries, min, cnt);
cnt = rv; if (cnt < 0) {
if (!rv) { kfree(entries);
return cnt;
}
if (cnt < (hw->num_sqsets + extra)) { if (cnt < (hw->num_sqsets + extra)) {
csio_dbg(hw, "Reducing sqsets to %d\n", cnt - extra); csio_dbg(hw, "Reducing sqsets to %d\n", cnt - extra);
csio_reduce_sqsets(hw, cnt - extra); csio_reduce_sqsets(hw, cnt - extra);
} }
} else {
if (rv > 0)
csio_info(hw, "Not using MSI-X, remainder:%d\n", rv);
kfree(entries);
return -ENOMEM;
}
/* Save off vectors */ /* Save off vectors */
for (i = 0; i < cnt; i++) { for (i = 0; i < cnt; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment