Re: [PATCH v11 2/4] usb: add apis for offload usage tracking

From: Guan-Yu Lin
Date: Wed Apr 16 2025 - 06:21:57 EST


On Fri, Apr 11, 2025 at 10:01 PM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Tue, Apr 08, 2025 at 03:57:22AM +0000, Guan-Yu Lin wrote:
> > @@ -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

Thanks for pointing out the blind spots. I'll change it to an integer
in the next version.

Regards,
Guan-Yu