android_kernel_xiaomi_sm8450/kernel/dma
Joakim Zhang 64299791d0 dma-mapping: clear dev->dma_mem to NULL after freeing it
[ Upstream commit b07bc2347672cc8c7293c64499f1488278c5ca3d ]

Reproduced with below sequence:
dma_declare_coherent_memory()->dma_release_coherent_memory()
->dma_declare_coherent_memory()->"return -EBUSY" error

It will return -EBUSY from the dma_assign_coherent_memory()
in dma_declare_coherent_memory(), the reason is that dev->dma_mem
pointer has not been set to NULL after it's freed.

Fixes: cf65a0f6f6 ("dma-mapping: move all DMA mapping code to kernel/dma")
Signed-off-by: Joakim Zhang <joakim.zhang@cixtech.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 14:37:45 -08:00
..
coherent.c dma-mapping: clear dev->dma_mem to NULL after freeing it 2024-01-25 14:37:45 -08:00
contiguous.c dma-mapping updates for 5.10 2020-10-15 14:43:29 -07:00
debug.c dma-debug: don't call __dma_entry_alloc_check_leak() under free_entries_lock 2023-10-10 21:53:32 +02:00
debug.h dma-mapping: move dma-debug.h to kernel/dma/ 2020-10-06 07:07:05 +02:00
direct.c dma-direct: don't over-decrypt memory 2022-06-22 14:13:20 +02:00
direct.h dma-direct: avoid redundant memory sync for swiotlb 2022-04-20 09:23:30 +02:00
dummy.c dma-mapping: split <linux/dma-mapping.h> 2020-10-06 07:07:03 +02:00
Kconfig dma-mapping: merge <linux/dma-contiguous.h> into <linux/dma-map-ops.h> 2020-10-06 07:07:04 +02:00
Makefile dma-mapping: move dma_common_{mmap,get_sgtable} out of mapping.c 2020-09-11 09:14:56 +02:00
mapping.c dma-mapping: move large parts of <linux/dma-direct.h> to kernel/dma 2020-10-06 07:07:06 +02:00
ops_helpers.c dma-mapping: handle vmalloc addresses in dma_common_{mmap,get_sgtable} 2021-07-28 14:35:38 +02:00
pool.c dma/pool: create dma atomic pool only if dma zone has managed pages 2022-01-27 10:53:44 +01:00
remap.c dma-remap: use kvmalloc_array/kvfree for larger dma memory remap 2023-08-26 15:26:43 +02:00
swiotlb.c swiotlb: max mapping size takes min align mask into account 2022-10-05 10:38:40 +02:00
virt.c dma-mapping: split <linux/dma-mapping.h> 2020-10-06 07:07:03 +02:00