USB: gadget: u_bam: Fix recursive spinlock up issue
There is recursive spinlock up issue seen as below:
CPU0 (thread 1) CPU0 (interrupt context)
gbam2bam_connect_work() |
| |
| |
| |
| USB reset interrupt
| | take dwc3->lock,
| | interrupt enable
| |
gbam_start_endless_rx() dwc3_disconnect_gadget()
|takes port_lock_ul, | release dwc3->lock
| interrupt enable |
| |
dwc3_gadget_ep_queue() composite_disconnect()
| takes dwc3->lock |
| |
frmnet_disable()
|
|
gport_rmnet_disconnect()
|
|
gbam_disconnect()
|
|
gbam_free_rx_buffers()
| trying to acquire same
| port_lock_ul which is
| already held on thread1
|
Hence fix this issue by using spin_lock_irqsave() and
spin_unlock_irqrestore() API for start/stop endless tx/rx APIs and also
not calling usb_ep_queue() and usb_ep_dequeue() with that acquire.
Spinlock is being used in this API to guard against disconnect
functionality and making port->port_usb to NULL which is handle now using
EP context before releasing spinlock here.
CRs-Fixed: 831709
Change-Id: Ic33a3fc8c5bd8ba256942db3e8cd3559017401db
Signed-off-by:
Mayank Rana <mrana@codeaurora.org>
Loading
Please register or sign in to comment