Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3699350imm; Wed, 5 Sep 2018 04:42:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYRbbl3y9XMyC1TiD11wPDxnaGS1y3pi/w/wfBZfrnfayoGEQi8a3iNfZlJdKRroHpKdHEX X-Received: by 2002:a17:902:ba83:: with SMTP id k3-v6mr37317419pls.251.1536147720497; Wed, 05 Sep 2018 04:42:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536147720; cv=none; d=google.com; s=arc-20160816; b=HgOJcpCrtQ/ZwctlhS5aiYZkVxQrVHB7jAENlFg5L+2LJfIPWElm0+8y3OrO7LAn37 QxUKHuIH5ueUxwh23vuRM74OXSiCCeufjYesDXXXNQs4Yix5XmWcVDB+6egBVo4IaiVA Kj11oBgwTTJ4F70xpd79gon2W12H+DWY/IUk9hoM0BhZOTQcut4QyjBhk9P8wZnvG8pJ Xnb88xWEAcGvytTp1UD2QCSvgUZXevhIEfOzI7hpgKbNvsRv0NndYZBJgMuZlbXiUgFI oaFLmXXaJ1Wwvz2TvewRHWFJ13Bs3wz2AyuUm6ktx9h74ryEJHJijuRsALNTupwvdpGy cAhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=dKg+K5dirLxyOfBAEbf1rWxD8j4Fat6zO47p4nJWdCM=; b=F0WnVrpJyn2LE1aSOTpw5TV/aobciGr04WcrcbRsWYrkSr861pupnZbKtG0qVaRi6Y lZ7VgNy98+HLpDlabkRYyqxNtGFexBeaEZpRpnOTL3mJOVPSi0zF5E98nlCM4KuwrtZf Y3CgI+mDBvguuNHDLzLf8AeJMnDJwUd6GqRmdWWHRGr+Qf+jTHD+m3vVsjqBDrAXo/J6 z4mrGCHJqVQMTh0hnLZ+4Hksu2UjOnJPYOB8AykMji5IHbQyKg8KyLGRqNJ5zlQ/DBGW pFSyaBJOq9G1JEsKMqnYUUKkYQoEEs8pKUGuMrRywscsHIUrdbGImHdi9W0a8d1/9kTD /DBQ== 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 o6-v6si1753935plh.226.2018.09.05.04.41.45; Wed, 05 Sep 2018 04:42:00 -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 S1727608AbeIEQK0 (ORCPT + 99 others); Wed, 5 Sep 2018 12:10:26 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:21453 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725868AbeIEQKX (ORCPT ); Wed, 5 Sep 2018 12:10:23 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w85BYk7u013470; Wed, 5 Sep 2018 13:40:26 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2m7fw6xycd-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 05 Sep 2018 13:40:26 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9E34834; Wed, 5 Sep 2018 11:40:25 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7D3582B82; Wed, 5 Sep 2018 11:40:25 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 5 Sep 2018 13:40:25 +0200 Received: from localhost (10.201.20.5) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 5 Sep 2018 13:40:25 +0200 From: Amelie Delaunay To: Minas Harutyunyan , Felipe Balbi , Greg Kroah-Hartman CC: , , , Fabrice Gasnier , Amelie Delaunay Subject: [PATCH 3/4] usb: dwc2: fix call to vbus supply exit routine, call it unlocked Date: Wed, 5 Sep 2018 13:40:04 +0200 Message-ID: <1536147605-26279-4-git-send-email-amelie.delaunay@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536147605-26279-1-git-send-email-amelie.delaunay@st.com> References: <1536147605-26279-1-git-send-email-amelie.delaunay@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.20.5] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-05_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fabrice Gasnier dwc2_vbus_supply_exit() may call regulator_disable(). It shouldn't be called with interrupts disabled as it might sleep. This is seen with DEBUG_ATOMIC_SLEEP=y. Fixes: 531ef5ebea96 ("usb: dwc2: add support for host mode external vbus supply") Signed-off-by: Fabrice Gasnier Signed-off-by: Amelie Delaunay --- drivers/usb/dwc2/hcd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index bb72517..e8a480e 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -4484,7 +4484,9 @@ static int _dwc2_hcd_suspend(struct usb_hcd *hcd) hprt0 |= HPRT0_SUSP; hprt0 &= ~HPRT0_PWR; dwc2_writel(hsotg, hprt0, HPRT0); + spin_unlock_irqrestore(&hsotg->lock, flags); dwc2_vbus_supply_exit(hsotg); + spin_lock_irqsave(&hsotg->lock, flags); } /* Enter partial_power_down */ -- 2.7.4