diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-04-23 13:54:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-23 15:05:44 -0400 |
commit | 3d9545cc375d117554a9b35dfddadf9189c62775 (patch) | |
tree | b01707d2e0901665f20bae0f0c5a0930af69651a /drivers/usb/host/ehci-sched.c | |
parent | 09091a4d5f2dd378dcf71de50b48cdacc58a8ac0 (diff) |
EHCI: maintain the ehci->command value properly
The ehci-hcd driver is a little haphazard about keeping track of the
state of the USBCMD register. The ehci->command field is supposed to
hold the register's value (apart from a few special bits) at all
times, but it isn't maintained properly.
This patch (as1543) cleans up the situation. It keeps ehci->command
up-to-date, and uses that value rather than reading the register from
the hardware whenever possible.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-sched.c')
-rw-r--r-- | drivers/usb/host/ehci-sched.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index a60679cbbf85..ffe8fc3bc7ef 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -481,7 +481,6 @@ static int tt_no_collision ( | |||
481 | 481 | ||
482 | static int enable_periodic (struct ehci_hcd *ehci) | 482 | static int enable_periodic (struct ehci_hcd *ehci) |
483 | { | 483 | { |
484 | u32 cmd; | ||
485 | int status; | 484 | int status; |
486 | 485 | ||
487 | if (ehci->periodic_sched++) | 486 | if (ehci->periodic_sched++) |
@@ -497,8 +496,8 @@ static int enable_periodic (struct ehci_hcd *ehci) | |||
497 | return status; | 496 | return status; |
498 | } | 497 | } |
499 | 498 | ||
500 | cmd = ehci_readl(ehci, &ehci->regs->command) | CMD_PSE; | 499 | ehci->command |= CMD_PSE; |
501 | ehci_writel(ehci, cmd, &ehci->regs->command); | 500 | ehci_writel(ehci, ehci->command, &ehci->regs->command); |
502 | /* posted write ... PSS happens later */ | 501 | /* posted write ... PSS happens later */ |
503 | 502 | ||
504 | /* make sure ehci_work scans these */ | 503 | /* make sure ehci_work scans these */ |
@@ -511,7 +510,6 @@ static int enable_periodic (struct ehci_hcd *ehci) | |||
511 | 510 | ||
512 | static int disable_periodic (struct ehci_hcd *ehci) | 511 | static int disable_periodic (struct ehci_hcd *ehci) |
513 | { | 512 | { |
514 | u32 cmd; | ||
515 | int status; | 513 | int status; |
516 | 514 | ||
517 | if (--ehci->periodic_sched) | 515 | if (--ehci->periodic_sched) |
@@ -537,8 +535,8 @@ static int disable_periodic (struct ehci_hcd *ehci) | |||
537 | return status; | 535 | return status; |
538 | } | 536 | } |
539 | 537 | ||
540 | cmd = ehci_readl(ehci, &ehci->regs->command) & ~CMD_PSE; | 538 | ehci->command &= ~CMD_PSE; |
541 | ehci_writel(ehci, cmd, &ehci->regs->command); | 539 | ehci_writel(ehci, ehci->command, &ehci->regs->command); |
542 | /* posted write ... */ | 540 | /* posted write ... */ |
543 | 541 | ||
544 | free_cached_lists(ehci); | 542 | free_cached_lists(ehci); |