diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index f7787e757244d474875260af17f063c655a4d351..2a34fa23978be372d3fa57071c6e9998e61b3771 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c @@ -187,6 +187,19 @@ const struct iommu_ops *of_iommu_configure(struct device *dev, if (err) break; } + + fwspec = dev->iommu_fwspec; + if (!err && fwspec) { + const __be32 *prop; + + if (of_get_property(master_np, "dma-can-stall", NULL)) + fwspec->can_stall = true; + + prop = of_get_property(master_np, + "pasid-num-bits", NULL); + if (prop) + fwspec->num_pasid_bits = be32_to_cpu(*prop); + } } /* diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 6643db40c1ada62eee221032f984791a81d31a6a..e63e881d7ea95e39c67bb4738bd61c74f8a0cc27 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -650,6 +650,8 @@ struct iommu_fwspec { struct fwnode_handle *iommu_fwnode; void *iommu_priv; unsigned int num_ids; + unsigned int num_pasid_bits; + bool can_stall; u32 ids[1]; };