How to Sync properly ?

Patrick Allaire pallaire at gameloft.com
Mon Jan 7 08:47:58 EST 2002


Hi,

I am having some problems with the syncing of data to flash. Last week I
have updated to 2.4.17 kernel and with cvs MTD drivers ... because I was
having the same kinds of problems with my previous version. 

If I want to move a file from a ram drive to the flash, I will issue a 'mv'
command followed by a 'sync' command. Sometime it will be updated but
sometime it wont !!! 'sync' should not return until the flash is updated ?
no ? 

To see what was happening I added some printk in the driver, in the delete
and write ! I saw some stranges behaviour. After a 'mv', sometimes the sync
command does not do any things, sometime I see somes delteting and writing
of buffers but not all of the blocks ... the remaining block will be written
to the flash in a delay from 1 to 5 mintutes later ... and sometime the sync
work fine !!!

It is really important for me, because my system has a hard power ... so if
I tell the user the system is ready to shut down ... there wont be a halt
command issued. For me the only way to do things, is to send a sync command,
when this command return, we can shut down.

I am using ST Flash, it is working on Intel flash driver(CFI) on char and
block device, with some modifications (ST cannot write partial block)

thank you

Patrick Allaire
mailto:pallaire at gameloft.com
If you can see it, but it's not there, it's virtual. 
If you can't see it, but it is there, it's hidden. 
It you can't see it and it isn't there, it's gone.






More information about the linux-mtd mailing list