Skip to contentSkip to conversation

NAND: Prevents NAND subsystem from hogging the CPU.

PATCH In review Rick Bronson 3 participants 3 messages Sep 6, 2007 – Sep 7, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NAND: Prevents NAND subsystem from hogging the CPU.

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 <[email protected]>]
[Acked-by: Realname <realmail>]
Signed-off-by Realname <realmail>
drivers/mtd/nand/nand_base.c 2007-09-06 08:31:20.000000000 -0700 renamed from drivers/mtd/nand/nand_base.c 2007-09-06 07:46:18.000000000 -0700 +1 -0
diff -ruN mtd-2.6.orig/drivers/mtd/nand/nand_base.c mtd-2.6/drivers/mtd/nand/nand_base.c
@@ -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);
 }
#1 lore raw
Quoted 4 lines · Rick Bronson
[From: Rick Bronson <[email protected]>]
[Acked-by: Realname <realmail>]
Signed-off-by Realname <realmail>

Looks like whatever tool you used needs a bit of configuration.

Jörn

Signature · 4 lines
To announce that there must be no criticism of the President, or that we
are to stand by the President, right or wrong, is not only unpatriotic
and servile, but is morally treasonable to the American public.
-- Theodore Roosevelt, Kansas City Star, 1918
#2 lore raw
In reply to Rick Bronson
Quoted 7 lines · Rick Bronson
                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);

}

And I think this touch_softlockup_watchdog() is bogus.

Signature · 2 lines
Best regards,
Artem Bityutskiy (Битюцкий Артём)