From mboxrd@z Thu Jan 1 00:00:00 1970 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=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 5F11CC43466 for ; Fri, 18 Sep 2020 02:28:58 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 F268C235F7 for ; Fri, 18 Sep 2020 02:28:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mR+bYnaU"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="xsfuO+3v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F268C235F7 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-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=x/BxtHPKc5qqYPjvusGuX4oTiX6DQbQYQz/aX3HjuTg=; b=mR+bYnaUHarE5HlWYcob+k40Y Z3ydnP19/vgCUHgnVe8rZn/Hj2kA6Er+aSzXr8AYAAr3pLrrT9W4JQHR4+bx89dgwu8sT0DTpliuR aqDtDZCEUvEVKtBbs72TrFnPBxQBe80zoUsNROCa3Jo5Tb7RoMsE9TlL+NNqqhG1JQMjW1d2Vejpd MbQFV1OSRIvhLtZ+zseIZdWIkX2n6Ke7AfeGsq9FDN+p3pSVkTghiYz9tmvMjjZoQG0ZvXFAt+CQm eGU+nWk3nOre3FIbBqqzDMcSc95Gkw+OAKiHWJXlIVanBiSZcpeZHXKYp8JHbRxwFnS1e2BstiAG3 A7pYnliHw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJ685-00071N-6w; Fri, 18 Sep 2020 02:28:05 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJ5sU-0007Ck-1l for linux-mtd@lists.infradead.org; Fri, 18 Sep 2020 02:12:05 +0000 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 679C92376E; Fri, 18 Sep 2020 02:11:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600395115; bh=XVGbZGXzyGzRewPWKVp/MbziheKaRme8wTSbBriuDLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xsfuO+3vGdhAdBEVEVy1gr76n22Jvi9XKYhuB2l5/EGop+jHNEdJ/mhpxDhOhEDRG w9b4g5m+o+JBz3FJKGo79/sXAkHQPSLtj1zJFViIetOYfyNR1DvA9B9FSkfRzj9o1X TQLQNZC6iGil7XszaUh6ATCtx7GrsXYJzkh5rg7A= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 188/206] mtd: rawnand: omap_elm: Fix runtime PM imbalance on error Date: Thu, 17 Sep 2020 22:07:44 -0400 Message-Id: <20200918020802.2065198-188-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020802.2065198-1-sashal@kernel.org> References: <20200918020802.2065198-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200917_221158_481654_74446207 X-CRM114-Status: GOOD ( 13.48 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , linux-mtd@lists.infradead.org, Dinghao Liu , Miquel Raynal Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org From: Dinghao Liu [ Upstream commit 37f7212148cf1d796135cdf8d0c7fee13067674b ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200522104008.28340-1-dinghao.liu@zju.edu.cn Signed-off-by: Sasha Levin --- drivers/mtd/nand/raw/omap_elm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/nand/raw/omap_elm.c b/drivers/mtd/nand/raw/omap_elm.c index a3f32f939cc17..6736777a41567 100644 --- a/drivers/mtd/nand/raw/omap_elm.c +++ b/drivers/mtd/nand/raw/omap_elm.c @@ -421,6 +421,7 @@ static int elm_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); if (pm_runtime_get_sync(&pdev->dev) < 0) { ret = -EINVAL; + pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); dev_err(&pdev->dev, "can't enable clock\n"); return ret; -- 2.25.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ From mboxrd@z Thu Jan 1 00:00:00 1970 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=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 1CF88C43464 for ; Fri, 18 Sep 2020 02:12:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D1F3B235F7 for ; Fri, 18 Sep 2020 02:12:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600395120; bh=XVGbZGXzyGzRewPWKVp/MbziheKaRme8wTSbBriuDLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=sT96Y8pJC2X2ACIPJbVHg24qCqheWQnRyQ/GU7+45tfH1gleKGQG1yJalDdj3OaH0 lUOr/YcgPCFKp3gn/UrW/BTRHGI9/7T98gQUuFkFuAtSGjNd7QFjVV/Ze6OCBIdYzw THHhNQrI8o/7vtpePCMwdv/wfjApzBgdyaptJJLU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728712AbgIRCL7 (ORCPT ); Thu, 17 Sep 2020 22:11:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:37876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727526AbgIRCLz (ORCPT ); Thu, 17 Sep 2020 22:11:55 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 679C92376E; Fri, 18 Sep 2020 02:11:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600395115; bh=XVGbZGXzyGzRewPWKVp/MbziheKaRme8wTSbBriuDLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xsfuO+3vGdhAdBEVEVy1gr76n22Jvi9XKYhuB2l5/EGop+jHNEdJ/mhpxDhOhEDRG w9b4g5m+o+JBz3FJKGo79/sXAkHQPSLtj1zJFViIetOYfyNR1DvA9B9FSkfRzj9o1X TQLQNZC6iGil7XszaUh6ATCtx7GrsXYJzkh5rg7A= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dinghao Liu , Miquel Raynal , Sasha Levin , linux-mtd@lists.infradead.org Subject: [PATCH AUTOSEL 4.19 188/206] mtd: rawnand: omap_elm: Fix runtime PM imbalance on error Date: Thu, 17 Sep 2020 22:07:44 -0400 Message-Id: <20200918020802.2065198-188-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020802.2065198-1-sashal@kernel.org> References: <20200918020802.2065198-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dinghao Liu [ Upstream commit 37f7212148cf1d796135cdf8d0c7fee13067674b ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200522104008.28340-1-dinghao.liu@zju.edu.cn Signed-off-by: Sasha Levin --- drivers/mtd/nand/raw/omap_elm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/nand/raw/omap_elm.c b/drivers/mtd/nand/raw/omap_elm.c index a3f32f939cc17..6736777a41567 100644 --- a/drivers/mtd/nand/raw/omap_elm.c +++ b/drivers/mtd/nand/raw/omap_elm.c @@ -421,6 +421,7 @@ static int elm_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); if (pm_runtime_get_sync(&pdev->dev) < 0) { ret = -EINVAL; + pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); dev_err(&pdev->dev, "can't enable clock\n"); return ret; -- 2.25.1