[PATCH] [MTD] NAND: Prevents NAND subsystem from hogging the CPU.

Rick Bronson rick at efn.org
Thu Sep 6 14:06:22 EDT 2007


  This is my first patch for mtd so bear with me...  sorry if I missed
something.

[PATCH] [MTD] NAND: Prevents NAND subsystem from hogging the
CPU waiting for ready line.

This patch prevents the nand_wait_ready chip from using too much
CPU time.  This was causing very long thread latencies.  The
solution, which is used elsewhere in this same file, is to call
cond_resched() in the wait loop.

[From: Rick Bronson <rick at efn.org>]
[Acked-by: Realname <realmail>]
Signed-off-by: Realname <realmail>


diff -ruN mtd-2.6.orig/drivers/mtd/nand/nand_base.c mtd-2.6/drivers/mtd/nand/nand_base.c
--- mtd-2.6.orig/drivers/mtd/nand/nand_base.c   2007-09-06 07:46:18.000000000 -0700
+++ mtd-2.6/drivers/mtd/nand/nand_base.c        2007-09-06 08:31:20.000000000 -0700
@@ -429,6 +429,7 @@
                if (chip->dev_ready(mtd))
                        break;
                touch_softlockup_watchdog();
+               cond_resched();  /* let others run */
        } while (time_before(jiffies, timeo));
        led_trigger_event(nand_led_trigger, LED_OFF);
 }



More information about the linux-mtd mailing list