mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Prashanth K <prashanth.k@oss.qualcomm.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 3/3] usb: dwc3: Log dwc3 instance name in traces
Date: Tue, 13 Jan 2026 23:38:05 +0000	[thread overview]
Message-ID: <20260113233754.5p325isiaw7v674r@synopsys.com> (raw)
In-Reply-To: <20260113103400.2347763-4-prashanth.k@oss.qualcomm.com>

On Tue, Jan 13, 2026, Prashanth K wrote:
> When multiple DWC3 controllers are being used, trace events from
> different instances get mixed up making debugging difficult as
> there's no way to distinguish which instance generated the trace.
> 
> Use the register base address of dwc3 controller, which is obtained
> from DT/ACPI, and append it to the trace events, so that the source

It's not neccessarily the case if it's a PCI device. I don't think you
need to mention whether it's coming from DT/ACPI.

Also, please fix $subject from "instance name" -> "address"

> instance is clearly identifiable.
> 
> Example trace output,
> before ->  dwc3_event: event (00000101): Reset [U0]
> after  ->  dwc3_event: 0a600000: event (00000101): Reset [U0]
> 
> Signed-off-by: Prashanth K <prashanth.k@oss.qualcomm.com>
> ---
>  drivers/usb/dwc3/core.c   |  5 ++-
>  drivers/usb/dwc3/core.h   |  3 ++
>  drivers/usb/dwc3/ep0.c    |  2 +-
>  drivers/usb/dwc3/gadget.c |  2 +-
>  drivers/usb/dwc3/io.h     |  4 +-
>  drivers/usb/dwc3/trace.h  | 88 ++++++++++++++++++++++++---------------
>  6 files changed, 66 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 670a9d4bfff2..125616489e04 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -158,7 +158,7 @@ void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode, bool ignore_susphy)
>  	dwc3_writel(dwc, DWC3_GCTL, reg);
>  
>  	dwc->current_dr_role = mode;
> -	trace_dwc3_set_prtcap(mode);
> +	trace_dwc3_set_prtcap(dwc, mode);
>  }
>  EXPORT_SYMBOL_GPL(dwc3_set_prtcap);
>  
> @@ -2193,6 +2193,9 @@ int dwc3_core_probe(const struct dwc3_probe_data *data)
>  	dwc_res = *res;
>  	dwc_res.start += DWC3_GLOBALS_REGS_START;
>  
> +	/* Store the base register address for using it in traces later */
> +	dwc->address = (u32)res->start;
> +
>  	if (dev->of_node) {
>  		struct device_node *parent = of_get_parent(dev->of_node);
>  
> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index 23188b910528..a8308087f786 100644
> --- a/drivers/usb/dwc3/core.h
> +++ b/drivers/usb/dwc3/core.h
> @@ -1178,6 +1178,8 @@ struct dwc3_glue_ops {
>   * @wakeup_pending_funcs: Indicates whether any interface has requested for
>   *			 function wakeup in bitmap format where bit position
>   *			 represents interface_id.
> + * @address: The register base address of controller as specified in DT/ACPI.
> + *	     Stored as string & used for logging the controller instance in trace.

Fix the description here. Perhaps something like this: "Cached lower
32-bit base address to be used for logging"

>   */
>  struct dwc3 {
>  	struct work_struct	drd_work;
> @@ -1412,6 +1414,7 @@ struct dwc3 {
>  	struct dentry		*debug_root;
>  	u32			gsbuscfg0_reqinfo;
>  	u32			wakeup_pending_funcs;
> +	u32			address;

While at it, can we move this above "ip" where the other dwc3 attributes
identifying the dwc3 instance are placed?

Thanks,
Thinh

      reply	other threads:[~2026-01-13 23:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-13 10:33 [PATCH v3 0/3] Add the DWC3 " Prashanth K
2026-01-13 10:33 ` [PATCH v3 1/3] usb: dwc3: Remove of dep->regs Prashanth K
2026-01-13 10:33 ` [PATCH v3 2/3] usb: dwc3: Add dwc pointer to dwc3_readl/writel Prashanth K
2026-01-13 10:34 ` [PATCH v3 3/3] usb: dwc3: Log dwc3 instance name in traces Prashanth K
2026-01-13 23:38   ` Thinh Nguyen [this message]

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=20260113233754.5p325isiaw7v674r@synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=prashanth.k@oss.qualcomm.com \
    /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®