[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <000001dc5791$5f2ea880$1d8bf980$@samsung.com>
Date: Mon, 17 Nov 2025 16:11:19 +0900
From: "Seunghui Lee" <sh043.lee@...sung.com>
To: 'Peter Wang (王信友)'
<peter.wang@...iatek.com>, <beanhuo@...ron.com>, <avri.altman@....com>,
<storage.sec@...sung.com>, <linux-scsi@...r.kernel.org>,
<bvanassche@....org>, <linux-kernel@...r.kernel.org>,
<alim.akhtar@...sung.com>, <adrian.hunter@...el.com>,
<martin.petersen@...cle.com>
Subject: RE: [PATCH] UFS: Make TM command timeout configurable from host
side
> -----Original Message-----
> From: Peter Wang (王信友) <peter.wang@...iatek.com>
> Sent: Thursday, November 13, 2025 7:09 PM
> To: beanhuo@...ron.com; sh043.lee@...sung.com; avri.altman@....com;
> storage.sec@...sung.com; linux-scsi@...r.kernel.org; bvanassche@....org;
> linux-kernel@...r.kernel.org; alim.akhtar@...sung.com;
> adrian.hunter@...el.com; martin.petersen@...cle.com
> Subject: Re: [PATCH] UFS: Make TM command timeout configurable from host
> side
>
> On Wed, 2025-11-12 at 08:51 -0800, Bart Van Assche wrote:
> >
> > Can't we increase the default timeout (TM_CMD_TIMEOUT)? Increasing the
> > default timeout shouldn't affect any configuration negatively, isn't
> > it?
> >
>
> Hi Bart,
>
> In the worst-case scenario (when the device is stuck), it may takes 1.1
> seconds to abort a single task. When the queue is full (64), there will be
> noticeable lag. Aborting all tasks can take over a minute, which is
> unacceptable regardless of whether TM_CMD_TIMEOUT is increased or not.
> Under normal conditions, it’s very unlikely to exceed 100ms. So I think
> directly modifying TM_CMD_TIMEOUT is also acceptable, but I suggest
> keeping it within 500ms.
>
> However, the optimal solution is for the vendor to update the firmware,
> ensuring that TM command priority is set appropriately to prevent
> situations where it exceeds 100ms.
>
> Thanks
> Peter
Hi Mr.Wang,
I understand your concerns about considering the worst-case scenario.
What about directly modifying TM_CMD_TIMEOUT (100ms -> 300ms) and
reducing the TM retry count from 100 to 30?
Please let me know your opinion.
Thank you,
Seunghui Lee.
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -68,7 +68,7 @@ enum {
#define ADVANCED_RPMB_REQ_TIMEOUT 3000 /* 3 seconds */
/* Task management command timeout */
-#define TM_CMD_TIMEOUT 100 /* msecs */
+#define TM_CMD_TIMEOUT 300 /* msecs */
/* maximum number of retries for a general UIC command */
#define UFS_UIC_COMMAND_RETRIES 3
@@ -7663,7 +7663,7 @@ int ufshcd_try_to_abort_task(struct ufs_hba *hba, int tag)
int poll_cnt;
u8 resp = 0xF;
- for (poll_cnt = 100; poll_cnt; poll_cnt--) {
+ for (poll_cnt = 30; poll_cnt; poll_cnt--) {
err = ufshcd_issue_tm_cmd(hba, lrbp->lun, lrbp->task_tag,
UFS_QUERY_TASK, &resp);
if (!err && resp == UPIU_TASK_MANAGEMENT_FUNC_SUCCEEDED) {
Powered by blists - more mailing lists