Thu Nov 28 06:56:36 2013 UTC ()
Drop the intr_lock when calling usb_schedsoftintr so that we don't lock
against ourself in dwc2_softintr in the polling case.


(skrll)
diff -r1.20 -r1.21 src/sys/external/bsd/dwc2/dwc2.c

cvs diff -r1.20 -r1.21 src/sys/external/bsd/dwc2/dwc2.c (expand / switch to unified diff)

--- src/sys/external/bsd/dwc2/dwc2.c 2013/11/19 10:07:11 1.20
+++ src/sys/external/bsd/dwc2/dwc2.c 2013/11/28 06:56:36 1.21
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: dwc2.c,v 1.20 2013/11/19 10:07:11 skrll Exp $ */ 1/* $NetBSD: dwc2.c,v 1.21 2013/11/28 06:56:36 skrll Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2013 The NetBSD Foundation, Inc. 4 * Copyright (c) 2013 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Nick Hudson 8 * by Nick Hudson
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.20 2013/11/19 10:07:11 skrll Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.21 2013/11/28 06:56:36 skrll Exp $");
34 34
35#include "opt_usb.h" 35#include "opt_usb.h"
36 36
37#include <sys/param.h> 37#include <sys/param.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/kmem.h> 39#include <sys/kmem.h>
40#include <sys/kernel.h> 40#include <sys/kernel.h>
41#include <sys/device.h> 41#include <sys/device.h>
42#include <sys/select.h> 42#include <sys/select.h>
43#include <sys/proc.h> 43#include <sys/proc.h>
44#include <sys/queue.h> 44#include <sys/queue.h>
45#include <sys/cpu.h> 45#include <sys/cpu.h>
46 46
@@ -1754,27 +1754,29 @@ void dwc2_host_complete(struct dwc2_hsot @@ -1754,27 +1754,29 @@ void dwc2_host_complete(struct dwc2_hsot
1754 1754
1755 dwc2_free_bus_bandwidth(hsotg, 1755 dwc2_free_bus_bandwidth(hsotg,
1756 dwc2_hcd_get_ep_bandwidth(hsotg, dpipe), 1756 dwc2_hcd_get_ep_bandwidth(hsotg, dpipe),
1757 xfer); 1757 xfer);
1758 } 1758 }
1759 1759
1760 qtd->urb = NULL; 1760 qtd->urb = NULL;
1761 callout_stop(&xfer->timeout_handle); 1761 callout_stop(&xfer->timeout_handle);
1762 1762
1763 KASSERT(mutex_owned(&hsotg->lock)); 1763 KASSERT(mutex_owned(&hsotg->lock));
1764 1764
1765 TAILQ_INSERT_TAIL(&sc->sc_complete, dxfer, xnext); 1765 TAILQ_INSERT_TAIL(&sc->sc_complete, dxfer, xnext);
1766 1766
 1767 mutex_spin_exit(&hsotg->lock);
1767 usb_schedsoftintr(&sc->sc_bus); 1768 usb_schedsoftintr(&sc->sc_bus);
 1769 mutex_spin_enter(&hsotg->lock);
1768} 1770}
1769 1771
1770 1772
1771int 1773int
1772_dwc2_hcd_start(struct dwc2_hsotg *hsotg) 1774_dwc2_hcd_start(struct dwc2_hsotg *hsotg)
1773{ 1775{
1774 dev_dbg(hsotg->dev, "DWC OTG HCD START\n"); 1776 dev_dbg(hsotg->dev, "DWC OTG HCD START\n");
1775 1777
1776 mutex_spin_enter(&hsotg->lock); 1778 mutex_spin_enter(&hsotg->lock);
1777 1779
1778 hsotg->op_state = OTG_STATE_A_HOST; 1780 hsotg->op_state = OTG_STATE_A_HOST;
1779 1781
1780 dwc2_hcd_reinit(hsotg); 1782 dwc2_hcd_reinit(hsotg);