Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp865327pxb; Fri, 22 Apr 2022 12:59:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMGs2ayWYg2Edo1A7ujyJGS9sq9wIHyVhIMhIRyK6m8TbqFpQkQSKOW/B+k7d+tG3SNvTo X-Received: by 2002:a17:902:e84a:b0:15c:e28c:5f7c with SMTP id t10-20020a170902e84a00b0015ce28c5f7cmr565345plg.94.1650657563072; Fri, 22 Apr 2022 12:59:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650657563; cv=none; d=google.com; s=arc-20160816; b=IuqgpNOqF974kBkm0TNI11cBpPb/WVDJ6wN5AQ0pQhd3YTr1XnjWuYD6IrL+fH22dw yOwLy1xhghqgAgW1200UzWEGHXOd+JSaTiLnvotOd4/63M3+6WreVoRVb9EK8jfVBiZB FtTh78EYeoTyXtKXeD1WIBme15UFJGATWJ9yOQ2/KzyC3BdqUVNV9sUEv2yqB/AYwe/g B6L3zog7RGfc3Dkrt/xHD3yIjUt3r2rDwsxBOUBFmaYSz1AE0UxzH7s2ae7QyLBfRyOj m+pWMD62mxUTsHxZVXUu57GCAAqKqumkF7VzVlv6k5wPipJQHOCRxA6NCHARCvWrk05I 3yTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=kqjSep9p2JAwLGIz8eoZDaLDUYRfX8TagCZqBa5jqMg=; b=jVJ4JJkRUbx4JMb3tt317Jen1RbmHbVrylBm57hbk9jYmP7R2eJR0pntyA8EKHN1no 5ZIABKxq/Rql9QwUFb88XhKsop3jgaqqaTY9cVD/R+gxz8suU2M0uIkjgHBhMHHPTcon tdLt1JcO7dljp6Q2VuA/4WggFPCYwnV5FQtyO7S7976FnV/Dd9L+H/e3or/qgQ2qF0qo b2EH3tJHm3ruSDJI9UDY+vaykMCN/e37l7PRvPrfk46ZGd99Ev/vYGKF2na3yJP0WVGY oXtd5LxjXVvTMBbIjaj7lcSeSMM27hakH5vJ+m4ZdOeUsCkUJ4zhpDujtwTm++A7eZTv lc/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="FImYl/5U"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g14-20020a17090a300e00b001d7d1e43224si3155972pjb.149.2022.04.22.12.59.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 12:59:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="FImYl/5U"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CDD7514B2FE; Fri, 22 Apr 2022 11:57:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443034AbiDVBXy (ORCPT + 99 others); Thu, 21 Apr 2022 21:23:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239067AbiDVBXx (ORCPT ); Thu, 21 Apr 2022 21:23:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB268403D9; Thu, 21 Apr 2022 18:21:01 -0700 (PDT) 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 9A77BB829EB; Fri, 22 Apr 2022 01:21:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52267C385A5; Fri, 22 Apr 2022 01:20:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650590459; bh=ZGP6Dc5HcbyYx3f99nyxqazx+rsBw8MPomaGNK5aG6g=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=FImYl/5UrR4i0m6nCKBrz+z1VN3Zg730BK0ue7KWi4bLydZ/F70wJMb9JLwLTZL8n f1sahHwn759HtZb2fXH9ZQ4ltig1/8Xa6pZsuoGpbaofsbFNgyCtRCcIt199ELfRhk pLBm88zhb+xq12fw1k9DoavfM2G09U9+nuC+g/UB2vS+KqURyHuBryqI4kfX8CkDlq OhUkt6E8cAPFdg7t7Prdl7NVsUupxvDpDlMatUTbaQnXni8fgY+6ORw8m8BjQB3hDx VDkXpQqAQ/Fwq/9blwMnrpVlI/5Ev/GNZ7XPHdWFconE4rTxwSWdKIPmA4qiqYi9xb 5GCb3j8kdj1Nw== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20220412065719.17735-1-linmq006@gmail.com> References: <20220412065719.17735-1-linmq006@gmail.com> Subject: Re: [PATCH] clk: imx: scu: Fix pm_runtime_get_sync() error checking 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:20:57 -0700 User-Agent: alot/0.10 Message-Id: <20220422012059.52267C385A5@smtp.kernel.org> X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Miaoqian Lin (2022-04-11 23:57:18) > If the device is already in a runtime PM enabled state > pm_runtime_get_sync() will return 1, so a test for negative > value should be used to check for errors. Maybe it should use pm_runtime_resume_and_get() instead? >=20 > Fixes: 78edeb080330 ("clk: imx: scu: add runtime pm support") > Signed-off-by: Miaoqian Lin > --- > drivers/clk/imx/clk-scu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c > index 083da31dc3ea..18c6190eeffd 100644 > --- a/drivers/clk/imx/clk-scu.c > +++ b/drivers/clk/imx/clk-scu.c > @@ -529,7 +529,7 @@ static int imx_clk_scu_probe(struct platform_device *= pdev) > pm_runtime_enable(dev); > =20 > ret =3D pm_runtime_get_sync(dev); > - if (ret) { > + if (ret < 0) { > pm_genpd_remove_device(dev); > pm_runtime_disable(dev); > return ret; > --=20 > 2.17.1 >