iommu/amd: Don't take domain->lock recursivly
authorJoerg Roedel <joerg.roedel@amd.com>
Fri, 2 Sep 2011 12:19:50 +0000 (14:19 +0200)
committerJoerg Roedel <joerg.roedel@amd.com>
Fri, 2 Sep 2011 12:19:50 +0000 (14:19 +0200)
The domain_flush_devices() function takes the domain->lock.
But this function is only called from update_domain() which
itself is already called unter the domain->lock. This causes
a deadlock situation when the dma-address-space of a domain
grows larger than 1GB.

Cc: stable@kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/amd_iommu.c

index 45652231dae868ecbff806586c03648f0b48d353..0e4227f457af38c9e1c6fc6bf1e065b94e1e9c4f 100644 (file)
@@ -847,14 +847,9 @@ static void domain_flush_complete(struct protection_domain *domain)
 static void domain_flush_devices(struct protection_domain *domain)
 {
        struct iommu_dev_data *dev_data;
-       unsigned long flags;
-
-       spin_lock_irqsave(&domain->lock, flags);
 
        list_for_each_entry(dev_data, &domain->dev_list, list)
                device_flush_dte(dev_data);
-
-       spin_unlock_irqrestore(&domain->lock, flags);
 }
 
 /****************************************************************************