Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: sh-sci: Fix for port types without BRI interrupts.

In doing the evt2irq() + muxed vector conversion for various port types
it became apparent that some of the legacy port types will presently
error out due to the irq requesting logic attempting to acquire the
non-existent BRI IRQ. This adds some sanity checks to the request/free
path to ensure that non-existence of a source in itself is not an error.

This should restore functionality for legacy PORT_SCI ports.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+18 -1
+18 -1
drivers/tty/serial/sh-sci.c
··· 1052 1052 if (SCIx_IRQ_IS_MUXED(port)) { 1053 1053 i = SCIx_MUX_IRQ; 1054 1054 irq = up->irq; 1055 - } else 1055 + } else { 1056 1056 irq = port->cfg->irqs[i]; 1057 + 1058 + /* 1059 + * Certain port types won't support all of the 1060 + * available interrupt sources. 1061 + */ 1062 + if (unlikely(!irq)) 1063 + continue; 1064 + } 1057 1065 1058 1066 desc = sci_irq_desc + i; 1059 1067 port->irqstr[j] = kasprintf(GFP_KERNEL, "%s:%s", ··· 1102 1094 * IRQ first. 1103 1095 */ 1104 1096 for (i = 0; i < SCIx_NR_IRQS; i++) { 1097 + unsigned int irq = port->cfg->irqs[i]; 1098 + 1099 + /* 1100 + * Certain port types won't support all of the available 1101 + * interrupt sources. 1102 + */ 1103 + if (unlikely(!irq)) 1104 + continue; 1105 + 1105 1106 free_irq(port->cfg->irqs[i], port); 1106 1107 kfree(port->irqstr[i]); 1107 1108