Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1615372ybv; Fri, 21 Feb 2020 00:20:05 -0800 (PST) X-Google-Smtp-Source: APXvYqyv5jpeEgzu0laYlmqjb3UIP6+AlwpgAtJRKILfaJ6fCBcq4yVqqBPjChkr0oJ+2tgjl0/1 X-Received: by 2002:a9d:5a09:: with SMTP id v9mr25961376oth.214.1582273205782; Fri, 21 Feb 2020 00:20:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582273205; cv=none; d=google.com; s=arc-20160816; b=p2w8SszX0Det+VIIPvDYWfv+kK7I144mlbyoewcHAadhvaxqi7i7MFnyUArYVycbLI Jjuu8q+Yrp1FFP21SfF/6EqNHU+MkD8+9MwGm2FVziDJRs/dGOvBP25ugTI8viQOWLGO GKUnHkEeYzFVMuMJY/K4PbPGRCpE0P5+Rm6YQ188XpEQHQiCOqV3HSlp4z4mykh/53rN St+z79E558Enn/V01SSaHhcfw3ltnMqvhTHE+/lquI093tYxq0vRAK3gjsOkcU8PSl3+ UICbFtRdObSRagGK8NsBtaDJAYKZJhx5NA10BzbUTa6fVU+TysarAA5BwLVzJQUAEbMs JBjg== 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=4arGibZ+7JPjdhLHOWurOd+G7PkuEvzU2Lij+VUFq8E=; b=upkwtNrDgz2oSjOGxn/8ieAY+ojayHHLmT+DGrR6YqBUYI01bDWqdjhDIDaFrIZxnL IEjFwm3tW69ebQaQYNjxOoqm7sOAWH3eDMnIg4i07z7u96sQQDtOW1yKKH9EitedtRrq UlFmxK7oG4nr819mM8yvGSPNyNCQUq1tNy9ufgKlq5VLzdF5F6ZuN0tRgRIOijYiNKCR eTbc3pTKqIX7qsLIsYtSkAeQzLveczLkuxMlCWIOnMYPaTAKvCLHxPXBFheqpfK3eERB qJI76m9Z6IbpE36z7OpMHxSgYzZ5Fb/yb5+WCxyWCvg33/VgVS71W6XEomFQCfjP/28y 2EUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HcM0tDXc; 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 w24si401101oic.260.2020.02.21.00.19.54; Fri, 21 Feb 2020 00:20:05 -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=HcM0tDXc; 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 S2387976AbgBUITO (ORCPT + 99 others); Fri, 21 Feb 2020 03:19:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:57446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387962AbgBUITL (ORCPT ); Fri, 21 Feb 2020 03:19:11 -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 AD0FC24689; Fri, 21 Feb 2020 08:19:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582273150; bh=eIfNHxaTaF6oemS/jKYLYEWreka0CQ5m1S3ahstw9uc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HcM0tDXcYOOe5dIoT1tBnJUM4TWki5GCwC7AKYiF23xYTd83Z5cZXJITjlHEmuYGl cvC6F+XozD1iHYlXp2h4GLMEAQBltHIuVkjhDykhts6OyUw2pz0q7YY4UvdC6AdbyB gFGB3pI5VjGu5+2EKdOWxBxG7juExQ1diop0aLpM= 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 4.19 064/191] PCI: iproc: Apply quirk_paxc_bridge() for module as well as built-in Date: Fri, 21 Feb 2020 08:40:37 +0100 Message-Id: <20200221072259.070206163@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072250.732482588@linuxfoundation.org> References: <20200221072250.732482588@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 9d5cbc75d5ae0..ec86414216f97 100644 --- a/drivers/pci/controller/pcie-iproc.c +++ b/drivers/pci/controller/pcie-iproc.c @@ -1526,6 +1526,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 5b4c36ab15962..84f10cda539ea 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2358,32 +2358,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