Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp873596pxk; Thu, 17 Sep 2020 19:56:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWFvhE4DPJO+aZkL8a38iZCwOvI22AWf5ZIUjNJt4Qf1pYYkt8qn7XDA+smT3tBJA+LwSw X-Received: by 2002:a17:906:ca4f:: with SMTP id jx15mr33398902ejb.454.1600397816898; Thu, 17 Sep 2020 19:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600397816; cv=none; d=google.com; s=arc-20160816; b=JjDCdQTpUcK7YTI+KZUi2NwdWVIKt8OEzOS36cfWn1KhaciAbCvbMSNXzRKoCTyH3I uNPJ+7zhvyB1c9DB1Ypa2nE+gzUO41GaFBTHRyDd0HynM+zqKKzuaEGXuOXMYVsC0PXh nmU6Aphc/naytL8JCdp02ucEiHOfNqrpnoEct30Yf52nMfJ8ehYrRqmaWP2DDqu8plpL vXPYgUECQ0iCnD2LTXG/M4iNFcH+Ab0r6zpQSGV7Wy9jD1I4Jkvr610DC8x92Xk4bLLq FQpFArzd2i5HDrSMGCuy5sObMbTaT4HNQCvPyP0N1xwaTBIr09u2gDq4XBQQt12bvX7q F8Mg== 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=rv/S5WSq0hiqE0NzQQw/S5BvaLfGYABpDSjxgEvLZo4=; b=ATnx9DkRw/zOR95JlBB0F86cI4kqE7zXmRW5hmGIcrSDsWDrc46Xi8KPw1fOEdP+lg /g9Kgb9rSshvhuqerooWQI/ZBGVncL4LvMK9iyj3HpYjENIP7VKAWlZBwAz7FjEhcjkv u+MH0lEznQ6jdPd2o1lovQeYfV2AVnnzmijjlXXV74PI+nNQXU9QBWzBhPoYgeuzo77Z x6RctuFb4Oaq+QLhp3K9E2sIFUSkIqMK9T8IVjYaHQHLtz2tiCci+Im090bQZ9wLeEyi QSI+Pz1w/HqyK+ap+NMsLukMd1RH0d0CMlIbjFEytFQEQkSxLa45X9c/l9BJO/COASHO hxGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MGAQZPkK; 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 r17si1247305ejz.238.2020.09.17.19.56.33; Thu, 17 Sep 2020 19:56:56 -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=MGAQZPkK; 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 S1729499AbgIRCym (ORCPT + 99 others); Thu, 17 Sep 2020 22:54:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:57610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727886AbgIRCHV (ORCPT ); Thu, 17 Sep 2020 22:07:21 -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 B71402395C; Fri, 18 Sep 2020 02:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394840; bh=sryL45D2Xw7qlPOrIrdtKdTGkdCEVjkzq3LYwn5mTFM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MGAQZPkKkBnOygwTe6LoOQAc7T00WBemTgQFO+kLjhtBYdzwtGTWgRHG5uWu8z/vC vo1tg/RFfyKJunhll8IgeKE3EU8uu88xtcBQDmDtUYm586IhavgeVScXP8AOLAgta/ MokdSqLY+nFszWkqRSF01uK3slpv0JbF6rjJEdyc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dinghao Liu , Lorenzo Pieralisi , Thierry Reding , Vidya Sagar , Sasha Levin , linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 298/330] PCI: tegra194: Fix runtime PM imbalance on error Date: Thu, 17 Sep 2020 22:00:38 -0400 Message-Id: <20200918020110.2063155-298-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 1c1dbb2c02623db18a50c61b175f19aead800b4e ] 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. Link: https://lore.kernel.org/r/20200521031355.7022-1-dinghao.liu@zju.edu.cn Signed-off-by: Dinghao Liu Signed-off-by: Lorenzo Pieralisi Acked-by: Thierry Reding Acked-by: Vidya Sagar Signed-off-by: Sasha Levin --- drivers/pci/controller/dwc/pcie-tegra194.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index f89f5acee72d4..c06b05ab9f787 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -1395,7 +1395,7 @@ static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie) ret = pinctrl_pm_select_default_state(dev); if (ret < 0) { dev_err(dev, "Failed to configure sideband pins: %d\n", ret); - goto fail_pinctrl; + goto fail_pm_get_sync; } tegra_pcie_init_controller(pcie); @@ -1422,9 +1422,8 @@ static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie) fail_host_init: tegra_pcie_deinit_controller(pcie); -fail_pinctrl: - pm_runtime_put_sync(dev); fail_pm_get_sync: + pm_runtime_put_sync(dev); pm_runtime_disable(dev); return ret; } -- 2.25.1