Skip to contentSkip to conversation

suspend/resume for multiple partitions

DISCUSSION Paul J THACKER 1 participant 1 message Jun 14, 2006 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

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