Re: [PATCH v8 2/3] scsi: ufs: core: Hold host_sem in ufshcd_wl_poweroff()
From: Bart Van Assche
Date: Mon Nov 09 2026 - 13:24:00 EST
On 11/9/26 1:34 AM, Peter Wang wrote:
> Although not checking the return value was an original
> mistake, this patch would make the previous mistake worse
> and cause a system hang. Could we at least add a check
> to release the lock?
>
> + ret = __ufshcd_wl_suspend(hba, UFS_SHUTDOWN_PM);
> + if (ret)
> + up(&hba->host_sem);
I agree with Peter. If __ufshcd_wl_suspend() fails, host_sem must be
released so that ufshcd_err_handler() does not deadlock waiting on
down(&hba->host_sem). Also, please propagate 'ret' instead of returning
0 on failure.
Thanks,
Bart.