[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <500022ecc5216afa01e7f606187f012294a76da3.camel@mediatek.com>
Date: Mon, 17 Nov 2025 08:40:46 +0000
From: Peter Wang (王信友) <peter.wang@...iatek.com>
To: "beanhuo@...ron.com" <beanhuo@...ron.com>, "sh043.lee@...sung.com"
<sh043.lee@...sung.com>, "avri.altman@....com" <avri.altman@....com>,
"storage.sec@...sung.com" <storage.sec@...sung.com>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"bvanassche@....org" <bvanassche@....org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "alim.akhtar@...sung.com"
<alim.akhtar@...sung.com>, "adrian.hunter@...el.com"
<adrian.hunter@...el.com>, "martin.petersen@...cle.com"
<martin.petersen@...cle.com>
Subject: Re: [PATCH] UFS: Make TM command timeout configurable from host side
On Mon, 2025-11-17 at 16:11 +0900, Seunghui Lee wrote:
> 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.
>
Hi Seunghui,
Changing TM_CMD_TIMEOUT from 100ms to 300ms is okay for me.
The adjustment of the TM retry count from 100 to 30 is not
significant, so it does not matter whether this change is
made or not. Overall, this patch looks good to me.
However, the other TM clear timeout of 1 second has a much
greater impact:
ufshcd_wait_for_register(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL,
mask, ~mask, 1000, 1000);
Would you consider shortening this value as well?
Thanks
Peter
> 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