Re: [PATCH v1] scsi: ufs: correct ufshcd_shutdown flow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 7/23/22 2:04 AM, Bart Van Assche wrote:
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@xxxxxxxxxxxx wrote:
From: Peter Wang <peter.wang@xxxxxxxxxxxx>
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.

Hi Bart,

No, in drivers/base/core.c:
pm_runtime_get_noresume(dev); => No guarantee device will resume
pm_runtime_barrier(dev);      => Only flush pending pm request like RPM_SUSPENDING/RPM_RESUMING

So, If below two condition is meet.
(1) device is already in RPM_SUSPENDED
(2) device resume is required.
Then driver still need call pm_runtime_get_sync just like ufshcd_wl_shutdown.

The reason why here can remove pm_runtime_get_sync is because,
(1) ufshcd_wl_shutdown -> pm_runtime_get_sync, will resume hba->dev too.
(2) device resume(turn on clk/power) is not required, even if device is in RPM_SUSPENDED.

Thanks.
Peter





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux