diff options
author | Alexander Gordeev <agordeev@redhat.com> | 2014-03-12 17:08:50 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2014-03-19 18:04:41 -0400 |
commit | 60e76b771f349bb1b50e0b382ad8bf0296a53819 (patch) | |
tree | d476e9ae20ac007bba2162fffed8b2f1952b7a7f /drivers/scsi | |
parent | 739910de5bfdd47ba77a19fa54bad3b52ac0d633 (diff) |
[SCSI] ipr: Use pci_enable_msi_range() and pci_enable_msix_range()
As result 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() and pci_enable_msix_range()
interfaces.
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/ipr.c | 47 |
1 files changed, 18 insertions, 29 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 09fdfd747e34..3d7b6af98e5e 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -9317,51 +9317,40 @@ static void ipr_wait_for_pci_err_recovery(struct ipr_ioa_cfg *ioa_cfg) | |||
9317 | static int ipr_enable_msix(struct ipr_ioa_cfg *ioa_cfg) | 9317 | static int ipr_enable_msix(struct ipr_ioa_cfg *ioa_cfg) |
9318 | { | 9318 | { |
9319 | struct msix_entry entries[IPR_MAX_MSIX_VECTORS]; | 9319 | struct msix_entry entries[IPR_MAX_MSIX_VECTORS]; |
9320 | int i, err, vectors; | 9320 | int i, vectors; |
9321 | 9321 | ||
9322 | for (i = 0; i < ARRAY_SIZE(entries); ++i) | 9322 | for (i = 0; i < ARRAY_SIZE(entries); ++i) |
9323 | entries[i].entry = i; | 9323 | entries[i].entry = i; |
9324 | 9324 | ||
9325 | vectors = ipr_number_of_msix; | 9325 | vectors = pci_enable_msix_range(ioa_cfg->pdev, |
9326 | 9326 | entries, 1, ipr_number_of_msix); | |
9327 | while ((err = pci_enable_msix(ioa_cfg->pdev, entries, vectors)) > 0) | 9327 | if (vectors < 0) { |
9328 | vectors = err; | ||
9329 | |||
9330 | if (err < 0) { | ||
9331 | ipr_wait_for_pci_err_recovery(ioa_cfg); | 9328 | ipr_wait_for_pci_err_recovery(ioa_cfg); |
9332 | return err; | 9329 | return vectors; |
9333 | } | 9330 | } |
9334 | 9331 | ||
9335 | if (!err) { | 9332 | for (i = 0; i < vectors; i++) |
9336 | for (i = 0; i < vectors; i++) | 9333 | ioa_cfg->vectors_info[i].vec = entries[i].vector; |
9337 | ioa_cfg->vectors_info[i].vec = entries[i].vector; | 9334 | ioa_cfg->nvectors = vectors; |
9338 | ioa_cfg->nvectors = vectors; | ||
9339 | } | ||
9340 | 9335 | ||
9341 | return err; | 9336 | return 0; |
9342 | } | 9337 | } |
9343 | 9338 | ||
9344 | static int ipr_enable_msi(struct ipr_ioa_cfg *ioa_cfg) | 9339 | static int ipr_enable_msi(struct ipr_ioa_cfg *ioa_cfg) |
9345 | { | 9340 | { |
9346 | int i, err, vectors; | 9341 | int i, vectors; |
9347 | 9342 | ||
9348 | vectors = ipr_number_of_msix; | 9343 | vectors = pci_enable_msi_range(ioa_cfg->pdev, 1, ipr_number_of_msix); |
9349 | 9344 | if (vectors < 0) { | |
9350 | while ((err = pci_enable_msi_block(ioa_cfg->pdev, vectors)) > 0) | ||
9351 | vectors = err; | ||
9352 | |||
9353 | if (err < 0) { | ||
9354 | ipr_wait_for_pci_err_recovery(ioa_cfg); | 9345 | ipr_wait_for_pci_err_recovery(ioa_cfg); |
9355 | return err; | 9346 | return vectors; |
9356 | } | 9347 | } |
9357 | 9348 | ||
9358 | if (!err) { | 9349 | for (i = 0; i < vectors; i++) |
9359 | for (i = 0; i < vectors; i++) | 9350 | ioa_cfg->vectors_info[i].vec = ioa_cfg->pdev->irq + i; |
9360 | ioa_cfg->vectors_info[i].vec = ioa_cfg->pdev->irq + i; | 9351 | ioa_cfg->nvectors = vectors; |
9361 | ioa_cfg->nvectors = vectors; | ||
9362 | } | ||
9363 | 9352 | ||
9364 | return err; | 9353 | return 0; |
9365 | } | 9354 | } |
9366 | 9355 | ||
9367 | static void name_msi_vectors(struct ipr_ioa_cfg *ioa_cfg) | 9356 | static void name_msi_vectors(struct ipr_ioa_cfg *ioa_cfg) |
@@ -9426,7 +9415,7 @@ static irqreturn_t ipr_test_intr(int irq, void *devp) | |||
9426 | * ipr_test_msi - Test for Message Signaled Interrupt (MSI) support. | 9415 | * ipr_test_msi - Test for Message Signaled Interrupt (MSI) support. |
9427 | * @pdev: PCI device struct | 9416 | * @pdev: PCI device struct |
9428 | * | 9417 | * |
9429 | * Description: The return value from pci_enable_msi() can not always be | 9418 | * Description: The return value from pci_enable_msi_range() can not always be |
9430 | * trusted. This routine sets up and initiates a test interrupt to determine | 9419 | * trusted. This routine sets up and initiates a test interrupt to determine |
9431 | * if the interrupt is received via the ipr_test_intr() service routine. | 9420 | * if the interrupt is received via the ipr_test_intr() service routine. |
9432 | * If the tests fails, the driver will fall back to LSI. | 9421 | * If the tests fails, the driver will fall back to LSI. |