<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/usb/host/isp1760-hcd.c, branch v3.5.1</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>isp1760-hcd: fix possible memory leak if urb could not be enqueued</title>
<updated>2012-04-18T20:51:19+00:00</updated>
<author>
<name>Michael Grzeschik</name>
<email>m.grzeschik@pengutronix.de</email>
</author>
<published>2012-04-05T12:56:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8788fa0344419d1d9bd1be3f61f1f0c4d9c1d568'/>
<id>8788fa0344419d1d9bd1be3f61f1f0c4d9c1d568</id>
<content type='text'>
After packetize_urb was called, we could still run into an error path
and will not hand over the prepared qtd to the qtd_list. Make sure to
free the prepared qtd in that case to avoid memory leaks.

Signed-off-by: Michael Grzeschik &lt;m.grzeschik@pengutronix.de&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>
After packetize_urb was called, we could still run into an error path
and will not hand over the prepared qtd to the qtd_list. Make sure to
free the prepared qtd in that case to avoid memory leaks.

Signed-off-by: Michael Grzeschik &lt;m.grzeschik@pengutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>isp1760-hcd: move dequeued qtds to the front in qh</title>
<updated>2012-04-18T20:51:19+00:00</updated>
<author>
<name>Michael Grzeschik</name>
<email>m.grzeschik@pengutronix.de</email>
</author>
<published>2012-04-18T07:58:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8cb2268001f9553f9ff83416ce3f009c4ab1e089'/>
<id>8cb2268001f9553f9ff83416ce3f009c4ab1e089</id>
<content type='text'>
Make sure that dequeued urbs get handled first
by collect_qtds. To achieve that we better move them
up to the head in the qh list.

This for instance fixes hanging serial devices, which wait
for dequeued urbs to properly close their device node.

Signed-off-by: Michael Grzeschik &lt;m.grzeschik@pengutronix.de&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>
Make sure that dequeued urbs get handled first
by collect_qtds. To achieve that we better move them
up to the head in the qh list.

This for instance fixes hanging serial devices, which wait
for dequeued urbs to properly close their device node.

Signed-off-by: Michael Grzeschik &lt;m.grzeschik@pengutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>isp1760-hcd: don't confuse parsers on kmem_cache_create</title>
<updated>2012-04-18T20:50:44+00:00</updated>
<author>
<name>Michael Grzeschik</name>
<email>m.grzeschik@pengutronix.de</email>
</author>
<published>2012-04-05T12:56:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=94011ec24ca1d1d5674651d6f30368f4138dbdd6'/>
<id>94011ec24ca1d1d5674651d6f30368f4138dbdd6</id>
<content type='text'>
If DEBUG is defined, the kmem_cache_create call a
WARN_ON if the name of the cache uses a space.

Signed-off-by: Michael Grzeschik &lt;m.grzeschik@pengutronix.de&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>
If DEBUG is defined, the kmem_cache_create call a
WARN_ON if the name of the cache uses a space.

Signed-off-by: Michael Grzeschik &lt;m.grzeschik@pengutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb/isp1760: Fix race condition memory leak</title>
<updated>2011-11-27T04:02:47+00:00</updated>
<author>
<name>Arvid Brodin</name>
<email>arvid.brodin@enea.com</email>
</author>
<published>2011-11-23T17:13:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c64391f264b7658c00515173cca58f5b054af1a2'/>
<id>c64391f264b7658c00515173cca58f5b054af1a2</id>
<content type='text'>
This fixes a memory leak reported by Catalin Marinas:

schedule_ptds() is called from isp1760_irq() and removes the qh from the
controlqhs queue but ep-&gt;hcpriv still points to the qh and therefore it is not
freed.

Shortly after this, the isp1760_endpoint_disable() function sets ep-&gt;hcpriv to
NULL and calls schedule_ptds() but since the corresponding qh is no longer in
the queue, it is simply forgotten and reported by kmemleak.

With this patch, the qh is always freed at endpoint_disable, instead, and the
corresponding entry removed from the queue head list.

While I was at it, I also replaced the lines in isp1760_endpoint_disable()
that removed remaining qtds from the qh with a WARN_ON check for non-empty qh,
in line with earlier comments from Alan Stern (linux-usb list, 2011-07-20).

Signed-off-by: Arvid Brodin &lt;arvid.brodin@enea.com&gt;
Tested-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes a memory leak reported by Catalin Marinas:

