<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/usb/dwc3, branch v4.5</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>usb: dwc3: Fix assignment of EP transfer resources</title>
<updated>2016-02-17T08:31:53+00:00</updated>
<author>
<name>John Youn</name>
<email>John.Youn@synopsys.com</email>
</author>
<published>2016-02-17T04:10:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c450960187f45d4260db87c7dd4fc0bceb5565d8'/>
<id>c450960187f45d4260db87c7dd4fc0bceb5565d8</id>
<content type='text'>
The assignement of EP transfer resources was not handled properly in the
dwc3 driver. Commit aebda6187181 ("usb: dwc3: Reset the transfer
resource index on SET_INTERFACE") previously fixed one aspect of this
where resources may be exhausted with multiple calls to SET_INTERFACE.
However, it introduced an issue where composite devices with multiple
interfaces can be assigned the same transfer resources for different
endpoints. This patch solves both issues.

The assignment of transfer resources cannot perfectly follow the data
book due to the fact that the controller driver does not have all
knowledge of the configuration in advance. It is given this information
piecemeal by the composite gadget framework after every
SET_CONFIGURATION and SET_INTERFACE. Trying to follow the databook
programming model in this scenario can cause errors. For two reasons:

1) The databook says to do DEPSTARTCFG for every SET_CONFIGURATION and
SET_INTERFACE (8.1.5). This is incorrect in the scenario of multiple
interfaces.

2) The databook does not mention doing more DEPXFERCFG for new endpoint
on alt setting (8.1.6).

The following simplified method is used instead:

All hardware endpoints can be assigned a transfer resource and this
setting will stay persistent until either a core reset or hibernation.
So whenever we do a DEPSTARTCFG(0) we can go ahead and do DEPXFERCFG for
every hardware endpoint as well. We are guaranteed that there are as
many transfer resources as endpoints.

This patch triggers off of the calling dwc3_gadget_start_config() for
EP0-out, which always happens first, and which should only happen in one
of the above conditions.

Fixes: aebda6187181 ("usb: dwc3: Reset the transfer resource index on SET_INTERFACE")
Cc: &lt;stable@vger.kernel.org&gt; # v3.2+
Reported-by: Ravi Babu &lt;ravibabu@ti.com&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>
The assignement of EP transfer resources was not handled properly in the
dwc3 driver. Commit aebda6187181 ("usb: dwc3: Reset the transfer
resource index on SET_INTERFACE") previously fixed one aspect of this
where resources may be exhausted with multiple calls to SET_INTERFACE.
However, it introduced an issue where composite devices with multiple
interfaces can be assigned the same transfer resources for different
endpoints. This patch solves both issues.

The assignment of transfer resources cannot perfectly follow the data
book due to the fact that the controller driver does not have all
knowledge of the configuration in advance. It is given this information
piecemeal by the composite gadget framework after every
SET_CONFIGURATION and SET_INTERFACE. Trying to follow the databook
programming model in this scenario can cause errors. For two reasons:

1) The databook says to do DEPSTARTCFG for every SET_CONFIGURATION and
SET_INTERFACE (8.1.5). This is incorrect in the scenario of multiple
interfaces.

2) The databook does not mention doing more DEPXFERCFG for new endpoint
on alt setting (8.1.6).

The following simplified method is used instead:

All hardware endpoints can be assigned a transfer resource and this
setting will stay persistent until either a core reset or hibernation.
So whenever we do a DEPSTARTCFG(0) we can go ahead and do DEPXFERCFG for
every hardware endpoint as well. We are guaranteed that there are as
many transfer resources as endpoints.

This patch triggers off of the calling dwc3_gadget_start_config() for
EP0-out, which always happens first, and which should only happen in one
of the above conditions.

Fixes: aebda6187181 ("usb: dwc3: Reset the transfer resource index on SET_INTERFACE")
Cc: &lt;stable@vger.kernel.org&gt; # v3.2+
Reported-by: Ravi Babu &lt;ravibabu@ti.com&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>
<entry>
<title>usb: dwc3: gadget: set the OTG flag in dwc3 gadget driver.</title>
<updated>2016-02-03T21:58:20+00:00</updated>
<author>
<name>Jianqiang Tang</name>
<email>jianqiang.tang@intel.com</email>
</author>
<published>2016-01-20T06:09:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6a4290cc28be12d72d50644bd4bda1aede37cd41'/>
<id>6a4290cc28be12d72d50644bd4bda1aede37cd41</id>
<content type='text'>
This patch is needed in order to pass one test case
defined in the OTG Automated Compliance Test specification.

