On RX buffer overflow, printk remaining input size
authornorly <ny-git@enpas.org>
Mon, 6 Jun 2022 11:39:00 +0000 (13:39 +0200)
committernorly <ny-git@enpas.org>
Mon, 6 Jun 2022 11:39:00 +0000 (13:39 +0200)
If can327_ldisc_rx() is called with a large 'count' because the UART
driver feeds us huge buffers, then the user should have a chance to
know and report this.

In this case, we'll have to increase ELM327_SIZE_RXBUF.

module/can327.c

index fc99dea652f6f22170f76176042bcad4beb425d4..da81fa3af8828561ccd00cd2b0c3ce816b307516 100644 (file)
@@ -993,7 +993,7 @@ static void can327_ldisc_rx(struct tty_struct *tty,
        }
 
        if (count >= 0) {
-               netdev_err(elm->dev, "Receive buffer overflowed. Bad chip or wiring?");
+               netdev_err(elm->dev, "Receive buffer overflowed. Bad chip or wiring? count = %i", count);
 
                elm327_uart_side_failure(elm);