Skip to contentSkip to conversation

serial: Fix matching of MMIO ports

PATCH In review Benjamin Herrenschmidt 2 participants 3 messages Nov 28, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: Fix matching of MMIO ports

The function uart_match_port() incorrectly compares the ioremap'd virtual addresses of ports instead of the physical address to find duplicate ports for MMIO based UARTs. This fixes it.

drivers/serial/serial_core.c +1 -1
Index: linux-work/drivers/serial/serial_core.c
===================================================================
@@ -2307,7 +2307,7 @@
 		return (port1->iobase == port2->iobase) &&
 		       (port1->hub6   == port2->hub6);
 	case UPIO_MEM:
-		return (port1->membase == port2->membase);
+		return (port1->mapbase == port2->mapbase);
 	}
 	return 0;
 }
#1 lore raw
Quoted 3 lines · Benjamin Herrenschmidt

The function uart_match_port() incorrectly compares the ioremap'd virtual addresses of ports instead of the physical address to find duplicate ports for MMIO based UARTs. This fixes it.

I'd like this to go in -mm for a bit before we put it into mainline, just in case there's any undesirable side effects.

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
#2 lore raw
Quoted 7 lines · Russell King
Quoted 3 lines · Benjamin Herrenschmidt

The function uart_match_port() incorrectly compares the ioremap'd virtual addresses of ports instead of the physical address to find duplicate ports for MMIO based UARTs. This fixes it.

I'd like this to go in -mm for a bit before we put it into mainline, just in case there's any undesirable side effects.

Fine with me.

Ben.