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: 207509 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A98AC433DF for ; Sun, 14 Jun 2020 10:29:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 05BB620747 for ; Sun, 14 Jun 2020 10:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592130565; bh=6cFZsG1Cg06Z0SqhU1Lqbfsgs6dC88nSSS50fU5oMng=; h=From:To:Cc:Subject:Date:List-ID:From; b=rFrKDYqH/Rf1+J/84hnWEzMeqC4HG4IZ+q5/CPLAvZUAqPZ/YdbMNPnsyIXsjB2p8 anN8fsC2UycCWCRh7Y/CuTsftCk77tzz1LBqptCj/LHG3g+1gZ11ZLigePZgsxw2zv 7y3tfUBFU8HNksU5/t1+KsYxNwDz1ALsZRYICH7I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726786AbgFNK3X (ORCPT ); Sun, 14 Jun 2020 06:29:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:59168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725265AbgFNK3W (ORCPT ); Sun, 14 Jun 2020 06:29:22 -0400 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 Cc: Marc Kleine-Budde , Oleksij Rempel , Krzysztof Kozlowski , stable@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 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.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);