From ebce97468b1801fece8a3ff77d2835315554ead0 Mon Sep 17 00:00:00 2001 From: Sriharsha Allenki Date: Thu, 26 Sep 2019 18:19:28 +0530 Subject: [PATCH] usb: dwc3: Use an ordered workqueue for sm_work The sm_work needs to be queued on an ordered workqueue. The create_freezable() does not ensure the ordered attribute needed. Hence, use the alloc_ordered_workqueue() instead of it with the flags WQ_FREEZABLE and WQ_MEM_RECLAIM. Change-Id: I535cb826f117b0162efb87639c85d7b1634a441a Signed-off-by: Sriharsha Allenki --- drivers/usb/dwc3/dwc3-msm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c index faea331af105..8fff934f5ffc 100644 --- a/drivers/usb/dwc3/dwc3-msm.c +++ b/drivers/usb/dwc3/dwc3-msm.c @@ -3990,12 +3990,13 @@ static int dwc3_msm_probe(struct platform_device *pdev) } /* - * Create freezable workqueue for sm_work so that it gets scheduled only - * after pm_resume has happened completely. This helps in avoiding race - * conditions between xhci_plat_resume and xhci_runtime_resume; and also - * between hcd disconnect and xhci_resume. + * Create an ordered freezable workqueue for sm_work so that it gets + * scheduled only after pm_resume has happened completely. This helps + * in avoiding race conditions between xhci_plat_resume and + * xhci_runtime_resume and also between hcd disconnect and xhci_resume. */ - mdwc->sm_usb_wq = create_freezable_workqueue("k_sm_usb"); + mdwc->sm_usb_wq = alloc_ordered_workqueue("k_sm_usb", + WQ_FREEZABLE | WQ_MEM_RECLAIM); if (!mdwc->sm_usb_wq) { destroy_workqueue(mdwc->dwc3_wq); return -ENOMEM;