>> >> > > > But now I wonder, maybe we could just remove the whole block? Is >> >> > > > there >> >> > > > any case nowadays were we don't get port event removals? If this >> >> > > > was a >> >> > > > hack for a bug in kernel 2.6.31, maybe we could consider it >> >> > > > already >> >> > > > obsoleted? >> >> > > >> >> > > >> >> > > >> >> > > Yeah, this comes from an old commit >> >> > > 53af144f49b0d81bd4dc1f5ee9eea6d61ccae992 >> >> > > (udev: handle removal of parent usb devices) dated back to 2009, >> >> > > which seems >> >> > > to imply that the kernel doesn't remove the tty when the usb device >> >> > > is >> >> > > removed. I guess it's probably not hard to reproduce the steps, but >> >> > > I'm not >> >> > > sure if the original fix was related to a particular kernel version >> >> > > or a >> >> > > particular devices or a combination of both. >> >> > > >> >> > >> >> > Dan, what do you think? >> >> > >> >> > From my POV, I would nuke that device removal logic right away now... >> >> >> >> I'll have to think about that one, but I'm on vacation all this coming >> >> week so I might not have a reply soon. IIRC it may have been related >> >> to before the tty subsystem was fully sysfs/kevent ported. I think we >> >> could be reasonably sure about it if we test a bunch of old modems with >> >> the block removed. >> > >> > >> > Aleksander, in the meantime, should I submit a patch to guard this block >> > of >> > code with a check DEVTYPE==usb_device? That would at least address the >> > issue >> > I observed on my Huawei modem. WDYT? >> > >> >> Yes, this is something we can do, and would also be a safe update for >> stable branches. > > > sgtm, let me know if the previously attached patch looks reasonable to you. > I'm not sure if we need to do anything if udev is disabled. >
When udev is disabled, we rely on the user reporting port addition/removals via the ReportKernelEvent() API. This API only allows reporting port addition/removals (i.e. no interface or device removals). So in theory, even without the #ifdef WITH_UDEV the code would work correctly, but I guess it doesn't harm for now having it. -- Aleksander https://aleksander.es _______________________________________________ ModemManager-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
