From patchwork Wed Nov 29 14:14:48 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: 10082357 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0A2226056F for ; Wed, 29 Nov 2017 14:17:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02BC5298F6 for ; Wed, 29 Nov 2017 14:17:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB449298F4; Wed, 29 Nov 2017 14:17:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 55EC4298F5 for ; Wed, 29 Nov 2017 14:17:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nBkgo6gw0DUMU9I8elAwx9AiwTkVAN7+LJ7cCnda0V0=; b=u554kTE50uUMrF hXwCPwfSrZicDl2RSBZG4nve7kxot3dsYAtTA092LuotVWDgxGtr0EfPwT935GaNCZ3eM2SPvXbvE oG5XcDq3DvZvOnZ9QzM/Cae2RZi+T0h/7MYl5YQzy+0kFs/QCgmM4oMxjACU+eAdJIOCUwWhYqxQH RRg3xkNpDi4Urvt8UQSrY9pPNiafQAHHWtPA8Oda01ivrdghe9oLDvYbyhkcnLKU/hrclLdk/ompC 8EJHZUswosqNaokAoBNCZDqI5BhVnibmHICMfRE2KRWhvIQmltCdI3KY1Wtfc6mOGGvRup+RtB+Oy AotL2a8HRjzyeJvvfVig==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eK3BD-00045g-T8; Wed, 29 Nov 2017 14:17:39 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eK3At-0003pF-Rg for linux-arm-kernel@bombadil.infradead.org; Wed, 29 Nov 2017 14:17:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=aI66rrZ068c5OyYTWKnHnBDXW5bUvlSv6M4KCwYw4SI=; b=IZ1ZHDSQKIYXbx0AdLVSa8P5U AmuCERCKQ+EF95CbdAb2YFvpFsdpsvjZFbbW76qKUhzuMVQX09GQz4B/74ggOFDXba88+AgBQCktZ jxBfIUIAaMJ2ZYiKbbur4/oxvuDcRTTGAM1eGewYkwvKcwZ6xryf2SP2aGIWt1iyzL4E1vPMDQl3Y 273U8wM2k1BBREBbc41zpESbrx10MbmTqH1xroXC6usVCIq4l3soHaUC6f2JPps+eaKz81/d7tWv7 28GR/FCQwjPdFulfIOT3z9RZR1xH4OxY+/CYVpqWwE9Wt/KFst2wcXYTPWlnj6GkrG0FQzNChofnq 3HW9O4W2g==; Received: from szxga05-in.huawei.com ([45.249.212.191]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eK3Ao-0000Av-Ny for linux-arm-kernel@lists.infradead.org; Wed, 29 Nov 2017 14:17:17 +0000 Received: from 172.30.72.60 (EHLO DGGEMS411-HUB.china.huawei.com) ([172.30.72.60]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DLR92804; Wed, 29 Nov 2017 22:16:39 +0800 (CST) Received: from S00345302A-PC.china.huawei.com (10.202.227.237) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.361.1; Wed, 29 Nov 2017 22:16:32 +0800 From: Shameer Kolothum To: , , , , Subject: [PATCH v10 2/3] iommu/dma: Add HW MSI(GICv3 ITS) address regions reservation Date: Wed, 29 Nov 2017 14:14:48 +0000 Message-ID: <20171129141449.120316-3-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20171129141449.120316-1-shameerali.kolothum.thodi@huawei.com> References: <20171129141449.120316-1-shameerali.kolothum.thodi@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.227.237] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090204.5A1EC148.0083, 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: 511c57110f51f5fa2ef97a3f28a66b1f X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, john.garry@huawei.com, linuxarm@huawei.com, xuwei5@hisilicon.com, linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org, Shameer Kolothum , guohanjun@huawei.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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 @@ 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 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;