Specification location:
http://www.usb.org/developers/onthego/otgeh_compliance_plan_1_2.pdf

This test case uses PET Tool, and PET Tool is one USB hardware
equipment provided by MQP Electronics.

Test case id is 6.8.3 B-UUT Bypass Capacitance.

We must set this otg flag in order to be able to return OTG
descriptor during enumeration, otherwise this test case with
failed with below error: "Get OTG descriptor request stalled".

Signed-off-by: Jianqiang Tang &lt;jianqiang.tang@intel.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>
This patch is needed in order to pass one test case
defined in the OTG Automated Compliance Test specification.

Specification location:
http://www.usb.org/developers/onthego/otgeh_compliance_plan_1_2.pdf

This test case uses PET Tool, and PET Tool is one USB hardware
equipment provided by MQP Electronics.

Test case id is 6.8.3 B-UUT Bypass Capacitance.

We must set this otg flag in order to be able to return OTG
descriptor during enumeration, otherwise this test case with
failed with below error: "Get OTG descriptor request stalled".

Signed-off-by: Jianqiang Tang &lt;jianqiang.tang@intel.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: of-simple: fix build warning on !PM</title>
<updated>2015-12-23T03:58:26+00:00</updated>
<author>
<name>Felipe Balbi</name>
<email>balbi@ti.com</email>
</author>
<published>2015-12-23T03:56:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5072cfc40a80cea3749fd3413b3896630d8c787e'/>
<id>5072cfc40a80cea3749fd3413b3896630d8c787e</id>
<content type='text'>
if we have a !PM kernel build, our runtime
suspend/resume callbacks will be left defined but
unused. Add a ifdef CONFIG_PM guard.

Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
if we have a !PM kernel build, our runtime
suspend/resume callbacks will be left defined but
unused. Add a ifdef CONFIG_PM guard.

Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: don't send extra ZLP</title>
<updated>2015-12-23T03:58:26+00:00</updated>
<author>
<name>John Youn</name>
<email>John.Youn@synopsys.com</email>
</author>
<published>2015-12-22T20:23:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d9261898a4b2c143c28568dc686a1becfc637a99'/>
<id>d9261898a4b2c143c28568dc686a1becfc637a99</id>
<content type='text'>
If the request-&gt;length is zero, a ZLP should already be sent due to that
and another ZLP is not needed to terminate the transfer.

Fixes: 04c03d10e507 ("usb: dwc3: gadget: handle request-&gt;zero")
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the request-&gt;length is zero, a ZLP should already be sent due to that
and another ZLP is not needed to terminate the transfer.

Fixes: 04c03d10e507 ("usb: dwc3: gadget: handle request-&gt;zero")
Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: pass a condition to dev_WARN_ONCE()</title>
<updated>2015-12-16T16:07:27+00:00</updated>
<author>
<name>Felipe Balbi</name>
<email>balbi@ti.com</email>
</author>
<published>2015-12-10T19:08:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=95ca961c758cd9ce789247098b09c39017637e58'/>
<id>95ca961c758cd9ce789247098b09c39017637e58</id>
<content type='text'>
instead of using:

	if (condition) {
		dev_WARN_ONCE(dev, true, "foo");
		return -EINVAL;
	}

let's use:

	if (dev_WARN_ONCE(dev, condition, "foo"))
		return -EINVAL;

Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
instead of using:

	if (condition) {
		dev_WARN_ONCE(dev, true, "foo");
		return -EINVAL;
	}

let's use:

	if (dev_WARN_ONCE(dev, condition, "foo"))
		return -EINVAL;

Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: trace: show request flags</title>
<updated>2015-12-15T15:12:41+00:00</updated>
<author>
<name>Felipe Balbi</name>
<email>balbi@ti.com</email>
</author>
<published>2015-12-03T21:27:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=46a01427e969e53d993b988ebbdb8c7c3562b66f'/>
<id>46a01427e969e53d993b988ebbdb8c7c3562b66f</id>
<content type='text'>
struct usb_request have 3 flags which might be
important to know about during debug. This patch
shows each of the 3 flags as a single letter:

z -&gt; for zero
s -&gt; short not okay
i -&gt; interrupt

A capital letter means the feature is enabled
while a lower case letter means it is disabled;

Thus 'zsI' indicates that a ZLP is not needed,
that we can accept a short packet and interrupt
for this request should be enabled.

Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
struct usb_request have 3 flags which might be
important to know about during debug. This patch
shows each of the 3 flags as a single letter:

z -&gt; for zero
s -&gt; short not okay
i -&gt; interrupt

A capital letter means the feature is enabled
while a lower case letter means it is disabled;

