Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp165331iob; Mon, 2 May 2022 16:04:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz16DZndFxNPaUiq6einvOG/m5eE21bwk9PDMZW8yAsOLWTMMnHJeqEgyXcm/SHVe+v6YUF X-Received: by 2002:a17:902:bf06:b0:14d:8c72:96c6 with SMTP id bi6-20020a170902bf0600b0014d8c7296c6mr13743185plb.156.1651532658574; Mon, 02 May 2022 16:04:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1651532658; cv=pass; d=google.com; s=arc-20160816; b=Z2eNfOCJtj5RnKJA6CgjFV+p/b1VMoeWxdC7cj1Uj8MMBx69vdJRp+FGNBmfez4Ui4 WEw6I/XMKjTrV7iyqUgrw7eVEAFZ6lx8L76/O5uZgpTi0SV1OnyoIvLgw31PKIBgJVMb rWHdMt2zHDEsCLmyS5dB/DL/U3OlRhOBXiJfXssc0afGmUMdTODAcZEwWeb4oLZDRLRx vJcRe2dqJPJt8DlOfQajygTRMZU0HaDac62gOneUfIbD8P61aeVhyI3oohdEYxLxBZ09 ypdmi/sPauCS35pTvAkRnprVPhDildZoOHw6uFQacRrPpfI6AYfT5oXzm4eHr3rAhgcq RKKg== 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=0beyg+wiykb1y9q6tEXyp474d4DAhFID5OfiHQH2GPs=; b=OhsKwgdYaPk/Vma/xtqfVe2H5/mVi3Ii3uen85dKnCBNbv/w0ZtW2/GBqhRWFy8+2n zuFpS+tykyG2CKrvrUxnxRQ9LHwbhdgj2gXSChUi3cESIFFlBnqTnN7IO7IeJO/YcQaU bBrLNru3qkkgxCEFFXJ1pV8xw4osFx/EGYfn39Slp2jaHx6s3wGbMJlOR7XfLqII/BCu vcp62svhd74nFH4ESY7jKkVD7UE5bdYVvtztBA3SMqfd8IAIimyNly+WivphV4lyMam7 YjhQFPyd/qpSBSINJDSTlS3mGritWtJmDOVyzM53k3dwd1WruhzAroKaatCQzo4B6j2f G8/Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=KOwFxAnw; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id bk16-20020a17090b081000b001cd5b0dcab5si584506pjb.12.2022.05.02.16.04.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 16:04:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=KOwFxAnw; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 27B922DD6C; Mon, 2 May 2022 16:04:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384258AbiEBJjZ (ORCPT + 99 others); Mon, 2 May 2022 05:39:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384243AbiEBJjW (ORCPT ); Mon, 2 May 2022 05:39:22 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2079.outbound.protection.outlook.com [40.107.21.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5174F24BC4; Mon, 2 May 2022 02:35:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OSOCIbVjJddPGAjfbJc6mc13byv9/qZm8m+nSF5z0E0NINPMzKG7OR+VeW22TD8QNzxGFMfIrC8D9dsPSUMa8AQbEOZ4L34evTDoQZbWVFCe1t2tNmZaaxu30eo6g/Da52hvKY6t7jvSQwyUN7qn4qWEMvULpLW0KgzOYhu2BM39uqk5eUP2D5LBrbI1l1CGo3X0VfByPH5iwnKfKowxzhmx67SEQ1WwWr5x9vxKiQz3SHjZ9Cn/fSeGFz7pRDwV+jO9VdTtTj9dWVCX3eW9U+WPKP4DxQl9tsV01vMIv/Wmk8URxIjRuIrT2p5UZ4PNBTQj8U9gupgfz6/xoHoE9w== 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=0beyg+wiykb1y9q6tEXyp474d4DAhFID5OfiHQH2GPs=; b=DvtBkqmojwxZ6vUa+XQko17kGke1xd3igVbOa7avGx52kmF+4NRLX9NwuoQ0/kFZwTyKOnDUGWnIiAGPHu1qiH3WXdDswQzo5TBar+CmtupfJv8SPT5ngfGoIEdDV89vpK80lylqBQI1p5XganM6X6OdTJ6bYOkD8zIVkJEFtvl0FwjApdvWrwppLFj6vMR6ZVNsm42Bb0y0OeY8eyfhFjgXtqxQlbiKHCTtBBThcxUFT6k3y46j+6deTKsuHYzfZgN2gqx+wPd67kl8J0AeQehUl5iXrP0wDK0UTWM/RGkFepbpAE1JMdhkIPYPPfHWxx81nD5JjanXzvf7xheB3g== 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=0beyg+wiykb1y9q6tEXyp474d4DAhFID5OfiHQH2GPs=; b=KOwFxAnwW1/8vECRSDgS++go4IpG76MA1hT98kTUUIga8JgBwIxSFk3hdq2eGTilh/OYysDsLX+RPRTuGuHLOPj4JmID3haOMzPHg3JzTlc1VNVmKEo+IT5p07lUerORaqexU8wYxA2UNPNxIWVuDLwyNO22DrYaoxFqKZrNhHA= 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 DBBPR04MB6123.eurprd04.prod.outlook.com (2603:10a6:10:c3::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Mon, 2 May 2022 09:35:50 +0000 Received: from VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::78d8:955a:7946:fd78]) by VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::78d8:955a:7946:fd78%6]) with mapi id 15.20.5206.013; Mon, 2 May 2022 09:35:50 +0000 Date: Mon, 2 May 2022 12:35:48 +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: [RESEND PATCH v2] clk: imx: scu: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage Message-ID: References: <20220425011117.25093-1-linmq006@gmail.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220425011117.25093-1-linmq006@gmail.com> X-ClientProxiedBy: VI1PR0202CA0031.eurprd02.prod.outlook.com (2603:10a6:803:14::44) 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: 65d9b82b-46eb-4bd8-999f-08da2c1f24f4 X-MS-TrafficTypeDiagnostic: DBBPR04MB6123: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: gnGq93n0Hh35FXMfKk4ss2M1UZlB/G5QvYnFGMmDQVtcO1c+3nuA8c1O4gkPCGQHz3GUOvFlEsM4E1h7H9HmasZs64Jl0HPbwoE8ZFKx/qH1niW3os9WWQiab2mDY2bXuEjdURFJECDKTx6O9Y0bC5BB01nQVB7RDZbCrTwBQayoljsnrOOHIfg5v7sk34LqzC1RhIObd3ikXOexQtoeo9N2NJIwMFUD0MAIK6jClabj5BE+JMjloutoqwGg3tIgRgp900v08zhXp6Qy4+1EB1I3FzG93zTj+RrR9XkbCpWsf9xVrL7EPtggr8Vj40FhRIjy26FHvfVh3dRYgB/kjMez6ZNPGpgnXWpSNiAk+UKAwtejwi6qE1ubq1v6VXplloY0bE9zTZXAxLB6A2nIwETcPH102bfnplNReVW9LzXNZeIrrvETwij6SPTYFXqszbm4O6e78Zd4klpdWT5u7zMaF3+PKN4eKA+yfPTT+jmDMgcz3mPnRr4KYssmJcGGAuxt6WBZ0w/cjzkzrLdG5JPem4DLE04YpWM7+BOERUzKLoUahl+9KCR/I/qUTwWfzIRhhsQ5PnE3Pz4g9eAcoF29hPrzCKWZU+YfHClaLGwx5OjEsFIExQFr7ufgN/N2J3lkEY4T7NIYHXeCZLd6eDM3ZdHL9y61Cy8tnWxh0/Yfro3pAQHc40rRcGbWBHwCsmSDWSIot66SJnXmeViGPiqHlrvFAZ9kGKVBsDkdJhp/xfS6AFZ8JCz+6iJz1xF+wA/d511V8fpBqDxdIid2lOEvaxt4PZyiVrSHth0F9tvM+UTSZwOW2FnQ9cd+54Ol 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)(186003)(7416002)(52116002)(6916009)(5660300002)(54906003)(44832011)(8936002)(53546011)(6506007)(83380400001)(6512007)(9686003)(26005)(966005)(6486002)(2906002)(86362001)(316002)(508600001)(66946007)(8676002)(4326008)(66476007)(38100700002)(38350700002)(33716001)(66556008)(67856001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?lOuZk5vm55hKu4hZ09yQ8iOMqOGzSoguP5hNtEkFRGdqxRhohJ85z4HsysFa?= =?us-ascii?Q?zepEHPB57t8iz0KfxQdabdPfjFCdoZ37yqLgopHBSKXAJn5L8pfPCk+Q7AAm?= =?us-ascii?Q?jYjb6QIlzYZq1N0/+I+cDuYrnC2AHcYFeo/5iXhymiujWXaRPOVEhJ00Igri?= =?us-ascii?Q?zF8qPImUjpEIl1A/z1CES0SR3B3gXvdtIJJS8PevUxJ3WgJRAGr6LrForLRX?= =?us-ascii?Q?lQJuM1PwqZC/DeYANaJfdmca/Hqg6H8VSz/btI/z++AD7QHSSawCnIYDJkOo?= =?us-ascii?Q?az52g5uCuBOoYR/Na+W/s1Vloglj5/WENIckpBHVtK4bHFGM+GcbSBDjQGer?= =?us-ascii?Q?ejCswerQLPKbzprRZlPnsfr9Oj+34urmL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+Q12y6aM4aZCPqO+5xhNnYSASHUu96Ax8SF+8wC6N4Rp?= =?us-ascii?Q?jbW+7fdjHV2lNLt//+tSlpbrBmA0VsJHYIrAcOrXu9oHzOUOV1afiW3/eFaf?= =?us-ascii?Q?FttRpwBU1y0ngAZ+ANSOvps1Zj1dqPdMETkbr39KN+Fak/MgCByl6tw4doHC?= =?us-ascii?Q?h0PGYJSfUM+gqkl8rgvITq937tm4pEXoA38qR7xCcHNzTevWmW+wowl27fIh?= =?us-ascii?Q?vVJHPrb6e9gPBIJLlA0C1aBdn0tUwc2YMkJinJse/0u7Cr8OsznglNYkhRd2?= =?us-ascii?Q?S4onWohdSLzmDLARJhpvt2fEDGAk6NH4YxzXs6S3O2dbvfh5gXvBkBwNtZ/H?= =?us-ascii?Q?NFoQnetqoFoif7ZzDQ95ebcYS+65fwp8/GzehA3PfPb4+ubpVSJTGuC83aul?= =?us-ascii?Q?reXqBaix+nSeqGfr34mP1+pbF/9tqoLiW4OC+HHqiMRywOR1wHXThIvzM4v/?= =?us-ascii?Q?paFt0s2qZg=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65d9b82b-46eb-4bd8-999f-08da2c1f24f4 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB4688.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2022 09:35:50.4933 (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: ROTJuLQoD/aFjDP90N40zjpC2wbcunkpuRPP39g3bi8/GHuSXhmsNesznfzbAzUa0YuTpv9lpC5fabr1Qf2vGg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB6123 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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-25 09:11:17, Miaoqian Lin wrote: > 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 Applied, thanks. > --- > changes in v2: > - change pm_runtime_get_sync to pm_runtime_resume_and_get > - current check works fine for pm_runtime_resume_and_get() so stay the > same. > Link: https://lore.kernel.org/all/20220412065719.17735-1-linmq006@gmail.com/ > --- > 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 >