All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
To: linux-scsi@vger.kernel.org
Cc: martin.petersen@oracle.com,
	Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Subject: [PATCH v2 7/9] mpi3mr: Scan the devices during resume time
Date: Mon, 12 Sep 2022 19:27:40 +0530	[thread overview]
Message-ID: <20220912135742.11764-8-sreekanth.reddy@broadcom.com> (raw)
In-Reply-To: <20220912135742.11764-1-sreekanth.reddy@broadcom.com>

[-- Attachment #1: Type: text/plain, Size: 2265 bytes --]

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.

Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
---
 drivers/scsi/mpi3mr/mpi3mr.h    | 2 ++
 drivers/scsi/mpi3mr/mpi3mr_fw.c | 8 +++-----
 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 883ed59..5b10504 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 e3df044..f841a44 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 bb276b5..f474c56 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;
-- 
2.27.0


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

  parent reply	other threads:[~2022-09-12 13:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12 13:57 [PATCH v2 0/9] mpi3mr: Few Enhancements and minor fixes Sreekanth Reddy
2022-09-12 13:57 ` [PATCH v2 1/9] mpi3mr: Update mpi3 header files Sreekanth Reddy
2022-09-12 13:57 ` [PATCH v2 2/9] mpi3mr: Support new power management framework Sreekanth Reddy
2022-09-12 13:57 ` [PATCH v2 3/9] mpi3mr: Schedule IRQ kthreads only on non-RT kernels Sreekanth Reddy
2022-09-12 13:57 ` [PATCH v2 4/9] mpi3mr: Graceful handling of surprise removal of PCIe HBA Sreekanth Reddy
2022-09-12 13:57 ` [PATCH v2 5/9] mpi3mr: Handle 0xF003 Fault Code Sreekanth Reddy
2022-09-12 13:57 ` [PATCH v2 6/9] mpi3mr: Free enclosure objects during driver unload Sreekanth Reddy
2022-09-12 13:57 ` Sreekanth Reddy [this message]
2022-09-12 13:57 ` [PATCH v2 8/9] mpi3mr: Fix scheduling while atomic type bug Sreekanth Reddy
2022-09-12 13:57 ` [PATCH v2 9/9] mpi3mr: Update driver version to 8.2.0.3.0 Sreekanth Reddy
2022-09-25 17:52 ` [PATCH v2 0/9] mpi3mr: Few Enhancements and minor fixes Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220912135742.11764-8-sreekanth.reddy@broadcom.com \
    --to=sreekanth.reddy@broadcom.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.