<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/usb/dwc2, branch v4.7</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>usb: dwc2: fix regression on big-endian PowerPC/ARM systems</title>
<updated>2016-05-31T08:24:17+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-05-13T13:52:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=23e3439296a55affce3ef0ab78f1c2e03aec8767'/>
<id>23e3439296a55affce3ef0ab78f1c2e03aec8767</id>
<content type='text'>
A patch that went into Linux-4.4 to fix big-endian mode on a Lantiq
MIPS system unfortunately broke big-endian operation on PowerPC
APM82181 as reported by Christian Lamparter, and likely other
systems.

It actually introduced multiple issues:

- it broke big-endian ARM kernels: any machine that was working
  correctly with a little-endian kernel is no longer using byteswaps
  on big-endian kernels, which clearly breaks them.
- On PowerPC the same thing must be true: if it was working before,
  using big-endian kernels is now broken. Unlike ARM, 32-bit PowerPC
  usually uses big-endian kernels, so they are likely all broken.
- The barrier for dwc2_writel is on the wrong side of the __raw_writel(),
  so the MMIO no longer synchronizes with DMA operations.
- On architectures that require specific CPU instructions for MMIO
  access, using the __raw_ variant may turn this into a pointer
  dereference that does not have the same effect as the readl/writel.

This patch is a simple revert for all architectures other than MIPS,
in the hope that we can more easily backport it to fix the regression
on PowerPC and ARM systems without breaking the Lantiq system again.

We should follow this up with a more elaborate change to add runtime
detection of endianness, to make sure it also works on all other
combinations of architectures and implementations of the usb-dwc2
device. That patch however will be fairly large and not appropriate
for backports to stable kernels.

Felipe suggested a different approach, using an endianness switching
register to always put the device into LE mode, but unfortunately
the dwc2 hardware does not provide a generic way to do that. Also,
I see no practical way of addressing the problem more generally by
patching architecture specific code on MIPS.

Fixes: 95c8bc360944 ("usb: dwc2: Use platform endianness when accessing registers")
Acked-by: John Youn &lt;johnyoun@synopsys.com&gt;
Tested-by: Christian Lamparter &lt;chunkeey@googlemail.com&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A patch that went into Linux-4.4 to fix big-endian mode on a Lantiq
MIPS system unfortunately broke big-endian operation on PowerPC
APM82181 as reported by Christian Lamparter, and likely other
systems.

It actually introduced multiple issues:

- it broke big-endian ARM kernels: any machine that was working
  correctly with a little-endian kernel is no longer using byteswaps
  on big-endian kernels, which clearly breaks them.
- On PowerPC the same thing must be true: if it was working before,
  using big-endian kernels is now broken. Unlike ARM, 32-bit PowerPC
  usually uses big-endian kernels, so they are likely all broken.
- The barrier for dwc2_writel is on the wrong side of the __raw_writel(),
  so the MMIO no longer synchronizes with DMA operations.
- On architectures that require specific CPU instructions for MMIO
  access, using the __raw_ variant may turn this into a pointer
  dereference that does not have the same effect as the readl/writel.

This patch is a simple revert for all architectures other than MIPS,
in the hope that we can more easily backport it to fix the regression
on PowerPC and ARM systems without breaking the Lantiq system again.

We should follow this up with a more elaborate change to add runtime
detection of endianness, to make sure it also works on all other
combinations of architectures and implementations of the usb-dwc2
device. That patch however will be fairly large and not appropriate
for backports to stable kernels.

Felipe suggested a different approach, using an endianness switching
register to always put the device into LE mode, but unfortunately
the dwc2 hardware does not provide a generic way to do that. Also,
I see no practical way of addressing the problem more generally by
patching architecture specific code on MIPS.

Fixes: 95c8bc360944 ("usb: dwc2: Use platform endianness when accessing registers")
Acked-by: John Youn &lt;johnyoun@synopsys.com&gt;
Tested-by: Christian Lamparter &lt;chunkeey@googlemail.com&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: gadget: Do not halt isochronous endpoints</title>
<updated>2016-05-31T08:12:57+00:00</updated>
<author>
<name>Vahram Aharonyan</name>
<email>vahrama@synopsys.com</email>
</author>
<published>2016-05-24T05:41:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=15186f1011b088432a10f435aa6e2df5ab177503'/>
<id>15186f1011b088432a10f435aa6e2df5ab177503</id>
<content type='text'>
Add a check in dwc2_hsotg_ep_sethalt() so that it does not halt
isochronous endpoints.

Signed-off-by: Vahram Aharonyan &lt;vahrama@synopsys.com&gt;
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a check in dwc2_hsotg_ep_sethalt() so that it does not halt
isochronous endpoints.

Signed-off-by: Vahram Aharonyan &lt;vahrama@synopsys.com&gt;
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: gadget: Do not halt endpoint if active</title>
<updated>2016-05-31T08:12:56+00:00</updated>
<author>
<name>Vahram Aharonyan</name>
<email>vahrama@synopsys.com</email>
</author>
<published>2016-05-24T05:41:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=51da43b555ba19e0230ff5a5acc58eb0fffb6026'/>
<id>51da43b555ba19e0230ff5a5acc58eb0fffb6026</id>
<content type='text'>
The gadget API function usb_ep_set_halt() expects the gadget to return
-EAGAIN if the ep is active. Add support for this behavior.

Otherwise this may break mass storage protocol if a STALL is attempted
on the endpoint.

Signed-off-by: Vahram Aharonyan &lt;vahrama@synopsys.com&gt;
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The gadget API function usb_ep_set_halt() expects the gadget to return
-EAGAIN if the ep is active. Add support for this behavior.

Otherwise this may break mass storage protocol if a STALL is attempted
on the endpoint.

Signed-off-by: Vahram Aharonyan &lt;vahrama@synopsys.com&gt;
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: Proper cleanup on dr_mode failure</title>
<updated>2016-04-28T06:41:34+00:00</updated>
<author>
<name>John Youn</name>
<email>johnyoun@synopsys.com</email>
</author>
<published>2016-04-28T03:20:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a6ef3e02542a33fb705e6977221deb0292b27398'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: Fixed SOF interrupt enabling/disabling</title>
<updated>2016-04-28T06:41:26+00:00</updated>
<author>
<name>Sevak Arakelyan</name>
<email>sevaka@synopsys.com</email>
</author>
<published>2016-04-28T03:20:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=907a444718b8f93956acac1c944d880c54ab900d'/>
<id>907a444718b8f93956acac1c944d880c54ab900d</id>
<content type='text'>
In case of DDMA mode we don't need to get an SOF interrupt so disable
the unmasking of SOF interrupt in DDMA mode.

Signed-off-by: Sevak Arakelyan &lt;sevaka@synopsys.com&gt;
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In case of DDMA mode we don't need to get an SOF interrupt so disable
the unmasking of SOF interrupt in DDMA mode.

Signed-off-by: Sevak Arakelyan &lt;sevaka@synopsys.com&gt;
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: host: Setting qtd to NULL after freeing it</title>
<updated>2016-04-28T06:41:12+00:00</updated>
<author>
<name>Vardan Mikayelyan</name>
<email>mvardan@synopsys.com</email>
</author>
<published>2016-04-28T03:20:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b0d659022e5c96ee5c4bd62d22d3da2d66de306b'/>
<id>b0d659022e5c96ee5c4bd62d22d3da2d66de306b</id>
<content type='text'>
This is safety change added while doing slub debugging.

Affected functions:
dwc2_hcd_qtd_unlink_and_free()
_dwc2_hcd_urb_enqueue()

Signed-off-by: Vardan Mikayelyan &lt;mvardan@synopsys.com&gt;
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is safety change added while doing slub debugging.

Affected functions:
dwc2_hcd_qtd_unlink_and_free()
_dwc2_hcd_urb_enqueue()

Signed-off-by: Vardan Mikayelyan &lt;mvardan@synopsys.com&gt;
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: gadget: Prevent handling of host interrupts</title>
<updated>2016-04-28T06:41:01+00:00</updated>
<author>
<name>Vardan Mikayelyan</name>
<email>mvardan@synopsys.com</email>
</author>
<published>2016-04-28T03:20:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ee3de8d750134703c702534173cd8623d1b32c38'/>
<id>ee3de8d750134703c702534173cd8623d1b32c38</id>
<content type='text'>
In host slave mode, the core asserts the rxready, txfifoempty interrupts
that get serviced in the gadget irq handler. Prevent servicing of these
when not in the gadget mode of operation.

Signed-off-by: Vardan Mikayelyan &lt;mvardan@synopsys.com&gt;
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In host slave mode, the core asserts the rxready, txfifoempty interrupts
that get serviced in the gadget irq handler. Prevent servicing of these
when not in the gadget mode of operation.

Signed-off-by: Vardan Mikayelyan &lt;mvardan@synopsys.com&gt;
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: gadget: Check for ep0 in enable</title>
<updated>2016-04-28T06:40:16+00:00</updated>
<author>
<name>Vahram Aharonyan</name>
<email>vahrama@synopsys.com</email>
</author>
<published>2016-04-28T03:20:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8c3d609275f7f39d308e5c40a6220c67454f7a28'/>
<id>8c3d609275f7f39d308e5c40a6220c67454f7a28</id>
<content type='text'>
Replaced the WARN_ON with a check and return of -EINVAL in the
dwc2_hsotg_ep_enable function if ep0 is passed in.

Signed-off-by: Vahram Aharonyan &lt;vahrama@synopsys.com&gt;
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replaced the WARN_ON with a check and return of -EINVAL in the
dwc2_hsotg_ep_enable function if ep0 is passed in.

Signed-off-by: Vahram Aharonyan &lt;vahrama@synopsys.com&gt;
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: do not override forced dr_mode in gadget setup</title>
<updated>2016-04-04T12:18:48+00:00</updated>
<author>
<name>Przemek Rudy</name>
<email>prudy1@o2.pl</email>
</author>
<published>2016-03-16T22:10:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ecd9a7ad453c5effc9a26355b79ee83f1337cba4'/>
<id>ecd9a7ad453c5effc9a26355b79ee83f1337cba4</id>
<content type='text'>
The host/device mode set with dr_mode should be kept all the time,
not being changed to OTG in gadget setup (by overriding CFGUSB_FORCEDEVMODE
and CFGUSB_FORCEHOSTMODE bits).

Acked-by: John Youn &lt;johnyoun@synopsys.com&gt;
Tested-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Przemek Rudy &lt;prudy1@o2.pl&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The host/device mode set with dr_mode should be kept all the time,
not being changed to OTG in gadget setup (by overriding CFGUSB_FORCEDEVMODE
and CFGUSB_FORCEHOSTMODE bits).

Acked-by: John Youn &lt;johnyoun@synopsys.com&gt;
Tested-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Przemek Rudy &lt;prudy1@o2.pl&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc2: Fix issues in dwc2_complete_non_isoc_xfer_ddma()</title>
<updated>2016-03-04T13:14:48+00:00</updated>
<author>
<name>John Youn</name>
<email>johnyoun@synopsys.com</email>
</author>
<published>2016-03-01T01:53:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1fc659894994c7faa67e51a4b5a981ab4cf0f3a5'/>
<id>1fc659894994c7faa67e51a4b5a981ab4cf0f3a5</id>
<content type='text'>
Fixes a static analysis issue in dwc2_complete_non_isoc_xfer_ddma(). The
qtd was being passed to a function after being freed. It was not being
used in the function so this doesn't fix any bugs. But it fixes up the
warning and makes the code safer by setting qtd to NULL and not using it
at all.

Reported-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes a static analysis issue in dwc2_complete_non_isoc_xfer_ddma(). The
qtd was being passed to a function after being freed. It was not being
used in the function so this doesn't fix any bugs. But it fixes up the
warning and makes the code safer by setting qtd to NULL and not using it
at all.

Reported-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
