Received: by 10.213.65.68 with SMTP id h4csp466446imn; Fri, 16 Mar 2018 08:36:22 -0700 (PDT) X-Google-Smtp-Source: AG47ELvmxDkr6VQC8/OeKDB/vSxQFzQSGdns+EAJyDWGWSTzALvLkk44Lxy4V1a3bh5QkhFbW/yl X-Received: by 10.98.111.65 with SMTP id k62mr645753pfc.184.1521214582208; Fri, 16 Mar 2018 08:36:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521214582; cv=none; d=google.com; s=arc-20160816; b=PsUNx9ghhxq6j4YRhxPR1cGHGOJGiIlzWY4ziaWCk2Q4JKZ4dAmjaPiFeQahkGJNEK U8qGkYlItcwSeYJyLrA2EA5GQ4iktP3FqHgMBlDRZfRPBG3zBCzJW1wibTPugIPaK1c/ awyaDGI/53TSVgj1/CsJjjsxRLcS5IJzim9efm2bNj8nS26Nf3/5iUBdZVjM1OmimzOl IV19kHDYTPtZw5IzbzYYOo0OXVO8VW2smOdP5F7631f47e8Y+8jEFonLyQrNa09eY0DD Cz18E6eMW0KKZtKJ95msDd3W4MQ/Bqm14Kd2i/XRN23K/7pHQLLHtsmZZY2tcMnhoAb6 Z6hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=WCEZhiJBO2yvnItHL6z4P4Pogis7m/ZjP4vhb9cve40=; b=q0aZ/zeiw4e/UHXq4q+skNHrrxZES80/VvO+/DZ6z0pMxcV7r5sYLaMD/u4SPOp6mw QDEGLIXemKfVVhE/9U/bE1M9+vxZ+RCn0zWdo4i4G5kgJ8p+RlHzH7UIzcOjZyK5MsjH EwDHf8vYL6ErAwxzwXcu0nb8yCEgrb9I+1LHrUQy454ldzH8ErPlp+OERBEoo/0iuOVs SGF+sbcw24lLeMrZ3EYf0S6u9aavcrQHVUPquaA7Vfdq6fTvf4PJjJHq5somGJvyyQAl zs2hDix83RMe6HFkOJFyI9UWTn+5f7zrc2C1btnBW2cYljWOLXMn0jsQy47fxPGovCyB QVPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x75si5702594pff.339.2018.03.16.08.36.07; Fri, 16 Mar 2018 08:36:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934013AbeCPPen (ORCPT + 99 others); Fri, 16 Mar 2018 11:34:43 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39528 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933999AbeCPPek (ORCPT ); Fri, 16 Mar 2018 11:34:40 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 77ABC1012; Fri, 16 Mar 2018 15:34:39 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manu Gautam , Roger Quadros , Felipe Balbi Subject: [PATCH 4.14 021/109] usb: dwc3: Fix lock-up on ID change during system suspend/resume Date: Fri, 16 Mar 2018 16:22:50 +0100 Message-Id: <20180316152331.103409541@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152329.844663293@linuxfoundation.org> References: <20180316152329.844663293@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Roger Quadros commit 084a804e01205bcd74cd0849bc72cb5c88f8e648 upstream. To reproduce the lock up do the following - connect otg host adapter and a USB device to the dual-role port so that it is in host mode. - suspend to mem. - disconnect otg adapter. - resume the system. If we call dwc3_host_exit() before tasks are thawed xhci_plat_remove() seems to lock up at the second usb_remove_hcd() call. To work around this we queue the _dwc3_set_mode() work on the system_freezable_wq. Fixes: 41ce1456e1db ("usb: dwc3: core: make dwc3_set_mode() work properly") Cc: # v4.12+ Suggested-by: Manu Gautam Signed-off-by: Roger Quadros Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -186,7 +186,7 @@ void dwc3_set_mode(struct dwc3 *dwc, u32 dwc->desired_dr_role = mode; spin_unlock_irqrestore(&dwc->lock, flags); - queue_work(system_power_efficient_wq, &dwc->drd_work); + queue_work(system_freezable_wq, &dwc->drd_work); } u32 dwc3_core_fifo_space(struct dwc3_ep *dep, u8 type)