From: Greg KH <gregkh@linuxfoundation.org>
To: Guan-Yu Lin <guanyulin@google.com>
Cc: mathias.nyman@intel.com, stern@rowland.harvard.edu,
gargaditya08@live.com, kekrby@gmail.com,
jeff.johnson@oss.qualcomm.com, elder@kernel.org,
quic_zijuhu@quicinc.com, ben@decadent.org.uk,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v11 2/4] usb: add apis for offload usage tracking
Date: Fri, 11 Apr 2025 16:01:06 +0200 [thread overview]
Message-ID: <2025041107-guru-epilogue-a4b6@gregkh> (raw)
In-Reply-To: <20250408035833.844821-3-guanyulin@google.com>
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
next prev parent reply other threads:[~2025-04-11 14:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 3:57 [PATCH v11 0/4] Support system sleep with offloaded usb transfers Guan-Yu Lin
2025-04-08 3:57 ` [PATCH v11 1/4] usb: xhci-plat: separate dev_pm_ops for each pm_event Guan-Yu Lin
2025-04-08 3:57 ` [PATCH v11 2/4] usb: add apis for offload usage tracking Guan-Yu Lin
2025-04-11 14:01 ` Greg KH [this message]
2025-04-16 10:21 ` Guan-Yu Lin
2025-04-08 3:57 ` [PATCH v11 3/4] xhci: sideband: add api to trace sideband usage Guan-Yu Lin
2025-04-08 3:57 ` [PATCH v11 4/4] usb: host: enable USB offload during system sleep Guan-Yu Lin
2025-04-09 15:17 ` Alan Stern
2025-04-16 9:26 ` Guan-Yu Lin
2025-04-11 14:02 ` Greg KH
2025-04-16 10:05 ` 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=2025041107-guru-epilogue-a4b6@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=ben@decadent.org.uk \
--cc=elder@kernel.org \
--cc=gargaditya08@live.com \
--cc=guanyulin@google.com \
--cc=jeff.johnson@oss.qualcomm.com \
--cc=kekrby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=quic_zijuhu@quicinc.com \
--cc=stern@rowland.harvard.edu \
/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®