On Wed, Jan 03, 2007 at 09:34:57PM -0800, David Brownell wrote:
> On Friday 29 December 2006 11:26 am, Marcelo Tosatti wrote:

<snip>

> Move that earlier ... into the existing block of code for STS_PCD.

As Alan mentioned that can't be done since we hold ehci->lock at that
point, and usb_hcd_poll_rh_status() attempts to acquire it.

> Presumably you tested this and it behaves?

Switch ehci-hcd to use the new polling scheme, which reports root
hub status changes via the interrupt handler, in an asynchronous
fashion. Doing so disables polling for status changes (whose handler is
rh_timer_func).

Tested on a Geode GX machine, which is now capable of running at =~ 5
timer interrupts per second (in the -rt tree), resulting in significant
power savings.

Signed-off-by: Marcelo Tosatti <[EMAIL PROTECTED]>

--- a/drivers/usb/host/ehci-hcd.c.orig  2007-01-20 22:01:35.000000000 -0200
+++ b/drivers/usb/host/ehci-hcd.c       2007-01-21 19:19:22.000000000 -0200
@@ -491,6 +491,9 @@
        u32                     temp;
        u32                     hcc_params;
 
+       hcd->uses_new_polling = 1;
+       hcd->poll_rh = 0;
+
        /* EHCI spec section 4.1 */
        if ((retval = ehci_reset(ehci)) != 0) {
                ehci_mem_cleanup(ehci);
@@ -561,7 +564,7 @@
 static irqreturn_t ehci_irq (struct usb_hcd *hcd)
 {
        struct ehci_hcd         *ehci = hcd_to_ehci (hcd);
-       u32                     status;
+       u32                     status, pcd_status = 0;
        int                     bh;
 
        spin_lock (&ehci->lock);
@@ -611,6 +614,7 @@
        /* remote wakeup [4.3.1] */
        if (status & STS_PCD) {
                unsigned        i = HCS_N_PORTS (ehci->hcs_params);
+               pcd_status = status;
 
                /* resume root hub? */
                status = readl (&ehci->regs->command);
@@ -657,6 +661,8 @@
        if (bh)
                ehci_work (ehci);
        spin_unlock (&ehci->lock);
+       if (pcd_status & STS_PCD)
+               usb_hcd_poll_rh_status(hcd);
        return IRQ_HANDLED;
 }



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to