Commit 0adf65f5 authored by Michel Lespinasse's avatar Michel Lespinasse Committed by Linus Torvalds

DMA reservations: use the new mmap locking API

This use is converted manually ahead of the next patch in the series, as
it requires including a new header which the automated conversion would
miss.
Signed-off-by: default avatarMichel Lespinasse <walken@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Reviewed-by: default avatarDaniel Jordan <daniel.m.jordan@oracle.com>
Reviewed-by: default avatarLaurent Dufour <ldufour@linux.ibm.com>
Reviewed-by: default avatarVlastimil Babka <vbabka@suse.cz>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Liam Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ying Han <yinghan@google.com>
Link: http://lkml.kernel.org/r/20200520052908.204642-4-walken@google.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b72327fc
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/dma-resv.h> #include <linux/dma-resv.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/mm.h>
#include <linux/sched/mm.h> #include <linux/sched/mm.h>
/** /**
...@@ -109,7 +110,7 @@ static int __init dma_resv_lockdep(void) ...@@ -109,7 +110,7 @@ static int __init dma_resv_lockdep(void)
dma_resv_init(&obj); dma_resv_init(&obj);
down_read(&mm->mmap_sem); mmap_read_lock(mm);
ww_acquire_init(&ctx, &reservation_ww_class); ww_acquire_init(&ctx, &reservation_ww_class);
ret = dma_resv_lock(&obj, &ctx); ret = dma_resv_lock(&obj, &ctx);
if (ret == -EDEADLK) if (ret == -EDEADLK)
...@@ -118,7 +119,7 @@ static int __init dma_resv_lockdep(void) ...@@ -118,7 +119,7 @@ static int __init dma_resv_lockdep(void)
fs_reclaim_release(GFP_KERNEL); fs_reclaim_release(GFP_KERNEL);
ww_mutex_unlock(&obj.lock); ww_mutex_unlock(&obj.lock);
ww_acquire_fini(&ctx); ww_acquire_fini(&ctx);
up_read(&mm->mmap_sem); mmap_read_unlock(mm);
mmput(mm); mmput(mm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment