[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2025081326-guileless-lego-ec59@gregkh>
Date: Wed, 13 Aug 2025 16:49:57 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Guan-Yu Lin <guanyulin@...gle.com>
Cc: mathias.nyman@...el.com, hannelotta@...il.com,
zijun.hu@....qualcomm.com, xu.yang_2@....com,
stern@...land.harvard.edu, andriy.shevchenko@...ux.intel.com,
ben@...adent.org.uk, quic_wcheng@...cinc.com,
krzysztof.kozlowski@...aro.org, dh10.jung@...sung.com,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v15 2/4] usb: offload: add apis for offload usage tracking
On Fri, Aug 01, 2025 at 03:39:31AM +0000, Guan-Yu Lin wrote:
> Introduce offload_usage and corresponding apis to track offload usage
> on each USB device. Offload denotes that there is another co-processor
> accessing the USB device via the same USB host controller. To optimize
> power usage, it's essential to monitor whether the USB device is
> actively used by other co-processor. This information is vital when
> determining if a USB device can be safely suspended during system power
> state transitions.
>
> Signed-off-by: Guan-Yu Lin <guanyulin@...gle.com>
> ---
> drivers/usb/core/Kconfig | 10 +++
> drivers/usb/core/Makefile | 1 +
> drivers/usb/core/offload.c | 136 +++++++++++++++++++++++++++++++++++++
> drivers/usb/core/usb.c | 1 +
> include/linux/usb.h | 18 +++++
> 5 files changed, 166 insertions(+)
> create mode 100644 drivers/usb/core/offload.c
>
> diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
> index 58e3ca7e4793..d5d38657f929 100644
> --- a/drivers/usb/core/Kconfig
> +++ b/drivers/usb/core/Kconfig
> @@ -143,3 +143,13 @@ config USB_DEFAULT_AUTHORIZATION_MODE
> ACPI selecting value 2 is analogous to selecting value 0.
>
> If unsure, keep the default value.
> +
> +config USB_OFFLOAD
> + bool "Enable USB offload feature"
I'm confused, we already have a "USB offload feature" that went into the
last kernel release, why do we need a separate config option for this as
well? Shouldn't this code only get built if the drivers that need it
select it automatically? Forcing distros to configure this isn't
generally a good idea if at all possible.
> + depends on USB
> + depends on USB_XHCI_SIDEBAND_SUSPEND
> + help
> + Offload denotes that there is another co-processor accessing the
> + USB device via the same USB host controller, creating the
> + "offloaded USB transfers". Say Y to allow offloaded USB
> + transfers during system sleep (Suspend-to-RAM).
Especially because all "desktops" do not want this code selected, so
having it in all distros feels like a waste to me.
thanks,
greg k-h
Powered by blists - more mailing lists