RE: [PATCH] UFS: Make TM command timeout configurable from host side
From: Seunghui Lee
Date: Tue Nov 11 2025 - 03:44:48 EST
> -----Original Message-----
> From: Peter Wang (王信友) <peter.wang@xxxxxxxxxxxx>
> Sent: Tuesday, November 11, 2025 11:46 AM
> To: beanhuo@xxxxxxxxxx; sh043.lee@xxxxxxxxxxx; avri.altman@xxxxxxx;
> storage.sec@xxxxxxxxxxx; linux-scsi@xxxxxxxxxxxxxxx; bvanassche@xxxxxxx;
> linux-kernel@xxxxxxxxxxxxxxx; alim.akhtar@xxxxxxxxxxx;
> adrian.hunter@xxxxxxxxx; martin.petersen@xxxxxxxxxx
> Subject: Re: [PATCH] UFS: Make TM command timeout configurable from host
> side
>
> On Thu, 2025-11-06 at 10:26 +0900, Seunghui Lee wrote:
> > Currently, UFS driver uses hardcoded TM_CMD_TIMEOUT (100ms) for all
> > Task Management commands, which may not be optimal for different UFS
> > devices and use cases.
> >
> > This patch adds a configurable tm_cmd_timeout field to ufs_hba
> > structure and uses it instead of the hardcoded constant. The default
> > value remains TM_CMD_TIMEOUT to maintain backward compatibility.
>
> Hi Seunghui,
>
> There should be another patch to add a device quirk that modifies the
> value of tm_cmd_timeout?
> Otherwise, this patch doesn’t actually change anything.
>
> Thanks.
> Peter
>
Thank you for your kind opinion.
As you know, it's not easy to modify default value.
Because it effects all devices.
Should I read the tm_cmd_timeout from dt property?
What do you think?
* drivers/ufs/host/ufhcd-pltfrm.c
static void ufshcd_init_tm_cmd_timeout(struct ufs_hba *hba)
{
struct device *dev = hba->dev;
int ret;
ret = of_property_read_u32(dev->of_node, "tm_cmd_timeout",
&hba->tm_cmd_timeout);
if (ret) {
dev_dbg(hba->dev,
"%s: failed to read tm_cmd_timeout, ret=%d\n",
__func__, ret);
hba->tm_cmd_timeout = TM_CMD_TIMEOUT;
}
}
Thanks,
Seunghui Lee.