From patchwork Thu Nov 24 06:51:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shang XiaoJing X-Patchwork-Id: 25337 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3239988wrr; Wed, 23 Nov 2022 23:23:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Dkkk4jNn1nE1mgZrJAovWLGeaRnF6ORX0vnsvvZbL7Ow37SdfaraHEtKZi9+yL+Z44Ge3 X-Received: by 2002:a62:a519:0:b0:573:bc35:54ae with SMTP id v25-20020a62a519000000b00573bc3554aemr17427305pfm.79.1669274589979; Wed, 23 Nov 2022 23:23:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669274589; cv=none; d=google.com; s=arc-20160816; b=JJHDA513Dp1PKXTI7NElAwIiDElRpxiWeKX8+TYy0G2T/XzQe/4+L6C8ae62P4nf3h wFoKIdSei9eaHn5AsZ9TJviiX9aEmOuskf0A4sT5xDaxj+47BiQM2TQFnl9UFyhV5sQA yYZDeb/ugRVO8/TEYoIsxUuHgN7mX5PRhXSZGhYC+u/TaQdNvDP84DkQ4Tge67h744Pd 2MP0JDeu0ZR7Ttill8h/n+i8NSoZH1C9LZoJ6QOEaOf88gadTnhxVlZcAqEALc+YOREl R39aBQnDF2nl6XQyc7LQP31wftXhJET3in2hH6/kaPyQ38Q0tL2cGsCzOgiKsmTw7ODu k+Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=GD4pRKrITshUK3dgqMCNXbkaH83f+iICCA9uT0k97cE=; b=Qczjo3v2bSK2i5iS71yo/PoGwoikSKhlFbslcnllT3hbfAbFraWBIjFycjnoEt6EVO tqHdoLuniH42FJuhMv8f8YpdwxXZlDOaJRVGZpQz/z1j5gcTrf+gn3khmzfAxfU6viyP fOkmAyxkLKdagC8SOJvWzE6FT17ySeXQHYf8ykIbgc05ojoX0DMCTwoOIzGPmNXu1sq5 AgAtFMjBrUuHDnd0WEvtQ04MBVJH1GE4eVR84feCkauD33M0Y+1sJH7JsDyxYVHXOkeJ 74VeOaWF1GJwh9uPhe6vJ20MR8e7ZPgxEw9+OjAeKj1N2sv11GyxSIpVAoI5YCBZm2Ck jR+A== ARC-Authentication-Results: i=1; mx.google.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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y24-20020a63e258000000b00470693437b8si637786pgj.550.2022.11.23.23.22.56; Wed, 23 Nov 2022 23:23:09 -0800 (PST) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229620AbiKXGxk (ORCPT + 99 others); Thu, 24 Nov 2022 01:53:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbiKXGxj (ORCPT ); Thu, 24 Nov 2022 01:53:39 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CF649BA28 for ; Wed, 23 Nov 2022 22:53:38 -0800 (PST) Received: from kwepemi500016.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NHpbh5J5nz15MmQ; Thu, 24 Nov 2022 14:53:04 +0800 (CST) Received: from huawei.com (10.175.100.227) by kwepemi500016.china.huawei.com (7.221.188.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 24 Nov 2022 14:53:36 +0800 From: Shang XiaoJing To: , , , CC: Subject: [PATCH] irqchip: gic-pm: Use pm_runtime_resume_and_get() in gic_probe() Date: Thu, 24 Nov 2022 14:51:50 +0800 Message-ID: <20221124065150.22809-1-shangxiaojing@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.175.100.227] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemi500016.china.huawei.com (7.221.188.220) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750361272265167996?= X-GMAIL-MSGID: =?utf-8?q?1750361272265167996?= gic_probe() calls pm_runtime_get_sync() and added fail path as rpm_put to put usage_counter. However, pm_runtime_get_sync() will increment usage_counter even it failed. Fix it by replacing it with pm_runtime_resume_and_get() to keep usage counter balanced. Fixes: 9c8edddfc992 ("irqchip/gic: Add platform driver for non-root GICs that require RPM") Signed-off-by: Shang XiaoJing --- drivers/irqchip/irq-gic-pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-pm.c b/drivers/irqchip/irq-gic-pm.c index b60e1853593f..3989d16f997b 100644 --- a/drivers/irqchip/irq-gic-pm.c +++ b/drivers/irqchip/irq-gic-pm.c @@ -102,7 +102,7 @@ static int gic_probe(struct platform_device *pdev) pm_runtime_enable(dev); - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); if (ret < 0) goto rpm_disable;