]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "USB: cdc-acm: fix rounding error in TIOCSSERIAL"
authorJohan Hovold <johan@kernel.org>
Thu, 8 Apr 2021 13:16:00 +0000 (15:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Apr 2021 14:08:27 +0000 (16:08 +0200)
commit5d24fec72ff27c1c2977db1fb68b6af2e6ee5fcb
tree14383a574e37af8dfa25758201d3111cac7aafc5
parent29ca579abd36934f5956ec9da574c45406ffa05c
Revert "USB: cdc-acm: fix rounding error in TIOCSSERIAL"

This reverts commit 984c281a051e5afa5d5e7aee9cc3b5cd6be2dfa3.

The offending commit claimed that trying to set the values reported back
by TIOCGSERIAL as a regular user could result in an -EPERM error when HZ
is 250, but that was never the case.

With HZ=250, the default 0.5 second value of close_delay is converted to
125 jiffies when set and is converted back to 50 centiseconds by
TIOCGSERIAL as expected (not 12 cs as was claimed, even if that was the
case before an earlier fix).

Comparing the internal current and new jiffies values is just fine to
determine if the value is about to change so drop the bogus workaround
(which was also backported to stable).

For completeness: With different default values for these parameters or
with a HZ value not divisible by two, the lack of rounding when setting
the default values in tty_port_init() could result in an -EPERM being
returned, but this is hardly something we need to worry about.

Cc: Anthony Mallet <anthony.mallet@laas.fr>
Cc: stable@vger.kernel.org
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210408131602.27956-2-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-acm.c