PATCH: solving a hang while waiting in FL_STATUS

Abel Bernabeu abelbg at m2grp.com
Wed Apr 23 12:35:11 EDT 2008


2008/4/23, Alexey Korolev <akorolev at infradead.org>:
> Hi David,
>
>
>  > > I am experimenting an infinite loop problem happening at
>  > > cfi_cmdset_0001.c:chip_ready.
>  > >
>  > > Some kind of timeout while waiting  in FL_STATUS should be included.
>  > > Indeed, this timeout feature is not new at all.
>  > >
>  > > The feature was present in 2.6.23.17 but disappeared in 2.6.24 (after
>  > > some refactoring work easily perceptible).
>  >
>  > Hm. This was removed in commit 5a37cf19:
>  >       Fix deadlock in Intel chip driver caused by get_chip recursion
>  >
>  > Alexey, can you explain why you removed it? Abel's patch simply adds
>  > this back where it was. That looks reasonable to me, so I'd like to know
>  > if I've missed some reason why it shouldn't be there...
>  >
>  >
>
> Yes. I can explain. I removed it because just simple adding timeout
>  won't work. Please look at the code after patch applying (solving a hang while waiting in FL_STATUS). Time_after will never occur:


Alexey, you are rigth... the patch did nothing, but the attached one
does the correct thing (discard the previous one).

Believe me, it is not a good idea to return -EAGAIN and let get_chip
to iterate forever (was my case).

I have added a timeout parameter to get_chip. It is a dirty solution
but I cannot redesign that piece of code since I did not wrote it and
I could introduce serious bugs.

Image you have a broken sector which will never respond... that could
hang the process while unlocking the sectors of a partition. In my
case the problem prevents our board to complete the kernel start-up.

Yours, Abel.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chip_ready.patch
Type: text/x-patch
Size: 3322 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-mtd/attachments/20080423/e7bd5a4a/attachment.bin 


More information about the linux-mtd mailing list