aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2012-05-01 12:42:09 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-05-10 04:07:56 -0400
commitf0bd0b68220aaba354f84518173498cae160afdc (patch)
tree32cd71dcc7e6e421b3622ea1dcd91733851217d2 /drivers
parent89a342ca6bfc1a014ff50cce5659abc58e11ecfc (diff)
[SCSI] hpsa: call pci_disable_device on driver unload
As Jenx Axboe explained to me: "In earlier times (2.6.18 and pre, iirc), Linux disabled IO and mem bars on pci_disable_device(). Now in newer kernel it does not. And in the newer kernels you run into problems if you DON'T disable the device on exit, since when it later loads the device is already in the enabled state - and pci_enable_device() then does nothing. This typically screws MSI/MSI-X." This is what the big scary comment that says pci_disable_device does "something nasty" to smart arrays was evidently referring to. If pci_disable_device is not called on driver rmmod, subsequently insmod'ing the driver may in result in some cases fail to be able to receive interrupts, esp. if other drivers are loaded between unloading and loading hpsa. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/hpsa.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index f49047478c94..732ae3dc0449 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3984,10 +3984,7 @@ err_out_free_res:
3984 iounmap(h->cfgtable); 3984 iounmap(h->cfgtable);
3985 if (h->vaddr) 3985 if (h->vaddr)
3986 iounmap(h->vaddr); 3986 iounmap(h->vaddr);
3987 /* 3987 pci_disable_device(h->pdev);
3988 * Deliberately omit pci_disable_device(): it does something nasty to
3989 * Smart Array controllers that pci_enable_device does not undo
3990 */
3991 pci_release_regions(h->pdev); 3988 pci_release_regions(h->pdev);
3992 return err; 3989 return err;
3993} 3990}
@@ -4526,10 +4523,7 @@ static void __devexit hpsa_remove_one(struct pci_dev *pdev)
4526 kfree(h->cmd_pool_bits); 4523 kfree(h->cmd_pool_bits);
4527 kfree(h->blockFetchTable); 4524 kfree(h->blockFetchTable);
4528 kfree(h->hba_inquiry_data); 4525 kfree(h->hba_inquiry_data);
4529 /* 4526 pci_disable_device(pdev);
4530 * Deliberately omit pci_disable_device(): it does something nasty to
4531 * Smart Array controllers that pci_enable_device does not undo
4532 */
4533 pci_release_regions(pdev); 4527 pci_release_regions(pdev);
4534 pci_set_drvdata(pdev, NULL); 4528 pci_set_drvdata(pdev, NULL);
4535 kfree(h); 4529 kfree(h);