tty: serial: imx: Add fast path when rs485 delays are 0
authorHarald Seiler <hws@denx.de>
Wed, 19 Jan 2022 14:52:03 +0000 (15:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Feb 2022 11:06:04 +0000 (12:06 +0100)
commit582e9a24fc139adabb1dc951620870806bfc1583
tree6f955aba131a68c4b19cb72de68de0d590ccfed6
parentfcc446c8aa6303b247b0d88f460167b731265282
tty: serial: imx: Add fast path when rs485 delays are 0

Right now, even when `delay_rts_before_send` and `delay_rts_after_send`
are 0, the hrtimer is triggered (with timeout 0) which can introduce a
few 100us of additional overhead on slower i.MX platforms.

Implement a fast path when the delays are 0, where the RTS signal is
toggled immediately instead of going through an hrtimer.  This fast path
behaves identical to the code before delay support was implemented.

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Harald Seiler <hws@denx.de>
Link: https://lore.kernel.org/r/20220119145204.238767-1-hws@denx.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c