File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -984,7 +984,7 @@ static int fsl_pamu_add_device(struct device *dev)
984
984
struct iommu_group * group = ERR_PTR (- ENODEV );
985
985
struct pci_dev * pdev ;
986
986
const u32 * prop ;
987
- int ret , len ;
987
+ int ret = 0 , len ;
988
988
989
989
/*
990
990
* For platform devices we allocate a separate group for
@@ -1007,7 +1007,13 @@ static int fsl_pamu_add_device(struct device *dev)
1007
1007
if (IS_ERR (group ))
1008
1008
return PTR_ERR (group );
1009
1009
1010
- ret = iommu_group_add_device (group , dev );
1010
+ /*
1011
+ * Check if device has already been added to an iommu group.
1012
+ * Group could have already been created for a PCI device in
1013
+ * the iommu_group_get_for_dev path.
1014
+ */
1015
+ if (!dev -> iommu_group )
1016
+ ret = iommu_group_add_device (group , dev );
1011
1017
1012
1018
iommu_group_put (group );
1013
1019
return ret ;
You can’t perform that action at this time.
0 commit comments