* [PATCH] scsi: ufs: core: Do not set link to OFF state while waking up from hibernation
@ 2024-07-18 17:06 Manivannan Sadhasivam
2024-07-22 17:57 ` Bart Van Assche
2024-07-23 0:32 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-18 17:06 UTC (permalink / raw)
To: James.Bottomley, martin.petersen
Cc: alim.akhtar, avri.altman, bvanassche, linux-scsi, linux-kernel,
Manivannan Sadhasivam, Anjana Hari, stable
UFS link is just put into hibern8 state during the 'freeze' process of the
hibernation. Afterwards, the system may get powered down. But that doesn't
matter during wakeup. Because during wakeup from hibernation, UFS link is
again put into hibern8 state by the restore kernel and then the control is
handed over to the to image kernel.
So in both the places, UFS link is never turned OFF. But
ufshcd_system_restore() just assumes that the link will be in OFF state and
sets the link state accordingly. And this breaks hibernation wakeup:
[ 2445.371335] phy phy-1d87000.phy.3: phy_power_on was called before phy_init
[ 2445.427883] ufshcd-qcom 1d84000.ufshc: Controller enable failed
[ 2445.427890] ufshcd-qcom 1d84000.ufshc: ufshcd_host_reset_and_restore: Host init failed -5
[ 2445.427906] ufs_device_wlun 0:0:0:49488: ufshcd_wl_resume failed: -5
[ 2445.427918] ufs_device_wlun 0:0:0:49488: PM: dpm_run_callback(): scsi_bus_restore returns -5
[ 2445.427973] ufs_device_wlun 0:0:0:49488: PM: failed to restore async: error -5
So fix the issue by removing the code that sets the link to OFF state.
Cc: Anjana Hari <quic_ahari@quicinc.com>
Cc: stable@vger.kernel.org # 6.3
Fixes: 88441a8d355d ("scsi: ufs: core: Add hibernation callbacks")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
drivers/ufs/core/ufshcd.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 9f037a40316a..a9dfa82adac9 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -10261,9 +10261,6 @@ int ufshcd_system_restore(struct device *dev)
*/
ufshcd_readl(hba, REG_UTP_TASK_REQ_LIST_BASE_H);
- /* Resuming from hibernate, assume that link was OFF */
- ufshcd_set_link_off(hba);
-
return 0;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: ufs: core: Do not set link to OFF state while waking up from hibernation
2024-07-18 17:06 [PATCH] scsi: ufs: core: Do not set link to OFF state while waking up from hibernation Manivannan Sadhasivam
@ 2024-07-22 17:57 ` Bart Van Assche
2024-07-23 0:32 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Bart Van Assche @ 2024-07-22 17:57 UTC (permalink / raw)
To: Manivannan Sadhasivam, James.Bottomley, martin.petersen
Cc: alim.akhtar, avri.altman, linux-scsi, linux-kernel, Anjana Hari,
stable
On 7/18/24 10:06 AM, Manivannan Sadhasivam wrote:
> UFS link is just put into hibern8 state during the 'freeze' process of the
> hibernation. Afterwards, the system may get powered down. But that doesn't
> matter during wakeup. Because during wakeup from hibernation, UFS link is
> again put into hibern8 state by the restore kernel and then the control is
> handed over to the to image kernel.
>
> So in both the places, UFS link is never turned OFF. But
> ufshcd_system_restore() just assumes that the link will be in OFF state and
> sets the link state accordingly. And this breaks hibernation wakeup:
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: ufs: core: Do not set link to OFF state while waking up from hibernation
2024-07-18 17:06 [PATCH] scsi: ufs: core: Do not set link to OFF state while waking up from hibernation Manivannan Sadhasivam
2024-07-22 17:57 ` Bart Van Assche
@ 2024-07-23 0:32 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2024-07-23 0:32 UTC (permalink / raw)
To: Manivannan Sadhasivam
Cc: James.Bottomley, martin.petersen, alim.akhtar, avri.altman,
bvanassche, linux-scsi, linux-kernel, Anjana Hari, stable
Manivannan,
> UFS link is just put into hibern8 state during the 'freeze' process of
> the hibernation. Afterwards, the system may get powered down. But that
> doesn't matter during wakeup. Because during wakeup from hibernation,
> UFS link is again put into hibern8 state by the restore kernel and
> then the control is handed over to the to image kernel.
Applied to 6.11/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-07-23 0:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-18 17:06 [PATCH] scsi: ufs: core: Do not set link to OFF state while waking up from hibernation Manivannan Sadhasivam
2024-07-22 17:57 ` Bart Van Assche
2024-07-23 0:32 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.