Re: ioremap_nocache problem?

From: Roman Zippel (roman@augan.com)
Date: Thu Jan 25 2001 - 11:44:51 EST


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/



This archive was generated by hypermail 2b29 : Wed Jan 31 2001 - 21:00:22 EST