<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/usb/dwc3, branch v4.9.78</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>usb: dwc3: gadget: Fix system suspend/resume on TI platforms</title>
<updated>2017-12-14T08:28:18+00:00</updated>
<author>
<name>Roger Quadros</name>
<email>rogerq@ti.com</email>
</author>
<published>2017-02-15T12:16:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7abf66d78e89800eb3a5759bf7592b6e53721c20'/>
<id>7abf66d78e89800eb3a5759bf7592b6e53721c20</id>
<content type='text'>
[ Upstream commit 1551e35ea4189c1f7199fe278395fc94196715f2 ]

On TI platforms (dra7, am437x), the DWC3_DSTS_DEVCTRLHLT bit is not set
after the device controller is stopped via DWC3_DCTL_RUN_STOP.

If we don't disconnect and stop the gadget, it stops working after a
system resume with the trace below.

There is no point in preventing gadget disconnect and gadget stop during
system suspend/resume as we're going to suspend in any case, whether
DEVCTRLHLT timed out or not.

[  141.727480] ------------[ cut here ]------------
[  141.732349] WARNING: CPU: 1 PID: 2135 at drivers/usb/dwc3/gadget.c:2384 dwc3_stop_active_transfer.constprop.4+0xc4/0xe4 [dwc3]
[  141.744299] Modules linked in: usb_f_ss_lb g_zero libcomposite xhci_plat_hcd xhci_hcd usbcore dwc3 evdev udc_core m25p80 usb_common spi_nor snd_soc_davinci_mcasp snd_soc_simple_card snd_soc_edma snd_soc_tlv3e
[  141.792163] CPU: 1 PID: 2135 Comm: irq/456-dwc3 Not tainted 4.10.0-rc8 #1138
[  141.799547] Hardware name: Generic DRA74X (Flattened Device Tree)
[  141.805940] [&lt;c01101b4&gt;] (unwind_backtrace) from [&lt;c010c31c&gt;] (show_stack+0x10/0x14)
[  141.814066] [&lt;c010c31c&gt;] (show_stack) from [&lt;c04a0918&gt;] (dump_stack+0xac/0xe0)
[  141.821648] [&lt;c04a0918&gt;] (dump_stack) from [&lt;c013708c&gt;] (__warn+0xd8/0x104)
[  141.828955] [&lt;c013708c&gt;] (__warn) from [&lt;c0137164&gt;] (warn_slowpath_null+0x20/0x28)
[  141.836902] [&lt;c0137164&gt;] (warn_slowpath_null) from [&lt;bf27784c&gt;] (dwc3_stop_active_transfer.constprop.4+0xc4/0xe4 [dwc3])
[  141.848329] [&lt;bf27784c&gt;] (dwc3_stop_active_transfer.constprop.4 [dwc3]) from [&lt;bf27ab14&gt;] (__dwc3_gadget_ep_disable+0x64/0x528 [dwc3])
[  141.861034] [&lt;bf27ab14&gt;] (__dwc3_gadget_ep_disable [dwc3]) from [&lt;bf27c27c&gt;] (dwc3_gadget_ep_disable+0x3c/0xc8 [dwc3])
[  141.872280] [&lt;bf27c27c&gt;] (dwc3_gadget_ep_disable [dwc3]) from [&lt;bf23b428&gt;] (usb_ep_disable+0x11c/0x18c [udc_core])
[  141.883160] [&lt;bf23b428&gt;] (usb_ep_disable [udc_core]) from [&lt;bf342774&gt;] (disable_ep+0x18/0x54 [usb_f_ss_lb])
[  141.893408] [&lt;bf342774&gt;] (disable_ep [usb_f_ss_lb]) from [&lt;bf3437b0&gt;] (disable_endpoints+0x18/0x50 [usb_f_ss_lb])
[  141.904168] [&lt;bf3437b0&gt;] (disable_endpoints [usb_f_ss_lb]) from [&lt;bf343814&gt;] (disable_source_sink+0x2c/0x34 [usb_f_ss_lb])
[  141.915771] [&lt;bf343814&gt;] (disable_source_sink [usb_f_ss_lb]) from [&lt;bf329a9c&gt;] (reset_config+0x48/0x7c [libcomposite])
[  141.927012] [&lt;bf329a9c&gt;] (reset_config [libcomposite]) from [&lt;bf329afc&gt;] (composite_disconnect+0x2c/0x54 [libcomposite])
[  141.938444] [&lt;bf329afc&gt;] (composite_disconnect [libcomposite]) from [&lt;bf23d7dc&gt;] (usb_gadget_udc_reset+0x10/0x34 [udc_core])
[  141.950237] [&lt;bf23d7dc&gt;] (usb_gadget_udc_reset [udc_core]) from [&lt;bf276d70&gt;] (dwc3_gadget_reset_interrupt+0x64/0x698 [dwc3])
[  141.962022] [&lt;bf276d70&gt;] (dwc3_gadget_reset_interrupt [dwc3]) from [&lt;bf27952c&gt;] (dwc3_thread_interrupt+0x618/0x1a3c [dwc3])
[  141.973723] [&lt;bf27952c&gt;] (dwc3_thread_interrupt [dwc3]) from [&lt;c01a7ce8&gt;] (irq_thread_fn+0x1c/0x54)
[  141.983215] [&lt;c01a7ce8&gt;] (irq_thread_fn) from [&lt;c01a7fbc&gt;] (irq_thread+0x120/0x1f0)
[  141.991247] [&lt;c01a7fbc&gt;] (irq_thread) from [&lt;c015ba14&gt;] (kthread+0xf8/0x138)
[  141.998641] [&lt;c015ba14&gt;] (kthread) from [&lt;c01078f0&gt;] (ret_from_fork+0x14/0x24)
[  142.006213] ---[ end trace b4ecfe9f175b9a9c ]---

Signed-off-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 1551e35ea4189c1f7199fe278395fc94196715f2 ]

On TI platforms (dra7, am437x), the DWC3_DSTS_DEVCTRLHLT bit is not set
after the device controller is stopped via DWC3_DCTL_RUN_STOP.

If we don't disconnect and stop the gadget, it stops working after a
system resume with the trace below.

There is no point in preventing gadget disconnect and gadget stop during
system suspend/resume as we're going to suspend in any case, whether
DEVCTRLHLT timed out or not.

[  141.727480] ------------[ cut here ]------------
[  141.732349] WARNING: CPU: 1 PID: 2135 at drivers/usb/dwc3/gadget.c:2384 dwc3_stop_active_transfer.constprop.4+0xc4/0xe4 [dwc3]
[  141.744299] Modules linked in: usb_f_ss_lb g_zero libcomposite xhci_plat_hcd xhci_hcd usbcore dwc3 evdev udc_core m25p80 usb_common spi_nor snd_soc_davinci_mcasp snd_soc_simple_card snd_soc_edma snd_soc_tlv3e
[  141.792163] CPU: 1 PID: 2135 Comm: irq/456-dwc3 Not tainted 4.10.0-rc8 #1138
[  141.799547] Hardware name: Generic DRA74X (Flattened Device Tree)
[  141.805940] [&lt;c01101b4&gt;] (unwind_backtrace) from [&lt;c010c31c&gt;] (show_stack+0x10/0x14)
[  141.814066] [&lt;c010c31c&gt;] (show_stack) from [&lt;c04a0918&gt;] (dump_stack+0xac/0xe0)
[  141.821648] [&lt;c04a0918&gt;] (dump_stack) from [&lt;c013708c&gt;] (__warn+0xd8/0x104)
[  141.828955] [&lt;c013708c&gt;] (__warn) from [&lt;c0137164&gt;] (warn_slowpath_null+0x20/0x28)
[  141.836902] [&lt;c0137164&gt;] (warn_slowpath_null) from [&lt;bf27784c&gt;] (dwc3_stop_active_transfer.constprop.4+0xc4/0xe4 [dwc3])
[  141.848329] [&lt;bf27784c&gt;] (dwc3_stop_active_transfer.constprop.4 [dwc3]) from [&lt;bf27ab14&gt;] (__dwc3_gadget_ep_disable+0x64/0x528 [dwc3])
[  141.861034] [&lt;bf27ab14&gt;] (__dwc3_gadget_ep_disable [dwc3]) from [&lt;bf27c27c&gt;] (dwc3_gadget_ep_disable+0x3c/0xc8 [dwc3])
[  141.872280] [&lt;bf27c27c&gt;] (dwc3_gadget_ep_disable [dwc3]) from [&lt;bf23b428&gt;] (usb_ep_disable+0x11c/0x18c [udc_core])
[  141.883160] [&lt;bf23b428&gt;] (usb_ep_disable [udc_core]) from [&lt;bf342774&gt;] (disable_ep+0x18/0x54 [usb_f_ss_lb])
[  141.893408] [&lt;bf342774&gt;] (disable_ep [usb_f_ss_lb]) from [&lt;bf3437b0&gt;] (disable_endpoints+0x18/0x50 [usb_f_ss_lb])
[  141.904168] [&lt;bf3437b0&gt;] (disable_endpoints [usb_f_ss_lb]) from [&lt;bf343814&gt;] (disable_source_sink+0x2c/0x34 [usb_f_ss_lb])
[  141.915771] [&lt;bf343814&gt;] (disable_source_sink [usb_f_ss_lb]) from [&lt;bf329a9c&gt;] (reset_config+0x48/0x7c [libcomposite])
[  141.927012] [&lt;bf329a9c&gt;] (reset_config [libcomposite]) from [&lt;bf329afc&gt;] (composite_disconnect+0x2c/0x54 [libcomposite])
[  141.938444] [&lt;bf329afc&gt;] (composite_disconnect [libcomposite]) from [&lt;bf23d7dc&gt;] (usb_gadget_udc_reset+0x10/0x34 [udc_core])
[  141.950237] [&lt;bf23d7dc&gt;] (usb_gadget_udc_reset [udc_core]) from [&lt;bf276d70&gt;] (dwc3_gadget_reset_interrupt+0x64/0x698 [dwc3])
[  141.962022] [&lt;bf276d70&gt;] (dwc3_gadget_reset_interrupt [dwc3]) from [&lt;bf27952c&gt;] (dwc3_thread_interrupt+0x618/0x1a3c [dwc3])
[  141.973723] [&lt;bf27952c&gt;] (dwc3_thread_interrupt [dwc3]) from [&lt;c01a7ce8&gt;] (irq_thread_fn+0x1c/0x54)
[  141.983215] [&lt;c01a7ce8&gt;] (irq_thread_fn) from [&lt;c01a7fbc&gt;] (irq_thread+0x120/0x1f0)
[  141.991247] [&lt;c01a7fbc&gt;] (irq_thread) from [&lt;c015ba14&gt;] (kthread+0xf8/0x138)
[  141.998641] [&lt;c015ba14&gt;] (kthread) from [&lt;c01078f0&gt;] (ret_from_fork+0x14/0x24)
[  142.006213] ---[ end trace b4ecfe9f175b9a9c ]---

Signed-off-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: Correct ISOC DATA PIDs for short packets</title>
<updated>2017-10-21T15:21:39+00:00</updated>
<author>
<name>Manu Gautam</name>
<email>mgautam@codeaurora.org</email>
</author>
<published>2017-07-19T11:37:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=480fd4fb29c596bf669a864ceda00dec7f0c2134'/>
<id>480fd4fb29c596bf669a864ceda00dec7f0c2134</id>
<content type='text'>
commit 40d829fb2ec636b6b4b0cc95e2546ab9aca04cc9 upstream.

The PIDs for Isochronous data transfers are incorrect
for high bandwidth IN endpoints when the request length
is less than EP wMaxPacketSize.

As per spec correct PIDs for ISOC data transfers are:

1) For request length &lt;= maxpacket
	- DATA0,

2) For maxpacket &lt; length &lt;= (2 * maxpacket)
	- DATA1, DATA0

3) For (2 * maxpacket) &lt;  length &lt;= (3 * maxpacket)
	- DATA2, DATA1, DATA0.

But driver always sets PCM fields based on wMaxPacketSize
due to which DATA2 happens even for small requests.

Fix this by setting the PCM field of trb-&gt;size depending
on request length rather than fixing it to the value
depending on wMaxPacketSize.

Ideally it shouldn't give any issues as dwc3 will send
0-length packet for next IN token if host sends (even
after receiving a short packet). Windows seems to ignore
this but with MacOS frame loss observed when using f_uvc.

Signed-off-by: Manu Gautam &lt;mgautam@codeaurora.org&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
[b-liu@ti.com added following change for v4.9.]

-	unsigned int maxp = usb_endpoint_maxp(ep-&gt;desc);
+	unsigned int maxp;
+	maxp = usb_endpoint_maxp(ep-&gt;desc) &amp; 0x07ff;

Signed-off-by: Bin Liu &lt;b-liu@ti.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 40d829fb2ec636b6b4b0cc95e2546ab9aca04cc9 upstream.

The PIDs for Isochronous data transfers are incorrect
for high bandwidth IN endpoints when the request length
is less than EP wMaxPacketSize.

As per spec correct PIDs for ISOC data transfers are:

1) For request length &lt;= maxpacket
	- DATA0,

2) For maxpacket &lt; length &lt;= (2 * maxpacket)
	- DATA1, DATA0

3) For (2 * maxpacket) &lt;  length &lt;= (3 * maxpacket)
	- DATA2, DATA1, DATA0.

But driver always sets PCM fields based on wMaxPacketSize
due to which DATA2 happens even for small requests.

Fix this by setting the PCM field of trb-&gt;size depending
on request length rather than fixing it to the value
depending on wMaxPacketSize.

Ideally it shouldn't give any issues as dwc3 will send
0-length packet for next IN token if host sends (even
after receiving a short packet). Windows seems to ignore
this but with MacOS frame loss observed when using f_uvc.

Signed-off-by: Manu Gautam &lt;mgautam@codeaurora.org&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
[b-liu@ti.com added following change for v4.9.]

-	unsigned int maxp = usb_endpoint_maxp(ep-&gt;desc);
+	unsigned int maxp;
+	maxp = usb_endpoint_maxp(ep-&gt;desc) &amp; 0x07ff;

Signed-off-by: Bin Liu &lt;b-liu@ti.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: omap: fix race of pm runtime with irq handler in probe</title>
<updated>2017-08-07T01:59:46+00:00</updated>
<author>
<name>Grygorii Strashko</name>
<email>grygorii.strashko@ti.com</email>
</author>
<published>2016-12-12T19:37:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8af0937aee50d1d1f41f1caf56aefcf364d3b1b9'/>
<id>8af0937aee50d1d1f41f1caf56aefcf364d3b1b9</id>
<content type='text'>
[ Upstream commit 12a7f17fac5b370bec87259e4c718faf563ce900 ]

Now races can happen between interrupt handler execution and PM runtime in
error handling code path in probe and in dwc3_omap_remove() which will lead
to system crash:

in probe:
...
 err1:
	pm_runtime_put_sync(dev);
^^ PM runtime can race with IRQ handler when deferred probing happening
   due to extcon
	pm_runtime_disable(dev);

	return ret;

in dwc3_omap_remove:
...
	dwc3_omap_disable_irqs(omap);
^^ IRQs are disabled in HW, but handler may still run
	of_platform_depopulate(omap-&gt;dev);
	pm_runtime_put_sync(&amp;pdev-&gt;dev);
^^ PM runtime can race with IRQ handler
	pm_runtime_disable(&amp;pdev-&gt;dev);

	return 0;

So, OMAP DWC3 IRQ need to be disabled before calling
pm_runtime_put() in probe and in dwc3_omap_remove().

Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 12a7f17fac5b370bec87259e4c718faf563ce900 ]

Now races can happen between interrupt handler execution and PM runtime in
error handling code path in probe and in dwc3_omap_remove() which will lead
to system crash:

in probe:
...
 err1:
	pm_runtime_put_sync(dev);
^^ PM runtime can race with IRQ handler when deferred probing happening
   due to extcon
	pm_runtime_disable(dev);

	return ret;

in dwc3_omap_remove:
...
	dwc3_omap_disable_irqs(omap);
^^ IRQs are disabled in HW, but handler may still run
	of_platform_depopulate(omap-&gt;dev);
	pm_runtime_put_sync(&amp;pdev-&gt;dev);
^^ PM runtime can race with IRQ handler
	pm_runtime_disable(&amp;pdev-&gt;dev);

	return 0;

So, OMAP DWC3 IRQ need to be disabled before calling
pm_runtime_put() in probe and in dwc3_omap_remove().

Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: replace %p with %pK</title>
<updated>2017-07-12T13:01:03+00:00</updated>
<author>
<name>Felipe Balbi</name>
<email>felipe.balbi@linux.intel.com</email>
</author>
<published>2017-05-17T12:57:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3272bad0c2aa7a48a5851acd6061a74210c974d1'/>
<id>3272bad0c2aa7a48a5851acd6061a74210c974d1</id>
<content type='text'>
commit 04fb365c453e14ff9e8a28f1c46050d920a27a4a upstream.

%p will leak kernel pointers, so let's not expose the information on
dmesg and instead use %pK. %pK will only show the actual addresses if
explicitly enabled under /proc/sys/kernel/kptr_restrict.

Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 04fb365c453e14ff9e8a28f1c46050d920a27a4a upstream.

%p will leak kernel pointers, so let's not expose the information on
dmesg and instead use %pK. %pK will only show the actual addresses if
explicitly enabled under /proc/sys/kernel/kptr_restrict.

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

</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: exynos fix axius clock error path to do cleanup</title>
<updated>2017-06-24T05:11:17+00:00</updated>
<author>
<name>Shuah Khan</name>
<email>shuahkh@osg.samsung.com</email>
</author>
<published>2017-01-10T23:05:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=22921a9e232a1187873c0127d408767b6bdc558e'/>
<id>22921a9e232a1187873c0127d408767b6bdc558e</id>
<content type='text'>
commit 8ae584d1951f241efd45499f8774fd7066f22823 upstream.

Axius clock error path returns without disabling clock and suspend clock.
Fix it to disable them before returning error.

Reviewed-by: Javier Martinez Canillas &lt;javier@osg.samsung.com&gt;
Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 8ae584d1951f241efd45499f8774fd7066f22823 upstream.

Axius clock error path returns without disabling clock and suspend clock.
Fix it to disable them before returning error.

Reviewed-by: Javier Martinez Canillas &lt;javier@osg.samsung.com&gt;
Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: Prevent losing events in event cache</title>
<updated>2017-05-25T13:44:40+00:00</updated>
<author>
<name>Thinh Nguyen</name>
<email>Thinh.Nguyen@synopsys.com</email>
</author>
<published>2017-05-12T00:26:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ff9177b158c3cf1420846d1114aec4e2b1cb76e5'/>
<id>ff9177b158c3cf1420846d1114aec4e2b1cb76e5</id>
<content type='text'>
commit d325a1de49d61ee11aca58a529571c91ecea7879 upstream.

The dwc3 driver can overwite its previous events if its top-half IRQ
handler (TH) gets invoked again before processing the events in the
cache. We see this as a hang in the file transfer and the host will
attempt to reset the device. TH gets the event count and deasserts the
interrupt line by writing DWC3_GEVNTSIZ_INTMASK to DWC3_GEVNTSIZ. If
there's a new event coming between reading the event count and interrupt
deassertion, dwc3 will lose previous pending events. More generally, we
will see 0 event count, which should not affect anything.

This shouldn't be possible in the current dwc3 implementation. However,
through testing and reading the PCIe trace, the TH occasionally still
gets invoked one more time after HW interrupt deassertion. (With PCIe
legacy interrupts, TH is called repeatedly as long as the interrupt line
is asserted). We suspect that there is a small detection delay in the
SW.

To avoid this issue, Check DWC3_EVENT_PENDING flag to determine if the
events are processed in the bottom-half IRQ handler. If not, return
IRQ_HANDLED and don't process new event.

Signed-off-by: Thinh Nguyen &lt;thinhn@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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit d325a1de49d61ee11aca58a529571c91ecea7879 upstream.

The dwc3 driver can overwite its previous events if its top-half IRQ
handler (TH) gets invoked again before processing the events in the
cache. We see this as a hang in the file transfer and the host will
attempt to reset the device. TH gets the event count and deasserts the
interrupt line by writing DWC3_GEVNTSIZ_INTMASK to DWC3_GEVNTSIZ. If
there's a new event coming between reading the event count and interrupt
deassertion, dwc3 will lose previous pending events. More generally, we
will see 0 event count, which should not affect anything.

This shouldn't be possible in the current dwc3 implementation. However,
through testing and reading the PCIe trace, the TH occasionally still
gets invoked one more time after HW interrupt deassertion. (With PCIe
legacy interrupts, TH is called repeatedly as long as the interrupt line
is asserted). We suspect that there is a small detection delay in the
SW.

To avoid this issue, Check DWC3_EVENT_PENDING flag to determine if the
events are processed in the bottom-half IRQ handler. If not, return
IRQ_HANDLED and don't process new event.

Signed-off-by: Thinh Nguyen &lt;thinhn@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;

</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: host: pass quirk-broken-port-ped property for known broken revisions</title>
<updated>2017-04-12T10:41:19+00:00</updated>
<author>
<name>Felipe Balbi</name>
<email>felipe.balbi@linux.intel.com</email>
</author>
<published>2017-04-04T19:32:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ae3a3e209ef1e2fa7efac9bb54c6fe934755bff6'/>
<id>ae3a3e209ef1e2fa7efac9bb54c6fe934755bff6</id>
<content type='text'>
[ Upstream commit e42a5dbb8a3d14f5a35bffa3bf7dcb87883f767a ]

dwc3 revisions &lt;=3.00a have a limitation where Port Disable command
doesn't work. Set the quirk-broken-port-ped property for such
controllers so XHCI core can do the necessary workaround.

[rogerq@ti.com] Updated code from platform data to device property.

Signed-off-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit e42a5dbb8a3d14f5a35bffa3bf7dcb87883f767a ]

dwc3 revisions &lt;=3.00a have a limitation where Port Disable command
doesn't work. Set the quirk-broken-port-ped property for such
controllers so XHCI core can do the necessary workaround.

[rogerq@ti.com] Updated code from platform data to device property.

Signed-off-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: delay unmap of bounced requests</title>
<updated>2017-04-12T10:41:15+00:00</updated>
<author>
<name>Janusz Dziedzic</name>
<email>januszx.dziedzic@intel.com</email>
</author>
<published>2017-03-13T12:11:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d9a97dcdf5c23f5a074e204e7a8fd355412146b8'/>
<id>d9a97dcdf5c23f5a074e204e7a8fd355412146b8</id>
<content type='text'>
commit de288e36fe33f7e06fa272bc8e2f85aa386d99aa upstream.

In the case of bounced ep0 requests, we must delay DMA operation until
after -&gt;complete() otherwise we might overwrite contents of req-&gt;buf.

This caused problems with RNDIS gadget.

Signed-off-by: Janusz Dziedzic &lt;januszx.dziedzic@intel.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit de288e36fe33f7e06fa272bc8e2f85aa386d99aa upstream.

In the case of bounced ep0 requests, we must delay DMA operation until
after -&gt;complete() otherwise we might overwrite contents of req-&gt;buf.

This caused problems with RNDIS gadget.

Signed-off-by: Janusz Dziedzic &lt;januszx.dziedzic@intel.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;

</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3-omap: Fix missing break in dwc3_omap_set_mailbox()</title>
<updated>2017-03-18T11:14:31+00:00</updated>
<author>
<name>Roger Quadros</name>
<email>rogerq@ti.com</email>
</author>
<published>2017-02-15T11:38:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=accadd8164b7a45645c8287839ca9d648415cb5e'/>
<id>accadd8164b7a45645c8287839ca9d648415cb5e</id>
<content type='text'>
commit 0913750f9fb6f26bcd00c8f9dd9a8d1b8d031246 upstream.

We need to break from all cases if we want to treat
each one of them separately.

Reported-by: Gustavo A. R. Silva &lt;garsilva@embeddedor.com&gt;
Fixes: d2728fb3e01f ("usb: dwc3: omap: Pass VBUS and ID events transparently")
Signed-off-by: Roger Quadros &lt;rogerq@ti.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 0913750f9fb6f26bcd00c8f9dd9a8d1b8d031246 upstream.

We need to break from all cases if we want to treat
each one of them separately.

Reported-by: Gustavo A. R. Silva &lt;garsilva@embeddedor.com&gt;
Fixes: d2728fb3e01f ("usb: dwc3: omap: Pass VBUS and ID events transparently")
Signed-off-by: Roger Quadros &lt;rogerq@ti.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;

</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: make Set Endpoint Configuration macros safe</title>
<updated>2017-03-18T11:14:31+00:00</updated>
<author>
<name>Felipe Balbi</name>
<email>felipe.balbi@linux.intel.com</email>
</author>
<published>2017-01-31T11:24:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=808ee146d733ff2792a26d715ac72e6e745c9a47'/>
<id>808ee146d733ff2792a26d715ac72e6e745c9a47</id>
<content type='text'>
commit 7369090a9fb57c3fc705ce355d2e4523a5a24716 upstream.

Some gadget drivers are bad, bad boys. We notice
that ADB was passing bad Burst Size which caused top
bits of param0 to be overwritten which confused DWC3
when running this command.

In order to avoid future issues, we're going to make
sure values passed by macros are always safe for the
controller. Note that ADB still needs a fix to *not*
pass bad values.

Reported-by: Mohamed Abbas &lt;mohamed.abbas@intel.com&gt;
Sugested-by: Adam Andruszak &lt;adam.andruszak@intel.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 7369090a9fb57c3fc705ce355d2e4523a5a24716 upstream.

Some gadget drivers are bad, bad boys. We notice
that ADB was passing bad Burst Size which caused top
bits of param0 to be overwritten which confused DWC3
when running this command.

In order to avoid future issues, we're going to make
sure values passed by macros are always safe for the
controller. Note that ADB still needs a fix to *not*
pass bad values.

Reported-by: Mohamed Abbas &lt;mohamed.abbas@intel.com&gt;
Sugested-by: Adam Andruszak &lt;adam.andruszak@intel.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;

</pre>
</div>
</content>
</entry>
</feed>
