Skip to contentSkip to conversation

nand potential div0

U-Boot Ryan J M 2 participants 2 messages Dec 31, 2008 – Jan 27, 2009

lore
Share & tools
lore

Ryan J M

author
#0 lore raw

I thought it would be better to check whether chip->ecc.size equal 0 here, I forgot to set ecc.size in board_nand_init() and it trigs a div0 hang.

driver/mtd/nand/nand_base.c
2786 /*
2787 * Set the number of read / write steps for one page
depending on ECC
2788 * mode
2789 */
2790 chip->ecc.steps = mtd->writesize / chip->ecc.size;
2791 if(chip->ecc.steps * chip->ecc.size != mtd->writesize) {
2792 printk(KERN_WARNING "Invalid ecc parameters\n");
2793 BUG();
2794 }
2795 chip->ecc.total = chip->ecc.steps * chip->ecc.bytes;
2796

Signature · 1 line
FIXME if it is wrong.
#1 lore raw

Dear "Ryan J M",

Quoted 10 lines · In message <[email protected]> you…

I thought it would be better to check whether chip->ecc.size equal 0 here, I forgot to set ecc.size in board_nand_init() and it trigs a div0 hang.

driver/mtd/nand/nand_base.c
2786 /*
2787 * Set the number of read / write steps for one page
depending on ECC
2788 * mode
2789 */

Quoted 7 lines
   2790         chip->ecc.steps = mtd->writesize / chip->ecc.size;
   2791         if(chip->ecc.steps * chip->ecc.size != mtd->writesize) {
   2792                 printk(KERN_WARNING "Invalid ecc parameters\n");
   2793                 BUG();
   2794         }
   2795         chip->ecc.total = chip->ecc.steps * chip->ecc.bytes;
   2796

Please submit a proper patch - see
http://www.denx.de/wiki/U-Boot/Patches for instructions.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Q:  Do you know what the death rate around here is?
A:  One per person.