: 8250.c don't iounmap() when no UPF_IOREMAP
PATCH 1/1 : 8250.c don't iounmap() when no UPF_IOREMAP
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().
drivers/serial/8250.c +2 -2
@@ -1634,7 +1634,7 @@ serial8250_request_std_resource(struct uswitch (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(struswitch (up->port.iotype) {case UPIO_MEM : -if (up->port.mapbase) { +if (up->port.mapbase && up->port.flags &UPF_IOREMAP ) {/* * Unmap the area. */