summaryrefslogtreecommitdiff
path: root/drivers/scsi/smartpqi
diff options
context:
space:
mode:
authorKevin Barnett <kevin.barnett@microsemi.com>2016-08-31 14:54:47 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2016-09-02 06:21:38 -0400
commite57a1f9b2fa4326ec289f1d03c658184ed6addb8 (patch)
treedf7464f0ea54713544bc919979a4864340ead890 /drivers/scsi/smartpqi
parentff6abb7383d2eec6c8c988ff661352e66f245686 (diff)
scsi: smartpqi: correct controller offline issue
Fixes: 6c223761e 'smartpqi: initial commit of Microsemi smartpqi driver' Fixed a bug where the driver would not free all of the controller resources if the controller ever went offline. Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/smartpqi')
-rw-r--r--drivers/scsi/smartpqi/smartpqi_init.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 43bfeaca65db..d759703da287 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -5609,19 +5609,14 @@ static void pqi_free_ctrl_resources(struct pqi_ctrl_info *ctrl_info)
static void pqi_remove_ctrl(struct pqi_ctrl_info *ctrl_info)
{
- int rc;
+ cancel_delayed_work_sync(&ctrl_info->rescan_work);
+ cancel_delayed_work_sync(&ctrl_info->update_time_work);
+ pqi_remove_all_scsi_devices(ctrl_info);
+ pqi_unregister_scsi(ctrl_info);
- if (ctrl_info->controller_online) {
- cancel_delayed_work_sync(&ctrl_info->rescan_work);
- cancel_delayed_work_sync(&ctrl_info->update_time_work);
- pqi_remove_all_scsi_devices(ctrl_info);
- pqi_unregister_scsi(ctrl_info);
- ctrl_info->controller_online = false;
- }
if (ctrl_info->pqi_mode_enabled) {
sis_disable_msix(ctrl_info);
- rc = pqi_reset(ctrl_info);
- if (rc == 0)
+ if (pqi_reset(ctrl_info) == 0)
sis_reenable_sis_mode(ctrl_info);
}
pqi_free_ctrl_resources(ctrl_info);