From: Akshay Gujar <Akshay.Gujar@harman.com>
To: <gregkh@linuxfoundation.org>
Cc: <Akshay.Gujar@harman.com>, <linux-kernel@vger.kernel.org>,
<linux-usb@vger.kernel.org>, <naveen.v@harman.com>,
<oneukum@suse.com>, <stern@rowland.harvard.edu>
Subject: [PATCH v6 0/3] driver core: add enumeration failure uevent helper
Date: Sun, 2 Aug 2026 23:31:05 +0000 [thread overview]
Message-ID: <20260802233108.70950-1-Akshay.Gujar@harman.com> (raw)
Hotpluggable buses can detect that a device is physically present, but
enumeration may still fail early due to protocol-level errors. Today,
such failures are only reported via kernel log messages, with no
structured userspace notification.
This series adds a small generic helper in the driver core that emits a
KOBJ_CHANGE uevent when enumeration fails, and wires it into the USB hub
enumeration failure path as an initial user.
On emitting the event from the port device itself: I tried adding
usb_port to usb_bus_type and hit an oops in driver_sysfs_add(), seen on
an OTG host-mode switch. usb_port_driver is assigned directly to
port_dev->dev.driver but never registered through driver_register(), so
drv->p is NULL by the time the driver core creates the "driver" symlink.
Putting ports on the bus also exposes them to udev rules matching
SUBSYSTEM=="usb" on every system, which I would prefer to send
separately where it can get the review it deserves.
This version therefore emits from the hub interface with the port named
in the payload, which is tested and working.
---
Changes in v6:
- Split helper into (dev, failed_id) arguments
- Return kobject_uevent_env() error to caller
- Reject NULL or empty failed_id
- Update ABI doc (date, DEVPATH, wording, newline at EOF)
- usb: hub: log warning if uevent fails
Changes in v5:
- Update ABI doc (date, version)
Changes in v4:
- Remove duplicate kerneldoc from device.h; keep only in core.c
- Clarify @dev description
- Update ABI doc (date)
Changes in v3:
- Rename 'parent' to 'dev'
- Remove 'id_name'; derive identifier via dev_name()
- Improve comments and commit messages
- Add kernel-doc in device.h
- Update ABI doc (date, version, example)
- usb: hub: pass &port_dev->dev directly
Changes in v2:
- Move helper from USB-specific code into driver core
- Add ABI documentation
- Split into a 3-patch series
v5: https://lore.kernel.org/all/20260715114028.3627807-1-Akshay.Gujar@harman.com/
v4: https://lore.kernel.org/all/2026071012-hesitancy-doornail-3dab@gregkh/
v3: https://lore.kernel.org/all/0b39693a-d8b0-4c95-97ee-07b3882c4b6a@rowland.harvard.edu/
v2: https://lore.kernel.org/all/2026010726-grimy-variably-b10e@gregkh/
v1: https://lore.kernel.org/all/2025022131-silo-impeach-3f24@gregkh/
Akshay Gujar (3):
driver core: add device_enumeration_failure_notify() helper
Documentation: ABI: document DEVICE_ENUMERATION_FAILURE uevent
usb: hub: send enumeration failure uevent
Documentation/ABI/testing/sysfs-uevent | 37 ++++++++++++++++++++++++++
drivers/base/core.c | 35 ++++++++++++++++++++++++
drivers/usb/core/hub.c | 14 +++++++++-
include/linux/device.h | 2 ++
4 files changed, 87 insertions(+), 1 deletion(-)
base-commit: 02dc699f83d04069fdabc996fc22d47cda47a4a9
--
2.19.0
next reply other threads:[~2026-08-02 23:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-02 23:31 Akshay Gujar [this message]
2026-08-02 23:31 ` [PATCH v6 1/3] driver core: add device_enumeration_failure_notify() helper Akshay Gujar
2026-08-02 23:31 ` [PATCH v6 2/3] Documentation: ABI: document DEVICE_ENUMERATION_FAILURE uevent Akshay Gujar
2026-08-02 23:31 ` [PATCH v6 3/3] usb: hub: send enumeration failure uevent Akshay Gujar
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=20260802233108.70950-1-Akshay.Gujar@harman.com \
--to=akshay.gujar@harman.com \
--cc=gregkh@linuxfoundation.org \
--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