提交 e3cb0e47 编写于 作者: C Christoph Hellwig 提交者: Martin K. Petersen

scsi: isci: switch to pci_alloc_irq_vectors

Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 9dadfb97
...@@ -295,7 +295,6 @@ enum sci_controller_states { ...@@ -295,7 +295,6 @@ enum sci_controller_states {
#define SCI_MAX_MSIX_INT (SCI_NUM_MSI_X_INT*SCI_MAX_CONTROLLERS) #define SCI_MAX_MSIX_INT (SCI_NUM_MSI_X_INT*SCI_MAX_CONTROLLERS)
struct isci_pci_info { struct isci_pci_info {
struct msix_entry msix_entries[SCI_MAX_MSIX_INT];
struct isci_host *hosts[SCI_MAX_CONTROLLERS]; struct isci_host *hosts[SCI_MAX_CONTROLLERS];
struct isci_orom *orom; struct isci_orom *orom;
}; };
......
...@@ -350,16 +350,12 @@ static int isci_setup_interrupts(struct pci_dev *pdev) ...@@ -350,16 +350,12 @@ static int isci_setup_interrupts(struct pci_dev *pdev)
*/ */
num_msix = num_controllers(pdev) * SCI_NUM_MSI_X_INT; num_msix = num_controllers(pdev) * SCI_NUM_MSI_X_INT;
for (i = 0; i < num_msix; i++) err = pci_alloc_irq_vectors(pdev, num_msix, num_msix, PCI_IRQ_MSIX);
pci_info->msix_entries[i].entry = i; if (err < 0)
err = pci_enable_msix_exact(pdev, pci_info->msix_entries, num_msix);
if (err)
goto intx; goto intx;
for (i = 0; i < num_msix; i++) { for (i = 0; i < num_msix; i++) {
int id = i / SCI_NUM_MSI_X_INT; int id = i / SCI_NUM_MSI_X_INT;
struct msix_entry *msix = &pci_info->msix_entries[i];
irq_handler_t isr; irq_handler_t isr;
ihost = pci_info->hosts[id]; ihost = pci_info->hosts[id];
...@@ -369,8 +365,8 @@ static int isci_setup_interrupts(struct pci_dev *pdev) ...@@ -369,8 +365,8 @@ static int isci_setup_interrupts(struct pci_dev *pdev)
else else
isr = isci_msix_isr; isr = isci_msix_isr;
err = devm_request_irq(&pdev->dev, msix->vector, isr, 0, err = devm_request_irq(&pdev->dev, pci_irq_vector(pdev, i),
DRV_NAME"-msix", ihost); isr, 0, DRV_NAME"-msix", ihost);
if (!err) if (!err)
continue; continue;
...@@ -378,18 +374,19 @@ static int isci_setup_interrupts(struct pci_dev *pdev) ...@@ -378,18 +374,19 @@ static int isci_setup_interrupts(struct pci_dev *pdev)
while (i--) { while (i--) {
id = i / SCI_NUM_MSI_X_INT; id = i / SCI_NUM_MSI_X_INT;
ihost = pci_info->hosts[id]; ihost = pci_info->hosts[id];
msix = &pci_info->msix_entries[i]; devm_free_irq(&pdev->dev, pci_irq_vector(pdev, i),
devm_free_irq(&pdev->dev, msix->vector, ihost); ihost);
} }
pci_disable_msix(pdev); pci_free_irq_vectors(pdev);
goto intx; goto intx;
} }
return 0; return 0;
intx: intx:
for_each_isci_host(i, ihost, pdev) { for_each_isci_host(i, ihost, pdev) {
err = devm_request_irq(&pdev->dev, pdev->irq, isci_intx_isr, err = devm_request_irq(&pdev->dev, pci_irq_vector(pdev, 0),
IRQF_SHARED, DRV_NAME"-intx", ihost); isci_intx_isr, IRQF_SHARED, DRV_NAME"-intx",
ihost);
if (err) if (err)
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册