sc16is7xx: Handle modem status lines
authorTomasz Moń <tomasz.mon@camlingroup.com>
Tue, 1 Mar 2022 06:03:31 +0000 (07:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Mar 2022 21:16:59 +0000 (22:16 +0100)
commit21144bab4f1191e01e1cf785720e6af99d86a347
tree9c5ef3fc7cf3c53e1ae1bd1afca06c3ad5ac9d5a
parentcc4c1d05eb10c3ad4c6315f1897bc56b1e7429aa
sc16is7xx: Handle modem status lines

The uart_handle_cts_change() and uart_handle_dcd_change() must be called
with port lock being held. Acquire the lock after reading MSR register.
Do not acquire spin lock when reading MSR register because I2C/SPI port
functions cannot be called with spinlocks held.

Update rng and dsr counters. Wake up delta_msr_wait to allow tty notice
modem status change.

Co-developed-by: Lech Perczak <l.perczak@camlintechnologies.com>
Co-developed-by: Tomasz Moń <tomasz.mon@camlingroup.com>
Signed-off-by: Lech Perczak <l.perczak@camlintechnologies.com>
Signed-off-by: Tomasz Moń <tomasz.mon@camlingroup.com>
Link: https://lore.kernel.org/r/20220301060332.2561851-3-tomasz.mon@camlingroup.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sc16is7xx.c