public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Akshay Gujar <Akshay.Gujar@harman.com>
Cc: linux-usb@vger.kernel.org, stern@rowland.harvard.edu,
	oneukum@suse.com, linux-kernel@vger.kernel.org,
	naveen.v@harman.com, sankarkumar.krishnasamy@harman.com
Subject: Re: [PATCH v2 3/3] usb: hub: send enumeration failure uevent
Date: Wed, 7 Jan 2026 16:03:46 +0100	[thread overview]
Message-ID: <2026010740-rotunda-squirt-921f@gregkh> (raw)
In-Reply-To: <20251224115808.415753-4-Akshay.Gujar@harman.com>

On Wed, Dec 24, 2025 at 11:58:08AM +0000, Akshay Gujar wrote:
> Use the device_enumeration_failure_notify() helper when USB device
> enumeration fails. This supplements the existing kernel log message with
> a structured userspace-visible notification identifying the affected
> port.
> 
> Signed-off-by: Akshay Gujar <Akshay.Gujar@harman.com>
> ---
>  drivers/usb/core/hub.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index be50d03034a9..c1963b1bb9fb 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -5613,9 +5613,12 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
>  	if (hub->hdev->parent ||
>  			!hcd->driver->port_handed_over ||
>  			!(hcd->driver->port_handed_over)(hcd, port1)) {
> -		if (status != -ENOTCONN && status != -ENODEV)
> +		if (status != -ENOTCONN && status != -ENODEV) {
>  			dev_err(&port_dev->dev,
>  					"unable to enumerate USB device\n");
> +			device_enumeration_failure_notify(port_dev->dev.parent,

Why use the parent here?  Normally devices can NOT access their parent
pointer "safely" so this feels odd.  Why not have the device itself be
the one that emits this, as that's what dev_err() just gave us.

> +							  dev_name(&port_dev->dev));

Why not just get the name directly from the device you are going to pass
in?  It shouldn't then be needed again, right?

thanks,

greg k-h

      parent reply	other threads:[~2026-01-07 15:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250221102949.1135849-1-Akshay.Gujar@harman.com>
2025-02-21 10:53 ` [PATCH] usb: core: notify unrecognized usb device Greg KH
     [not found]   ` <20250826165244.22283-1-Akshay.Gujar@harman.com>
2025-09-06 12:28     ` Greg KH
2025-09-08  8:58       ` Oliver Neukum
2025-09-08  9:04         ` Greg KH
     [not found]       ` <20250918172355.5118-1-Akshay.Gujar@harman.com>
2025-10-08 11:08         ` Greg KH
     [not found]           ` <20251224115808.415753-1-Akshay.Gujar@harman.com>
     [not found]             ` <20251224115808.415753-2-Akshay.Gujar@harman.com>
2026-01-07 15:01               ` [PATCH v2 1/3] driver core: add device_enumeration_failure_notify() helper Greg KH
2026-01-07 15:01             ` [PATCH v2 0/3] Generic device enumeration failure notification Greg KH
     [not found]             ` <20251224115808.415753-3-Akshay.Gujar@harman.com>
2026-01-07 15:02               ` [PATCH v2 2/3] Documentation: ABI: document DEVICE_ENUMERATION_FAILURE uevent Greg KH
     [not found]             ` <20251224115808.415753-4-Akshay.Gujar@harman.com>
2026-01-07 15:03               ` Greg KH [this message]

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=2026010740-rotunda-squirt-921f@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=sankarkumar.krishnasamy@harman.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