Skip to content

Commit d1829dc

Browse files
pres2300nickslopez
authored andcommitted
[nrf fromtree] drivers: uart: nrf: rx_timeout_slab incorrectly set
When rx_timeout is set to a sufficiently small value, rx_timeout_slab could potentially get set to a greater than necessary value that causes spurious UART_RX_RDY events. Fixes #62828 Signed-off-by: Jacob Preston <[email protected]> (cherry picked from commit 52c5517)
1 parent 83980fe commit d1829dc

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

drivers/serial/uart_nrfx_uarte.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -844,15 +844,7 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf,
844844
}
845845

846846
data->async->rx_timeout = timeout;
847-
/* Set minimum interval to 3 RTC ticks. 3 is used due to RTC limitation
848-
* which cannot set timeout for next tick. Assuming delay in processing
849-
* 3 instead of 2 is used. Note that lower value would work in a similar
850-
* way but timeouts would always occur later than expected, most likely
851-
* after ~3 ticks.
852-
*/
853-
data->async->rx_timeout_slab =
854-
MAX(timeout / RX_TIMEOUT_DIV,
855-
NRFX_CEIL_DIV(3 * 1000000, CONFIG_SYS_CLOCK_TICKS_PER_SEC));
847+
data->async->rx_timeout_slab = timeout / RX_TIMEOUT_DIV;
856848

857849
data->async->rx_buf = buf;
858850
data->async->rx_buf_len = len;

0 commit comments

Comments
 (0)