diff options
| author | Peter Wang <peter.wang@mediatek.com> | 2026-09-14 16:49:25 +0800 |
|---|---|---|
| committer | Martin K. Petersen (Oracle) <mkp@kernel.org> | 2026-09-25 22:29:41 -0400 |
| commit | 7dec5cedf7b248036da606c16f9f3f9aa350b417 (patch) | |
| tree | bc50ac73d8b92b5f8f4f4958712420362a392bf5 /tools/lib/python | |
| parent | 6efee14ca0aed33103ea17f4367da173f893442f (diff) | |
| download | linux-next-7dec5cedf7b248036da606c16f9f3f9aa350b417.tar.gz linux-next-7dec5cedf7b248036da606c16f9f3f9aa350b417.zip | |
scsi: ufs: core: Serialize AHIT register access between sysfs and host driver
A race exists between ufshcd_auto_hibern8_update() and
ufs_mtk_pwr_change_notify() when both paths concurrently access
REG_AUTO_HIBERNATE_IDLE_TIMER. Additionally, the static local variable used
to save/restore AHIT in the power change path is not re-entrant and may
hold a stale value if a sysfs write races with a gear change.
Introduce ahit_mutex and ahit_disable_depth in struct ufs_hba to
serialize AHIT register access. The depth counter tracks how many
host-driver paths have forced AHIT off; sysfs writes are suppressed
while it is non-zero and the register is restored from hba->ahit
only when the last disabler drops it to zero.
Fixes: f5ca8d0c7a63 ("scsi: ufs: host: mediatek: Disable auto-hibern8 during power mode changes")
Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Reviewed-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
Link: https://patch.msgid.link/20260914085148.136429-3-peter.wang@mediatek.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
