Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4cffd968 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Revert "arm64: dma-mapping: Attach IOMMUs as groups""

parents 62fc2827 805f58d1
Loading
Loading
Loading
Loading
+2 −16
Original line number Original line Diff line number Diff line
@@ -2115,19 +2115,12 @@ int arm_iommu_attach_device(struct device *dev,
{
{
	int err;
	int err;
	int s1_bypass = 0, is_fast = 0;
	int s1_bypass = 0, is_fast = 0;
	struct iommu_group *group;


	iommu_domain_get_attr(mapping->domain, DOMAIN_ATTR_FAST, &is_fast);
	iommu_domain_get_attr(mapping->domain, DOMAIN_ATTR_FAST, &is_fast);
	if (is_fast)
	if (is_fast)
		return fast_smmu_attach_device(dev, mapping);
		return fast_smmu_attach_device(dev, mapping);


	group = iommu_group_get(dev);
	err = iommu_attach_device(mapping->domain, dev);
	if (!group) {
		dev_err(dev, "Couldn't get group\n");
		return -ENODEV;
	}

	err = iommu_attach_group(mapping->domain, group);
	if (err)
	if (err)
		return err;
		return err;


@@ -2155,7 +2148,6 @@ void arm_iommu_detach_device(struct device *dev)
{
{
	struct dma_iommu_mapping *mapping;
	struct dma_iommu_mapping *mapping;
	int is_fast;
	int is_fast;
	struct iommu_group *group;


	mapping = to_dma_iommu_mapping(dev);
	mapping = to_dma_iommu_mapping(dev);
	if (!mapping) {
	if (!mapping) {
@@ -2169,13 +2161,7 @@ void arm_iommu_detach_device(struct device *dev)
		return;
		return;
	}
	}


	group = iommu_group_get(dev);
	iommu_detach_device(mapping->domain, dev);
	if (!group) {
		dev_err(dev, "Couldn't get group\n");
		return;
	}

	iommu_detach_group(mapping->domain, group);
	kref_put(&mapping->kref, release_iommu_mapping);
	kref_put(&mapping->kref, release_iommu_mapping);
	dev->archdata.mapping = NULL;
	dev->archdata.mapping = NULL;
	set_dma_ops(dev, NULL);
	set_dma_ops(dev, NULL);