<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/dwc2/platform.c, branch linux-4.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-08-21T09:02:02Z</updated>
<entry>
<title>usb: dwc2: Fix error path in gadget registration</title>
<updated>2020-08-21T09:02:02Z</updated>
<author>
<name>Marek Szyprowski</name>
</author>
<published>2020-07-16T12:09:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7d2a4749e1589295c69183f7d79d5b62664b34d6'/>
<id>urn:sha1:7d2a4749e1589295c69183f7d79d5b62664b34d6</id>
<content type='text'>
[ Upstream commit 33a06f1300a79cfd461cea0268f05e969d4f34ec ]

When gadget registration fails, one should not call usb_del_gadget_udc().
Ensure this by setting gadget-&gt;udc to NULL. Also in case of a failure
there is no need to disable low-level hardware, so return immiedetly
instead of jumping to error_init label.

This fixes the following kernel NULL ptr dereference on gadget failure
(can be easily triggered with g_mass_storage without any module
parameters):

dwc2 12480000.hsotg: dwc2_check_params: Invalid parameter besl=1
dwc2 12480000.hsotg: dwc2_check_params: Invalid parameter g_np_tx_fifo_size=1024
dwc2 12480000.hsotg: EPs: 16, dedicated fifos, 7808 entries in SPRAM
Mass Storage Function, version: 2009/09/11
LUN: removable file: (no medium)
no file given for LUN0
g_mass_storage 12480000.hsotg: failed to start g_mass_storage: -22
8&lt;--- cut here ---
Unable to handle kernel NULL pointer dereference at virtual address 00000104
pgd = (ptrval)
[00000104] *pgd=00000000
Internal error: Oops: 805 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 12 Comm: kworker/0:1 Not tainted 5.8.0-rc5 #3133
Hardware name: Samsung Exynos (Flattened Device Tree)
Workqueue: events deferred_probe_work_func
PC is at usb_del_gadget_udc+0x38/0xc4
LR is at __mutex_lock+0x31c/0xb18
...
Process kworker/0:1 (pid: 12, stack limit = 0x(ptrval))
Stack: (0xef121db0 to 0xef122000)
...
[&lt;c076bf3c&gt;] (usb_del_gadget_udc) from [&lt;c0726bec&gt;] (dwc2_hsotg_remove+0x10/0x20)
[&lt;c0726bec&gt;] (dwc2_hsotg_remove) from [&lt;c0711208&gt;] (dwc2_driver_probe+0x57c/0x69c)
[&lt;c0711208&gt;] (dwc2_driver_probe) from [&lt;c06247c0&gt;] (platform_drv_probe+0x6c/0xa4)
[&lt;c06247c0&gt;] (platform_drv_probe) from [&lt;c0621df4&gt;] (really_probe+0x200/0x48c)
[&lt;c0621df4&gt;] (really_probe) from [&lt;c06221e8&gt;] (driver_probe_device+0x78/0x1fc)
[&lt;c06221e8&gt;] (driver_probe_device) from [&lt;c061fcd4&gt;] (bus_for_each_drv+0x74/0xb8)
[&lt;c061fcd4&gt;] (bus_for_each_drv) from [&lt;c0621b54&gt;] (__device_attach+0xd4/0x16c)
[&lt;c0621b54&gt;] (__device_attach) from [&lt;c0620c98&gt;] (bus_probe_device+0x88/0x90)
[&lt;c0620c98&gt;] (bus_probe_device) from [&lt;c06211b0&gt;] (deferred_probe_work_func+0x3c/0xd0)
[&lt;c06211b0&gt;] (deferred_probe_work_func) from [&lt;c0149280&gt;] (process_one_work+0x234/0x7dc)
[&lt;c0149280&gt;] (process_one_work) from [&lt;c014986c&gt;] (worker_thread+0x44/0x51c)
[&lt;c014986c&gt;] (worker_thread) from [&lt;c0150b1c&gt;] (kthread+0x158/0x1a0)
[&lt;c0150b1c&gt;] (kthread) from [&lt;c0100114&gt;] (ret_from_fork+0x14/0x20)
Exception stack(0xef121fb0 to 0xef121ff8)
...
---[ end trace 9724c2fc7cc9c982 ]---

While fixing this also fix the double call to dwc2_lowlevel_hw_disable()
if dr_mode is set to USB_DR_MODE_PERIPHERAL. In such case low-level
hardware is already disabled before calling usb_add_gadget_udc(). That
function correctly preserves low-level hardware state, there is no need
for the second unconditional dwc2_lowlevel_hw_disable() call.

Fixes: 207324a321a8 ("usb: dwc2: Postponed gadget registration to the udc class driver")
Acked-by: Minas Harutyunyan &lt;hminas@synopsys.com&gt;
Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: Fix shutdown callback in platform</title>
<updated>2020-07-22T07:10:52Z</updated>
<author>
<name>Minas Harutyunyan</name>
</author>
<published>2020-05-30T07:41:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=46cfd55e8de177207b7ff41d18831749ca2322e4'/>
<id>urn:sha1:46cfd55e8de177207b7ff41d18831749ca2322e4</id>
<content type='text'>
commit 4fdf228cdf6925af45a2066d403821e0977bfddb upstream.

