io_block_mapping & ioremap question

Kumar Gala galak at kernel.crashing.org
Wed Apr 16 13:52:19 EST 2008


On Apr 15, 2008, at 11:25 AM, Gutson Daniel-ADG035 wrote:
> Hi,
> 	I'm doing some work on 2.6.10, and got this problem:
> - there are some io_block_mapping calls in the setup_io_mapping
> callback, that use the BATs, and passing same va and pa each one.
> Problem arises later when vmallocs gets a a pointer within the mapped
> ranges. In other words, seems like the VMM is not aware of the BATs
> mapping.
>
> So what I did is: called first ioremap and then io_block_mapping in  
> the
> callback thus not hardcoding the va, something like:
> 	va = ioremap(pa, size);
> 	io_block_mapping(pa, va, size);
>
> Questions:
> 	1) Is it right?
> 	2) Should I unmap that address sometime later? (i.e. after
> mem_init_done).

You should look at getting ride of your io_block_mapping calls as  
we've removed that in new kernels.

However, ioremap() should work properly in that it should lookup the  
address you are mapping via p_mapped_by_bats().

- k


More information about the Linuxppc-embedded mailing list