mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Prashanth K <prashanth.k@oss.qualcomm.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] usb: dwc3: Log dwc3 instance name in traces
Date: Wed, 7 Jan 2026 14:35:26 +0530	[thread overview]
Message-ID: <16c3b03f-198a-487a-9e1b-b772b61441ff@oss.qualcomm.com> (raw)
In-Reply-To: <2026010747-darkroom-peso-24fb@gregkh>



On 1/7/2026 12:10 PM, Greg Kroah-Hartman wrote:
> On Wed, Jan 07, 2026 at 11:33:11AM +0530, Prashanth K wrote:
>> On 1/6/2026 3:28 PM, Greg Kroah-Hartman wrote:
>> +	snprintf(dwc->base_addr, sizeof(dwc->base_addr), "%08llx",
>> +		 (u64)res->start);
>>
>>> And are you _sure_ it is ok to expose that to userspace?
>>>
>> yes, because it's already part of devname in most cases.
> 
As Thinh suggested PCI based devices has different devname style,  which
is difficult to map with correct controller instance from just trace logs.

> Ah, so then why do you really need this?  :)
> 
>>>> +
>>>>  	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.
>>>
>>> You already have this pointer to the resource in dwc3 somewhere, so why
>>> are you storing this as a char string and not just always using the
>>> "real" resource instead?
>>>
>> No Greg, dwc3 struct doesn't have the resource pointer, but has res for
>> xhci.
> 
> That resource has to be somewhere in the dwc3 structure, otherwise how
> does the driver know how to talk to the device in the end?  Or is that
> just happening deep in the dwc3-platform-specific-code?  And if so,
> doesn't that imply that you can't just rely on a single resource for
> this "address" as you don't know what the platform really does to talk
> to the device?
> 
It does have the iomapped resource (stored in dwc3 struct), but doesn't
have the actual physical address.

> So this leads me back to the "just use the device name" argument.  Don't
> try to encode a platform-type-thing into the name for everyone to be
> using as that's just not going to work well.  But if you totally insist
> on it, please name this something else, as that's not what this really
> is (i.e. "base_addr" is not correct.)
> 
Sorry, I guess there's a confusion here.
We are trying to print the physical address thats coming from DT/ACPI
(reg property). We are not adding the iomem/virtual address here.
I'll rename/document it for better clarity.

Regards,
Prashanth K

  reply	other threads:[~2026-01-07  9:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 11:53 [PATCH v2 0/3] Add the DWC3 " Prashanth K
2026-01-05 11:53 ` [PATCH v2 1/3] usb: dwc3: Remove of dep->regs Prashanth K
2026-01-09  0:53   ` Thinh Nguyen
2026-01-05 11:53 ` [PATCH v2 2/3] usb: dwc3: Add dwc pointer to dwc3_readl/writel Prashanth K
2026-01-09  0:54   ` Thinh Nguyen
2026-01-05 11:53 ` [PATCH v2 3/3] usb: dwc3: Log dwc3 instance name in traces Prashanth K
2026-01-05 12:43   ` Greg Kroah-Hartman
2026-01-06  9:58   ` Greg Kroah-Hartman
2026-01-07  6:03     ` Prashanth K
2026-01-07  6:40       ` Greg Kroah-Hartman
2026-01-07  9:05         ` Prashanth K [this message]
2026-01-09  1:18   ` Thinh Nguyen
2026-01-09 10:04     ` Prashanth K
2026-01-13  1:38       ` Thinh Nguyen
2026-01-05 12:44 ` [PATCH v2 0/3] Add the DWC3 " Greg Kroah-Hartman
2026-01-05 16:11   ` Thinh Nguyen
2026-01-05 16:27     ` Greg Kroah-Hartman
2026-01-05 17:01       ` Thinh Nguyen
2026-01-05 19:59         ` Greg Kroah-Hartman
2026-01-05 21:16           ` Thinh Nguyen
2026-01-06  5:50             ` Greg Kroah-Hartman

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=16c3b03f-198a-487a-9e1b-b772b61441ff@oss.qualcomm.com \
    --to=prashanth.k@oss.qualcomm.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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®