EG20T: Update PCH_UART driver to 2.6.36
PATCH v3 1/1 EG20T: Update PCH_UART driver to 2.6.36
Hi Alan,
I have modified for your all indications.
Please check below.
Signature · 20 lines
Thanks, Tomoya MORINAGA(OKI SEMICONDUCTOR CO., LTD.) --- UART driver of Intel EG20T(Topcliff) PCH Intel EG20T PCH is the platform controller hub that is going to be used in Intel's general embedded platform. All IO peripherals in Intel EG20T PCH are actually devices sitting on AMBA bus. Intel EG20T PCH has UART I/F. Using this I/F, it is able to access system devices connected to UART. Signed-off-by: Tomoya MORINAGA <[email protected]> --- drivers/serial/Kconfig | 8 + drivers/serial/Makefile | 1 + drivers/serial/pch_uart.c | 1467 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1476 insertions(+), 0 deletions(-) create mode 100644 drivers/serial/pch_uart.c
drivers/serial/Kconfig +8 -0
@@ -1611,4 +1611,12 @@ config SERIAL_ALTERA_UART_CONSOLE help Enable a Altera UART port to be the system console. +config SERIAL_PCH_UART + tristate "Intel EG20T PCH UART" + select SERIAL_CORE + depends on PCI + help + This driver is for PCH(Platform controller Hub) UART of Intel EG20T + which is an IOH(Input/Output Hub) for x86 embedded processor. + Enabling PCH_DMA, this PCH UART works as DMA mode. endmenu
drivers/serial/Makefile +1 -0
@@ -88,3 +88,4 @@ obj-$(CONFIG_SERIAL_ALTERA_JTAGUART) += altera_jtaguart.o obj-$(CONFIG_SERIAL_ALTERA_UART) += altera_uart.o obj-$(CONFIG_SERIAL_MRST_MAX3110) += mrst_max3110.o obj-$(CONFIG_SERIAL_MFD_HSU) += mfd.o +obj-$(CONFIG_SERIAL_PCH_UART) += pch_uart.o
drivers/serial/pch_uart.c new file +1467 -0
1,467 lines not on this page · raw message
Signature · 1 line
1.6.0.6
drivers/serial/pch_uart.c line 1158
Quoted 5 lines · Tomoya MORINAGA
drivers/serial/pch_uart.c new file +5
-0+spin_lock_irqsave (&port->lock, flags); + +uart_update_timeout (port, termios->c_cflag, baud); + rtn =pch_uart_hal_set_line (priv, baud, parity, bits, stb); +if (rtn)
You need a spin_unlock_irqrestore(&port->lock, flags); here.
drivers/serial/pch_uart.c line 1166
Quoted 8 lines
drivers/serial/pch_uart.c new file +8
-0+return ; + +/* Don't rewrite B0 */ +if (tty_termios_baud_rate (termios)) +tty_termios_encode_baud_rate (termios, baud, baud); + +spin_unlock_irqrestore (&port->lock, flags); +}
regards,
dan carpenter
Quoted 5 lines · On Mon, 15 Nov 2010 21:26:03 +0900 Tomoya MORINAGA…
Hi Alan,
I have modified for your all indications.
Please check below.
+static int push_rx(struct eg20t_port *priv, const unsigned char *buf,
+ int size)
+{
+ struct uart_port *port;
+ struct tty_struct *tty;
+ int sz, i, j;
+ int loop;
+ int pushed;
+
+ port = &priv->port;
+ tty = tty_port_tty_get(&port->state->port);
+ if (!tty) {
+ pr_debug("%s:tty is busy now", __func__);
+ return -EBUSY;
+ }
+
+ for (pushed = 0, i = 0, loop = 1; (pushed < size) && loop;
+ pushed += sz, i++) {
+ sz = tty_insert_flip_string(tty, &buf[pushed], size - pushed);
+ for (j = 0; (j < 100000) && (sz == 0); j++) {
+ tty_flip_buffer_push(tty);
+ sz = tty_insert_flip_string(tty, &buf[pushed],
+ size - pushed);
+ }
+ }
tty_insert_flip_string will deal with retries itself for the cases you have here. So you shouldn't need the loop
+static int dma_push_rx(struct eg20t_port *priv, int size) +{
+ struct tty_struct *tty;
+ int room;
+ struct uart_port *port = &priv->port;
+
+ port = &priv->port;
+ tty = tty_port_tty_get(&port->state->port);
+ if (!tty) {
+ pr_info("%s:tty is busy now", __func__);
As I said last time- this isn't an error or unusual so it shouldn't be logged
+static void pch_dma_rx_complete(void *arg)
+{
+ struct eg20t_port *priv = arg;
+ struct uart_port *port = &priv->port;
+ struct tty_struct *tty = tty_port_tty_get(&port->state->port);
+ if (!tty) {
+ pr_info("%s:tty is busy now", __func__);
Same comment
Otherwise looks great.
Alan