mbox series

[V7,0/3] Minor fixes to UFS error handling

Message ID 1606910644-21185-1-git-send-email-cang@codeaurora.org (mailing list archive)
Headers show
Series Minor fixes to UFS error handling | expand

Message

Can Guo Dec. 2, 2020, 12:04 p.m. UTC
This series mainly fixes below two things which come along with UFS error
handling in some corner cases.
[1] Concurrency problems btw err_handler and paths like system suspend/resume/shutdown and async scan.
[2] Race condition btw UFS error recovery and task abort which happens to W-LU during suspend/resume/shutdown.

The 1st change is tested with error/fault injections to power mode change
operations during system PM operations and async scan. The 2nd change is
tested by mimicing SSU cmd timeout during suspend/resume/shutdown. The 3rd
one is just a minor change to a check condition in IRQ handler such that
the driver can dump host regs when AH8 error happens.

Change since v6:
- Updated the check condition of updating clk_scaling.active_reqs in __ufshcd_transfer_req_compl()

Change since v5:
- Incorporated Stanley's comment

Change since v4:
- Fixed a typo found by Stanley.

Change since v3:
- Slightly updated some commit msg lines, no code changes.

Change since v2:
- Added one more minor change into this series.

Change since v1:
- Removed Change-Id from commit msg


Can Guo (3):
  scsi: ufs: Serialize eh_work with system PM events and async scan
  scsi: ufs: Fix a race condition between ufshcd_abort and eh_work
  scsi: ufs: Print host regs in IRQ handler when AH8 error happens

 drivers/scsi/ufs/ufshcd.c | 127 ++++++++++++++++++++++++++++++++--------------
 drivers/scsi/ufs/ufshcd.h |   3 ++
 2 files changed, 92 insertions(+), 38 deletions(-)

Comments

Martin K. Petersen Dec. 7, 2020, 11:31 p.m. UTC | #1
Can,

> This series mainly fixes below two things which come along with UFS error
> handling in some corner cases.
> [1] Concurrency problems btw err_handler and paths like system suspend/resume/shutdown and async scan.
> [2] Race condition btw UFS error recovery and task abort which happens to W-LU during suspend/resume/shutdown.

Applied to 5.11/scsi-staging, thanks!

Stanley: Please verify conflict resolution with your event notification
series.
Stanley Chu Dec. 8, 2020, 5:04 a.m. UTC | #2
Hi Martin,

On Mon, 2020-12-07 at 18:31 -0500, Martin K. Petersen wrote:
> Can,
> 
> > This series mainly fixes below two things which come along with UFS error
> > handling in some corner cases.
> > [1] Concurrency problems btw err_handler and paths like system suspend/resume/shutdown and async scan.
> > [2] Race condition btw UFS error recovery and task abort which happens to W-LU during suspend/resume/shutdown.
> 
> Applied to 5.11/scsi-staging, thanks!
> 
> Stanley: Please verify conflict resolution with your event notification
> series.

Conflict is resolved perfectly!

Thanks for your time : )

Stanley Chu
Martin K. Petersen Dec. 9, 2020, 5:23 p.m. UTC | #3
On Wed, 2 Dec 2020 04:04:00 -0800, Can Guo wrote:

> This series mainly fixes below two things which come along with UFS error
> handling in some corner cases.
> [1] Concurrency problems btw err_handler and paths like system suspend/resume/shutdown and async scan.
> [2] Race condition btw UFS error recovery and task abort which happens to W-LU during suspend/resume/shutdown.
> 
> The 1st change is tested with error/fault injections to power mode change
> operations during system PM operations and async scan. The 2nd change is
> tested by mimicing SSU cmd timeout during suspend/resume/shutdown. The 3rd
> one is just a minor change to a check condition in IRQ handler such that
> the driver can dump host regs when AH8 error happens.
> 
> [...]

Applied to 5.11/scsi-queue, thanks!

[1/3] scsi: ufs: Serialize eh_work with system PM events and async scan
      https://git.kernel.org/mkp/scsi/c/88a92d6ae4fe
[2/3] scsi: ufs: Fix a race condition between ufshcd_abort and eh_work
      https://git.kernel.org/mkp/scsi/c/7a7e66c65d41
[3/3] scsi: ufs: Print host regs in IRQ handler when AH8 error happens
      https://git.kernel.org/mkp/scsi/c/ace3804b69af