Skip to content

Synchronize user layer access with system PM ops and error handling

Can Guo linux-arm-kernel linux-mediatek linux-scsi lkml 5 versions – Applied

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 2 repliesApplied
  2. v42 patches 2 repliesSuperseded
  3. v32 patches 26 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches5 repliesSuperseded
v12 patches0 repliesSuperseded

Changes in v5 from the cover letter

- Incoroporate Adrian's comment - renamed ufshcd_is_sysfs_allowed() as ufshcd_is_user_access_allowed()

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/2scsi: ufs: Fix a possible NULL pointer issuedrivers/scsi/ufs/ufshcd.c+14 -30 replies
2/2scsi: ufs: Protect PM ops and err_handler from user access through sysfsdrivers/scsi/ufs/ufs-sysfs.c drivers/scsi/ufs/ufshcd.c drivers/scsi/ufs/ufshcd.h+125 -330 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchStanley ChuAvri Altman
1/2A-b
2/2R-b A-b

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

Read the v5 thread

Cover letter [PATCH v5 0/2] Synchronize user layer access with system PM ops and error handling

This series contains two changes and it is based on 5.11/scsi-queue
The 1st change is just a minor fix.
The 2nd change is to synchronize user layer access through UFS sysfs nodes, so that system PM ops (suspend, resume and shutdown), error handling and async probe won't be disturbed by user layer access. The protection is only added to some sysfs nodes, not all of them.

Change since v4:
- Incoroporate Adrian's comment - renamed ufshcd_is_sysfs_allowed() as ufshcd_is_user_access_allowed()

Change since v3:
- Rebased to 5.12/scsi-queue

Change since v2:
- Updated the 1st change, added a global boolean flag to tell if system suspend is invoked when hba is NULL, it is used during resume in case of hba becomes not NULL.

Change since v1:
- Slightly updated the 2nd change, added a dedicated inline func to check hba->shutting_down in ufshcd.h. This inline func can be updated to add more rules for sysfs passage in future.

Can Guo (2):
scsi: ufs: Fix a possible NULL pointer issue
scsi: ufs: Protect PM ops and err_handler from user access through
sysfs

 drivers/scsi/ufs/ufs-sysfs.c | 106 ++++++++++++++++++++++++++++++++++++-------
 drivers/scsi/ufs/ufshcd.c    |  57 +++++++++++++++--------
 drivers/scsi/ufs/ufshcd.h    |  10 +++-
 3 files changed, 138 insertions(+), 35 deletions(-)
Signature · 1 line
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.