Displaying 5 results from an estimated 5 matches for "idx_grp".
2020 Apr 07
0
[RFC PATCH 17/34] iommu/arm-smmu: Store device instead of group in arm_smmu_s2cr
...gt;stream_map_mutex);
@@ -1495,11 +1495,15 @@ static struct iommu_group *arm_smmu_device_group(struct device *dev)
int i, idx;
for_each_cfg_sme(cfg, fwspec, i, idx) {
- if (group && smmu->s2crs[idx].group &&
- group != smmu->s2crs[idx].group)
+ struct iommu_group *idx_grp = NULL;
+
+ if (smmu->s2crs[idx].dev)
+ idx_grp = smmu->s2crs[idx].dev->iommu_group;
+
+ if (group && idx_grp && group != idx_grp)
return ERR_PTR(-EINVAL);
- group = smmu->s2crs[idx].group;
+ group = idx_grp;
}
if (group)
--
2.17.1
2020 Apr 08
2
[RFC PATCH 17/34] iommu/arm-smmu: Store device instead of group in arm_smmu_s2cr
...+1495,15 @@ static struct iommu_group *arm_smmu_device_group(struct device *dev)
> int i, idx;
>
> for_each_cfg_sme(cfg, fwspec, i, idx) {
> - if (group && smmu->s2crs[idx].group &&
> - group != smmu->s2crs[idx].group)
> + struct iommu_group *idx_grp = NULL;
> +
> + if (smmu->s2crs[idx].dev)
> + idx_grp = smmu->s2crs[idx].dev->iommu_group;
For a hot-pluggable bus where logical devices may share Stream IDs (like
fsl-mc), this could happen:
create device A
iommu_probe_device(A)
iommu_device_group(A) -> alloc...
2020 Apr 08
2
[RFC PATCH 17/34] iommu/arm-smmu: Store device instead of group in arm_smmu_s2cr
...+1495,15 @@ static struct iommu_group *arm_smmu_device_group(struct device *dev)
> int i, idx;
>
> for_each_cfg_sme(cfg, fwspec, i, idx) {
> - if (group && smmu->s2crs[idx].group &&
> - group != smmu->s2crs[idx].group)
> + struct iommu_group *idx_grp = NULL;
> +
> + if (smmu->s2crs[idx].dev)
> + idx_grp = smmu->s2crs[idx].dev->iommu_group;
For a hot-pluggable bus where logical devices may share Stream IDs (like
fsl-mc), this could happen:
create device A
iommu_probe_device(A)
iommu_device_group(A) -> alloc...
2020 Apr 07
41
[RFC PATCH 00/34] iommu: Move iommu_group setup to IOMMU core code
Hi,
here is a patch-set to remove all calls of iommu_group_get_for_dev() from
the IOMMU drivers and move the per-device group setup and default domain
allocation into the IOMMU core code.
This eliminates some ugly back and forth between IOMMU core code and the
IOMMU drivers, where the driver called iommu_group_get_for_dev() which itself
called back into the driver.
The patch-set started as a
2020 Apr 07
41
[RFC PATCH 00/34] iommu: Move iommu_group setup to IOMMU core code
Hi,
here is a patch-set to remove all calls of iommu_group_get_for_dev() from
the IOMMU drivers and move the per-device group setup and default domain
allocation into the IOMMU core code.
This eliminates some ugly back and forth between IOMMU core code and the
IOMMU drivers, where the driver called iommu_group_get_for_dev() which itself
called back into the driver.
The patch-set started as a