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-dbg.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-dbg.c')
-rw-r--r-- | drivers/usb/host/ehci-dbg.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c index 680e1a31fb87..7561966fbdc4 100644 --- a/drivers/usb/host/ehci-dbg.c +++ b/drivers/usb/host/ehci-dbg.c | |||
@@ -1025,10 +1025,8 @@ static ssize_t debug_lpm_write(struct file *file, const char __user *user_buf, | |||
1025 | if (strict_strtoul(buf + 5, 16, &hird)) | 1025 | if (strict_strtoul(buf + 5, 16, &hird)) |
1026 | return -EINVAL; | 1026 | return -EINVAL; |
1027 | printk(KERN_INFO "setting hird %s %lu\n", buf + 6, hird); | 1027 | printk(KERN_INFO "setting hird %s %lu\n", buf + 6, hird); |
1028 | temp = ehci_readl(ehci, &ehci->regs->command); | 1028 | ehci->command = (ehci->command & ~CMD_HIRD) | (hird << 24); |
1029 | temp &= ~CMD_HIRD; | 1029 | ehci_writel(ehci, ehci->command, &ehci->regs->command); |
1030 | temp |= hird << 24; | ||
1031 | ehci_writel(ehci, temp, &ehci->regs->command); | ||
1032 | } else if (strncmp(buf, "disable", 7) == 0) { | 1030 | } else if (strncmp(buf, "disable", 7) == 0) { |
1033 | if (strict_strtoul(buf + 8, 10, &port)) | 1031 | if (strict_strtoul(buf + 8, 10, &port)) |
1034 | return -EINVAL; | 1032 | return -EINVAL; |