All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.de>
Subject: [PATCH 3/3] mptfc: iterate over all rports during bus reset
Date: Thu, 19 Aug 2021 11:10:17 +0200	[thread overview]
Message-ID: <20210819091017.94142-4-hare@suse.de> (raw)
In-Reply-To: <20210819091017.94142-1-hare@suse.de>

When issuing a bus reset we need to call fc_block_rport() on all
ports, otherwise we might be executing the bus reset call prematurely.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/message/fusion/mptfc.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index 3962951c1e9a..952dc85bba08 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -227,14 +227,18 @@ mptfc_bus_reset(struct scsi_cmnd *SCpnt)
 {
 	struct scsi_device	*sdev = SCpnt->device;
 	struct Scsi_Host	*shost = sdev->host;
-	struct fc_rport		*rport = starget_to_rport(scsi_target(sdev));
 	MPT_SCSI_HOST		*hd = shost_priv(shost);
 	MPT_ADAPTER 		*ioc = hd->ioc;
+	struct mptfc_rport_info	*ri;
 	int rval;
 
-	rval = fc_block_rport(rport);
-	if (rval)
-		return rval;
+	list_for_each_entry(ri, &ioc->fc_rports, list) {
+		rval = fc_block_rport(ri->rport);
+		if (rval)
+			return rval;
+		if (ioc->active == 0)
+			return FAILED;
+	}
 	dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT
 		"%s.%d: %d:%llu, executing recovery.\n",
 		ioc->name, __func__, ioc->sh->host_no,
-- 
2.29.2


      parent reply	other threads:[~2021-08-19  9:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19  9:10 [PATCH 0/3] mptfusion: Fixes for SCSI EH rework Hannes Reinecke
2021-08-19  9:10 ` [PATCH 1/3] mptfusion: correct definitions for mptscsih_dev_reset() Hannes Reinecke
2021-08-19  9:10 ` [PATCH 2/3] mptfc: use fc_block_rport() instead of open-coding it Hannes Reinecke
2021-08-19  9:10 ` Hannes Reinecke [this message]

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=20210819091017.94142-4-hare@suse.de \
    --to=hare@suse.de \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.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.