Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2662588pxa; Mon, 17 Aug 2020 15:53:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwG/aQgWwwVHBx0rucmiN5kOF6Z9YVTrqUsmEYQKOoV7E5VFSNllcyXBhCFGEGgi/Uq5MHF X-Received: by 2002:a50:f10c:: with SMTP id w12mr17454986edl.202.1597704828041; Mon, 17 Aug 2020 15:53:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704828; cv=none; d=google.com; s=arc-20160816; b=e4aDFqhs5j9GTicdnKB5pWWm01nLTzN0G53LxxeU9GfExJaeCYZHnYPEcts4LQ9aMi 7ajdBmmhRiQI8AgHLKqzhSz0B4Acqv0ZvESj2a0YRnf2IfBTu/1AdVMBzlfnyFMvAZDr THUXOaQy4f3iICvrT1K5DOu/5viDIYoStk0hE+pM/kWi10pEjVU0E+YTm5hSEvWHFRZ6 Z3yHpEP3l9aAeqV1u+bLI4ELklaaaoaNg9ZF7ZoXu0e6IUn3+8Ol6LmwucJO3u89Yo9j r0Xv9hfoScW9Wnop8DMPN5Q9q24phKSLyMd3MzyWBL0VmxgjAWUeaAmEGMmViHZMZtj9 IL3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NxIXcowbw83KZlico9Vu4jbx4wC08A2d534/6QeyUos=; b=fPsD8pw75UPSbSsvpFziPvk4Q3WkAqeG3lbtN1+ExOOuNlmp4IU5A/cwdlbR0sS/yu uhbLXLBifhAmimDfokdLkFrGdiJ2pM9wNSUctJlheLMFsoZ+n5DcS4PiprFF7AwcUni3 tipCbjO5FX9TbvfaLwLqbbjYU7if9fpBT0havO/0WJWRn/wDwWbF5Zs9J+wbgL5MQl+d RvQle3RHfMXbFRFSfNFUvqtfUUoiHPKYhKthEx3F7baZK2AhNCMgm/9MOS6+NHeH/cTC YjgaZAx3tzLPULPTzNxB1APshKKBjf6aUZb8eVmDjLy54pPe9eSb3ZBeIYkefgaiwSY2 F3Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GQF39twQ; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k10si12164269ejd.657.2020.08.17.15.53.24; Mon, 17 Aug 2020 15:53:48 -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=GQF39twQ; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732086AbgHQTcM (ORCPT + 99 others); Mon, 17 Aug 2020 15:32:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:56122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730285AbgHQPbd (ORCPT ); Mon, 17 Aug 2020 11:31:33 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1793022CBB; Mon, 17 Aug 2020 15:31:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678292; bh=Uln+deEU/tSr+Yu9jrfHo1h8aju24WYtRq6HtS+xw9Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GQF39twQaMxN62jfnxRYS0c9L6l/unxoEddEkib6hT8j+J7kPKzBiTNgBeWQpSDhf jiWN0OZPlUGJIoUPVJwRG7afkKh1hZF9ou58T0Y0fKRj802q+4kPSjsoCRGIKMJ0lS H+hSuPBaLNL+lVD2j6mA6MQ3zeNACO+VLct1YX+Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Lorenzo Pieralisi , Yoshihiro Shimoda , Sasha Levin Subject: [PATCH 5.8 282/464] PCI: rcar: Fix runtime PM imbalance on error Date: Mon, 17 Aug 2020 17:13:55 +0200 Message-Id: <20200817143847.263731460@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dinghao Liu [ Upstream commit a68e06e729b1b06c50ee52917d6b825b43e7d269 ] pm_runtime_get_sync() increments the runtime PM usage counter even when the call returns an error code. Thus a corresponding decrement is needed on the error handling path to keep the counter balanced. Link: https://lore.kernel.org/r/20200709064356.8800-1-dinghao.liu@zju.edu.cn Fixes: 0df6150e7ceb ("PCI: rcar: Use runtime PM to control controller clock") Signed-off-by: Dinghao Liu Signed-off-by: Lorenzo Pieralisi Reviewed-by: Yoshihiro Shimoda Signed-off-by: Sasha Levin --- drivers/pci/controller/pcie-rcar-host.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c index d210a36561be2..060c24f5221e2 100644 --- a/drivers/pci/controller/pcie-rcar-host.c +++ b/drivers/pci/controller/pcie-rcar-host.c @@ -986,7 +986,7 @@ static int rcar_pcie_probe(struct platform_device *pdev) err = pm_runtime_get_sync(pcie->dev); if (err < 0) { dev_err(pcie->dev, "pm_runtime_get_sync failed\n"); - goto err_pm_disable; + goto err_pm_put; } err = rcar_pcie_get_resources(host); @@ -1057,8 +1057,6 @@ static int rcar_pcie_probe(struct platform_device *pdev) err_pm_put: pm_runtime_put(dev); - -err_pm_disable: pm_runtime_disable(dev); pci_free_resource_list(&host->resources); -- 2.25.1