mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Guan-Yu Lin <guanyulin@google.com>
Cc: gregkh@linuxfoundation.org, Thinh.Nguyen@synopsys.com,
	mathias.nyman@intel.com, perex@perex.cz, tiwai@suse.com,
	sumit.garg@linaro.org, kekrby@gmail.com, oneukum@suse.com,
	ricardo@marliere.net, lijiayi@kylinos.cn,
	quic_jjohnson@quicinc.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org
Subject: Re: [PATCH v8 5/5] usb: host: enable USB offload during system sleep
Date: Thu, 16 Jan 2025 10:06:27 -0500	[thread overview]
Message-ID: <47efaf4a-8237-4030-8386-5e67a50c3030@rowland.harvard.edu> (raw)
In-Reply-To: <20250116135358.2335615-6-guanyulin@google.com>

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@google.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

  reply	other threads:[~2025-01-16 15:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-16 13:50 [PATCH v8 0/5] Support system sleep with offloaded usb transfers Guan-Yu Lin
2025-01-16 13:50 ` [PATCH v8 1/5] usb: dwc3: separate dev_pm_ops for each pm_event Guan-Yu Lin
2025-01-16 13:50 ` [PATCH v8 2/5] usb: xhci-plat: " Guan-Yu Lin
2025-01-16 13:50 ` [PATCH v8 3/5] usb: add apis for offload usage tracking Guan-Yu Lin
2025-01-16 13:50 ` [PATCH v8 4/5] xhci: sideband: add api to trace sideband usage Guan-Yu Lin
2025-01-16 13:50 ` [PATCH v8 5/5] usb: host: enable USB offload during system sleep Guan-Yu Lin
2025-01-16 15:06   ` Alan Stern [this message]
2025-01-17 14:30     ` Guan-Yu Lin

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=47efaf4a-8237-4030-8386-5e67a50c3030@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=guanyulin@google.com \
    --cc=kekrby@gmail.com \
    --cc=lijiayi@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=oneukum@suse.com \
    --cc=perex@perex.cz \
    --cc=quic_jjohnson@quicinc.com \
    --cc=ricardo@marliere.net \
    --cc=sumit.garg@linaro.org \
    --cc=tiwai@suse.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®