To avoid lot of interrupts from dwc2 core, which can be asserted in
specific conditions need to disable interrupts on HW level instead of
disable IRQs on Kernel level, because of IRQ can be shared between
drivers.

Cc: stable@vger.kernel.org
Fixes: a40a00318c7fc ("usb: dwc2: add shutdown callback to platform variant")
Tested-by: Frank Mori Hess &lt;fmh6jj@gmail.com&gt;
Reviewed-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reviewed-by: Doug Anderson &lt;dianders@chromium.org&gt;
Reviewed-by: Frank Mori Hess &lt;fmh6jj@gmail.com&gt;
Signed-off-by: Minas Harutyunyan &lt;hminas@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: dwc2: Postponed gadget registration to the udc class driver</title>
<updated>2020-06-30T19:38:40Z</updated>
<author>
<name>Minas Harutyunyan</name>
</author>
<published>2020-06-09T08:28:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aedf21cf521c28e5a04500045e230f5bdc0a7677'/>
<id>urn:sha1:aedf21cf521c28e5a04500045e230f5bdc0a7677</id>
<content type='text'>
commit 207324a321a866401b098cadf19e4a2dd6584622 upstream.

During dwc2 driver probe, after gadget registration to the udc class
driver, if exist any builtin function driver it immediately bound to
dwc2 and after init host side (dwc2_hcd_init()) stucked in host mode.
Patch postpone gadget registration after host side initialization done.

Fixes: 117777b2c3bb9 ("usb: dwc2: Move gadget probe function into platform code")
Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
Tested-by: Marek Vasut &lt;marex@denx.de&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Minas Harutyunyan &lt;hminas@synopsys.com&gt;
Link: https://lore.kernel.org/r/f21cb38fecc72a230b86155d94c7e60c9cb66f58.1591690938.git.hminas@synopsys.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc</title>
<updated>2016-10-08T04:34:49Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2016-10-08T04:34:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c913fc4146ba7c280e074558d0a461e5c6f07c8a'/>
<id>urn:sha1:c913fc4146ba7c280e074558d0a461e5c6f07c8a</id>
<content type='text'>
Pull ARM SoC late DT updates from Arnd Bergmann:
 "These updates have been kept in a separate branch mostly because they
  rely on updates to the respective clk drivers to keep the shared
  header files in sync.

   - The Renesas r8a7796 (R-Car M3-W) platform gets added, this is an
     automotive SoC similar to the ⅹ8a7795 chip we already support, but
     the dts changes rely on a clock driver change that has been merged
     for v4.9 through the clk tree.

   - The Amlogic meson-gxbb (S905) platform gains support for a few
     drivers merged through our tree, in particular the network and usb
     driver changes are required and included here, and also the clk
     tree changes.

   - The Allwinner platforms have seen a large-scale change to their clk
     drivers and the dts file updates must come after that. This
     includes the newly added Nextthing GR8 platform, which is derived
     from sun5i/A13.

   - Some integrator (arm32) changes rely on clk driver changes.

   - A single patch for lpc32xx has no such dependency but wasn't added
     until just before the merge window"

* tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (99 commits)
  ARM: dts: lpc32xx: add device node for IRAM on-chip memory
  ARM: dts: sun8i: Add accelerometer to polaroid-mid2407pxe03
  ARM: dts: sun8i: enable UART1 for iNet D978 Rev2 board
  ARM: dts: sun8i: add pinmux for UART1 at PG
  dts: sun8i-h3: add I2C0-2 peripherals to H3 SOC
  dts: sun8i-h3: add pinmux definitions for I2C0-2
  dts: sun8i-h3: associate exposed UARTs on Orange Pi Boards
  dts: sun8i-h3: split off RTS/CTS for UART1 in seperate pinmux
  dts: sun8i-h3: add pinmux definitions for UART2-3
  ARM: dts: sun9i: a80-optimus: Disable EHCI1
  ARM: dts: sun9i: cubieboard4: Add AXP806 PMIC device node and regulators
  ARM: dts: sun9i: a80-optimus: Add AXP806 PMIC device node and regulators
  ARM: dts: sun9i: cubieboard4: Declare AXP809 SW regulator as unused
  ARM: dts: sun9i: a80-optimus: Declare AXP809 SW regulator as unused
  ARM: dts: sun8i: Add touchscreen node for sun8i-a33-ga10h
  ARM: dts: sun8i: Add touchscreen node for sun8i-a23-polaroid-mid2809pxe04
  ARM: dts: sun8i: Add touchscreen node for sun8i-a23-polaroid-mid2407pxe03
  ARM: dts: sun8i: Add touchscreen node for sun8i-a23-inet86dz
  ARM: dts: sun8i: Add touchscreen node for sun8i-a23-gt90h
  ARM64: dts: meson-gxbb-vega-s95: Enable USB Nodes
  ...
