Messages in this thread | | | Date | Tue, 16 Nov 2010 13:34:00 +0000 | From | Alan Cox <> | Subject | Re: [PATCH v3] EG20T: Update PCH_UART driver to 2.6.36 |
| |
On Mon, 15 Nov 2010 21:26:03 +0900 Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> wrote:
> 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
| |