All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Zippel <roman@augan.com>
To: Timur Tabi <ttabi@interactivesi.com>
Cc: "Stephen C. Tweedie" <sct@redhat.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: ioremap_nocache problem?
Date: Thu, 25 Jan 2001 17:44:51 +0100	[thread overview]
Message-ID: <3A705802.5C4DD2F2@augan.com> (raw)
In-Reply-To: <3A6D5D28.C132D416@sangate.com> <20010123165117Z131182-221+34@kanga.kvack.org>  <20010123165117Z131182-221+34@kanga.kvack.org> ; from ttabi@interactivesi.com on Tue, Jan 23, 2001 at 10:53:51AM -0600 <20010125155345Z131181-221+38@kanga.kvack.org>

Hi,

Timur Tabi wrote:

> I mark the page as reserved when I ioremap() it.  However, if I leave it marked
> reserved, then iounmap() will not unmap it.  If I mark it "unreserved" (i.e.
> reset the reserved bit), then iounmap will unmap it, but it will decrement the
> page counter to -1 and the whole system will crash soon thereafter.
> 
> I've been asking about this problem for months, but no one has bothered to help
> me out.

The order is important:

	get_free_page();
	set_bit(PG_reserved, &page->flags);
	ioremap();
	...
	iounmap();
	clear_bit(PG_reserved, &page->flags);
	free_page();

Alternatively something like this should also be possible:

	get_free_page();
	ioremap();
	...
	iounmap();

nopage() {
	...
	atomic_inc(&page->count);
	return page;
}

But I never tried this version, so I can't guarantee anything. :)

bye, Roman
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

WARNING: multiple messages have this Message-ID (diff)
From: Roman Zippel <roman@augan.com>
To: Timur Tabi <ttabi@interactivesi.com>
Cc: "Stephen C. Tweedie" <sct@redhat.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: ioremap_nocache problem?
Date: Thu, 25 Jan 2001 17:44:51 +0100	[thread overview]
Message-ID: <3A705802.5C4DD2F2@augan.com> (raw)
In-Reply-To: 20010125155345Z131181-221+38@kanga.kvack.org

Hi,

Timur Tabi wrote:

> I mark the page as reserved when I ioremap() it.  However, if I leave it marked
> reserved, then iounmap() will not unmap it.  If I mark it "unreserved" (i.e.
> reset the reserved bit), then iounmap will unmap it, but it will decrement the
> page counter to -1 and the whole system will crash soon thereafter.
> 
> I've been asking about this problem for months, but no one has bothered to help
> me out.

The order is important:

	get_free_page();
	set_bit(PG_reserved, &page->flags);
	ioremap();
	...
	iounmap();
	clear_bit(PG_reserved, &page->flags);
	free_page();

Alternatively something like this should also be possible:

	get_free_page();
	ioremap();
	...
	iounmap();

nopage() {
	...
	atomic_inc(&page->count);
	return page;
}

But I never tried this version, so I can't guarantee anything. :)

bye, Roman
--
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-25 16:45 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-23 10:30 ioremap_nocache problem? Mark Mokryn
2001-01-23 10:30 ` Mark Mokryn
2001-01-23 16:53 ` Timur Tabi
2001-01-23 16:53 ` Timur Tabi
2001-01-25 15:16   ` Stephen C. Tweedie
2001-01-25 15:16     ` Stephen C. Tweedie
2001-01-25 15:56     ` Timur Tabi
2001-01-25 16:44       ` Roman Zippel [this message]
2001-01-25 16:44         ` Roman Zippel
2001-01-25 16:49         ` Timur Tabi
2001-01-26 10:39           ` Stephen C. Tweedie
2001-01-26 10:39             ` Stephen C. Tweedie
2001-01-25 16:49       ` Timur Tabi
2001-01-25 17:04         ` Jeff Hartmann
2001-01-25 17:04           ` Jeff Hartmann
2001-01-25 17:11           ` Timur Tabi
2001-01-25 17:11         ` Timur Tabi
     [not found]         ` <E14LpvQ-0008Pw-00@mail.valinux.com>
2001-01-25 17:47           ` Jeff Hartmann
2001-01-25 17:47             ` Jeff Hartmann
2001-01-25 17:53             ` Timur Tabi
2001-01-26 10:43               ` Stephen C. Tweedie
2001-01-26 10:43                 ` Stephen C. Tweedie
2001-01-26 16:32               ` Eric W. Biederman
2001-01-26 19:22                 ` Timur Tabi
2001-01-25 17:53           ` Timur Tabi
2001-01-25 18:13             ` Jeff Hartmann
2001-01-25 18:13               ` Jeff Hartmann
2001-01-25 18:18               ` Timur Tabi
2001-01-25 18:18             ` Timur Tabi
     [not found]             ` <E14Lqyt-0003z6-00@mail.valinux.com>
2001-01-25 18:46               ` Jeff Hartmann
2001-01-25 18:46                 ` Jeff Hartmann
     [not found]     ` <200101251556.f0PFuPd01743@mail.redhat.com>
2001-01-26 10:37       ` Stephen C. Tweedie
2001-01-26 10:37         ` Stephen C. Tweedie
2001-01-25 15:56   ` Timur Tabi
2001-01-23 18:12 ` Roman Zippel
2001-01-23 18:12   ` Roman Zippel
2001-01-23 18:38   ` Timur Tabi
2001-01-24  0:50   ` David Wragg
2001-01-24  0:50     ` David Wragg, David Wragg
2001-01-24 15:14     ` Timur Tabi
2001-01-24 15:14   ` Timur Tabi
     [not found]   ` <E14LRce-0008FU-00@diver.doc.ic.ac.uk>
2001-01-24 15:39     ` David Wragg
2001-01-24 15:39       ` David Wragg
2001-01-23 18:38 ` Timur Tabi
2001-01-24  1:01   ` David Wragg
2001-01-24  1:01     ` David Wragg

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=3A705802.5C4DD2F2@augan.com \
    --to=roman@augan.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sct@redhat.com \
    --cc=ttabi@interactivesi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.