public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* chip driver mar_ram.c never sets MTD_ERASE_DONE state
@ 2004-06-17 13:51 Oliver Kühlert
  2004-06-17 14:08 ` Thomas Gleixner
  2004-06-17 14:43 ` Ian Campbell
  0 siblings, 2 replies; 3+ messages in thread
From: Oliver Kühlert @ 2004-06-17 13:51 UTC (permalink / raw)
  To: linux-mtd; +Cc: mag, rof, acs



Hello,

trying to erase on an mtd devices using the map_ram.c driver
blocks the current process and never wakes up. (see mtdchar.c, ioctl func)

I believe, that this can be fixed by adding the marked line in map_ram.c:


static int mapram_erase (struct mtd_info *mtd, struct erase_info *instr)
{
         /* Yeah, it's inefficient. Who cares? It's faster than a _real_
            flash erase. */
         struct map_info *map = (struct map_info *)mtd->priv;
         unsigned long i;

         for (i=0; i<instr->len; i++)
                 map_write8(map, 0xFF, instr->addr + i);

!!!!!!---->   instr->state = MTD_ERASE_DONE;   <----- !!!!!!

         if (instr->callback)
                 instr->callback(instr);

         return 0;
}

Best regards, Oliver Kühlert


-- 
Dr. Oliver Kuehlert          SYSGO Real-Time Solutions AG
oliver.kuehlert@sysgo.com
Software Engineering     Embedded and Real-Time Software    www.sysgo.de
Voice: +49-6136-9948-0   Am Pfaffenstein 14                 www.osek.de
FAX:   +49-6136-9948-10  55270 Klein-Winternheim, Germany   www.elinos.com

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

* Re: chip driver mar_ram.c never sets MTD_ERASE_DONE state
  2004-06-17 13:51 chip driver mar_ram.c never sets MTD_ERASE_DONE state Oliver Kühlert
@ 2004-06-17 14:08 ` Thomas Gleixner
  2004-06-17 14:43 ` Ian Campbell
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Gleixner @ 2004-06-17 14:08 UTC (permalink / raw)
  To: Oliver Kühlert, linux-mtd; +Cc: mag, rof, acs

On Thursday 17 June 2004 15:51, Oliver Kühlert wrote:
> Hello,
>
> trying to erase on an mtd devices using the map_ram.c driver
> blocks the current process and never wakes up. (see mtdchar.c, ioctl func)
>
> !!!!!!---->   instr->state = MTD_ERASE_DONE;   <----- !!!!!!

Thanks, fixed 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: chip driver mar_ram.c never sets MTD_ERASE_DONE state
  2004-06-17 13:51 chip driver mar_ram.c never sets MTD_ERASE_DONE state Oliver Kühlert
  2004-06-17 14:08 ` Thomas Gleixner
@ 2004-06-17 14:43 ` Ian Campbell
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2004-06-17 14:43 UTC (permalink / raw)
  To: Linux MTD Mailing List

On Thu, 2004-06-17 at 14:51, Oliver Kühlert wrote:
> trying to erase on an mtd devices using the map_ram.c driver
> blocks the current process and never wakes up. (see mtdchar.c, ioctl func)
> 
> I believe, that this can be fixed by adding the marked line in map_ram.c:

I believe that to be correct -- I posted a patch here quite some time
ago
http://lists.infradead.org/pipermail/linux-mtd/2002-November/006436.html

Please could someone who has CVS access commit it? Perhaps I should also
submit to the kernel list?

Ian.

%patch
Index: q/drivers/mtd/chips/map_ram.c
===================================================================
--- q.orig/drivers/mtd/chips/map_ram.c	Tue Aug  5 16:46:21 2003
+++ q/drivers/mtd/chips/map_ram.c	Tue Aug  5 16:46:37 2003
@@ -109,6 +109,8 @@
 	for (i=0; i<instr->len; i++)
 		map_write8(map, 0xFF, instr->addr + i);
 
+	instr->state = MTD_ERASE_DONE;
+
 	if (instr->callback)
 		instr->callback(instr);
 

%diffstat
 map_ram.c |    2 ++
 1 files changed, 2 insertions(+)


-- 
Ian Campbell, Senior Design Engineer
                                        Web: http://www.arcom.com
Arcom, Clifton Road, 			Direct: +44 (0)1223 403 465
Cambridge CB1 7EA, United Kingdom	Phone:  +44 (0)1223 411 200

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

end of thread, other threads:[~2004-06-17 14:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-17 13:51 chip driver mar_ram.c never sets MTD_ERASE_DONE state Oliver Kühlert
2004-06-17 14:08 ` Thomas Gleixner
2004-06-17 14:43 ` Ian Campbell

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