From 3d9545cc375d117554a9b35dfddadf9189c62775 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Mon, 23 Apr 2012 13:54:36 -0400 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/ehci-dbg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/usb/host/ehci-dbg.c') diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c index 680e1a31fb8..7561966fbdc 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, if (strict_strtoul(buf + 5, 16, &hird)) return -EINVAL; printk(KERN_INFO "setting hird %s %lu\n", buf + 6, hird); - temp = ehci_readl(ehci, &ehci->regs->command); - temp &= ~CMD_HIRD; - temp |= hird << 24; - ehci_writel(ehci, temp, &ehci->regs->command); + ehci->command = (ehci->command & ~CMD_HIRD) | (hird << 24); + ehci_writel(ehci, ehci->command, &ehci->regs->command); } else if (strncmp(buf, "disable", 7) == 0) { if (strict_strtoul(buf + 8, 10, &port)) return -EINVAL; -- cgit v1.2.3-70-g09d2