* Re: can't erase "sharp".
2002-05-16 16:17 can't erase "sharp" Takashi YOSHII
@ 2002-05-16 16:12 ` Russ Dill
2002-05-17 9:00 ` David Woodhouse
1 sibling, 0 replies; 3+ messages in thread
From: Russ Dill @ 2002-05-16 16:12 UTC (permalink / raw)
To: Takashi YOSHII; +Cc: linux-mtd
On Thu, 2002-05-16 at 09:17, Takashi YOSHII wrote:
> I'm using drivers/mtd/chip/sharp.c (I know it's "obsolete", though).
> And, found "eraseall" command doesn't work upon it.
> The operation stops at 0%, and the command never exit.
>
> I added few lines(see the patch below), and it works, perhaps...
> I'm not sure if it is correct (especially when signals received).
>
> Could someone tell me the right answer, please?
> Regards,
is the first flash block locked?
^ permalink raw reply [flat|nested] 3+ messages in thread
* can't erase "sharp".
@ 2002-05-16 16:17 Takashi YOSHII
2002-05-16 16:12 ` Russ Dill
2002-05-17 9:00 ` David Woodhouse
0 siblings, 2 replies; 3+ messages in thread
From: Takashi YOSHII @ 2002-05-16 16:17 UTC (permalink / raw)
To: linux-mtd
I'm using drivers/mtd/chip/sharp.c (I know it's "obsolete", though).
And, found "eraseall" command doesn't work upon it.
The operation stops at 0%, and the command never exit.
I added few lines(see the patch below), and it works, perhaps...
I'm not sure if it is correct (especially when signals received).
Could someone tell me the right answer, please?
Regards,
/ yoshii
Index: drivers/mtd/chips/sharp.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/sharp.c,v
retrieving revision 1.7
diff -u -r1.7 sharp.c
--- drivers/mtd/chips/sharp.c 13 Feb 2002 15:49:07 -0000 1.7
+++ drivers/mtd/chips/sharp.c 16 May 2002 15:25:33 -0000
@@ -409,7 +409,10 @@
while(len){
ret = sharp_erase_oneblock(map, &sharp->chips[chipnum], adr);
- if(ret)return ret;
+ if(ret){
+ instr->state = MTD_ERASE_FAILED;
+ return ret;
+ }
adr += mtd->erasesize;
len -= mtd->erasesize;
@@ -421,6 +424,7 @@
}
}
+ instr->state = MTD_ERASE_DONE;
if(instr->callback)
instr->callback(instr);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: can't erase "sharp".
2002-05-16 16:17 can't erase "sharp" Takashi YOSHII
2002-05-16 16:12 ` Russ Dill
@ 2002-05-17 9:00 ` David Woodhouse
1 sibling, 0 replies; 3+ messages in thread
From: David Woodhouse @ 2002-05-17 9:00 UTC (permalink / raw)
To: Takashi YOSHII; +Cc: linux-mtd
takasi-y@ops.dti.ne.jp said:
> I'm using drivers/mtd/chip/sharp.c (I know it's "obsolete", though).
> And, found "eraseall" command doesn't work upon it. The operation
> stops at 0%, and the command never exit.
> I added few lines(see the patch below), and it works, perhaps... I'm
> not sure if it is correct (especially when signals received).
> Could someone tell me the right answer, please?
The second part of your patch was the correct one -- setting instr->state
to MTD_ERASE_DONE on completion. When the erase fails immediately, it's not
required to set instr->state to MTD_ERASE_FAILED. That's only necessary if
the chip driver does asynchronous operation, and returns from the erase
function before the operation has completed.
--
dwmw2
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-05-17 9:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-16 16:17 can't erase "sharp" Takashi YOSHII
2002-05-16 16:12 ` Russ Dill
2002-05-17 9:00 ` David Woodhouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox