Re: [PATCH v3 15/18] scsi: ufs: Request sense data asynchronously
From: Bean Huo <hidden>
Date: 2021-08-02 13:16:43
On Wed, 2021-07-21 at 20:34 -0700, Bart Van Assche wrote:
Clearing a unit attention synchronously from inside the UFS error handler may trigger the following deadlock: - ufshcd_err_handler() calls ufshcd_err_handling_unprepare() and the latter function calls ufshcd_clear_ua_wluns(). - ufshcd_clear_ua_wluns() submits a REQUEST SENSE command and that command activates the SCSI error handler. - The SCSI error handler calls ufshcd_host_reset_and_restore(). - ufshcd_host_reset_and_restore() executes the following code: ufshcd_schedule_eh_work(hba); flush_work(&hba->eh_work); This sequence results in a deadlock (circular wait). Fix this by requesting sense data asynchronously. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Stanley Chu <redacted> Cc: Can Guo <redacted> Cc: Asutosh Das <redacted> Cc: Avri Altman <avri.altman@wdc.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Bean Huo <redacted>