Skip to content

Commit ee36710

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: ufs: core: Remove the ufshcd_hba_exit() call from ufshcd_async_scan()
Calling ufshcd_hba_exit() from a function that is called asynchronously from ufshcd_init() is wrong because this triggers multiple race conditions. Instead of calling ufshcd_hba_exit(), log an error message. Reported-by: Daniel Mentz <danielmentz@google.com> Fixes: 1d337ec ("ufs: improve init sequence") Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20231218225229.2542156-3-bvanassche@acm.org Reviewed-by: Can Guo <quic_cang@quicinc.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent daf7795 commit ee36710

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8982,12 +8982,9 @@ static void ufshcd_async_scan(void *data, async_cookie_t cookie)
89828982

89838983
out:
89848984
pm_runtime_put_sync(hba->dev);
8985-
/*
8986-
* If we failed to initialize the device or the device is not
8987-
* present, turn off the power/clocks etc.
8988-
*/
8985+
89898986
if (ret)
8990-
ufshcd_hba_exit(hba);
8987+
dev_err(hba->dev, "%s failed: %d\n", __func__, ret);
89918988
}
89928989

89938990
static enum scsi_timeout_action ufshcd_eh_timed_out(struct scsi_cmnd *scmd)

0 commit comments

Comments
 (0)