diff mbox

[PATCH/RFC] serial: sh-sci: Remove schedule_work in sci_dma_rx_complete

Message ID 1430327256-8545-1-git-send-email-ykaneko0929@gmail.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Yoshihiro Kaneko April 29, 2015, 5:07 p.m. UTC
From: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>

This patch calls work_fn_rx() directly so that the driver can avoid
executing of next sci_dma_rx_complete() before work_fn_rx() completes.

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---

This patch is based on the tty-next branch of Greg Kroah-Hartman's tty
tree.

 drivers/tty/serial/sh-sci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Geert Uytterhoeven April 29, 2015, 6:21 p.m. UTC | #1
Hi Kaneko-san, Mizuguchi-san,

On Wed, Apr 29, 2015 at 7:07 PM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
> diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
> index e7d6566..664ae78 100644
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -126,6 +126,9 @@ struct sci_port {
>  static void sci_start_tx(struct uart_port *port);
>  static void sci_stop_tx(struct uart_port *port);
>  static void sci_start_rx(struct uart_port *port);
> +#ifdef CONFIG_SERIAL_SH_SCI_DMA
> +static void work_fn_rx(struct work_struct *work);
> +#endif

While it would generate a larger patch, I think it's worthwhile moving
work_fn_rx() up, so you don't need the #ifdef and the forward declaration.

>  #define SCI_NPORTS CONFIG_SERIAL_SH_SCI_NR_UARTS
>
> @@ -1341,7 +1344,7 @@ static void sci_dma_rx_complete(void *arg)
>         if (count)
>                 tty_flip_buffer_push(&port->state->port);
>
> -       schedule_work(&s->work_rx);
> +       work_fn_rx(&s->work_rx);
>  }
>
>  static void sci_rx_dma_release(struct sci_port *s, bool enable_pio)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yoshihiro Kaneko May 17, 2015, 3:15 p.m. UTC | #2
Hi Geert-san,

2015-04-30 3:21 GMT+09:00 Geert Uytterhoeven <geert@linux-m68k.org>:
> Hi Kaneko-san, Mizuguchi-san,
>
> On Wed, Apr 29, 2015 at 7:07 PM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
>> diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
>> index e7d6566..664ae78 100644
>> --- a/drivers/tty/serial/sh-sci.c
>> +++ b/drivers/tty/serial/sh-sci.c
>> @@ -126,6 +126,9 @@ struct sci_port {
>>  static void sci_start_tx(struct uart_port *port);
>>  static void sci_stop_tx(struct uart_port *port);
>>  static void sci_start_rx(struct uart_port *port);
>> +#ifdef CONFIG_SERIAL_SH_SCI_DMA
>> +static void work_fn_rx(struct work_struct *work);
>> +#endif
>
> While it would generate a larger patch, I think it's worthwhile moving
> work_fn_rx() up, so you don't need the #ifdef and the forward declaration.

Thanks for your review.
I'll send patch v2.

Regards,
Kaneko

>
>>  #define SCI_NPORTS CONFIG_SERIAL_SH_SCI_NR_UARTS
>>
>> @@ -1341,7 +1344,7 @@ static void sci_dma_rx_complete(void *arg)
>>         if (count)
>>                 tty_flip_buffer_push(&port->state->port);
>>
>> -       schedule_work(&s->work_rx);
>> +       work_fn_rx(&s->work_rx);
>>  }
>>
>>  static void sci_rx_dma_release(struct sci_port *s, bool enable_pio)
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index e7d6566..664ae78 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -126,6 +126,9 @@  struct sci_port {
 static void sci_start_tx(struct uart_port *port);
 static void sci_stop_tx(struct uart_port *port);
 static void sci_start_rx(struct uart_port *port);
+#ifdef CONFIG_SERIAL_SH_SCI_DMA
+static void work_fn_rx(struct work_struct *work);
+#endif
 
 #define SCI_NPORTS CONFIG_SERIAL_SH_SCI_NR_UARTS
 
@@ -1341,7 +1344,7 @@  static void sci_dma_rx_complete(void *arg)
 	if (count)
 		tty_flip_buffer_push(&port->state->port);
 
-	schedule_work(&s->work_rx);
+	work_fn_rx(&s->work_rx);
 }
 
 static void sci_rx_dma_release(struct sci_port *s, bool enable_pio)