On Tue, Aug 13, 2024 at 03:22:45PM +0800, Shawn Lin wrote: [...] > > > > For runtime PM case, it's the power-domain driver will power down the > > > > controller and PHY if UFS stack is not active any more(autosuspend). > > > > > > > > For system PM case, it's the SoC's firmware to cutting of all the power > > > > for controller/PHY and device. > > > > > > > > > > Both cases are not matching the expectations of {rpm/spm}_lvl. So > > > the platform > > > (power domain or the firmware) should be fixed. What if the user sets the > > > {rpm/spm}_lvl to 1? Will the platform power down the controller even > > > then? If > > > so, then I'd say that the platform is broken and should be fixed. > > > > Ok, it seems I need to set {rpm/spm}_lvl = 6 if I want platform to power > > down the controller for ultra power-saving. But I still need to add my > > own system PM callback in that case to recovery the link first. Do I > > misunderstand it? > > > > And for the user who sets the rpm/spm level via > > ufs_sysfs_pm_lvl_store(), I think there is no way to block it currently, > > except that we need to fix the power-domain driver and Firmware to > > respect the level and choose correct policy. > > > > > > So in summary for what the next step I should to: > > (1) Set {rpm/spm}_lvl = 6 in host driver to reflect the expectation > > (2) Add own PM callbacks to recovery the link to meet the expectation > > (3) Fix the broken behaviour of PD or Firmware to respect the actual > > desired pm level if user changes the pm level. > > > > > > Sorry, I misunderstood your comment, so the action should be > (1) Set {rpm/spm}_lvl = 5 in host driver to reflect the expectation > (2) Use ufshcd_system_suspend/resume, but keep our own runtime PM > callbacks as we need a extra step to gate refclk. Ok. > (3) Fix the broken behaviour of PD or Firmware to respect the actual > desired pm level if user changes the pm level. If you do this, then you don't need (1), don't you? - Mani -- மணிவண்ணன் சதாசிவம்