Re: [PATCH] usb: usbfs: Add reset_resume callback to usbfs.
From: Alan Stern
Date: Fri Aug 22 2025 - 16:31:11 EST
On Fri, Aug 22, 2025 at 10:46:02AM +0800, ccc194101@xxxxxxx wrote:
> From: chenchangcheng <chenchangcheng@xxxxxxxxxx>
>
> 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.
usbfs has no way to inform userspace when the device is reset. This is
true for normal resets as well as for reset-resumes (no pre_reset,
post_reset, or reset_resume callbacks). I don't see any point in trying
to add support for the latter but not the former.
Unbinding the device forces userspace to re-open the device file and
establish a new binding. How does adding REMOVE and ADD uevents make
the situation any better than it already is?
Alan Stern