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>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
09091a4d5f
commit
3d9545cc37
@@ -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;
|
||||
|
Reference in New Issue
Block a user