linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Timur Tabi <ttabi@interactivesi.com>
To: Linux MM mailing list <linux-mm@kvack.org>
Subject: iounmap causes Oops and Aiees
Date: Mon, 8 Jan 2001 12:13:17 -0600	[thread overview]
Message-ID: <20010108181048Z131177-224+83@kanga.kvack.org> (raw)

I'm using 2.2.18pre15 on an i386, and the following code causes my system to be
very unstable:

unsigned long phys = virt_to_phys(high_memory) - (2 * PAGE_SIZE);
mem_map_t *mm = mem_map + MAP_NR(phys);
unsigned long flags = mm->flags;

mm->flags |= PG_reserved;
p = ioremap_nocache(phys, PAGE_SIZE);
mm->flags = flags;
ASSERT(p);
if (p) iounmap(p);


The code is located in the init_module section of my driver.  It executes
without any problems.  However, after the driver is loaded (it doesn't do
anything but run this code), the system rapidly becomes unstable.  Symptoms are
random and include:

1. Inability to log in (login prompt doesn't respond after I type in a userid)
2. Attempting to shut down always causes an oops
3. Various kernel panics, including the "Aieee" kind.

I must be forgetting to do something critical, probably because what I'm trying
to do is not well documented but apparently supported by the kernel.  I make
that assumption because of this code fragment in function __ioremap of
arch/i386/mm/ioremap.c:

	if (phys_addr < virt_to_phys(high_memory))
           {
		char *temp_addr, *temp_end;
		int i;

		temp_addr = __va(phys_addr);
		temp_end = temp_addr + (size - 1);
	      
		for(i = MAP_NR(temp_addr); i < MAP_NR(temp_end); i++) {
			if(!PageReserved(mem_map + i))
				return NULL;
		}
	   }

As long as every page is marked as reserved, ioremap_nocache() will map the
page.  My question is: why does iounmap fail when ioremap succeeds?


-- 
Timur Tabi - ttabi@interactivesi.com
Interactive Silicon - http://www.interactivesi.com

When replying to a mailing-list message, please direct the reply to the mailing list only.  Don't send another copy to me.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

             reply	other threads:[~2001-01-08 18:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-08 18:13 Timur Tabi [this message]
2001-01-08 18:29 Timur Tabi

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=20010108181048Z131177-224+83@kanga.kvack.org \
    --to=ttabi@interactivesi.com \
    --cc=linux-mm@kvack.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