]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Drop dma-direct-correct-the-physical-addr-in-dma_direct_s.patch
authorSasha Levin <sashal@kernel.org>
Tue, 6 Aug 2019 12:51:32 +0000 (08:51 -0400)
committerSasha Levin <sashal@kernel.org>
Tue, 6 Aug 2019 12:51:32 +0000 (08:51 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.2/dma-direct-correct-the-physical-addr-in-dma_direct_s.patch [deleted file]
queue-5.2/series

diff --git a/queue-5.2/dma-direct-correct-the-physical-addr-in-dma_direct_s.patch b/queue-5.2/dma-direct-correct-the-physical-addr-in-dma_direct_s.patch
deleted file mode 100644 (file)
index dbdecd0..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-From 039511af8a45e8d8ca0e851dae8652199d23721c Mon Sep 17 00:00:00 2001
-From: Fugang Duan <fugang.duan@nxp.com>
-Date: Fri, 19 Jul 2019 17:26:48 +0800
-Subject: dma-direct: correct the physical addr in
- dma_direct_sync_sg_for_cpu/device
-
-[ Upstream commit 449fa54d6815be8c2c1f68fa9dbbae9384a7c03e ]
-
-dma_map_sg() may use swiotlb buffer when the kernel command line includes
-"swiotlb=force" or the dma_addr is out of dev->dma_mask range.  After
-DMA complete the memory moving from device to memory, then user call
-dma_sync_sg_for_cpu() to sync with DMA buffer, and copy the original
-virtual buffer to other space.
-
-So dma_direct_sync_sg_for_cpu() should use swiotlb physical addr, not
-the original physical addr from sg_phys(sg).
-
-dma_direct_sync_sg_for_device() also has the same issue, correct it as
-well.
-
-Fixes: 55897af63091("dma-direct: merge swiotlb_dma_ops into the dma_direct code")
-Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
-Reviewed-by: Robin Murphy <robin.murphy@arm.com>
-Signed-off-by: Christoph Hellwig <hch@lst.de>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- kernel/dma/direct.c | 18 +++++++++++-------
- 1 file changed, 11 insertions(+), 7 deletions(-)
-
-diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
-index 2c2772e9702ab..2c6d51a62251d 100644
---- a/kernel/dma/direct.c
-+++ b/kernel/dma/direct.c
-@@ -231,12 +231,14 @@ void dma_direct_sync_sg_for_device(struct device *dev,
-       int i;
-       for_each_sg(sgl, sg, nents, i) {
--              if (unlikely(is_swiotlb_buffer(sg_phys(sg))))
--                      swiotlb_tbl_sync_single(dev, sg_phys(sg), sg->length,
-+              phys_addr_t paddr = dma_to_phys(dev, sg_dma_address(sg));
-+
-+              if (unlikely(is_swiotlb_buffer(paddr)))
-+                      swiotlb_tbl_sync_single(dev, paddr, sg->length,
-                                       dir, SYNC_FOR_DEVICE);
-               if (!dev_is_dma_coherent(dev))
--                      arch_sync_dma_for_device(dev, sg_phys(sg), sg->length,
-+                      arch_sync_dma_for_device(dev, paddr, sg->length,
-                                       dir);
-       }
- }
-@@ -268,11 +270,13 @@ void dma_direct_sync_sg_for_cpu(struct device *dev,
-       int i;
-       for_each_sg(sgl, sg, nents, i) {
-+              phys_addr_t paddr = dma_to_phys(dev, sg_dma_address(sg));
-+
-               if (!dev_is_dma_coherent(dev))
--                      arch_sync_dma_for_cpu(dev, sg_phys(sg), sg->length, dir);
--      
--              if (unlikely(is_swiotlb_buffer(sg_phys(sg))))
--                      swiotlb_tbl_sync_single(dev, sg_phys(sg), sg->length, dir,
-+                      arch_sync_dma_for_cpu(dev, paddr, sg->length, dir);
-+
-+              if (unlikely(is_swiotlb_buffer(paddr)))
-+                      swiotlb_tbl_sync_single(dev, paddr, sg->length, dir,
-                                       SYNC_FOR_CPU);
-       }
--- 
-2.20.1
-
index 15bdd70c095b2f38fe26645cc7852603bccbdf7b..d0f39b7b74a2a376d022e8f65d79f3a4260f8c40 100644 (file)
@@ -70,7 +70,6 @@ x86-paravirt-fix-callee-saved-function-elf-sizes.patch
 x86-boot-remove-multiple-copy-of-static-function-san.patch
 bpf-disable-gcc-fgcse-optimization-for-___bpf_prog_r.patch
 drm-nouveau-fix-memory-leak-in-nouveau_conn_reset.patch
-dma-direct-correct-the-physical-addr-in-dma_direct_s.patch
 drm-nouveau-dmem-missing-mutex_lock-in-error-path.patch
 kconfig-clear-written-flag-to-avoid-data-loss.patch
 kbuild-initialize-clang_flags-correctly-in-the-top-makefile.patch