On Thu, May 02, 2024 at 02:24:41PM +0100, Måns Rullgård wrote: > Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> writes: > > > On Thu, May 02, 2024 at 11:45:44AM +0100, Måns Rullgård wrote: > >> Johan Hovold <johan@xxxxxxxxxx> writes: > >> > >> > On Thu, May 02, 2024 at 11:07:28AM +0100, Mans Rullgard wrote: > >> >> Use tty_port_register_device_serdev() so that usb-serial devices > >> >> can be used as serdev controllers. > >> > > >> > I'm afraid it's not that easy. The reason serdev is not enabled for > >> > usb-serial is that there's currently no support for handling hotplug in > >> > serdev. The device can go away from under you at any time and then you'd > >> > crash the kernel. > >> > >> Oh, that's unfortunate. Regular serial ports can go away too, though, > >> and that seems to be handled fine. What am I missing? > > > > How is it handled? Normal serial ports can go away but in practice, > > it's a rare occurance, and usually people use serdev for devices where > > the ports can not be removed (i.e. internal connections). > > If I unbind a regular serial port from its driver using sysfs, a serdev > device defined in a device tree gets removed as expected. Binding the > serial port makes everything come back again. I fail to see any problem > here. If there is one, you'll have to be less evasive in explaining > what it is. Try yanking a usb-serial device out with this patch applied and see what happens. I'm pretty sure serdev will not handle that well, just like if you yank out a pci serial device while it is being used. Doing bind/unbind is not a "surprise" removal, but a nice orderly one :) If this does now work, nice, but I haven't seen the changes to serdev to make this happen, I wonder what changed... thanks, greg k-h