diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-04-19 15:32:51 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 07:00:37 -0400 |
commit | 31e824ed0d8c84c5232405167b2338ffc071ae8a (patch) | |
tree | d63462e4a808ef9992632e9261a65be4a51ba471 /drivers/scsi/isci/init.c | |
parent | e2023b8735956bb78f167d0fdc575364e69b02c4 (diff) |
isci: rely on irq core for intx multiplexing, and silence screaming intx
Remove the extra logic to poll each controller for interrupts, that's
the core's job for shared interrupts.
While testing noticed that a number of interrupts fire while waiting for
the completion tasklet to run, so added an irq-ack.
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/init.c')
-rw-r--r-- | drivers/scsi/isci/init.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c index 015ce94453bb..5a9cd5fbeab9 100644 --- a/drivers/scsi/isci/init.c +++ b/drivers/scsi/isci/init.c | |||
@@ -335,6 +335,7 @@ static int num_controllers(struct pci_dev *pdev) | |||
335 | static int isci_setup_interrupts(struct pci_dev *pdev) | 335 | static int isci_setup_interrupts(struct pci_dev *pdev) |
336 | { | 336 | { |
337 | int err, i, num_msix; | 337 | int err, i, num_msix; |
338 | struct isci_host *ihost; | ||
338 | struct isci_pci_info *pci_info = to_pci_info(pdev); | 339 | struct isci_pci_info *pci_info = to_pci_info(pdev); |
339 | 340 | ||
340 | /* | 341 | /* |
@@ -353,9 +354,9 @@ static int isci_setup_interrupts(struct pci_dev *pdev) | |||
353 | for (i = 0; i < num_msix; i++) { | 354 | for (i = 0; i < num_msix; i++) { |
354 | int id = i / SCI_NUM_MSI_X_INT; | 355 | int id = i / SCI_NUM_MSI_X_INT; |
355 | struct msix_entry *msix = &pci_info->msix_entries[i]; | 356 | struct msix_entry *msix = &pci_info->msix_entries[i]; |
356 | struct isci_host *isci_host = pci_info->hosts[id]; | ||
357 | irq_handler_t isr; | 357 | irq_handler_t isr; |
358 | 358 | ||
359 | ihost = pci_info->hosts[id]; | ||
359 | /* odd numbered vectors are error interrupts */ | 360 | /* odd numbered vectors are error interrupts */ |
360 | if (i & 1) | 361 | if (i & 1) |
361 | isr = isci_error_isr; | 362 | isr = isci_error_isr; |
@@ -363,16 +364,16 @@ static int isci_setup_interrupts(struct pci_dev *pdev) | |||
363 | isr = isci_msix_isr; | 364 | isr = isci_msix_isr; |
364 | 365 | ||
365 | err = devm_request_irq(&pdev->dev, msix->vector, isr, 0, | 366 | err = devm_request_irq(&pdev->dev, msix->vector, isr, 0, |
366 | DRV_NAME"-msix", isci_host); | 367 | DRV_NAME"-msix", ihost); |
367 | if (!err) | 368 | if (!err) |
368 | continue; | 369 | continue; |
369 | 370 | ||
370 | dev_info(&pdev->dev, "msix setup failed falling back to intx\n"); | 371 | dev_info(&pdev->dev, "msix setup failed falling back to intx\n"); |
371 | while (i--) { | 372 | while (i--) { |
372 | id = i / SCI_NUM_MSI_X_INT; | 373 | id = i / SCI_NUM_MSI_X_INT; |
373 | isci_host = pci_info->hosts[id]; | 374 | ihost = pci_info->hosts[id]; |
374 | msix = &pci_info->msix_entries[i]; | 375 | msix = &pci_info->msix_entries[i]; |
375 | devm_free_irq(&pdev->dev, msix->vector, isci_host); | 376 | devm_free_irq(&pdev->dev, msix->vector, ihost); |
376 | } | 377 | } |
377 | pci_disable_msix(pdev); | 378 | pci_disable_msix(pdev); |
378 | goto intx; | 379 | goto intx; |
@@ -380,8 +381,12 @@ static int isci_setup_interrupts(struct pci_dev *pdev) | |||
380 | return 0; | 381 | return 0; |
381 | 382 | ||
382 | intx: | 383 | intx: |
383 | err = devm_request_irq(&pdev->dev, pdev->irq, isci_intx_isr, | 384 | for_each_isci_host(i, ihost, pdev) { |
384 | IRQF_SHARED, DRV_NAME"-intx", pdev); | 385 | err = devm_request_irq(&pdev->dev, pdev->irq, isci_intx_isr, |
386 | IRQF_SHARED, DRV_NAME"-intx", ihost); | ||
387 | if (err) | ||
388 | break; | ||
389 | } | ||
385 | return err; | 390 | return err; |
386 | } | 391 | } |
387 | 392 | ||