Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1638732ybv; Fri, 21 Feb 2020 00:47:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzccv8BOgzmDLgE6jynuGIE/mBI2xZMhOE8Nv0ux8O29hgF0zqVE6zAobwoXYa+wQqdXwSW X-Received: by 2002:a9d:6e02:: with SMTP id e2mr28489651otr.194.1582274862606; Fri, 21 Feb 2020 00:47:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582274862; cv=none; d=google.com; s=arc-20160816; b=rSFX8qAkUTvmdMGKWn2Lxb+JBl/9lTmm0n+PZHch9L7n1Ud5NqkIJf5pPLDJ/IbJ+8 OYfKLsi6tvAcMuuRGP+h0eLynuMNf++9j4PiMinCuaMEvmnk51hepZCrUZzsUCelqFGj gT9PRMa/xUL2OVIv4lZHKQjcw/jfN6gqMLsrdeMxc3V0f/B7HodBKhoc0SboyBsC+IfA MizCbT5Jy8E3s9KT9pf0rBVQfL8wVeankP09yq6dbZJfGYhLKEssUQZhT0bLq/ENjImU CZoFYik22h2QCLO+xZPpnnQ/kgl7EhnBv1qCL5Dc+G+mwDqePrTwWeZAi8uiah0QSDeZ JXbw== 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=l49TIf7P58h7YUXARUXJ71QJBdHyVNTsuJDx2dEAwxI=; b=lJj2Yjdnad0KLHCH3FjuxNEUwwD4CEHPU9uqZIhMw3NS2QIJWQYEcQuICjcQeX26YI 9b2npf+1ktmMsdTzX8tH/2g4/H6K9lcPiH8zqxnPnbARpvYhShWL3GXJTN/KwW9V/wPi veJENVfUX6ERCUjdu8qrdrhtp6z3+7ZDy+rMjPxIIqz+LXbOEQ1AXZu0lHEEnsgORJoV bJu6EGkCc4mOsmkqLje1i7Rgb/17ChFirBQn1C6DB+wJEnzZVRcqJ44UwHNEd3dK6sGO GINwQWrwLYSJY0mRow2J96em8M/N7wrfNZbuEquS7HGcqltF02besvEvBUHiqZmETt5f k2EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=InbvHrwT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i194si512370oib.73.2020.02.21.00.47.30; Fri, 21 Feb 2020 00:47:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=InbvHrwT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732664AbgBUIrA (ORCPT + 99 others); Fri, 21 Feb 2020 03:47:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:45654 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729237AbgBUHtQ (ORCPT ); Fri, 21 Feb 2020 02:49:16 -0500 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 C5396207FD; Fri, 21 Feb 2020 07:49:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582271355; bh=Ximt0gbK7xTVxkrTv+3W+qrzUdNxPeqPaVwbPCy6Kys=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=InbvHrwTxK2PpgGvd7Zp04bnIIfoVgvcZsLELPYg39QloQy5uQdjnQM6U41QexiU/ 7dwKk0MdGSAwEr5Dmg+bXkPAipdBqvxG+vs25U6UL/3wTEndsw2+AVYccDVh7qrusB h60elWvaPm/PfwEqjiOEMFgx/3/8o2ZvPq14O8yU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wei Liu , Bjorn Helgaas , Sasha Levin Subject: [PATCH 5.5 134/399] PCI: iproc: Apply quirk_paxc_bridge() for module as well as built-in Date: Fri, 21 Feb 2020 08:37:39 +0100 Message-Id: <20200221072415.487294106@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072402.315346745@linuxfoundation.org> References: <20200221072402.315346745@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: Wei Liu [ Upstream commit 574f29036fce385e28617547955dd6911d375025 ] Previously quirk_paxc_bridge() was applied when the iproc driver was built-in, but not when it was compiled as a module. This happened because it was under #ifdef CONFIG_PCIE_IPROC_PLATFORM: PCIE_IPROC_PLATFORM=y causes CONFIG_PCIE_IPROC_PLATFORM to be defined, but PCIE_IPROC_PLATFORM=m causes CONFIG_PCIE_IPROC_PLATFORM_MODULE to be defined. Move quirk_paxc_bridge() to pcie-iproc.c and drop the #ifdef so the quirk is always applied, whether iproc is built-in or a module. [bhelgaas: commit log, move to pcie-iproc.c, not pcie-iproc-platform.c] Link: https://lore.kernel.org/r/20191211174511.89713-1-wei.liu@kernel.org Signed-off-by: Wei Liu Signed-off-by: Bjorn Helgaas Signed-off-by: Sasha Levin --- drivers/pci/controller/pcie-iproc.c | 24 ++++++++++++++++++++++++ drivers/pci/quirks.c | 26 -------------------------- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c index 0a468c73bae38..8c7f875acf7fa 100644 --- a/drivers/pci/controller/pcie-iproc.c +++ b/drivers/pci/controller/pcie-iproc.c @@ -1588,6 +1588,30 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd802, DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd804, quirk_paxc_disable_msi_parsing); +static void quirk_paxc_bridge(struct pci_dev *pdev) +{ + /* + * The PCI config space is shared with the PAXC root port and the first + * Ethernet device. So, we need to workaround this by telling the PCI + * code that the bridge is not an Ethernet device. + */ + if (pdev->hdr_type == PCI_HEADER_TYPE_BRIDGE) + pdev->class = PCI_CLASS_BRIDGE_PCI << 8; + + /* + * MPSS is not being set properly (as it is currently 0). This is + * because that area of the PCI config space is hard coded to zero, and + * is not modifiable by firmware. Set this to 2 (e.g., 512 byte MPS) + * so that the MPS can be set to the real max value. + */ + pdev->pcie_mpss = 2; +} +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16cd, quirk_paxc_bridge); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd750, quirk_paxc_bridge); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd802, quirk_paxc_bridge); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd804, quirk_paxc_bridge); + MODULE_AUTHOR("Ray Jui "); MODULE_DESCRIPTION("Broadcom iPROC PCIe common driver"); MODULE_LICENSE("GPL v2"); diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index fbeb9f73ef280..5cd6a77ddefff 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2381,32 +2381,6 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5719, quirk_brcm_5719_limit_mrrs); -#ifdef CONFIG_PCIE_IPROC_PLATFORM -static void quirk_paxc_bridge(struct pci_dev *pdev) -{ - /* - * The PCI config space is shared with the PAXC root port and the first - * Ethernet device. So, we need to workaround this by telling the PCI - * code that the bridge is not an Ethernet device. - */ - if (pdev->hdr_type == PCI_HEADER_TYPE_BRIDGE) - pdev->class = PCI_CLASS_BRIDGE_PCI << 8; - - /* - * MPSS is not being set properly (as it is currently 0). This is - * because that area of the PCI config space is hard coded to zero, and - * is not modifiable by firmware. Set this to 2 (e.g., 512 byte MPS) - * so that the MPS can be set to the real max value. - */ - pdev->pcie_mpss = 2; -} -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16cd, quirk_paxc_bridge); -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge); -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd750, quirk_paxc_bridge); -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd802, quirk_paxc_bridge); -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd804, quirk_paxc_bridge); -#endif - /* * Originally in EDAC sources for i82875P: Intel tells BIOS developers to * hide device 6 which configures the overflow device access containing the -- 2.20.1