Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
usb: dwc3: gadget: avoid multiple calls to free_irq
When we use /sys/class/udc/<udc>/soft_connect to do a logical disconnection from the USB Host on RK3399 Excavator Board, it dumps the warning log: Trying to free already-free IRQ 231 WARNING: CPU: 2 PID: 1308 at kernel/irq/manage.c:1628 __free_irq+0xa0/0x2e0 Modules linked in: CPU: 2 PID: 1308 Comm: adbd Not tainted 4.19.80 rockchip-linux#49 Hardware name: Rockchip RK3399 Excavator Board edp avb (Android) (DT) pstate: 40400085 (nZcv daIf +PAN -UAO) pc : __free_irq+0xa0/0x2e0 lr : __free_irq+0xa0/0x2e0 ... Call trace: __free_irq+0xa0/0x2e0 free_irq+0x38/0x90 dwc3_gadget_stop+0x58/0x80 usb_gadget_remove_driver+0x50/0x70 usb_gadget_unregister_driver+0xc0/0x110 unregister_gadget+0x20/0x50 unregister_gadget_item+0x24/0x38 ffs_data_clear+0x120/0x130 ffs_data_reset+0x14/0x50 ffs_data_closed+0x88/0xd8 ffs_epfile_release+0x20/0x30 To solve the problem, don't call free_irq() in dwc3_gadget_stop() if dwc->gadget_driver is NULL. Change-Id: I9d5b5b354612c3ce3677b3d15cf6af1fcbf3f399 Signed-off-by: William Wu <[email protected]>
- Loading branch information