Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp854538pxk; Thu, 17 Sep 2020 19:11:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvlv3RS9MshZEzhPciG+Jpq8QHAj0P8WOMxVnLfIeSvQ3mKnZJv9fbs0+r2Lnp0Iw+K4xc X-Received: by 2002:a17:906:f0cb:: with SMTP id dk11mr23928858ejb.457.1600395062297; Thu, 17 Sep 2020 19:11:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600395062; cv=none; d=google.com; s=arc-20160816; b=Xf3RelLL9brqfrqvmeB7X3U0J246kXQWPINVTYGaBqkHSMpBEpq6KI3woP0htU0W7u ZVcw+FTtoBhTTv0SLi9v9r/zq0ns6JW3Cfc9wERZKQG8OsVPneLxrfrreiaVWgtwBSI7 xqED9q1VZms+SXqg2VwHcdcDr8N01v7kh50qnx1YyURXvzA91S0V9271TyPYoVkpEwwk NQkqS3GI2oucvhcQjj/VYqdMM7TvPF4PDLHWDdzL4EjHMylGKMDzjvSlL1sVaKi/ABzp D4HImNrjnQFIWnQTc/jPXkgjZ7td89vDetlK4SIuzE7JFfLW+e/cy9qUBiVIyunOICff Uxtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PaPhM4+dK/7i6ZnEP8rbHAbFqFRb3SPYdnAY+CxRRD8=; b=gkrti5OfpQ8Pg6SCJKGSgSrskeWvu/Fd0qZY83pFstvVFlJF8Om5VQ4YtOV0RvMFm1 al/8DKwdV1Raf5xLj0ldQzTel27xgtdcVhj7C2MSMC+9E7RyxuCHNx4syDNnARtcnFxZ HOPD3iuSkI9+Sy+9WyPgHu4rQM/H+wGQ8FCsZGA8qJxFsvJTy/LpGlTrArGzqYOwXCRV lYeDF0MUrsE/tUQwHBcKF0/A3ypBBSydhDbd4wVWRmkxByUKMI6eIXeal0EDBLTp94Wh IPpX3Z8OYIGXpYPMy5cy6qjokK7Q2TGqdQw7IGKZ4Tz5NQ0nENCC4SGP7YMCidSNW1tx fa4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UvoS2XUU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d21si1274279eje.284.2020.09.17.19.10.39; Thu, 17 Sep 2020 19:11:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UvoS2XUU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727963AbgIRCHh (ORCPT + 99 others); Thu, 17 Sep 2020 22:07:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:57718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727924AbgIRCHZ (ORCPT ); Thu, 17 Sep 2020 22:07:25 -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 7F5A823770; Fri, 18 Sep 2020 02:07:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394845; bh=OZBRK2VLGNUKvLPFgd5TqEh2BcN//uJryGvXEeZgT54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UvoS2XUU2VF77jIoONcIb4idPQTSAqUomTAOb6BJeyP1+Z61gNeRJsdhc0S3y1NAV 1XxoIuDHt7/ynUfLa1ZSZh63JAA7C5LKlWpH4EHlhAYSww0MmfsDSAthpn7HeJ9RH7 GOUIboTjwBrWyL0nQp1QYTzEvcjsdxEh7A/ise4A= 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 5.4 302/330] mtd: rawnand: gpmi: Fix runtime PM imbalance on error Date: Thu, 17 Sep 2020 22:00:42 -0400 Message-Id: <20200918020110.2063155-302-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-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 550e68ea36a6671a96576c0531685ce6e6c0d19d ] 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/20200522095139.19653-1-dinghao.liu@zju.edu.cn Signed-off-by: Sasha Levin --- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c index b9d5d55a5edb9..ef89947ee3191 100644 --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c @@ -540,8 +540,10 @@ static int bch_set_geometry(struct gpmi_nand_data *this) return ret; ret = pm_runtime_get_sync(this->dev); - if (ret < 0) + if (ret < 0) { + pm_runtime_put_autosuspend(this->dev); return ret; + } /* * Due to erratum #2847 of the MX23, the BCH cannot be soft reset on this -- 2.25.1