[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1504167642-14922-3-git-send-email-xieyisheng1@huawei.com>
Date: Thu, 31 Aug 2017 16:20:38 +0800
From: Yisheng Xie <xieyisheng1@...wei.com>
To: <jean-philippe.brucker@....com>
CC: <joro@...tes.org>, <robh+dt@...nel.org>, <mark.rutland@....com>,
<lorenzo.pieralisi@....com>, <hanjun.guo@...aro.org>,
<sudeep.holla@....com>, <rjw@...ysocki.net>, <lenb@...nel.org>,
<will.deacon@....com>, <robin.murphy@....com>,
<robert.moore@...el.com>, <lv.zheng@...el.com>,
<iommu@...ts.linux-foundation.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-acpi@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <devel@...ica.org>,
<liubo95@...wei.com>, <chenjiankang1@...wei.com>,
<xieyisheng@...wei.com>
Subject: [RFC PATCH 2/6] iommu/of: Add stall and pasid properties to iommu_fwspec
From: Jean-Philippe Brucker <jean-philippe.brucker@....com>
Add stall and pasid properties to iommu_fwspec.
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@....com>
---
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
Powered by blists - more mailing lists