<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/dwc2/platform.c, branch linux-5.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-12-15T17:43:24Z</updated>
<entry>
<title>usb: dwc2: fix STM ID/VBUS detection startup delay in dwc2_driver_probe</title>
<updated>2021-12-15T17:43:24Z</updated>
<author>
<name>Amelie Delaunay</name>
</author>
<published>2021-12-07T12:45:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fac6bf87c55f7f0733efb0375565fb6a50cf2caf'/>
<id>urn:sha1:fac6bf87c55f7f0733efb0375565fb6a50cf2caf</id>
<content type='text'>
When activate_stm_id_vb_detection is enabled, ID and Vbus detection relies
on sensing comparators. This detection needs time to stabilize.
A delay was already applied in dwc2_resume() when reactivating the
detection, but it wasn't done in dwc2_probe().
This patch adds delay after enabling STM ID/VBUS detection. Then, ID state
is good when initializing gadget and host, and avoid to get a wrong
Connector ID Status Change interrupt.

Fixes: a415083a11cc ("usb: dwc2: add support for STM32MP15 SoCs USB OTG HS and FS")
Cc: stable &lt;stable@vger.kernel.org&gt;
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/20211207124510.268841-1-amelie.delaunay@foss.st.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: platform: Provide function name for 'dwc2_check_core_version()'</title>
<updated>2021-05-27T07:45:26Z</updated>
<author>
<name>Lee Jones</name>
</author>
<published>2021-05-26T13:00:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c1fb8640e8a3d1dc04195246d0f5fe437c74b6bd'/>
<id>urn:sha1:c1fb8640e8a3d1dc04195246d0f5fe437c74b6bd</id>
<content type='text'>
Fixes the following W=1 kernel build warning(s):

 drivers/usb/dwc2/platform.c:411: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst

Cc: Minas Harutyunyan &lt;hminas@synopsys.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Philipp Zabel &lt;p.zabel@pengutronix.de&gt;
Cc: Liam Girdwood &lt;lgirdwood@gmail.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Matthijs Kooijman &lt;matthijs@stdin.nl&gt;
Cc: linux-usb@vger.kernel.org
Acked-by: Minas Harutyunyan &lt;Minas.Harutyunyan@synopsys.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Link: https://lore.kernel.org/r/20210526130037.856068-3-lee.jones@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: Remove obsolete MODULE_ constants from platform.c</title>
<updated>2021-05-10T12:59:05Z</updated>
<author>
<name>Matthijs Kooijman</name>
</author>
<published>2021-05-03T18:05:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e89baeba4f64bab679618b3330cdcda5929fb8d5'/>
<id>urn:sha1:e89baeba4f64bab679618b3330cdcda5929fb8d5</id>
<content type='text'>
Originally, the core and platform drivers were separate modules, so each
had its own module info. Since commit 2d1165a4b95e (usb: dwc2: remove
dwc2_platform.ko) platform.c is included in the core module, which now
contains duplicate module info (from core.c and platform.c).

Due to the linking order and modinfo implementation, running `modinfo`
on the resulting dwc2.ko shows just the info from platform.c, rather
than that from core.c, suggesting that I am the author of the entire
dwc2 module. Since platform.c is just a minor part of the entire module,
this removes its module info in favor of the info from core.c.

Acked-by: Minas Harutyunyan &lt;Minas.Harutyunyan@synopsys.com&gt;
Signed-off-by: Matthijs Kooijman &lt;matthijs@stdin.nl&gt;
Link: https://lore.kernel.org/r/20210503180538.64423-1-matthijs@stdin.nl
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: Add exit hibernation mode before removing drive</title>
<updated>2021-04-22T09:55:34Z</updated>
<author>
<name>Artur Petrosyan</name>
</author>
<published>2021-04-16T12:48:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a94f01814be4fb46fb89c08209f808b665182763'/>
<id>urn:sha1:a94f01814be4fb46fb89c08209f808b665182763</id>
<content type='text'>
When dwc2 core is in hibernation mode loading
driver again causes driver fail. Because in
that mode registers are not accessible.

In order to exit from hibernation checking
dwc2 core power saving state in "dwc2_driver_remove()"
function. If core is in hibernation, then checking the
operational mode of the driver. To check whether dwc2 core
is operating in host mode or device mode there is one way
which is retrieving the backup value of "gotgctl" and compare
the "CurMod" value. If previously core entered hibernation
in host mode then the exit is performed for host if not then
exit is performed for device mode. The introduced checking
is because in hibernation state all registers are not
accessible.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Acked-by: Minas Harutyunyan &lt;Minas.Harutyunyan@synopsys.com&gt;
Signed-off-by: Artur Petrosyan &lt;Arthur.Petrosyan@synopsys.com&gt;
Link: https://lore.kernel.org/r/20210416124827.9BB59A005D@mailhost.synopsys.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: Enable RPi in ACPI mode</title>
<updated>2021-04-22T08:55:54Z</updated>
<author>
<name>Jeremy Linton</name>
</author>
<published>2021-04-13T21:58:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2e5db2c0e508f10daa348c47c3093d34f0b865c8'/>
<id>urn:sha1:2e5db2c0e508f10daa348c47c3093d34f0b865c8</id>
<content type='text'>
The dwc2 driver has everything we need to run
in ACPI mode except for the ACPI module device table
boilerplate. With that added and identified as "BCM2848",
an id in use by other OSs for this device, the dw2
controller on the BCM2711 will work.

Signed-off-by: Jeremy Linton &lt;jeremy.linton@arm.com&gt;
Link: https://lore.kernel.org/r/20210413215834.3126447-2-jeremy.linton@arm.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: Add exit clock gating before removing driver</title>
<updated>2021-04-13T10:25:12Z</updated>
<author>
<name>Artur Petrosyan</name>
</author>
<published>2021-04-13T07:37:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=401411bbc4e62bcbcc020c2c458ecb90843140a8'/>
<id>urn:sha1:401411bbc4e62bcbcc020c2c458ecb90843140a8</id>
<content type='text'>
When dwc2 core is in clock gating mode loading driver
again causes driver fail. Because in that mode
registers are not accessible.

Added a flow of exiting clock gating mode
to avoid the driver reload failure.

Signed-off-by: Artur Petrosyan &lt;Arthur.Petrosyan@synopsys.com&gt;
Link: https://lore.kernel.org/r/20210413073731.3C81BA022E@mailhost.synopsys.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: Add exit partial power down before removing driver</title>
<updated>2021-04-09T13:16:39Z</updated>
<author>
<name>Artur Petrosyan</name>
</author>
<published>2021-04-08T09:46:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b46b1ef7b0da5c9257b98a0d1d658422e7851783'/>
<id>urn:sha1:b46b1ef7b0da5c9257b98a0d1d658422e7851783</id>
<content type='text'>
When dwc2 core is in partial power down mode
loading driver again causes driver fail. Because in
that mode registers are not accessible.

Added a flow of exiting the partial power down mode
to avoid the driver reload failure.

Acked-by: Minas Harutyunyan &lt;Minas.Harutyunyan@synopsys.com&gt;
Signed-off-by: Artur Petrosyan &lt;Arthur.Petrosyan@synopsys.com&gt;
Link: https://lore.kernel.org/r/20210408094615.8AE35A0094@mailhost.synopsys.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: Avoid leaving the error_debugfs label unused</title>
<updated>2020-10-27T09:33:53Z</updated>
<author>
<name>Martin Blumenstingl</name>
</author>
<published>2020-10-17T16:50:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=190bb01b72d2d5c3654a03c42fb1ad0dc6114c79'/>
<id>urn:sha1:190bb01b72d2d5c3654a03c42fb1ad0dc6114c79</id>
<content type='text'>
The error_debugfs label is only used when either
CONFIG_USB_DWC2_PERIPHERAL or CONFIG_USB_DWC2_DUAL_ROLE is enabled. Add
the same #if to the error_debugfs label itself as the code which uses
this label already has.

This avoids the following compiler warning:
  warning: label ‘error_debugfs’ defined but not used [-Wunused-label]

Fixes: e1c08cf23172ed ("usb: dwc2: Add missing cleanups when usb_add_gadget_udc() fails")
Acked-by: Minas Harutyunyan &lt;Minas.Harutyunyan@synopsys.com&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Reported-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Martin Blumenstingl &lt;martin.blumenstingl@googlemail.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: override PHY input signals with usb role switch support</title>
<updated>2020-10-02T10:29:13Z</updated>
<author>
<name>Amelie Delaunay</name>
</author>
<published>2020-09-09T09:35:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=17f934024e84e73cd55dd620a48c1b9e21fac87f'/>
<id>urn:sha1:17f934024e84e73cd55dd620a48c1b9e21fac87f</id>
<content type='text'>
This patch adds support for usb role switch to dwc2, by using overriding
control of the PHY voltage valid and ID input signals.

iddig signal (ID) can be overridden:
- when setting GUSBCFG_FORCEHOSTMODE, iddig input pin is overridden with 1;
- when setting GUSBCFG_FORCEDEVMODE, iddig input pin is overridden with 0.

avalid/bvalid/vbusvalid signals can be overridden respectively with:
- GOTGCTL_AVALOEN + GOTGCTL_AVALOVAL
- GOTGCTL_BVALOEN + GOTGCTL_BVALOVAL
- GOTGCTL_VBVALEN + GOTGCTL_VBVALOVAL

