Skip to content

ufs: fix POST_CHANGE pairing and AHIT race condition

[email protected] linux-mediatek linux-scsi sashiko-reviews 1 version Applied

Status from this message: Applied to 7.4/scsi-staging, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 7 repliesApplied

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2ufs: always notify POST_CHANGE even on gear switch failuredrivers/ufs/core/ufshcd.c drivers/ufs/host/ufs-exynos.c drivers/ufs/host/ufshcd-pci.c+11 -41 reply
2/2ufs: serialize AHIT register access between sysfs and host driverdrivers/ufs/core/ufshcd.c drivers/ufs/host/ufs-mediatek.c include/ufs/ufshcd.h+33 -51 reply

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchChun-Hung Wu
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] ufs: fix POST_CHANGE pairing and AHIT race condition

From: Peter Wang <[email protected]>

Patch 1 fixes a bug where POST_CHANGE was skipped on a failed gear switch, leaving the host in an inconsistent state if resources acquired in PRE_CHANGE were never released.

Patch 2 fixes a race between the sysfs AHIT update path and the MediaTek host driver's power mode change path. A mutex and depth counter are introduced to serialize AHIT register access and ensure AHIT is correctly restored after the last disabler completes.

The two patches are related: patch 1 guarantees POST_CHANGE is always called, ensuring the depth counter introduced in patch 2 is always properly decremented.

Peter Wang (2):
ufs: always notify POST_CHANGE even on gear switch failure
ufs: serialize AHIT register access between sysfs and host driver

 drivers/ufs/core/ufshcd.c       | 22 +++++++++++++++++++---
 drivers/ufs/host/ufs-exynos.c   |  4 +++-
 drivers/ufs/host/ufs-mediatek.c | 16 ++++++++++++----
 drivers/ufs/host/ufshcd-pci.c   |  3 ++-
 include/ufs/ufshcd.h            |  8 ++++++++
 5 files changed, 44 insertions(+), 9 deletions(-)
Signature · 1 line
2.45.2