blob: fbf5c3e77d73979d1692afe863fe352e9147cc3e [file] [log] [blame]
From be32acff43800c87dc5c707f5d47cc607b76b653 Mon Sep 17 00:00:00 2001
From: Can Guo <>
Date: Wed, 27 May 2020 19:24:42 -0700
Subject: [PATCH] scsi: ufs: Don't update urgent bkops level when toggling auto
commit be32acff43800c87dc5c707f5d47cc607b76b653 upstream.
Urgent bkops level is used to compare against actual bkops status read from
UFS device. Urgent bkops level is set during initialization and might be
updated in exception event handler during runtime. But it should not be
updated to the actual bkops status every time when auto bkops is toggled.
Otherwise, if urgent bkops level is updated to 0, auto bkops shall always
be kept enabled.
Fixes: 24366c2afbb0 ("scsi: ufs: Recheck bkops level if bkops is disabled")
Reviewed-by: Stanley Chu <>
Signed-off-by: Can Guo <>
Signed-off-by: Martin K. Petersen <>
Signed-off-by: Paul Gortmaker <>
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 5db18f444ea9..2bdee9edec0d 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -5123,7 +5123,6 @@ static int ufshcd_bkops_ctrl(struct ufs_hba *hba,
err = ufshcd_enable_auto_bkops(hba);
err = ufshcd_disable_auto_bkops(hba);
- hba->urgent_bkops_lvl = curr_status;
return err;