public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] gen_probe forgets to clean chip_map
@ 2004-07-03 11:03 Robert Schwebel
  2004-07-03 14:37 ` Thomas Gleixner
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Schwebel @ 2004-07-03 11:03 UTC (permalink / raw)
  To: linux-mtd

On systems that have more than one flash chip in a probe window with
some space between the chips we recently found that erase operations are
performed on the wrong chip. This comes from the chip_map being
allocated in genprobe_ident_chips() but it is never cleaned before being
used. Here is a patch: 

----------8<----------
diff -urN mtd-20040622-1/drivers/mtd/chips/gen_probe.c mtd-20040622-1-ptx1/drivers/mtd/chips/gen_probe.c
--- mtd-20040622-1/drivers/mtd/chips/gen_probe.c	2003-11-09 00:00:04.000000000 +0100
+++ mtd-20040622-1-ptx1/drivers/mtd/chips/gen_probe.c	2004-06-25 14:38:28.000000000 +0200
@@ -114,6 +114,7 @@
 		kfree(cfi.cfiq);
 		return NULL;
 	}
+	memset(chip_map, 0, ((max_chips / 8) + ((max_chips % 8) ? 1 : 0)));
 
 	set_bit(0, chip_map); /* Mark first chip valid */
----------8<----------
 
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Signed-off-by: Benedikt Spranger <b.spranger@pengutronix.de>
Signed-off-by: Kai-Uwe Bloem <linux-development@auerswald.de>

Robert
-- 
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hornemannstraße 12,  31137 Hildesheim, Germany
    Phone: +49-5121-28619-0 |  Fax: +49-5121-28619-4

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-07-04 15:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-03 11:03 [PATCH] gen_probe forgets to clean chip_map Robert Schwebel
2004-07-03 14:37 ` Thomas Gleixner
2004-07-04 15:23   ` Robert Schwebel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox