From patchwork Mon Sep 20 16:44:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 514376 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2338070jao; Mon, 20 Sep 2021 11:47:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVHM5nOxq4JWbw1LsREHa1UxG4eOq0Ywvq1vV8MsJ2FL63wI2SbpHXPXNSdPscFPz3rX5A X-Received: by 2002:a05:6402:358f:: with SMTP id y15mr29838504edc.67.1632163630296; Mon, 20 Sep 2021 11:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632163630; cv=none; d=google.com; s=arc-20160816; b=Ng5ytljrAzuSfxqWK7uQqvFiwfK8CnTr7tPC3Ju8ZtfxShzmkSsR4SvBRTcFO9nOiw afgSL0Kgii86pxIYRjBUhaknmWWYmmjTGg+GZBFuTZY2UqNcD27is4pOr8Q6SxHsU/p2 PVMnLNRyPduiRv6q44lJniFBbghvl46XrPUgBidkArRrRQ/t2y9caO9ioSV5CZIQjFNt 3rZ5aOXzIe+YrLl1N4863EJgsLPq4Kcm90S4oPcio68O3Q/wpIO4HUTEZXAz86yEZ+aH Cz7X9gF5HmU1K4hBp+CxcYiqyIQWeh54V6K8Hftc0OiQ9s5YsgW8pM/HxDmWLg3Qv4by NbBQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KchsrLwXX54Dvfldy/gP/UtblKXwOYw58PaYddA0PXs=; b=kboh4uYQfHgL0BvGX3VIlSDBZOCJLVqUPqprwaVfmiYFJTE4fYAe0AqoztP+HtZRJv YHgTk+Or/y9N11JbznT87+WnMb5iZilbXChsW0vcqadYDIV0oE4mJ04FNbmQh1hSDggp iyjtsLUrW0GfPeqw6b/f3e4ilOXY3d4KmIVQ9MpUwTWap0ESB3+7/0UAGaBGbP28exoF ZF7lX7hMg9l22IttfllUnNPBnr3WIvOFH920gcCV1un68XUiC04xUqQIjwZPFXKpRpVK ZFE1NVJ0PISnWDNrGKewnc1pua2fmIRqAIM7Sc8kp9WQISEb6DSbbe3WKYBqYW4wFrlT 02lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uyxL9mY4; 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=pass (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 y20si14446786edc.166.2021.09.20.11.47.10; Mon, 20 Sep 2021 11:47:10 -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=@linuxfoundation.org header.s=korg header.b=uyxL9mY4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354383AbhITSsf (ORCPT + 11 others); Mon, 20 Sep 2021 14:48:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:33542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384095AbhITSqc (ORCPT ); Mon, 20 Sep 2021 14:46:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D350061B04; Mon, 20 Sep 2021 17:33:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632159209; bh=12eTKTrgXoNsliTpBIj9AqdcGCF3gdeRnknu9J4fK+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uyxL9mY4mYLrNFN2/xfkjxSThPYWEgMXLtxCpHhNTEpjNjbDMgD791NXt3FxflRBi VIwkMeE+TTEOwBp88qDDOXA/4RIFOngMr7l0ZInZXm090MVeH7PVZiOi+sk7y4Uly1 o4x5wEdZUxpOXrqFpfPxxCIR1YFFOCeb9uPslgOk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Rob Herring , Lorenzo Pieralisi , Srinath Mannam , Roman Bacik , Bharat Gooty , Abhishek Shah , Jitendra Bhivare , Ray Jui , Florian Fainelli , BCM Kernel Feedback , Scott Branden , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , Sasha Levin Subject: [PATCH 5.14 125/168] PCI: iproc: Fix BCMA probe resource handling Date: Mon, 20 Sep 2021 18:44:23 +0200 Message-Id: <20210920163925.767828626@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163921.633181900@linuxfoundation.org> References: <20210920163921.633181900@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Rob Herring [ Upstream commit aeaea8969b402e0081210cc9144404d13996efed ] In commit 7ef1c871da16 ("PCI: iproc: Use pci_parse_request_of_pci_ranges()"), calling devm_request_pci_bus_resources() was dropped from the common iProc probe code, but is still needed for BCMA bus probing. Without it, there will be lots of warnings like this: pci 0000:00:00.0: BAR 8: no space for [mem size 0x00c00000] pci 0000:00:00.0: BAR 8: failed to assign [mem size 0x00c00000] Add back calling devm_request_pci_bus_resources() and adding the resources to pci_host_bridge.windows for BCMA bus probe. Link: https://lore.kernel.org/r/20210803215656.3803204-2-robh@kernel.org Fixes: 7ef1c871da16 ("PCI: iproc: Use pci_parse_request_of_pci_ranges()") Reported-by: Rafał Miłecki Tested-by: Rafał Miłecki Signed-off-by: Rob Herring Signed-off-by: Lorenzo Pieralisi Cc: Srinath Mannam Cc: Roman Bacik Cc: Bharat Gooty Cc: Abhishek Shah Cc: Jitendra Bhivare Cc: Ray Jui Cc: Florian Fainelli Cc: BCM Kernel Feedback Cc: Scott Branden Cc: Lorenzo Pieralisi Cc: "Krzysztof Wilczyński" Cc: Bjorn Helgaas Signed-off-by: Sasha Levin --- drivers/pci/controller/pcie-iproc-bcma.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) -- 2.30.2 diff --git a/drivers/pci/controller/pcie-iproc-bcma.c b/drivers/pci/controller/pcie-iproc-bcma.c index 56b8ee7bf330..f918c713afb0 100644 --- a/drivers/pci/controller/pcie-iproc-bcma.c +++ b/drivers/pci/controller/pcie-iproc-bcma.c @@ -35,7 +35,6 @@ static int iproc_pcie_bcma_probe(struct bcma_device *bdev) { struct device *dev = &bdev->dev; struct iproc_pcie *pcie; - LIST_HEAD(resources); struct pci_host_bridge *bridge; int ret; @@ -60,19 +59,16 @@ static int iproc_pcie_bcma_probe(struct bcma_device *bdev) pcie->mem.end = bdev->addr_s[0] + SZ_128M - 1; pcie->mem.name = "PCIe MEM space"; pcie->mem.flags = IORESOURCE_MEM; - pci_add_resource(&resources, &pcie->mem); + pci_add_resource(&bridge->windows, &pcie->mem); + ret = devm_request_pci_bus_resources(dev, &bridge->windows); + if (ret) + return ret; pcie->map_irq = iproc_pcie_bcma_map_irq; - ret = iproc_pcie_setup(pcie, &resources); - if (ret) { - dev_err(dev, "PCIe controller setup failed\n"); - pci_free_resource_list(&resources); - return ret; - } - bcma_set_drvdata(bdev, pcie); - return 0; + + return iproc_pcie_setup(pcie, &bridge->windows); } static void iproc_pcie_bcma_remove(struct bcma_device *bdev)