destroying maps, and secure sectors

Robert P. J. Day rpjday at mindspring.com
Tue Jul 13 10:34:17 EDT 2004


   two questions.  first, what is the standard order for cleanup 
operations in a map file?  based on what i've read in several sample 
files, it seems that the consensus is

   1) EITHER del_mtd_partitions() or del_mtd_device()
   2) map_destroy()
   3) iounmap()

i'm not familiar with the mechanics of map_destroy(), but it seems to 
offend aesthetic sensibilities to have a routine called map_destroy(), 
immediately followed by a routine that explicitly accesses a portion 
of that map object to run iounmap().  it reminds me of that old canard 
from college programming class -- don't delete a node from a linked 
list, then try to follow the next pointer of that same node.

   given that everyone seems to agree on the above order, i'll stick 
with it, but it sure seems counter-intuitive.

   second, how does one define a secure sector?  (a pointer to a URL 
would work just great.)  our system flash chip has a secure sector at 
offset 0, size 64K (overlaid with the boot loader).  the way this was 
defined in the code i inherited was to (wait for it) hack mtdchar.c, 
specifically look for any partition definition that was <=64K, and 
return from mtd_notify_add() without doing any processing.  i'm pretty 
sure that's not what i want to do. :-)

   hints?

rday




More information about the linux-mtd mailing list