Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1999442imm; Thu, 24 May 2018 04:16:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrhfBBXth6vIEki3qhZcYgDws/J1EmyLWXlVs0++FKbiUeDxhvuZmWpPvHzxUzfjUGGOUZq X-Received: by 2002:a63:4143:: with SMTP id o64-v6mr5528961pga.280.1527160617574; Thu, 24 May 2018 04:16:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527160617; cv=none; d=google.com; s=arc-20160816; b=BYW1UFot7VBP36bC+4iIz6IzE9KrGkD4w42fWPetXOS8VHjaoR5Xeh992J1+UHyEJf LplPFFEgYqq8HJtUMvmAqVpoY2jjihQpdoeWaTRwREA1T82Ctg4gnuvUBJ9EkroQAdoe jsHy24vhzoKKyhwP1wUFC2Ugz9+P4Fo4DpuC+CxHCwbDiGToptfoao40eSpT8mfYJORU cQC56+jWOGYrJL3SnuralS5uWHs57ZwDd9k0EqV9P+CqhfSIUylH0TVRVGIlrMVCNCBL CeWzYx78/YrkL+cmi72tnA/HWRY+/w/JV8kFLZoeqI2RBubkCpngBSlazk7UoFaFvBMS uM5A== 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:dkim-signature :arc-authentication-results; bh=knoVHoiqeoVHjeNQIbA1nss11cmdtfwIaAfwjYIB/jI=; b=QYk4BTmbLXIbw9xWciqtoXA5xXqJIEIjY5JnY/LYyg72NYKKdrdoODR+tCZ5jEaM0Y +VyVTE6uAdaCuQvn5lqVdQMGy9Bs1F+8UBA2wtYWXj7/jhHHwqHIearNFyvN5pM3nb8t 2FJmoQH5884CvEf0pkpFtTk99dTGzTxMgDpjSOamfklKTp5OcwKedlPDLTwHQfox1mZw RrtqElh2sDWndQn5O39ggDmcwyQzDxCgKeJCXXmohRmPOFiLAnBVY96h/3lq/YrQO+N/ j1TrajKKgvKs8Q1dDaOBv0UzWYTp4r81GwnJrh7bcDgCGk1sigtq48V1ywWr/r5H0gXt HYPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DD33Vb9b; 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 d7-v6si14388914pgn.455.2018.05.24.04.16.42; Thu, 24 May 2018 04:16:57 -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; dkim=pass header.i=@kernel.org header.s=default header.b=DD33Vb9b; 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 S968669AbeEXLQN (ORCPT + 99 others); Thu, 24 May 2018 07:16:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:60260 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968037AbeEXJxh (ORCPT ); Thu, 24 May 2018 05:53:37 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A9080208A0; Thu, 24 May 2018 09:53:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155617; bh=bR9yrdW0BygnDOTtWX+i1xAXjbCo33E2UW3x8mrNNPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DD33Vb9b56vn2DefuT03ZhAbtPYtCjemFJS+jcSaQ5bbPPfUsGYjA7wK8efH1ICvw VaNVhvSjKVOQLFrsAyuaVJWQa0n2H45GLT6+Gq+I7/w8wDiPAIrU3ydUWRWkwLf8Gs Xfuq4jxjP+EJu6e0UKJMBoDYzDoMLv6VbFnOpqag= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian Norris , Felipe Balbi , Sasha Levin Subject: [PATCH 4.14 055/165] usb: dwc3: Undo PHY init if soft reset fails Date: Thu, 24 May 2018 11:37:41 +0200 Message-Id: <20180524093624.250695261@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@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: Brian Norris [ Upstream commit 00b42170c86f90ac9dea83a7dfcd3f0c38098fe2 ] In this function, we init the USB2 and USB3 PHYs, but if soft reset times out, we don't unwind this. Noticed by inspection. Signed-off-by: Brian Norris Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/core.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -248,6 +248,9 @@ static int dwc3_core_soft_reset(struct d udelay(1); } while (--retries); + phy_exit(dwc->usb3_generic_phy); + phy_exit(dwc->usb2_generic_phy); + return -ETIMEDOUT; }