Re: question on correct error return from break_ctl()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 30, 2023 at 02:09:48PM +0100, Oliver Neukum wrote:
> 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?

usb-serial should probably change, but given the fact that no one has
noticed this in the 20+ years it has been like this, is it really
needed?  :)

thanks,

greg k-h




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux