[PATCH] set membase in serial8250_request_port

From: Alex Williamson
Date: Mon Oct 04 2004 - 13:57:43 EST



I'm running into a problem that seems to be caused by this really old
changeset:

http://linux.bkbits.net:8080/linux-2.5/cset@3d9f67f2BWvXiLsZCFwD-8s_E9AN6A

When I run 'setserial /dev/ttyS1 uart 16450' on an ia64 system w/ MMIO
UARTs, I get a NAT consumption oops from the kernel. The problem is
that this code path calls serial8250_release_port() where the membase
gets cleared. However, the subsequent call to serial8250_request_port()
doesn't restore membase, causing a read from a bad address. I don't see
many users of the UPF_IOREMAP flag, so I think the solution is to simply
make the remap case symmetric to the unmap case. Patch below. Thanks,

Alex

--
Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>

===== drivers/serial/8250.c 1.67 vs edited =====
--- 1.67/drivers/serial/8250.c 2004-09-13 18:23:24 -06:00
+++ edited/drivers/serial/8250.c 2004-10-04 12:12:34 -06:00
@@ -1733,7 +1733,7 @@
/*
* If we have a mapbase, then request that as well.
*/
- if (ret == 0 && up->port.flags & UPF_IOREMAP) {
+ if (ret == 0 && up->port.iotype == UPIO_MEM && up->port.mapbase) {
int size = res->end - res->start + 1;

up->port.membase = ioremap(up->port.mapbase, size);


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/