[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Battery powered ram

On Thu, 2002-12-05 at 21:27, Pieter Grimmerink wrote:
> > ioremap is not enough but since the kernel won't
> > use the SRAM for normal allocations it should
> > be safe.
> Would it be wise to call request_mem_region() first,
> just in case someone adds support for SRAM in the
> future?

There is no direct relation between the I/O memory handled by
request_mem_region() and the memory the kernel uses for normal
allocations. Thus, if the kernel somehow decides to use the SRAM then
calling request_mem_region() from your driver will not help anyway.

However, if someone adds support for using SRAM to the kernel there will
probably be config options for this so your driver will still work
unless you explicitly enable the new config options.

> Or would that fail because SRAM can't be allocated?

It should work.

> I'm just trying to get this whole thing clear, I'm
> not sure whether I should follow the same approach
> as for device memory regions.

You could, and it may be a good idea to do so, but it is not necessary
and it is no guarantee that something else won't use the SRAM unless all
parts of the kernel (drivers etc.) that may decide to use the SRAM calls
request_mem_region() first.