]> www.infradead.org Git - users/jedix/linux-maple.git/commit
[SCSI] hpsa: call pci_disable_device on driver unload
authorStephen M. Cameron <scameron@beardog.cce.hp.com>
Tue, 1 May 2012 16:42:09 +0000 (11:42 -0500)
committerJoe Jin <joe.jin@oracle.com>
Fri, 21 Dec 2012 03:13:28 +0000 (11:13 +0800)
commitcd205c471c41da6f904bbc4b0f5b7dad30e3c983
treefea9dfdad1d5325124dc73562ed0af0890e80212
parent2281dd0e870a80693de5b57e278af68101239be5
[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>
(cherry picked from commit f0bd0b68220aaba354f84518173498cae160afdc)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/scsi/hpsa.c