mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-17 22:05:08 +00:00
iommu/exynos: Remove useless members from exynos_iommu_owner structure
This patch removes useless spinlocks and other unused members from struct exynos_iommu_owner. There is no point is protecting this structure by spinlock because content of this structure doesn't change and other structures have their own spinlocks. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
parent
3211cf2042
commit
73db569896
@ -189,9 +189,6 @@ struct exynos_iommu_owner {
|
|||||||
struct list_head client; /* entry of exynos_iommu_domain.clients */
|
struct list_head client; /* entry of exynos_iommu_domain.clients */
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
struct device *sysmmu;
|
struct device *sysmmu;
|
||||||
struct iommu_domain *domain;
|
|
||||||
void *vmm_data; /* IO virtual memory manager's data */
|
|
||||||
spinlock_t lock; /* Lock to preserve consistency of System MMU */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct exynos_iommu_domain {
|
struct exynos_iommu_domain {
|
||||||
@ -477,44 +474,34 @@ static int __exynos_sysmmu_enable(struct device *dev, phys_addr_t pgtable,
|
|||||||
struct iommu_domain *domain)
|
struct iommu_domain *domain)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
unsigned long flags;
|
|
||||||
struct exynos_iommu_owner *owner = dev->archdata.iommu;
|
struct exynos_iommu_owner *owner = dev->archdata.iommu;
|
||||||
struct sysmmu_drvdata *data;
|
struct sysmmu_drvdata *data;
|
||||||
|
|
||||||
BUG_ON(!has_sysmmu(dev));
|
BUG_ON(!has_sysmmu(dev));
|
||||||
|
|
||||||
spin_lock_irqsave(&owner->lock, flags);
|
|
||||||
|
|
||||||
data = dev_get_drvdata(owner->sysmmu);
|
data = dev_get_drvdata(owner->sysmmu);
|
||||||
|
|
||||||
ret = __sysmmu_enable(data, pgtable, domain);
|
ret = __sysmmu_enable(data, pgtable, domain);
|
||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
data->master = dev;
|
data->master = dev;
|
||||||
|
|
||||||
spin_unlock_irqrestore(&owner->lock, flags);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool exynos_sysmmu_disable(struct device *dev)
|
static bool exynos_sysmmu_disable(struct device *dev)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
|
||||||
bool disabled = true;
|
bool disabled = true;
|
||||||
struct exynos_iommu_owner *owner = dev->archdata.iommu;
|
struct exynos_iommu_owner *owner = dev->archdata.iommu;
|
||||||
struct sysmmu_drvdata *data;
|
struct sysmmu_drvdata *data;
|
||||||
|
|
||||||
BUG_ON(!has_sysmmu(dev));
|
BUG_ON(!has_sysmmu(dev));
|
||||||
|
|
||||||
spin_lock_irqsave(&owner->lock, flags);
|
|
||||||
|
|
||||||
data = dev_get_drvdata(owner->sysmmu);
|
data = dev_get_drvdata(owner->sysmmu);
|
||||||
|
|
||||||
disabled = __sysmmu_disable(data);
|
disabled = __sysmmu_disable(data);
|
||||||
if (disabled)
|
if (disabled)
|
||||||
data->master = NULL;
|
data->master = NULL;
|
||||||
|
|
||||||
spin_unlock_irqrestore(&owner->lock, flags);
|
|
||||||
|
|
||||||
return disabled;
|
return disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -762,10 +749,8 @@ static int exynos_iommu_attach_device(struct iommu_domain *domain,
|
|||||||
spin_lock_irqsave(&priv->lock, flags);
|
spin_lock_irqsave(&priv->lock, flags);
|
||||||
|
|
||||||
ret = __exynos_sysmmu_enable(dev, pagetable, domain);
|
ret = __exynos_sysmmu_enable(dev, pagetable, domain);
|
||||||
if (ret == 0) {
|
if (ret == 0)
|
||||||
list_add_tail(&owner->client, &priv->clients);
|
list_add_tail(&owner->client, &priv->clients);
|
||||||
owner->domain = domain;
|
|
||||||
}
|
|
||||||
|
|
||||||
spin_unlock_irqrestore(&priv->lock, flags);
|
spin_unlock_irqrestore(&priv->lock, flags);
|
||||||
|
|
||||||
@ -793,10 +778,8 @@ static void exynos_iommu_detach_device(struct iommu_domain *domain,
|
|||||||
|
|
||||||
list_for_each_entry(owner, &priv->clients, client) {
|
list_for_each_entry(owner, &priv->clients, client) {
|
||||||
if (owner == dev->archdata.iommu) {
|
if (owner == dev->archdata.iommu) {
|
||||||
if (exynos_sysmmu_disable(dev)) {
|
if (exynos_sysmmu_disable(dev))
|
||||||
list_del_init(&owner->client);
|
list_del_init(&owner->client);
|
||||||
owner->domain = NULL;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user