mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-04 17:44:14 +08:00
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/20201208135635.15326-2-stanley.chu@mediatek.com
Fixes: 3d17b9b5ab
("scsi: ufs: Add write booster feature support")
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
5213dc7940
commit
bd14bf0e4a
@ -1221,8 +1221,13 @@ static inline void ufshcd_vops_device_reset(struct ufs_hba *hba)
|
||||
if (hba->vops && hba->vops->device_reset) {
|
||||
int err = hba->vops->device_reset(hba);
|
||||
|
||||
if (!err)
|
||||
if (!err) {
|
||||
ufshcd_set_ufs_dev_active(hba);
|
||||
if (ufshcd_is_wb_allowed(hba)) {
|
||||
hba->wb_enabled = false;
|
||||
hba->wb_buf_flush_enabled = false;
|
||||
}
|
||||
}
|
||||
if (err != -EOPNOTSUPP)
|
||||
ufshcd_update_evt_hist(hba, UFS_EVT_DEV_RESET, err);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user