public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] [MTD] NAND: Prevents NAND subsystem from hogging the CPU.
@ 2007-09-06 18:06 Rick Bronson
  2007-09-06 18:46 ` Jörn Engel
  2007-09-07  5:39 ` Artem Bityutskiy
  0 siblings, 2 replies; 3+ messages in thread
From: Rick Bronson @ 2007-09-06 18:06 UTC (permalink / raw)
  To: linux-mtd


  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@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);
 }

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

end of thread, other threads:[~2007-09-07  5:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-06 18:06 [PATCH] [MTD] NAND: Prevents NAND subsystem from hogging the CPU Rick Bronson
2007-09-06 18:46 ` Jörn Engel
2007-09-07  5:39 ` Artem Bityutskiy

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