mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dominik Brodowski <linux@dominikbrodowski.net>
To: Vincent C Jones <vcjones@networkingunlimited.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [2.6.13-rc3][PCMCIA] - iounmap: bad address f1d62000
Date: Sun, 17 Jul 2005 00:25:26 +0200	[thread overview]
Message-ID: <20050716222526.GA14172@dominikbrodowski.de> (raw)
In-Reply-To: <20050716162144.A1650@flint.arm.linux.org.uk>

On Sat, Jul 16, 2005 at 04:21:44PM +0100, Russell King wrote:
> On Sat, Jul 16, 2005 at 05:12:58PM +0200, Dominik Brodowski wrote:
> > Could you send me the output of /proc/iomem on both a working kernel and on
> > 2.6.13-rc3-APM, please?
> 
> Dominik, I'd suggest looking elsewhere.  The memory regions must be
> free to be able to call into readable(), and therefore pccard_validate_cis().
> 
> What seems to be happening is that s->ops->set_mem_map in set_cis_map
> is returning an error, causing it to free the ioremapped region
> multiple times.  Maybe the card has an invalid CIS causing an out
> of range card_start to be requested?

Could you check whether this patch helps, please?

Index: 2.6.13-rc3-git2/drivers/pcmcia/cistpl.c
===================================================================
--- 2.6.13-rc3-git2.orig/drivers/pcmcia/cistpl.c
+++ 2.6.13-rc3-git2/drivers/pcmcia/cistpl.c
@@ -88,31 +88,38 @@ EXPORT_SYMBOL(release_cis_mem);
 static void __iomem *
 set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flags)
 {
-    pccard_mem_map *mem = &s->cis_mem;
-    int ret;
+	pccard_mem_map *mem = &s->cis_mem;
+	int ret;
 
-    if (!(s->features & SS_CAP_STATIC_MAP) && mem->res == NULL) {
-	mem->res = pcmcia_find_mem_region(0, s->map_size, s->map_size, 0, s);
-	if (mem->res == NULL) {
-	    printk(KERN_NOTICE "cs: unable to map card memory!\n");
-	    return NULL;
-	}
-	s->cis_virt = ioremap(mem->res->start, s->map_size);
-    }
-    mem->card_start = card_offset;
-    mem->flags = flags;
-    ret = s->ops->set_mem_map(s, mem);
-    if (ret) {
-	iounmap(s->cis_virt);
-	return NULL;
-    }
-
-    if (s->features & SS_CAP_STATIC_MAP) {
-	if (s->cis_virt)
-	    iounmap(s->cis_virt);
-	s->cis_virt = ioremap(mem->static_start, s->map_size);
-    }
-    return s->cis_virt;
+	if (!(s->features & SS_CAP_STATIC_MAP) && (mem->res == NULL)) {
+		mem->res = pcmcia_find_mem_region(0, s->map_size, s->map_size, 0, s);
+		if (mem->res == NULL) {
+			printk(KERN_NOTICE "cs: unable to map card memory!\n");
+			return NULL;
+		}
+		s->cis_virt = NULL;
+	}
+
+	if (!(s->features & SS_CAP_STATIC_MAP) && (!s->cis_virt))
+		s->cis_virt = ioremap(mem->res->start, s->map_size);
+
+	mem->card_start = card_offset;
+	mem->flags = flags;
+
+	ret = s->ops->set_mem_map(s, mem);
+	if (ret) {
+		iounmap(s->cis_virt);
+		s->cis_virt = NULL;
+		return NULL;
+	}
+
+	if (s->features & SS_CAP_STATIC_MAP) {
+		if (s->cis_virt)
+			iounmap(s->cis_virt);
+		s->cis_virt = ioremap(mem->static_start, s->map_size);
+	}
+
+	return s->cis_virt;
 }
 
 /*======================================================================

  reply	other threads:[~2005-07-16 22:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4qGHl-3Hm-11@gated-at.bofh.it>
2005-07-16 14:40 ` Vincent C Jones
2005-07-16 15:12   ` Dominik Brodowski
2005-07-16 15:21     ` Russell King
2005-07-16 22:25       ` Dominik Brodowski [this message]
2005-07-17  2:08     ` Vincent C Jones

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=20050716222526.GA14172@dominikbrodowski.de \
    --to=linux@dominikbrodowski.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vcjones@networkingunlimited.com \
    /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

all inboxes | Powered by JetHome®