From: Greg KH <gregkh@linuxfoundation.org>
To: ccc194101@163.com
Cc: jannh@google.com, stern@rowland.harvard.edu,
rex.nie@jaguarmicro.com, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org,
chenchangcheng <chenchangcheng@kylinos.cn>
Subject: Re: [PATCH] usb: usbfs: Add reset_resume callback to usbfs.
Date: Fri, 22 Aug 2025 06:49:23 +0200 [thread overview]
Message-ID: <2025082256-wizard-traverse-1c88@gregkh> (raw)
In-Reply-To: <20250822024602.42894-1-ccc194101@163.com>
On Fri, Aug 22, 2025 at 10:46:02AM +0800, ccc194101@163.com wrote:
> From: chenchangcheng <chenchangcheng@kylinos.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@kylinos.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
next prev parent reply other threads:[~2025-08-22 4:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-22 2:46 [PATCH] usb: usbfs: Add reset_resume callback to usbfs ccc194101
2025-08-22 4:49 ` Greg KH [this message]
2025-08-22 20:30 ` Alan Stern
2025-08-25 1:36 ` 自己
2025-08-25 2:01 ` Alan Stern
2025-08-25 2:19 ` 自己
2025-08-25 9:50 ` Oliver Neukum
2025-08-25 14:04 ` Re: " Alan Stern
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=2025082256-wizard-traverse-1c88@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=ccc194101@163.com \
--cc=chenchangcheng@kylinos.cn \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=rex.nie@jaguarmicro.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;
as well as URLs for NNTP newsgroup(s).