File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -109,4 +109,11 @@ struct ufs_dev_fix {
109
109
*/
110
110
#define UFS_DEVICE_QUIRK_SUPPORT_EXTENDED_FEATURES (1 << 10)
111
111
112
+ /*
113
+ * Some UFS devices require delay after VCC power rail is turned-off.
114
+ * Enable this quirk to introduce 5ms delays after VCC power-off during
115
+ * suspend flow.
116
+ */
117
+ #define UFS_DEVICE_QUIRK_DELAY_AFTER_LPM (1 << 11)
118
+
112
119
#endif /* UFS_QUIRKS_H_ */
Original file line number Diff line number Diff line change @@ -8107,6 +8107,8 @@ static int ufshcd_link_state_transition(struct ufs_hba *hba,
8107
8107
8108
8108
static void ufshcd_vreg_set_lpm (struct ufs_hba * hba )
8109
8109
{
8110
+ bool vcc_off = false;
8111
+
8110
8112
/*
8111
8113
* It seems some UFS devices may keep drawing more than sleep current
8112
8114
* (atleast for 500us) from UFS rails (especially from VCCQ rail).
@@ -8135,13 +8137,22 @@ static void ufshcd_vreg_set_lpm(struct ufs_hba *hba)
8135
8137
if (ufshcd_is_ufs_dev_poweroff (hba ) && ufshcd_is_link_off (hba ) &&
8136
8138
!hba -> dev_info .is_lu_power_on_wp ) {
8137
8139
ufshcd_setup_vreg (hba , false);
8140
+ vcc_off = true;
8138
8141
} else if (!ufshcd_is_ufs_dev_active (hba )) {
8139
8142
ufshcd_toggle_vreg (hba -> dev , hba -> vreg_info .vcc , false);
8143
+ vcc_off = true;
8140
8144
if (!ufshcd_is_link_active (hba )) {
8141
8145
ufshcd_config_vreg_lpm (hba , hba -> vreg_info .vccq );
8142
8146
ufshcd_config_vreg_lpm (hba , hba -> vreg_info .vccq2 );
8143
8147
}
8144
8148
}
8149
+
8150
+ /*
8151
+ * Some UFS devices require delay after VCC power rail is turned-off.
8152
+ */
8153
+ if (vcc_off && hba -> vreg_info .vcc &&
8154
+ hba -> dev_quirks & UFS_DEVICE_QUIRK_DELAY_AFTER_LPM )
8155
+ usleep_range (5000 , 5100 );
8145
8156
}
8146
8157
8147
8158
static int ufshcd_vreg_set_hpm (struct ufs_hba * hba )
You can’t perform that action at this time.
0 commit comments