Skip to content

Commit 17865dc

Browse files
hreineckemartinkpetersen
authored andcommitted
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>
1 parent e662908 commit 17865dc

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

drivers/message/fusion/mptfc.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,23 @@ static int
262262
mptfc_bus_reset(struct scsi_cmnd *SCpnt)
263263
{
264264
struct Scsi_Host *shost = SCpnt->device->host;
265-
struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device));
266265
MPT_SCSI_HOST __maybe_unused *hd = shost_priv(shost);
266+
int channel = SCpnt->device->channel;
267+
struct mptfc_rport_info *ri;
267268
int rtn;
268269

269-
rtn = mptfc_block_error_handler(rport);
270-
if (rtn == SUCCESS) {
270+
list_for_each_entry(ri, &hd->ioc->fc_rports, list) {
271+
if (ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED) {
272+
VirtTarget *vtarget = ri->starget->hostdata;
273+
274+
if (!vtarget || vtarget->channel != channel)
275+
continue;
276+
rtn = fc_block_rport(ri->rport);
277+
if (rtn != 0)
278+
break;
279+
}
280+
}
281+
if (rtn == 0) {
271282
dfcprintk (hd->ioc, printk(MYIOC_s_DEBUG_FMT
272283
"%s.%d: %d:%llu, executing recovery.\n", __func__,
273284
hd->ioc->name, shost->host_no,

0 commit comments

Comments
 (0)