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

父節點
09091a4d5f
當前提交
3d9545cc37
@@ -233,7 +233,6 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
|
||||
/* stop schedules, clean any completed work */
|
||||
if (ehci->rh_state == EHCI_RH_RUNNING)
|
||||
ehci_quiesce (ehci);
|
||||
ehci->command = ehci_readl(ehci, &ehci->regs->command);
|
||||
ehci_work(ehci);
|
||||
|
||||
/* Unlike other USB host controller types, EHCI doesn't have
|
||||
@@ -374,6 +373,7 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
|
||||
ehci_writel(ehci, (u32) ehci->async->qh_dma, &ehci->regs->async_next);
|
||||
|
||||
/* restore CMD_RUN, framelist size, and irq threshold */
|
||||
ehci->command |= CMD_RUN;
|
||||
ehci_writel(ehci, ehci->command, &ehci->regs->command);
|
||||
ehci->rh_state = EHCI_RH_RUNNING;
|
||||
|
||||
|
Reference in New Issue
Block a user