aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPankaj Gupta <pagupta@redhat.com>2017-04-17 01:23:17 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2017-04-17 01:23:17 +1000
commit80610f5a82c0ad0c5bf396cf33a07f23e756ace0 (patch)
tree755092d8bce591a408bb060f69a27d243ca5661e /lib
parent20e5c2a39c63ac70aba4741c08f7663c734672d3 (diff)
lib/dma-debug.c: make locking work for RT
Interrupt enable/disabled with spinlock is not a valid operation for RT as it can make executing tasks sleep from a non-sleepable context. So convert it to spin_lock_irq[save, restore]. Link: http://lkml.kernel.org/r/1492065666-3816-1-git-send-email-pagupta@redhat.com Signed-off-by: Pankaj Gupta <pagupta@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Cc: Vinod Koul <vinod.koul@intel.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Ville Syrjl <ville.syrjala@linux.intel.com> Cc: Miles Chen <miles.chen@mediatek.com> Cc: Marcelo Tosatti <mtosatti@redhat.com> Cc: Joerg Roedel <jroedel@suse.de> Cc: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/dma-debug.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index b157b46cc9a6..fe4d50c992df 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -942,21 +942,17 @@ static int device_dma_allocations(struct device *dev, struct dma_debug_entry **o
unsigned long flags;
int count = 0, i;
- local_irq_save(flags);
-
for (i = 0; i < HASH_SIZE; ++i) {
- spin_lock(&dma_entry_hash[i].lock);
+ spin_lock_irqsave(&dma_entry_hash[i].lock, flags);
list_for_each_entry(entry, &dma_entry_hash[i].list, list) {
if (entry->dev == dev) {
count += 1;
*out_entry = entry;
}
}
- spin_unlock(&dma_entry_hash[i].lock);
+ spin_unlock_irqrestore(&dma_entry_hash[i].lock, flags);
}
- local_irq_restore(flags);
-
return count;
}