linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] : 8250.c don't iounmap() when no UPF_IOREMAP
@ 2004-06-21 11:00 David Kimdon
  0 siblings, 0 replies; only message in thread
From: David Kimdon @ 2004-06-21 11:00 UTC (permalink / raw)
  To: linux-serial

Hi,

I have a PCI serial device, using 2.6.6 I get :

__iounmap: bad address fbc79200
__iounmap: bad address fbc79400
__iounmap: bad address fbc79600
. . . .

When the driver is unloaded.  Something like the included patch is, I
believe, necessary.  I don't see any drivers that actually use the
UPF_IOREMAP flag, so it isn't completely clear to me how it should be
used.


-David

* drivers/serial/8250.c 
  (serial8250_request_std_resource) : Only request a resource if
  UPF_IOREMAP is set.
  (serial8250_release_port) : If UPF_IOREMAP is not set then we
  didn't do an ioremap().  In that case we shouldn't do iounmap()
  or release_mem_region().

Index: linux/drivers/serial/8250.c
===================================================================
--- linux.orig/drivers/serial/8250.c	Mon May 10 11:48:00 2004
+++ linux/drivers/serial/8250.c	Mon Jun 21 12:26:42 2004
@@ -1634,7 +1634,7 @@ serial8250_request_std_resource(struct u
 
 	switch (up->port.iotype) {
 	case UPIO_MEM:
-		if (up->port.mapbase) {
+		if (up->port.mapbase && up->port.flags & UPF_IOREMAP) {
 			*res = request_mem_region(up->port.mapbase, size, "serial");
 			if (!*res)
 				ret = -EBUSY;
@@ -1698,7 +1698,7 @@ static void serial8250_release_port(stru
 
 	switch (up->port.iotype) {
 	case UPIO_MEM:
-		if (up->port.mapbase) {
+		if (up->port.mapbase && up->port.flags & UPF_IOREMAP) {
 			/*
 			 * Unmap the area.
 			 */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-06-21 11:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-21 11:00 [PATCH] : 8250.c don't iounmap() when no UPF_IOREMAP David Kimdon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).