[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47efaf4a-8237-4030-8386-5e67a50c3030@rowland.harvard.edu>
Date: Thu, 16 Jan 2025 10:06:27 -0500
From: Alan Stern <stern@...land.harvard.edu>
To: Guan-Yu Lin <guanyulin@...gle.com>
Cc: gregkh@...uxfoundation.org, Thinh.Nguyen@...opsys.com,
mathias.nyman@...el.com, perex@...ex.cz, tiwai@...e.com,
sumit.garg@...aro.org, kekrby@...il.com, oneukum@...e.com,
ricardo@...liere.net, lijiayi@...inos.cn, quic_jjohnson@...cinc.com,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-sound@...r.kernel.org
Subject: Re: [PATCH v8 5/5] usb: host: enable USB offload during system sleep
On Thu, Jan 16, 2025 at 01:50:17PM +0000, Guan-Yu Lin wrote:
> Sharing a USB controller with another entity via xhci-sideband driver
> creates power management complexities. To prevent the USB controller
> from being inadvertently deactivated while in use by the other entity, a
> usage-count based mechanism is implemented. This allows the system to
> manage power effectively, ensuring the controller remains available
> whenever needed.
> In order to maintain full functionality of an offloaded USB devices,
> several changes are made within the suspend flow of such devices:
> - skip usb_suspend_device() so that the port/hub are still active for
> USB transfers via offloaded path.
> - not suspending the endpoints which are used by USB interfaces marked
> with needs_remote_wakeup. Namely, skip usb_suspend_interface() and
> usb_hcd_flush_endpoint() on associated USB interfaces. This reserves a
> pending interrupt urb during system suspend for handling the interrupt
> transfer, which is necessary since remote wakeup doesn't apply in the
> offloaded USB devices when controller is still active.
> - not flushing the endpoints of actively offloaded USB devices. Given
> that the USB devices is used by another entity, unilaterally flush the
> endpoint might lead to unexpected behavior on another entity.
>
> Signed-off-by: Guan-Yu Lin <guanyulin@...gle.com>
> ---
> diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
> index 1bbf9592724f..6441742869ff 100644
> --- a/drivers/usb/core/driver.c
> +++ b/drivers/usb/core/driver.c
> @@ -1413,19 +1413,31 @@ static int usb_resume_interface(struct usb_device *udev,
> */
> static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
> {
> - int status = 0;
> - int i = 0, n = 0;
> - struct usb_interface *intf;
> + int status = 0;
> + int i = 0, n = 0;
> + bool offload = false;
> + struct usb_interface *intf;
Unnecessary whitespace change. Please remove this from the patch.
Alan Stern
Powered by blists - more mailing lists