From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751672AbdHaIaZ (ORCPT ); Thu, 31 Aug 2017 04:30:25 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5498 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751341AbdHaI3U (ORCPT ); Thu, 31 Aug 2017 04:29:20 -0400 From: Yisheng Xie To: CC: , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 2/6] iommu/of: Add stall and pasid properties to iommu_fwspec Date: Thu, 31 Aug 2017 16:20:38 +0800 Message-ID: <1504167642-14922-3-git-send-email-xieyisheng1@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1504167642-14922-1-git-send-email-xieyisheng1@huawei.com> References: <1504167642-14922-1-git-send-email-xieyisheng1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A010206.59A7C8DB.004E,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: dbe049d9f6b340647d01f6f9f738850d Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jean-Philippe Brucker Add stall and pasid properties to iommu_fwspec. Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/of_iommu.c | 11 +++++++++++ include/linux/iommu.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index 84fa6b4..b926276 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c @@ -209,6 +209,16 @@ static bool of_pci_rc_supports_ats(struct device_node *rc_node) break; } + if (dev->iommu_fwspec) { + const __be32 *prop; + + if (of_get_property(np, "dma-can-stall", NULL)) + dev->iommu_fwspec->can_stall = true; + + prop = of_get_property(np, "pasid-bits", NULL); + if (prop) + dev->iommu_fwspec->num_pasid_bits = be32_to_cpu(*prop); + } + return ops; } diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 1c5a216..5f580de 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -387,6 +387,8 @@ struct iommu_fwspec { void *iommu_priv; u32 flags; unsigned int num_ids; + unsigned long num_pasid_bits; + bool can_stall; u32 ids[1]; }; -- 1.7.12.4