Van.Ghylivan 2022-11-13 13:41 采纳率: 66.7%
浏览 14

DMA移植时发现DMA_SG消失了

DMA_SG消失了

在对内核4.4->5.10版本DMA的移植时,发现DMA驱动里有一个DMA_SG的枚举被删去.

这对于移植来说带来了很大的麻烦.最坏的情况是,这个枚举消失了,但是合并到其他枚举的功能实现里去了.
然后我就去查找在哪一个版本有对这个枚举有改动.最终在这个版本里发现该枚举被移除了

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/include/linux/dmaengine.h?h=linux-5.10.y&id=c678fa66341c7b82a57cfed0ba3656162e970f99

authorDave Jiang dave.jiang@intel.com2017-08-21 10:23:13 -0700
committerVinod Koul vinod.koul@intel.com2017-08-22 09:22:11 +0530
commithttps://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/include/linux/dmaengine.h?h=linux-5.10.y&id=c678fa66341c7b82a57cfed0ba3656162e970f99 (https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/include/linux/dmaengine.h?id=c678fa66341c7b82a57cfed0ba3656162e970f99)
treehttps://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/?h=linux-5.10.y&id=c678fa66341c7b82a57cfed0ba3656162e970f99 /https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/linux/dmaengine.h?h=linux-5.10.y&id=c678fa66341c7b82a57cfed0ba3656162e970f99
parenthttps://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/include/linux/dmaengine.h?h=linux-5.10.y&id=61b5f54d8c1fafb97dace958a54cdd72b37138c3 (https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/diff/include/linux/dmaengine.h?h=linux-5.10.y&id=c678fa66341c7b82a57cfed0ba3656162e970f99&id2=61b5f54d8c1fafb97dace958a54cdd72b37138c3)
downloadhttps://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/snapshot/linux-c678fa66341c7b82a57cfed0ba3656162e970f99.tar.gz
dmaengine: remove DMA_SG as it is dead code in kernel
There are no in kernel consumers for DMA_SG op. Removing operation,
dead code, and test code in dmatest.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Gary Hook <gary.hook@amd.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: Kedareswara rao Appana <appana.durga.rao@xilinx.com>
Cc: Li Yang <leoyang.li@nxp.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>


diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 533680860865a..64fbd380c4309 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -68,7 +68,6 @@ enum dma_transaction_type {
     DMA_MEMSET,
     DMA_MEMSET_SG,
     DMA_INTERRUPT,
-    DMA_SG,
     DMA_PRIVATE,
     DMA_ASYNC_TX,
     DMA_SLAVE,
@@ -771,11 +770,6 @@ struct dma_device {
         unsigned int nents, int value, unsigned long flags);
     struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)(
         struct dma_chan *chan, unsigned long flags);
-    struct dma_async_tx_descriptor *(*device_prep_dma_sg)(
-        struct dma_chan *chan,
-        struct scatterlist *dst_sg, unsigned int dst_nents,
-        struct scatterlist *src_sg, unsigned int src_nents,
-        unsigned long flags);
 
     struct dma_async_tx_descriptor *(*device_prep_slave_sg)(
         struct dma_chan *chan, struct scatterlist *sgl,
@@ -905,19 +899,6 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_memcpy(
                             len, flags);
 }
 
-static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_sg(
-        struct dma_chan *chan,
-        struct scatterlist *dst_sg, unsigned int dst_nents,
-        struct scatterlist *src_sg, unsigned int src_nents,
-        unsigned long flags)
-{
-    if (!chan || !chan->device || !chan->device->device_prep_dma_sg)
-        return NULL;
-
-    return chan->device->device_prep_dma_sg(chan, dst_sg, dst_nents,
-            src_sg, src_nents, flags);
-}
-
 /**
  * dmaengine_terminate_all() - Terminate all active DMA transfers
  * @chan: The channel for which to terminate the transfers

dmaengine: remove DMA_SG as it is dead code in kernel
There are no in kernel consumers for DMA_SG op. Removing operation,
dead code, and test code in dmatest.

翻译成中文

dmaengine:删除DMA_SG,因为它是内核中的死代码

DMA_SG操作的内核内没有使用者。删除操作,死代码和dmatest中的测试代码。

通过此只知道被删去了,不知道其他属于DMA_SG的部分去了哪里.

所以想问一下DMA_SG这个宏为什么可以直接删除

  • 写回答

1条回答 默认 最新

  • CSDN-Ada助手 CSDN-AI 官方账号 2022-11-13 16:07
    关注
    评论

报告相同问题?

问题事件

  • 创建了问题 11月13日

悬赏问题

  • ¥15 黄永刚的晶体塑性子程序中输入的材料参数里的晶体取向参数是什么形式的?
  • ¥20 数学建模来解决我这个问题
  • ¥15 计算机网络ip分片偏移量计算头部是-20还是-40呀
  • ¥15 stc15f2k60s2单片机关于流水灯,时钟,定时器,矩阵键盘等方面的综合问题
  • ¥15 YOLOv8已有一个初步的检测模型,想利用这个模型对新的图片进行自动标注,生成labellmg可以识别的数据,再手动修改。如何操作?
  • ¥30 NIRfast软件使用指导
  • ¥20 matlab仿真问题,求功率谱密度
  • ¥15 求micropython modbus-RTU 从机的代码或库?
  • ¥15 django5安装失败
  • ¥15 Java与Hbase相关问题