File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -124,10 +124,11 @@ static int cma_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
124
124
struct cma_heap_buffer * buffer = dmabuf -> priv ;
125
125
struct dma_heap_attachment * a ;
126
126
127
+ mutex_lock (& buffer -> lock );
128
+
127
129
if (buffer -> vmap_cnt )
128
130
invalidate_kernel_vmap_range (buffer -> vaddr , buffer -> len );
129
131
130
- mutex_lock (& buffer -> lock );
131
132
list_for_each_entry (a , & buffer -> attachments , list ) {
132
133
if (!a -> mapped )
133
134
continue ;
@@ -144,10 +145,11 @@ static int cma_heap_dma_buf_end_cpu_access(struct dma_buf *dmabuf,
144
145
struct cma_heap_buffer * buffer = dmabuf -> priv ;
145
146
struct dma_heap_attachment * a ;
146
147
148
+ mutex_lock (& buffer -> lock );
149
+
147
150
if (buffer -> vmap_cnt )
148
151
flush_kernel_vmap_range (buffer -> vaddr , buffer -> len );
149
152
150
- mutex_lock (& buffer -> lock );
151
153
list_for_each_entry (a , & buffer -> attachments , list ) {
152
154
if (!a -> mapped )
153
155
continue ;
You can’t perform that action at this time.
0 commit comments