mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Alan Stern <stern@rowland.harvard.edu>,
	Greg KH <gregkh@linuxfoundation.org>
Cc: Zongmin Zhou <min_halo@163.com>,
	shuah@kernel.org, valentina.manea.m@gmail.com, i@zenithal.me,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	zhouzongmin@kylinos.cn, Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v2] usbip: convert to use faux_device
Date: Wed, 9 Jul 2025 15:57:35 -0600	[thread overview]
Message-ID: <4478924b-fbd7-4a5a-ad0d-4fe0569b4971@linuxfoundation.org> (raw)
In-Reply-To: <ce96291b-c0b2-41cf-a71c-c13bd8d0f139@linuxfoundation.org>

On 7/9/25 15:49, Shuah Khan wrote:
> On 7/9/25 08:20, Alan Stern wrote:
>> On Wed, Jul 09, 2025 at 12:06:57PM +0200, Greg KH wrote:
>>> On Wed, Jul 09, 2025 at 05:07:24PM +0800, Zongmin Zhou wrote:
>>>>>> In fact, I've experimented with adding PM hooks to the faux bus,
>>>>>> and found that faux bus devices then behave identically to platform
>>>>>> bus devices during suspend/resume.
>>>>>> See the attachment.
>>>>>>
>>>>>
>>>>> Thanks for checking this scenario. No surprises here.
>>>> Another part of my purpose in doing this is that the vhci-hcd driver seems
>>>> should still retain suspend/resume hooks. Therefore, the faux bus should
>>>> add corresponding hooks to allow the driver to call its own pm functions.
>>>> Though currently don't know how to fix this problem yet.
>>>
>>> I have no problem with adding the pm functions to the faux bus, BUT it
>>> needs to make sense as to why they would be needed at all as this is not
>>> a "real" device or bus that should need to do anything when
>>> suspend/resume happens.
>>
>> The unique problem faced by vhci-hcd is that the devices it controls
>> reside on external computer systems that have a lot of their own state,
>> much more than ordinay USB devices have.  Consequently vhci-hcd may need
>> to do more work for a PM transition than a normal driver would.
>>
>> As an analogy, suppose you're running a program that has an open TCP
>> connection to an external server.  If you suspend your computer, it
>> won't be able to send the TCP keepalive packets that the server expects,
>> and the server will eventually close the connection.  Then when your
>> computer resumes, your program may misbehave when it finds its
>> connection has spontaneously been closed for no apparent reason.
>>
> 
> Right. We have a few too many moving pieces here:
> 
> usbipd (user-space)
> vhci_hcd and the usb devices it creates
> 
> usbip_host, stub driver that proxies between the device
> on the server and vhci_client.
> 
> PM can be complex and it has to do lot more than it currently
> does on both server and client end to support seamlessly.
> 
> The current suspend took the approach of refusing suspend
> which doesn't work since usb devices underneath hang in
> usb_dev_resume(). Looks like this usb device is treated like
> a real device bu usb core. Is there a way to have usb core
> PM (suspend and resume) handle them as virtual? Would it
> help to use "supports_autosuspend" to disable suspend and
> resume?

Would it work if usb_disable_autosuspend() on the devices
that hang off its vitual bus?

thanks,
-- Shuah

  reply	other threads:[~2025-07-09 21:57 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-08  9:11 [PATCH 0/2] some changes based on faux bus Zongmin Zhou
2025-05-08  9:11 ` [PATCH 1/2] driver core:add device's platform_data set for faux device Zongmin Zhou
2025-05-08  9:45   ` Greg KH
2025-05-09  2:41     ` Zongmin Zhou
2025-05-21 10:51       ` Greg KH
2025-05-28  9:21         ` Zongmin Zhou
2025-05-08  9:11 ` [PATCH 2/2] usbip: convert to use faux_device Zongmin Zhou
2025-05-09 10:42   ` kernel test robot
2025-06-04  6:54   ` [PATCH v2] " Zongmin Zhou
2025-06-10 15:15     ` Shuah Khan
2025-06-19 11:02       ` Greg KH
2025-06-19 11:01     ` Greg KH
2025-06-20  2:16       ` Zongmin Zhou
2025-06-20  4:29         ` Greg KH
2025-06-20  9:19           ` Zongmin Zhou
2025-06-20  9:27             ` Greg KH
2025-06-20 17:26               ` Shuah Khan
2025-06-24  3:21                 ` Zongmin Zhou
2025-07-01 22:56                   ` Shuah Khan
2025-07-02  2:12                     ` Zongmin Zhou
2025-07-02 23:54                       ` Shuah Khan
2025-07-03  6:04                         ` Zongmin Zhou
2025-07-08 18:16                           ` Shuah Khan
2025-07-09  9:07                             ` Zongmin Zhou
2025-07-09 10:06                               ` Greg KH
2025-07-09 14:20                                 ` Alan Stern
2025-07-09 21:49                                   ` Shuah Khan
2025-07-09 21:57                                     ` Shuah Khan [this message]
2025-07-10 14:06                                       ` Alan Stern
2025-07-10 20:33                                         ` Shuah Khan
2025-07-11  5:56                                           ` Greg KH
2025-07-14  5:31                                           ` Zongmin Zhou
2025-07-09 21:33                               ` Shuah Khan

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=4478924b-fbd7-4a5a-ad0d-4fe0569b4971@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=i@zenithal.me \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=min_halo@163.com \
    --cc=shuah@kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=valentina.manea.m@gmail.com \
    --cc=zhouzongmin@kylinos.cn \
    /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®