]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
ufs: Disable UTP command timeout in slow mode
authorPadmarao Begari <padmarao.begari@amd.com>
Wed, 26 Nov 2025 15:06:41 +0000 (16:06 +0100)
committerNeil Armstrong <neil.armstrong@linaro.org>
Mon, 2 Mar 2026 14:19:17 +0000 (15:19 +0100)
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@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/e6deb9086afab9d2bdd53db8ecbc7db93af5204d.1764169598.git.michal.simek@amd.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
drivers/ufs/ufs-uclass.c

index 3c8e4299259c69bc20705978908e7c3b78f0664b..7a80a9d5664b659b70e659c19e30444f44c251f1 100644 (file)
@@ -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) {