Subject: Re: Ordering device probes
To: Peter Seebach <seebs@plethora.net>
From: Nathan J. Williams <nathanw@wasabisystems.com>
List: tech-kern
Date: 02/21/2006 09:16:08
seebs@plethora.net (Peter Seebach) writes:

> Hmm.  The design seems to imply that I still want to use bus_space_map
> on that tag to get a suitable bus_space_handle for use by the
> various i2c functions.  I have established that I can do this, and
> it works, but I can't unmap it; I get a very strange error asserting that
> a value isn't in an extent, even though it appears to be:
> 
> extent `opbtag' (0xef600300 - 0xef6012fe), flags = 0x3
>      0xef600500 - 0xef60051f
> extent_free: extent `opbtag', start 0x1e, size 0x20
> panic: extent_free: extent `opbtag', region not within extent

> I am a little confused about the relationship between map and unmap.  It
> seems to me that, if bus_space_map(tag, addr, ... &handle) has been called,
> it's obligatory to later call bus_space_unmap(tag, handle); not because
> it necessarily does anything, but simply as a matter of the interface
> contract.

Note the "extent_flags" hack in powerpc/powerpc/bus_space.c. It
doesn't bother to allocate the extent for bootstrap uses... but
there's no corresponding check in the unmap code. My interpretation of
this is that bootstrap code should feel free to not bother to unmap
the region; adding the matching extent_flags hack to the unmap code
would be okay, too.

        - Nathan