[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-serial
Subject:    Re: g_serial hangs on write when the cable is disconnected
From:       Greg KH <greg () kroah ! com>
Date:       2015-08-05 17:26:40
Message-ID: 20150805172640.GB25008 () kroah ! com
[Download RAW message or body]

On Wed, Aug 05, 2015 at 07:09:27PM +0200, Peter Stuge wrote:
> Greg KH wrote:
> > > >>     int fd = open("/dev/ttyGS0", O_RDWR | O_NONBLOCK);
> > > >
> > > > This line discipline is very different from the "traditional" tty
> > > > line discipline
> ..
> > this is a character device, with a very specific line discipline
> > that works in a very specific way and assumes you know exactly how
> > to talk to it and communicate with it properly.
> 
> If the character device is called tty* then I think it is appropriate
> to expect that it (by default) behaves like a "traditional" tty device.
> 
> How the kernel implements this device internally (ldisc or no)
> shouldn't matter to the user, and if it does I'd consider that a bug.
> (Sadly unfixable, because public API.)
> 
> => Rather than defending unexpected behavior, why not admit that the
> name was poorly chosen and point to the device-specific requirements?

hm, wait, is this really the n_gsm line discipline?  Or is it something
else?

g_serial is the device side of a serial connection, there is no "cable
removed" notification that it even knows about, that has to come from
the gadget driver somehow, which you should listen for and then kick
your userspace program.

Yeah, gadget devices are odd...

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic