lkml.org 
[lkml]   [2018]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/5] memstick: rtsx_usb_ms: Support runtime power management
On Wed, 25 Jul 2018, Kai-Heng Feng wrote:

> In order to let host's parent device, rtsx_usb, to use USB remote wake
> up signaling to do card detection, it needs to be suspended. Hence it's
> necessary to add runtime PM support for the memstick host.
>
> To keep memstick host stays suspended when it's not in use, convert the
> card detection function from kthread to delayed_work, which can be
> scheduled when the host is resumed and can be canceled when the host is
> suspended.
>
> Use an idle function check if there's no card and the power mode is
> MEMSTICK_POWER_OFF. If both criteria are met, put the device to suspend.
>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>

I'm not familiar enough with this driver to comment on specific
instances, but you should carefully go through the code and make sure
that you use pm_runtime_get_noresume() and pm_runtime_put_noidle()
correctly.

The basic idea is to use these when you know beforehand that the device
is already at full power (for _get_noresume) and the usage count will
not go to 0 (for _put_noidle). If you aren't certain of these
requirements then you should call pm_runtime_get_sync() and
pm_runtime_put().

Alan Stern

\
 
 \ /
  Last update: 2018-07-25 20:00    [W:0.069 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site