[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <991f7feb-a5bf-4eb4-9623-a13534a02b98@suse.com>
Date: Wed, 17 Jul 2024 09:52:50 +0200
From: Oliver Neukum <oneukum@...e.com>
To: Hongyu Xie <xy521521@...il.com>, stern@...land.harvard.edu,
oneukum@...e.com
Cc: gregkh@...uxfoundation.org, brauner@...nel.org, jlayton@...nel.org,
jack@...e.cz, linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
xiehongyu1@...inos.cn
Subject: Re: [PATCH next] usb: usbfs: Add reset_resume for usbfs
On 17.07.24 05:13, Hongyu Xie wrote:
> From: Hongyu Xie <xiehongyu1@...inos.cn>
> But I still think that there's no need to rebind for a USB device that was using usbfs.
Technically you are correct. From a conceptual view point the only
hard requirement we have is that the first operation after reset_resume()
has to fail with an error code user space can interpret.
> Because rebinding doesn't fix settings lost. And it looks strange from user-space's perspective.
> What do you think?
Only user space can reapply the settings. The kernel, however, must notify
user space of the need to do so and avoiding a race condition is tricky.
However, it is the same race that also applies to a disconnected device and that
problem is solved.
ENODEV clearly is an error that makes clear to user space that settings have
been lost. User space has to be able to deal with a device being disconnected
at any time, as we are talking about USB.
Hence, where is the need to add a special case for reset_resume()?
HTH
Oliver
Powered by blists - more mailing lists