Linux USB
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Akshay Gujar <Akshay.Gujar@harman.com>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	naveen.v@harman.com, oneukum@suse.com, stern@rowland.harvard.edu
Subject: Re: [PATCH v5 2/3] Documentation: ABI: document DEVICE_ENUMERATION_FAILURE uevent
Date: Mon, 27 Jul 2026 21:31:54 +0200	[thread overview]
Message-ID: <2026072747-snowshoe-outrank-7a49@gregkh> (raw)
In-Reply-To: <20260727133232.556324-1-Akshay.Gujar@harman.com>

On Mon, Jul 27, 2026 at 01:32:32PM +0000, Akshay Gujar wrote:
> On Sat, Jul 25, 2026 at 07:21:30AM +0200, Greg KH wrote:
> > > > > +What:          DEVICE_ENUMERATION_FAILURE
> > > > > +Date:          July 2026
> > > > > +KernelVersion: 7.3
> > > > > +Description:
> > > > > +               Some devices may be detected but fail to enumerate
> > > > > +               due to protocol-level errors or invalid responses.
> > > > > +
> > > > > +               A KOBJ_CHANGE uevent includes the following environment
> > > > > +               variable when this occurs:
> > > > > +
> > > > > +                 DEVICE_ENUMERATION_FAILURE=<dev_name>
> > > > > +
> > > > > +               The value is the kernel device name of the device for
> > > > > +               which enumeration failed, as returned by dev_name().
> > > > > +
> > > > > +               Example (USB):
> > > > > +
> > > > > +               ACTION=change
> > > > > +               SUBSYSTEM=usb
> > > > > +               DEVTYPE=usb_interface
> > > > 
> > > > This will be the port device, not the usb interface, right?
> > > 
> > > No, DEVTYPE=usb_interface is correct, the example was captured on
> > > real hardware. The uevent is not emitted from the port device itself.
> > > usb_port devices have no bus or class, so dev_uevent_filter()
> > > drops any event from them.It is emitted from the port's parent, 
> > > the hub's usb_interface device, while the failing port is identified in the payload instead.
> 
> > So shouldn't we fix the fact that usb_ports are not on the bus and add
> > them to one?  Would that make things more obvious here as to what port
> > the issue is happening on, and potentially allow userspace to actually
> > figure out which physical port the problem is?
> 
> Adding usb_port devices to usb_bus_type does not fit. usb_device_match()
> only handles usb_device and usb_interface, so ports would fall through
> unmatched, and bus-managed binding would conflict with the existing
> usb_port_driver assignment.

We can change usb_device_match() to not do that :)

> Userspace can already resolve the physical port directly from the
> event today:
> 
>   DEVPATH=/devices/.../usb1/1-0:1.0
>   DEVICE_ENUMERATION_FAILURE=usb1-port1
> 
> which corresponds to:
>   -> /sys/devices/.../usb1/1-0:1.0/usb1-port1
> 
> Appending the payload name to DEVPATH gives the exact sysfs path to
> the failing port on the hub.

That feels odd, as the port is the device having the problem.

> I dropped the DEVPATH line from the documentation example by mistake.
> Will restore it in v6 so the emitter/payload relationship is clear.

Ok, maybe your next version will make more sense, as I'm confused now :)

thanks,

greg k-h

  reply	other threads:[~2026-07-27 19:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15 11:40 [PATCH v5 0/3] driver core: add enumeration failure uevent helper Akshay Gujar
2026-07-15 11:40 ` [PATCH v5 1/3] driver core: add device_enumeration_failure_notify() helper Akshay Gujar
2026-07-17 10:40   ` Greg KH
2026-07-24 22:22     ` Akshay Gujar
2026-07-15 11:40 ` [PATCH v5 2/3] Documentation: ABI: document DEVICE_ENUMERATION_FAILURE uevent Akshay Gujar
2026-07-17 10:37   ` Greg KH
2026-07-24 22:25     ` Akshay Gujar
2026-07-25  5:21       ` Greg KH
2026-07-27 13:32         ` Akshay Gujar
2026-07-27 19:31           ` Greg KH [this message]
2026-07-15 11:40 ` [PATCH v5 3/3] usb: hub: send enumeration failure uevent Akshay Gujar
2026-07-17 10:35 ` [PATCH v5 0/3] driver core: add enumeration failure uevent helper Greg KH
2026-07-24 22:26   ` Akshay Gujar
2026-07-26 23:14 ` Michal Pecio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026072747-snowshoe-outrank-7a49@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=Akshay.Gujar@harman.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=naveen.v@harman.com \
    --cc=oneukum@suse.com \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox