Skip to content

Commit 1c7cc1c

Browse files
committed
scsi: smartpqi: Add timeout value to RAID path requests to physical devices
JIRA: https://issues.redhat.com/browse/RHEL-107917 commit f3ecbba Author: Mike McGowen <Mike.McGowen@microchip.com> Date: Thu Nov 6 10:38:19 2025 -0600 scsi: smartpqi: Add timeout value to RAID path requests to physical devices Add a timeout value to requests sent to physical devices via the RAID path. A timeout value of zero means wait indefinitely, which may cause the OS to issue Target Management Function (TMF) commands if the device does not respond. For input timeouts of 8 seconds or greater, the value sent to firmware is reduced by 3 seconds to provide an earlier firmware timeout and allow the OS additional time before timing out. This change improves timeout handling between the driver, firmware, and OS, helping to better manage device responsiveness and avoid indefinite waits. Reviewed-by: David Strahan <david.strahan@microchip.com> Reviewed-by: Scott Benesh <scott.benesh@microchip.com> Reviewed-by: Scott Teel <scott.teel@microchip.com> Signed-off-by: Mike McGowen <Mike.McGowen@microchip.com> Signed-off-by: Don Brace <don.brace@microchip.com> Link: https://patch.msgid.link/20251106163823.786828-2-don.brace@microchip.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> (cherry picked from commit f3ecbba) Assisted-by: Patchpal Signed-off-by: Don Brace <dbrace@redhat.com>
1 parent 7dffc1b commit 1c7cc1c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

drivers/scsi/smartpqi/smartpqi_init.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5554,14 +5554,25 @@ static void pqi_raid_io_complete(struct pqi_io_request *io_request,
55545554
pqi_scsi_done(scmd);
55555555
}
55565556

5557+
/*
5558+
* Adjust the timeout value for physical devices sent to the firmware
5559+
* by subtracting 3 seconds for timeouts greater than or equal to 8 seconds.
5560+
*
5561+
* This provides the firmware with additional time to attempt early recovery
5562+
* before the OS-level timeout occurs.
5563+
*/
5564+
#define ADJUST_SECS_TIMEOUT_VALUE(tv) (((tv) >= 8) ? ((tv) - 3) : (tv))
5565+
55575566
static int pqi_raid_submit_io(struct pqi_ctrl_info *ctrl_info,
55585567
struct pqi_scsi_dev *device, struct scsi_cmnd *scmd,
55595568
struct pqi_queue_group *queue_group, bool io_high_prio)
55605569
{
55615570
int rc;
5571+
u32 timeout;
55625572
size_t cdb_length;
55635573
struct pqi_io_request *io_request;
55645574
struct pqi_raid_path_request *request;
5575+
struct request *rq;
55655576

55665577
io_request = pqi_alloc_io_request(ctrl_info, scmd);
55675578
if (!io_request)
@@ -5633,6 +5644,12 @@ static int pqi_raid_submit_io(struct pqi_ctrl_info *ctrl_info,
56335644
return SCSI_MLQUEUE_HOST_BUSY;
56345645
}
56355646

5647+
if (device->is_physical_device) {
5648+
rq = scsi_cmd_to_rq(scmd);
5649+
timeout = rq->timeout / HZ;
5650+
put_unaligned_le32(ADJUST_SECS_TIMEOUT_VALUE(timeout), &request->timeout);
5651+
}
5652+
56365653
pqi_start_io(ctrl_info, queue_group, RAID_PATH, io_request);
56375654

56385655
return 0;

0 commit comments

Comments
 (0)