Skip to content

RFC scsi: ufs: Start to make driver synchronization easier to understand

Adrian Hunter linux-scsi 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6scsi: ufs: Encapsulate clk_scaling_lock by inline functionsdrivers/scsi/ufs/ufshcd.c drivers/scsi/ufs/ufshcd.h+47 -170 replies
2/6scsi: ufs: Rename clk_scaling_lock to host_rw_semdrivers/scsi/ufs/ufshcd.c drivers/scsi/ufs/ufshcd.h+8 -83 replies
3/6scsi: ufs: Let ufshcd_[down/up]_read be nested within ufshcd_[down/up]_writedrivers/scsi/ufs/ufshcd.h+17 -20 replies
4/6scsi: ufs: Fix a possible dead lock in clock scalingdrivers/scsi/ufs/ufshcd.c drivers/scsi/ufs/ufshcd.h+3 -150 replies
5/6scsi: ufs: Reorder dev_cmd lockingdrivers/scsi/ufs/ufshcd.c+33 -360 replies
6/6scsi: ufs: Hold ufshcd_down_write() lock for entire error handler durationdrivers/scsi/ufs/ufshcd.c+1 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RFC 0/6] scsi: ufs: Start to make driver synchronization easier to understand

Hi

Driver synchronization would be easier to understand if we used the clk_scaling_lock as the only lock to provide either shared (down/up_read) or exclusive (down/up_write) access to the host.

These patches make changes with that in mind, finally resulting in being able to hold the down_write() lock for the entire error handler duration.

If this approach is acceptable, it could be extended to simplify the the synchronization of PM vs error handler and Shutdown vs sysfs.

Adrian Hunter (6):
scsi: ufs: Encapsulate clk_scaling_lock by inline functions
scsi: ufs: Rename clk_scaling_lock to host_rw_sem
scsi: ufs: Let ufshcd_[down/up]_read be nested within ufshcd_[down/up]_write
scsi: ufs: Fix a possible dead lock in clock scaling
scsi: ufs: Reorder dev_cmd locking
scsi: ufs: Hold ufshcd_down_write() lock for entire error handler duration

 drivers/scsi/ufs/ufshcd.c | 104 +++++++++++++++++++++-------------------------
 drivers/scsi/ufs/ufshcd.h |  41 +++++++++++++++++-
 2 files changed, 87 insertions(+), 58 deletions(-)

Regards
Adrian