It wasn't protecting anything, as the single word writes used to
set up or tear down a translation are already inherently atomic,
so the spinlock is pure overhead.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-By: Wladimir J. van der Laan <laanwj@gmail.com>
void *bad_page_cpu;
dma_addr_t bad_page_dma;
struct etnaviv_iommu_domain_pgtable pgtable;
- spinlock_t map_lock;
};
static struct etnaviv_iommu_domain *to_etnaviv_domain(struct iommu_domain *domain)
etnaviv_domain->pgtable.pgtable[i] =
etnaviv_domain->bad_page_dma;
- spin_lock_init(&etnaviv_domain->map_lock);
-
return 0;
}
if (size != SZ_4K)
return -EINVAL;
- spin_lock(&etnaviv_domain->map_lock);
etnaviv_domain->pgtable.pgtable[index] = paddr;
- spin_unlock(&etnaviv_domain->map_lock);
return 0;
}
if (size != SZ_4K)
return -EINVAL;
- spin_lock(&etnaviv_domain->map_lock);
etnaviv_domain->pgtable.pgtable[index] = etnaviv_domain->bad_page_dma;
- spin_unlock(&etnaviv_domain->map_lock);
return SZ_4K;
}