mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Hongyu Xie <xy521521@gmail.com>,
	stern@rowland.harvard.edu, oneukum@suse.com
Cc: gregkh@linuxfoundation.org, brauner@kernel.org,
	jlayton@kernel.org, jack@suse.cz, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, xiehongyu1@kylinos.cn
Subject: Re: [PATCH next] usb: usbfs: Add reset_resume for usbfs
Date: Wed, 17 Jul 2024 09:52:50 +0200	[thread overview]
Message-ID: <991f7feb-a5bf-4eb4-9623-a13534a02b98@suse.com> (raw)
In-Reply-To: <45b87923-d256-4c5e-8167-8ef764add1e9@kylinos.cn>

On 17.07.24 05:13, Hongyu Xie wrote:
> From: Hongyu Xie <xiehongyu1@kylinos.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


  reply	other threads:[~2024-07-17  7:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11  8:43 Hongyu Xie
2024-07-11  8:59 ` Oliver Neukum
2024-07-11 14:41   ` Alan Stern
2024-07-15  8:53     ` Oliver Neukum
2024-07-15 14:22       ` Alan Stern
2024-07-16 12:44         ` Oliver Neukum
2024-07-17  1:43           ` Hongyu Xie
2024-07-17  2:05             ` Alan Stern
2024-07-17  3:13               ` Hongyu Xie
2024-07-17  7:52                 ` Oliver Neukum [this message]
2024-07-17 13:44                 ` Alan Stern
2024-07-17 15:27                   ` Oliver Neukum
2024-07-17  7:42             ` Oliver Neukum
2024-07-18  3:23               ` Hongyu Xie
2024-07-12  3:10   ` Hongyu Xie
2024-07-13  2:22     ` Alan Stern
2024-07-15  1:13       ` Hongyu Xie
2024-07-15  8:40         ` Oliver Neukum

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=991f7feb-a5bf-4eb4-9623-a13534a02b98@suse.com \
    --to=oneukum@suse.com \
    --cc=brauner@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jack@suse.cz \
    --cc=jlayton@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=xiehongyu1@kylinos.cn \
    --cc=xy521521@gmail.com \
    /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

all inboxes | Powered by JetHome®