px4io_serial: ensure TX DMA is stopped if exiting early on stream error

- otherwise the next retry can happen quickly enough that dma setup
hangs waiting for the stream
This commit is contained in:
Daniel Agar 2021-08-30 20:59:49 -04:00
parent 3f88a6d0bf
commit 0a6045367f
No known key found for this signature in database
GPG Key ID: FD3CBA98017A69DE
2 changed files with 4 additions and 0 deletions

View File

@ -328,6 +328,8 @@ ArchPX4IOSerial::_bus_exchange(IOPacket *_packet)
if (ret == OK) {
/* check for DMA errors */
if (_rx_dma_status & DMA_STATUS_TEIF) {
// stream transfer error, ensure TX DMA is also stopped before exiting early
stm32_dmastop(_tx_dma);
perf_count(_pc_dmaerrs);
ret = -EIO;
break;

View File

@ -373,6 +373,8 @@ ArchPX4IOSerial::_bus_exchange(IOPacket *_packet)
if (ret == OK) {
/* check for DMA errors */
if (_rx_dma_status & DMA_STATUS_TEIF) {
// stream transfer error, ensure TX DMA is also stopped before exiting early
stm32_dmastop(_tx_dma);
perf_count(_pc_dmaerrs);
ret = -EIO;
break;