From patchwork Tue Aug 1 10:49:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shameerali Kolothum Thodi X-Patchwork-Id: 109135 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp1341382qge; Tue, 1 Aug 2017 03:54:34 -0700 (PDT) X-Received: by 10.101.69.142 with SMTP id o14mr18511578pgq.242.1501584874433; Tue, 01 Aug 2017 03:54:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501584874; cv=none; d=google.com; s=arc-20160816; b=JlF9uyM2zsPqBjvpCjRxTAzCZnA7Zb3fbVqsEpeviForGrXSz9ACWcbUN2ao4oN9n5 2W2qeSHCh9XVqM6j8tWUGfEMfHUwNzRH/A5OZ4nwq5X9IThM4TZUUozVoM1IEq/oVVWx MTxyC7eD/SVfyxbEdSTLNzl1pzAUvNM+brIlB2Cat869anvh/ISqToOdW/mm6CRganAz YDFqrrMqsAl0NcjPPXS3mKE9ixlyqsdWrDFn4sZEdhXrvTEeWuJw7B7wnv/PfOhFFbfH UhsBKKKimUKPfSscGmyz6zAb+gTls3e36WLvKd+x5uYRdf8aPnCYbfoVmxyXmcJXuoFb GqFA== 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=KFoZB0Nspn3c5Q5ff4VBn83o2bG1EY8By3iXN/FgypE=; b=JdVuxRApk6UWIfAVPco4up7ufhUtN6ouGXZcRolXtpV3TputFbN1yzjSl9NMLOyJQv uEyus0BAL1nzuoZBpL5czwM3M3D4Nxqvq2O0z99ZT3ZHVQWFcv6n5+JPZ+N2qRY293mN ewzeIigahYEjpuIOYutis5RWWY2PP7zYQBLgTpNK/DE8JZtIVAQWIW85j1H81dNPcO9e t7PlqStgTvpAjamLSVifaV/D+G+PJGmj7slEJ/ilPNjo9YU4NN5ozbN/EhjoXYqoaqiD iuQmStH7+GldTbCuFpBVdqfhaIxTgzJNFVyTOwqGnZYL7NPN7BA3F70d+o7WYXHrT0d5 YvCw== 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 i26si12961076pfi.264.2017.08.01.03.54.34; Tue, 01 Aug 2017 03:54:34 -0700 (PDT) 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 S1751008AbdHAKwz (ORCPT + 7 others); Tue, 1 Aug 2017 06:52:55 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:10809 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751535AbdHAKvu (ORCPT ); Tue, 1 Aug 2017 06:51:50 -0400 Received: from 172.30.72.56 (EHLO dggeml406-hub.china.huawei.com) ([172.30.72.56]) by dggrg02-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id ASO11134; Tue, 01 Aug 2017 18:51:49 +0800 (CST) Received: from S00345302A-PC.china.huawei.com (10.203.177.212) by dggeml406-hub.china.huawei.com (10.3.17.50) with Microsoft SMTP Server id 14.3.301.0; Tue, 1 Aug 2017 18:51:40 +0800 From: Shameer Kolothum To: , , , , , CC: , , , , , , , , , Shameer Kolothum Subject: [PATCH v5 2/2] iommu/dma: Add HW MSI address regions reservation Date: Tue, 1 Aug 2017 11:49:13 +0100 Message-ID: <20170801104913.71912-3-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20170801104913.71912-1-shameerali.kolothum.thodi@huawei.com> References: <20170801104913.71912-1-shameerali.kolothum.thodi@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.203.177.212] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090202.59805D45.0156, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 1fcf839a1d2ac9029d2e0539db5ec465 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 HW MSI (ARM GICv3 ITS MSI) specific reservations if available. Suggested-by: Robin Murphy Signed-off-by: Shameer Kolothum --- drivers/iommu/dma-iommu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 1.9.1 -- 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 9d1cebe..44eca1e 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 @@ void iommu_put_dma_cookie(struct iommu_domain *domain) * * 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 HW MSI(ARM GICv3 ITS MSI) region + * reservations if available. */ 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_its_get_resv_regions(dev, list) < 0) + return; + if (!dev_is_pci(dev)) return;