[PATCH v1] scsi: ufs: correct ufshcd_shutdown flow

Bart Van Assche bvanassche at acm.org
Fri Jul 22 11:04:08 PDT 2022


On 7/20/22 21:30, Peter Wang wrote:
> On 7/21/22 5:40 AM, Bart Van Assche wrote:
>> On 7/19/22 06:02, peter.wang at mediatek.com wrote:
>>> From: Peter Wang <peter.wang at mediatek.com>
>>> Also remove pm_runtime_get_sync because it is unnecessary.
>>
>> Please explain in the patch description why the pm_runtime_get_sync() 
>> call is not necessary.
> 
> Because shutdown is focus on turn off clock/power, we don't need turn 
> on(resume) and turn off, right?
Hi Peter,

I think that removing the pm_runtime_get_sync() call is safe because the 
device driver core already performs a runtime resume before the UFS 
driver shutdown callback function is called. From drivers/base/core.c:

		/* Don't allow any more runtime suspends */
		pm_runtime_get_noresume(dev);
		pm_runtime_barrier(dev);

Thanks,

Bart.



More information about the Linux-mediatek mailing list