]> git.baikalelectronics.ru Git - kernel.git/commit
[MTD] [OneNAND] fix numerous races
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 21 Sep 2007 16:35:21 +0000 (19:35 +0300)
committerDavid Woodhouse <dwmw2@infradead.org>
Sun, 23 Sep 2007 18:58:52 +0000 (19:58 +0100)
commitedb9249853ce82d33edc8c8997052d28597ffc00
tree8d7a38e54d6f07e42b953478437fa6a535f4e723
parent85d050dcc2fd36016d33743e883f29b834bbc1c4
[MTD] [OneNAND] fix numerous races

This patch make the OneNAND driver much less racy. It fixes
our "onenand_wait: read timeout!" heisenbugs. The reason of
these bugs was that the driver did not lock the chip when
accessing OTP, and it screwed up OneNAND state when the OTP
was read while JFFS2 was doing FS checking.

This patch also fixes other races I spotted:
1. BBT was not protected
2. Access to ecc_stats was not protected

Now the chip is locked when BBT is accessed.

To fix all of these I basically split all interface functions
on 'function()' and 'function_nolock()' parts.

I tested this patch on N800 hardware - it fixes our problems.
But I tested a little different version because our OneNAND
codebase is slightly out-of-date. But it should be OK.

This patch also includes the prin fixes I posted before.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
drivers/mtd/onenand/onenand_base.c