Re: [PATCH v2 2/3] serial: sh-sci: Add support for separate TEI+DRI interrupts

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

 



Hi Chris,

On Wed, Jul 25, 2018 at 4:39 PM Chris Brandt <chris.brandt@xxxxxxxxxxx> wrote:
> Some SCIF versions mux error and break interrupts together and then provide
> a separate interrupt ID for just TEI/DRI.
>
> Allow all 6 types of interrupts to be specified via platform data (or DT)
> and for any signals that are muxed together (have the same interrupt
> number) simply register one handler.
>
> Signed-off-by: Chris Brandt <chris.brandt@xxxxxxxxxxx>
> ---
> v2:
>  * Move compressed SCIF reg address space to a separate commit
>  * Handle all 6 possible interrupt types

Thanks for your patch!

> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c

> @@ -1683,11 +1685,26 @@ static irqreturn_t sci_tx_interrupt(int irq, void *ptr)
>         return IRQ_HANDLED;
>  }
>
> +static irqreturn_t sci_br_interrupt(int irq, void *ptr);

You can avoid the forward declaration by moving the whole function here.

> +
>  static irqreturn_t sci_er_interrupt(int irq, void *ptr)
>  {
>         struct uart_port *port = ptr;
>         struct sci_port *s = to_sci_port(port);
>
> +       if (s->irqs[SCIx_ERI_IRQ] == s->irqs[SCIx_BRI_IRQ]) {
> +               /* Break and Error interrupts are muxed */
> +               unsigned short ssr_status = serial_port_in(port, SCxSR);
> +
> +               /* Break Interrupt */
> +               if (ssr_status & SCxSR_BRK(port))
> +                       sci_br_interrupt(irq, ptr);
> +
> +               /* Break only? */
> +               if (!(ssr_status & SCxSR_ERRORS(port)))
> +                       return IRQ_HANDLED;
> +       }
> +
>         /* Handle errors */
>         if (port->type == PORT_SCI) {
>                 if (sci_handle_errors(port)) {

> @@ -2809,6 +2845,8 @@ static int sci_init_single(struct platform_device *dev,
>                 sci_port->irqs[1] = sci_port->irqs[0];
>                 sci_port->irqs[2] = sci_port->irqs[0];
>                 sci_port->irqs[3] = sci_port->irqs[0];
> +               sci_port->irqs[4] = sci_port->irqs[0];
> +               sci_port->irqs[5] = sci_port->irqs[0];

You may want to start using a loop from 1 to ARRAY_SIZE(sci_port->irqs) - 1
instead.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux