Skip to content

Commit bd14bf0

Browse files
Stanley Chumartinkpetersen
authored andcommitted
scsi: ufs: Re-enable WriteBooster after device reset
UFS 3.1 specification mentions that the WriteBooster flags listed below will be set to their default values, i.e. disabled, after power cycle or any type of reset event. Thus we need to reset the flag variables kept in struct hba to align with the device status and ensure that WriteBooster-related functions are configured properly after device reset. Without this fix, WriteBooster will not be enabled successfully after by ufshcd_wb_ctrl() after device reset because hba->wb_enabled remains true. Flags required to be reset to default values: - fWriteBoosterEn: hba->wb_enabled - fWriteBoosterBufferFlushEn: hba->wb_buf_flush_enabled - fWriteBoosterBufferFlushDuringHibernate: No variable mapped Link: https://lore.kernel.org/r/[email protected] Fixes: 3d17b9b ("scsi: ufs: Add write booster feature support") Reviewed-by: Bean Huo <[email protected]> Signed-off-by: Stanley Chu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 5213dc7 commit bd14bf0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/scsi/ufs/ufshcd.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,8 +1221,13 @@ static inline void ufshcd_vops_device_reset(struct ufs_hba *hba)
12211221
if (hba->vops && hba->vops->device_reset) {
12221222
int err = hba->vops->device_reset(hba);
12231223

1224-
if (!err)
1224+
if (!err) {
12251225
ufshcd_set_ufs_dev_active(hba);
1226+
if (ufshcd_is_wb_allowed(hba)) {
1227+
hba->wb_enabled = false;
1228+
hba->wb_buf_flush_enabled = false;
1229+
}
1230+
}
12261231
if (err != -EOPNOTSUPP)
12271232
ufshcd_update_evt_hist(hba, UFS_EVT_DEV_RESET, err);
12281233
}

0 commit comments

Comments
 (0)