qla2xxx: Check for device state before unloading the driver.
authorSawan Chandak <sawan.chandak@qlogic.com>
Wed, 6 Jul 2016 15:14:25 +0000 (11:14 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 15 Jul 2016 19:31:31 +0000 (15:31 -0400)
commit783e0dc4f66ade6bbd8833b6bae778158d54c1a6
tree730b6f3f3b3912a45e70b07ee2504c820f883385
parentc6dc99058e5798958847eab7411083ca5b25643c
qla2xxx: Check for device state before unloading the driver.

During hot swap of PCI device, there can be PCI error on device,
during normal driver unload. The race between normal driver unload and
driver unload due to PCI error, can lead to system crash.Fix is to check
if there is unload going on and allow that function to unload the driver.

Signed-off-by: Sawan Chandak <sawan.chandak@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_dbg.c
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_mbx.c
drivers/scsi/qla2xxx/qla_os.c