Commit e4386a9f authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] ehci, more small fixes

- some access to urb->hcpriv and urb->status needed to be
   locked using urb->lock
- paranoia: don't depend on two values being in lock-step.
parent fb4efa15
...@@ -180,9 +180,10 @@ ehci_urb_done (struct ehci_hcd *ehci, struct urb *urb, struct pt_regs *regs) ...@@ -180,9 +180,10 @@ ehci_urb_done (struct ehci_hcd *ehci, struct urb *urb, struct pt_regs *regs)
hcd_to_bus (&ehci->hcd)->bandwidth_int_reqs--; hcd_to_bus (&ehci->hcd)->bandwidth_int_reqs--;
} }
qh_put (ehci, qh); qh_put (ehci, qh);
urb->hcpriv = 0;
} }
spin_lock (&urb->lock);
urb->hcpriv = 0;
switch (urb->status) { switch (urb->status) {
case -EINPROGRESS: /* success */ case -EINPROGRESS: /* success */
urb->status = 0; urb->status = 0;
...@@ -199,6 +200,7 @@ ehci_urb_done (struct ehci_hcd *ehci, struct urb *urb, struct pt_regs *regs) ...@@ -199,6 +200,7 @@ ehci_urb_done (struct ehci_hcd *ehci, struct urb *urb, struct pt_regs *regs)
COUNT (ehci->stats.unlink); COUNT (ehci->stats.unlink);
break; break;
} }
spin_unlock (&urb->lock);
/* complete() can reenter this HCD */ /* complete() can reenter this HCD */
spin_unlock (&ehci->lock); spin_unlock (&ehci->lock);
...@@ -686,7 +688,7 @@ static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh) ...@@ -686,7 +688,7 @@ static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
head = ehci->async; head = ehci->async;
if (ehci->async_idle) if (ehci->async_idle)
del_timer (&ehci->watchdog); del_timer (&ehci->watchdog);
else if (!head->qh_next.qh) { if (!head->qh_next.qh) {
u32 cmd = readl (&ehci->regs->command); u32 cmd = readl (&ehci->regs->command);
if (!(cmd & CMD_ASE)) { if (!(cmd & CMD_ASE)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment