public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Ranjan Kumar <ranjan.kumar@broadcom.com>
To: linux-scsi@vger.kernel.org, martin.petersen@oracle.com
Cc: rajsekhar.chundru@broadcom.com, sathya.prakash@broadcom.com,
	sumit.saxena@broadcom.com, chandrakanth.patil@broadcom.com,
	sreekanth.reddy@broadcom.com,
	Ranjan Kumar <ranjan.kumar@broadcom.com>
Subject: [PATCH v1 5/6] mpi3mr: Enhance handling of devices removed after controller reset
Date: Mon, 24 Jul 2023 18:53:02 +0530	[thread overview]
Message-ID: <20230724132303.19470-6-ranjan.kumar@broadcom.com> (raw)
In-Reply-To: <20230724132303.19470-1-ranjan.kumar@broadcom.com>

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

Mark all of the devices that are exposed to the OS prior to a
controller reset and not detected by the controller after the
reset as removed devices and the I/Os to those devices are
unblocked (and returned with DID_NO_CONNECT) prior to
removing the devices one after the other.

Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com>
---
 drivers/scsi/mpi3mr/mpi3mr_os.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 080c1a958905..14b289fb4823 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -1041,6 +1041,19 @@ mpi3mr_update_sdev(struct scsi_device *sdev, void *data)
 void mpi3mr_rfresh_tgtdevs(struct mpi3mr_ioc *mrioc)
 {
 	struct mpi3mr_tgt_dev *tgtdev, *tgtdev_next;
+	struct mpi3mr_stgt_priv_data *tgt_priv;
+
+	dprint_reset(mrioc, "refresh target devices: check for removals\n");
+	list_for_each_entry_safe(tgtdev, tgtdev_next, &mrioc->tgtdev_list,
+	    list) {
+		if ((tgtdev->dev_handle == MPI3MR_INVALID_DEV_HANDLE) &&
+		    tgtdev->host_exposed && tgtdev->starget &&
+		    tgtdev->starget->hostdata) {
+			tgt_priv = tgtdev->starget->hostdata;
+			tgt_priv->dev_removed = 1;
+			atomic_set(&tgt_priv->block_io, 0);
+		}
+	}
 
 	list_for_each_entry_safe(tgtdev, tgtdev_next, &mrioc->tgtdev_list,
 	    list) {
-- 
2.31.1


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

  parent reply	other threads:[~2023-07-24 13:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24 13:22 [PATCH v1 0/6] mpi3mr: Few Enhancements and minor fixes Ranjan Kumar
2023-07-24 13:22 ` [PATCH v1 1/6] mpi3mr: Invokes soft reset upon TSU or event ack time out Ranjan Kumar
2023-07-24 13:22 ` [PATCH v1 2/6] mpi3mr: Update MPI Headers to version 3.00.28 Ranjan Kumar
2023-07-24 13:23 ` [PATCH v1 3/6] mpi3mr: Add support for more than 1MB I/O Ranjan Kumar
2023-07-24 13:23 ` [PATCH v1 4/6] mpi3mr: WriteSame implementation Ranjan Kumar
2023-07-26  1:24   ` Martin K. Petersen
2023-07-27 17:06   ` kernel test robot
2023-07-24 13:23 ` Ranjan Kumar [this message]
2023-07-24 13:23 ` [PATCH v1 6/6] mpi3mr: Update driver version to 8.5.0.0.0 Ranjan Kumar
2023-07-26  1:04 ` [PATCH v1 0/6] mpi3mr: Few Enhancements and minor fixes Martin K. Petersen
2023-07-26 10:41   ` Ranjan kumar

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=20230724132303.19470-6-ranjan.kumar@broadcom.com \
    --to=ranjan.kumar@broadcom.com \
    --cc=chandrakanth.patil@broadcom.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=rajsekhar.chundru@broadcom.com \
    --cc=sathya.prakash@broadcom.com \
    --cc=sreekanth.reddy@broadcom.com \
    --cc=sumit.saxena@broadcom.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox