summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorPeter Wang <peter.wang@mediatek.com>2026-09-14 16:49:25 +0800
committerMartin K. Petersen (Oracle) <mkp@kernel.org>2026-09-25 22:29:41 -0400
commit7dec5cedf7b248036da606c16f9f3f9aa350b417 (patch)
treebc50ac73d8b92b5f8f4f4958712420362a392bf5 /tools/lib/python
parent6efee14ca0aed33103ea17f4367da173f893442f (diff)
downloadlinux-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