Skip to content

Commit f352a0d

Browse files
Narsimhulu Musinimartinkpetersen
authored andcommitted
snic: LUN goes offline due to scsi cmd timeouts
- LUN goes offline if there are at least two scsi command timeouts Completing the IO with scsi_done() fixes the issue. Signed-off-by: Narsimhulu Musini <[email protected]> Signed-off-by: Sesidhar Baddela <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 3f5c11a commit f352a0d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/scsi/snic/snic_scsi.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,11 +1465,19 @@ snic_abort_finish(struct snic *snic, struct scsi_cmnd *sc)
14651465
case SNIC_STAT_IO_SUCCESS:
14661466
case SNIC_STAT_IO_NOT_FOUND:
14671467
ret = SUCCESS;
1468+
/*
1469+
* If abort path doesn't call scsi_done(),
1470+
* the # IO timeouts == 2, will cause the LUN offline.
1471+
* Call scsi_done to complete the IO.
1472+
*/
1473+
sc->result = (DID_ERROR << 16);
1474+
sc->scsi_done(sc);
14681475
break;
14691476

14701477
default:
14711478
/* Firmware completed abort with error */
14721479
ret = FAILED;
1480+
rqi = NULL;
14731481
break;
14741482
}
14751483

@@ -1842,6 +1850,9 @@ snic_dr_clean_single_req(struct snic *snic,
18421850

18431851
snic_release_req_buf(snic, rqi, sc);
18441852

1853+
sc->result = (DID_ERROR << 16);
1854+
sc->scsi_done(sc);
1855+
18451856
ret = 0;
18461857

18471858
return ret;
@@ -2396,6 +2407,13 @@ snic_cmpl_pending_tmreq(struct snic *snic, struct scsi_cmnd *sc)
23962407
"Completing Pending TM Req sc %p, state %s flags 0x%llx\n",
23972408
sc, snic_io_status_to_str(CMD_STATE(sc)), CMD_FLAGS(sc));
23982409

2410+
/*
2411+
* CASE : FW didn't post itmf completion due to PCIe Errors.
2412+
* Marking the abort status as Success to call scsi completion
2413+
* in snic_abort_finish()
2414+
*/
2415+
CMD_ABTS_STATUS(sc) = SNIC_STAT_IO_SUCCESS;
2416+
23992417
rqi = (struct snic_req_info *) CMD_SP(sc);
24002418
if (!rqi)
24012419
return;

0 commit comments

Comments
 (0)