From patchwork Sat Jan 30 11:06:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Lawrynowicz X-Patchwork-Id: 8170691 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D81BCBEEE5 for ; Sat, 30 Jan 2016 11:07:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1945120395 for ; Sat, 30 Jan 2016 11:07:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 33F0D2039D for ; Sat, 30 Jan 2016 11:07:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751945AbcA3LHc (ORCPT ); Sat, 30 Jan 2016 06:07:32 -0500 Received: from mga02.intel.com ([134.134.136.20]:16015 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753918AbcA3LHX (ORCPT ); Sat, 30 Jan 2016 06:07:23 -0500 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP; 30 Jan 2016 03:07:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,369,1449561600"; d="scan'208";a="39050484" Received: from gklab-119a-230.igk.intel.com ([10.91.119.230]) by fmsmga004.fm.intel.com with ESMTP; 30 Jan 2016 03:07:21 -0800 From: Jacek Lawrynowicz To: linux-pci@vger.kernel.org Cc: bhelgaas@google.com, alex.williamson@redhat.com, dwmw2@infradead.org, jroedel@suse.de, jacek.lawrynowicz@intel.com Subject: [PATCH v3 2/2] pci: Add DMA alias quirk for mic_x200_dma Date: Sat, 30 Jan 2016 12:06:52 +0100 Message-Id: <1454152012-46337-3-git-send-email-jacek.lawrynowicz@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1454152012-46337-1-git-send-email-jacek.lawrynowicz@intel.com> References: <1453926324.18221.2.camel@redhat.com> <1454152012-46337-1-git-send-email-jacek.lawrynowicz@intel.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 MIC x200 NTB forwards PCIe traffic using multiple alien RID. They have to be added as aliases to the DMA device in order to allow buffer access when IOMMU is enabled. Signed-off-by: Jacek Lawrynowicz Acked-by: David Woodhouse --- drivers/pci/quirks.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 27c298c..96ab9dc 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -3702,6 +3702,19 @@ DECLARE_PCI_FIXUP_HEADER(0x1283, 0x8892, quirk_use_pcie_bridge_dma_alias); DECLARE_PCI_FIXUP_HEADER(0x8086, 0x244e, quirk_use_pcie_bridge_dma_alias); /* + * MIC x200 NTB forwards PCIe traffic using multiple alien RID. They have to + * be added as aliases to the DMA device in order to allow buffer access + * when IOMMU is enabled. + */ +static void quirk_mic_x200_dma_alias(struct pci_dev *pdev) +{ + pci_add_dma_alias(pdev, PCI_DEVFN(0x10, 0x0)); + pci_add_dma_alias(pdev, PCI_DEVFN(0x11, 0x0)); + pci_add_dma_alias(pdev, PCI_DEVFN(0x12, 0x3)); +} +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2264, quirk_mic_x200_dma_alias); + +/* * Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero) * class code. Fix it. */