diff options
author | Sreekanth Reddy <sreekanth.reddy@broadcom.com> | 2022-09-12 19:27:40 +0530 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-09-25 13:49:52 -0400 |
commit | f84e8b5bb57eb64391a45f95ebf0e2a179d8c566 (patch) | |
tree | 43665e22d5f4ea047a1e0f4bd63149298db06276 /drivers/scsi/mpi3mr | |
parent | 130fc180a48141cb6fbfdb30138a114cf9be61c7 (diff) |
scsi: mpi3mr: Scan the devices during resume time
Scan the target devices during system resume time and add or remove the
target device with the SML if the corresponding target device is newly
added or removed respectively.
Link: https://lore.kernel.org/r/20220912135742.11764-8-sreekanth.reddy@broadcom.com
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/mpi3mr')
-rw-r--r-- | drivers/scsi/mpi3mr/mpi3mr.h | 2 | ||||
-rw-r--r-- | drivers/scsi/mpi3mr/mpi3mr_fw.c | 8 | ||||
-rw-r--r-- | drivers/scsi/mpi3mr/mpi3mr_os.c | 4 |
3 files changed, 9 insertions, 5 deletions
diff --git a/drivers/scsi/mpi3mr/mpi3mr.h b/drivers/scsi/mpi3mr/mpi3mr.h index 883ed59f731f..5b105044bf66 100644 --- a/drivers/scsi/mpi3mr/mpi3mr.h +++ b/drivers/scsi/mpi3mr/mpi3mr.h @@ -132,6 +132,8 @@ extern atomic64_t event_counter; #define MPI3MR_DEFAULT_CFG_PAGE_SZ 1024 /* in bytes */ +#define MPI3MR_RESET_TOPOLOGY_SETTLE_TIME 10 + #define MPI3MR_SCMD_TIMEOUT (60 * HZ) #define MPI3MR_EH_SCMD_TIMEOUT (60 * HZ) diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index e3df044ad716..f841a44d3a63 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -4042,10 +4042,8 @@ retry_init: goto out_failed; } - if (!is_resume) { - mrioc->device_refresh_on = 1; - mpi3mr_add_event_wait_for_device_refresh(mrioc); - } + mrioc->device_refresh_on = 1; + mpi3mr_add_event_wait_for_device_refresh(mrioc); ioc_info(mrioc, "sending port enable\n"); retval = mpi3mr_issue_port_enable(mrioc, 1); @@ -4912,7 +4910,7 @@ int mpi3mr_soft_reset_handler(struct mpi3mr_ioc *mrioc, mrioc->name, reset_reason); goto out; } - ssleep(10); + ssleep(MPI3MR_RESET_TOPOLOGY_SETTLE_TIME); out: if (!retval) { diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index 282ec4b382da..d61837f0087d 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -5228,13 +5228,17 @@ mpi3mr_resume(struct device *dev) } mrioc->stop_drv_processing = 0; + mpi3mr_invalidate_devhandles(mrioc); + mpi3mr_free_enclosure_list(mrioc); mpi3mr_memset_buffers(mrioc); r = mpi3mr_reinit_ioc(mrioc, 1); if (r) { ioc_err(mrioc, "resuming controller failed[%d]\n", r); return r; } + ssleep(MPI3MR_RESET_TOPOLOGY_SETTLE_TIME); scsi_unblock_requests(shost); + mrioc->device_refresh_on = 0; mpi3mr_start_watchdog(mrioc); return 0; |