Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2662430pxa; Mon, 17 Aug 2020 15:53:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzB9VLNlHrusPbuzprrkI/7vB0d334f3z/ops0PJWY9LNPXdcJudr9CJyVFnujO4Paycgyg X-Received: by 2002:aa7:c74f:: with SMTP id c15mr17348996eds.331.1597704808168; Mon, 17 Aug 2020 15:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704808; cv=none; d=google.com; s=arc-20160816; b=U6hpyarqZJAINwZzzjWSRpWKxqWzUdiar0O/aml7JGBRYhkmDvXEbKfNgzFKFSvOih 2uUJp6aDruuMaI6pZ1NUiDvrk/paZ8yQuKTK4tUd/01F5VA6Qyi3meI1yCLVsYg8iRTS pWC0bMb0WmF3/AZDK8oMD+r7k6Nse1JLDJlTQ+dEFywrK0GdUdsQlRZCZiTcOoO+BtJw RkYNVZegR643Xh911AzINNiND21ga7hTkkgWWXKrXEc4BV69mHzOcevkm9q1C1LYnSeV ttW2RJLIXm0B/aXnriOAvAbIViJNU56umjboDt/ehzTeuaamyNcgOeeu62JgAAczmn2x u/SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tB5gm0PUyw3UITf/tPMhQDE39vvlOeP4iJxt9UZ8pbs=; b=h+9N1cFyoH3Kt+Z9ET3lLQVXle12vp8UC084BeRrSeOWhdWZ11j7emYanCkGFNeER2 rzJ+vTAQvrowKp1ja6/KOpXJDuahegSf/9KIdLd1RPyjb0jNEr0mQOEpxa5SAt3+/Xrf 4FVb2lybhTCz4yIGo0XTzYv+awU7LklxiZIExN1PZJ4lC+Swop4MEh3OxCElSro5jDfB nEMFppx/0N9GjdWB+6BYqwN2zlbm8oAhaQ7ulkLOskKPhkV1IVA9gkk1PW0tHCdXcDeS eabJPP+mG0clYw0WWn6YZdZjxaAdvzbFJuVidbop1tC4CQjrW4lD0LQawamtFF7T64AS LlpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oqrmX5DT; 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 yk11si12026870ejb.113.2020.08.17.15.53.05; Mon, 17 Aug 2020 15:53:28 -0700 (PDT) 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=oqrmX5DT; 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 S1731983AbgHQT3N (ORCPT + 99 others); Mon, 17 Aug 2020 15:29:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:60118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730305AbgHQPcb (ORCPT ); Mon, 17 Aug 2020 11:32:31 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 145AA2389A; Mon, 17 Aug 2020 15:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678347; bh=OjKwuGq6o48gdmVKs5O1o02EftD/J2g4ZV6Yxn+WrJs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oqrmX5DT27em/lxInYQ8jWIpeLULzOEig82UgXc7Wy+Qo2cifnGIFaSmUavKzrPlk pDHXQkQSNdZGQesvIfQOkswdn1PDcqpTNBaIThWJHpsTsqHOkiND0KNOSyP4DnwjBJ axIE8LB997So7ziSerBPcvfnAIZ21Wl7TLWzWlYA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Robertson , Felipe Balbi , Sasha Levin Subject: [PATCH 5.8 285/464] usb: dwc3: meson-g12a: fix shared reset control use Date: Mon, 17 Aug 2020 17:13:58 +0200 Message-Id: <20200817143847.406488369@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Robertson [ Upstream commit 7a410953d1fb4dbe91ffcfdee9cbbf889d19b0d7 ] The reset is a shared reset line, but reset_control_reset is still used and reset_control_deassert is not guaranteed to have been called before the first reset_control_assert call. When suspending the following warning may be seen: WARNING: CPU: 1 PID: 5530 at drivers/reset/core.c:355 reset_control_assert+0x184/0x19c Hardware name: Hardkernel ODROID-N2 (DT) [..] pc : reset_control_assert+0x184/0x19c lr : dwc3_meson_g12a_suspend+0x68/0x7c [..] Call trace: reset_control_assert+0x184/0x19c dwc3_meson_g12a_suspend+0x68/0x7c platform_pm_suspend+0x28/0x54 __device_suspend+0x590/0xabc dpm_suspend+0x104/0x404 dpm_suspend_start+0x84/0x1bc suspend_devices_and_enter+0xc4/0x4fc pm_suspend+0x198/0x2d4 Fixes: 6d9fa35a347a87 ("usb: dwc3: meson-g12a: get the reset as shared") Signed-off-by: Dan Robertson Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin --- drivers/usb/dwc3/dwc3-meson-g12a.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c index 1f7f4d88ed9d8..88b75b5a039c9 100644 --- a/drivers/usb/dwc3/dwc3-meson-g12a.c +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c @@ -737,13 +737,13 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) goto err_disable_clks; } - ret = reset_control_reset(priv->reset); + ret = reset_control_deassert(priv->reset); if (ret) - goto err_disable_clks; + goto err_assert_reset; ret = dwc3_meson_g12a_get_phys(priv); if (ret) - goto err_disable_clks; + goto err_assert_reset; ret = priv->drvdata->setup_regmaps(priv, base); if (ret) @@ -752,7 +752,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) if (priv->vbus) { ret = regulator_enable(priv->vbus); if (ret) - goto err_disable_clks; + goto err_assert_reset; } /* Get dr_mode */ @@ -765,13 +765,13 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) ret = priv->drvdata->usb_init(priv); if (ret) - goto err_disable_clks; + goto err_assert_reset; /* Init PHYs */ for (i = 0 ; i < PHY_COUNT ; ++i) { ret = phy_init(priv->phys[i]); if (ret) - goto err_disable_clks; + goto err_assert_reset; } /* Set PHY Power */ @@ -809,6 +809,9 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) for (i = 0 ; i < PHY_COUNT ; ++i) phy_exit(priv->phys[i]); +err_assert_reset: + reset_control_assert(priv->reset); + err_disable_clks: clk_bulk_disable_unprepare(priv->drvdata->num_clks, priv->drvdata->clks); -- 2.25.1