From patchwork Tue Feb 13 15:20:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shameerali Kolothum Thodi X-Patchwork-Id: 128247 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp4361497ljc; Tue, 13 Feb 2018 07:22:17 -0800 (PST) X-Google-Smtp-Source: AH8x227FO8imPSfT50geTIeVYm4OHlFT7BqwJ4g7qGkk7okSjLSHrqcZX3vtFTNH4PaKbVhlKFKK X-Received: by 10.99.126.24 with SMTP id z24mr1232447pgc.343.1518535337713; Tue, 13 Feb 2018 07:22:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518535337; cv=none; d=google.com; s=arc-20160816; b=Fzw19lnbz0w3hgXe4DuH7A6FVJFQP4VKBQSONFlhk74r5INbxwWd1TzBiiOzZv3Km8 O51uXmbFV04Mh1XUpJYNYeooiIj1/bAGWGXebcnrUlsjPlQHDBDqo1DNa+hWN5GJsjuZ mtsM3WUbVb9bHTbsDuFzqJoBRPc2S2NefraDKqrgITKgMtN98/VUbPdNq3q+JYOMlnpP LdvNiI/zRsWuojwZWuLfAqohFzXHjcMUyJAd7d8UhHVs6mLPs7p61hLs9kPi0TzXZQW+ gNvavmrAv/3IRqfykV5rTZpcco7I2kSwnJBe1GILeVC9KZzUfzvEz42oPoaw97wbW4OQ aJKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=q5nj+/m50YTOu57r5Uvc8dHz1mmtD5r+Zh6SONR3hS4=; b=cKvgeWZEDjUgk1X632s6Kd0iiCTo3EnohljyjeuS61hnBCLbUFGCduCFklSqit8qyP mz4DLLW0dtZhvEFtzjkRP4R6QZTdKHTVhQQrO8wv+TaAw9nvfZ/+RUSSpOrw4uwK+GVf bCEObZHtZWb6msONOvSmWPjjbVFJqi2qKklx/jPZ4mD71xZ+KlaxpCt4Ty+gPgTAfar1 uuerxy7waqxiN0h7FvVFivw4/IlVAvE7wTQ7Vdr8BqOVmTMw+tJ4THCgyyOoDN4flyL4 QSq0DUwixE6byLRwzvqil6WrAZn7Mudjd3KEJ0LJtCJwlohUMNDBj0zhpZTtYEvhC4io ztfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-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 y12si5830679pgv.267.2018.02.13.07.22.17; Tue, 13 Feb 2018 07:22:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964937AbeBMPWQ (ORCPT + 8 others); Tue, 13 Feb 2018 10:22:16 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:46513 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S964869AbeBMPWQ (ORCPT ); Tue, 13 Feb 2018 10:22:16 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 72E4D8BBE670B; Tue, 13 Feb 2018 23:22:00 +0800 (CST) Received: from S00345302A-PC.china.huawei.com (10.202.227.237) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.361.1; Tue, 13 Feb 2018 23:21:54 +0800 From: Shameer Kolothum To: , , , CC: , , , , , , , , Shameer Kolothum Subject: [PATCH v13 2/2] iommu/dma: Add HW MSI(GICv3 ITS) address regions reservation Date: Tue, 13 Feb 2018 15:20:51 +0000 Message-ID: <20180213152051.10296-3-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20180213152051.10296-1-shameerali.kolothum.thodi@huawei.com> References: <20180213152051.10296-1-shameerali.kolothum.thodi@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.227.237] X-CFilter-Loop: Reflected Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Modified iommu_dma_get_resv_regions() to include GICv3 ITS region on ACPI based ARM platfiorms which may require HW MSI reservations. Signed-off-by: Shameer Kolothum Reviewed-by: Robin Murphy --- drivers/iommu/dma-iommu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 25914d3..f05f3cf 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -19,6 +19,7 @@ * along with this program. If not, see . */ +#include #include #include #include @@ -167,13 +168,18 @@ EXPORT_SYMBOL(iommu_put_dma_cookie); * * IOMMU drivers can use this to implement their .get_resv_regions callback * for general non-IOMMU-specific reservations. Currently, this covers host - * bridge windows for PCI devices. + * bridge windows for PCI devices and GICv3 ITS region reservation on ACPI + * based ARM platforms that may require HW MSI reservation. */ void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list) { struct pci_host_bridge *bridge; struct resource_entry *window; + if (!is_of_node(dev->iommu_fwspec->iommu_fwnode) && + iort_iommu_msi_get_resv_regions(dev, list) < 0) + return; + if (!dev_is_pci(dev)) return;