public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] cfi: Fixup of write errors on XIP
@ 2006-02-22 18:17 Korolev, Alexey
  2006-03-01 17:48 ` Alexey, Korolev
  0 siblings, 1 reply; 15+ messages in thread
From: Korolev, Alexey @ 2006-02-22 18:17 UTC (permalink / raw)
  To: linux-mtd

Hi all,
 
Here is fixup of issue I have seen on XIP configuration. 
Sometimes I received write errors with message "buffer write error
(status timeout)" on test  which did read write and erase on several
volumes at the same time.
 
I investigated the issue. 
The scenario of the issue is following:
 
1. do_write_buffer 
2. Waiting for write complete in xip_udelay
3. System Interrupt
4. Write suspend
5. Rescheduling
6. Block erasing by other process. ( This operation typically took
rather long time )
7. Complete, rescheduling 
8. Return to write (write is not complete due to suspend ). 
9. Check timeout. Time is up.
10. Error.
 
I made small fixup for these issue. Please see patch below.

Thanks,
Alexey

===================================================================
--- c/drivers/mtd/chips/cfi_cmdset_0001.c	2006-02-22
20:58:05.869203280 +0300
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c	2006-02-22
20:55:42.272033368 +0300
@@ -1571,6 +1571,7 @@
 	/* GO GO GO */
 	map_write(map, CMD(0xd0), cmd_adr);
 	chip->state = FL_WRITING;
+	chip->write_suspended = 0;
 
 	INVALIDATE_CACHE_UDELAY(map, chip, cmd_adr,
 				adr, len,
@@ -1592,6 +1593,12 @@
 			continue;
 		}
 
+		/* Somebody suspended write. We should reset timeo. */
+		if (chip->write_suspended) {
+			chip->write_suspended = 0;
+			timeo = jiffies + (HZ/2);
+		}
+		
 		status = map_read(map, cmd_adr);
 		if (map_word_andequal(map, status, status_OK,
status_OK))
 			break;
====================================================================

^ permalink raw reply	[flat|nested] 15+ messages in thread
* RE: [PATCH] cfi: Fixup of write errors on XIP
@ 2006-03-01 18:20 Korolev, Alexey
  2006-03-02 15:36 ` Nicolas Pitre
  0 siblings, 1 reply; 15+ messages in thread
From: Korolev, Alexey @ 2006-03-01 18:20 UTC (permalink / raw)
  To: Korolev, Alexey, linux-mtd, David Woodhouse, Nicolas Pitre

Hi all,

Several days ago I sent this patch to the list. I wonder are there any
objections to it?
I guess this patch shouldn't break anything. It just fixes write errors
I saw in our tests. The patch has been verified on several
configurations. 
If you don't mind I will commit it by the end of this week.

Thanks,
Alexey 

 
> Here is fixup of issue I have seen on XIP configuration. 
> Sometimes I received write errors with message "buffer write error
> (status timeout)" on test  which did read write and erase on several
> volumes at the same time.
> 
> I investigated the issue. 
> The scenario of the issue is following:
 
> 1. do_write_buffer 
> 2. Waiting for write complete in xip_udelay
> 3. System Interrupt
> 4. Write suspend
> 5. Rescheduling
> 6. Block erasing by other process. ( This operation typically took
> rather long time )
> 7. Complete, rescheduling 
> 8. Return to write (write is not complete due to suspend ). 
> 9. Check timeout. Time is up.
> 10. Error.
>  
> I made small fixup for these issue. Please see patch below.


===================================================================
--- c/drivers/mtd/chips/cfi_cmdset_0001.c	2006-02-22
20:58:05.869203280 +0300
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c	2006-02-22
20:55:42.272033368 +0300
@@ -1571,6 +1571,7 @@
 	/* GO GO GO */
 	map_write(map, CMD(0xd0), cmd_adr);
 	chip->state = FL_WRITING;
+	chip->write_suspended = 0;
 
 	INVALIDATE_CACHE_UDELAY(map, chip, cmd_adr,
 				adr, len,
@@ -1592,6 +1593,12 @@
 			continue;
 		}
 
+		/* Somebody suspended write. We should reset timeo. */
+		if (chip->write_suspended) {
+			chip->write_suspended = 0;
+			timeo = jiffies + (HZ/2);
+		}
+		
 		status = map_read(map, cmd_adr);
 		if (map_word_andequal(map, status, status_OK,
status_OK))
 			break;
====================================================================

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH]   cfi: Fixup of write errors on XIP
@ 2006-03-02 10:18 Korolev, Alexey
  0 siblings, 0 replies; 15+ messages in thread
From: Korolev, Alexey @ 2006-03-02 10:18 UTC (permalink / raw)
  To: linux-mtd

Hi all,

Several days ago I sent this patch to the list. I wonder are there any
objections to it?
I guess this patch shouldn't break anything. It just fixes write errors
I saw in our tests. The patch has been verified on several
configurations. 
If you don't mind I will commit it by the end of this week.

Thanks,
Alexey 

 
> Here is fixup of issue I have seen on XIP configuration. 
> Sometimes I received write errors with message "buffer write error
> (status timeout)" on test  which did read write and erase on several
> volumes at the same time.
> 
> I investigated the issue. 
> The scenario of the issue is following:
 
> 1. do_write_buffer 
> 2. Waiting for write complete in xip_udelay
> 3. System Interrupt
> 4. Write suspend
> 5. Rescheduling
> 6. Block erasing by other process. ( This operation typically took
> rather long time )
> 7. Complete, rescheduling 
> 8. Return to write (write is not complete due to suspend ). 
> 9. Check timeout. Time is up.
> 10. Error.
>  
> I made small fixup for these issue. Please see patch below.


===================================================================
--- c/drivers/mtd/chips/cfi_cmdset_0001.c	2006-02-22
20:58:05.869203280 +0300
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c	2006-02-22
20:55:42.272033368 +0300
@@ -1571,6 +1571,7 @@
 	/* GO GO GO */
 	map_write(map, CMD(0xd0), cmd_adr);
 	chip->state = FL_WRITING;
+	chip->write_suspended = 0;
 
 	INVALIDATE_CACHE_UDELAY(map, chip, cmd_adr,
 				adr, len,
@@ -1592,6 +1593,12 @@
 			continue;
 		}
 
+		/* Somebody suspended write. We should reset timeo. */
+		if (chip->write_suspended) {
+			chip->write_suspended = 0;
+			timeo = jiffies + (HZ/2);
+		}
+		
 		status = map_read(map, cmd_adr);
 		if (map_word_andequal(map, status, status_OK,
status_OK))
 			break;
====================================================================

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2006-03-30 14:38 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-22 18:17 [PATCH] cfi: Fixup of write errors on XIP Korolev, Alexey
2006-03-01 17:48 ` Alexey, Korolev
  -- strict thread matches above, loose matches on Subject: below --
2006-03-01 18:20 Korolev, Alexey
2006-03-02 15:36 ` Nicolas Pitre
2006-03-02 16:35   ` Alexey, Korolev
2006-03-10 16:36     ` Nicolas Pitre
2006-03-21 14:26       ` Alexey, Korolev
2006-03-21 15:10         ` Nicolas Pitre
2006-03-28 14:09           ` Alexey, Korolev
2006-03-29 16:34             ` Nicolas Pitre
2006-03-29 16:44               ` Nicolas Pitre
2006-03-30  2:54               ` Nicolas Pitre
2006-03-30 13:27                 ` Alexey, Korolev
2006-03-30 14:38                   ` Nicolas Pitre
2006-03-02 10:18 Korolev, Alexey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox