mbox series

[v3,0/2] Synchronize user layer access with system PM ops and error handling

Message ID 1609595975-12219-1-git-send-email-cang@codeaurora.org (mailing list archive)
Headers show
Series Synchronize user layer access with system PM ops and error handling | expand

Message

Can Guo Jan. 2, 2021, 1:59 p.m. UTC
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 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 | 104 ++++++++++++++++++++++++++++++++++++-------
 drivers/scsi/ufs/ufshcd.c    |  49 ++++++++++++--------
 drivers/scsi/ufs/ufshcd.h    |  10 ++++-
 3 files changed, 128 insertions(+), 35 deletions(-)

Comments

Martin K. Petersen Jan. 13, 2021, 4:18 a.m. UTC | #1
Can,

> This series contains two changes and it is based on 5.11/scsi-queue

Please rebase against 5.12/scsi-queue.

Thanks!
Can Guo Jan. 13, 2021, 4:23 a.m. UTC | #2
On 2021-01-13 12:18, Martin K. Petersen wrote:
> Can,
> 
>> This series contains two changes and it is based on 5.11/scsi-queue
> 
> Please rebase against 5.12/scsi-queue.
> 
> Thanks!

Sure. Thanks Martin.