<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/usb/class, branch tegra-9.12.14</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: usbtmc: repeat usb_bulk_msg until whole message is transfered</title>
<updated>2009-12-18T22:03:59+00:00</updated>
<author>
<name>Andre Herms</name>
<email>andre.herms@tec-venture.de</email>
</author>
<published>2009-11-19T17:14:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f4c0cf18d2b21dd614662c3b95ce0ffd0a4aa881'/>
<id>f4c0cf18d2b21dd614662c3b95ce0ffd0a4aa881</id>
<content type='text'>
commit ec412b92dbe3ea839716853eea058d1bcc5e6ca4 upstream.

usb_bulk_msg() transfers only bytes up to the maximum packet size.
It must be repeated by the usbtmc driver until all bytes of a TMC message
are transfered.

Without this patch, ETIMEDOUT is reported when writing TMC messages
larger than the maximum USB bulk size and the transfer remains incomplete.
The user will notice that the device hangs and must be reset by either closing
the application or pulling the plug.

Signed-off-by: Andre Herms &lt;andre.herms@tec-venture.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>
commit ec412b92dbe3ea839716853eea058d1bcc5e6ca4 upstream.

usb_bulk_msg() transfers only bytes up to the maximum packet size.
It must be repeated by the usbtmc driver until all bytes of a TMC message
are transfered.

Without this patch, ETIMEDOUT is reported when writing TMC messages
larger than the maximum USB bulk size and the transfer remains incomplete.
The user will notice that the device hangs and must be reset by either closing
the application or pulling the plug.

Signed-off-by: Andre Herms &lt;andre.herms@tec-venture.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: cdc_acm: Fix memory leak after hangup</title>
<updated>2009-11-18T00:46:33+00:00</updated>
<author>
<name>Francesco Lavra</name>
<email>francescolavra@interfree.it</email>
</author>
<published>2009-11-03T10:53:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=051522bb47797f7168a617a0752d7ddc1a2f6f24'/>
<id>051522bb47797f7168a617a0752d7ddc1a2f6f24</id>
<content type='text'>
Am Donnerstag, 10. September 2009 15:43:53 schrieb Dietmar Hilbrich:
&gt; Hello,
&gt;
&gt; i have the following problem with the cdc-acm - driver:
&gt;
&gt; I'm using the driver with an "Ericsson F3507G" on a Thinkpad T400.
&gt;
&gt; If a disable the device (with the RFKill-Switch) while it is used by a
&gt; programm like ppp, the driver doesn't seem to correctly clean up the tty,
&gt; even after the program has been closed)
&gt;
&gt; The tty is still active (e.g. there still exists an entry in
&gt; /sys/dev/char/166:0 if ttyACM0 was used) and if a reacticate the device,
&gt; this device entry will be skipped and the Device-Nodes ttyACM1, ttyACM2
&gt; and ttyACM3 will be used.
&gt;
&gt; This problem was introduced with the commit
&gt; 10077d4a6674f535abdbe25cdecb1202af7948f1 (before 2.6.31-rc1) and still
&gt; exists in 2.6.31.
&gt;
&gt; I was able the fix this problem with the following patch:
&gt;
&gt; diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
&gt; index 2bfc41e..0970d2f 100644
&gt; --- a/drivers/usb/class/cdc-acm.c
&gt; +++ b/drivers/usb/class/cdc-acm.c
&gt; @@ -676,6 +676,7 @@ static void acm_tty_hangup(struct tty_struct *tty)
&gt;         struct acm *acm = tty-&gt;driver_data;
&gt;         tty_port_hangup(&amp;acm-&gt;port);
&gt;         acm_port_down(acm, 0);
&gt; +       acm_tty_unregister(acm);
&gt;  }

