@@ -763,6 +763,10 @@ static int rtsx_usb_ms_drv_probe(struct platform_device *pdev)
msh->set_param = rtsx_usb_ms_set_param;
msh->caps = MEMSTICK_CAP_PAR4;
+ /* DPM_FLAG_LEAVE_SUSPENDED is not needed, the parent device will wake
+ * up memstick host.
+ */
+ dev_pm_set_driver_flags(ms_dev(host), DPM_FLAG_SMART_SUSPEND);
pm_runtime_set_active(ms_dev(host));
pm_runtime_enable(ms_dev(host));
@@ -671,6 +671,7 @@ static int rtsx_usb_probe(struct usb_interface *intf,
goto out_init_fail;
#ifdef CONFIG_PM
+ dev_pm_set_driver_flags(&intf->dev, DPM_FLAG_SMART_SUSPEND | DPM_FLAG_LEAVE_SUSPENDED);
intf->needs_remote_wakeup = 1;
usb_enable_autosuspend(usb_dev);
#endif
There's a long power-on delay at the end of rtsx_usb_ms_set_param(). This delay is noticeable right before system suspend. To prevent already suspended memstick host from getting powered on by PM core, use DPM_FLAG_SMART_SUSPEND to avoid the situation. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> --- drivers/memstick/host/rtsx_usb_ms.c | 4 ++++ drivers/misc/cardreader/rtsx_usb.c | 1 + 2 files changed, 5 insertions(+)