Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1297943rbb; Mon, 26 Feb 2024 05:19:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXPxMv12VOZ+QKx7LI7sEYa1ipfgfI+nmv8/G55Jn6A1GOuI4bZ1mQEjpNpMjxgMqlpTOo3KJpdaJuHDWX0vDM9D1qwr+jPXSu7rLwQDw== X-Google-Smtp-Source: AGHT+IG32CpK0dsaz+AtmhT9tW3KWSh0H9m7mEiziurjI98vwtsHe9aSuDaxPs65bO15ks48cGJU X-Received: by 2002:a05:6808:1183:b0:3bf:f1da:633 with SMTP id j3-20020a056808118300b003bff1da0633mr8334091oil.54.1708953561178; Mon, 26 Feb 2024 05:19:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708953561; cv=pass; d=google.com; s=arc-20160816; b=Q7dnGYNLexncjdyqEW4O0DILltir46nICnx3aDNJZQRxegUoAzaAnrMWF23iTZuFHl cfBUKFzHUdNkgMvUqO8BGGJVTiH+K7w7W+To8StYor6LzJ7/HSyPrjMZfN36qEZd9sA3 H1QMieI/0ZjhF4ostsu+WfSdNkhE2U4DAZ1nuk8/4D//yeyywXtEOG3gzvuAen/67Eg4 wyGENj5rFhh3kwYmUW+mt9Tkf6SrxpIhIbIX2rMfeqytDbhN0JfzqZEKl0KXK4jTqJgH 0kMdDsWrAJY7QEjhjrS/VbR1OxONZdTCHagBe2VDTFpLvXuzwMkMqjLcixXGi1j8fjM1 RLSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=fMHisU8vdhuPfqFaxJ31TX+guMcuoW9NpR2MgA6CzMA=; fh=mEdmZijQoKlc15f4CdAH32/BrR02UiG5Q9VBNF1MjjA=; b=A4a0/SVDZrlwThX0OhgvT+U5Jjv2W0y7weAjOBHNRGQ7+1jQ5xbUO8hiYpghmOvFNW f5COpOmUpuLslZ3Cj9x7bfXShCU5Ug6a3UB4//Nxsc5YCmzLV331LvwzCSiV7wSA9R1O JQl4bSqLReKAfv7jSdNv5dfRvUG8gEKyCfiRlypGBkQXZLQ4NPixCCutQX3rK0tSBREV B9WQN62WFLEEmksz9V8oBqlnIv3BsCeDannbAQuiEI9zr2gitclM2RHflgf7My0YZAKm buMo1qcFLUL6nT0+n4TZNzjt7FYFNQTP2G+LmZqf/0KgKJuap+hmxVpUgGYzK6zMIQ+E TkLA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hLb5ucUB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81465-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81465-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id x24-20020ac87318000000b0042dd5264d2bsi5022578qto.139.2024.02.26.05.19.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 05:19:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81465-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hLb5ucUB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81465-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81465-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E731A1C2440B for ; Mon, 26 Feb 2024 13:19:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44973128363; Mon, 26 Feb 2024 13:19:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hLb5ucUB" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F1731C6B0; Mon, 26 Feb 2024 13:19:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708953551; cv=none; b=bhjn9O9RmW/qhmfaGnycLsRZdrcnBrYCE7TTy8tKXhwels8t4hLp9Cv8x5fkG3yWzuq7RBE7ZZklJnRWMI4vI8YyHBEct3DJAwPg5+/l1U5JFpWgp0CCg9NxDAenNpJoeAJn098i1FW/b0UKZxBniHrj8nOEoky7ZEtKZEm4sWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708953551; c=relaxed/simple; bh=HBsVccxSNxv26lBX/VuGdylXD0W8SDHVP7TBViLLh1U=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VV0yBcZlxBj9HO6bIX0k4jSUnxBsLLMyuI91HuAWHtnAfLIOw83o4UJFcs+C7BTdipjaTV1eG6iY8A4EKd025+ID/yA2XV30MvPenWd81Lo7BLoDmINFodCD1hfA9yPJn7mNraFpi7ZVhA8K6y4oCayfXhHCS0L5aQEQxcHEdfE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hLb5ucUB; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAFA3C433C7; Mon, 26 Feb 2024 13:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708953550; bh=HBsVccxSNxv26lBX/VuGdylXD0W8SDHVP7TBViLLh1U=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=hLb5ucUBiTfbxjjr2QmBkznJfek11WH5eQYPxJpMIcxvOvaBwZTV3vpqnMVUMYcR3 yozacW65Mb9/3Gt0CJnieXcJTAk8088rHIS8r/UUBgilgciaT2dgFYnU5SnpgrV9Aw VluPV/mH2bn5nlRF5phXoIQeBlLrnHOFpL+VKvpzQk6GCrs4lvCKP6JyciMPCRk+2U NGQ/AYJ1Bt9vcn4glsQOHyP9Br28iRb60S+kwPtSWCHqdKfSHIbP9jXsskfA/R7pXU xlJkdZOyVAjH56bBA2GBFhAplOvAuvdpSDAMy8iEOzNRPsRBge4UeywevtAW9Ailj7 DrDdPzGND2sZA== Message-ID: <9554348e-2269-4f7d-a06a-9dcaac7b4301@kernel.org> Date: Mon, 26 Feb 2024 15:19:05 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/5] usb: dwc3-am62: fix error on module removal Content-Language: en-US To: Thinh Nguyen Cc: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "nm@ti.com" , "r-gunasekaran@ti.com" , "afd@ti.com" , "b-liu@ti.com" , "srk@ti.com" , "francesco@dolcini.it" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" References: <20240214-for-v6-9-am62-usb-errata-3-0-v3-0-147ec5eae18c@kernel.org> <20240214-for-v6-9-am62-usb-errata-3-0-v3-2-147ec5eae18c@kernel.org> <20240223223118.3awhuee5kgoebngy@synopsys.com> From: Roger Quadros In-Reply-To: <20240223223118.3awhuee5kgoebngy@synopsys.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 24/02/2024 00:31, Thinh Nguyen wrote: > On Wed, Feb 14, 2024, Roger Quadros wrote: >> As runtime PM is enabled, the module can be runtime >> suspended when .remove() is called. >> >> Do a pm_runtime_get_sync() to make sure module is active >> before doing any register operations. >> >> Doing a pm_runtime_put_sync() should disable the refclk >> so no need to disable it again. >> >> Fixes the below warning at module removel. >> >> [ 39.705310] ------------[ cut here ]------------ >> [ 39.710004] clk:162:3 already disabled >> [ 39.713941] WARNING: CPU: 0 PID: 921 at drivers/clk/clk.c:1090 clk_core_disable+0xb0/0xb8 >> > > Actually, it will be better to have a fixes tag and separate this from > this series series. You can retain my Acked-by if you resend it with the > Fixes tag and Cc stable. OK I will resend. please see below. > > BR, > Thinh > >> Signed-off-by: Roger Quadros >> --- >> Changelog: >> >> v3: no change >> >> v2: no change >> https://urldefense.com/v3/__https://lore.kernel.org/all/20240205141221.56076-3-rogerq@kernel.org/__;!!A4F2R9G_pg!b7_3vmJpNLOFy3g_wExMQSAzi949O4PoID3e4rNEvAsbgCvxxkj0DiSDFJxF7857DZM7qy9DMkH6Q5BPD-jX$ >> >> v1: https://urldefense.com/v3/__https://lore.kernel.org/all/20240201121220.5523-3-rogerq@kernel.org/__;!!A4F2R9G_pg!b7_3vmJpNLOFy3g_wExMQSAzi949O4PoID3e4rNEvAsbgCvxxkj0DiSDFJxF7857DZM7qy9DMkH6Q1CciylE$ >> --- >> drivers/usb/dwc3/dwc3-am62.c | 6 +++++- >> 1 file changed, 5 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c >> index 1bfc9e67614f..600ba9cfefea 100644 >> --- a/drivers/usb/dwc3/dwc3-am62.c >> +++ b/drivers/usb/dwc3/dwc3-am62.c >> @@ -273,6 +273,11 @@ static void dwc3_ti_remove(struct platform_device *pdev) >> struct dwc3_am62 *am62 = platform_get_drvdata(pdev); >> u32 reg; >> >> + pm_runtime_get_sync(dev); >> + >> + device_wakeup_disable(dev); >> + device_set_wakeup_capable(dev, false); >> + I'll split the wakeup disable changes to a separate patch, so there are less dependencies. >> of_platform_depopulate(dev); >> >> /* Clear mode valid bit */ >> @@ -281,7 +286,6 @@ static void dwc3_ti_remove(struct platform_device *pdev) >> dwc3_ti_writel(am62, USBSS_MODE_CONTROL, reg); >> >> pm_runtime_put_sync(dev); >> - clk_disable_unprepare(am62->usb2_refclk); >> pm_runtime_disable(dev); >> pm_runtime_set_suspended(dev); >> } >> >> -- >> 2.34.1 >> -- cheers, -roger