[PATCH] ufs: Disable UTP command timeout in slow mode

Neil Armstrong neil.armstrong at linaro.org
Thu Dec 11 11:27:13 CET 2025


On 11/26/25 16:06, Michal Simek wrote:
> From: Padmarao Begari <padmarao.begari at amd.com>
> 
> When the UFS controller is operating in slow (PWM) mode,
> the driver is disabled the timeout for UTP send commands.
> In high-speed mode, the timeout remains enabled to
> detect stalled or failed transfers. This change ensures reliable
> operation in slow mode, where command completion may take longer
> and timeouts are not required.
> 
> Signed-off-by: Padmarao Begari <padmarao.begari at amd.com>
> Signed-off-by: Michal Simek <michal.simek at amd.com>
> ---
> 
>   drivers/ufs/ufs-uclass.c | 12 +++++++-----
>   1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/ufs/ufs-uclass.c b/drivers/ufs/ufs-uclass.c
> index 3c8e4299259c..7a80a9d5664b 100644
> --- a/drivers/ufs/ufs-uclass.c
> +++ b/drivers/ufs/ufs-uclass.c
> @@ -917,11 +917,13 @@ static int ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag)
>   		enabled_intr_status = intr_status & hba->intr_mask;
>   		ufshcd_writel(hba, intr_status, REG_INTERRUPT_STATUS);
>   
> -		if (get_timer(start) > QUERY_REQ_TIMEOUT) {
> -			dev_err(hba->dev,
> -				"Timedout waiting for UTP response\n");
> -
> -			return -ETIMEDOUT;
> +		if (hba->max_pwr_info.info.pwr_rx != SLOWAUTO_MODE &&
> +		    hba->max_pwr_info.info.pwr_tx != SLOWAUTO_MODE) {
> +			if (get_timer(start) > QUERY_REQ_TIMEOUT) {
> +				dev_err(hba->dev,
> +					"Timedout waiting for UTP response\n");
> +				return -ETIMEDOUT;
> +			}
>   		}
>   
>   		if (enabled_intr_status & UFSHCD_ERROR_MASK) {

OK seems valid

Reviewed-by: Neil Armstrong <neil.armstrong at linaro.org>


More information about the U-Boot mailing list