diff options
author | Christoph Hellwig <hch@lst.de> | 2016-11-30 11:21:01 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-12-01 08:36:17 -0500 |
commit | e3cb0e47b9233a42f8c5865ad748666b6bbbc12f (patch) | |
tree | 8d76c525b380033f0f5df493c374ce691ff04e50 | |
parent | 9dadfb973f0d9396ef18f7ee0867fe9a165c03f4 (diff) |
scsi: isci: switch to pci_alloc_irq_vectors
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/isci/host.h | 1 | ||||
-rw-r--r-- | drivers/scsi/isci/init.c | 23 |
2 files changed, 10 insertions, 14 deletions
diff --git a/drivers/scsi/isci/host.h b/drivers/scsi/isci/host.h index 22a9bb1abae1..b3539928073c 100644 --- a/drivers/scsi/isci/host.h +++ b/drivers/scsi/isci/host.h | |||
@@ -295,7 +295,6 @@ enum sci_controller_states { | |||
295 | #define SCI_MAX_MSIX_INT (SCI_NUM_MSI_X_INT*SCI_MAX_CONTROLLERS) | 295 | #define SCI_MAX_MSIX_INT (SCI_NUM_MSI_X_INT*SCI_MAX_CONTROLLERS) |
296 | 296 | ||
297 | struct isci_pci_info { | 297 | struct isci_pci_info { |
298 | struct msix_entry msix_entries[SCI_MAX_MSIX_INT]; | ||
299 | struct isci_host *hosts[SCI_MAX_CONTROLLERS]; | 298 | struct isci_host *hosts[SCI_MAX_CONTROLLERS]; |
300 | struct isci_orom *orom; | 299 | struct isci_orom *orom; |
301 | }; | 300 | }; |
diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c index 77128d680e3b..0b5b5db0d0f8 100644 --- a/drivers/scsi/isci/init.c +++ b/drivers/scsi/isci/init.c | |||
@@ -350,16 +350,12 @@ static int isci_setup_interrupts(struct pci_dev *pdev) | |||
350 | */ | 350 | */ |
351 | num_msix = num_controllers(pdev) * SCI_NUM_MSI_X_INT; | 351 | num_msix = num_controllers(pdev) * SCI_NUM_MSI_X_INT; |
352 | 352 | ||
353 | for (i = 0; i < num_msix; i++) | 353 | err = pci_alloc_irq_vectors(pdev, num_msix, num_msix, PCI_IRQ_MSIX); |
354 | pci_info->msix_entries[i].entry = i; | 354 | if (err < 0) |
355 | |||
356 | err = pci_enable_msix_exact(pdev, pci_info->msix_entries, num_msix); | ||
357 | if (err) | ||
358 | goto intx; | 355 | goto intx; |
359 | 356 | ||
360 | for (i = 0; i < num_msix; i++) { | 357 | for (i = 0; i < num_msix; i++) { |
361 | int id = i / SCI_NUM_MSI_X_INT; | 358 | int id = i / SCI_NUM_MSI_X_INT; |
362 | struct msix_entry *msix = &pci_info->msix_entries[i]; | ||
363 | irq_handler_t isr; | 359 | irq_handler_t isr; |
364 | 360 | ||
365 | ihost = pci_info->hosts[id]; | 361 | ihost = pci_info->hosts[id]; |
@@ -369,8 +365,8 @@ static int isci_setup_interrupts(struct pci_dev *pdev) | |||
369 | else | 365 | else |
370 | isr = isci_msix_isr; | 366 | isr = isci_msix_isr; |
371 | 367 | ||
372 | err = devm_request_irq(&pdev->dev, msix->vector, isr, 0, | 368 | err = devm_request_irq(&pdev->dev, pci_irq_vector(pdev, i), |
373 | DRV_NAME"-msix", ihost); | 369 | isr, 0, DRV_NAME"-msix", ihost); |
374 | if (!err) | 370 | if (!err) |
375 | continue; | 371 | continue; |
376 | 372 | ||
@@ -378,18 +374,19 @@ static int isci_setup_interrupts(struct pci_dev *pdev) | |||
378 | while (i--) { | 374 | while (i--) { |
379 | id = i / SCI_NUM_MSI_X_INT; | 375 | id = i / SCI_NUM_MSI_X_INT; |
380 | ihost = pci_info->hosts[id]; | 376 | ihost = pci_info->hosts[id]; |
381 | msix = &pci_info->msix_entries[i]; | 377 | devm_free_irq(&pdev->dev, pci_irq_vector(pdev, i), |
382 | devm_free_irq(&pdev->dev, msix->vector, ihost); | 378 | ihost); |
383 | } | 379 | } |
384 | pci_disable_msix(pdev); | 380 | pci_free_irq_vectors(pdev); |
385 | goto intx; | 381 | goto intx; |
386 | } | 382 | } |
387 | return 0; | 383 | return 0; |
388 | 384 | ||
389 | intx: | 385 | intx: |
390 | for_each_isci_host(i, ihost, pdev) { | 386 | for_each_isci_host(i, ihost, pdev) { |
391 | err = devm_request_irq(&pdev->dev, pdev->irq, isci_intx_isr, | 387 | err = devm_request_irq(&pdev->dev, pci_irq_vector(pdev, 0), |
392 | IRQF_SHARED, DRV_NAME"-intx", ihost); | 388 | isci_intx_isr, IRQF_SHARED, DRV_NAME"-intx", |
389 | ihost); | ||
393 | if (err) | 390 | if (err) |
394 | break; | 391 | break; |
395 | } | 392 | } |