<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/tty/n_tty.c, branch v3.7</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>Remove BUG_ON from n_tty_read()</title>
<updated>2012-08-16T18:53:14+00:00</updated>
<author>
<name>Stanislav Kozina</name>
<email>skozina@redhat.com</email>
</author>
<published>2012-08-16T11:01:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e9490e93c1978b6669f3e993caa3189be13ce459'/>
<id>e9490e93c1978b6669f3e993caa3189be13ce459</id>
<content type='text'>
Change the BUG_ON to WARN_ON and return in case of tty-&gt;read_buf==NULL. We want to track a
couple of long standing reports of this but at the same time we can avoid killing the box.

Signed-off-by: Stanislav Kozina &lt;skozina@redhat.com&gt;
Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Cc: Horses &lt;stable@kernel.org&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>
Change the BUG_ON to WARN_ON and return in case of tty-&gt;read_buf==NULL. We want to track a
couple of long standing reports of this but at the same time we can avoid killing the box.

Signed-off-by: Stanislav Kozina &lt;skozina@redhat.com&gt;
Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Cc: Horses &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>n_tty: Don't lose characters when PARMRK is enabled</title>
<updated>2012-08-10T20:14:54+00:00</updated>
<author>
<name>Jaeden Amero</name>
<email>jaeden.amero@ni.com</email>
</author>
<published>2012-07-27T13:43:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=090abf7b91645c1936ba959b1e1cd6d09110779c'/>
<id>090abf7b91645c1936ba959b1e1cd6d09110779c</id>
<content type='text'>
When PARMRK is set and large transfers of characters that will get
marked are being received, n_tty could drop data silently (i.e.
without reporting any error to the client). This is because
characters have the potential to take up to three bytes in the line
discipline (when they get marked with parity or framing errors), but
the amount of free space reported to tty_buffer flush_to_ldisc (via
tty-&gt;receive_room) is based on the pre-marked data size.

With this patch, the n_tty layer will no longer assume that each byte
will only take up one byte in the line discipline. Instead, it will
make an overly conservative estimate that each byte will take up
three bytes in the line discipline when PARMRK is set.

Signed-off-by: Jaeden Amero &lt;jaeden.amero@ni.com&gt;
Acked-by: Alan Cox &lt;alan@linux.intel.com&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>
When PARMRK is set and large transfers of characters that will get
marked are being received, n_tty could drop data silently (i.e.
without reporting any error to the client). This is because
characters have the potential to take up to three bytes in the line
discipline (when they get marked with parity or framing errors), but
the amount of free space reported to tty_buffer flush_to_ldisc (via
tty-&gt;receive_room) is based on the pre-marked data size.

With this patch, the n_tty layer will no longer assume that each byte
will only take up one byte in the line discipline. Instead, it will
make an overly conservative estimate that each byte will take up
three bytes in the line discipline when PARMRK is set.

Signed-off-by: Jaeden Amero &lt;jaeden.amero@ni.com&gt;
Acked-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tty: Fix possible race in n_tty_read()</title>
<updated>2012-08-10T20:13:11+00:00</updated>
<author>
<name>Stanislav Kozina</name>
<email>skozina@redhat.com</email>
</author>
<published>2012-08-09T13:48:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=00aaae033e323af33740e7012a8ba4b0fa6dce20'/>
<id>00aaae033e323af33740e7012a8ba4b0fa6dce20</id>
<content type='text'>
Fix possible panic caused by unlocked access to tty-&gt;read_cnt in
while-loop condition in n_tty_read().

Signed-off-by: Stanislav Kozina &lt;skozina@redhat.com&gt;
Signed-off-by: Alan Cox &lt;alan@linux.intel.com&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>
Fix possible panic caused by unlocked access to tty-&gt;read_cnt in
while-loop condition in n_tty_read().

Signed-off-by: Stanislav Kozina &lt;skozina@redhat.com&gt;
Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tty: move the termios object into the tty</title>
<updated>2012-07-16T20:00:41+00:00</updated>
<author>
<name>Alan Cox</name>
<email>alan@linux.intel.com</email>
</author>
<published>2012-07-14T14:31:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=adc8d746caa67fff4b53ba3e5163a6cbacc3b523'/>
<id>adc8d746caa67fff4b53ba3e5163a6cbacc3b523</id>
<content type='text'>
This will let us sort out a whole pile of tty related races. The
alternative would be to keep points and refcount the termios objects.
However
1. They are tiny anyway
2. Many devices don't use the stored copies
3. We can remove a pty special case

Signed-off-by: Alan Cox &lt;alan@linux.intel.com&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>
This will let us sort out a whole pile of tty related races. The
alternative would be to keep points and refcount the termios objects.
However
1. They are tiny anyway
2. Many devices don't use the stored copies
3. We can remove a pty special case

Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tty: note race we need to fix</title>
<updated>2012-06-27T02:25:38+00:00</updated>
<author>
<name>Alan Cox</name>
<email>alan@lxorguk.ukuu.org.uk</email>
</author>
<published>2012-06-22T15:40:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0a44ab41eb833d07e3ec807d87151c7164d4f075'/>
<id>0a44ab41eb833d07e3ec807d87151c7164d4f075</id>
<content type='text'>
This was identified by Vincent Pillet with a high speed interface that uses
low latency mode. In the low latency case we have a tiny race but it can
be hit.

