Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3210771pxb; Mon, 9 Nov 2020 05:41:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzi17lfwCIOZwSIeqk6PQuWmJWcsGVYQNKBfowyAedxjzucBZWmtWzb/CZtRISbm1lhNgnr X-Received: by 2002:a17:906:3e8f:: with SMTP id a15mr6890700ejj.57.1604929293967; Mon, 09 Nov 2020 05:41:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604929293; cv=none; d=google.com; s=arc-20160816; b=RlWoXIO4fxVwVPewljlQVWmHWxoRcP92zDzn80/NGZp4eeWetjyehzKfXyeT4YZCqo r0Up7z6BQSvxU6HLDWoVNu8CnuATA7Y01/dI78/ZQzTgrfUvNgJZU1vFi10qOQuhBQAh XJmNWkaS+mx8bYuBKsYGnt/q6z9PZYHJPjx+EfCBa8Ut2eBnXlKLTbOFJbT/IZZE9o6l xU6Uy9tOrSLxHKbXHfL/eqYG2goGB4X8+fiATpZo4ZhJ0Zk1OyAQ7I4hNIO1GyI/yjuo zepwpxF4gCto/NfNnigjhnMjEkX+9icZzIkB57dU5wRNEtoSBS3xym/qdAKBk+Y+HO69 pYig== 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=/jatIcVmJhZks626ELU7qVBvpVwm+09QLUDjSd/uDJQ=; b=dIt0CcOjBYqinBv7dIuHQPbg5pB1pg7BdwdQ9UJlpMGg9Z6NBJfmc6vzXzjF3QcJwE R1N5EXJFFYxKMzgtK+YkOrEJDkxfEXE2vjQlE6WI5GZpoKtRIHelkG9N5KXQ5Qld7l9Q dqaxos5iM5pQw0unzmVz3YAZYmFzJSR287k6wRHrxYWETv0NS5KOQgtF/4wWP1G0omes Xwott7vlvTLLdykci/YFauNL/9cWgWiTYZehuKvMI40XvST4SHxQXR6fmPCtnZmbpS6o CBxxYN+hEEEd1HPSdo4k5wr1cjX6BI9CF6RErxikkDg2hvRDTo/iaF08jntrRLNLp0Qo WGPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=F6D5osRF; 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 a21si6590172ejd.414.2020.11.09.05.41.10; Mon, 09 Nov 2020 05:41:33 -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=F6D5osRF; 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 S2387928AbgKINjy (ORCPT + 99 others); Mon, 9 Nov 2020 08:39:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:56244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730642AbgKINCk (ORCPT ); Mon, 9 Nov 2020 08:02:40 -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 E795421D46; Mon, 9 Nov 2020 13:02:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604926950; bh=miv/onbwCQT97ox3By4hcR1GQCILCs7hylsnxiBa+hs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F6D5osRFb8UrvWb4SbM2Wsz6Fuj3wcZ/MyQFbOGrAyvjG5Vrl0L+8S1+Ij6EBVc9Q AAevm1LSVCiYcapuOR870N0IUiu8DhERQHLRLg2r6wvtTdpPccj/J7J4GPWOFE+8r1 UA5gpI9Cir6e802Q0x6Si3G6+zv1dFYhHTawJ+TA= 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.9 060/117] usb: dwc3: core: add phy cleanup for probe error handling Date: Mon, 9 Nov 2020 13:54:46 +0100 Message-Id: <20201109125028.517713194@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125025.630721781@linuxfoundation.org> References: <20201109125025.630721781@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 @@ -1148,6 +1148,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: