From: David Kimdon <kimdon@esrf.fr>
To: linux-serial@vger.kernel.org
Subject: [PATCH] : 8250.c don't iounmap() when no UPF_IOREMAP
Date: Mon, 21 Jun 2004 13:00:22 +0200 [thread overview]
Message-ID: <20040621110022.GE8110@wow.esrf.fr> (raw)
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.
*/
reply other threads:[~2004-06-21 11:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040621110022.GE8110@wow.esrf.fr \
--to=kimdon@esrf.fr \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).