Signed-off-by: Alan Cox &lt;alan@linux.intel.com&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>
This was identified by Vincent Pillet with a high speed interface that uses
low latency mode. In the low latency case we have a tiny race but it can
be hit.

Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>TTY: n_tty, do not dereference user buffer</title>
<updated>2012-04-30T02:13:54+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2012-04-26T18:13:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3fa10cc83fb92750af11fab81e11ad96dc75d656'/>
<id>3fa10cc83fb92750af11fab81e11ad96dc75d656</id>
<content type='text'>
copy_from_read_buf currently copies data to a user buffer and then
checks if the data is single EOF. But it checks it by accessing the
user buffer. First, the buffer may be changed by other threads of the
user program already. Second, it accesses the buffer without any
checks. It might be write-only for example.

Fix this by inspecting contents of the tty (kernel) buffer instead.
Note that "n == 1" is necessary, but not sufficient. But we check
later that there is nothing left by "!tty-&gt;read_cnt" condition.

There is still an issue with the current code that EOF being wrapped
to the start of the circular buffer will result in an inappropriate
losing of the EOF character. But this is not intended to be fixed by
this patch.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Reported-by: Emil Goode &lt;emilgoode@gmail.com&gt;
Cc: Howard Chu &lt;hyc@symas.com&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&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>
copy_from_read_buf currently copies data to a user buffer and then
checks if the data is single EOF. But it checks it by accessing the
user buffer. First, the buffer may be changed by other threads of the
user program already. Second, it accesses the buffer without any
checks. It might be write-only for example.

Fix this by inspecting contents of the tty (kernel) buffer instead.
Note that "n == 1" is necessary, but not sufficient. But we check
later that there is nothing left by "!tty-&gt;read_cnt" condition.

There is still an issue with the current code that EOF being wrapped
to the start of the circular buffer will result in an inappropriate
losing of the EOF character. But this is not intended to be fixed by
this patch.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Reported-by: Emil Goode &lt;emilgoode@gmail.com&gt;
Cc: Howard Chu &lt;hyc@symas.com&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove all #inclusions of asm/system.h</title>
<updated>2012-03-28T17:30:03+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2012-03-28T17:30:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9ffc93f203c18a70623f21950f1dd473c9ec48cd'/>
<id>9ffc93f203c18a70623f21950f1dd473c9ec48cd</id>
<content type='text'>
Remove all #inclusions of asm/system.h preparatory to splitting and killing
it.  Performed with the following command:

perl -p -i -e 's!^#\s*include\s*&lt;asm/system[.]h&gt;.*\n!!' `grep -Irl '^#\s*include\s*&lt;asm/system[.]h&gt;' *`

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove all #inclusions of asm/system.h preparatory to splitting and killing
it.  Performed with the following command:

perl -p -i -e 's!^#\s*include\s*&lt;asm/system[.]h&gt;.*\n!!' `grep -Irl '^#\s*include\s*&lt;asm/system[.]h&gt;' *`

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers/tty: Remove unneeded spaces</title>
<updated>2011-12-10T03:11:35+00:00</updated>
<author>
<name>Thorsten WiÃŸmann</name>
<email>re06huxa@cip.cs.fau.de</email>
</author>
<published>2011-12-08T16:47:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bbd20759d157e6ecbe2e64e2d9d2505b504bb6b9'/>
<id>bbd20759d157e6ecbe2e64e2d9d2505b504bb6b9</id>
<content type='text'>
coding style fixes in n_tty.c

Signed-off-by: Maximilian Krüger &lt;maxfragg@gmail.com&gt;
Signed-off-by: Thorsten Wißmann &lt;re06huxa@cip.cs.fau.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>
coding style fixes in n_tty.c

Signed-off-by: Maximilian Krüger &lt;maxfragg@gmail.com&gt;
Signed-off-by: Thorsten Wißmann &lt;re06huxa@cip.cs.fau.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6</title>
<updated>2011-07-26T06:09:27+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-07-26T06:09:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d5ef642355bdd9b383ff5c18cbc6102a06eecbaf'/>
<id>d5ef642355bdd9b383ff5c18cbc6102a06eecbaf</id>
<content type='text'>
* 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (26 commits)
  amba pl011: workaround for uart registers lockup
  n_gsm: fix the wrong FCS handling
  pch_uart: add missing comment about OKI ML7223
  pch_uart: Add MSI support
  tty: fix "IRQ45: nobody cared"
  PTI feature to allow user to name and mark masterchannel request.
  0 for o PTI Makefile bug.
  tty: serial: samsung.c remove legacy PM code.
  SERIAL: SC26xx: Fix link error.
  serial: mrst_max3110: initialize waitqueue earlier
  mrst_max3110: Change max missing message priority.
  tty: s5pv210: Add delay loop on fifo reset function for UART
  tty/serial: Fix XSCALE serial ports, e.g. ce4100
  serial: bfin_5xx: fix off-by-one with resource size
  drivers/tty: use printk_ratelimited() instead of printk_ratelimit()
  tty: n_gsm: Added refcount usage to gsm_mux and gsm_dlci structs
  tty: n_gsm: Add raw-ip support
  tty: n_gsm: expose gsmtty device nodes at ldisc open time
  pch_phub: Fix register miss-setting issue
  serial: 8250, increase PASS_LIMIT
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (26 commits)
  amba pl011: workaround for uart registers lockup
  n_gsm: fix the wrong FCS handling
  pch_uart: add missing comment about OKI ML7223
  pch_uart: Add MSI support
  tty: fix "IRQ45: nobody cared"
  PTI feature to allow user to name and mark masterchannel request.
  0 for o PTI Makefile bug.
  tty: serial: samsung.c remove legacy PM code.
  SERIAL: SC26xx: Fix link error.
  serial: mrst_max3110: initialize waitqueue earlier
  mrst_max3110: Change max missing message priority.
  tty: s5pv210: Add delay loop on fifo reset function for UART
  tty/serial: Fix XSCALE serial ports, e.g. ce4100
  serial: bfin_5xx: fix off-by-one with resource size
  drivers/tty: use printk_ratelimited() instead of printk_ratelimit()
  tty: n_gsm: Added refcount usage to gsm_mux and gsm_dlci structs
  tty: n_gsm: Add raw-ip support
  tty: n_gsm: expose gsmtty device nodes at ldisc open time
  pch_phub: Fix register miss-setting issue
  serial: 8250, increase PASS_LIMIT
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>tty: fix "IRQ45: nobody cared"</title>
<updated>2011-07-01T22:40:19+00:00</updated>
<author>
<name>Andrew McGregor</name>
<email>andrew.mcgregor@alliedtelesis.co.nz</email>
</author>
<published>2011-06-12T23:31:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7b292b4bf9a9d6098440d85616d6ca4c608b8304'/>
<id>7b292b4bf9a9d6098440d85616d6ca4c608b8304</id>
<content type='text'>
Unthrottling the TTY during close ends up enabling interrupts
on a device not on the active list, which will never have the
interrupts cleared.  Doctor, it hurts when I do this.

&gt;&gt;&gt; On 6/2/2011 at 01:56 AM, in message &lt;20110601145608.3e586e16@bob.linux.org.uk&gt;, Alan Cox &lt;alan@linux.intel.com&gt; wrote:
&gt; On Wed, 01 Jun 2011 10:34:07 +1200
&gt; "andrew mcgregor" &lt;andrew.mcgregor@alliedtelesis.co.nz&gt; wrote:
&gt; &gt; The LKML message
&gt; &gt; http://kerneltrap.org/mailarchive/linux-kernel/2010/2/25/4541847 from
&gt; &gt; February doesn't seem to have been resolved since.  We struck the
&gt; &gt; issue, and the patch below (against 2.6.32) fixes it.  Should I
&gt; &gt; supply a patch against 3.0.0rc?
&gt;
&gt; I think that would be sensible. I don't actually see how you hit it as
&gt; the IRQ ought to be masked by then but it's certainly wrong for n_tty
&gt; to be calling into check_unthrottle at that point.
&gt;
&gt; So yes please send a patch with a suitable Signed-off-by: line to
&gt; linux-serial and cc GregKH &lt;greg@kroah.com&gt; as well.
&gt;
&gt; Alan

Signed-off-by: Andrew McGregor &lt;andrew.mcgregor@alliedtelesis.co.nz&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>
Unthrottling the TTY during close ends up enabling interrupts
on a device not on the active list, which will never have the
interrupts cleared.  Doctor, it hurts when I do this.

&gt;&gt;&gt; On 6/2/2011 at 01:56 AM, in message &lt;20110601145608.3e586e16@bob.linux.org.uk&gt;, Alan Cox &lt;alan@linux.intel.com&gt; wrote:
&gt; On Wed, 01 Jun 2011 10:34:07 +1200
&gt; "andrew mcgregor" &lt;andrew.mcgregor@alliedtelesis.co.nz&gt; wrote:
&gt; &gt; The LKML message
&gt; &gt; http://kerneltrap.org/mailarchive/linux-kernel/2010/2/25/4541847 from
&gt; &gt; February doesn't seem to have been resolved since.  We struck the
&gt; &gt; issue, and the patch below (against 2.6.32) fixes it.  Should I
&gt; &gt; supply a patch against 3.0.0rc?
&gt;
&gt; I think that would be sensible. I don't actually see how you hit it as
&gt; the IRQ ought to be masked by then but it's certainly wrong for n_tty
&gt; to be calling into check_unthrottle at that point.
&gt;
&gt; So yes please send a patch with a suitable Signed-off-by: line to
&gt; linux-serial and cc GregKH &lt;greg@kroah.com&gt; as well.
&gt;
&gt; Alan

Signed-off-by: Andrew McGregor &lt;andrew.mcgregor@alliedtelesis.co.nz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