It is possible to determine valid sessions thanks to usb role switch:
- if USB_ROLE_NONE then !avalid &amp;&amp; !bvalid &amp;&amp; !vbusvalid
- if USB_ROLE_DEVICE then !avalid &amp;&amp; bvalid &amp;&amp; vbusvalid
- if USB_ROLE_HOST then avalid &amp;&amp; !bvalid &amp;&amp; vbusvalid

Acked-by: Minas Harutyunyan &lt;hminas@synopsys.com&gt;
Acked-by: Martin Blumenstingl &lt;martin.blumenstingl@googlemail.com&gt;
Signed-off-by: Amelie Delaunay &lt;amelie.delaunay@st.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: Always disable regulators on driver teardown</title>
<updated>2020-10-02T06:57:40Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2020-09-14T13:06:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=54c1960605107e1b5e562966e3dc3d29526f66b3'/>
<id>urn:sha1:54c1960605107e1b5e562966e3dc3d29526f66b3</id>
<content type='text'>
If the dwc2 driver fails to probe after having enabled the regulators,
it ends up being unregistered with regulators enabled, something the
core regulator code is legitimately upset about:

   dwc2 ff400000.usb: supply vusb_d not found, using dummy regulator
   dwc2 ff400000.usb: supply vusb_a not found, using dummy regulator
   dwc2 ff400000.usb: dwc2_core_reset: HANG! AHB Idle timeout GRSTCTL GRSTCTL_AHBIDLE
   WARNING: CPU: 2 PID: 112 at drivers/regulator/core.c:2074 _regulator_put.part.0+0x16c/0x174
   Modules linked in: dwc2(E+) dwc3(E) udc_core(E) rtc_hym8563(E) dwmac_generic(E) ulpi(E) usbcore(E) dwc3_meson_g12a(E) roles(E) meson_gx_mmc(E+) i2c_meson(E) mdio_mux_meson_g12a(E) mdio_mux(E) dwmac_meson8b(E) stmmac_platform(E) stmmac(E) mdio_xpcs(E) phylink(E) of_mdio(E) fixed_phy(E) libphy(E) pwm_regulator(E) fixed(E)
   CPU: 2 PID: 112 Comm: systemd-udevd Tainted: G            E     5.9.0-rc4-00102-g423583bc8cf9 #1840
   Hardware name: amlogic w400/w400, BIOS 2020.04 05/22/2020
   pstate: 80400009 (Nzcv daif +PAN -UAO BTYPE=--)
   pc : _regulator_put.part.0+0x16c/0x174
   lr : regulator_bulk_free+0x6c/0x9c
   sp : ffffffc012353820
   x29: ffffffc012353820 x28: ffffff805a4b7000
   x27: ffffff8059c2eac0 x26: ffffff8059c2e810
   x25: ffffff805a4b7d00 x24: ffffffc008cf3028
   x23: ffffffc011729ef8 x22: ffffff807e2761d8
   x21: ffffffc01171df78 x20: ffffff805a4b7700
   x19: ffffff805a4b7700 x18: 0000000000000030
   x17: 0000000000000000 x16: 0000000000000000
   x15: ffffff807ea8d178 x14: 3935312820435455
   x13: 2038323a36313a37 x12: ffffffffffffffff
   x11: 0000000000000040 x10: 0000000000000007
   x9 : ffffffc0106f77d0 x8 : ffffffffffffffe0
   x7 : ffffffffffffffff x6 : 0000000000017702
   x5 : ffffff805a4b7400 x4 : 0000000000000000
   x3 : ffffffc01171df78 x2 : ffffff807ea8cc40
   x1 : 0000000000000000 x0 : 0000000000000001
   Call trace:
    _regulator_put.part.0+0x16c/0x174
    regulator_bulk_free+0x6c/0x9c
    devm_regulator_bulk_release+0x28/0x3c
    release_nodes+0x1c8/0x2c0
    devres_release_all+0x44/0x6c
    really_probe+0x1ec/0x504
    driver_probe_device+0x100/0x170
    device_driver_attach+0xcc/0xd4
    __driver_attach+0xb0/0x17c
    bus_for_each_dev+0x7c/0xd4
    driver_attach+0x30/0x3c
    bus_add_driver+0x154/0x250
    driver_register+0x84/0x140
    __platform_driver_register+0x54/0x60
    dwc2_platform_driver_init+0x2c/0x1000 [dwc2]
    do_one_initcall+0x54/0x2d0
    do_init_module+0x68/0x29c

In order to fix this, tie the regulator disabling to the teardown
process by registering a devm action callback. This makes sure that
the regulators are disabled at the right time (just before they are
released).

Cc: Minas Harutyunyan &lt;hminas@synopsys.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</content>
</entry>
</feed>
