* [PATCH] CFI cmdset_0001 A small fixup of wrong cache invalidation regions.
@ 2006-01-31 16:16 Korolev, Alexey
2006-02-08 16:18 ` [PATCH] CFI cmdset_0001 A small fixup of wrong cache invalidationregions Alexey, Korolev
0 siblings, 1 reply; 3+ messages in thread
From: Korolev, Alexey @ 2006-01-31 16:16 UTC (permalink / raw)
To: linux-mtd
Hi all,
I found issue in cfi_cmdset0001.c. It related to setting up of cache
regions for invalidating in buffered write porcedure.
Code performs cache invalidation from "cmd_addr" to "cmd_adr + len" in
do_write_buffer function. In fact we modify region from "adr" to
"adr+len".
The issue affects when you try to write and read data by small chunks.
This case you may catch read errors on SND configurations.
I made fix for it. Please take a look at the patch.
=================================================================
--- b/drivers/mtd/chips/cfi_cmdset_0001.c 2006-01-26 18:59:52.000000000
+0300
+++ a/drivers/mtd/chips/cfi_cmdset_0001.c 2006-01-31 18:56:01.315227496
+0300
@@ -1019,8 +1019,8 @@
#define XIP_INVAL_CACHED_RANGE(map, from, size) \
INVALIDATE_CACHED_RANGE(map, from, size)
-#define INVALIDATE_CACHE_UDELAY(map, chip, adr, len, usec) \
- UDELAY(map, chip, adr, usec)
+#define INVALIDATE_CACHE_UDELAY(map, chip, cmd_adr, adr, len, usec) \
+ UDELAY(map, chip, cmd_adr, usec)
/*
* Extra notes:
@@ -1052,7 +1052,7 @@
spin_lock(chip->mutex); \
} while (0)
-#define INVALIDATE_CACHE_UDELAY(map, chip, adr, len, usec) \
+#define INVALIDATE_CACHE_UDELAY(map, chip, cmd_adr, adr, len, usec) \
do { \
spin_unlock(chip->mutex); \
INVALIDATE_CACHED_RANGE(map, adr, len); \
@@ -1284,7 +1284,7 @@
map_write(map, datum, adr);
chip->state = mode;
- INVALIDATE_CACHE_UDELAY(map, chip,
+ INVALIDATE_CACHE_UDELAY(map, chip, adr,
adr, map_bankwidth(map),
chip->word_write_time);
@@ -1572,8 +1572,8 @@
map_write(map, CMD(0xd0), cmd_adr);
chip->state = FL_WRITING;
- INVALIDATE_CACHE_UDELAY(map, chip,
- cmd_adr, len,
+ INVALIDATE_CACHE_UDELAY(map, chip, cmd_adr,
+ adr, len,
chip->buffer_write_time);
timeo = jiffies + (HZ/2);
@@ -1749,7 +1749,7 @@
chip->state = FL_ERASING;
chip->erase_suspended = 0;
- INVALIDATE_CACHE_UDELAY(map, chip,
+ INVALIDATE_CACHE_UDELAY(map, chip, adr,
adr, len,
chip->erase_time*1000/2);
=====================================================
Thanks,
Alexey
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] CFI cmdset_0001 A small fixup of wrong cache invalidationregions.
2006-01-31 16:16 [PATCH] CFI cmdset_0001 A small fixup of wrong cache invalidation regions Korolev, Alexey
@ 2006-02-08 16:18 ` Alexey, Korolev
2006-02-08 16:48 ` Nicolas Pitre
0 siblings, 1 reply; 3+ messages in thread
From: Alexey, Korolev @ 2006-02-08 16:18 UTC (permalink / raw)
To: jwboyer, dwmw2; +Cc: linux-mtd
David, Josh
Would you please review this patch.
This small patch shouldn't break anything. It just fixes read error
issues found by our test engine.
If you found it acceptable I would be much appreciate if you commit it
into CVS repository.
Please see details and patch below.
Thanks,
Alexey
> Hi all,
>
> I found issue in cfi_cmdset0001.c. It related to setting up of cache
> regions for invalidating in buffered write porcedure.
> Code performs cache invalidation from "cmd_addr" to "cmd_adr + len" in
> do_write_buffer function. In fact we modify region from "adr" to
> "adr+len".
> The issue affects when you try to write and read data by small chunks.
> This case you may catch read errors on SND configurations.
>
> I made fix for it. Please take a look at the patch.
> =================================================================
> --- b/drivers/mtd/chips/cfi_cmdset_0001.c 2006-01-26 18:59:52.000000000
> +0300
> +++ a/drivers/mtd/chips/cfi_cmdset_0001.c 2006-01-31 18:56:01.315227496
> +0300
> @@ -1019,8 +1019,8 @@
> #define XIP_INVAL_CACHED_RANGE(map, from, size) \
> INVALIDATE_CACHED_RANGE(map, from, size)
>
> -#define INVALIDATE_CACHE_UDELAY(map, chip, adr, len, usec) \
> - UDELAY(map, chip, adr, usec)
> +#define INVALIDATE_CACHE_UDELAY(map, chip, cmd_adr, adr, len, usec) \
> + UDELAY(map, chip, cmd_adr, usec)
>
> /*
> * Extra notes:
> @@ -1052,7 +1052,7 @@
> spin_lock(chip->mutex); \
> } while (0)
>
> -#define INVALIDATE_CACHE_UDELAY(map, chip, adr, len, usec) \
> +#define INVALIDATE_CACHE_UDELAY(map, chip, cmd_adr, adr, len, usec) \
> do { \
> spin_unlock(chip->mutex); \
> INVALIDATE_CACHED_RANGE(map, adr, len); \
> @@ -1284,7 +1284,7 @@
> map_write(map, datum, adr);
> chip->state = mode;
>
> - INVALIDATE_CACHE_UDELAY(map, chip,
> + INVALIDATE_CACHE_UDELAY(map, chip, adr,
> adr, map_bankwidth(map),
> chip->word_write_time);
>
> @@ -1572,8 +1572,8 @@
> map_write(map, CMD(0xd0), cmd_adr);
> chip->state = FL_WRITING;
>
> - INVALIDATE_CACHE_UDELAY(map, chip,
> - cmd_adr, len,
> + INVALIDATE_CACHE_UDELAY(map, chip, cmd_adr,
> + adr, len,
> chip->buffer_write_time);
>
> timeo = jiffies + (HZ/2);
> @@ -1749,7 +1749,7 @@
> chip->state = FL_ERASING;
> chip->erase_suspended = 0;
>
> - INVALIDATE_CACHE_UDELAY(map, chip,
> + INVALIDATE_CACHE_UDELAY(map, chip, adr,
> adr, len,
> chip->erase_time*1000/2);
>
> =====================================================
>
> Thanks,
> Alexey
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-02-08 16:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-31 16:16 [PATCH] CFI cmdset_0001 A small fixup of wrong cache invalidation regions Korolev, Alexey
2006-02-08 16:18 ` [PATCH] CFI cmdset_0001 A small fixup of wrong cache invalidationregions Alexey, Korolev
2006-02-08 16:48 ` Nicolas Pitre
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox