From patchwork Tue Jul 25 11:17:32 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: 108636 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp446173qge; Tue, 25 Jul 2017 04:19:50 -0700 (PDT) X-Received: by 10.84.179.165 with SMTP id b34mr12386734plc.455.1500981590751; Tue, 25 Jul 2017 04:19:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500981590; cv=none; d=google.com; s=arc-20160816; b=UyrvM4XkBGWcr0PDiz1vvgTYOKrdzo/TQ467AlQ5VXODIZNzYBlz6A0LrIakI0o8Y6 5HYVRuvrOY/5ipCSSdoeU2WH5RJxudiNxI0ShXXh1xCepptxmvMurUnEl0zcHipkcoOv NHH3Ga/hef9U5BAFB6v/YT+IeaIKQhv+ixT/O6SFyctmz+TlsaRC5T+icFeTd1eNvNdN +fCg7eJpdTYYeNCwQL943llkLfoFlYwVbfdTEBYS94ba2pDa7mKemcTN1I7G68cNQlva bh2I7mA5EzSJVDh6QJyK6i3lwDHDQtqBYJBRum6cHWhIqvI6NI9uJ2wVNoLOhLUc+gJl +6Sw== 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=4sYYxGL+itDYhMVRkyJru7eQhNz0eogMO+8bukCRCjA=; b=uWJR4tMOIqr3SvICA2BOcuLUQQZLvpO49vPCha0csgQjTRWAsIfcdjTyGbMU5HIvBO T9YExAxXGhaIWSYpWQigVhSwyJcfvumWuZo8cMa11DZjgU8dWaMtmpD3lcvL0bP9HqNY Kaok6BbZTab0nTRpStkArVBn5smws4Yk2ePzmgwCA67zAU3+aduq94cot9KzB8PdDUXy 54Jw47UelG/D70auwZhbkjgIj6PIBfuLglZyPvW8T2BU0iDHIz2do+CvSMwHEjqHytwm QwQiRYkS7SWk7xxjwsaBJrSjVhrANLTKY7jGVwfonTwjU8Lo8vlA088KKV9OZVeKshAC SwpQ== 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 h11si8572998plk.114.2017.07.25.04.19.50; Tue, 25 Jul 2017 04:19:50 -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 S1751527AbdGYLTt (ORCPT + 7 others); Tue, 25 Jul 2017 07:19:49 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:9413 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750839AbdGYLTs (ORCPT ); Tue, 25 Jul 2017 07:19:48 -0400 Received: from 172.30.72.57 (EHLO dggeml406-hub.china.huawei.com) ([172.30.72.57]) by dggrg03-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id ARZ13630; Tue, 25 Jul 2017 19:19:42 +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, 25 Jul 2017 19:19:35 +0800 From: Shameer Kolothum To: , , , , , CC: , , , , , , , , , Shameer Kolothum Subject: [PATCH v4 2/2] iommu/dma: Add HW MSI address regions reservation for IOMMU drivers Date: Tue, 25 Jul 2017 12:17:32 +0100 Message-ID: <20170725111732.41792-3-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20170725111732.41792-1-shameerali.kolothum.thodi@huawei.com> References: <20170725111732.41792-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.0A0B0207.5977294F.0032, 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: 61d326fb0f2c7f44d710b46e421f90d2 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..3b6fde7 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 avialable. */ 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;