From patchwork Tue Jan 26 17:24:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Lawrynowicz X-Patchwork-Id: 8125361 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 3D261BEEE5 for ; Tue, 26 Jan 2016 17:24:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 83E392028D for ; Tue, 26 Jan 2016 17:24:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B382F20279 for ; Tue, 26 Jan 2016 17:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966836AbcAZRYg (ORCPT ); Tue, 26 Jan 2016 12:24:36 -0500 Received: from mga01.intel.com ([192.55.52.88]:4441 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966811AbcAZRYd (ORCPT ); Tue, 26 Jan 2016 12:24:33 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 26 Jan 2016 09:24:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,350,1449561600"; d="scan'208";a="889628043" Received: from gklab-119a-230.igk.intel.com ([10.91.119.230]) by fmsmga001.fm.intel.com with ESMTP; 26 Jan 2016 09:24:31 -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 v2 2/2] pci: Add DMA alias quirk for mic_x200_dma Date: Tue, 26 Jan 2016 18:24:27 +0100 Message-Id: <1453829067-128959-1-git-send-email-jacek.lawrynowicz@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <36D38C1F74839847A52A484C31F3E51A6213B660@irsmsx105.ger.corp.intel.com> References: <36D38C1F74839847A52A484C31F3E51A6213B660@irsmsx105.ger.corp.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 83c3da1..350eac3 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_enable_dma_alias(pdev, PCI_DEVFN(0x10, 0x0)); + pci_enable_dma_alias(pdev, PCI_DEVFN(0x11, 0x0)); + pci_enable_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. */