aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/message
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2023-10-02 17:43:13 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2023-10-13 14:23:14 -0400
commit17865dc2eccca0177433eb52c06befdc82b6a286 (patch)
treefaa68a2d98aea894c4d7809d712113f2526b46ca /drivers/message
parentscsi: message: fusion: Correct definitions for mptscsih_dev_reset() (diff)
downloadwireguard-linux-17865dc2eccca0177433eb52c06befdc82b6a286.tar.xz
wireguard-linux-17865dc2eccca0177433eb52c06befdc82b6a286.zip
scsi: message: fusion: Open-code mptfc_block_error_handler() for bus reset
When calling bus_reset we have potentially several ports to be reset, so this patch open-codes the existing mptfc_block_error_handler() to wait for all ports attached to this bus. Signed-off-by: Hannes Reinecke <hare@suse.de> Link: https://lore.kernel.org/r/20231002154328.43718-4-hare@suse.de Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/message')
-rw-r--r--drivers/message/fusion/mptfc.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index 5d5563ea90c2..aa6bb764df3e 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -262,12 +262,23 @@ static int
mptfc_bus_reset(struct scsi_cmnd *SCpnt)
{
struct Scsi_Host *shost = SCpnt->device->host;
- struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device));
MPT_SCSI_HOST __maybe_unused *hd = shost_priv(shost);
+ int channel = SCpnt->device->channel;
+ struct mptfc_rport_info *ri;
int rtn;
- rtn = mptfc_block_error_handler(rport);
- if (rtn == SUCCESS) {
+ list_for_each_entry(ri, &hd->ioc->fc_rports, list) {
+ if (ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED) {
+ VirtTarget *vtarget = ri->starget->hostdata;
+
+ if (!vtarget || vtarget->channel != channel)
+ continue;
+ rtn = fc_block_rport(ri->rport);
+ if (rtn != 0)
+ break;
+ }
+ }
+ if (rtn == 0) {
dfcprintk (hd->ioc, printk(MYIOC_s_DEBUG_FMT
"%s.%d: %d:%llu, executing recovery.\n", __func__,
hd->ioc->name, shost->host_no,