On Tue, 1 Mar 2016, Felipe Balbi wrote:

> Hi,
> 
> Robert Baldyga <r.bald...@samsung.com> writes:
> >> Olivier Schonken <olivier.schon...@gmail.com> writes:
> >>> Hope I'm not raising an issue which actually is my own stupidity.
> >>>
> >>> I recently upstreamed my embedded Linux kernel to version 4.4, after which
> >>> I started experiencing issues with my serial gadget - acm and obex.  I 
> >>> used
> >>> to be able to run a getty console on it through a systemd service, which
> >>> would restart everytime it was unplugged, and plugged in again.  With
> >>> kernel 4.4, this stopped working as usual(On startup console would word,
> >>> but if plugged out and in again, console is frozen), and I traced it back
> >>> to the series of patches "usb: gadget: introduce 'enabled' flag in struct
> >>> usb_ep".  If I revert these patches, everything works as normal again.  As
> >>> you are the owner of these patches, I thought that you might help me
> >>> understand if I'm doing something wrong w.r.t. re-initializing the console
> >>> getty, or if something really got broken.
> >> 
> >> This is short of email where the mailing list should be in Cc :-)
> >> 
> >> The author of that series was Robert (now in Cc). Robert, does this ring
> >> any bells to you ?
> >> 
> >
> > I have tested it with getty (without systemd) and it looks like getty
> > hangs up after replugging no matter if patch is applied or not, so
> > without systemd it won't work anyway.
> >
> > Hence how systemd handles this is the key here, however I have no idea
> > how systemd knows that USB device is unplugged. On device side
> > /dev/ttyGS0 exists regardless to ACM function state, so process which
> > opened this device file has no way to figure out whether connection to
> > host is active or not. Can you explain how systemd knows that device is
> > unplugged? This knowledge can be helpful.
> 
> there should be a SIGHUP when cable's removed, no ?

More to the point, udev is now part of systemd, and udev certainly 
knows when a device has been added or removed.  It gets messages 
directly from the kernel whenever one of those events occurs.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to