Skip to contentSkip to conversation

serial: compare mapbase and not membase in find_port

PATCH In review Gyorgy Jeney 2 participants 2 messages Jan 1, 2006 – Jan 4, 2006 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: compare mapbase and not membase in find_port

From: Gyorgy Jeney

If the 8250_early driver uses bt_ioremap, find_port() is unable to find the correct device since the address returned by ioremap is different to that returned by bt_ioremap for the same address. Since no more than one device occupies the same physical address, compareing the physical addresses should be safe.

nog.

../linux-2.6.14/drivers/serial/8250.c renamed from serial/8250.c +1 -1
@@ -2229,7 +2229,7 @@ static int __init find_port(struct uart_
 		port = &serial8250_ports[line].port;
 		if (p->iotype == port->iotype &&
 		    p->iobase == port->iobase &&
-		    p->membase == port->membase)
+		    p->mapbase == port->mapbase)
 			return line;
 	}
 	return -ENODEV;
#1 lore raw
Quoted 7 lines · Gyorgy Jeney

From: Gyorgy Jeney

If the 8250_early driver uses bt_ioremap, find_port() is unable to find the correct device since the address returned by ioremap is different to that returned by bt_ioremap for the same address. Since no more than one device occupies the same physical address, compareing the physical addresses should be safe.

Really, this should be using uart_match_port(). Fixed to use that.

(And in combination with Ben's patch from November time, it works out to do the right thing.)

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core