Skip to contentSkip to conversation

fallback to "no irq" hack for case of no pnp_irq allocated for 8250_pnp

RFC PATCH In review Luming Yu 3 participants 3 messages Oct 17, 2007

lore
Share & tools
lore

Luming Yu

author
#0 lore raw

RFC PATCH 1/1 fallback to "no irq" hack for case of no pnp_irq allocated for 8250_pnp

Hello list,

There is a "ttyS1 irq is -1" problem observed on tiger4 which cause the serial port broken.
It is because that there is __no__ ACPI IRQ resource assigned for the serial port. So the value of the IRQ for the port is never changed since it got initialized to -1. The attached patch falls back to the "no irq" hack for this case. It works for me. Please review and test.

Thanks,
Luming

 8250_pnp.c |    3 +++
 1 files changed, 3 insertions(+)
drivers/serial/8250_pnp.c renamed from drivers/serial/8250_pnp.c.orig +3 -0
@@ -431,6 +431,9 @@
 
 	memset(&port, 0, sizeof(struct uart_port));
 	port.irq = pnp_irq(dev, 0);
+	/* No irq is assigned for the port, fallback to "no irq" hack */
+	if (port.irq == -1)
+		port.irq = 0; 
 	if (pnp_port_valid(dev, 0)) {
 		port.iobase = pnp_port_start(dev, 0);
 		port.iotype = UPIO_PORT;
#1 lore raw
Quoted 6 lines · Luming Yu

There is a "ttyS1 irq is -1" problem observed on tiger4 which cause the serial port broken.
It is because that there is __no__ ACPI IRQ resource assigned for the serial port. So the value of the IRQ for the port is never changed since it got initialized to -1. The attached patch falls back to the "no irq" hack for this case. It works for me. Please review and test.

Seems reasonable to me. Although arguably pnp_irq is broken, since Linus has decreed that 0 means no irq on Linux.

Signature · 4 lines
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."