Skip to content

Commit 240b9a5

Browse files
6by9pelwell
authored andcommitted
staging: vc04_services: vc-sm-cma: Use [map|unmap]_attachment_unlocked
lockdep throws warnings when using libcamera as buffers are mapped and unmapped as the dmabuf->resv lock hasn't been taken. Switch to using the _unlocked variants so that the framework takes the lock. #6814 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent cdd894a commit 240b9a5

File tree

1 file changed

+5
-5
lines changed
  • drivers/staging/vc04_services/vc-sm-cma

1 file changed

+5
-5
lines changed

drivers/staging/vc04_services/vc-sm-cma/vc_sm.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ static void vc_sm_clean_up_dmabuf(struct vc_sm_buffer *buffer)
249249

250250
/* Handle cleaning up imported dmabufs */
251251
if (buffer->import.sgt) {
252-
dma_buf_unmap_attachment(buffer->import.attach,
253-
buffer->import.sgt,
254-
DMA_BIDIRECTIONAL);
252+
dma_buf_unmap_attachment_unlocked(buffer->import.attach,
253+
buffer->import.sgt,
254+
DMA_BIDIRECTIONAL);
255255
buffer->import.sgt = NULL;
256256
}
257257
if (buffer->import.attach) {
@@ -735,7 +735,7 @@ vc_sm_cma_import_dmabuf_internal(struct vc_sm_privdata_t *private,
735735
goto error;
736736
}
737737

738-
sgt = dma_buf_map_attachment(attach, DMA_BIDIRECTIONAL);
738+
sgt = dma_buf_map_attachment_unlocked(attach, DMA_BIDIRECTIONAL);
739739
if (IS_ERR(sgt)) {
740740
ret = PTR_ERR(sgt);
741741
goto error;
@@ -845,7 +845,7 @@ vc_sm_cma_import_dmabuf_internal(struct vc_sm_privdata_t *private,
845845
free_kernel_id(import.kernel_id);
846846
kfree(buffer);
847847
if (sgt)
848-
dma_buf_unmap_attachment(attach, sgt, DMA_BIDIRECTIONAL);
848+
dma_buf_unmap_attachment_unlocked(attach, sgt, DMA_BIDIRECTIONAL);
849849
if (attach)
850850
dma_buf_detach(dma_buf, attach);
851851
dma_buf_put(dma_buf);

0 commit comments

Comments
 (0)