All of lore.kernel.org
 help / color / mirror / Atom feed
* + dma-debug-make-locking-to-work-for-rt.patch added to -mm tree
@ 2017-04-13 20:09 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-04-13 20:09 UTC (permalink / raw)
  To: pagupta, jroedel, luto, miles.chen, mingo, mtosatti,
	niklas.soderlund+renesas, sgruszka, ville.syrjala, vinod.koul,
	mm-commits


The patch titled
     Subject: lib/dma-debug.c: make locking work for RT
has been added to the -mm tree.  Its filename is
     dma-debug-make-locking-to-work-for-rt.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/dma-debug-make-locking-to-work-for-rt.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/dma-debug-make-locking-to-work-for-rt.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Pankaj Gupta <pagupta@redhat.com>
Subject: 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>
---

 lib/dma-debug.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff -puN lib/dma-debug.c~dma-debug-make-locking-to-work-for-rt lib/dma-debug.c
--- a/lib/dma-debug.c~dma-debug-make-locking-to-work-for-rt
+++ a/lib/dma-debug.c
@@ -942,21 +942,17 @@ static int device_dma_allocations(struct
 	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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-13 20:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-13 20:09 + dma-debug-make-locking-to-work-for-rt.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.