I have the same problem with cdc-acm (I'm using a Samsung SGH-U900): when I
unplug it from the USB port during a PPP connection, the ppp daemon gets the
hangup correctly (and closes the device), but the struct acm corresponding to
the device disconnected is not freed. Hence reconnecting the device results in
creation of /dev/ttyACM(x+1). The same happens when the system is hibernated
during a PPP connection.

This memory leak is due to the fact that when the tty is hung up,
tty_port_close_start() returns always zero, and acm_tty_close() never reaches
the point where acm_tty_unregister() is called.

Here is a fix for this.

Signed-off-by: Francesco Lavra &lt;francescolavra@interfree.it&gt;
Acked-by: Oliver Neukum &lt;oliver@neukum.org&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>
Am Donnerstag, 10. September 2009 15:43:53 schrieb Dietmar Hilbrich:
&gt; Hello,
&gt;
&gt; i have the following problem with the cdc-acm - driver:
&gt;
&gt; I'm using the driver with an "Ericsson F3507G" on a Thinkpad T400.
&gt;
&gt; If a disable the device (with the RFKill-Switch) while it is used by a
&gt; programm like ppp, the driver doesn't seem to correctly clean up the tty,
&gt; even after the program has been closed)
&gt;
&gt; The tty is still active (e.g. there still exists an entry in
&gt; /sys/dev/char/166:0 if ttyACM0 was used) and if a reacticate the device,
&gt; this device entry will be skipped and the Device-Nodes ttyACM1, ttyACM2
&gt; and ttyACM3 will be used.
&gt;
&gt; This problem was introduced with the commit
&gt; 10077d4a6674f535abdbe25cdecb1202af7948f1 (before 2.6.31-rc1) and still
&gt; exists in 2.6.31.
&gt;
&gt; I was able the fix this problem with the following patch:
&gt;
&gt; diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
&gt; index 2bfc41e..0970d2f 100644
&gt; --- a/drivers/usb/class/cdc-acm.c
&gt; +++ b/drivers/usb/class/cdc-acm.c
&gt; @@ -676,6 +676,7 @@ static void acm_tty_hangup(struct tty_struct *tty)
&gt;         struct acm *acm = tty-&gt;driver_data;
&gt;         tty_port_hangup(&amp;acm-&gt;port);
&gt;         acm_port_down(acm, 0);
&gt; +       acm_tty_unregister(acm);
&gt;  }

I have the same problem with cdc-acm (I'm using a Samsung SGH-U900): when I
unplug it from the USB port during a PPP connection, the ppp daemon gets the
hangup correctly (and closes the device), but the struct acm corresponding to
the device disconnected is not freed. Hence reconnecting the device results in
creation of /dev/ttyACM(x+1). The same happens when the system is hibernated
during a PPP connection.

This memory leak is due to the fact that when the tty is hung up,
tty_port_close_start() returns always zero, and acm_tty_close() never reaches
the point where acm_tty_unregister() is called.

Here is a fix for this.

Signed-off-by: Francesco Lavra &lt;francescolavra@interfree.it&gt;
Acked-by: Oliver Neukum &lt;oliver@neukum.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: cdc_acm: Fix race condition when opening tty</title>
<updated>2009-11-18T00:46:33+00:00</updated>
<author>
<name>Henry Gebhardt</name>
<email>gebhardt@astro.uni-tuebingen.de</email>
</author>
<published>2009-11-04T10:19:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=18a77b5d237a67d2c621a46f5271a3b51da1b380'/>
<id>18a77b5d237a67d2c621a46f5271a3b51da1b380</id>
<content type='text'>
If acm_rx_tasklet() gets called before tty_port_block_til_ready()
returns, then bulk IN urbs may not be sent. This fixes it.

Signed-off-by: Henry Gebhardt &lt;gebhardt@astro.uni-tuebingen.de&gt;
Acked-by: Oliver Neukum &lt;oliver@neukum.org&gt;
Cc: stable &lt;stable@kernel.org&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>
If acm_rx_tasklet() gets called before tty_port_block_til_ready()
returns, then bulk IN urbs may not be sent. This fixes it.

Signed-off-by: Henry Gebhardt &lt;gebhardt@astro.uni-tuebingen.de&gt;
Acked-by: Oliver Neukum &lt;oliver@neukum.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: usbtmc: fix timeout increase</title>
<updated>2009-10-09T20:52:06+00:00</updated>
<author>
<name>Gergely Imreh</name>
<email>imrehg@gmail.com</email>
</author>
<published>2009-09-15T08:03:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=35f76e897d67fb62b4ec0be01fc0caaeb7f90108'/>
<id>35f76e897d67fb62b4ec0be01fc0caaeb7f90108</id>
<content type='text'>
The current 10ms timeout is too short for some normal USBTMC device
operation, increase it to a value which was tested with previously
affected Tektronix oscilloscopes.

Signed-off-by: Gergely Imreh &lt;imrehg@gmail.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>
The current 10ms timeout is too short for some normal USBTMC device
operation, increase it to a value which was tested with previously
affected Tektronix oscilloscopes.

Signed-off-by: Gergely Imreh &lt;imrehg@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>const: constify remaining file_operations</title>
<updated>2009-10-01T23:11:11+00:00</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2009-10-01T22:43:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=828c09509b9695271bcbdc53e9fc9a6a737148d2'/>
<id>828c09509b9695271bcbdc53e9fc9a6a737148d2</id>
<content type='text'>
[akpm@linux-foundation.org: fix KVM]
Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Acked-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[akpm@linux-foundation.org: fix KVM]
Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Acked-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>USB: fix USBTMC get_capabilities success handling</title>
<updated>2009-09-23T13:46:39+00:00</updated>
<author>
<name>Gergely Imreh</name>
<email>imrehg@gmail.com</email>
</author>
<published>2009-09-07T02:47:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d0a38365d9585bf3fb71f7c57fd532441a14f3e8'/>
<id>d0a38365d9585bf3fb71f7c57fd532441a14f3e8</id>
<content type='text'>
In order:
Add reference to relevant section of USBTMC usb488 subclass specs.
Print debug output of capabilities only when it was retrieved successfully.
Clear return value on success, otherwise driver always reports failure.

Signed-off-by: Gergely Imreh &lt;imrehg@gmail.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>
In order:
Add reference to relevant section of USBTMC usb488 subclass specs.
Print debug output of capabilities only when it was retrieved successfully.
Clear return value on success, otherwise driver always reports failure.

Signed-off-by: Gergely Imreh &lt;imrehg@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: usbtmc: correct termination condition for reads.</title>
<updated>2009-09-23T13:46:35+00:00</updated>
<author>
<name>Steve Holland</name>
<email>sdh4@iastate.edu</email>
</author>
<published>2009-06-18T22:37:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4143d178e7b39c00d5277040c69a1522c4d98871'/>
<id>4143d178e7b39c00d5277040c69a1522c4d98871</id>
<content type='text'>
Follow T&amp;M convention of obeying EOM flag.  Avoid exception cases where
instrument response size matches a buffer size.

Signed-off-by: Steve Holland &lt;sdh4@iastate.edu&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>
Follow T&amp;M convention of obeying EOM flag.  Avoid exception cases where
instrument response size matches a buffer size.

Signed-off-by: Steve Holland &lt;sdh4@iastate.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: usbtmc: inhibit corruption</title>
<updated>2009-09-23T13:46:35+00:00</updated>
<author>
<name>Steve Holland</name>
<email>sdh4@iastate.edu</email>
</author>
<published>2009-06-18T22:37:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=92d07e422df3cc5370d0d9b95a671abb69d50ef1'/>
<id>92d07e422df3cc5370d0d9b95a671abb69d50ef1</id>
<content type='text'>
Limit data copied to userspace to amount requested.  Prevents a faulty
instrument from overwriting user memory.

Signed-off-by: Steve Holland &lt;sdh4@iastate.edu&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>
Limit data copied to userspace to amount requested.  Prevents a faulty
instrument from overwriting user memory.

Signed-off-by: Steve Holland &lt;sdh4@iastate.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: usbtmc: Fix short reads in usbtmc_read()</title>
<updated>2009-09-23T13:46:35+00:00</updated>
<author>
<name>Steve Holland</name>
<email>sdh4@iastate.edu</email>
</author>
<published>2009-06-18T22:37:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c2cd26e15b84b964c489f2aff278cdaf03840c93'/>
<id>c2cd26e15b84b964c489f2aff278cdaf03840c93</id>
<content type='text'>
The header size should not be included in the number of bytes requested of the
instrument

Signed-off-by: Steve Holland &lt;sdh4@iastate.edu&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>
The header size should not be included in the number of bytes requested of the
instrument

Signed-off-by: Steve Holland &lt;sdh4@iastate.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: usbtmc: fix printk format warnings</title>
<updated>2009-09-23T13:46:30+00:00</updated>
<author>
<name>Randy Dunlap</name>
<email>randy.dunlap@oracle.com</email>
</author>
<published>2009-07-28T18:22:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a2fbf10eba3a38407e3984bc9503342de2b5e399'/>
<id>a2fbf10eba3a38407e3984bc9503342de2b5e399</id>
<content type='text'>
Fix printk format warnings:
drivers/usb/class/usbtmc.c:466: warning: format '%zu' expects type 'size_t', but argument 4 has type 'u32'
drivers/usb/class/usbtmc.c:466: warning: format '%zu' expects type 'size_t', but argument 5 has type 'int'

Signed-off-by: Randy Dunlap &lt;randy.dunlap@oracle.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>
Fix printk format warnings:
drivers/usb/class/usbtmc.c:466: warning: format '%zu' expects type 'size_t', but argument 4 has type 'u32'
drivers/usb/class/usbtmc.c:466: warning: format '%zu' expects type 'size_t', but argument 5 has type 'int'

Signed-off-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

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