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

* Re: [PATCH] gen_probe forgets to clean chip_map
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2004-07-03 14:37 UTC (permalink / raw)
  To: linux-mtd; +Cc: Robert Schwebel

On Saturday 03 July 2004 13:03, Robert Schwebel wrote:
> ----------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 */

Thanks, fixed due to your previous suggestion since 06-24 in CVS

-- 
Thomas
_____________________________________________________________________
From slash dot org
"When customers are visiting, engineers are not allowed to wear ties. 
That way the customer can tell who is the engineer and who is the 
salesman (and therefore whom to believe.). Ties cut off blood flow 
to the brain, making it easier for the salesmen to do their jobs." 
_____________________________________________________________________
linutronix - competence in embedded & realtime linux
http://www.linutronix.de
mail: tglx@linutronix.de

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

* Re: [PATCH] gen_probe forgets to clean chip_map
  2004-07-03 14:37 ` Thomas Gleixner
@ 2004-07-04 15:23   ` Robert Schwebel
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Schwebel @ 2004-07-04 15:23 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: linux-mtd

On Sat, Jul 03, 2004 at 04:37:04PM +0200, Thomas Gleixner wrote:
> Thanks, fixed due to your previous suggestion since 06-24 in CVS

Ah, thx ;) It became difficult recently to follow CVS since it lives
behind that IPv6 gateway...

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