tree affdbc2dbf1cf7058331e1bdbf70d1b6c8384ce8
parent 1a78ff6b4114cfb0f734b7df217759315d692683
author Todd Poynor <[EMAIL PROTECTED]> Tue, 29 Mar 2005 23:06:40 +0100
committer Thomas Gleixner <[EMAIL PROTECTED]> Mon, 23 May 2005 13:05:37 +0200

[MTD] cfi_cmdset_0001: Skip delay if Instant Block Locking is set

Skip jiffy delay after each block lock/unlock for Intel CFI flash
with the "Instant Individual Block Locking" feature bit set.

Signed-off-by: Todd Poynor <[EMAIL PROTECTED]>
Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>

 drivers/mtd/chips/cfi_cmdset_0001.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c 
b/drivers/mtd/chips/cfi_cmdset_0001.c
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -4,7 +4,7 @@
  *
  * (C) 2000 Red Hat. GPL'd
  *
- * $Id: cfi_cmdset_0001.c,v 1.171 2005/03/19 22:39:49 gleixner Exp $
+ * $Id: cfi_cmdset_0001.c,v 1.172 2005/03/29 22:06:37 tpoynor Exp $
  *
  * 
  * 10/10/2000  Nicolas Pitre <[EMAIL PROTECTED]>
@@ -1823,6 +1823,7 @@ static int __xipram do_xxlock_oneblock(s
                                       unsigned long adr, int len, void *thunk)
 {
        struct cfi_private *cfi = map->fldrv_priv;
+       struct cfi_pri_intelext *extp = cfi->cmdset_priv;
        map_word status, status_OK;
        unsigned long timeo = jiffies + HZ;
        int ret;
@@ -1852,9 +1853,16 @@ static int __xipram do_xxlock_oneblock(s
        } else
                BUG();
 
-       spin_unlock(chip->mutex);
-       UDELAY(map, chip, adr, 1000000/HZ);
-       spin_lock(chip->mutex);
+       /*
+        * If Instant Individual Block Locking supported then no need
+        * to delay.
+        */
+
+       if (!extp || !(extp->FeatureSupport & (1 << 5))) {
+               spin_unlock(chip->mutex);
+               UDELAY(map, chip, adr, 1000000/HZ);
+               spin_lock(chip->mutex);
+       }
 
        /* FIXME. Use a timer to check this, and return immediately. */
        /* Once the state machine's known to be working I'll do that */
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to