<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/serial, branch linux-2.6.29.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>8250: Fix oops from setserial</title>
<updated>2009-07-02T23:40:29+00:00</updated>
<author>
<name>Alan Cox</name>
<email>alan@linux.intel.com</email>
</author>
<published>2009-05-28T13:01:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5c652d98415a927dec43a1267d3e64a40dbb6936'/>
<id>5c652d98415a927dec43a1267d3e64a40dbb6936</id>
<content type='text'>
commit b8e7e40abeac49644fec4a4f52ffe74c7b05eca0 upstream.

If you setserial a port which has never been initialised we change the type
but don't update the I/O method pointers. The same problem is true if you
change the io type of a port - but nobody ever does that so nobody noticed!

Remember the old type and when attaching if the type has changed reload the
port accessor pointers. We can't do it blindly as some 8250 drivers load custom
accessors and we must not stomp those.

Tested-by: Victor Seryodkin &lt;vvscore@gmail.com&gt;
Closes-bug: #13367
Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Kirill Smelkov &lt;kirr@mns.spb.ru&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 b8e7e40abeac49644fec4a4f52ffe74c7b05eca0 upstream.

If you setserial a port which has never been initialised we change the type
but don't update the I/O method pointers. The same problem is true if you
change the io type of a port - but nobody ever does that so nobody noticed!

Remember the old type and when attaching if the type has changed reload the
port accessor pointers. We can't do it blindly as some 8250 drivers load custom
accessors and we must not stomp those.

Tested-by: Victor Seryodkin &lt;vvscore@gmail.com&gt;
Closes-bug: #13367
Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Kirill Smelkov &lt;kirr@mns.spb.ru&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>drivers/serial/mpc52xx_uart.c: fix array overindexing check</title>
<updated>2009-06-15T16:40:03+00:00</updated>
<author>
<name>Roel Kluin</name>
<email>roel.kluin@gmail.com</email>
</author>
<published>2009-05-28T21:34:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=500689eff402f957f55481166e09b79a9dd8b41d'/>
<id>500689eff402f957f55481166e09b79a9dd8b41d</id>
<content type='text'>
commit b898f4f869da5b9d41f297fff87aca4cd42d80b3 upstream.

The check for an overindexing of mpc52xx_uart_{ports,nodes} has an
off-by-one.

Signed-off-by: Roel Kluin &lt;roel.kluin@gmail.com&gt;
Acked-by: Wolfram Sang &lt;w.sang@pengutronix.de&gt;
Acked-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.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>
commit b898f4f869da5b9d41f297fff87aca4cd42d80b3 upstream.

The check for an overindexing of mpc52xx_uart_{ports,nodes} has an
off-by-one.

Signed-off-by: Roel Kluin &lt;roel.kluin@gmail.com&gt;
Acked-by: Wolfram Sang &lt;w.sang@pengutronix.de&gt;
Acked-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>icom: fix rmmod crash</title>
<updated>2009-06-15T16:40:00+00:00</updated>
<author>
<name>Breno Leitao</name>
<email>leitao@linux.vnet.ibm.com</email>
</author>
<published>2009-05-23T00:30:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=82b3c4cc1d1ab48121f5514e22e00c6dcf9e1fb7'/>
<id>82b3c4cc1d1ab48121f5514e22e00c6dcf9e1fb7</id>
<content type='text'>
commit 95caa0a9bdaf93607bd0cc8932f53112496f2f22 upstream.

Actually the icom driver is crashing when is being removed because
the driver is kfreeing the adapter structure before calling
pci_release_regions(), which result in the following error:

  Unable to handle kernel paging request for data at address 0x6b6b6b6b6b6b6d33
  Faulting instruction address: 0xc000000000246b80
  Oops: Kernel access of bad area, sig: 11 [#1]
  ....
  [c000000012d436a0] [c0000000001002d0] .kfree+0x120/0x34c (unreliable)
  [c000000012d43730] [c000000000246d60] .pci_release_selected_regions+0x3c/0x68
  [c000000012d437c0] [d000000002d54700] .icom_kref_release+0xf4/0x118 [icom]
  [c000000012d43850] [c000000000232e50] .kref_put+0x74/0x94
  [c000000012d438d0] [d000000002d56c58] .icom_remove+0x40/0xa4 [icom]
  [c000000012d43960] [c000000000249e48] .pci_device_remove+0x50/0x90
  [c000000012d439e0] [c0000000002d68d8] .__device_release_driver+0x94/0xd4
  [c000000012d43a70] [c0000000002d7104] .driver_detach+0xf8/0x12c
  [c000000012d43b00] [c0000000002d549c] .bus_remove_driver+0xbc/0x11c
  [c000000012d43b90] [c0000000002d71dc] .driver_unregister+0x60/0x80
  [c000000012d43c20] [c00000000024a07c] .pci_unregister_driver+0x44/0xe8
  [c000000012d43cb0] [d000000002d56bf4] .icom_exit+0x1c/0x40 [icom]
  [c000000012d43d30] [c000000000095fa8] .SyS_delete_module+0x214/0x2a8
  [c000000012d43e30] [c00000000000852c] syscall_exit+0x0/0x40

Signed-off-by: Breno Leitao &lt;leitao@linux.vnet.ibm.com&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.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>
commit 95caa0a9bdaf93607bd0cc8932f53112496f2f22 upstream.

Actually the icom driver is crashing when is being removed because
the driver is kfreeing the adapter structure before calling
pci_release_regions(), which result in the following error:

  Unable to handle kernel paging request for data at address 0x6b6b6b6b6b6b6d33
  Faulting instruction address: 0xc000000000246b80
  Oops: Kernel access of bad area, sig: 11 [#1]
  ....
  [c000000012d436a0] [c0000000001002d0] .kfree+0x120/0x34c (unreliable)
  [c000000012d43730] [c000000000246d60] .pci_release_selected_regions+0x3c/0x68
  [c000000012d437c0] [d000000002d54700] .icom_kref_release+0xf4/0x118 [icom]
  [c000000012d43850] [c000000000232e50] .kref_put+0x74/0x94
  [c000000012d438d0] [d000000002d56c58] .icom_remove+0x40/0xa4 [icom]
  [c000000012d43960] [c000000000249e48] .pci_device_remove+0x50/0x90
  [c000000012d439e0] [c0000000002d68d8] .__device_release_driver+0x94/0xd4
  [c000000012d43a70] [c0000000002d7104] .driver_detach+0xf8/0x12c
  [c000000012d43b00] [c0000000002d549c] .bus_remove_driver+0xbc/0x11c
  [c000000012d43b90] [c0000000002d71dc] .driver_unregister+0x60/0x80
  [c000000012d43c20] [c00000000024a07c] .pci_unregister_driver+0x44/0xe8
  [c000000012d43cb0] [d000000002d56bf4] .icom_exit+0x1c/0x40 [icom]
  [c000000012d43d30] [c000000000095fa8] .SyS_delete_module+0x214/0x2a8
  [c000000012d43e30] [c00000000000852c] syscall_exit+0x0/0x40

Signed-off-by: Breno Leitao &lt;leitao@linux.vnet.ibm.com&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>powerpc/5200: Don't specify IRQF_SHARED in PSC UART driver</title>
<updated>2009-05-18T23:35:26+00:00</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@secretlab.ca</email>
</author>
<published>2009-02-04T18:23:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=99d78985c194fe8816d9176be3e3be81f3af2df8'/>
<id>99d78985c194fe8816d9176be3e3be81f3af2df8</id>
<content type='text'>
commit d9f0c5f9bc74f16d0ea0f6c518b209e48783a796 upstream.

The MPC5200 PSC device is wired up to a dedicated interrupt line
which is never shared.  This patch removes the IRQF_SHARED flag
from the request_irq() call which eliminates the "IRQF_DISABLED
is not guaranteed on shared IRQs" warning message from the console
output.

Signed-off-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Reviewed-by: Wolfram Sang &lt;w.sang@pengutronix.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 d9f0c5f9bc74f16d0ea0f6c518b209e48783a796 upstream.

The MPC5200 PSC device is wired up to a dedicated interrupt line
which is never shared.  This patch removes the IRQF_SHARED flag
from the request_irq() call which eliminates the "IRQF_DISABLED
is not guaranteed on shared IRQs" warning message from the console
output.

Signed-off-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Reviewed-by: Wolfram Sang &lt;w.sang@pengutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'sh/for-2.6.29' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6</title>
<updated>2009-02-28T00:40:00+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-02-28T00:40:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6febf65b2965858507e4d55afad20b24b2ad9a91'/>
<id>6febf65b2965858507e4d55afad20b24b2ad9a91</id>
<content type='text'>
* 'sh/for-2.6.29' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: ap325rxa: Revert ov772x support.
  serial: sh-sci: fix overrun error handling for SH7785 SCIF.
  sh: Storage class should be before const qualifier
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'sh/for-2.6.29' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: ap325rxa: Revert ov772x support.
  serial: sh-sci: fix overrun error handling for SH7785 SCIF.
  sh: Storage class should be before const qualifier
</pre>
</div>
</content>
</entry>
<entry>
<title>8250: fix boot hang with serial console when using with Serial Over Lan port</title>
<updated>2009-02-21T01:57:50+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@redhat.com</email>
</author>
<published>2009-02-20T23:38:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b6adea334c6c89d5e6c94f9196bbf3a279cb53bd'/>
<id>b6adea334c6c89d5e6c94f9196bbf3a279cb53bd</id>
<content type='text'>
Intel 8257x Ethernet boards have a feature called Serial Over Lan.

This feature works by emulating a serial port, and it is detected by
kernel as a normal 8250 port.  However, this emulation is not perfect, as
also noticed on changeset 7500b1f602aad75901774a67a687ee985d85893f.

Before this patch, the kernel were trying to check if the serial TX is
capable of work using IRQ's.

This were done with a code similar this:

        serial_outp(up, UART_IER, UART_IER_THRI);
        lsr = serial_in(up, UART_LSR);
        iir = serial_in(up, UART_IIR);
        serial_outp(up, UART_IER, 0);

        if (lsr &amp; UART_LSR_TEMT &amp;&amp; iir &amp; UART_IIR_NO_INT)
		up-&gt;bugs |= UART_BUG_TXEN;

This works fine for other 8250 ports, but, on 8250-emulated SoL port, the
chip is a little lazy to down UART_IIR_NO_INT at UART_IIR register.

Due to that, UART_BUG_TXEN is sometimes enabled.  However, as TX IRQ keeps
working, and the TX polling is now enabled, the driver miss-interprets the
IRQ received later, hanging up the machine until a key is pressed at the
serial console.

This is the 6 version of this patch.  Previous versions were trying to
introduce a large enough delay between serial_outp and serial_in(up,
UART_IIR), but not taking forever.  However, the needed delay couldn't be
safely determined.

At the experimental tests, a delay of 1us solves most of the cases, but
still hangs sometimes.  Increasing the delay to 5us was better, but still
doesn't solve.  A very high delay of 50 ms seemed to work every time.

However, poking around with delays and pray for it to be enough doesn't
seem to be a good approach, even for a quirk.

So, instead of playing with random large arbitrary delays, let's just
disable UART_BUG_TXEN for all SoL ports.

[akpm@linux-foundation.org: fix warnings]
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Cc: &lt;stable@kernel.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>
Intel 8257x Ethernet boards have a feature called Serial Over Lan.

This feature works by emulating a serial port, and it is detected by
kernel as a normal 8250 port.  However, this emulation is not perfect, as
also noticed on changeset 7500b1f602aad75901774a67a687ee985d85893f.

Before this patch, the kernel were trying to check if the serial TX is
capable of work using IRQ's.

This were done with a code similar this:

        serial_outp(up, UART_IER, UART_IER_THRI);
        lsr = serial_in(up, UART_LSR);
        iir = serial_in(up, UART_IIR);
        serial_outp(up, UART_IER, 0);

        if (lsr &amp; UART_LSR_TEMT &amp;&amp; iir &amp; UART_IIR_NO_INT)
		up-&gt;bugs |= UART_BUG_TXEN;

This works fine for other 8250 ports, but, on 8250-emulated SoL port, the
chip is a little lazy to down UART_IIR_NO_INT at UART_IIR register.

Due to that, UART_BUG_TXEN is sometimes enabled.  However, as TX IRQ keeps
working, and the TX polling is now enabled, the driver miss-interprets the
IRQ received later, hanging up the machine until a key is pressed at the
serial console.

This is the 6 version of this patch.  Previous versions were trying to
introduce a large enough delay between serial_outp and serial_in(up,
UART_IIR), but not taking forever.  However, the needed delay couldn't be
safely determined.

At the experimental tests, a delay of 1us solves most of the cases, but
still hangs sometimes.  Increasing the delay to 5us was better, but still
doesn't solve.  A very high delay of 50 ms seemed to work every time.

However, poking around with delays and pray for it to be enough doesn't
seem to be a good approach, even for a quirk.

So, instead of playing with random large arbitrary delays, let's just
disable UART_BUG_TXEN for all SoL ports.

[akpm@linux-foundation.org: fix warnings]
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Cc: &lt;stable@kernel.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>jsm: additional device support</title>
<updated>2009-02-18T23:37:55+00:00</updated>
<author>
<name>Adam Lackorzynski</name>
<email>adam@os.inf.tu-dresden.de</email>
</author>
<published>2009-02-18T22:48:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ffa7525c13eb3db0fd19a3e1cffe2ce6f561f5f3'/>
<id>ffa7525c13eb3db0fd19a3e1cffe2ce6f561f5f3</id>
<content type='text'>
I have a Digi Neo 8 PCI card (114f:00b1) Serial controller: Digi
International Digi Neo 8 (rev 05)

that works with the jsm driver after using the following patch.

Signed-off-by: Adam Lackorzynski &lt;adam@os.inf.tu-dresden.de&gt;
Cc: Scott H Kilau &lt;Scott_Kilau@digi.com&gt;
Cc: Wendy Xiong &lt;wendyx@us.ibm.com&gt;
Acked-by: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&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>
I have a Digi Neo 8 PCI card (114f:00b1) Serial controller: Digi
International Digi Neo 8 (rev 05)

that works with the jsm driver after using the following patch.

Signed-off-by: Adam Lackorzynski &lt;adam@os.inf.tu-dresden.de&gt;
Cc: Scott H Kilau &lt;Scott_Kilau@digi.com&gt;
Cc: Wendy Xiong &lt;wendyx@us.ibm.com&gt;
Acked-by: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&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>atmel_serial might lose modem status change</title>
<updated>2009-02-18T23:37:55+00:00</updated>
<author>
<name>Atsushi Nemoto</name>
<email>anemo@mba.ocn.ne.jp</email>
</author>
<published>2009-02-18T22:48:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=27c0c8e511fa9e2389503926840fac606d90a049'/>
<id>27c0c8e511fa9e2389503926840fac606d90a049</id>
<content type='text'>
I found a problem of handling of modem status of atmel_serial driver.

With the commit 1ecc26 ("atmel_serial: split the interrupt handler"),
handling of modem status signal was splitted into two parts.  The
atmel_tasklet_func() compares new status with irq_status_prev, but
irq_status_prev is not correct if signal status was changed while the port
is closed.

Here is a sequence to cause problem:

1. Remote side sets CTS (and DSR).
2. Local side close the port.
3. Local side clears RTS and DTR.
4. Remote side clears CTS and DSR.
5. Local side reopen the port.  hw_stopped becomes 1.
6. Local side sets RTS and DTR.
7. Remote side sets CTS and DSR.

Then CTS change interrupt can be received, but since CTS bit in
irq_status_prev and new status is same, uart_handle_cts_change() will not
be called (so hw_stopped will not be cleared, i.e.  cannot send any data).

I suppose irq_status_prev should be initialized at somewhere in open
sequence.

Itai Levi pointed out that we need to initialize atmel_port-&gt;irq_status
as well here. His analysis is as follows:

&gt; Regarding the second part of the patch (which resets irq_status_prev),
&gt; it turns out that both versions of the patch (mine and Atsushi's)
&gt; still leave enough room for faulty behavior when opening the port.
&gt;
&gt; This is because we are not resetting both irq_status_prev and
&gt; irq_status in atmel_startup() to CSR, which leads faulty behavior in
&gt; the following sequences:
&gt;
&gt; First case:
&gt; 1. closing the port while CTS line = 1 (TX not allowed)
&gt; 2. setting CTS line = 0 (TX allowed)
&gt; 3. opening the port
&gt; 4. transmitting one char
&gt; 5. Cannot transmit more chars, although CTS line is 0
&gt;
&gt; Second case:
&gt; 1. closing the port while CTS line = 0 (TX allowed)
&gt; 2. setting CTS line = 1 (TX not allowed)
&gt; 3. opening the port
&gt; 4. receiving some chars
&gt; 5. Now we can transmit, although CTS line is 1
&gt;
&gt; This reason for this is that the tasklet is scheduled as a result of
&gt; TX or RX interrupts (not a status change!), in steps 4 above. Inside
&gt; the tasklet, the atmel_port-&gt;irq_status (which holds the value from
&gt; the previous session) is compared to atmel_port-&gt;irq_status_prev.
&gt; Hence, a status-change of the CTS line is faultily detected.
&gt;
&gt; Both cases were verified on 9260 hardware.

[haavard.skinnemoen@atmel.com: folded with patch from Itai Levi]
Signed-off-by: Atsushi Nemoto &lt;anemo@mba.ocn.ne.jp&gt;
Signed-off-by: Haavard Skinnemoen &lt;haavard.skinnemoen@atmel.com&gt;
Cc: Remy Bohmer &lt;linux@bohmer.net&gt;
Cc: Marc Pignat &lt;marc.pignat@hevs.ch&gt;
Cc: Itai Levi &lt;itai.levi.devel@gmail.com&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&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>
I found a problem of handling of modem status of atmel_serial driver.

With the commit 1ecc26 ("atmel_serial: split the interrupt handler"),
handling of modem status signal was splitted into two parts.  The
atmel_tasklet_func() compares new status with irq_status_prev, but
irq_status_prev is not correct if signal status was changed while the port
is closed.

Here is a sequence to cause problem:

1. Remote side sets CTS (and DSR).
2. Local side close the port.
3. Local side clears RTS and DTR.
4. Remote side clears CTS and DSR.
5. Local side reopen the port.  hw_stopped becomes 1.
6. Local side sets RTS and DTR.
7. Remote side sets CTS and DSR.

Then CTS change interrupt can be received, but since CTS bit in
irq_status_prev and new status is same, uart_handle_cts_change() will not
be called (so hw_stopped will not be cleared, i.e.  cannot send any data).

I suppose irq_status_prev should be initialized at somewhere in open
sequence.

Itai Levi pointed out that we need to initialize atmel_port-&gt;irq_status
as well here. His analysis is as follows:

&gt; Regarding the second part of the patch (which resets irq_status_prev),
&gt; it turns out that both versions of the patch (mine and Atsushi's)
&gt; still leave enough room for faulty behavior when opening the port.
&gt;
&gt; This is because we are not resetting both irq_status_prev and
&gt; irq_status in atmel_startup() to CSR, which leads faulty behavior in
&gt; the following sequences:
&gt;
&gt; First case:
&gt; 1. closing the port while CTS line = 1 (TX not allowed)
&gt; 2. setting CTS line = 0 (TX allowed)
&gt; 3. opening the port
&gt; 4. transmitting one char
&gt; 5. Cannot transmit more chars, although CTS line is 0
&gt;
&gt; Second case:
&gt; 1. closing the port while CTS line = 0 (TX allowed)
&gt; 2. setting CTS line = 1 (TX not allowed)
&gt; 3. opening the port
&gt; 4. receiving some chars
&gt; 5. Now we can transmit, although CTS line is 1
&gt;
&gt; This reason for this is that the tasklet is scheduled as a result of
&gt; TX or RX interrupts (not a status change!), in steps 4 above. Inside
&gt; the tasklet, the atmel_port-&gt;irq_status (which holds the value from
&gt; the previous session) is compared to atmel_port-&gt;irq_status_prev.
&gt; Hence, a status-change of the CTS line is faultily detected.
&gt;
&gt; Both cases were verified on 9260 hardware.

[haavard.skinnemoen@atmel.com: folded with patch from Itai Levi]
Signed-off-by: Atsushi Nemoto &lt;anemo@mba.ocn.ne.jp&gt;
Signed-off-by: Haavard Skinnemoen &lt;haavard.skinnemoen@atmel.com&gt;
Cc: Remy Bohmer &lt;linux@bohmer.net&gt;
Cc: Marc Pignat &lt;marc.pignat@hevs.ch&gt;
Cc: Itai Levi &lt;itai.levi.devel@gmail.com&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&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>serial: sh-sci: fix overrun error handling for SH7785 SCIF.</title>
<updated>2009-02-12T08:27:12+00:00</updated>
<author>
<name>Kuninori Morimoto</name>
<email>morimoto.kuninori@renesas.com</email>
</author>
<published>2009-02-10T09:04:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=34aeb43e2d3800f4d8f96feb9f1b49cd506679d5'/>
<id>34aeb43e2d3800f4d8f96feb9f1b49cd506679d5</id>
<content type='text'>
There was a typo for the overrun bit definition, causing it not to be
handled correctly on SH7785, fix it up.

Signed-off-by: Kuninori Morimoto &lt;morimoto.kuninori@renesas.com&gt;
Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There was a typo for the overrun bit definition, causing it not to be
handled correctly on SH7785, fix it up.

Signed-off-by: Kuninori Morimoto &lt;morimoto.kuninori@renesas.com&gt;
Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add enable_ms to jsm driver</title>
<updated>2009-01-30T16:40:54+00:00</updated>
<author>
<name>Paul Larson</name>
<email>pl@linux.vnet.ibm.com</email>
</author>
<published>2009-01-30T16:21:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0461ec5bc7745b89a8ab67ba0ea497abd58a6301'/>
<id>0461ec5bc7745b89a8ab67ba0ea497abd58a6301</id>
<content type='text'>
This fixes a crash observed when non-existant enable_ms function is
called for jsm driver.

Signed-off-by: Scott Kilau &lt;Scott.Kilau@digi.com&gt;
Signed-off-by: Paul Larson &lt;pl@linux.vnet.ibm.com&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>
This fixes a crash observed when non-existant enable_ms function is
called for jsm driver.

Signed-off-by: Scott Kilau &lt;Scott.Kilau@digi.com&gt;
Signed-off-by: Paul Larson &lt;pl@linux.vnet.ibm.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
