<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/usb/dwc3, branch linux-4.20.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.20.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.20.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2019-03-13T21:04:12+00:00</updated>
<entry>
<title>usb: dwc3: exynos: Fix error handling of clk_prepare_enable</title>
<updated>2019-03-13T21:04:12+00:00</updated>
<author>
<name>Alexey Khoroshilov</name>
<email>khoroshilov@ispras.ru</email>
</author>
<published>2019-01-21T21:23:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=58f556fa99dd4bc556722b3f5afe7a97d48b3513'/>
<id>urn:sha1:58f556fa99dd4bc556722b3f5afe7a97d48b3513</id>
<content type='text'>
[ Upstream commit 512e6fb589bc18f9321457632e89b95017447db9 ]

If clk_prepare_enable() fails in dwc3_exynos_probe() or in
dwc3_exynos_resume(), exynos-&gt;clks[0] is left undisabled
because of usage preincrement in while condition.

Found by Linux Driver Verification project (linuxtesting.org).

Fixes: 9f2168367a0a ("usb: dwc3: exynos: Rework clock handling and prepare for new variants")
Acked-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Alexey Khoroshilov &lt;khoroshilov@ispras.ru&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: Fix the uninitialized link_state when udc starts</title>
<updated>2019-03-05T16:59:36+00:00</updated>
<author>
<name>Zeng Tao</name>
<email>prime.zeng@hisilicon.com</email>
</author>
<published>2018-12-26T11:22:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=50869076de318aaa8d2987f0dcefb2b26d09fd35'/>
<id>urn:sha1:50869076de318aaa8d2987f0dcefb2b26d09fd35</id>
<content type='text'>
[ Upstream commit 88b1bb1f3b88e0bf20b05d543a53a5b99bd7ceb6 ]

Currently the link_state is uninitialized and the default value is 0(U0)
before the first time we start the udc, and after we start the udc then
 stop the udc, the link_state will be undefined.
We may have the following warnings if we start the udc again with
an undefined link_state:

WARNING: CPU: 0 PID: 327 at drivers/usb/dwc3/gadget.c:294 dwc3_send_gadget_ep_cmd+0x304/0x308
dwc3 100e0000.hidwc3_0: wakeup failed --&gt; -22
[...]
Call Trace:
[&lt;c010f270&gt;] (unwind_backtrace) from [&lt;c010b3d8&gt;] (show_stack+0x10/0x14)
[&lt;c010b3d8&gt;] (show_stack) from [&lt;c034a4dc&gt;] (dump_stack+0x84/0x98)
[&lt;c034a4dc&gt;] (dump_stack) from [&lt;c0118000&gt;] (__warn+0xe8/0x100)
[&lt;c0118000&gt;] (__warn) from [&lt;c0118050&gt;](warn_slowpath_fmt+0x38/0x48)
[&lt;c0118050&gt;] (warn_slowpath_fmt) from [&lt;c0442ec0&gt;](dwc3_send_gadget_ep_cmd+0x304/0x308)
[&lt;c0442ec0&gt;] (dwc3_send_gadget_ep_cmd) from [&lt;c0445e68&gt;](dwc3_ep0_start_trans+0x48/0xf4)
[&lt;c0445e68&gt;] (dwc3_ep0_start_trans) from [&lt;c0446750&gt;](dwc3_ep0_out_start+0x64/0x80)
[&lt;c0446750&gt;] (dwc3_ep0_out_start) from [&lt;c04451c0&gt;](__dwc3_gadget_start+0x1e0/0x278)
[&lt;c04451c0&gt;] (__dwc3_gadget_start) from [&lt;c04452e0&gt;](dwc3_gadget_start+0x88/0x10c)
[&lt;c04452e0&gt;] (dwc3_gadget_start) from [&lt;c045ee54&gt;](udc_bind_to_driver+0x88/0xbc)
[&lt;c045ee54&gt;] (udc_bind_to_driver) from [&lt;c045f29c&gt;](usb_gadget_probe_driver+0xf8/0x140)
[&lt;c045f29c&gt;] (usb_gadget_probe_driver) from [&lt;bf005424&gt;](gadget_dev_desc_UDC_store+0xac/0xc4 [libcomposite])
[&lt;bf005424&gt;] (gadget_dev_desc_UDC_store [libcomposite]) from[&lt;c023d8e0&gt;] (configfs_write_file+0xd4/0x160)
[&lt;c023d8e0&gt;] (configfs_write_file) from [&lt;c01d51e8&gt;] (__vfs_write+0x1c/0x114)
[&lt;c01d51e8&gt;] (__vfs_write) from [&lt;c01d5ff4&gt;] (vfs_write+0xa4/0x168)
[&lt;c01d5ff4&gt;] (vfs_write) from [&lt;c01d6d40&gt;] (SyS_write+0x3c/0x90)
[&lt;c01d6d40&gt;] (SyS_write) from [&lt;c0107400&gt;] (ret_fast_syscall+0x0/0x3c)

Signed-off-by: Zeng Tao &lt;prime.zeng@hisilicon.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: synchronize_irq dwc irq in suspend</title>
<updated>2019-03-05T16:59:36+00:00</updated>
<author>
<name>Bo He</name>
<email>bo.he@intel.com</email>
</author>
<published>2019-01-14T07:48:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f34ef6323cf21e5fef480f8a8a88614c75754411'/>
<id>urn:sha1:f34ef6323cf21e5fef480f8a8a88614c75754411</id>
<content type='text'>
[ Upstream commit 01c10880d24291a96a4ab0da773e3c5ce4d12da8 ]

We see dwc3 endpoint stopped by unwanted irq during
suspend resume test, which is caused dwc3 ep can't be started
with error "No Resource".

Here, add synchronize_irq before suspend to sync the
pending IRQ handlers complete.

Signed-off-by: Bo He &lt;bo.he@intel.com&gt;
Signed-off-by: Yu Wang &lt;yu.y.wang@intel.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: Handle 0 xfer length for OUT EP</title>
<updated>2019-02-12T19:02:36+00:00</updated>
<author>
<name>Tejas Joglekar</name>
<email>tejas.joglekar@synopsys.com</email>
</author>
<published>2019-01-22T07:56:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=003e5eab7547d87b0fed0eb4ce17ca5a43ee3ad0'/>
<id>urn:sha1:003e5eab7547d87b0fed0eb4ce17ca5a43ee3ad0</id>
<content type='text'>
commit 1e19cdc8060227b0802bda6bc0bd22b23679ba32 upstream.

For OUT endpoints, zero-length transfers require MaxPacketSize buffer as
per the DWC_usb3 programming guide 3.30a section 4.2.3.3.

This patch fixes this by explicitly checking zero length
transfer to correctly pad up to MaxPacketSize.

Fixes: c6267a51639b ("usb: dwc3: gadget: align transfers to wMaxPacketSize")
Cc: stable@vger.kernel.org

Signed-off-by: Tejas Joglekar &lt;joglekar@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: dwc3: gadget: Disable CSP for stream OUT ep</title>
<updated>2019-02-12T19:02:17+00:00</updated>
<author>
<name>Tejas Joglekar</name>
<email>tejas.joglekar@synopsys.com</email>
</author>
<published>2018-12-10T10:38:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2de23f52a08a57d91a6a38d411505ea44a61fe87'/>
<id>urn:sha1:2de23f52a08a57d91a6a38d411505ea44a61fe87</id>
<content type='text'>
[ Upstream commit 244add8ebfb231c39db9e33b204bd0ce8f24f782 ]

In stream mode, when fast-forwarding TRBs, the stream number
is not cleared causing the new stream to not get assigned. So
we don't want controller to carry on transfers when short packet
is received. So disable the CSP for stream capable endpoint.

This is based on the 3.30a Programming guide, where table 3-1
device descriptor structure field definitions says for CSP bit
If this bit is 0, the controller generates an XferComplete event
and remove the stream. So if we keep CSP as 1 then switching between
streams would not happen as in stream mode, when fast-forwarding
TRBs, the stream number is not cleared causing the new stream to not get
assigned.

Signed-off-by: Tejas Joglekar &lt;joglekar@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: trace: add missing break statement to make compiler happy</title>
<updated>2019-02-12T19:02:15+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2018-12-03T09:28:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4dc2acb15d52af484ee1155aee9ae53474827647'/>
<id>urn:sha1:4dc2acb15d52af484ee1155aee9ae53474827647</id>
<content type='text'>
[ Upstream commit 54d48183d21e03f780053d7129312049cb5dd591 ]

The missed break statement in the outer switch makes the code fall through
always and thus always same value will be printed.

Besides that, compiler warns about missed fall through marker:

drivers/usb/dwc3/./trace.h: In function ‘trace_raw_output_dwc3_log_trb’:
drivers/usb/dwc3/./trace.h:246:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
    switch (pcm) {
    ^~~~~~

Add the missing break statement to work correctly without compilation
warnings.

Fixes: fa8d965d736b ("usb: dwc3: trace: pretty print high-bandwidth transfers too")
Cc: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: Correct the logic for checking TRB full in __dwc3_prepare_one_trb()</title>
<updated>2019-02-12T19:02:14+00:00</updated>
<author>
<name>Anurag Kumar Vulisha</name>
<email>anurag.kumar.vulisha@xilinx.com</email>
</author>
<published>2018-12-01T11:13:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4f05f36a3a7a12bf34d530e22c900bbf9105c028'/>
<id>urn:sha1:4f05f36a3a7a12bf34d530e22c900bbf9105c028</id>
<content type='text'>
[ Upstream commit b7a4fbe2300a8965ea760c7e871507b84aea17f6 ]

Availability of TRB's is calculated using dwc3_calc_trbs_left(), which
determines total available TRB's based on the HWO bit set in a TRB.

In the present code, __dwc3_prepare_one_trb() is called with a TRB which
needs to be prepared for transfer. This __dwc3_prepare_one_trb() calls
dwc3_calc_trbs_left() to determine total available TRBs and set IOC bit
if the total available TRBs are zero. Since the present working TRB (which
is passed as an argument to __dwc3_prepare_one_trb() )  doesn't yet have
the HWO bit set before calling dwc3_calc_trbs_left(), there are chances
that dwc3_calc_trbs_left() wrongly calculates this present working TRB
as free(since the HWO bit is not yet set) and returns the total available
TRBs as greater than zero (including the present working TRB). This could
be a problem.

This patch corrects the above mentioned problem in __dwc3_prepare_one_trb()
by increementing the dep-&gt;trb_enqueue at the last (after preparing the TRB)
instead of increementing at the start and setting the IOC bit only if the
total available TRBs returned by dwc3_calc_trbs_left() is 1 . Since we are
increementing the dep-&gt;trb_enqueue at the last, the present working TRB is
also considered as available by dwc3_calc_trbs_left() and non zero value is
returned . So, according to the modified logic, when the total available
TRBs is equal to 1 that means the total available TRBs in the pool are 0.

Signed-off-by: Anurag Kumar Vulisha &lt;anurag.kumar.vulisha@xilinx.com&gt;
Reviewed-by: Thinh Nguyen &lt;thinhn@synopsys.com&gt;
Tested-by: Tejas Joglekar &lt;tejas.joglekar@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: Clear req-&gt;needs_extra_trb flag on cleanup</title>
<updated>2019-01-31T07:15:45+00:00</updated>
<author>
<name>Jack Pham</name>
<email>jackp@codeaurora.org</email>
</author>
<published>2019-01-10T20:39:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5eaf9833f5be9bb86fcc22c3d879edd929235753'/>
<id>urn:sha1:5eaf9833f5be9bb86fcc22c3d879edd929235753</id>
<content type='text'>
commit bd6742249b9ca918565e4e3abaa06665e587f4b5 upstream.

OUT endpoint requests may somtimes have this flag set when
preparing to be submitted to HW indicating that there is an
additional TRB chained to the request for alignment purposes.
If that request is removed before the controller can execute the
transfer (e.g. ep_dequeue/ep_disable), the request will not go
through the dwc3_gadget_ep_cleanup_completed_request() handler
and will not have its needs_extra_trb flag cleared when
dwc3_gadget_giveback() is called.  This same request could be
later requeued for a new transfer that does not require an
extra TRB and if it is successfully completed, the cleanup
and TRB reclamation will incorrectly process the additional TRB
which belongs to the next request, and incorrectly advances the
TRB dequeue pointer, thereby messing up calculation of the next
requeust's actual/remaining count when it completes.

The right thing to do here is to ensure that the flag is cleared
before it is given back to the function driver.  A good place
to do that is in dwc3_gadget_del_and_unmap_request().

Fixes: c6267a51639b ("usb: dwc3: gadget: align transfers to wMaxPacketSize")
Cc: stable@vger.kernel.org
Signed-off-by: Jack Pham &lt;jackp@codeaurora.org&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
[jackp: backport to &lt;= 4.20: replaced 'needs_extra_trb' with 'unaligned'
        and 'zero' members in patch and reworded commit text]
Signed-off-by: Jack Pham &lt;jackp@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "usb: dwc3: pci: Use devm functions to get the phy GPIOs"</title>
<updated>2019-01-09T16:45:53+00:00</updated>
<author>
<name>Stephan Gerhold</name>
<email>stephan@gerhold.net</email>
</author>
<published>2018-12-06T18:42:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=685689d4f2c6d11441545cdcf9a8b2f84a141761'/>
<id>urn:sha1:685689d4f2c6d11441545cdcf9a8b2f84a141761</id>
<content type='text'>
commit 3004cfd6204927c1294060b849029cf0c2651074 upstream.

Commit 211f658b7b40 ("usb: dwc3: pci: Use devm functions to get
the phy GPIOs") changed the code to claim the PHY GPIOs permanently
for Intel Baytrail devices.

This causes issues when the actual PHY driver attempts to claim the
same GPIO descriptors. For example, tusb1210 now fails to probe with:

  tusb1210: probe of dwc3.0.auto.ulpi failed with error -16 (EBUSY)

dwc3-pci needs to turn on the PHY once before dwc3 is loaded, but
usually the PHY driver will then hold the GPIOs to turn off the
PHY when requested (e.g. during suspend).

To fix the problem, this reverts the commit to restore the old
behavior to put the GPIOs immediately after usage.

Link: https://www.spinics.net/lists/linux-usb/msg174681.html
Cc: stable@vger.kernel.org
Signed-off-by: Stephan Gerhold &lt;stephan@gerhold.net&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Revert "usb: dwc3: gadget: skip Set/Clear Halt when invalid"</title>
<updated>2018-11-26T07:05:27+00:00</updated>
<author>
<name>Felipe Balbi</name>
<email>felipe.balbi@linux.intel.com</email>
</author>
<published>2018-11-19T06:34:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=38317f5c0f2faae5110854f36edad810f841d62f'/>
<id>urn:sha1:38317f5c0f2faae5110854f36edad810f841d62f</id>
<content type='text'>
This reverts commit ffb80fc672c3a7b6afd0cefcb1524fb99917b2f3.

Turns out that commit is wrong. Host controllers are allowed to use
Clear Feature HALT as means to sync data toggle between host and
periperal.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
</entry>
</feed>
