Patch "drm/etnaviv: fix DMA direction handling for cached RW buffers" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/etnaviv: fix DMA direction handling for cached RW buffers

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-etnaviv-fix-dma-direction-handling-for-cached-rw.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5786c5c07acbf3666a3908ad7c9f2c9701bbb5c9
Author: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
Date:   Fri Jun 21 19:11:06 2024 +0200

    drm/etnaviv: fix DMA direction handling for cached RW buffers
    
    [ Upstream commit 58979ad6330a70450ed78837be3095107d022ea9 ]
    
    The dma sync operation needs to be done with DMA_BIDIRECTIONAL when
    the BO is prepared for both read and write operations.
    
    Fixes: a8c21a5451d8 ("drm/etnaviv: add initial etnaviv DRM driver")
    Signed-off-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
    Reviewed-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
    Reviewed-by: Christian Gmeiner <cgmeiner@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
index 1fa74226db91f..69f91662ba236 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
@@ -370,9 +370,11 @@ static void *etnaviv_gem_vmap_impl(struct etnaviv_gem_object *obj)
 
 static inline enum dma_data_direction etnaviv_op_to_dma_dir(u32 op)
 {
-	if (op & ETNA_PREP_READ)
+	op &= ETNA_PREP_READ | ETNA_PREP_WRITE;
+
+	if (op == ETNA_PREP_READ)
 		return DMA_FROM_DEVICE;
-	else if (op & ETNA_PREP_WRITE)
+	else if (op == ETNA_PREP_WRITE)
 		return DMA_TO_DEVICE;
 	else
 		return DMA_BIDIRECTIONAL;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux