From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00DC6C388F9 for ; Tue, 3 Nov 2020 21:11:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B29F422226 for ; Tue, 3 Nov 2020 21:11:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437898; bh=Rh7h61UGjFBXQiUz0pwsLj2ueoke3f65bJZDC+7a+8E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=t0cWXxtGGO1vUexYE028xZ52LH0UzOkJEpMvwC/FxuAnr8dM6j0pT8m9gYBiTTMz9 rM4bybVYYD8nSdQa+HHvD/Tee9WP6uK7dsLKTyZRaEJRlKPgok8mNfihNV2nZ0dJs9 54SuSfckCWHHXFp2oRgNTjIgiDL18d68HHrQ1EIE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388896AbgKCVLh (ORCPT ); Tue, 3 Nov 2020 16:11:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:53404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388894AbgKCVLg (ORCPT ); Tue, 3 Nov 2020 16:11:36 -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 931A4205ED; Tue, 3 Nov 2020 21:11:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437896; bh=Rh7h61UGjFBXQiUz0pwsLj2ueoke3f65bJZDC+7a+8E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gWw5kLnb1yKAMNXHukCVB1/rBYeTaeIMe+XYUenD1ZiSoaX+r61AMgufMlyP9eqa3 y75+rtsxptwHT/2tkw40Bxfx00AOV5Y1x4GF34cnneKZzrSdOdXk9ogRlsvXSKermY UGODpAwKjaQ6xfVFSuYaiLy0mqgvMQY2YTdJrkVM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Li Jun , Felipe Balbi Subject: [PATCH 4.14 079/125] usb: dwc3: core: add phy cleanup for probe error handling Date: Tue, 3 Nov 2020 21:37:36 +0100 Message-Id: <20201103203208.366077286@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203156.372184213@linuxfoundation.org> References: <20201103203156.372184213@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: stable@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 @@ -1287,6 +1287,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: