Commit 50966da
usb: gadget: udc: core: Offload usb_udc_vbus_handler processing
usb_udc_vbus_handler() can be invoked from interrupt context by irq
handlers of the gadget drivers, however, usb_udc_connect_control() has
to run in non-atomic context due to the following:
a. Some of the gadget driver implementations expect the ->pullup
callback to be invoked in non-atomic context.
b. usb_gadget_disconnect() acquires udc_lock which is a mutex.
Hence offload invocation of usb_udc_connect_control()
to workqueue.
UDC should not be pulled up unless gadget driver is bound. The new flag
"allow_connect" is now set by gadget_bind_driver() and cleared by
gadget_unbind_driver(). This prevents work item to pull up the gadget
even if queued when the gadget driver is already unbound.
Cc: stable@vger.kernel.org
Fixes: 1016fc0 ("USB: gadget: Fix obscure lockdep violation for udc_mutex")
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Message-ID: <20230609010227.978661-1-badhri@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 92c9c3b commit 50966da
1 file changed
Lines changed: 27 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
| |||
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| 54 | + | |
| 55 | + | |
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
| |||
706 | 711 | | |
707 | 712 | | |
708 | 713 | | |
709 | | - | |
| 714 | + | |
710 | 715 | | |
711 | 716 | | |
712 | 717 | | |
| |||
1086 | 1091 | | |
1087 | 1092 | | |
1088 | 1093 | | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
1089 | 1101 | | |
1090 | 1102 | | |
1091 | 1103 | | |
| |||
1094 | 1106 | | |
1095 | 1107 | | |
1096 | 1108 | | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
1097 | 1117 | | |
1098 | 1118 | | |
1099 | 1119 | | |
1100 | 1120 | | |
1101 | 1121 | | |
1102 | 1122 | | |
1103 | 1123 | | |
1104 | | - | |
| 1124 | + | |
1105 | 1125 | | |
1106 | 1126 | | |
1107 | 1127 | | |
| |||
1328 | 1348 | | |
1329 | 1349 | | |
1330 | 1350 | | |
| 1351 | + | |
1331 | 1352 | | |
1332 | 1353 | | |
1333 | 1354 | | |
| |||
1459 | 1480 | | |
1460 | 1481 | | |
1461 | 1482 | | |
| 1483 | + | |
1462 | 1484 | | |
1463 | 1485 | | |
1464 | 1486 | | |
| |||
1527 | 1549 | | |
1528 | 1550 | | |
1529 | 1551 | | |
| 1552 | + | |
1530 | 1553 | | |
1531 | 1554 | | |
1532 | 1555 | | |
| |||
1558 | 1581 | | |
1559 | 1582 | | |
1560 | 1583 | | |
| 1584 | + | |
| 1585 | + | |
1561 | 1586 | | |
1562 | 1587 | | |
1563 | 1588 | | |
| |||
0 commit comments