Re-entrancy of flash erase/write

Adam Wozniak awozniak at comdev.cc
Mon Feb 25 10:44:21 EST 2002


On Mon, 25 Feb 2002, Robert Kaiser wrote:
> I looked into this a little further: it seems that the erase
> functions in cfi_cmdset_000?.c and amd_flash.c temporarily release
> the chip->mutex while VPP is on. Won't that allow other threads
> to get hold of the mutex and fiddle with VPP, possibly turning it
> off ?
>
> That would explain the behavior I'm observing here. Only why doensn't
> anyone else see this problem ?
>
> A proper solution IMHO would be to use a counter (similar to what I
> now have in my mapping driver) in the ENABLE/DISABLE_VPP() macros.

If I recall correctly, last time I dug into this:

ENABLE/DISABLE_VPP  call the map_info set_vpp function
For the physmap_map map_info, there is no set_vpp, it is NULL

So for people who use physmap_map anyway, they won't see the behavior
you are describing.  I suspect it is the same for other maps.

--Adam
-- 
Adam Wozniak (KG6GZR)   COM DEV Broadband - Digital and Software Systems
awozniak at comdev.cc      805 Aerovista Place, San Luis Obispo, CA 93401
                        http://www.comdev.cc
                        Voice: (805) 544-1089       Fax: (805) 544-2055





More information about the linux-mtd mailing list