<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/dwc2, branch linux-5.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-06-14T16:41:35Z</updated>
<entry>
<title>usb: dwc2: gadget: don't reset gadget's driver-&gt;bus</title>
<updated>2022-06-14T16:41:35Z</updated>
<author>
<name>Marek Szyprowski</name>
</author>
<published>2022-05-05T10:46:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=172cfc167c8ee6238f24f9c16efd598602af643c'/>
<id>urn:sha1:172cfc167c8ee6238f24f9c16efd598602af643c</id>
<content type='text'>
[ Upstream commit 3120aac6d0ecd9accf56894aeac0e265f74d3d5a ]

UDC driver should not touch gadget's driver internals, especially it
should not reset driver-&gt;bus. This wasn't harmful so far, but since
commit fc274c1e9973 ("USB: gadget: Add a new bus for gadgets") gadget
subsystem got it's own bus and messing with -&gt;bus triggers the
following NULL pointer dereference:

dwc2 12480000.hsotg: bound driver g_ether
8&lt;--- cut here ---
Unable to handle kernel NULL pointer dereference at virtual address 00000000
[00000000] *pgd=00000000
Internal error: Oops: 5 [#1] SMP ARM
Modules linked in: ...
CPU: 0 PID: 620 Comm: modprobe Not tainted 5.18.0-rc5-next-20220504 #11862
Hardware name: Samsung Exynos (Flattened Device Tree)
PC is at module_add_driver+0x44/0xe8
LR is at sysfs_do_create_link_sd+0x84/0xe0
...
Process modprobe (pid: 620, stack limit = 0x(ptrval))
...
 module_add_driver from bus_add_driver+0xf4/0x1e4
 bus_add_driver from driver_register+0x78/0x10c
 driver_register from usb_gadget_register_driver_owner+0x40/0xb4
 usb_gadget_register_driver_owner from do_one_initcall+0x44/0x1e0
 do_one_initcall from do_init_module+0x44/0x1c8
 do_init_module from load_module+0x19b8/0x1b9c
 load_module from sys_finit_module+0xdc/0xfc
 sys_finit_module from ret_fast_syscall+0x0/0x54
Exception stack(0xf1771fa8 to 0xf1771ff0)
...
dwc2 12480000.hsotg: new device is high-speed
---[ end trace 0000000000000000 ]---

Fix this by removing driver-&gt;bus entry reset.

Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Link: https://lore.kernel.org/r/20220505104618.22729-1-m.szyprowski@samsung.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: drd: fix soft connect when gadget is unconfigured</title>
<updated>2022-02-17T15:10:21Z</updated>
<author>
<name>Fabrice Gasnier</name>
</author>
<published>2022-02-16T08:12:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=32fde84362c40961726a5c91f35ad37355ccc0c6'/>
<id>urn:sha1:32fde84362c40961726a5c91f35ad37355ccc0c6</id>
<content type='text'>
When the gadget driver hasn't been (yet) configured, and the cable is
connected to a HOST, the SFTDISCON gets cleared unconditionally, so the
HOST tries to enumerate it.
At the host side, this can result in a stuck USB port or worse. When
getting lucky, some dmesg can be observed at the host side:
 new high-speed USB device number ...
 device descriptor read/64, error -110

Fix it in drd, by checking the enabled flag before calling
dwc2_hsotg_core_connect(). It will be called later, once configured,
by the normal flow:
- udc_bind_to_driver
 - usb_gadget_connect
   - dwc2_hsotg_pullup
     - dwc2_hsotg_core_connect

Fixes: 17f934024e84 ("usb: dwc2: override PHY input signals with usb role switch support")
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Fabrice Gasnier &lt;fabrice.gasnier@foss.st.com&gt;
Link: https://lore.kernel.org/r/1644999135-13478-1-git-send-email-fabrice.gasnier@foss.st.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: gadget: don't try to disable ep0 in dwc2_hsotg_suspend</title>
<updated>2022-01-26T12:49:35Z</updated>
<author>
<name>Amelie Delaunay</name>
</author>
<published>2021-12-07T13:01:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ac55d163855924aa5af9f1560977da8f346963c8'/>
<id>urn:sha1:ac55d163855924aa5af9f1560977da8f346963c8</id>
<content type='text'>
Calling dwc2_hsotg_ep_disable on ep0 (in/out) will lead to the following
logs before returning -EINVAL:
dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0
dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0

To avoid these two logs while suspending, start disabling the endpoint
from the index 1, as done in dwc2_hsotg_udc_stop:

	/* all endpoints should be shutdown */
	for (ep = 1; ep &lt; hsotg-&gt;num_of_eps; ep++) {
		if (hsotg-&gt;eps_in[ep])
			dwc2_hsotg_ep_disable_lock(&amp;hsotg-&gt;eps_in[ep]-&gt;ep);
		if (hsotg-&gt;eps_out[ep])
			dwc2_hsotg_ep_disable_lock(&amp;hsotg-&gt;eps_out[ep]-&gt;ep);
	}

Acked-by: Minas Harutyunyan &lt;Minas.Harutyunyan@synopsys.com&gt;
Signed-off-by: Amelie Delaunay &lt;amelie.delaunay@foss.st.com&gt;
Link: https://lore.kernel.org/r/20211207130101.270314-1-amelie.delaunay@foss.st.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: gadget: initialize max_speed from params</title>
<updated>2022-01-06T14:28:12Z</updated>
<author>
<name>John Keeping</name>
</author>
<published>2022-01-06T11:57:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=92ef98a4caacad6d4a1490dda45d81ae5ccf5bc9'/>
<id>urn:sha1:92ef98a4caacad6d4a1490dda45d81ae5ccf5bc9</id>
<content type='text'>
DWC2 may be paired with a full-speed PHY which is not capable of
high-speed operation.  Report this correctly to the gadget core by
setting max_speed from the core parameters.

Prior to commit 5324bad66f09f ("usb: dwc2: gadget: implement
udc_set_speed()") this didn't cause the hardware to be configured
incorrectly, although the speed may have been reported incorrectly.  But
after that commit params.speed is updated based on a value passed in by
the gadget core which may set it to a faster speed than is supported by
the hardware.  Initialising the max_speed parameter ensures the speed
passed to dwc2_gadget_set_speed() will be one supported by the hardware.

Fixes: 5324bad66f09f ("usb: dwc2: gadget: implement udc_set_speed()")
Acked-by: Minas Harutyunyan &lt;Minas.Harutyunyan@synopsys.com&gt;
Signed-off-by: John Keeping &lt;john@metanate.com&gt;
Link: https://lore.kernel.org/r/20220106115731.1473909-1-john@metanate.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: do not gate off the hardware if it does not support clock gating</title>
<updated>2022-01-06T14:27:53Z</updated>
<author>
<name>Dinh Nguyen</name>
</author>
<published>2022-01-04T13:59:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=34146c68083f1aef6709196b3dc888c1ceffd357'/>
<id>urn:sha1:34146c68083f1aef6709196b3dc888c1ceffd357</id>
<content type='text'>
We should not be clearing the HCD_FLAG_HW_ACCESSIBLE bit if the hardware
does not support clock gating.

Fixes: 50fb0c128b6e ("usb: dwc2: Add clock gating entering flow by system suspend")
Acked-by: Minas Harutyunyan &lt;Minas.Harutyunyan@synopsys.com&gt;
Signed-off-by: Dinh Nguyen &lt;dinguyen@kernel.org&gt;
Link: https://lore.kernel.org/r/20220104135922.734776-1-dinguyen@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: Simplify a bitmap declaration</title>
<updated>2021-12-30T12:16:13Z</updated>
<author>
<name>Christophe JAILLET</name>
</author>
<published>2021-12-23T07:40:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=db3e8244bd1c46f5a416fd1e6821036ecc59884a'/>
<id>urn:sha1:db3e8244bd1c46f5a416fd1e6821036ecc59884a</id>
<content type='text'>
Use DECLARE_BITMAP() instead of hand writing it.

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Link: https://lore.kernel.org/r/a2bf604d26dbe9816fdaae0faf4b4837ecacc6d3.1640245180.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 5.16-rc6 into usb-next</title>
<updated>2021-12-20T08:58:10Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2021-12-20T08:58:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=236c9ad1f87088bb07ebdd136b8432f83dfd1e14'/>
<id>urn:sha1:236c9ad1f87088bb07ebdd136b8432f83dfd1e14</id>
<content type='text'>
We need the USB fixes in here as well.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: drd: restore role and overrides upon resume</title>
<updated>2021-12-17T15:52:51Z</updated>
<author>
<name>Fabrice Gasnier</name>
</author>
<published>2021-12-06T15:56:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ad02e0e524117d019417b88715c69802ec9c5e0'/>
<id>urn:sha1:3ad02e0e524117d019417b88715c69802ec9c5e0</id>
<content type='text'>
Override enable bits may not be restored when going to low power mode
(e.g. when in DWC2_POWER_DOWN_PARAM_NONE).
These bits are set when probing/initializing drd (role switch). Restore
them upon resume from low power mode (in case these have been lost).

To achieve this, the last known role is restored upon resume. And the
override enable bits are always set when configuring aval, bval and vbval.

When resuming, forcing the role should be done only once, or this can cause
port changes in HOST mode for instance.
So, only restore FORCEDEVMODE/FORCEHOSTMODE when role_sw is unused

Acked-by: Minas Harutyunyan &lt;Minas.Harutyunyan@synopsys.com&gt;
Signed-off-by: Fabrice Gasnier &lt;fabrice.gasnier@foss.st.com&gt;
Link: https://lore.kernel.org/r/1638806203-6624-4-git-send-email-fabrice.gasnier@foss.st.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: drd: add role-switch-default-node support</title>
<updated>2021-12-17T15:52:51Z</updated>
<author>
<name>Fabrice Gasnier</name>
</author>
<published>2021-12-06T15:56:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e14acb8769850fedfbfc62a64998e34348442784'/>
<id>urn:sha1:e14acb8769850fedfbfc62a64998e34348442784</id>
<content type='text'>
When using usb-role-switch, while the usb role is not yet define
(USB_ROLE_NONE), the user may want to configure the default mode to host
or device.
Use role-switch-default-mode for that purpose.

Acked-by: Minas Harutyunyan &lt;Minas.Harutyunyan@synopsys.com&gt;
Signed-off-by: Amelie Delaunay &lt;amelie.delaunay@foss.st.com&gt;
Signed-off-by: Fabrice Gasnier &lt;fabrice.gasnier@foss.st.com&gt;
Link: https://lore.kernel.org/r/1638806203-6624-3-git-send-email-fabrice.gasnier@foss.st.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: platform: adopt dev_err_probe() to silent probe defer</title>
<updated>2021-12-15T22:48:08Z</updated>
<author>
<name>Amelie Delaunay</name>
</author>
<published>2021-12-07T12:08:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=856d3624489a4906b8a95de7bb8311ca6e25b3b9'/>
<id>urn:sha1:856d3624489a4906b8a95de7bb8311ca6e25b3b9</id>
<content type='text'>
In case of probe defer, a message is logged for resets and clocks. Use
dev_err_probe to log the message only when error code is not -517.
Simplify phy, regulators and drd probe defer handling with dev_err_probe().
Then, take benefit of devices_deferred debugfs in case of probe deferral.

Acked-by: Minas Harutyunyan &lt;Minas.Harutyunyan@synopsys.com&gt;
Signed-off-by: Amelie Delaunay &lt;amelie.delaunay@foss.st.com&gt;
Link: https://lore.kernel.org/r/20211207120829.266837-1-amelie.delaunay@foss.st.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
