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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 85758C433F5 for ; Fri, 22 Apr 2022 01:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:To:Cc:From:Subject: References:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XtFD9GF7Kf8KRxwmYSqfStUvwVapD7BtC/4pCCtPmVA=; b=QUtCfCanrjAJK2 GFeEjAr+M/vpMXQ+pXI8MsPqyJdY4CLM6DumDfeQx2MNsHUgIFaOvXaLa5JdzXnDZNDzn7O7KlMWw zh/FuJRhyPk+0ck8C3agyny48FyYacGftwipyYUE1dMv5MbWhzgXnAA9MUJtKT8XXqanQsMdPym5C G3JvtA5MIuT644rcfi48cQ+p9r7VxGeugj/R+JoKQl4SSuq3dym9V1FGYetED9dW+z7Buu39xqx9P J2HiQJhpQyrJIxl/b0iR8dXDwzaEYaKL6MUPIcSYUOavEErn74s1vlAdZgkKmPlWE/HlZhLC4mM6J wb6NhCsDr+NHx6EQk08Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhiLK-00Fbsl-0y; Fri, 22 Apr 2022 01:44:18 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhiLG-00Fbqu-24 for linux-arm-kernel@lists.infradead.org; Fri, 22 Apr 2022 01:44:15 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AC61FB829EB; Fri, 22 Apr 2022 01:44:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F96BC385A7; Fri, 22 Apr 2022 01:44:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650591851; bh=3dKzo/CNM7o0fMsSPqSjBhW3RlZrFwl/PpvNPNQgmg0=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=uF1TrlOKfD1+u/AzyPo4V5FvFcuIOBJAPq346IdP4HmyagaWLOZb83UW0ADV0fA2Y UXyESVCyLrYtTnM+gQ8Cr0SFThinGPF/g6wpagdwT3cxsmiGKWdXt8g+xdcHAHLOx5 QUg6K7soeNDKVKepsoUvQd6nYBUXTmhF1l+jRVXFnGfYyr/+vJGwfMbXQmgjQM46Li hwpdkI4f9QYMJdi96FDvs4bbGD9ml6YPmaz1bSnm7Ztjd+D50Ja3O8KeP3IJR+Uc+C GVL/jN4Uv2qWhArfnjaBzB8H9rHbrZ5wGbehrOfWhqyN1ZoMZBvRmnvZqCdv0dsMFD bxuGpLYtBx+/A== MIME-Version: 1.0 In-Reply-To: <20220422013317.30362-1-linmq006@gmail.com> References: <20220422012059.52267C385A5@smtp.kernel.org> <20220422013317.30362-1-linmq006@gmail.com> Subject: Re: [PATCH v2] clk: imx: scu: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage From: Stephen Boyd Cc: linmq006@gmail.com To: Abel Vesa , Dong Aisheng , Fabio Estevam , Miaoqian Lin , Michael Turquette , NXP Linux Team , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 21 Apr 2022 18:44:09 -0700 User-Agent: alot/0.10 Message-Id: <20220422014411.4F96BC385A7@smtp.kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220421_184414_281445_321D732E X-CRM114-Status: GOOD ( 17.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Quoting Miaoqian Lin (2022-04-21 18:33:16) > If the device is already in a runtime PM enabled state > pm_runtime_get_sync() will return 1. > > Also, we need to call pm_runtime_put_noidle() when pm_runtime_get_sync() > fails, so use pm_runtime_resume_and_get() instead. this function > will handle this. > > Fixes: 78edeb080330 ("clk: imx: scu: add runtime pm support") > Signed-off-by: Miaoqian Lin > --- Please don't send patches as replies to previous versions of the patch. > drivers/clk/imx/clk-scu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c > index 083da31dc3ea..2044e62980e3 100644 > --- a/drivers/clk/imx/clk-scu.c > +++ b/drivers/clk/imx/clk-scu.c > @@ -528,7 +528,7 @@ static int imx_clk_scu_probe(struct platform_device *pdev) > pm_runtime_use_autosuspend(&pdev->dev); > pm_runtime_enable(dev); > > - ret = pm_runtime_get_sync(dev); > + ret = pm_runtime_resume_and_get(dev); > if (ret) { > pm_genpd_remove_device(dev); > pm_runtime_disable(dev); > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel