[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2026011406-coyness-latter-aee4@gregkh>
Date: Wed, 14 Jan 2026 12:42:20 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Prashanth K <prashanth.k@....qualcomm.com>
Cc: Thinh Nguyen <Thinh.Nguyen@...opsys.com>, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 3/3] usb: dwc3: Log dwc3 address in traces
On Wed, Jan 14, 2026 at 03:37:48PM +0530, 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 and append it to
> trace events, so that the source 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@....qualcomm.com>
> ---
> drivers/usb/dwc3/core.c | 5 ++-
> drivers/usb/dwc3/core.h | 2 +
> 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, 65 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;
And shouldn't this be dwc_res.start? Why ignore
DWC3_GLOBALS_REGS_START?
And because of that, shouldn't this go below:
> +
> if (dev->of_node) {
> struct device_node *parent = of_get_parent(dev->of_node);
That if statement, which will change the real resource start range
value?
thanks,
greg k-h
Powered by blists - more mailing lists