public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] set membase in serial8250_request_port
@ 2004-10-04 18:54 Alex Williamson
  2004-10-04 21:04 ` Russell King
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Williamson @ 2004-10-04 18:54 UTC (permalink / raw)
  To: rmk+serial; +Cc: linux-kernel


   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@hp.com>

===== 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);



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-10-30 10:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-04 18:54 [PATCH] set membase in serial8250_request_port Alex Williamson
2004-10-04 21:04 ` Russell King
2004-10-04 21:43   ` Alex Williamson
2004-10-18 14:56     ` Alex Williamson
2004-10-28 19:24       ` Alex Williamson
2004-10-30 10:28         ` Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox