Thread (20 messages) 20 messages, 5 authors, 2018-07-31

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

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2018-07-26 11:39:08
Also in: linux-renesas-soc

Hi Chris,

On Wed, Jul 25, 2018 at 4:39 PM Chris Brandt [off-list ref] 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@renesas.com>
---
v2:
 * Move compressed SCIF reg address space to a separate commit
 * Handle all 6 possible interrupt types
Thanks for your patch!
quoted hunk ↗ jump to hunk
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
quoted hunk ↗ jump to hunk
@@ -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)) {
quoted hunk ↗ jump to hunk
@@ -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@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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help