[PATCH][MTD] mtdpart.c: allow other drivers to get physical address of partition

Jörn Engel joern at logfs.org
Fri Aug 3 08:58:06 EDT 2007


On Fri, 3 August 2007 14:21:54 +0200, Carsten Otte wrote:
> 
> Hmm. At least this does'nt seem like something that the xip 
> infrastructure should be concerned with: it will ask for 
> get_xip_page() [or get_xip_pfn()], and return temporary references via 
> put_xip_page/pfn(). The mtd layer has to decide when to pospone 
> get_xip_page() calls and when to ask for references being returned. On 
> the other hand, I think we should make sure get_xip_page() targets may 
> call schedule() in case the page we ask for is currently unavailable 
> while an erase operation is in progress.

Why schedule()?  I believe we should not wait but process the fault
immediatly via one of the methods Jared mentioned:

>> If you get a fault it gets routed to the filesystem .fault or
>> something like that.  The .fault routine can:
>> (a) suspend the erase
>> (b) copy the page to RAM
>> (c) update the pte to point to RAM
>> (d) resume the erase
>> -or-
>> (a) suspend the erase
>> (b) reenable the pte
>> (c) wait a short time
>> (d) disable pte again
>> (e) resume the erase

The second variant could be a bit hairy.  How can one ensure that (c)
only waits a short while and not much longer?  So I tend to prefer the
first variant.

Jörn

-- 
Courage is not the absence of fear, but rather the judgement that
something else is more important than fear.
-- Ambrose Redmoon



More information about the linux-mtd mailing list