schedule_ptds() is called from isp1760_irq() and removes the qh from the
controlqhs queue but ep-&gt;hcpriv still points to the qh and therefore it is not
freed.

Shortly after this, the isp1760_endpoint_disable() function sets ep-&gt;hcpriv to
NULL and calls schedule_ptds() but since the corresponding qh is no longer in
the queue, it is simply forgotten and reported by kmemleak.

With this patch, the qh is always freed at endpoint_disable, instead, and the
corresponding entry removed from the queue head list.

While I was at it, I also replaced the lines in isp1760_endpoint_disable()
that removed remaining qtds from the qh with a WARN_ON check for non-empty qh,
in line with earlier comments from Alan Stern (linux-usb list, 2011-07-20).

Signed-off-by: Arvid Brodin &lt;arvid.brodin@enea.com&gt;
Tested-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb/isp1760: Simpler queue head list code.</title>
<updated>2011-11-27T04:02:47+00:00</updated>
<author>
<name>Arvid Brodin</name>
<email>arvid.brodin@enea.com</email>
</author>
<published>2011-11-23T17:10:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e08f6a2790aaf3563e7800399321c0fb9a6c6636'/>
<id>e08f6a2790aaf3563e7800399321c0fb9a6c6636</id>
<content type='text'>
Small code refactoring to ease the real fix in patch #2.

Signed-off-by: Arvid Brodin &lt;arvid.brodin@enea.com&gt;
Tested-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Small code refactoring to ease the real fix in patch #2.

Signed-off-by: Arvid Brodin &lt;arvid.brodin@enea.com&gt;
Tested-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb/isp1760: Allow to optionally trigger low-level chip reset via GPIOLIB.</title>
<updated>2011-10-19T20:29:06+00:00</updated>
<author>
<name>Joachim Foerster</name>
<email>joachim.foerster@missinglinkelectronics.com</email>
</author>
<published>2011-10-19T12:18:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3a7655fcb210b349111251689d0a56b7250885ea'/>
<id>3a7655fcb210b349111251689d0a56b7250885ea</id>
<content type='text'>
Properly triggering the reset wire is necessary with the ISP1761 used
on Terasic DE4 Altera-FPGA boards using a NIOS2 processor, for example.

This is an optional implementation for the OF binding only. The other
bindings just pass an invalid GPIO to the isp1760_register() routine.

Example, usage in DTS:
        gpios = &lt;&amp;pio_isp1761rst_0 0 1&gt;;
to point to a GPIO controller from within the ISP1761 node: GPIO 0, active low.

Signed-off-by: Joachim Foerster &lt;joachim.foerster@missinglinkelectronics.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Properly triggering the reset wire is necessary with the ISP1761 used
on Terasic DE4 Altera-FPGA boards using a NIOS2 processor, for example.

This is an optional implementation for the OF binding only. The other
bindings just pass an invalid GPIO to the isp1760_register() routine.

Example, usage in DTS:
        gpios = &lt;&amp;pio_isp1761rst_0 0 1&gt;;
to point to a GPIO controller from within the ISP1761 node: GPIO 0, active low.

Signed-off-by: Joachim Foerster &lt;joachim.foerster@missinglinkelectronics.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb/isp1760: Clear TT buffer on interrupted low &amp; full speed transfers</title>
<updated>2011-08-23T00:05:27+00:00</updated>
<author>
<name>Arvid Brodin</name>
<email>arvid.brodin@enea.com</email>
</author>
<published>2011-08-22T23:25:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=74ad60292bf0108de9884c531d7ec3f65c206230'/>
<id>74ad60292bf0108de9884c531d7ec3f65c206230</id>
<content type='text'>
When a low or full speed urb in progress is unlinked (or some other error
occurs), the buffer in the transaction translator (part of the hub) might end
up in an inconsistent state. This can make all further low and full speed
transactions fail, unless the buffer is cleared.

The bug can be seen when running the usbtest unlink tests as "set altsetting
to 0 failed, -110", and gets fixed by this patch.

Signed-off-by: Arvid Brodin &lt;arvid.brodin@enea.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a low or full speed urb in progress is unlinked (or some other error
occurs), the buffer in the transaction translator (part of the hub) might end
up in an inconsistent state. This can make all further low and full speed
transactions fail, unless the buffer is cleared.

The bug can be seen when running the usbtest unlink tests as "set altsetting
to 0 failed, -110", and gets fixed by this patch.

Signed-off-by: Arvid Brodin &lt;arvid.brodin@enea.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb/isp1760: Fix problems that trigger WARNING at line 1136.</title>
<updated>2011-08-22T22:32:46+00:00</updated>
<author>
<name>Arvid Brodin</name>
<email>arvid.brodin@enea.com</email>
</author>
<published>2011-08-21T06:29:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6477acc0814fc7aadfe3d723d2596fb4eb6d1732'/>
<id>6477acc0814fc7aadfe3d723d2596fb4eb6d1732</id>
<content type='text'>
1) A bug in the usage of time_after() in errata2_function().

2) Clear done_maps just prior to starting a new transfer in
   start_bus_transfer(), instead of just after, when done_map bits might have
   been validly set by the started transfer.

Signed-off-by: Arvid Brodin &lt;arvid.brodin@enea.com&gt;
Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1) A bug in the usage of time_after() in errata2_function().

2) Clear done_maps just prior to starting a new transfer in
   start_bus_transfer(), instead of just after, when done_map bits might have
   been validly set by the started transfer.

Signed-off-by: Arvid Brodin &lt;arvid.brodin@enea.com&gt;
Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb/isp1760: Fix missing endpoint unlink when no mem during enqueue</title>
<updated>2011-08-22T22:32:45+00:00</updated>
<author>
<name>Arvid Brodin</name>
<email>arvid.brodin@enea.com</email>
</author>
<published>2011-08-21T06:29:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=38679b720014d89b192c38d4c604f5a718b9788d'/>
<id>38679b720014d89b192c38d4c604f5a718b9788d</id>
<content type='text'>
... and some small code style fixes.

Signed-off-by: Arvid Brodin &lt;arvid.brodin@enea.com&gt;
Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
... and some small code style fixes.

Signed-off-by: Arvid Brodin &lt;arvid.brodin@enea.com&gt;
Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb/isp1760: Use polling instead of SOF interrupts to fix Errata 2</title>
<updated>2011-08-22T22:32:45+00:00</updated>
<author>
<name>Arvid Brodin</name>
<email>arvid.brodin@enea.com</email>
</author>
<published>2011-08-21T06:29:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6d50c60e6d169b04b0cf0b267eb14ab0839f9540'/>
<id>6d50c60e6d169b04b0cf0b267eb14ab0839f9540</id>
<content type='text'>
Errata 2 for the isp1760 explains that the chip sometimes does not issue
interrupts when an ATL (bulk or control) transfer is completed. There are
several issues with the current work-around (SOF interrupts) for this:

1) It seems the chip sometimes does not even set the done bit for a
   completed transfer, in which case SOF interrupts does not solve
   the problem since we still check the done map to find out which
   transfer descriptors to handle.

2) The above point seems to happen only when ATL and SOF interrupts
   are enabled at the same time. However, disabling ATL interrupts
   increases the latency between transfer completion and handling.
   This is very noticeable in the testusb suite, which take several
   minutes more to run with ATL interrupts disabled.

This patch removes the code to switch on SOF interrupts, and instead
use a kernel timer to periodically check for "old" descriptors that
have their VALID and ACTIVE flags unset, indicating completion, thus
avoiding the dependency on the chip's done map (and SOF interrupts)
to find transfers affected by this HW bug.

[bigeasy@linutronix: 80 lines limit]

Signed-off-by: Arvid Brodin &lt;arvid.brodin@enea.com&gt;
Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Errata 2 for the isp1760 explains that the chip sometimes does not issue
interrupts when an ATL (bulk or control) transfer is completed. There are
several issues with the current work-around (SOF interrupts) for this:

1) It seems the chip sometimes does not even set the done bit for a
   completed transfer, in which case SOF interrupts does not solve
   the problem since we still check the done map to find out which
   transfer descriptors to handle.

2) The above point seems to happen only when ATL and SOF interrupts
   are enabled at the same time. However, disabling ATL interrupts
   increases the latency between transfer completion and handling.
   This is very noticeable in the testusb suite, which take several
   minutes more to run with ATL interrupts disabled.

This patch removes the code to switch on SOF interrupts, and instead
use a kernel timer to periodically check for "old" descriptors that
have their VALID and ACTIVE flags unset, indicating completion, thus
avoiding the dependency on the chip's done map (and SOF interrupts)
to find transfers affected by this HW bug.

[bigeasy@linutronix: 80 lines limit]

Signed-off-by: Arvid Brodin &lt;arvid.brodin@enea.com&gt;
Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
