Re: ioremap_nocache problem?

2001-01-26 Thread Stephen C. Tweedie
Hi, On Thu, Jan 25, 2001 at 11:53:01AM -0600, Timur Tabi wrote: > > > As in an MMIO aperture? If its MMIO on the bus you should be able to > > just call ioremap with the bus address. By nature of it being outside > > of real ram, it should automatically be uncached (unless you've set an >

Re: ioremap_nocache problem?

2001-01-26 Thread Stephen C. Tweedie
Hi, On Thu, Jan 25, 2001 at 10:49:50AM -0600, Timur Tabi wrote: > > > set_bit(PG_reserved, >flags); > > ioremap(); > > ... > > iounmap(); > > clear_bit(PG_reserved, >flags); > > The problem with this is that between the ioremap and iounmap, the page is > reserved. What happens

Re: ioremap_nocache problem?

2001-01-26 Thread Stephen C. Tweedie
Hi, On Thu, Jan 25, 2001 at 09:56:32AM -0600, Timur Tabi wrote: > > ioremap*() is only supposed to be used on IO regions or reserved > > pages. If you haven't marked the pages as reserved, then iounmap will > > do the wrong thing, so it's up to you to reserve the pages. > > Au contraire! > >

Re: ioremap_nocache problem?

2001-01-26 Thread Stephen C. Tweedie
Hi, On Thu, Jan 25, 2001 at 09:56:32AM -0600, Timur Tabi wrote: ioremap*() is only supposed to be used on IO regions or reserved pages. If you haven't marked the pages as reserved, then iounmap will do the wrong thing, so it's up to you to reserve the pages. Au contraire! I mark the

Re: ioremap_nocache problem?

2001-01-26 Thread Stephen C. Tweedie
Hi, On Thu, Jan 25, 2001 at 10:49:50AM -0600, Timur Tabi wrote: set_bit(PG_reserved, page-flags); ioremap(); ... iounmap(); clear_bit(PG_reserved, page-flags); The problem with this is that between the ioremap and iounmap, the page is reserved. What happens if

Re: ioremap_nocache problem?

2001-01-26 Thread Stephen C. Tweedie
Hi, On Thu, Jan 25, 2001 at 11:53:01AM -0600, Timur Tabi wrote: As in an MMIO aperture? If its MMIO on the bus you should be able to just call ioremap with the bus address. By nature of it being outside of real ram, it should automatically be uncached (unless you've set an MTRR

Re: ioremap_nocache problem?

2001-01-25 Thread Jeff Hartmann
Timur Tabi wrote: > ** Reply to message from Jeff Hartmann <[EMAIL PROTECTED]> on Thu, 25 Jan > 2001 11:13:35 -0700 > > > >> You need to have your driver in the early bootup process then. When >> memory is being detected (but before the free lists are created.), you >> can set your page as

Re: ioremap_nocache problem?

2001-01-25 Thread Timur Tabi
** Reply to message from Jeff Hartmann <[EMAIL PROTECTED]> on Thu, 25 Jan 2001 11:13:35 -0700 > You need to have your driver in the early bootup process then. When > memory is being detected (but before the free lists are created.), you > can set your page as being reserved. But doesn't

Re: ioremap_nocache problem?

2001-01-25 Thread Jeff Hartmann
Timur Tabi wrote: > ** Reply to message from Jeff Hartmann <[EMAIL PROTECTED]> on Thu, 25 Jan > 2001 10:47:13 -0700 > > > >> As in an MMIO aperture? If its MMIO on the bus you should be able to >> just call ioremap with the bus address. By nature of it being outside >> of real ram, it

Re: ioremap_nocache problem?

2001-01-25 Thread Timur Tabi
** Reply to message from Jeff Hartmann <[EMAIL PROTECTED]> on Thu, 25 Jan 2001 10:47:13 -0700 > As in an MMIO aperture? If its MMIO on the bus you should be able to > just call ioremap with the bus address. By nature of it being outside > of real ram, it should automatically be uncached

Re: ioremap_nocache problem?

2001-01-25 Thread Jeff Hartmann
Timur Tabi wrote: > ** Reply to message from Jeff Hartmann <[EMAIL PROTECTED]> on Thu, 25 Jan > 2001 10:04:47 -0700 > > > >>> The problem with this is that between the ioremap and iounmap, the page is >>> reserved. What happens if that page belongs to some disk buffer or user >>> process,

Re: ioremap_nocache problem?

2001-01-25 Thread Timur Tabi
** Reply to message from Jeff Hartmann <[EMAIL PROTECTED]> on Thu, 25 Jan 2001 10:04:47 -0700 > > The problem with this is that between the ioremap and iounmap, the page is > > reserved. What happens if that page belongs to some disk buffer or user > > process, and some other process tries to

Re: ioremap_nocache problem?

2001-01-25 Thread Jeff Hartmann
Timur Tabi wrote: > ** Reply to message from Roman Zippel <[EMAIL PROTECTED]> on Thu, 25 Jan 2001 > 17:44:51 +0100 > > > >> set_bit(PG_reserved, >flags); >> ioremap(); >> ... >> iounmap(); >> clear_bit(PG_reserved, >flags); > > > The problem with this is that between the

Re: ioremap_nocache problem?

2001-01-25 Thread Timur Tabi
** Reply to message from Roman Zippel <[EMAIL PROTECTED]> on Thu, 25 Jan 2001 17:44:51 +0100 > set_bit(PG_reserved, >flags); > ioremap(); > ... > iounmap(); > clear_bit(PG_reserved, >flags); The problem with this is that between the ioremap and iounmap, the page is

Re: ioremap_nocache problem?

2001-01-25 Thread Roman Zippel
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

Re: ioremap_nocache problem?

2001-01-25 Thread Timur Tabi
** Reply to message from "Stephen C. Tweedie" <[EMAIL PROTECTED]> on Thu, 25 Jan 2001 15:16:55 + > ioremap*() is only supposed to be used on IO regions or reserved > pages. If you haven't marked the pages as reserved, then iounmap will > do the wrong thing, so it's up to you to reserve the

Re: ioremap_nocache problem?

2001-01-25 Thread Stephen C. Tweedie
Hi, On Tue, Jan 23, 2001 at 10:53:51AM -0600, Timur Tabi wrote: > > My problem is that it's very easy to map memory with ioremap_nocache, but if > you use iounmap() the un-map it, the entire system will crash. No one has been > able to explain that one to me, either. ioremap*() is only

Re: ioremap_nocache problem?

2001-01-25 Thread Stephen C. Tweedie
Hi, On Tue, Jan 23, 2001 at 10:53:51AM -0600, Timur Tabi wrote: My problem is that it's very easy to map memory with ioremap_nocache, but if you use iounmap() the un-map it, the entire system will crash. No one has been able to explain that one to me, either. ioremap*() is only supposed

Re: ioremap_nocache problem?

2001-01-25 Thread Timur Tabi
** Reply to message from "Stephen C. Tweedie" [EMAIL PROTECTED] on Thu, 25 Jan 2001 15:16:55 + ioremap*() is only supposed to be used on IO regions or reserved pages. If you haven't marked the pages as reserved, then iounmap will do the wrong thing, so it's up to you to reserve the

Re: ioremap_nocache problem?

2001-01-25 Thread Roman Zippel
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

Re: ioremap_nocache problem?

2001-01-25 Thread Jeff Hartmann
Timur Tabi wrote: ** Reply to message from Roman Zippel [EMAIL PROTECTED] on Thu, 25 Jan 2001 17:44:51 +0100 set_bit(PG_reserved, page-flags); ioremap(); ... iounmap(); clear_bit(PG_reserved, page-flags); The problem with this is that between the ioremap and

Re: ioremap_nocache problem?

2001-01-25 Thread Timur Tabi
** Reply to message from Jeff Hartmann [EMAIL PROTECTED] on Thu, 25 Jan 2001 10:04:47 -0700 The problem with this is that between the ioremap and iounmap, the page is reserved. What happens if that page belongs to some disk buffer or user process, and some other process tries to free it.

Re: ioremap_nocache problem?

2001-01-25 Thread Jeff Hartmann
Timur Tabi wrote: ** Reply to message from Jeff Hartmann [EMAIL PROTECTED] on Thu, 25 Jan 2001 10:04:47 -0700 The problem with this is that between the ioremap and iounmap, the page is reserved. What happens if that page belongs to some disk buffer or user process, and some other

Re: ioremap_nocache problem?

2001-01-25 Thread Jeff Hartmann
Timur Tabi wrote: ** Reply to message from Jeff Hartmann [EMAIL PROTECTED] on Thu, 25 Jan 2001 10:47:13 -0700 As in an MMIO aperture? If its MMIO on the bus you should be able to just call ioremap with the bus address. By nature of it being outside of real ram, it should

Re: ioremap_nocache problem?

2001-01-25 Thread Timur Tabi
** Reply to message from Jeff Hartmann [EMAIL PROTECTED] on Thu, 25 Jan 2001 11:13:35 -0700 You need to have your driver in the early bootup process then. When memory is being detected (but before the free lists are created.), you can set your page as being reserved. But doesn't this

Re: ioremap_nocache problem?

2001-01-25 Thread Jeff Hartmann
Timur Tabi wrote: ** Reply to message from Jeff Hartmann [EMAIL PROTECTED] on Thu, 25 Jan 2001 11:13:35 -0700 You need to have your driver in the early bootup process then. When memory is being detected (but before the free lists are created.), you can set your page as being

Re: ioremap_nocache problem?

2001-01-24 Thread David Wragg
Timur Tabi <[EMAIL PROTECTED]> writes: > ** Reply to message from David Wragg <[EMAIL PROTECTED]> on 24 Jan 2001 > 00:50:20 + > > (x86 processors with PAT and IA64 can set write-combining through > >page flags. x86 processors with MTRRs but not PAT would need a more > >elaborate

Re: ioremap_nocache problem?

2001-01-24 Thread Timur Tabi
** Reply to message from David Wragg <[EMAIL PROTECTED]> on 24 Jan 2001 00:50:20 + > (x86 processors with PAT and IA64 can set write-combining through page > flags. x86 processors with MTRRs but not PAT would need a more > elaborate implementation for write-combining.) What is PAT? I

Re: ioremap_nocache problem?

2001-01-24 Thread Timur Tabi
** Reply to message from David Wragg [EMAIL PROTECTED] on 24 Jan 2001 00:50:20 + (x86 processors with PAT and IA64 can set write-combining through page flags. x86 processors with MTRRs but not PAT would need a more elaborate implementation for write-combining.) What is PAT? I

Re: ioremap_nocache problem?

2001-01-24 Thread David Wragg
Timur Tabi [EMAIL PROTECTED] writes: ** Reply to message from David Wragg [EMAIL PROTECTED] on 24 Jan 2001 00:50:20 + (x86 processors with PAT and IA64 can set write-combining through page flags. x86 processors with MTRRs but not PAT would need a more elaborate implementation for

Re: ioremap_nocache problem?

2001-01-23 Thread David Wragg
Timur Tabi <[EMAIL PROTECTED]> writes: > ** Reply to message from Roman Zippel <[EMAIL PROTECTED]> on > Tue, 23 Jan 2001 19:12:36 +0100 (MET) > > ioremap creates a new mapping that shouldn't interfere with MTRR, > >whereas you can map a MTRR mapped area into userspace. But I'm not > >sure if it's

Re: ioremap_nocache problem?

2001-01-23 Thread David Wragg
From: David Wragg <[EMAIL PROTECTED]> Gcc: nnfolder:mail.sent --text follows this line-- Roman Zippel <[EMAIL PROTECTED]> writes: > On Tue, 23 Jan 2001, Mark Mokryn wrote: > > ioremap_nocache does the following: > > return __ioremap(offset, size, _PAGE_PCD); You have a point. It would be

Re: ioremap_nocache problem?

2001-01-23 Thread Timur Tabi
** Reply to message from Roman Zippel <[EMAIL PROTECTED]> on Tue, 23 Jan 2001 19:12:36 +0100 (MET) > ioremap creates a new mapping that shouldn't interfere with MTRR, whereas > you can map a MTRR mapped area into userspace. But I'm not sure if it's > correct that no flag is set for

Re: ioremap_nocache problem?

2001-01-23 Thread Roman Zippel
Hi, On Tue, 23 Jan 2001, Mark Mokryn wrote: > ioremap_nocache does the following: > return __ioremap(offset, size, _PAGE_PCD); > > However, in drivers/char/mem.c (2.4.0), we see the following: > > /* On PPro and successors, PCD alone doesn't always mean > uncached

Re: ioremap_nocache problem?

2001-01-23 Thread Timur Tabi
** Reply to message from Mark Mokryn <[EMAIL PROTECTED]> on Tue, 23 Jan 2001 12:30:00 +0200 > Does this mean ioremap_nocache() may not do the job? Good luck trying to get an answer. I've been asking questions on ioremap for months, but no one's ever been able to tell me anything. According

Re: ioremap_nocache problem?

2001-01-23 Thread Timur Tabi
** Reply to message from Mark Mokryn [EMAIL PROTECTED] on Tue, 23 Jan 2001 12:30:00 +0200 Does this mean ioremap_nocache() may not do the job? Good luck trying to get an answer. I've been asking questions on ioremap for months, but no one's ever been able to tell me anything. According to

Re: ioremap_nocache problem?

2001-01-23 Thread Roman Zippel
Hi, On Tue, 23 Jan 2001, Mark Mokryn wrote: ioremap_nocache does the following: return __ioremap(offset, size, _PAGE_PCD); However, in drivers/char/mem.c (2.4.0), we see the following: /* On PPro and successors, PCD alone doesn't always mean uncached because of

Re: ioremap_nocache problem?

2001-01-23 Thread Timur Tabi
** Reply to message from Roman Zippel [EMAIL PROTECTED] on Tue, 23 Jan 2001 19:12:36 +0100 (MET) ioremap creates a new mapping that shouldn't interfere with MTRR, whereas you can map a MTRR mapped area into userspace. But I'm not sure if it's correct that no flag is set for boot_cpu_data.x86

Re: ioremap_nocache problem?

2001-01-23 Thread David Wragg
From: David Wragg [EMAIL PROTECTED] Gcc: nnfolder:mail.sent --text follows this line-- Roman Zippel [EMAIL PROTECTED] writes: On Tue, 23 Jan 2001, Mark Mokryn wrote: ioremap_nocache does the following: return __ioremap(offset, size, _PAGE_PCD); You have a point. It would be nice if

Re: ioremap_nocache problem?

2001-01-23 Thread David Wragg
Timur Tabi [EMAIL PROTECTED] writes: ** Reply to message from Roman Zippel [EMAIL PROTECTED] on Tue, 23 Jan 2001 19:12:36 +0100 (MET) ioremap creates a new mapping that shouldn't interfere with MTRR, whereas you can map a MTRR mapped area into userspace. But I'm not sure if it's correct