mtd woes

Abraham vd Merwe abraham at 2d3d.co.za
Tue Jun 12 10:11:16 EDT 2001


Hi!

Jeez. I've had the worst debugging session in a long time the past two days.
My flash module kept causing a fault when using partitioning. In the end it
turned out there's a small bug in mtdpart.c - It doesn't check whether
sync() is defined, i.e. in add_mtd_partitions():

------------< snip <------< snip <------< snip <------------
        slave->mtd.bank_size = master->bank_size;

        slave->mtd.module = master->module;

        slave->mtd.read = part_read;
        slave->mtd.write = part_write;
       if (master->sync) slave->mtd.sync = part_sync;
        //slave->mtd.sync = part_sync;
        if (!i && master->suspend && master->resume) {
                slave->mtd.suspend = part_suspend;
                slave->mtd.resume = part_resume;
------------< snip <------< snip <------< snip <------------

The uncommented line is what it's set to atm which is wrong since the MTD
API states that sync() is optional. The line in there fixes it.

I'll send a patch when I release my module, but since this is a one-liner
anyway, one of you guys can patch it as well...

-- 

Regards
 Abraham

If A = B and B = C, then A = C, except where void or prohibited by law.
		-- Roy Santoro

__________________________________________________________
 Abraham vd Merwe - 2d3D, Inc.

 Device Driver Development, Outsourcing, Embedded Systems

  Cell: +27 82 565 4451         Snailmail:
   Tel: +27 21 761 7549            Block C, Antree Park
   Fax: +27 21 761 7648            Doncaster Road
 Email: abraham at 2d3d.co.za         Kenilworth, 7700
  Http: http://www.2d3d.com        South Africa

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-mtd/attachments/20010612/db5c4277/attachment.bin 


More information about the linux-mtd mailing list