Skip to content

Commit 2b75cfa

Browse files
author
Chandrakanth Patil
committed
scsi: mpi3mr: Fix premature TM timeouts on virtual drives
JIRA: https://issues.redhat.com/browse/RHEL-111654 Task Management to virtual drives may timeout prematurely when using a static default timeout. Read Abort and Reset timeouts from Device Page 0 and apply the maximum of the firmware value and the default. This fixes premature TM failures on virtual drives. Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com> Link: https://lore.kernel.org/r/20250820084138.228471-6-chandrakanth.patil@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> (cherry picked from commit 4af8647) Signed-off-by: Chandrakanth Patil <chanpati@redhat.com>
1 parent bdc3316 commit 2b75cfa

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

drivers/scsi/mpi3mr/mpi3mr.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,8 @@ struct tgt_dev_vd {
697697
u16 tg_id;
698698
u32 tg_high;
699699
u32 tg_low;
700+
u8 abort_to;
701+
u8 reset_to;
700702
struct mpi3mr_throttle_group_info *tg;
701703
};
702704

@@ -738,6 +740,8 @@ enum mpi3mr_dev_state {
738740
* @wwid: World wide ID
739741
* @enclosure_logical_id: Enclosure logical identifier
740742
* @dev_spec: Device type specific information
743+
* @abort_to: Timeout for abort TM
744+
* @reset_to: Timeout for Target/LUN reset TM
741745
* @ref_count: Reference count
742746
* @state: device state
743747
*/

drivers/scsi/mpi3mr/mpi3mr_os.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,6 +1308,12 @@ static void mpi3mr_update_tgtdev(struct mpi3mr_ioc *mrioc,
13081308
if (vdinf->vd_state == MPI3_DEVICE0_VD_STATE_OFFLINE)
13091309
tgtdev->is_hidden = 1;
13101310
tgtdev->non_stl = 1;
1311+
tgtdev->dev_spec.vd_inf.reset_to =
1312+
max_t(u8, vdinf->vd_reset_to,
1313+
MPI3MR_INTADMCMD_TIMEOUT);
1314+
tgtdev->dev_spec.vd_inf.abort_to =
1315+
max_t(u8, vdinf->vd_abort_to,
1316+
MPI3MR_INTADMCMD_TIMEOUT);
13111317
tgtdev->dev_spec.vd_inf.tg_id = vdinf_io_throttle_group;
13121318
tgtdev->dev_spec.vd_inf.tg_high =
13131319
le16_to_cpu(vdinf->io_throttle_group_high) * 2048;
@@ -3917,11 +3923,13 @@ int mpi3mr_issue_tm(struct mpi3mr_ioc *mrioc, u8 tm_type,
39173923
if (scsi_tgt_priv_data)
39183924
atomic_inc(&scsi_tgt_priv_data->block_io);
39193925

3920-
if (tgtdev && (tgtdev->dev_type == MPI3_DEVICE_DEVFORM_PCIE)) {
3921-
if (cmd_priv && tgtdev->dev_spec.pcie_inf.abort_to)
3922-
timeout = tgtdev->dev_spec.pcie_inf.abort_to;
3923-
else if (!cmd_priv && tgtdev->dev_spec.pcie_inf.reset_to)
3924-
timeout = tgtdev->dev_spec.pcie_inf.reset_to;
3926+
if (tgtdev) {
3927+
if (tgtdev->dev_type == MPI3_DEVICE_DEVFORM_PCIE)
3928+
timeout = cmd_priv ? tgtdev->dev_spec.pcie_inf.abort_to
3929+
: tgtdev->dev_spec.pcie_inf.reset_to;
3930+
else if (tgtdev->dev_type == MPI3_DEVICE_DEVFORM_VD)
3931+
timeout = cmd_priv ? tgtdev->dev_spec.vd_inf.abort_to
3932+
: tgtdev->dev_spec.vd_inf.reset_to;
39253933
}
39263934

39273935
init_completion(&drv_cmd->done);

0 commit comments

Comments
 (0)