Re: [PATCH v4 5/5] usb: host: enable sideband transfer during system sleep

From: Greg KH
Date: Wed Oct 09 2024 - 08:51:22 EST


On Wed, Oct 09, 2024 at 05:42:59AM +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.
>
> Signed-off-by: Guan-Yu Lin <guanyulin@xxxxxxxxxx>
> ---
> drivers/usb/core/driver.c | 10 ++++++++++
> drivers/usb/core/hcd.c | 1 +
> drivers/usb/core/usb.c | 1 +
> drivers/usb/dwc3/core.c | 13 +++++++++++++
> drivers/usb/dwc3/core.h | 8 ++++++++
> drivers/usb/host/xhci-plat.c | 10 ++++++++++
> drivers/usb/host/xhci-plat.h | 7 +++++++
> sound/usb/qcom/qc_audio_offload.c | 3 +++
> 8 files changed, 53 insertions(+)
>
> diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
> index c1ba5ed15214..83726bf88fb6 100644
> --- a/drivers/usb/core/driver.c
> +++ b/drivers/usb/core/driver.c
> @@ -1583,6 +1583,11 @@ int usb_suspend(struct device *dev, pm_message_t msg)
> struct usb_device *udev = to_usb_device(dev);
> int r;
>
> + if (msg.event == PM_EVENT_SUSPEND && usb_sideband_check(udev)) {
> + dev_info(dev, "device active, skip %s", __func__);

When drivers work properly, they are quiet. Why all of the loud
shouting in this patch as it goes about it's business?

also, __func__ is redundant in dev_*() calls :)

thanks,

greg k-h