Troubles with JFFS2

Narinder Kumar narinder at kritikalsolutions.com
Thu Mar 31 12:21:25 EST 2005


Hi all,

I have written a keypad driver which is a memory mapped device which  
works perfectly fine when teh application and drivers are on NFS rather 
than on JFFS2 filesystem.__ I have already spent two months trying to 
debug it. But even a minimal keypad driver has trouble working together
with JFFS2. I never had any problems on NFS.
    I put my drivers and application onto JFFS2 filesystem and then 
mount that partition and run the application and it runs succesfully but 
when i try to unmount the partitioned just mounted it hangs.  I am using 
timer interrupt in my keypad driver which is running on a JFFS2 
filesystem on DataFlash on AT91RM9200DK on linux-2.4.27-vrs1 (using 
20050304 MTD snapshot)
    I think it is some bug in JFFS2, but I am not sure. Is JFFS2 really 
"production stable" ? I am hereby attaching the code of my Keypad 
Driver  and providing some overview of what the code is doing

INSMOD:
when the keypad driver is loaded into the kernel, the timer interrupt is 
initialized but it does nothing till the point the application tries to 
read from the keypad.

SCAN_KBD ( Timer Interrupt function)
After timer expiry this function is called and it checks for the flag, 
whether it should read from memory mapped device or not ( which is set 
when the application tries to read from keypad) and if its false , it 
just adds the timer again and returns. So when application reads , its 
sets the flag SCHEDULE_OR_NOT to 1 and thereafter the timer interrupt 
actually reads from a memory mapped region where keypad is sitting. Once 
it reads from the memory mapped region , it checks which key was being 
pressed and then ignores the key if the same key is pressed till certain 
timeout ( HZ/5 ).

READ:
Sets the flag SCHEDULE_OR_NOT to 1 so that timer interrupt actually 
starts reading from memory mapped location.

RMMOD:
When the driver is removed from the kernel , it sets a flag CLOSE_TIMER 
to 1 , which is checked by the timer interrupt and it never adds itself 
again if this flag is set., and then it calls del_timer just to check if 
timer is still added it will delete it. and thereby unmap the memory 
mapped region that was being used for keypad.


Narinder


-------------- next part --------------
A non-text attachment was scrubbed...
Name: mail_keypad.c
Type: text/x-csrc
Size: 10254 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-mtd/attachments/20050331/d3feec01/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mail_keypad.h
Type: text/x-chdr
Size: 1123 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-mtd/attachments/20050331/d3feec01/attachment-0001.bin 


More information about the linux-mtd mailing list