suspend/resume for multiple partitions

Paul J THACKER paul.thacker at st.com
Wed Jun 14 16:45:38 EDT 2006


On my ARM9-based platform, we have 5 MTD partitions on NOR flash. One of 
those partitions contains a jffs2 filesystem. Upon wake-up from deep 
sleep, the NOR comes up in locked state. The resume code unlocks the 
first partition, but not the rest. This causes subsequent writes to the 
jffs2 filesystem to fail. Debugging showed that the mtd_info struct 
fields for suspend and resume were only set for the first partition. I 
traced this back to add_mtd_partitions():

        if (!i && master->suspend && master->resume) {
                slave->mtd.suspend = part_suspend;
                slave->mtd.resume = part_resume;
        }

which sets the fields, but only for the first partition. Removing the 
"!i" condition seems to fix this problem, at least for my platform.

I'm not that familiar with the MTD code, so can somebody explain why 
it's done this way, and if changing it will break something somewhere else?

Thanks,
Paul





More information about the linux-mtd mailing list