From patchwork Mon Aug 17 15:14:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 247867 Delivered-To: patch@linaro.org Received: by 2002:a54:3b12:0:0:0:0:0 with SMTP id j18csp2587715ect; Mon, 17 Aug 2020 12:29:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkPwcSFzkzlmNRfcuPNrSUN9/XU5RqfN9P16M065phHrcWLSbK6s83oLXxlOmvstvPZbEy X-Received: by 2002:a50:e0cf:: with SMTP id j15mr16866674edl.285.1597692585792; Mon, 17 Aug 2020 12:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597692585; cv=none; d=google.com; s=arc-20160816; b=Y75DFEhBbtvv5Ty4cIDoIsNO4zRcn77cEm3gwBCiuZwRw8rWx+ZjtIpRjKD8t+z8k3 DBGAvjNzVeRNkOtp7rYm7BIkfmd7AORIeJAQlBVVvUgfd5pjlvoMuphgpGL1RuWD8TXq aTOv9mShSCFE/v3CvbrqgD37zAHPypSkrGH2hN9D3KDKIqcB4JYrUBuhUvFYFTmAyy+g NllHxCs29cehuUBPCIfmpYosFfB9M490tXGQQWBT5+zV0uwS2CDbYZY4nT/62nTzZkVF TrutbgCxVOF2gaB4uwyNGLdod4GEzDk1Jkz+5odn7Dkw1T95mkjHwuNr0/+wgMdDs17P O81g== 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=sK/a7nuwLH8sJxYuJ+Iy5X0aIfrmeFETliHs7uByQpI=; b=r6GX7Iej6Svse6Ebq/hRtexHGjRixOe8MYJbZbMTcgd46+Ay9ZXNSoTzCl1NUs43uE GVF16wpU7WitCSmWDYZCB4lZ4qrYCIB8DoCzXMNvnOM+gdVrXViM0rPp0rfo/xCPdqrL hlUzd2zxpHml1BoKoCPZM/8pbkftN2wCQ5bp+MCG3Q23PKzFIxJk9QVXU/+DnaiC9XRW a8yxanc0Co5ep17r/8w9c3uCJyJ579M2hVNGon8mmr4t8Z3no8klRCHcfhb8qXPwfJxg ud1FWnnxiaraYW+FBMgAm6EZWgtZ3qUbRpKk0YJSlIZUAPJhmJroOjXho7GorczPnWTC oFTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cHFwHzwj; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 gh13si11801380ejb.3.2020.08.17.12.29.45; Mon, 17 Aug 2020 12:29:45 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=cHFwHzwj; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S1732251AbgHQT31 (ORCPT + 15 others); Mon, 17 Aug 2020 15:29:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:59222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730314AbgHQPcQ (ORCPT ); Mon, 17 Aug 2020 11:32:16 -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 5968923125; Mon, 17 Aug 2020 15:32:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678335; bh=Xji4J+FpRs9JzraOZWkDixn6ptwTmp3//zbyAFyKBIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cHFwHzwjzM7k1wslISzy6Oow1ogXvpr8ARA6+122p2wMdjyL+QYDDhrBfTh6I2X2m aFxKip9bF1At3LluG5qiykv8qJPtT9mBBSg5mHUkYiEUNmCoyaCdBGC9Wi1WY5amd3 GmCtqshVadVlzC0/CnR3g4IN0s85HP9wv+fBiYHs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kishon Vijay Abraham I , Lorenzo Pieralisi , Rob Herring , Sasha Levin Subject: [PATCH 5.8 299/464] PCI: cadence: Fix cdns_pcie_{host|ep}_setup() error path Date: Mon, 17 Aug 2020 17:14:12 +0200 Message-Id: <20200817143848.129941592@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 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Kishon Vijay Abraham I [ Upstream commit 19abcd790b51b26d775e1170ba2ac086823cceeb ] commit bd22885aa188 ("PCI: cadence: Refactor driver to use as a core library") while refactoring the Cadence PCIe driver to be used as library, removed pm_runtime_get_sync() from cdns_pcie_ep_setup() and cdns_pcie_host_setup() but missed to remove the corresponding pm_runtime_put_sync() in the error path. Fix it here. Link: https://lore.kernel.org/r/20200722110317.4744-3-kishon@ti.com Fixes: bd22885aa188 ("PCI: cadence: Refactor driver to use as a core library") Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Signed-off-by: Sasha Levin --- drivers/pci/controller/cadence/pcie-cadence-ep.c | 9 ++------- drivers/pci/controller/cadence/pcie-cadence-host.c | 6 +----- 2 files changed, 3 insertions(+), 12 deletions(-) -- 2.25.1 diff --git a/drivers/pci/controller/cadence/pcie-cadence-ep.c b/drivers/pci/controller/cadence/pcie-cadence-ep.c index 1c15c8352125e..4a829ccff7d0b 100644 --- a/drivers/pci/controller/cadence/pcie-cadence-ep.c +++ b/drivers/pci/controller/cadence/pcie-cadence-ep.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include "pcie-cadence.h" @@ -440,8 +439,7 @@ int cdns_pcie_ep_setup(struct cdns_pcie_ep *ep) epc = devm_pci_epc_create(dev, &cdns_pcie_epc_ops); if (IS_ERR(epc)) { dev_err(dev, "failed to create epc device\n"); - ret = PTR_ERR(epc); - goto err_init; + return PTR_ERR(epc); } epc_set_drvdata(epc, ep); @@ -453,7 +451,7 @@ int cdns_pcie_ep_setup(struct cdns_pcie_ep *ep) resource_size(pcie->mem_res), PAGE_SIZE); if (ret < 0) { dev_err(dev, "failed to initialize the memory space\n"); - goto err_init; + return ret; } ep->irq_cpu_addr = pci_epc_mem_alloc_addr(epc, &ep->irq_phys_addr, @@ -472,8 +470,5 @@ int cdns_pcie_ep_setup(struct cdns_pcie_ep *ep) free_epc_mem: pci_epc_mem_exit(epc); - err_init: - pm_runtime_put_sync(dev); - return ret; } diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c index 8c2543f28ba05..a1c6bd6f87c51 100644 --- a/drivers/pci/controller/cadence/pcie-cadence-host.c +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c @@ -7,7 +7,6 @@ #include #include #include -#include #include "pcie-cadence.h" @@ -250,7 +249,7 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc) ret = cdns_pcie_host_init(dev, &resources, rc); if (ret) - goto err_init; + return ret; list_splice_init(&resources, &bridge->windows); bridge->dev.parent = dev; @@ -268,8 +267,5 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc) err_host_probe: pci_free_resource_list(&resources); - err_init: - pm_runtime_put_sync(dev); - return ret; }