[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2025041107-guru-epilogue-a4b6@gregkh>
Date: Fri, 11 Apr 2025 16:01:06 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Guan-Yu Lin <guanyulin@...gle.com>
Cc: mathias.nyman@...el.com, stern@...land.harvard.edu,
gargaditya08@...e.com, kekrby@...il.com,
jeff.johnson@....qualcomm.com, elder@...nel.org,
quic_zijuhu@...cinc.com, ben@...adent.org.uk,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v11 2/4] usb: add apis for offload usage tracking
On Tue, Apr 08, 2025 at 03:57:22AM +0000, Guan-Yu Lin wrote:
> --- a/include/linux/usb.h
> +++ b/include/linux/usb.h
> @@ -647,6 +647,7 @@ struct usb3_lpm_parameters {
> * parent->hub_delay + wHubDelay + tTPTransmissionDelay (40ns)
> * Will be used as wValue for SetIsochDelay requests.
> * @use_generic_driver: ask driver core to reprobe using the generic driver.
> + * @offload_usage: number of offload activities happening on this usb device.
> *
> * Notes:
> * Usbcore drivers should not set usbdev->state directly. Instead use
> @@ -733,6 +734,8 @@ struct usb_device {
>
> u16 hub_delay;
> unsigned use_generic_driver:1;
> +
> + refcount_t offload_usage;
You now have 2 different "refcounts" for the same structure, which of
course is crazy and will do nothing but cause massive problems.
I know this isn't going to be used to "reference count" the structure,
and surely you don't need/want the atomic properties of a "real"
reference count, so why isn't this a simple integer?
thanks,
greg k-h
Powered by blists - more mailing lists