Re: [PATCH] USB: serial: Support attaching serdev devices

From: Alban Bedel

Date: Thu Sep 17 2026 - 12:44:42 EST


On Thu, 17 Sep 2026 15:08:11 +0100
Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:

> On Thu, Sep 17, 2026 at 03:37:36PM +0200, Alban Bedel wrote:
> > On Thu, 17 Sep 2026 09:27:42 +0100
> > Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> >
> > > On Thu, Sep 17, 2026 at 10:11:03AM +0200, Alban Bedel wrote:
> > > > Use tty_port_register_device_serdev() to allow attaching serdev
> > > > devices to USB serial ports. Also set the ACPI companion device on the
> > > > USB serial device to let the serdev matching work on ACPI systems.
> > >
> > > "also" should be a separate patch, right?
> >
> > Will do.
> >
> > > And I didn't think that serdev could handle devices going away at any
> > > point in time, when did that change? How was this all tested and what
> > > ACPI device wants to use this?
> >
> > The use case here is an x86 embedded platform with a soldered USB serial
> > adapter connecting to a MAX9265 GMSL serializer. As everything is on a
> > single PCB there is no question of anything getting disconnected at
> > runtime.
>
> You hope :)

Obviously anything can fail, but I don't see why that should be treated
differently than an UART connected via PCI or LPC. The link could also
fail anytime.

> > But I now see that I missed that the bus remove also need to be
> > adjusted to use tty_port_unregister_device() instead of
> > tty_unregister_device(). With that done the serdev device get properly
> > taken down when I manually disable the port. With a small fix to the
> > serdev core it also comes back up when the port is enabled again.
>
> Please read the archives for why we don't want to do this unless/until
> serdev is "fixed" to properly handle dynamic device removals.

All I could find is the "USB-Serial serdev support" thread from last
year which sadly doesn't provides much details. Like Marco Felsch back
then I tested disabling/enabling the USB port and didn't have any
issue, the serdev device get removed and added back just fine. In my
case the serdev driver provides an I2C bus, all devices on it get
removed and added back again as well and work just fine.

I really fail to see an issue in pratice, would you care to explain
what I'm missing here?

> > The ACPI part is a custom DSDT overlay that defines the chain
> > starting from the USB port. At this level there is no difference to
> > classic UART where serdev are already working.
>
> So acpi now defines USB to serial devices? Is that new?

UARTSerialBusV2() is there to define devices using an UART, the
specification doesn't mention any limitation on the kind of UART it can
be pointed at. What is the issue here?

Alban