<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/usb/dwc3/debugfs.c, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-09-06T13:21:59+00:00</updated>
<entry>
<title>usb: dwc3: Refactor dwc3_mode_show</title>
<updated>2025-09-06T13:21:59+00:00</updated>
<author>
<name>Kuen-Han Tsai</name>
<email>khtsai@google.com</email>
</author>
<published>2025-08-22T09:23:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4c9860fbe66177fddb8b7161d6809110d3960a6e'/>
<id>urn:sha1:4c9860fbe66177fddb8b7161d6809110d3960a6e</id>
<content type='text'>
Use dwc3_mode_string as the single source of truth for mode-to-string
conversion.

Signed-off-by: Kuen-Han Tsai &lt;khtsai@google.com&gt;
Acked-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Link: https://lore.kernel.org/r/20250822092411.173519-2-khtsai@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: debugfs: Resume dwc3 before accessing registers</title>
<updated>2023-05-13T08:56:22+00:00</updated>
<author>
<name>Udipto Goswami</name>
<email>quic_ugoswami@quicinc.com</email>
</author>
<published>2023-05-09T14:48:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=614ce6a2ea50068b45339257891e51e639ac9001'/>
<id>urn:sha1:614ce6a2ea50068b45339257891e51e639ac9001</id>
<content type='text'>
When the dwc3 device is runtime suspended, various required clocks are in
disabled state and it is not guaranteed that access to any registers would
work. Depending on the SoC glue, a register read could be as benign as
returning 0 or be fatal enough to hang the system.

In order to prevent such scenarios of fatal errors, make sure to resume
dwc3 then allow the function to proceed.

Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver")
Cc: stable@vger.kernel.org #3.2: 30332eeefec8: debugfs: regset32: Add Runtime PM support
Signed-off-by: Udipto Goswami &lt;quic_ugoswami@quicinc.com&gt;
Reviewed-by: Johan Hovold &lt;johan+linaro@kernel.org&gt;
Tested-by: Johan Hovold &lt;johan+linaro@kernel.org&gt;
Acked-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Link: https://lore.kernel.org/r/20230509144836.6803-1-quic_ugoswami@quicinc.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: add several registers dump for debugfs</title>
<updated>2023-03-23T18:19:23+00:00</updated>
<author>
<name>Li Jun</name>
<email>jun.li@nxp.com</email>
</author>
<published>2023-03-17T08:55:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8c4853c48d6cd56611446ec767c5e8365bdd964b'/>
<id>urn:sha1:8c4853c48d6cd56611446ec767c5e8365bdd964b</id>
<content type='text'>
Add 5 missing register dump for debugfs as they are in use now.

Signed-off-by: Li Jun &lt;jun.li@nxp.com&gt;
Acked-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Link: https://lore.kernel.org/r/1679043328-13425-1-git-send-email-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: dwc3: fix memory leak with using debugfs_lookup()</title>
<updated>2023-02-06T12:46:41+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2023-02-02T15:28:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=be308d68785b205e483b3a0c61ba3a82da468f2c'/>
<id>urn:sha1:be308d68785b205e483b3a0c61ba3a82da468f2c</id>
<content type='text'>
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time.  To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.

Note, the root dentry for the debugfs directory for the device needs to
be saved so we don't have to keep looking it up, which required a bit
more refactoring to properly create and remove it when needed.

Reported-by: Bruce Chen &lt;bruce.chen@unisoc.com&gt;
Reported-by: Cixi Geng &lt;cixi.geng1@unisoc.com&gt;
Tested-by: Cixi Geng &lt;gengcixi@gmail.com&gt;
Acked-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Link: https://lore.kernel.org/r/20230202152820.2409908-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: dwc3: remove debugfs root dentry storage</title>
<updated>2021-06-10T17:57:21+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2021-06-09T09:39:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8562d5bfc0fcdfd3aef32991e17dca585ae5ae7d'/>
<id>urn:sha1:8562d5bfc0fcdfd3aef32991e17dca585ae5ae7d</id>
<content type='text'>
There is no need to keep around the debugfs "root" directory for the
dwc3 device.  Instead, look it up anytime we need to find it.  This will
help when callers get out-of-order and we had the potential to have a
"stale" pointer around for the root dentry, as has happened in the past.

