[PATCH v2] scsi: ufs: Change the error check sequence for auto hibern8
From: HOYOUNG SEO
Date: Thu Oct 22 2026 - 03:48:29 EST
In the case of auto hibern8, hibern8 entering or exiting occurs
without a cmd, so it is not correct to check
for the presence of a cmd before checking for auto hibern8 errors.
Thus, the order of the auto hibern8 error check changed.
Change in v2:
- changed to check UFSHCD_UIC_HIBERN8_MASK for auto hibern
only when cmd is null.
Separated from the case of cmd, there will be no problem
in the normal processing situation of cmd.
In the case of retval, when UFSHCD_UIC_HIBERN8_MASK is set,
the ufshcd_check_errors() function is performed
by hba->error and IRQ_HANDLED is set in the retval.
Signed-off-by: HOYOUNG SEO <hy50.seo@xxxxxxxxxxx>
---
drivers/ufs/core/ufshcd.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index bcc2512bf34b..4f4380c93ce7 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -5930,14 +5930,15 @@ static irqreturn_t ufshcd_uic_cmd_compl(struct ufs_hba *hba, u32 intr_status)
guard(spinlock_irqsave)(&hba->host->host_lock);
cmd = hba->active_uic_cmd;
if (!cmd) {
- dev_err(hba->dev,
- "No active UIC command. Maybe a timeout occurred?\n");
- return retval;
+ if (ufshcd_is_auto_hibern8_error(hba, intr_status)) {
+ hba->errors |= (UFSHCD_UIC_HIBERN8_MASK & intr_status);
+ } else {
+ dev_err(hba->dev,
+ "No active UIC command. Maybe a timeout occurred?\n");
+ return retval;
+ }
}
- if (ufshcd_is_auto_hibern8_error(hba, intr_status))
- hba->errors |= (UFSHCD_UIC_HIBERN8_MASK & intr_status);
-
if (intr_status & UIC_COMMAND_COMPL) {
/*
* Store the UIC command result in the lowest byte of
--
2.34.1