From: Uwe Kleine-König Date: Thu, 24 Mar 2016 13:24:23 +0000 (+0100) Subject: serial: imx: only count 0->1 transitions for RNG X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9ec8efe94b5c6a797aa5bceca337373d310f9c2c;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git serial: imx: only count 0->1 transitions for RNG According to tty_ioctl(4) (from man-pages 4.04) the rng member only counts 0->1 transitions. For the other signals (DSR, CD, CTS) both edges are supposed to be counted. Signed-off-by: Uwe Kleine-König Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index aa07301df262..8ec8127bc3dc 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -887,7 +887,7 @@ static void imx_mctrl_check(struct imx_port *sport) sport->old_status = status; - if (changed & TIOCM_RI) + if (changed & TIOCM_RI && status & TIOCM_RI) sport->port.icount.rng++; if (changed & TIOCM_DSR) sport->port.icount.dsr++;