From patchwork Sun Feb 14 22:05:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jayachandran C." X-Patchwork-Id: 8303491 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 7C6FD9F372 for ; Sun, 14 Feb 2016 22:08:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 93CAF2051D for ; Sun, 14 Feb 2016 22:08:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80CF820498 for ; Sun, 14 Feb 2016 22:08:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751509AbcBNWIo (ORCPT ); Sun, 14 Feb 2016 17:08:44 -0500 Received: from 5520-maca-inet1-outside.broadcom.com ([216.31.211.11]:44178 "EHLO mail-irv-18.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751476AbcBNWIo (ORCPT ); Sun, 14 Feb 2016 17:08:44 -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 9B55182025; Sun, 14 Feb 2016 14:08:43 -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 A43BB40FE5; Sun, 14 Feb 2016 14:08:35 -0800 (PST) From: Jayachandran C To: Bjorn Helgaas , linux-pci@vger.kernel.org Cc: Jayachandran C Subject: [RFC PATCH 1/2] PCI: Add PCI device flag PCI_DEV_FLAGS_BRIDGE_SKIP_ALIAS Date: Mon, 15 Feb 2016 03:35:00 +0530 Message-Id: <1455487501-28630-1-git-send-email-jchandra@broadcom.com> X-Mailer: git-send-email 1.9.1 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=ham 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 Add a new flag PCI_DEV_FLAGS_BRIDGE_SKIP_ALIAS to indicate bridges that should not be considered during DMA alias search. This is to support hardware (in this case Broadcom Vulcan PCIe subsystem) that has internal bridges which have either missing or wrong PCIe capabilities. Update the function pci_for_each_dma_alias() to skip bridges with this flag set. Signed-off-by: Jayachandran C --- This patch is an RFC, if there is a better way to do this, please let me know. Thanks, JC. drivers/pci/search.c | 2 ++ include/linux/pci.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/pci/search.c b/drivers/pci/search.c index a20ce7d..e5296aa 100644 --- a/drivers/pci/search.c +++ b/drivers/pci/search.c @@ -55,6 +55,8 @@ int pci_for_each_dma_alias(struct pci_dev *pdev, continue; tmp = bus->self; + if (tmp->dev_flags & PCI_DEV_FLAGS_BRIDGE_SKIP_ALIAS) + continue; /* * PCIe-to-PCI/X bridges alias transactions from downstream diff --git a/include/linux/pci.h b/include/linux/pci.h index 27df4a6..b4d8215 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -182,6 +182,8 @@ enum pci_dev_flags { PCI_DEV_FLAGS_NO_PM_RESET = (__force pci_dev_flags_t) (1 << 7), /* Get VPD from function 0 VPD */ PCI_DEV_FLAGS_VPD_REF_F0 = (__force pci_dev_flags_t) (1 << 8), + /* Bridge should be ignored for alias search */ + PCI_DEV_FLAGS_BRIDGE_SKIP_ALIAS = (__force pci_dev_flags_t) (1 << 9), }; enum pci_irq_reroute_variant {