aboutsummaryrefslogtreecommitdiff
path: root/drivers/ufs/core/ufshcd-priv.h
diff options
context:
space:
mode:
authorGravatar Jinyoung Choi <j-young.choi@samsung.com> 2022-08-04 16:54:44 +0900
committerGravatar Martin K. Petersen <martin.petersen@oracle.com> 2022-08-22 23:15:11 -0400
commit42f8c5cdb039f93f8d20f3e299aa6436775ee9d6 (patch)
tree10b2f00449ccd47b1e16ee2a90f76dbbe4d2d725 /drivers/ufs/core/ufshcd-priv.h
parentscsi: ufs: wb: Add explicit flush sysfs attribute (diff)
downloadlinux-42f8c5cdb039f93f8d20f3e299aa6436775ee9d6.tar.gz
linux-42f8c5cdb039f93f8d20f3e299aa6436775ee9d6.tar.bz2
linux-42f8c5cdb039f93f8d20f3e299aa6436775ee9d6.zip
scsi: ufs: wb: Introduce ufshcd_is_wb_buf_flush_allowed()
The explicit flushing should check the following: - UFSHCD_CAP_WB_EN - UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL Add helper to improve readability. Link: https://lore.kernel.org/r/20220804075444epcms2p4a0520880262281f02be65ce0fe50602d@epcms2p4 Reviewed-by: Avri Altman <avri.altman@wdc.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Acked-by: Bean Huo <beanhuo@micron.com> Signed-off-by: Jinyoung Choi <j-young.choi@samsung.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ufs/core/ufshcd-priv.h')
-rw-r--r--drivers/ufs/core/ufshcd-priv.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/ufs/core/ufshcd-priv.h b/drivers/ufs/core/ufshcd-priv.h
index 8f67db202d7b..d00dba17297d 100644
--- a/drivers/ufs/core/ufshcd-priv.h
+++ b/drivers/ufs/core/ufshcd-priv.h
@@ -26,6 +26,12 @@ static inline u8 ufshcd_wb_get_query_index(struct ufs_hba *hba)
return 0;
}
+static inline bool ufshcd_is_wb_buf_flush_allowed(struct ufs_hba *hba)
+{
+ return ufshcd_is_wb_allowed(hba) &&
+ !(hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL);
+}
+
#ifdef CONFIG_SCSI_UFS_HWMON
void ufs_hwmon_probe(struct ufs_hba *hba, u8 mask);
void ufs_hwmon_remove(struct ufs_hba *hba);