From patchwork Mon Feb 15 09:26:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jayachandran C." X-Patchwork-Id: 8312061 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3AFC99F399 for ; Mon, 15 Feb 2016 09:30:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C0F25204EB for ; Mon, 15 Feb 2016 09:30:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE81720515 for ; Mon, 15 Feb 2016 09:30:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752686AbcBOJaj (ORCPT ); Mon, 15 Feb 2016 04:30:39 -0500 Received: from 5520-maca-inet1-outside.broadcom.com ([216.31.211.11]:39976 "EHLO mail-irv-18.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752678AbcBOJah (ORCPT ); Mon, 15 Feb 2016 04:30:37 -0500 Received: from mail-irva-13.broadcom.com (mail-irva-13.broadcom.com [10.11.16.103]) by mail-irv-18.broadcom.com (Postfix) with ESMTP id 558228203D; Mon, 15 Feb 2016 01:30:36 -0800 (PST) Received: from lc-blr-136.ban.broadcom.com (unknown [10.131.60.136]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 60E9B40FE6; Mon, 15 Feb 2016 01:30:28 -0800 (PST) From: Jayachandran C To: Bjorn Helgaas , linux-pci@vger.kernel.org Cc: Jayachandran C Subject: [RFC PATCH 2/2] PCI: Handle Broadcom Vulcan quirks Date: Mon, 15 Feb 2016 14:56:38 +0530 Message-Id: <1455528398-29311-1-git-send-email-jchandra@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455487501-28630-2-git-send-email-jchandra@broadcom.com> References: <1455487501-28630-2-git-send-email-jchandra@broadcom.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Handle two quirks of the PCI controller on Broadcom's Vulcan processor. - Mark internal bridges so that they are skipped during DMA alias search. - Skip BAR0 resource assignment for internal bridges. The BARs of internal bridges should not be assigned from the mem resource range. Signed-off-by: Jayachandran C --- Resending, last patch was missing the Signed-off-by, also fixed the comment a bit. JC. drivers/pci/quirks.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 0575a1e..afc186a 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -3705,6 +3705,27 @@ DECLARE_PCI_FIXUP_HEADER(0x1283, 0x8892, quirk_use_pcie_bridge_dma_alias); DECLARE_PCI_FIXUP_HEADER(0x8086, 0x244e, quirk_use_pcie_bridge_dma_alias); /* + * Two levels of bridges in Broadcom Vulcan are not real PCI or PCIe bridges. + * These are internal bridges and should not be used for dma alias + * calculations. Additionally, the BAR0 of thes bridges should not be + * assigned with a mem resource from linux + */ +static void quirk_bridge_brcm_vulcan_internal(struct pci_dev *pdev) +{ + struct resource *r = &pdev->resource[0]; + + /* skip from alias search */ + pdev->dev_flags |= PCI_DEV_FLAGS_BRIDGE_SKIP_ALIAS; + + /* clear BAR0, should not be used from Linux */ + memset(r, 0, sizeof(*r)); +} +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9000, + quirk_bridge_brcm_vulcan_internal); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9039, + quirk_bridge_brcm_vulcan_internal); + +/* * Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero) * class code. Fix it. */