+ zsc-drain-the-transmission-line.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     zs.c: drain the transmission line
has been added to the -mm tree.  Its filename is
     zsc-drain-the-transmission-line.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: zs.c: drain the transmission line
From: "Maciej W. Rozycki" <macro@xxxxxxxxxxxxxx>

This is an update to the zs.c driver to make it wait for the transmission
line to become idle before disabling the transmitter or resetting the chip.
 This way the character that is on the way at the time one of these actions
is about to be performed does not get corrupted.

Plus a change to reset the index/data pointer first before issuing a chip
reset just in case the state is wrong when control of the chip is taken the
first time.

Signed-off-by: Maciej W. Rozycki <macro@xxxxxxxxxxxxxx>
Cc: Ralf Baechle <ralf@xxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/serial/zs.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletion(-)

diff -puN drivers/serial/zs.c~zsc-drain-the-transmission-line drivers/serial/zs.c
--- a/drivers/serial/zs.c~zsc-drain-the-transmission-line
+++ a/drivers/serial/zs.c
@@ -240,10 +240,24 @@ static int zs_transmit_drain(struct zs_p
 	return loops;
 }
 
+static int zs_line_drain(struct zs_port *zport, int irq)
+{
+	struct zs_scc *scc = zport->scc;
+	int loops = 10000;
+
+	while (!(read_zsreg(zport, R1) & ALL_SNT) && loops--) {
+		zs_spin_unlock_cond_irq(&scc->zlock, irq);
+		udelay(2);
+		zs_spin_lock_cond_irq(&scc->zlock, irq);
+	}
+	return loops;
+}
+
 
 static void load_zsregs(struct zs_port *zport, u8 *regs, int irq)
 {
-	zs_transmit_drain(zport, irq);
+	/* Let the current transmission finish.  */
+	zs_line_drain(zport, irq);
 	/* Load 'em up.  */
 	write_zsreg(zport, R3, regs[3] & ~RxENABLE);
 	write_zsreg(zport, R5, regs[5] & ~TxENAB);
@@ -814,6 +828,10 @@ static void zs_reset(struct zs_port *zpo
 	spin_lock_irqsave(&scc->zlock, flags);
 	irq = !irqs_disabled_flags(flags);
 	if (!scc->initialised) {
+		/* Reset the pointer first, just in case...  */
+		read_zsreg(zport, R0);
+		/* And let the current transmission finish.  */
+		zs_line_drain(zport, irq);
 		write_zsreg(zport, R9, FHWRES);
 		udelay(10);
 		write_zsreg(zport, R9, 0);
_

Patches currently in -mm which might be from macro@xxxxxxxxxxxxxx are

zs-move-to-the-serial-subsystem.patch
zs-move-to-the-serial-subsystem-update.patch
zsc-drain-the-transmission-line.patch
tgafb-actually-allocate-memory-for-the-pseudo_palette.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux