Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp824145pxb; Tue, 3 Nov 2020 13:35:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0+IiV42Ba1au8HyjKRoQneHn3NtMAJp0lh70/V9aledHtDoKFSxvEJ+QA4SbFaIQDlris X-Received: by 2002:a17:906:c357:: with SMTP id ci23mr3315254ejb.311.1604439305556; Tue, 03 Nov 2020 13:35:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604439305; cv=none; d=google.com; s=arc-20160816; b=SmKIDSd7NghFFEt01bS4H+NMLmcbXcNqHHQXgzweM7qopkFUE4h++gmftaJEFlS9jU jM/CTXEYS4OAWT5amdrRYijfJpDFCR8W0hoWLX8B767hx4LDXJUSb1BrboRzil78ZRQf tlkt91g7z49O/RX8SD87G93+eqf2btAJHWUr3/ImfSSacFVCsd5esWW9eydTBBx7fFQ2 O0QgIdkRLxMQT4hh8VtxAzQusdUf9YAYK0ooetRM/Y0RqTlqD8zmhxLVkSnCiFqhNfoF xQrK5d6QaSpeVqYlOQHPQDZAdfCLwjXGPpaNnKT5IBctUPaD7Xn1gmtdHwYpUuhtUvSp E9cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mCYLck6L3OJEpLz3V2cvrNROij3F4x1NkvMewh5VkIs=; b=UIk64lSCZFCyQN9mTI7OZfrU0Az8XqcL4Eo4UP+ysc3Q2HqPL9IsRkNPT4llytfjGw PwhDrMOBrtFUVFloJUNny259eU7j8jHGickdTZ9vI31aw+Yew4ZJAoGYftbb6q2CYpuT Fo2lyCwjhg4CZE9j2GzDGQt597BiCjqsw3qS2qPgxSUa7pEGKhe5tyu0YKqvzln7db9E BrjULUd9pRFz6U0UQbBlz8Kcz5TCz2ZsZE5LO99UXeGXUvVbH5Wg9PFe50WQY2k/Txjz 8Zc84yH7A4h+7iYPoDpPJM4LP5LeZMIfhcsRyt5WCUfEEAqvgmFre7pMQOlKAXp9tX0/ eaYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dsf6iDrm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k20si72665ejj.93.2020.11.03.13.34.42; Tue, 03 Nov 2020 13:35:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dsf6iDrm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732097AbgKCVao (ORCPT + 99 others); Tue, 3 Nov 2020 16:30:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:60552 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731943AbgKCU57 (ORCPT ); Tue, 3 Nov 2020 15:57:59 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 A17A92053B; Tue, 3 Nov 2020 20:57:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437079; bh=9QN+udJZnhGzgroHE4DOWTJeymjfgpRTOmxGr0XsLYI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dsf6iDrmvRl0wNPVSS6ixVl00cHbviaQJwNKS1ZKXrqadPPTsydxSzzzPVURGqs7B TGwpMg/ty4JsUm2bXjBUcv25Rbb/2xCrbKPbM7xd3EO8Ixxy0kNaHu/lKgtV2p8sCO VppnagfMyvz5PySz9qddxZlUccS4wpgmQtywOwXI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Li Jun , Felipe Balbi Subject: [PATCH 5.4 137/214] usb: dwc3: core: add phy cleanup for probe error handling Date: Tue, 3 Nov 2020 21:36:25 +0100 Message-Id: <20201103203303.682009582@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Li Jun commit 03c1fd622f72c7624c81b64fdba4a567ae5ee9cb upstream. Add the phy cleanup if dwc3 mode init fail, which is the missing part of de-init for dwc3 core init. Fixes: c499ff71ff2a ("usb: dwc3: core: re-factor init and exit paths") Cc: Signed-off-by: Li Jun Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/core.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1535,6 +1535,17 @@ static int dwc3_probe(struct platform_de err5: dwc3_event_buffers_cleanup(dwc); + + usb_phy_shutdown(dwc->usb2_phy); + usb_phy_shutdown(dwc->usb3_phy); + phy_exit(dwc->usb2_generic_phy); + phy_exit(dwc->usb3_generic_phy); + + usb_phy_set_suspend(dwc->usb2_phy, 1); + usb_phy_set_suspend(dwc->usb3_phy, 1); + phy_power_off(dwc->usb2_generic_phy); + phy_power_off(dwc->usb3_generic_phy); + dwc3_ulpi_exit(dwc); err4: