<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/usb/dwc2, branch v4.4.171</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.4.171</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.4.171'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2018-08-24T11:26:54+00:00</updated>
<entry>
<title>usb: gadget: dwc2: fix memory leak in gadget_init()</title>
<updated>2018-08-24T11:26:54+00:00</updated>
<author>
<name>Grigor Tovmasyan</name>
<email>Grigor.Tovmasyan@synopsys.com</email>
</author>
<published>2018-05-24T14:22:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d51ce9e03e6341a036b44e38d91adaf48c82ec9b'/>
<id>urn:sha1:d51ce9e03e6341a036b44e38d91adaf48c82ec9b</id>
<content type='text'>
[ Upstream commit 9bb073a053f0464ea74a4d4c331fdb7da58568d6 ]

Freed allocated request for ep0 to prevent memory leak in case when
dwc2_driver_probe() failed.

Cc: Stefan Wahren &lt;stefan.wahren@i2se.com&gt;
Cc: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Tested-by: Stefan Wahren &lt;stefan.wahren@i2se.com&gt;
Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Acked-by: Minas Harutyunyan &lt;hminas@synopsys.com&gt;
Signed-off-by: Grigor Tovmasyan &lt;tovmasya@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: fix isoc split in transfer with no data</title>
<updated>2018-08-24T11:26:54+00:00</updated>
<author>
<name>William Wu</name>
<email>william.wu@rock-chips.com</email>
</author>
<published>2018-05-11T09:46:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=879384b1fc452c7de5f3c027c7530f0379a8a3a2'/>
<id>urn:sha1:879384b1fc452c7de5f3c027c7530f0379a8a3a2</id>
<content type='text'>
[ Upstream commit 70c3c8cb83856758025c2a211dd022bc0478922a ]

If isoc split in transfer with no data (the length of DATA0
packet is zero), we can't simply return immediately. Because
the DATA0 can be the first transaction or the second transaction
for the isoc split in transaction. If the DATA0 packet with no
data is in the first transaction, we can return immediately.
But if the DATA0 packet with no data is in the second transaction
of isoc split in transaction sequence, we need to increase the
qtd-&gt;isoc_frame_index and giveback urb to device driver if needed,
otherwise, the MDATA packet will be lost.

A typical test case is that connect the dwc2 controller with an
usb hs Hub (GL852G-12), and plug an usb fs audio device (Plantronics
headset) into the downstream port of Hub. Then use the usb mic
to record, we can find noise when playback.

In the case, the isoc split in transaction sequence like this:

- SSPLIT IN transaction
- CSPLIT IN transaction
  - MDATA packet (176 bytes)
- CSPLIT IN transaction
  - DATA0 packet (0 byte)

This patch use both the length of DATA0 and qtd-&gt;isoc_split_offset
to check if the DATA0 is in the second transaction.

Tested-by: Gevorg Sahakyan &lt;sahakyan@synopsys.com&gt;
Tested-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Acked-by: Minas Harutyunyan hminas@synopsys.com&gt;
Signed-off-by: William Wu &lt;william.wu@rock-chips.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: Fix interval type issue</title>
<updated>2018-05-30T05:49:12+00:00</updated>
<author>
<name>Grigor Tovmasyan</name>
<email>Grigor.Tovmasyan@synopsys.com</email>
</author>
<published>2018-02-06T15:07:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=18f31bd07993b3ddde2916b764d7bee0b7f873fd'/>
<id>urn:sha1:18f31bd07993b3ddde2916b764d7bee0b7f873fd</id>
<content type='text'>
[ Upstream commit 12814a3f8f9b247531d7863170cc82b3fe4218fd ]

The maximum value that unsigned char can hold is 255, meanwhile
the maximum value of interval is  2^(bIntervalMax-1)=2^15.

Signed-off-by: Grigor Tovmasyan &lt;tovmasya@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: Fix dwc2_hsotg_core_init_disconnected()</title>
<updated>2018-05-30T05:48:58+00:00</updated>
<author>
<name>Vardan Mikayelyan</name>
<email>mvardan@synopsys.com</email>
</author>
<published>2018-01-16T12:04:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ef2ca85e8f7b31b5203f05d89444a31fddd3fb90'/>
<id>urn:sha1:ef2ca85e8f7b31b5203f05d89444a31fddd3fb90</id>
<content type='text'>
[ Upstream commit 755d739534f998d92e348fba8ffb0478416576e7 ]

We should call dwc2_hsotg_enqueue_setup() after properly
setting lx_state. Because it may cause error-out from
dwc2_hsotg_enqueue_setup() due to wrong value in lx_state.

Issue can be reproduced by loading driver while connected
A-Connector (start in A-HOST mode) then disconnect A-Connector
to switch to B-DEVICE.

Acked-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Vardan Mikayelyan &lt;mvardan@synopsys.com&gt;
Signed-off-by: Grigor Tovmasyan &lt;tovmasya@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: Improve gadget state disconnection handling</title>
<updated>2018-04-08T09:51:59+00:00</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2017-10-23T21:32:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=da15e8c622f2f1c1e6ae8ac8ead44e8d4890182c'/>
<id>urn:sha1:da15e8c622f2f1c1e6ae8ac8ead44e8d4890182c</id>
<content type='text'>
commit d2471d4a24dfbff5e463d382e2c6fec7d7e25a09 upstream.

In the earlier commit dad3f793f20f ("usb: dwc2: Make sure we
disconnect the gadget state"), I was trying to fix up the
fact that we somehow weren't disconnecting the gadget state,
so that when the OTG port was plugged in the second time we
would get warnings about the state tracking being wrong.

(This seems to be due to a quirk of the HiKey board where
we do not ever get any otg interrupts, particularly the session
end detected signal. Instead we only see status change
interrupt.)

The fix there was somewhat simple, as it just made sure to
call dwc2_hsotg_disconnect() before we connected things up
in OTG mode, ensuring the state handling didn't throw errors.

But in looking at a different issue I was seeing with UDC
state handling, I realized that it would be much better
to call dwc2_hsotg_disconnect when we get the state change
signal moving to host mode.

Thus, this patch removes the earlier disconnect call I added
and moves it (and the needed locking) to the host mode
transition.

Cc: Wei Xu &lt;xuwei5@hisilicon.com&gt;
Cc: Guodong Xu &lt;guodong.xu@linaro.org&gt;
Cc: Amit Pundir &lt;amit.pundir@linaro.org&gt;
Cc: YongQin Liu &lt;yongqin.liu@linaro.org&gt;
Cc: John Youn &lt;johnyoun@synopsys.com&gt;
Cc: Minas Harutyunyan &lt;Minas.Harutyunyan@synopsys.com&gt;
Cc: Douglas Anderson &lt;dianders@chromium.org&gt;
Cc: Chen Yu &lt;chenyu56@huawei.com&gt;
Cc: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: linux-usb@vger.kernel.org
Acked-by: Minas Harutyunyan &lt;hminas@synopsys.com&gt;
Tested-by: Minas Harutyunyan &lt;hminas@synopsys.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Cc: Ben Hutchings &lt;ben.hutchings@codethink.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: dwc2: Make sure we disconnect the gadget state</title>
<updated>2018-03-22T08:23:26+00:00</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2017-02-14T04:08:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ed5fb5479972d0db84e3bdbb664ace6f3e8b0bca'/>
<id>urn:sha1:ed5fb5479972d0db84e3bdbb664ace6f3e8b0bca</id>
<content type='text'>
[ Upstream commit dad3f793f20fbb5c0c342f0f5a0bdf69a4d76089 ]

I had seen some odd behavior with HiKey's usb-gadget interface
that I finally seemed to have chased down. Basically every other
time I plugged in the OTG port, the gadget interface would
properly initialize. The other times, I'd get a big WARN_ON
in dwc2_hsotg_init_fifo() about the fifo_map not being clear.

Ends up if we don't disconnect the gadget state, the fifo-map
doesn't get cleared properly, which causes WARN_ON messages and
also results in the device not properly being setup as a gadget
every other time the OTG port is connected.

So this patch adds a call to dwc2_hsotg_disconnect() in the
reset path so the state is properly cleared.

With it, the gadget interface initializes properly on every
plug in.

Cc: Wei Xu &lt;xuwei5@hisilicon.com&gt;
Cc: Guodong Xu &lt;guodong.xu@linaro.org&gt;
Cc: Amit Pundir &lt;amit.pundir@linaro.org&gt;
Cc: Rob Herring &lt;robh+dt@kernel.org&gt;
Cc: John Youn &lt;johnyoun@synopsys.com&gt;
Cc: Douglas Anderson &lt;dianders@chromium.org&gt;
Cc: Chen Yu &lt;chenyu56@huawei.com&gt;
Cc: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: linux-usb@vger.kernel.org
Acked-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: fix regression on big-endian PowerPC/ARM systems</title>
<updated>2016-07-27T16:47:28+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.radix-linux.su/kernel/linux.git/commit/?id=7b74d56f6a37ffa0397a8bdd8b5c1eb840ab90f3'/>
<id>urn:sha1:7b74d56f6a37ffa0397a8bdd8b5c1eb840ab90f3</id>
<content type='text'>
commit 23e3439296a55affce3ef0ab78f1c2e03aec8767 upstream.

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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: dwc2: fix kernel oops during driver probe</title>
<updated>2015-11-20T15:29:47+00:00</updated>
<author>
<name>Stefan Wahren</name>
<email>stefan.wahren@i2se.com</email>
</author>
<published>2015-11-12T21:08:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f74875dc36135ebae82a8e005f4b7f52289d2c40'/>
<id>urn:sha1:f74875dc36135ebae82a8e005f4b7f52289d2c40</id>
<content type='text'>
This patch make sure that all necessary members of dwc2_hsotg
are initialized before the irq handler is requested. So
the kernel oops triggered by dwc2_handle_common_intr has
been fixed.

  dwc2 20980000.usb: Configuration mismatch. Forcing host mode
  dwc2 20980000.usb: no platform data or transceiver defined
  Unable to handle kernel paging request at virtual address cc860040
  pgd = c0004000
  [cc860040] *pgd=0b41e811, *pte=00000000, *ppte=00000000
  Internal error: Oops: 7 [#1] ARM
  CPU: 0 PID: 1 Comm: swapper Not tainted 4.3.0-rc3+ #19
  Hardware name: BCM2835
  task: cb494000 ti: cb4d0000 task.ti: cb4d0000
  PC is at dwc2_is_controller_alive+0x18/0x34
  LR is at dwc2_handle_common_intr+0x24/0xb60

Acked-by: John Youn &lt;johnyoun@synopsys.com&gt;
Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Stefan Wahren &lt;stefan.wahren@i2se.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: make otg clk optional</title>
<updated>2015-11-19T20:48:49+00:00</updated>
<author>
<name>Stefan Wahren</name>
<email>stefan.wahren@i2se.com</email>
</author>
<published>2015-11-13T17:02:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8aa90cf2a28645c6733f8879c5fe1848c5d510b7'/>
<id>urn:sha1:8aa90cf2a28645c6733f8879c5fe1848c5d510b7</id>
<content type='text'>
Fixes commit 09a75e857790
("usb: dwc2: refactor common low-level hw code to platform.c")

The above commit consolidated the low-level phy access into a common
location. This change made the otg clk a requirement and broke some
platforms when it was moved into platform.c.

So make clk handling optional again.

Acked-by: Eric Anholt &lt;eric@anholt.net&gt;
Signed-off-by: Stefan Wahren &lt;stefan.wahren@i2se.com&gt;
Cc: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Acked-by: John Youn &lt;johnyoun@synopsys.com&gt;
Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Fixes: 09a75e857790 ("usb: dwc2: refactor common low-level hw code to platform.c")
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: dwc2: Return errors from PHY</title>
<updated>2015-11-19T20:48:49+00:00</updated>
<author>
<name>Stefan Wahren</name>
<email>stefan.wahren@i2se.com</email>
</author>
<published>2015-11-13T17:02:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6c2dad69163fdb4ea82344dcba360fc00b4adda4'/>
<id>urn:sha1:6c2dad69163fdb4ea82344dcba360fc00b4adda4</id>
<content type='text'>
When searching for PHYs, any error was treated as if the PHY did not
exist or was not specified. Thus the probe function did not
correctly return error conditions such as -EPROBE_DEFER.

Fixed so that only a non-existing PHY is ignored and any other error
is returned.

Acked-by: Eric Anholt &lt;eric@anholt.net&gt;
Reported-by: Alexander Aring &lt;alex.aring@gmail.com&gt;
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Stefan Wahren &lt;stefan.wahren@i2se.com&gt;
Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
</feed>
