linux/include/ufs
Wang Shuaiwei b06cf63d83 scsi: ufs: core: Fix bRefClkFreq write failure in HS-LSS mode
According to the UFS spec, the bRefClkFreq attribute can only be written
when both sub-links are in LS-MODE. However, in HS LSS mode with
resetmode = HS_MODE, if the UFS device's default bRefClkFreq value
differs from the host controller's dev_ref_clk_freq setting, the write
operation will fail.

To fix this issue, introduce ufshcd_get_op_mode() function to detect the
current link operational mode. Call ufshcd_set_dev_ref_clk() only when
both sub-links are in LS-MODE to ensure the attribute can be written
successfully.

Signed-off-by: Wang Shuaiwei <wangshuaiwei1@xiaomi.com>
Link: https://patch.msgid.link/20260414033718.1459540-1-wangshuaiwei1@xiaomi.com
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-04-21 20:58:06 -04:00
..
ufs_quirks.h scsi: ufs: core: Remove UFS_DEVICE_QUIRK_DELAY_AFTER_LPM quirk 2025-10-21 21:22:17 -04:00
ufs.h scsi: ufs: core: Improve the documentation of UFS data frames 2026-01-11 22:04:10 -05:00
ufshcd.h Merge patch series "scsi: ufs: Add TX Equalization support for UFS 5.0" 2026-03-27 17:21:28 -04:00
ufshci.h scsi: ufs: core: Handle MCQ IAG events 2026-03-19 21:37:09 -04:00
unipro.h scsi: ufs: core: Fix bRefClkFreq write failure in HS-LSS mode 2026-04-21 20:58:06 -04:00