ehci pci runtime pm question

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

 



Hi,

I have a dumb question about enabling EHCI runtime PM with PCI
subsystem. It seems core code in hci-pci.c provides the runtime call
backs in usb_hcd_pci_pm_ops. But I don't see that being used in case of
EHCI suspend/resume.

I must have missed something, can someone explain how this should work?

On our platform, we need to put EHCI in PCI D0i3 hot when we suspend
root hub so that the block can be put into low power mode. I guess we
also need platform specific functions to set the PCI Dx state during
runtime suspend.

It seems we can add the following to schedule PCI runtime PM calls by:

--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -301,8 +301,10 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
 
        if (ehci->has_otg && ehci->otg_suspend)
                rc = ehci->otg_suspend(hcd);
-
        spin_unlock_irq (&ehci->lock);
+       ehci_dbg(ehci, "rpm suspend\n");
+       pm_runtime_put_sync(ehci_to_hcd(ehci)->self.controller);
+       pm_schedule_suspend(ehci_to_hcd(ehci)->self.controller, 0);
 
        /* ehci_work() may have re-enabled the watchdog timer, which we
do not
         * want, and so we must delete any pending watchdog timer
events. @@ -322,6 +324,9 @@ static int ehci_bus_resume (struct usb_hcd
*hcd) u8                      resume_needed = 0;
        int                     rc = 0;
 
+       ehci_dbg(ehci, "rpm resume bus\n");
+       pm_runtime_get_sync(ehci_to_hcd(ehci)->self.controller);
+
        if (time_before (jiffies, ehci->next_statechange))
                msleep(5);
        spin_lock_irq (&ehci->lock);

-- 
Thanks

Jacob
(from Linux laptop)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux