mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-02-06 11:19:56 +00:00
dma-debug: disable/enable irqs only once in device_dma_allocations
There is no need to disable/enable irqs on each loop iteration. Just disable irqs for the whole time the loop runs. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
This commit is contained in:
parent
e7ed70eedc
commit
be81c6ea23
@ -649,15 +649,19 @@ static int device_dma_allocations(struct device *dev)
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int count = 0, i;
|
int count = 0, i;
|
||||||
|
|
||||||
|
local_irq_save(flags);
|
||||||
|
|
||||||
for (i = 0; i < HASH_SIZE; ++i) {
|
for (i = 0; i < HASH_SIZE; ++i) {
|
||||||
spin_lock_irqsave(&dma_entry_hash[i].lock, flags);
|
spin_lock(&dma_entry_hash[i].lock);
|
||||||
list_for_each_entry(entry, &dma_entry_hash[i].list, list) {
|
list_for_each_entry(entry, &dma_entry_hash[i].list, list) {
|
||||||
if (entry->dev == dev)
|
if (entry->dev == dev)
|
||||||
count += 1;
|
count += 1;
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&dma_entry_hash[i].lock, flags);
|
spin_unlock(&dma_entry_hash[i].lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local_irq_restore(flags);
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user