Skip to content

Commit 4e0a517

Browse files
Murthy Bhatmartinkpetersen
authored andcommitted
scsi: smartpqi: fix rare system hang during LUN reset
Correct a rare case where in a LUN reset occurs on a device and I/O requests for other devices persist in the driver's internal request queue. Part of a LUN reset involves waiting for our internal request queue to empty before proceeding. The internal request queue contains requests not yet sent down to the controller. We were clearing the requests queued for the LUN undergoing a reset, but not all of the queued requests. Causing a hang. For all requests in our internal request queue: Complete requests with DID_RESET for queued requests for the device undergoing a reset. Complete requests with DID_REQUEUE for all other queued requests. Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Signed-off-by: Murthy Bhat <[email protected]> Signed-off-by: Don Brace <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent dbc39b8 commit 4e0a517

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/scsi/smartpqi/smartpqi_init.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6200,14 +6200,12 @@ static void pqi_fail_io_queued_for_device(struct pqi_ctrl_info *ctrl_info,
62006200
continue;
62016201

62026202
scsi_device = scmd->device->hostdata;
6203-
if (scsi_device != device)
6204-
continue;
6205-
6206-
if ((u8)scmd->device->lun != lun)
6207-
continue;
62086203

62096204
list_del(&io_request->request_list_entry);
6210-
set_host_byte(scmd, DID_RESET);
6205+
if (scsi_device == device && (u8)scmd->device->lun == lun)
6206+
set_host_byte(scmd, DID_RESET);
6207+
else
6208+
set_host_byte(scmd, DID_REQUEUE);
62116209
pqi_free_io_request(io_request);
62126210
scsi_dma_unmap(scmd);
62136211
pqi_scsi_done(scmd);

0 commit comments

Comments
 (0)