</content>
</entry>
<entry>
<title>usb: dwc2: add support for Meson8b and GXBB SoCs</title>
<updated>2016-09-14T18:18:52Z</updated>
<author>
<name>Jerome Brunet</name>
</author>
<published>2016-09-11T13:41:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f94310ac076ea2cd84ff42c901e7a17382ad75f8'/>
<id>urn:sha1:f94310ac076ea2cd84ff42c901e7a17382ad75f8</id>
<content type='text'>
Add compatible strings for amlogic Meson8b and GXBB SoCs with the
corresponding configuration parameters.

Signed-off-by: Jerome Brunet &lt;jbrunet@baylibre.com&gt;
Signed-off-by: Martin Blumenstingl &lt;martin.blumenstingl@googlemail.com&gt;
Acked-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@baylibre.com&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: Add reset control to dwc2</title>
<updated>2016-08-22T07:45:11Z</updated>
<author>
<name>Dinh Nguyen</name>
</author>
<published>2016-08-10T13:53:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=83f8da562f8b5275fa1095b45762996971f7c607'/>
<id>urn:sha1:83f8da562f8b5275fa1095b45762996971f7c607</id>
<content type='text'>
Allow for platforms that have a reset controller driver in place to bring
the USB IP out of reset.

Signed-off-by: Dinh Nguyen &lt;dinguyen@opensource.altera.com&gt;
Acked-by: John Youn &lt;johnyoun@synopsys.com&gt;
Tested-by: Stefan Wahren &lt;stefan.wahren@i2se.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: Proper cleanup on dr_mode failure</title>
<updated>2016-04-28T06:41:34Z</updated>
<author>
<name>John Youn</name>
</author>
<published>2016-04-28T03:20:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a6ef3e02542a33fb705e6977221deb0292b27398'/>
<id>urn:sha1:a6ef3e02542a33fb705e6977221deb0292b27398</id>
<content type='text'>
Cleanup in probe if we fail to get dr_mode.

Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: Add support for Lantiq ARX and XRX SoCs</title>
<updated>2016-03-04T13:14:47Z</updated>
<author>
<name>Antti Seppälä</name>
</author>
<published>2016-02-27T10:31:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6c0c0951bbf8c2c216675fe277fba4c42aa0a2bf'/>
<id>urn:sha1:6c0c0951bbf8c2c216675fe277fba4c42aa0a2bf</id>
<content type='text'>
Add support for Lantiq ARX and XRX SoC families to the dwc2 driver.

Acked-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Antti Seppälä &lt;a.seppala@gmail.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: host: Set host_rx_fifo_size to 525 for rk3066</title>
<updated>2016-03-04T13:14:39Z</updated>
<author>
<name>Douglas Anderson</name>
</author>
<published>2016-01-29T02:19:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=098c1ef8fe6bcdfed7905cea1debdd3a0ff9a16f'/>
<id>urn:sha1:098c1ef8fe6bcdfed7905cea1debdd3a0ff9a16f</id>
<content type='text'>
As documented in dwc2_calculate_dynamic_fifo(), host_rx_fifo_size should
really be:
 2 * ((Largest Packet size / 4) + 1 + 1) + n
 with n = number of host channel.

We have 9 host channels, so
 2 * ((1024/4) + 2) + 9 = 516 + 9 = 525

We've got 960 / 972 total_fifo_size on rk3288 (and presumably on
rk3066) and 525 + 128 + 256 = 909 so we're still under on both ports
even when we increment by 5.

In the future, it would be nice if dwc2_calculate_dynamic_fifo() could
handle the "too small" FIFO case and come up with something more
dynamically.  When we do that we can figure out how to allocate the
extra 48 / 60 bytes of FIFO that we're currently wasting.

NOTE: no known bugs are fixed by this patch, but it seems like a simple
fix and ought to fix someone.

Acked-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Reviewed-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
Tested-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: rockchip: Make the max_transfer_size automatic</title>
<updated>2016-03-04T13:14:39Z</updated>
<author>
<name>Douglas Anderson</name>
</author>
<published>2016-01-29T02:19:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=40eed7d78378f1f609680a8a891a50cce12ed612'/>
<id>urn:sha1:40eed7d78378f1f609680a8a891a50cce12ed612</id>
<content type='text'>
Previously we needed to set the max_transfer_size to explicitly be 65535
because the old driver would detect that our hardware could support much
bigger transfers and then would try to do them.  This wouldn't work
since the DMA alignment code couldn't support it.

Later in commit e8f8c14d9da7 ("usb: dwc2: clip max_transfer_size to
65535") upstream added support for clipping this automatically.  Since
that commit it has been OK to just use "-1" (default), but nobody
bothered to change it.

Let's change it to default now for two reasons:
- It's nice to use autodetected params.
- If we can remove the 65535 limit, we can transfer more!

Signed-off-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Acked-by: John Youn &lt;johnyoun@synopsys.com&gt;
Tested-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</content>
</entry>
</feed>
