Message ID | 20220825131746.21257-2-ilpo.jarvinen@linux.intel.com |
---|---|
State | New |
Headers | show |
Series | [v2,1/2] serial: dz: xmit buffer is UART_XMIT_SIZE'd | expand |
diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c index 2e21acf39720..5d2588f3e6a9 100644 --- a/drivers/tty/serial/dz.c +++ b/drivers/tty/serial/dz.c @@ -279,7 +279,7 @@ static inline void dz_transmit_chars(struct dz_mux *mux) * so we go one char at a time) :-< */ tmp = xmit->buf[xmit->tail]; - xmit->tail = (xmit->tail + 1) & (DZ_XMIT_SIZE - 1); + xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); dz_out(dport, DZ_TDR, tmp); dport->port.icount.tx++;
Instead of DZ_XMIT_SIZE, use the normal UART_XMIT_SIZE directly as it's the correct size of the xmit circular buffer. In theory, the Tx code would be buggy if UART_XMIT_SIZE differs from 4096 (occurs when PAGE_SIZE > 4k), however, given the lack of issue reports such configuration likely doesn't occur with any real platform with dz HW. The inconsisted sizes would cause missing characters and never-ending bogus Tx when ->head reaches the region above 4k. The issue, if it would be real, would predate git days. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> --- drivers/tty/serial/dz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)