About eDMA channel 0

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

About eDMA channel 0

2,424 次查看
makotokatsukura
Contributor II

Dear Forum members,

Is there any special meaning for eDMA channel 0?

We are using Timesys Linux and in their UART driver (mvf.c), following codes imply eDMA channel 0 has special meaning.

(linux3.0/drivers/tty/serial/mvf.c

static void imx_shutdown(struct uart_port *port)

{

    struct imx_port *sport = (struct imx_port *)port;

    unsigned char temp;

    unsigned long flags;

    if (sport->enable_dma) {

        /* We have to wait for the DMA to finish. */

        if (sport->dma_tx_ch) {

            mcf_edma_stop_transfer(sport->dma_tx_ch);

            mcf_edma_free_channel(sport->dma_tx_ch, sport);

            sport->dma_tx_ch = 0;

        }

    }

Line 10 to 14 is not executed when UART uses DMA channel 0 (Because, sport->dma_tx_ch is 0 ).

We think those are just a software bug, but we want to confirm that eDMA channel 0 has special meaning or not.

Thank you,

Makoto Katsukura

标签 (2)
标记 (3)
0 项奖励
回复
4 回复数

2,162 次查看
timesyssupport
Senior Contributor II

Hello Katsukura-san,

We recently became aware of this issue - it is possible for sport->dma_tx_ch to be assigned channel 0, which results in the unintended operation you are experiencing. We will fix this in the next release of the kernel. You can change the conditional to check if 'sport->dma_tx_ch < 0' for the meantime.

Thanks,

Timesys Support

2,162 次查看
makotokatsukura
Contributor II

Dear Timesys Support,

Thank you for your reply.

> the conditional to check if 'sport->dma_tx_ch < 0'

Is it really?

We think if 'sport->dma_tx_ch > 0' is the condition to check.

Please check it.

Regards,

Makoto Katsukura

0 项奖励
回复

2,162 次查看
timesyssupport
Senior Contributor II

Hello Katsukura-san,

Sorry, what I had posted was not correct before. This is the planned change:

     if (sport->enable_dma) {
         /* We have to wait for the DMA to finish. */
-        if (sport->dma_tx_ch) {
+        if (sport->dma_tx_ch >= 0) {
             mcf_edma_stop_transfer(sport->dma_tx_ch);
             mcf_edma_free_channel(sport->dma_tx_ch, sport);
-            sport->dma_tx_ch = 0;
+            sport->dma_tx_ch = -1;
         }
     }

Thanks, and let me know if you have any questions.

Timesys Support

2,163 次查看
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport can you attend this case?

0 项奖励
回复