Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1209179 > unrolled thread

[PATCH 1/5] usb: xhci: lock mutex on xhci_stop

Started byRoger Quadros <rogerq@ti.com>
First post2015-08-18 12:50 +0200
Last post2015-08-18 13:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/5] usb: xhci: lock mutex on xhci_stop Roger Quadros <rogerq@ti.com> - 2015-08-18 12:50 +0200
    Re: [PATCH 1/5] usb: xhci: lock mutex on xhci_stop Mathias Nyman <mathias.nyman@intel.com> - 2015-08-18 13:40 +0200

#1209179 — [PATCH 1/5] usb: xhci: lock mutex on xhci_stop

FromRoger Quadros <rogerq@ti.com>
Date2015-08-18 12:50 +0200
Subject[PATCH 1/5] usb: xhci: lock mutex on xhci_stop
Message-ID<pYMCS-3Kd-17@gated-at.bofh.it>
Else it races with xhci_setup_device

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/host/xhci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 526ebc0..f998ddf 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -677,8 +677,11 @@ void xhci_stop(struct usb_hcd *hcd)
 	u32 temp;
 	struct xhci_hcd *xhci = hcd_to_xhci(hcd);
 
+	mutex_lock(&xhci->mutex);
+
 	if (!usb_hcd_is_primary_hcd(hcd)) {
 		xhci_only_stop_hcd(xhci->shared_hcd);
+		mutex_unlock(&xhci->mutex);
 		return;
 	}
 
@@ -717,6 +720,7 @@ void xhci_stop(struct usb_hcd *hcd)
 	xhci_dbg_trace(xhci, trace_xhci_dbg_init,
 			"xhci_stop completed - status = %x",
 			readl(&xhci->op_regs->status));
+	mutex_unlock(&xhci->mutex);
 }
 
 /*
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1209206

FromMathias Nyman <mathias.nyman@intel.com>
Date2015-08-18 13:40 +0200
Message-ID<pYNpg-4Ug-39@gated-at.bofh.it>
In reply to#1209179
On 18.08.2015 13:39, Roger Quadros wrote:
> Else it races with xhci_setup_device
>
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> ---

Thanks.
Applied, will send forward after 4.3-rc1

-Mathias

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web