Patchwork [1/1] mtd: OneNAND: fix bufferram management when chip has 2-planes.

login
register
mail settings
Submitter Enric Balletbò i Serra
Date Oct. 23, 2010, 1:43 p.m.
Message ID <1287841434-3349-2-git-send-email-eballetbo@gmail.com>
Download mbox | patch
Permalink /patch/69003/
State New
Headers show

Comments

Enric Balletbò i Serra - Oct. 23, 2010, 1:43 p.m.
This patch adds code that I think was lost when it was applied the commit
  5988af2319781bc8e0ce418affec4e09cfa77907 - mtd: Flex-OneNAND support

Test case:
 1. Stress a jffs2 filesystem using
    bonnie++ -u 0:0 -s 32 -m 16 -r 16
 2. dmesg shows various 'Header CRC failed' errors like:
    Header CRC failed on REF_PRISTINE node at 0x1e81315c: Read 0x000000e0,
    calculated 0x564fc9e8

Tested on IGEP v2 board with a Muxed OneNAND(DDP) 512MB 1.8V 16-bit (0x58)
with 2 planes from Numonyx and CONFIG_MTD_ONENAND_2X_PROGRAM set to y

Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com>
---
 drivers/mtd/onenand/onenand_base.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Artem Bityutskiy - Oct. 26, 2010, 9:36 a.m.
On Sat, 2010-10-23 at 15:43 +0200, Enric Balletbo i Serra wrote:
> This patch adds code that I think was lost when it was applied the commit
>   5988af2319781bc8e0ce418affec4e09cfa77907 - mtd: Flex-OneNAND support
> 
> Test case:
>  1. Stress a jffs2 filesystem using
>     bonnie++ -u 0:0 -s 32 -m 16 -r 16
>  2. dmesg shows various 'Header CRC failed' errors like:
>     Header CRC failed on REF_PRISTINE node at 0x1e81315c: Read 0x000000e0,
>     calculated 0x564fc9e8
> 
> Tested on IGEP v2 board with a Muxed OneNAND(DDP) 512MB 1.8V 16-bit (0x58)
> with 2 planes from Numonyx and CONFIG_MTD_ONENAND_2X_PROGRAM set to y
> 
> Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com>

Kyungmin, would be nice to have your ack/nack.
Kyungmin Park - Oct. 26, 2010, 10:29 a.m.
On Tue, Oct 26, 2010 at 6:36 PM, Artem Bityutskiy
<Artem.Bityutskiy@nokia.com> wrote:
> On Sat, 2010-10-23 at 15:43 +0200, Enric Balletbo i Serra wrote:
>> This patch adds code that I think was lost when it was applied the commit
>>   5988af2319781bc8e0ce418affec4e09cfa77907 - mtd: Flex-OneNAND support
>>
>> Test case:
>>  1. Stress a jffs2 filesystem using
>>     bonnie++ -u 0:0 -s 32 -m 16 -r 16
>>  2. dmesg shows various 'Header CRC failed' errors like:
>>     Header CRC failed on REF_PRISTINE node at 0x1e81315c: Read 0x000000e0,
>>     calculated 0x564fc9e8
>>
>> Tested on IGEP v2 board with a Muxed OneNAND(DDP) 512MB 1.8V 16-bit (0x58)
>> with 2 planes from Numonyx and CONFIG_MTD_ONENAND_2X_PROGRAM set to y
>>
>> Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com>
>
> Kyungmin, would be nice to have your ack/nack.
Sorry for late reply

One more check, it seems to use the invalidate instead of update bufferram.
In case of 2X PROGRAM, it always uses the BUFFERRAM0 so invalidate
another bufferram.

Don't set the bufferram index.

Thank you,
Kyungmin Park
>
> --
> Best Regards,
> Artem Bityutskiy (Артём Битюцкий)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

Patch

diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index a2bb520..53aa13e 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -1964,6 +1964,10 @@  static int onenand_write_ops_nolock(struct mtd_info *mtd, loff_t to,
 
 			/* In partial page write we don't update bufferram */
 			onenand_update_bufferram(mtd, to, !ret && !subpage);
+			ONENAND_SET_BUFFERRAM1(this);
+			onenand_update_bufferram(mtd, to + this->writesize,
+				!ret && !subpage);
+
 			if (ret) {
 				printk(KERN_ERR "%s: write failed %d\n",
 					__func__, ret);