From patchwork Sun Jun 14 10:29:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11603259 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 164E5912 for ; Sun, 14 Jun 2020 10:29:34 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D578C204EA for ; Sun, 14 Jun 2020 10:29:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jzxGy7oF"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ckNqKqXB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D578C204EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=7A27Z+63bUTbwFFA2OB3sz/56ayKT8vdh77emt0P4VQ=; b=jzx Gy7oF/CBwJoML6g1VYF+W+Au/WZV/xK0Gtl/3Kr11HwaowL6GjZUl36+w8bfKzhOfxmXdBcIqUvmn 7yLtNk72zXPILjQ9AA3mJN0TEEpFs7m7q6tPThu5vZI1j3mpgeD/YD/9ijKhSIGfMR1idVSSa5XUU wOMHVnbYlI8PeItz/xMLkgGCz6vJgViIn20dDheXRjI8P0WIubnr3/RDFFYvp21UneXXGS86Z2i3l Y4ljHdoLkUoJfjZ/GeUi8j0+gxsIfEiETPHHGzZ+iokcssuQbMgeANOfXhbKBa/OueYu803rJKyvm 1xttuOHAC92s8qsoJkbkap5RUSqJ/Aw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jkPtG-0001XW-49; Sun, 14 Jun 2020 10:29:26 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jkPtC-0001R1-Bq for linux-arm-kernel@lists.infradead.org; Sun, 14 Jun 2020 10:29:23 +0000 Received: from PC-kkoz.proceq.com (unknown [213.160.61.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F03EC204EA; Sun, 14 Jun 2020 10:29:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592130561; bh=6cFZsG1Cg06Z0SqhU1Lqbfsgs6dC88nSSS50fU5oMng=; h=From:To:Cc:Subject:Date:From; b=ckNqKqXB5xIVStBcC6h3zibB/rXKBPHPgoclByL12a7tePbDcGjcXkUNM16yDNI+/ 82in1GhOFLIfvJmVlG3tsP7RsI3UsybodNNatpgdEPEa7WqF+TBhs5wkE4bjkhZu4v O7mZGAV43rqRolEyPo3+cYr+tnIZX0MIgeMq+iE0= From: Krzysztof Kozlowski To: Oleksij Rempel , Pengutronix Kernel Team , Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , Wolfram Sang , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] i2c: imx: Fix PM runtime inbalance in probe error path Date: Sun, 14 Jun 2020 12:29:03 +0200 Message-Id: <1592130544-19759-1-git-send-email-krzk@kernel.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200614_032922_426843_887DAD11 X-CRM114-Status: GOOD ( 10.97 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oleksij Rempel , Marc Kleine-Budde , stable@vger.kernel.org, Krzysztof Kozlowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org When pm_runtime_get_sync() fails in probe(), the error path should not call pm_runtime_put_noidle(). This would lead to inbalance in usage_count. Fixes: 588eb93ea49f ("i2c: imx: add runtime pm support to improve the performance") Cc: Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. New patch --- drivers/i2c/busses/i2c-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 0ab5381aa012..6e45958565d1 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -1239,8 +1239,8 @@ static int i2c_imx_probe(struct platform_device *pdev) clk_notifier_unregister: clk_notifier_unregister(i2c_imx->clk, &i2c_imx->clk_change_nb); -rpm_disable: pm_runtime_put_noidle(&pdev->dev); +rpm_disable: pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); pm_runtime_dont_use_autosuspend(&pdev->dev);