USB: host: ohci-at91: tailor power consumption
Subsystems (3)
Nicolas Ferre
maintainercover USB: host: ohci-at91: tailor power consumption
Following a set of experiments we found areas of improvement for OHCI power consumption (and associated USB analog cells).
This enhances the shutdown of residual power consumption in case of Linux suspend/resume and removal of the driver (when compiled as a module).
Best regards,
Nicolas
Boris Krasnovskiy (2):
USB: host: ohci-at91: completely shutdown the controller in
at91_stop_hc()
USB: host: ohci-at91: resume: balance the clock start call
Nicolas Ferre (1):
USB: host: ohci-at91: suspend: delay needed before to stop clocks
drivers/usb/host/ohci-at91.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
2.17.1
Nicolas Ferre
maintainerPATCH 1/3 USB: host: ohci-at91: completely shutdown the controller in at91_stop_hc()
From: Boris Krasnovskiy <[email protected]>
When removing the ohci-at91 module, the fact of not running complete shutdown of all the ports was keeping additional analog cells consuming power for no reason.
Doing Reset (OHCI_HCR) to HcCommandStatus register is the way to go, but using the OHCI controller shutdown procedure is just perfect for this.
--- drivers/usb/host/ohci-at91.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ohci-at91.c +1 -1
@@ -123,7 +123,7 @@ static void at91_stop_hc(struct platform_device *pdev)/* * Put the USB host controller into reset. */ -writel (0 , ®s->control); +usb_hcd_platform_shutdown (pdev);/* * Stop the USB clocks.
Signature · 1 line
2.17.1
Nicolas Ferre
maintainerPATCH 2/3 USB: host: ohci-at91: suspend: delay needed before to stop clocks
In reply to Nicolas FerreIn order to completely remove marginal power consumption in PM suspend, we need to let the controller settle down before being stopped. In ohci_hcd_at91_drv_suspend() function, one additional delay is needed before to stop the clocks.
--- drivers/usb/host/ohci-at91.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/ohci-at91.c +1 -0
@@ -628,6 +628,7 @@ ohci_hcd_at91_drv_suspend(struct device *dev)/* flush the writes */ (void )ohci_readl (ohci, &ohci->regs->control); +msleep (1 );at91_stop_clock (ohci_at91); }
Signature · 1 line
2.17.1
Nicolas Ferre
maintainerPATCH 3/3 USB: host: ohci-at91: resume: balance the clock start call
In reply to Nicolas FerreFrom: Boris Krasnovskiy <[email protected]>
There is a clock enable counter run away problem in resume ohci_at91. Code enables clock that was never disabled in case of non wakeup interface. That would make clock unstoppable in future.
Use proper alternative to start clocks only if they were stopped before.
--- drivers/usb/host/ohci-at91.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ohci-at91.c +2 -2
@@ -643,8 +643,8 @@ ohci_hcd_at91_drv_resume(struct device *dev)if (ohci_at91->wakeup)disable_irq_wake (hcd->irq); - -at91_start_clock (ohci_at91); +else +at91_start_clock (ohci_at91);ohci_resume (hcd, false);
Signature · 1 line
2.17.1
Quoted 10 lines · Nicolas Ferre
Following a set of experiments we found areas of improvement for OHCI power consumption (and associated USB analog cells).
This enhances the shutdown of residual power consumption in case of Linux suspend/resume and removal of the driver (when compiled as a module).Best regards,
NicolasBoris Krasnovskiy (2):
USB: host: ohci-at91: completely shutdown the controller in
Quoted 8 lines
at91_stop_hc()USB: host: ohci-at91: resume: balance the clock start call
Nicolas Ferre (1):
USB: host: ohci-at91: suspend: delay needed before to stop clocksdrivers/usb/host/ohci-at91.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
For all three patches: