Skip to content

Commit b43a186

Browse files
bijudasgregkh
authored andcommitted
tty: serial: sh-sci: Fix transmit end interrupt handler
The fourth interrupt on SCI port is transmit end interrupt compared to the break interrupt on other port types. So, shuffle the interrupts to fix the transmit end interrupt handler. Fixes: e1d0be6 ("sh-sci: Add h8300 SCI") Cc: stable <stable@kernel.org> Suggested-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://lore.kernel.org/r/20230317150403.154094-1-biju.das.jz@bp.renesas.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e8d018d commit b43a186

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/tty/serial/sh-sci.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <linux/ioport.h>
3232
#include <linux/ktime.h>
3333
#include <linux/major.h>
34+
#include <linux/minmax.h>
3435
#include <linux/module.h>
3536
#include <linux/mm.h>
3637
#include <linux/of.h>
@@ -2864,6 +2865,13 @@ static int sci_init_single(struct platform_device *dev,
28642865
sci_port->irqs[i] = platform_get_irq(dev, i);
28652866
}
28662867

2868+
/*
2869+
* The fourth interrupt on SCI port is transmit end interrupt, so
2870+
* shuffle the interrupts.
2871+
*/
2872+
if (p->type == PORT_SCI)
2873+
swap(sci_port->irqs[SCIx_BRI_IRQ], sci_port->irqs[SCIx_TEI_IRQ]);
2874+
28672875
/* The SCI generates several interrupts. They can be muxed together or
28682876
* connected to different interrupt lines. In the muxed case only one
28692877
* interrupt resource is specified as there is only one interrupt ID.

0 commit comments

Comments
 (0)