lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260113013842.ryvstb6tmdmyqno6@synopsys.com>
Date: Tue, 13 Jan 2026 01:38:53 +0000
From: Thinh Nguyen <Thinh.Nguyen@...opsys.com>
To: Prashanth K <prashanth.k@....qualcomm.com>
CC: Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 3/3] usb: dwc3: Log dwc3 instance name in traces

On Fri, Jan 09, 2026, Prashanth K wrote:
> 
> 
> On 1/9/2026 6:48 AM, Thinh Nguyen wrote:
> > On Mon, Jan 05, 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.
> >>
> >> Append the base address of dwc3 controller 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   |  6 ++-
> >>  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, 66 insertions(+), 38 deletions(-)
> >>
> >> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> >> index 670a9d4bfff2..3aa85f5f1c47 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,10 @@ int dwc3_core_probe(const struct dwc3_probe_data *data)
> >>  	dwc_res = *res;
> >>  	dwc_res.start += DWC3_GLOBALS_REGS_START;
> >>  
> >> +	/* Store the physical base address for logging in trace */
> >> +	snprintf(dwc->base_addr, sizeof(dwc->base_addr), "%08llx",
> >> +		 (unsigned long long)res->start);
> >> +
> > 
> > Why string?
> > 
> >>  	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..c16e47273ea0 100644
> >> --- a/drivers/usb/dwc3/core.h
> >> +++ b/drivers/usb/dwc3/core.h
> >> @@ -1178,6 +1178,7 @@ 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.
> >> + * @base_addr: The HW base address of DWC3 controller.
> >>   */
> >>  struct dwc3 {
> >>  	struct work_struct	drd_work;
> >> @@ -1412,6 +1413,7 @@ struct dwc3 {
> >>  	struct dentry		*debug_root;
> >>  	u32			gsbuscfg0_reqinfo;
> >>  	u32			wakeup_pending_funcs;
> >> +	char			base_addr[9];
> > 
> > Can this be u32?
> > 
> Sure, will change it. And also rename it to dwc3_reg_base.
> Let me know if that needs to be changed.
> 

If we want to rename it, perhaps just call it "address".

Thanks!
Thinh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