[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2025082256-wizard-traverse-1c88@gregkh>
Date: Fri, 22 Aug 2025 06:49:23 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: ccc194101@....com
Cc: jannh@...gle.com, stern@...land.harvard.edu, rex.nie@...uarmicro.com,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
chenchangcheng <chenchangcheng@...inos.cn>
Subject: Re: [PATCH] usb: usbfs: Add reset_resume callback to usbfs.
On Fri, Aug 22, 2025 at 10:46:02AM +0800, ccc194101@....com wrote:
> From: chenchangcheng <chenchangcheng@...inos.cn>
>
> When an Apple device is inserted into the host, and the host
> wakes up from S3/S4 power states, if the reset_resume process
> is triggered, the absence of a reset_resume callback in usbfs will
> cause the device to unbind.
> By adding a reset_resume callback to usbfs and reporting REMOVE and ADD
> uevents in reset_resume, the userspace is prompted to reissue commands
> to re-establish the binding with usbfs.
>
> Signed-off-by: chenchangcheng <chenchangcheng@...inos.cn>
Nit, we need a "real name", see the kernel documentation for details.
> ---
> drivers/usb/core/devio.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
> index f6ce6e26e0d4..358850596b0d 100644
> --- a/drivers/usb/core/devio.c
> +++ b/drivers/usb/core/devio.c
> @@ -749,6 +749,14 @@ static int driver_resume(struct usb_interface *intf)
> return 0;
> }
>
> +static int driver_reset_resume(struct usb_interface *intf)
> +{
> + struct usb_device *udev = interface_to_usbdev(intf);
> +
> + kobject_uevent(&udev->dev.kobj, KOBJ_REMOVE);
> + kobject_uevent(&udev->dev.kobj, KOBJ_ADD);
But the object is not being removed and added. So why lie like this?
How does userspace now handle this as the device did not go away?
This feels odd, what changed to require this kernel change to be added?
thanks,
greg k-h
Powered by blists - more mailing lists