Re: [PATCH v7 3/3] scsi: ufs: core: Limit early link recovery in the error handler to runtime PM
From: Bart Van Assche
Date: Fri Nov 06 2026 - 17:01:00 EST
On 11/5/26 10:11 PM, HOYOUNG SEO wrote:
> ufshcd_rpm_get_noresume(hba);
> - if (hba->pm_op_in_progress) {
> + if (READ_ONCE(hba->runtime_pm_in_progress)) {
> ufshcd_link_recovery(hba);
> ufshcd_rpm_put(hba);
> return;
Has it been considered to use the runtime PM status maintained by the
PM core instead of introducing a new member variable? While
ufshcd_wl_runtime_suspend() or ufshcd_wl_runtime_resume() is running,
hba->ufs_device_wlun->sdev_gendev.power.runtime_status is either
RPM_SUSPENDING or RPM_RESUMING. During system PM it is either
RPM_ACTIVE or RPM_SUSPENDED. Reading runtime_status without holding
power.lock is not more racy than reading the new flag.
Thanks,
Bart.