aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/uhci-q.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2010-06-09 17:34:39 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 17:35:33 -0400
commitba297edde4dd7376832bafb23e032a40d5928b56 (patch)
tree9ede30f81c45a29f10ad2170d787985a88da828c /drivers/usb/host/uhci-q.c
parentc548795abe0d3520b74e18f23ca0a0d72deddab9 (diff)
USB: UHCI: acquire spinlock before calling start_rh()
This patch (as1392) fixes a bug in uhci-hcd: The start_rh() routine is supposed to be called with the private spinlock held. If an IRQ comes in at just the wrong time, the driver will think the controller has died when in fact it simply hasn't start yet. The patch also addresses some issues that may prevent an URB from being unlinked after the controller has stopped. This is an abnormal occurrence (ordinarily the controller stops only when the entire bus is suspended and hence there are no active URBs), so the pathways haven't gotten much testing. These two changes may be a little more than is strictly necessary, but clearly they won't hurt. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/uhci-q.c')
-rw-r--r--drivers/usb/host/uhci-q.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c
index acd582c02802..d3ade4018487 100644
--- a/drivers/usb/host/uhci-q.c
+++ b/drivers/usb/host/uhci-q.c
@@ -565,7 +565,7 @@ static void uhci_unlink_qh(struct uhci_hcd *uhci, struct uhci_qh *qh)
565 qh->unlink_frame = uhci->frame_number; 565 qh->unlink_frame = uhci->frame_number;
566 566
567 /* Force an interrupt so we know when the QH is fully unlinked */ 567 /* Force an interrupt so we know when the QH is fully unlinked */
568 if (list_empty(&uhci->skel_unlink_qh->node)) 568 if (list_empty(&uhci->skel_unlink_qh->node) || uhci->is_stopped)
569 uhci_set_next_interrupt(uhci); 569 uhci_set_next_interrupt(uhci);
570 570
571 /* Move the QH from its old list to the end of the unlinking list */ 571 /* Move the QH from its old list to the end of the unlinking list */
@@ -1667,7 +1667,7 @@ static int uhci_advance_check(struct uhci_hcd *uhci, struct uhci_qh *qh)
1667 qh->advance_jiffies = jiffies; 1667 qh->advance_jiffies = jiffies;
1668 goto done; 1668 goto done;
1669 } 1669 }
1670 ret = 0; 1670 ret = uhci->is_stopped;
1671 } 1671 }
1672 1672
1673 /* The queue hasn't advanced; check for timeout */ 1673 /* The queue hasn't advanced; check for timeout */