]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: cdc-acm: return correct error code on unsupported break
authorOliver Neukum <oneukum@suse.com>
Thu, 7 Dec 2023 13:26:30 +0000 (14:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:45:23 +0000 (15:45 -0800)
commit31d85bfd47376872fd80fc9bc5dfb9c2e62bba75
tree2b627c8f5ac166ddb60043beccd586209ef18d6c
parent6f4ab8c02427da39f88a7140ac41811a5d746a46
usb: cdc-acm: return correct error code on unsupported break

[ Upstream commit 66aad7d8d3ec5a3a8ec2023841bcec2ded5f65c9 ]

In ACM support for sending breaks to devices is optional.
If a device says that it doenot support sending breaks,
the host must respect that.
Given the number of optional features providing tty operations
for each combination is not practical and errors need to be
returned dynamically if unsupported features are requested.

In case a device does not support break, we want the tty layer
to treat that like it treats drivers that statically cannot
support sending a break. It ignores the inability and does nothing.
This patch uses EOPNOTSUPP to indicate that.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Fixes: 9e98966c7bb94 ("tty: rework break handling")
Link: https://lore.kernel.org/r/20231207132639.18250-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/tty_io.c
drivers/usb/class/cdc-acm.c