mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
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:
|
||
|---|---|---|
| .. | ||
| ufs_quirks.h | ||
| ufs.h | ||
| ufshcd.h | ||
| ufshci.h | ||
| unipro.h | ||