From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796354551; b=WiCjiX/fXjhyHL3JpHHLgc47GHqPM61xB50OZNifSfFw2EJAmuPN/zmrLOieBcbeFbw8 ELXokH+5yKlYsk5ZOuyJAdTj1kdnnM5sHVUA4OBV7iU5nwwSeuEWipMQ5GbBKLDDY5jNy Lg/xC1CV8MwFKWtJfDBLWm6RX8CbI0gTgA9FWQVnhyNH00AjV+Q5Y9ZKAndx8f8xJqPLs gyHOrwRTF695uXyvBypOrTNtjg9ISmbllVRAD6yIPRW5W8fbwC8foF/hWzQMRm6Qulko/ YsUEDVM0ZcsQ/rbu7ANL+VSJ5ype+Z2wbx5w5x99zfUs/qr5Hz3DoMilIj9261pjahw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796354551; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=2WR77vBAbeQkT6eGwlXLirmZwOAs2DtHAPA+K3P7tO0=; b=gRO7dhDFaiQKlhgAvUFeKBv09UldGApl7lzaI2MWC/DUrUAAgsRgSlcalATjwuWb02MN R3gi4McrLM1Y0TsABFplB8VoDipnm9fBVod8g0by5zBBmf8RLwL4opXHlSmNcr9dtyCcc ouF+pbnrw8jVGIwlu8Vnu9fr4Uei3QxYIDu1O83OyYwNHRztuV9CxDHrv5Nz74OQaOaNe MnB8oYYbUxCtktlSGO24QfUsqDxFG9bTbzF9TXUuijkjXja5GrnKrESXpoTdkN4OlgiIz sDoxUsTWN7qQRmcXywhkDOr/JyaNK6LQTcTNBcOtUkdv/wRc+I2er5KAqnMAv0zjgYg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="V+YbHHS/"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A336606A32D; Fri, 4 Dec 2026 03:22:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=V+YbHHS/ Received: by smtp.kernel.org (Postfix) with ESMTPSA id A431D1F0092C; Fri, 4 Dec 2026 03:22:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796354550; bh=2WR77vBAbeQkT6eGwlXLirmZwOAs2DtHAPA+K3P7tO0=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=V+YbHHS/qCuJOs/C355eCLZej8lwcBKk8nEOCtZCKE4FzDj7se6fqLc3WkJMwoMzM L8Dn+4L6iWVjjqm+uGYTSBxyu0savEiPgZ82RbRD7ANsg0w5NFAAHK8R7KnKmnn6mk c995EsH2W44d4D78RzI1H7jTadNUeqsSIyPt17Ek= Date: Thu, 3 Dec 2026 18:15:21 +0100 From: Greg KH To: Akshay Gujar 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 v6 3/3] usb: hub: send enumeration failure uevent Message-ID: <2026120300-tall-coming-c742@gregkh> References: <20260802233108.70950-1-Akshay.Gujar@harman.com> <20260802233108.70950-4-Akshay.Gujar@harman.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260802233108.70950-4-Akshay.Gujar@harman.com> On Sun, Aug 02, 2026 at 11:31:08PM +0000, Akshay Gujar wrote: > Emit a structured uevent when USB device enumeration fails in > hub_port_connect(), supplementing the existing error log with a > notification userspace can act on. > > The event is emitted from the port's parent, the hub interface, because > usb_port devices have neither a bus nor a class and dev_uevent_filter() > drops any uevent sent from them. The failing port is named in the > payload. > > Signed-off-by: Akshay Gujar > --- > drivers/usb/core/hub.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c > index 5262e11c12cd3..78275dd702ceb 100644 > --- a/drivers/usb/core/hub.c > +++ b/drivers/usb/core/hub.c > @@ -5613,9 +5613,21 @@ 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) { > + int ret; > dev_err(&port_dev->dev, > "unable to enumerate USB device\n"); > + > + /* usb_port has no bus or class, so uevents from it > + * are dropped; emit from the hub interface instead. > + */ > + ret = device_enumeration_failure_notify(port_dev->dev.parent, > + dev_name(&port_dev->dev)); This still feels wrong, the port is a device, and as such should be the thing that emits the event so that you know exactly what port had the problem (otherwise you have to somehow parse the name of the port in the string after the device name, which is wrong...) Also the comment is in the wrong style. I could live with that, but not the port issue. If the real solution is to put the port on the bus, or have a class, then do that as that needs to be fixed up so you get the actual port that is having the problem here, not the "hub". thanks, greg k-h