Linux USB
 help / color / mirror / Atom feed
* question on correct error return from break_ctl()
@ 2023-11-30 13:09 Oliver Neukum
  2023-11-30 13:48 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: Oliver Neukum @ 2023-11-30 13:09 UTC (permalink / raw)
  To: Johan Hovold; +Cc: Greg Kroah-Hartman, Jiri Slaby, USB list, linux-serial

Hi,

it seems inconsistent. The tty layer
in drivers/tty/tty_io.c::send_break()

static int send_break(struct tty_struct *tty, unsigned int duration)
{
         int retval;

         if (tty->ops->break_ctl == NULL)
                 return 0;

not supporting break_ctl() is treated as the operation
succeeding. Yet in drivers/usb/serial/usb-serial.c::serial_break()

static int serial_break(struct tty_struct *tty, int break_state)
{
         struct usb_serial_port *port = tty->driver_data;

         dev_dbg(&port->dev, "%s\n", __func__);

         if (port->serial->type->break_ctl)
                 return port->serial->type->break_ctl(tty, break_state);

         return -ENOTTY;
}

we are seeing that not supporting break_ctl() leads to returning
-ENOTTY, which drivers/tty/tty_io.c::send_break() will return to user space.
These reactions are at odds with each other. What is a driver supposed
to do?

	Regards
		Oliver

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-11-30 15:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-30 13:09 question on correct error return from break_ctl() Oliver Neukum
2023-11-30 13:48 ` Greg Kroah-Hartman
2023-11-30 14:36   ` Oliver Neukum
2023-11-30 14:42     ` Greg Kroah-Hartman
2023-11-30 15:12       ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox