From ded9d8b53d9df54b5725c7c9552f7118821379b1 Mon Sep 17 00:00:00 2001 From: Pratham Pratap Date: Tue, 17 Dec 2019 21:28:39 +0530 Subject: [PATCH] usb: dwc3: Remove WQ_MEM_RECLAIM flag while allocating sm_usb_wq This change removes WQ_MEM_RECLAIM flag while allocating workqueue for sm_usb_wq. With this flag, below warning message and calltrace is seen while flushing hub_wq during peripheral disconnect. [ 223.260116] workqueue: WQ_MEM_RECLAIM k_sm_usb:dwc3_otg_sm_work is flushing !WQ_MEM_RECLAIM usb_hub_wq: (null) [ 223.279836] pstate: 60c00005 (nZCv daif +PAN +UAO) [ 223.304544] pc : check_flush_dependency+0x118/0x120 [ 223.393801] lr : check_flush_dependency+0x118/0x120 Call trace: [ 224.069750] check_flush_dependency+0x118/0x120 [ 224.074420] flush_workqueue+0x1b0/0x488 [ 224.078466] usb_flush_hub_wq+0x18/0x20 [ 224.082416] usb_remove_hcd+0xc4/0x240 [ 224.086288] xhci_plat_remove+0x68/0xe8 [ 224.090244] platform_drv_remove+0x28/0x50 [ 224.094463] device_release_driver_internal+0x1ac/0x260 [ 224.099839] device_release_driver+0x24/0x30 [ 224.104244] bus_remove_device+0xf0/0x140 [ 224.108379] device_del+0x294/0x4a0 [ 224.111974] platform_device_unregister+0x30/0xa0 [ 224.116817] dwc3_host_exit+0x5c/0x68 [ 224.120589] dwc3_otg_start_host+0x37c/0x760 [ 224.124983] dwc3_otg_sm_work+0x2d4/0x718 [ 224.129112] process_one_work+0x328/0x6b0 [ 224.133247] worker_thread+0x330/0x4d0 [ 224.137108] kthread+0x128/0x138 [ 224.140437] ret_from_fork+0x10/0x1c [ 224.144116] irq event stamp: 0. Change-Id: Ida3f8c56406756b09cfb81f816e8ea76e21f8caa Signed-off-by: Pratham Pratap --- drivers/usb/dwc3/dwc3-msm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c index 1176191f17b6..857d730166a6 100644 --- a/drivers/usb/dwc3/dwc3-msm.c +++ b/drivers/usb/dwc3/dwc3-msm.c @@ -4126,8 +4126,7 @@ static int dwc3_msm_probe(struct platform_device *pdev) * in avoiding race conditions between xhci_plat_resume and * xhci_runtime_resume and also between hcd disconnect and xhci_resume. */ - mdwc->sm_usb_wq = alloc_ordered_workqueue("k_sm_usb", - WQ_FREEZABLE | WQ_MEM_RECLAIM); + mdwc->sm_usb_wq = alloc_ordered_workqueue("k_sm_usb", WQ_FREEZABLE); if (!mdwc->sm_usb_wq) { destroy_workqueue(mdwc->dwc3_wq); return -ENOMEM;