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
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
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
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
timesyssupport can you attend this case?