diff options
author | Marcelo Tosatti <marcelo@kvack.org> | 2007-01-21 16:45:59 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-02-07 18:44:39 -0500 |
commit | 1d619f128ba911cd3e6d6ad3475f146eb92f5c27 (patch) | |
tree | 2446e8041cdcf07fc5a530b853a6fa546fa0f52f /drivers/usb/host/ehci-hcd.c | |
parent | d0532184086906889f4a0cd92eade1f7be49fbac (diff) |
USB: switch ehci-hcd to new polling scheme
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 <mtosatti@redhat.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 92c62911f574..185721dba42b 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -501,6 +501,9 @@ static int ehci_run (struct usb_hcd *hcd) | |||
501 | u32 temp; | 501 | u32 temp; |
502 | u32 hcc_params; | 502 | u32 hcc_params; |
503 | 503 | ||
504 | hcd->uses_new_polling = 1; | ||
505 | hcd->poll_rh = 0; | ||
506 | |||
504 | /* EHCI spec section 4.1 */ | 507 | /* EHCI spec section 4.1 */ |
505 | if ((retval = ehci_reset(ehci)) != 0) { | 508 | if ((retval = ehci_reset(ehci)) != 0) { |
506 | ehci_mem_cleanup(ehci); | 509 | ehci_mem_cleanup(ehci); |
@@ -574,7 +577,7 @@ static int ehci_run (struct usb_hcd *hcd) | |||
574 | static irqreturn_t ehci_irq (struct usb_hcd *hcd) | 577 | static irqreturn_t ehci_irq (struct usb_hcd *hcd) |
575 | { | 578 | { |
576 | struct ehci_hcd *ehci = hcd_to_ehci (hcd); | 579 | struct ehci_hcd *ehci = hcd_to_ehci (hcd); |
577 | u32 status; | 580 | u32 status, pcd_status = 0; |
578 | int bh; | 581 | int bh; |
579 | 582 | ||
580 | spin_lock (&ehci->lock); | 583 | spin_lock (&ehci->lock); |
@@ -624,6 +627,7 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd) | |||
624 | /* remote wakeup [4.3.1] */ | 627 | /* remote wakeup [4.3.1] */ |
625 | if (status & STS_PCD) { | 628 | if (status & STS_PCD) { |
626 | unsigned i = HCS_N_PORTS (ehci->hcs_params); | 629 | unsigned i = HCS_N_PORTS (ehci->hcs_params); |
630 | pcd_status = status; | ||
627 | 631 | ||
628 | /* resume root hub? */ | 632 | /* resume root hub? */ |
629 | if (!(ehci_readl(ehci, &ehci->regs->command) & CMD_RUN)) | 633 | if (!(ehci_readl(ehci, &ehci->regs->command) & CMD_RUN)) |
@@ -670,6 +674,8 @@ dead: | |||
670 | if (bh) | 674 | if (bh) |
671 | ehci_work (ehci); | 675 | ehci_work (ehci); |
672 | spin_unlock (&ehci->lock); | 676 | spin_unlock (&ehci->lock); |
677 | if (pcd_status & STS_PCD) | ||
678 | usb_hcd_poll_rh_status(hcd); | ||
673 | return IRQ_HANDLED; | 679 | return IRQ_HANDLED; |
674 | } | 680 | } |
675 | 681 | ||