Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3153617pxb; Mon, 18 Apr 2022 17:27:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwx6UyEIgTojbnvHARhnEhm9VlnzwHzR+hdSmpcanqPz5sriZo9Z7P01Hzb38dDScHcHInP X-Received: by 2002:a17:906:7943:b0:6df:e5b3:6553 with SMTP id l3-20020a170906794300b006dfe5b36553mr11141120ejo.398.1650328035561; Mon, 18 Apr 2022 17:27:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1650328035; cv=pass; d=google.com; s=arc-20160816; b=uC0X/A3oJ/kC6zYp6KUNoU72IdKJVZCr560g3uzLLLkK5QF232YTgYF+A+CuvTrRYU sJa4iAFQJ3OK/nQBtp/2DH1TpNQtpQSaI//U7hY8HdzC72wVfv3QgVSYyga5CQqjkfJn iOSpev1fxg97biNN0A/sQzIiGrmqwPKApiVQfcvctTGDFVc0AxeevOShbZGD5jp6d+Cb 4E05TFtF4bexcjOJ0Y5HxYezYREANX+E6s/8GcCRlNxESaAtoBwIMkZBiTqTP09d19hz UoaAZfy9rdB6kyQwj1+QxqF5nr2kmRumo8X/BfqRvJZgBoQUkRmUmBGU/R3EsVj1Fmt9 5H7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QaQ14GZone6JpFMyVvqJCb9nZcMp/GXcGnFd6Zda4hA=; b=l21hu3BCrU8lcMcPG27IT2nfyZfnxRuYtxw9adwe80ZZuKpyQvcEZ7LDhZ/s8sByYr zqUtnQFA7EF9LfZt00MIKMVVSRZOV4l0RhsA5eYuooVMxTFRLj/oEBPcUtE8G1T5m078 j4/ESX0FWhSB+Uz8jJ6NyzziMz4q+M1IfN1ncHruB0lWp8pvosuNVknbFNSLnb5Slo0I E21adyFOMewOcSEcuuRcnRSrqdFhKZYrbsHX3/x8rwjakW7zyQ9irlwy3UodIg/QQk93 I+JzXNEyuu7tDRPriY6f/oNjnFvNhJ3HklheBITvduanTYS/bjOyJuk6mZ+iLIJTpxXq aVoA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=BBWr4wxI; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rk9-20020a170907214900b006dfa07788cfsi7001122ejb.452.2022.04.18.17.26.51; Mon, 18 Apr 2022 17:27:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=BBWr4wxI; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237927AbiDRL5T (ORCPT + 99 others); Mon, 18 Apr 2022 07:57:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229823AbiDRL5S (ORCPT ); Mon, 18 Apr 2022 07:57:18 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70084.outbound.protection.outlook.com [40.107.7.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06F176301; Mon, 18 Apr 2022 04:54:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j9zmhEGTezNdhXPjYVwEhHZJ5cqflOF1WDOGGmArJT4rFJZctwwTKzd1II4BifM5hybpSa7oJ5SoBuX1VJOkgw2Op5wY8kA+kUFD+ovU4ndgCkI4bgOHdx6simPzTKE4Ps9+UgDd91c0gj9eLAyPMDSRAwdThEIpeCc1Knwz3B08f8yLS5kcPDPG9+PfX7Aomm7u6aY6yr3spX46hP198bIa1Ey6fvwTAGQ1/HsPjul2HIpJYkZ8AiuWf7tFFDR5ksI0QBHFrKBa2vtp0RWIGMJTcGeqw2Bzy8WE6R1mAwVWtu2JdtK2EXXiL6G3trAgy9tmOJmyJ+nrYJervxwP3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QaQ14GZone6JpFMyVvqJCb9nZcMp/GXcGnFd6Zda4hA=; b=mdj/2V3GX6sN8cC0FmPqwYjQW0s7Ydn5k8VSk9V6TsaN+88HTxJwRzQVy/I/uKBbEpTZiDgTIJJC/7bIEjAnzc/WZbsnvgVW7qru4zYC1kUPJQBry0oyv3Li2WFLQrDeJiM9PlJlJSLJ7dlDfC7CDgZ0oWTAGh6DaiWDjoBnltVNNT2z0DO/Ez5hSsqoeYp4cisA33oTnGwGSP5Erf8/jSETMv1VnrmoZThcf2wB543WBnZknO9YarDo6K5hbBwjGr8CIQmQ33hLQI3eMk2ATTJfa8Ky27QJWVXMWm2u2oqKYm/9BWJGRKzrqiSLmkTpaVLquKuxmzt/WbEBsYo8oQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QaQ14GZone6JpFMyVvqJCb9nZcMp/GXcGnFd6Zda4hA=; b=BBWr4wxIgJ1vuwjYKCXfCtkRqljxiYZ3jezBS1Bkw3CTvDQ8ogQR+pc/ISW0+a0crkr8bqMC4xZgxDBZ1fSgo988lIXmz+SRtB1dfH1/ec5IvCjeuJ+viu0dmG+7dmSHKej0XvA3YgA8Rzo3xCESwd56s8byQSCnbp7QfCjwVLk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:6a::30) by DU0PR04MB9273.eurprd04.prod.outlook.com (2603:10a6:10:354::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.25; Mon, 18 Apr 2022 11:54:36 +0000 Received: from VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::a9d1:199:574b:502f]) by VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::a9d1:199:574b:502f%6]) with mapi id 15.20.5164.025; Mon, 18 Apr 2022 11:54:36 +0000 Date: Mon, 18 Apr 2022 14:54:34 +0300 From: Abel Vesa To: Miaoqian Lin Cc: Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Dong Aisheng , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] clk: imx: scu: Fix pm_runtime_get_sync() error checking Message-ID: References: <20220412065719.17735-1-linmq006@gmail.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220412065719.17735-1-linmq006@gmail.com> X-ClientProxiedBy: VI1PR0202CA0034.eurprd02.prod.outlook.com (2603:10a6:803:14::47) To VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:6a::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ac1aa0aa-f560-40c9-76e0-08da2132360a X-MS-TrafficTypeDiagnostic: DU0PR04MB9273:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e/xCcXQNUC1cJo1y9CnfLOL3Z0lwG8p0EazTD63MkGw/pgLn8s3ihCCOqKPQYAEJPjJAzykvx8pR5pO78VGPzUxM8zdzo4DZDsp9FaURseWDMzanJ0ehDNNvMj+fSCeKcqK4Jr4hy6YRbwO8xkuhNAmN4zflenLDUAEextqgBCw3I45GemtiTrfTfWjwfJo3kMWE0ZSqWd9jrUFCxrXmYpEQcIb1SN2QrsUA1k4jWhS9x2gG8YNh2QGXgN0g5qgOpZ/A/8kwrVXIcJpeEwsvZULdgg7Xr9/sjWvZ9IZKynzDk2Cwobx7wH1YcT/+3RvDYlzOrIW2awQcu/OAXRsomQK2bmfo0IrLpUxVJE3girO1tf6eCtwdxFkKR5NqDqiip6TH6STC7Vkk8AqU9Hwviwcdstabym4Tcsj5jPIlq0Og7efwsz5yLBmjaQ/Rzx7eMMlj2TkYdP3xfncu3mnoMLEbOyWgcXifqu4szS45y9WTYu9o4PiD3k09zm3g1rGfk/9va/YLdcHpDZ6+F/d+V+Gfpz7ZDvwxxHYQLK3vEbd6h2rwHchL4FftEC27I61qut3VpirnBPJEDbLD2KvMcD/nYHesd/KRhFrpsovTnwIlrwPu/bQ512x8rkXuyurgXGqvKWrfiUqEhVFEm8BMfvtyfdOEdj/EWEPORW5ujIcdy2xafsLDNeR41d9uAp0wPPFcc1B51MnPReZqzGo6FA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB4688.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(7916004)(4636009)(366004)(52116002)(66946007)(66476007)(54906003)(66556008)(4326008)(8676002)(6916009)(6512007)(8936002)(4744005)(6506007)(9686003)(2906002)(33716001)(86362001)(53546011)(38350700002)(316002)(38100700002)(83380400001)(26005)(5660300002)(7416002)(508600001)(186003)(6486002)(44832011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?VX5H0kd9fLAti0HjGNwOr23JctCz/8/MUT1N0R0db6c7WT6jzOBCFL0Xfiqx?= =?us-ascii?Q?UHtz0tYWYIcAM1uBt8ZS3DKiADzt0mPbcJa4m4Iy2LeNFMCYxw3ncfAWfPX8?= =?us-ascii?Q?tKZCeNsWh6Rsu5a5qQ6QrXQibtB+Zy2YjmoKVHltcZNV5gxAqFFA/bYT1xfK?= =?us-ascii?Q?tnR/EtmKl16P4LxKDwC7oscaDmf+0QvyVkO3aqVbUsM0o8gM2Ri9boRREsEu?= =?us-ascii?Q?1A5sBGy7ndJQOUWWvmnZCDAtNNuqRuQ60ZvNVOQ3CdfrgzrzMdhYjwRykZpe?= =?us-ascii?Q?R6V1HTe9yuHSYx5X0ZMc24bXoFDrjvUNT2+Vt2JQckFprndJGYb38/n8TxNh?= =?us-ascii?Q?4bqSN0xDDrwhnvkcSI+VRSevoXxRLW6dnkEFrqqdaXNY+zRl6qM9uWq2dzwq?= =?us-ascii?Q?P0LnZEWJFGI06y6VGigE6nDwdJsAoV2wFiszZvimUCtX/iyzzzhTF7rjHXxq?= =?us-ascii?Q?BxmS/A4qCx1/yRSAGFDvKADigdHmWgWJHSADqkRTi9cxsV85WZJ6aWEkqDhW?= =?us-ascii?Q?S65U3MuGRS8njG3VtfTdqhnQsrGjruLjmrPkO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KuXP1SrlgJu25mjlH4eaKuLlLrx9+zMDyApJ9O/ElUL54+?= =?us-ascii?Q?wHwRGK7l/JUWqSiFzuOBHP81MR5tECkMLmVYyl99T53hnjywqkuM7IMUHV3X?= =?us-ascii?Q?6uvFiabXFG+TQNz8rM+ftRJHrp0lvfi1P0zi7irn9NZso5jqiVWEd/OWhj+b?= =?us-ascii?Q?yevMvTbaggd+Gr/yqphH6AlyniJeCSuwgmIrsxHd4S7TrD6xrWb9+k61eEL0?= =?us-ascii?Q?U59soDVzKzQxpYgeldN2YVvrBeEvXztxcfalN9/FX61Izd8Y4fgU9NmOCjSF?= =?us-ascii?Q?QQJT+1o3yA=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac1aa0aa-f560-40c9-76e0-08da2132360a X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB4688.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2022 11:54:36.6801 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yLoCrNXLCI1k0t7WUbrGvwuixcglM7OKJDMxGHrZWG794ozxK1gzLHVzLshwfeiMw+QgFUfC5Eh5pOjDjtuB0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9273 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On 22-04-12 06:57:18, Miaoqian Lin wrote: > 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. > > Fixes: 78edeb080330 ("clk: imx: scu: add runtime pm support") > Signed-off-by: Miaoqian Lin Reviewed-by: Abel Vesa > --- > 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..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); > > ret = pm_runtime_get_sync(dev); > - if (ret) { > + if (ret < 0) { > pm_genpd_remove_device(dev); > pm_runtime_disable(dev); > return ret; > -- > 2.17.1 >