You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/10/27 14:24:34 UTC
(nuttx) branch master updated (18819b6b24 -> 881d67272c)
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
from 18819b6b24 sched/task: close file descriptor with O_CLOEXEC before active task or exec
new 892fe45900 imxrt:Serial overcome race where DMA has not fetched TCD again"
new 8b9d05d0f7 s32k1xx:Serial overcome race where DMA has not fetched TCD again"
new 881d67272c s32k3xx:Serial overcome race where DMA has not fetched TCD again"
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
arch/arm/src/imxrt/imxrt_serial.c | 2 +-
arch/arm/src/s32k1xx/s32k1xx_serial.c | 2 +-
arch/arm/src/s32k3xx/s32k3xx_serial.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
(nuttx) 02/03: s32k1xx:Serial overcome race where DMA has not fetched TCD again"
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 8b9d05d0f78e0eafe615dd83b802dc4b572ea586
Author: David Sidrane <Da...@NscDg.com>
AuthorDate: Fri Oct 27 03:37:01 2023 -0700
s32k1xx:Serial overcome race where DMA has not fetched TCD again"
With TCD set to loop, there is a window where the
DMA has raised Done, but not reloaded the TCD, resetting
count and clearing Done.
In this window imxrt_dmach_getcount could then return 0.
Resulting in imxrt_dma_nextrx returning RXDMA_BUFFER_SIZE.
Which is not a valid index in the FIFO.
Since the count will be set to RXDMA_BUFFER_SIZE. When the DMA
engine completes the TCD reload. The imxrt_dma_nextrx would
return 0. Therefore:
(RXDMA_BUFFER_SIZE - dmaresidual) % RXDMA_BUFFER_SIZE
accomplishes this.
---
arch/arm/src/s32k1xx/s32k1xx_serial.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/src/s32k1xx/s32k1xx_serial.c b/arch/arm/src/s32k1xx/s32k1xx_serial.c
index 50fad28005..de1ed6ef80 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_serial.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_serial.c
@@ -658,7 +658,7 @@ static int s32k1xx_dma_nextrx(struct s32k1xx_uart_s *priv)
{
int dmaresidual = s32k1xx_dmach_getcount(priv->rxdma);
- return RXDMA_BUFFER_SIZE - dmaresidual;
+ return (RXDMA_BUFFER_SIZE - dmaresidual) % RXDMA_BUFFER_SIZE;
}
#endif
(nuttx) 03/03: s32k3xx:Serial overcome race where DMA has not fetched TCD again"
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 881d67272cbc840b6f477241784146490dc6c87c
Author: David Sidrane <Da...@NscDg.com>
AuthorDate: Fri Oct 27 03:37:49 2023 -0700
s32k3xx:Serial overcome race where DMA has not fetched TCD again"
With TCD set to loop, there is a window where the
DMA has raised Done, but not reloaded the TCD, resetting
count and clearing Done.
In this window imxrt_dmach_getcount could then return 0.
Resulting in imxrt_dma_nextrx returning RXDMA_BUFFER_SIZE.
Which is not a valid index in the FIFO.
Since the count will be set to RXDMA_BUFFER_SIZE. When the DMA
engine completes the TCD reload. The imxrt_dma_nextrx would
return 0. Therefore:
(RXDMA_BUFFER_SIZE - dmaresidual) % RXDMA_BUFFER_SIZE
accomplishes this.
---
arch/arm/src/s32k3xx/s32k3xx_serial.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/src/s32k3xx/s32k3xx_serial.c b/arch/arm/src/s32k3xx/s32k3xx_serial.c
index ca30e7fa50..3ef3dccb1b 100644
--- a/arch/arm/src/s32k3xx/s32k3xx_serial.c
+++ b/arch/arm/src/s32k3xx/s32k3xx_serial.c
@@ -2815,7 +2815,7 @@ static int s32k3xx_dma_nextrx(struct s32k3xx_uart_s *priv)
{
int dmaresidual = s32k3xx_dmach_getcount(priv->rxdma);
- return RXDMA_BUFFER_SIZE - dmaresidual;
+ return (RXDMA_BUFFER_SIZE - dmaresidual) % RXDMA_BUFFER_SIZE;
}
#endif
(nuttx) 01/03: imxrt:Serial overcome race where DMA has not fetched TCD again"
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 892fe459006b4fbcd70aee2dd4c95f2b7c75de01
Author: David Sidrane <Da...@NscDg.com>
AuthorDate: Fri Oct 27 03:15:10 2023 -0700
imxrt:Serial overcome race where DMA has not fetched TCD again"
With TCD set to loop, there is a window where the
DMA has raised Done, but not reloaded the TCD, resetting
count and clearing Done.
In this window imxrt_dmach_getcount could then return 0.
Resulting in imxrt_dma_nextrx returning RXDMA_BUFFER_SIZE.
Which is not a valid index in the FIFO.
Since the count will be set to RXDMA_BUFFER_SIZE. When the DMA
engine completes the TCD reload. The imxrt_dma_nextrx would
return 0. Therefore:
(RXDMA_BUFFER_SIZE - dmaresidual) % RXDMA_BUFFER_SIZE
accomplishes this.
---
arch/arm/src/imxrt/imxrt_serial.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/src/imxrt/imxrt_serial.c b/arch/arm/src/imxrt/imxrt_serial.c
index 30a487b553..939ccc6e58 100644
--- a/arch/arm/src/imxrt/imxrt_serial.c
+++ b/arch/arm/src/imxrt/imxrt_serial.c
@@ -1375,7 +1375,7 @@ static int imxrt_dma_nextrx(struct imxrt_uart_s *priv)
int dmaresidual = imxrt_dmach_getcount(priv->rxdma);
DEBUGASSERT(dmaresidual <= RXDMA_BUFFER_SIZE);
- return RXDMA_BUFFER_SIZE - dmaresidual;
+ return (RXDMA_BUFFER_SIZE - dmaresidual) % RXDMA_BUFFER_SIZE;
}
#endif