linux/drivers/ufs/core
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
..
Kconfig scsi: ufs: core: Remove HPB support 2023-07-23 16:40:39 -04:00
Makefile scsi: ufs: core: Add support for TX Equalization 2026-03-27 17:20:29 -04:00
ufs_bsg.c scsi: ufs: core: Remove an unnecessary NULL pointer check 2025-11-12 20:58:28 -05:00
ufs_bsg.h
ufs_trace_types.h scsi: ufs: core: Remove UFS_DEV_COMP 2025-10-23 22:18:12 -04:00
ufs_trace.h scsi: ufs: core: Remove UFS_DEV_COMP 2025-10-23 22:18:12 -04:00
ufs-debugfs.c scsi: ufs: core: Add support to retrain TX Equalization via debugfs 2026-03-27 17:20:30 -04:00
ufs-debugfs.h scsi: ufs: core: Make the header files self-contained 2026-04-02 21:26:44 -04:00
ufs-fault-injection.c fault-inject: improve build for CONFIG_FAULT_INJECTION=n 2024-09-01 20:43:33 -07:00
ufs-fault-injection.h scsi: ufs: core: Make the header files self-contained 2026-04-02 21:26:44 -04:00
ufs-hwmon.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ufs-mcq.c scsi: ufs: core: Add a comment block above ufshcd_mcq_compl_all_cqes_lock() 2026-04-02 21:26:44 -04:00
ufs-rpmb.c scsi: ufs: core: Add OP-TEE based RPMB driver for UFS devices 2025-11-10 12:49:43 -05:00
ufs-sysfs.c scsi: ufs: core: Add support to notify userspace of UniPro QoS events 2026-03-07 11:04:35 -05:00
ufs-sysfs.h scsi: ufs: core: Revert "Make HID attributes visible" 2025-10-29 23:12:33 -04:00
ufs-txeq.c scsi: ufs: ufs-qcom: Implement vops get_rx_fom() 2026-03-27 17:20:30 -04:00
ufshcd-crypto.c blk-crypto: add basic hardware-wrapped key support 2025-02-10 09:54:19 -07:00
ufshcd-crypto.h scsi: ufs: core: Remove an include directive from ufshcd-crypto.h 2026-04-02 21:26:44 -04:00
ufshcd-priv.h Merge patch series "scsi: ufs: Add TX Equalization support for UFS 5.0" 2026-03-27 17:21:28 -04:00
ufshcd.c scsi: ufs: core: Fix bRefClkFreq write failure in HS-LSS mode 2026-04-21 20:58:06 -04:00