From: Pantelis Antoniou <panto@intracom.gr>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Tom Rini <trini@kernel.crashing.org>,
Kumar Gala <kumar.gala@motorola.com>,
Linuxppc-Embedded <linuxppc-embedded@lists.linuxppc.org>
Subject: Re: [PATCH] Take two of the new serial uart driver.
Date: Mon, 07 Jun 2004 11:11:35 +0300 [thread overview]
Message-ID: <40C42337.20209@intracom.gr> (raw)
In-Reply-To: <1086472929.4862.12.camel@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 852 bytes --]
David Woodhouse wrote:
>On Sat, 2004-06-05 at 12:22 -0700, Tom Rini wrote:
>
>>On Sat, Jun 05, 2004 at 10:12:24AM +0100, David Woodhouse wrote:
>>
>>
>>>On Thu, 2004-06-03 at 17:13 +0300, Pantelis Antoniou wrote:
>>>
>>>>Hi
>>>>
>>>>The following patch updates the new CPM1/CPM2 uart driver.
>>>>
>>>It seems to lose queued characters from the kernel output when userspace
>>>/dev/console is first opened. Should you drain the FIFO before resetting
>>>the hardware on open? Or indeed refrain from resetting the hardware if
>>>you're not actually changing anything?
>>>
>>I haven't seen this problem on 8xx myself.
>>
>
>8265 here.
>
>VFS: Mounted root (nfs filesystem).
>Freeing unused kernel memory: 100k iné
>sh-2.05b#
>
>
Hi there.
The following patch fixes the problem by properly waiting
two character times on mode change.
Regards
Pantelis
[-- Attachment #2: cpm_uart_fix.patch --]
[-- Type: text/x-patch, Size: 1782 bytes --]
===== drivers/serial/cpm_uart/cpm_uart.h 1.2 vs edited =====
--- 1.2/drivers/serial/cpm_uart/cpm_uart.h Fri Jun 4 10:37:06 2004
+++ edited/drivers/serial/cpm_uart/cpm_uart.h Mon Jun 7 11:07:52 2004
@@ -65,6 +65,9 @@
uint dp_addr;
void *mem_addr;
dma_addr_t dma_addr;
+ /* helpers */
+ int baud;
+ int bits;
};
extern int cpm_uart_port_map[UART_NR];
===== drivers/serial/cpm_uart/cpm_uart_core.c 1.1 vs edited =====
--- 1.1/drivers/serial/cpm_uart/cpm_uart_core.c Thu Jun 3 16:42:27 2004
+++ edited/drivers/serial/cpm_uart/cpm_uart_core.c Mon Jun 7 11:07:52 2004
@@ -43,6 +43,7 @@
#include <asm/io.h>
#include <asm/irq.h>
+#include <asm/delay.h>
#include <linux/serial_core.h>
#include <linux/kernel.h>
@@ -242,10 +243,11 @@
pr_debug("CPM uart[%d]:stop tx\n", port->line);
- if (IS_SMC(pinfo))
+ if (IS_SMC(pinfo)) {
smcp->smc_smcm &= ~SMCM_TX;
- else
+ } else {
sccp->scc_sccm &= ~UART_SCCM_TX;
+ }
}
/*
@@ -479,6 +481,10 @@
if ((termios->c_cflag & CREAD) == 0)
port->read_status_mask &= ~BD_SC_EMPTY;
+ /* if previous configuration exists wait 2 character times for tx to finish */
+ if (pinfo->baud != 0 || pinfo->bits != 0)
+ udelay((2 * 1000000 * pinfo->bits) / pinfo->baud);
+
spin_lock_irqsave(&port->lock, flags);
/* Start bit has not been added (so don't, because we would just
@@ -499,6 +505,10 @@
}
cpm_set_brg(pinfo->brg - 1, baud);
+
+ pinfo->baud = baud;
+ pinfo->bits = bits;
+
spin_unlock_irqrestore(&port->lock, flags);
}
next prev parent reply other threads:[~2004-06-07 8:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-03 14:13 [PATCH] Take two of the new serial uart driver Pantelis Antoniou
2004-06-03 16:21 ` David Woodhouse
2004-06-04 6:31 ` Pantelis Antoniou
2004-06-05 9:12 ` David Woodhouse
2004-06-05 19:22 ` Tom Rini
2004-06-05 22:02 ` David Woodhouse
2004-06-06 1:30 ` Tom Rini
2004-06-07 8:11 ` Pantelis Antoniou [this message]
2004-06-07 8:36 ` David Woodhouse
2004-06-07 8:34 ` Pantelis Antoniou
2004-06-07 8:53 ` David Woodhouse
2004-06-07 8:53 ` Pantelis Antoniou
2004-06-07 9:06 ` David Woodhouse
2004-06-07 9:12 ` David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40C42337.20209@intracom.gr \
--to=panto@intracom.gr \
--cc=dwmw2@infradead.org \
--cc=kumar.gala@motorola.com \
--cc=linuxppc-embedded@lists.linuxppc.org \
--cc=trini@kernel.crashing.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).