Tested-by: Jack Pham &lt;jackp@codeaurora.org&gt;
Reviewed-by: Peter Chen &lt;peter.chen@kernel.org&gt;
Acked-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20210609093924.3293230-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: debugfs: Add and remove endpoint dirs dynamically</title>
<updated>2021-06-02T14:42:17+00:00</updated>
<author>
<name>Jack Pham</name>
<email>jackp@codeaurora.org</email>
</author>
<published>2021-05-29T19:29:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5ff90af9da8f243133e6f21368e5df15e29037bf'/>
<id>urn:sha1:5ff90af9da8f243133e6f21368e5df15e29037bf</id>
<content type='text'>
The DWC3 DebugFS directory and files are currently created once
during probe.  This includes creation of subdirectories for each
of the gadget's endpoints.  This works fine for peripheral-only
controllers, as dwc3_core_init_mode() calls dwc3_gadget_init()
just prior to calling dwc3_debugfs_init().

However, for dual-role controllers, dwc3_core_init_mode() will
instead call dwc3_drd_init() which is problematic in a few ways.
First, the initial state must be determined, then dwc3_set_mode()
will have to schedule drd_work and by then dwc3_debugfs_init()
could have already been invoked.  Even if the initial mode is
peripheral, dwc3_gadget_init() happens after the DebugFS files
are created, and worse so if the initial state is host and the
controller switches to peripheral much later.  And secondly,
even if the gadget endpoints' debug entries were successfully
created, if the controller exits peripheral mode, its dwc3_eps
are freed so the debug files would now hold stale references.

So it is best if the DebugFS endpoint entries are created and
removed dynamically at the same time the underlying dwc3_eps are.
Do this by calling dwc3_debugfs_create_endpoint_dir() as each
endpoint is created, and conversely remove the DebugFS entry when
the endpoint is freed.

Fixes: 41ce1456e1db ("usb: dwc3: core: make dwc3_set_mode() work properly")
Reviewed-by: Peter Chen &lt;peter.chen@kernel.org&gt;
Signed-off-by: Jack Pham &lt;jackp@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20210529192932.22912-1-jackp@codeaurora.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: fix incorrect kernel-doc comment syntax in files</title>
<updated>2021-04-02T13:20:51+00:00</updated>
<author>
<name>Aditya Srivastava</name>
<email>yashsri421@gmail.com</email>
</author>
<published>2021-03-29T13:51:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=27088e00b623a9581bcd4e443a6f9380524edfce'/>
<id>urn:sha1:27088e00b623a9581bcd4e443a6f9380524edfce</id>
<content type='text'>
The opening comment mark '/**' is used for highlighting the beginning of
kernel-doc comments.
There are certain files in drivers/usb/dwc3, which follow this syntax,
but the content inside does not comply with kernel-doc.
Such lines were probably not meant for kernel-doc parsing, but are parsed
due to the presence of kernel-doc like comment syntax(i.e, '/**'), which
causes unexpected warnings from kernel-doc.

E.g., presence of kernel-doc like comment in drivers/usb/dwc3/io.h at
header causes this warnings by kernel-doc:
"warning: expecting prototype for h(). Prototype was for __DRIVERS_USB_DWC3_IO_H() instead"

Similarly for other files too.

Provide a simple fix by replacing such occurrences with general comment
format, i.e. '/*', to prevent kernel-doc from parsing it.

Acked-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Signed-off-by: Aditya Srivastava &lt;yashsri421@gmail.com&gt;
Link: https://lore.kernel.org/r/20210329135108.27128-1-yashsri421@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: Create helper function getting MDWIDTH</title>
<updated>2021-03-28T12:07:18+00:00</updated>
<author>
<name>Thinh Nguyen</name>
<email>Thinh.Nguyen@synopsys.com</email>
</author>
<published>2021-03-28T00:54:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d00be779cc5016a1f4cc414e25fc45a9df40ffaf'/>
<id>urn:sha1:d00be779cc5016a1f4cc414e25fc45a9df40ffaf</id>
<content type='text'>
Different controller IPs check different HW parameters for MDWIDTH.
To help with maintainability, create a helper function to consolidate
the logic in a single place.

Signed-off-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Link: https://lore.kernel.org/r/456329d36e8c188df5c234f3282595b630bf1470.1616892233.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: debugfs: do not queue work if try to change mode on non-drd</title>
<updated>2020-10-02T06:57:42+00:00</updated>
<author>
<name>Li Jun</name>
<email>jun.li@nxp.com</email>
</author>
<published>2020-07-22T09:02:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5bde3f020a150aa16f396ce22b6a778627dd4484'/>
<id>urn:sha1:5bde3f020a150aa16f396ce22b6a778627dd4484</id>
<content type='text'>
Do not try to queue a drd work for change mode if the port is not a drd,
this is to avoid below kernel dump:
[   60.115529] ------------[ cut here ]------------
[   60.120166] WARNING: CPU: 1 PID: 627 at kernel/workqueue.c:1473
__queue_work+0x46c/0x520
[   60.128254] Modules linked in:
[   60.131313] CPU: 1 PID: 627 Comm: sh Not tainted
5.7.0-rc4-00022-g914a586-dirty #135
[   60.139054] Hardware name: NXP i.MX8MQ EVK (DT)
[   60.143585] pstate: a0000085 (NzCv daIf -PAN -UAO)
[   60.148376] pc : __queue_work+0x46c/0x520
[   60.152385] lr : __queue_work+0x314/0x520
[   60.156393] sp : ffff8000124ebc40
[   60.159705] x29: ffff8000124ebc40 x28: ffff800011808018
[   60.165018] x27: ffff800011819ef8 x26: ffff800011d39980
[   60.170331] x25: ffff800011808018 x24: 0000000000000100
[   60.175643] x23: 0000000000000013 x22: 0000000000000001
[   60.180955] x21: ffff0000b7c08e00 x20: ffff0000b6c31080
[   60.186267] x19: ffff0000bb99bc00 x18: 0000000000000000
[   60.191579] x17: 0000000000000000 x16: 0000000000000000
[   60.196891] x15: 0000000000000000 x14: 0000000000000000
[   60.202202] x13: 0000000000000000 x12: 0000000000000000
[   60.207515] x11: 0000000000000000 x10: 0000000000000040
[   60.212827] x9 : ffff800011d55460 x8 : ffff800011d55458
[   60.218138] x7 : ffff0000b7800028 x6 : 0000000000000000
[   60.223450] x5 : ffff0000b7800000 x4 : 0000000000000000
[   60.228762] x3 : ffff0000bb997cc0 x2 : 0000000000000001
[   60.234074] x1 : 0000000000000000 x0 : ffff0000b6c31088
[   60.239386] Call trace:
[   60.241834]  __queue_work+0x46c/0x520
[   60.245496]  queue_work_on+0x6c/0x90
[   60.249075]  dwc3_set_mode+0x48/0x58
[   60.252651]  dwc3_mode_write+0xf8/0x150
[   60.256489]  full_proxy_write+0x5c/0xa8
[   60.260327]  __vfs_write+0x18/0x40
[   60.263729]  vfs_write+0xdc/0x1c8
[   60.267045]  ksys_write+0x68/0xf0
[   60.270360]  __arm64_sys_write+0x18/0x20
[   60.274286]  el0_svc_common.constprop.0+0x68/0x160
[   60.279077]  do_el0_svc+0x20/0x80
[   60.282394]  el0_sync_handler+0x10c/0x178
[   60.286403]  el0_sync+0x140/0x180
[   60.289716] ---[ end trace 70b155582e2b7988 ]---

Signed-off-by: Li Jun &lt;jun.li@nxp.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: debugfs: fix checkpatch warnings</title>
<updated>2020-10-02T06:43:35+00:00</updated>
<author>
<name>Felipe Balbi</name>
<email>balbi@kernel.org</email>
</author>
<published>2020-08-13T06:22:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9ae0eb455b9136b1857cbbf12e4bf4d31f334f1e'/>
<id>urn:sha1:9ae0eb455b9136b1857cbbf12e4bf4d31f334f1e</id>
<content type='text'>
no functional changes

Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</content>
</entry>
</feed>