Thus 'zsI' indicates that a ZLP is not needed,
that we can accept a short packet and interrupt
for this request should be enabled.

Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: handle request-&gt;zero</title>
<updated>2015-12-15T15:12:41+00:00</updated>
<author>
<name>Felipe Balbi</name>
<email>balbi@ti.com</email>
</author>
<published>2015-12-02T16:06:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=04c03d10e507052cfce6910ddf34091196e79e1c'/>
<id>04c03d10e507052cfce6910ddf34091196e79e1c</id>
<content type='text'>
So far, dwc3 has always missed request-&gt;zero
handling for every endpoint. Let's implement
that so we can handle cases where transfer must
be finished with a ZLP.

Note that dwc3 is a little special. Even though
we're dealing with a ZLP, we still need a buffer
of wMaxPacketSize bytes; to hide that detail from
every gadget driver, we have a preallocated buffer
of 1024 bytes (biggest bulk size) to use (and
share) among all endpoints.

Reported-by: Ravi B &lt;ravibabu@ti.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
So far, dwc3 has always missed request-&gt;zero
handling for every endpoint. Let's implement
that so we can handle cases where transfer must
be finished with a ZLP.

Note that dwc3 is a little special. Even though
we're dealing with a ZLP, we still need a buffer
of wMaxPacketSize bytes; to hide that detail from
every gadget driver, we have a preallocated buffer
of 1024 bytes (biggest bulk size) to use (and
share) among all endpoints.

Reported-by: Ravi B &lt;ravibabu@ti.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: remove dwc3-qcom in favor of dwc3-of-simple</title>
<updated>2015-12-15T15:12:41+00:00</updated>
<author>
<name>Felipe Balbi</name>
<email>balbi@ti.com</email>
</author>
<published>2015-11-19T18:15:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b084662776be8b07ab9114ff1a16a4e9bf907d35'/>
<id>b084662776be8b07ab9114ff1a16a4e9bf907d35</id>
<content type='text'>
Now that we have a generic dwc3-of-simple.c, we can
use that instead of maintaining dwc3-qcom.c which is
extremely similar.

Cc: Ivan T. Ivanov &lt;iivanov@mm-sol.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that we have a generic dwc3-of-simple.c, we can
use that instead of maintaining dwc3-qcom.c which is
extremely similar.

Cc: Ivan T. Ivanov &lt;iivanov@mm-sol.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: add generic OF glue layer</title>
<updated>2015-12-15T15:12:41+00:00</updated>
<author>
<name>Felipe Balbi</name>
<email>balbi@ti.com</email>
</author>
<published>2015-11-18T19:15:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=16adc674d0d68a50dfc725574738d7ae11cf5d7e'/>
<id>16adc674d0d68a50dfc725574738d7ae11cf5d7e</id>
<content type='text'>
For simple platforms which merely enable some clocks
and populate its children, we can use this generic
glue layer to avoid boilerplate code duplication.

For now this supports Qcom and Xilinx, but if we
find a way to add generic handling of regulators and
optional PHYs, we can absorb exynos as well.

Tested-by: Subbaraya Sundeep Bhatta &lt;subbaraya.sundeep.bhatta@xilinx.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For simple platforms which merely enable some clocks
and populate its children, we can use this generic
glue layer to avoid boilerplate code duplication.

For now this supports Qcom and Xilinx, but if we
find a way to add generic handling of regulators and
optional PHYs, we can absorb exynos as well.

Tested-by: Subbaraya Sundeep Bhatta &lt;subbaraya.sundeep.bhatta@xilinx.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: ep0: fix setup_packet_pending initialization</title>
<updated>2015-12-15T15:12:41+00:00</updated>
<author>
<name>Felipe Balbi</name>
<email>balbi@ti.com</email>
</author>
<published>2015-11-16T22:20:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b5d335e5ea6a60f5254c1f3d5fddd47f4531bccf'/>
<id>b5d335e5ea6a60f5254c1f3d5fddd47f4531bccf</id>
<content type='text'>
It just ocurred to me that dwc3 already gives a
really hint of when a setup packet is pending and
that's the SETUP_PENDING TRB Status for EP0 IRQs.

Fix setup_packet_pending initialization based on
that. While at that, also make sure the comment in
gadget.c matches what code is doing.

Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It just ocurred to me that dwc3 already gives a
really hint of when a setup packet is pending and
that's the SETUP_PENDING TRB Status for EP0 IRQs.

Fix setup_packet_pending initialization based on
that. While at that, also make sure the comment in
gadget.c matches what code is doing.

Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
