[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] usbredir: remove 'remote wake' capability from configuration
From: |
Gerd Hoffmann |
Subject: |
Re: [PATCH] usbredir: remove 'remote wake' capability from configuration descriptor |
Date: |
Wed, 27 Nov 2019 17:38:23 +0100 |
User-agent: |
NeoMutt/20180716 |
Hi,
> Indeed, it would be good to call usb_wakeup(), but ... there is no
> trigger to do that.
>
> When the guest places the device to D2, it cancels all the urbs that
> were pending, so there are no request that will be completed on spice
> client side that can call usb_wakeup on qemu side.
> The device on spice client side is powered up without any active
> request so the device will not produce wake up event.
Well, the device will produce a wakeup event for sure (unless it is
buggy), so the kernel will notice. It might be that the kernel doesn't
forward the event to userspace though.
For "normal" usb applications the kernel can transparently handle
suspend+wakeup and just re-submit pending urbs to the hardware after
receiving a wakeup event, so powermanagement works automagically without
the app doing anything special.
For qemu + spice-client that approach doesn't work though, we need
explicit instead of automatic power management so we can properly
forward any events to the guest and let the guest deal with it.
Skimming the libusb docs it seems there is no support for that though.
So no easy way out. Guess patching the descriptor is the best thing we
can do here.
> Similar problem happens with local redirection, BTW. But this is for
> another patch.
Can you make a small series for both? I guess the actual descriptor
checking and patching is pretty simliar and can be handled by a shared
helper function.
thanks,
Gerd