All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/mmc/mmc.c: Replacing yield() with a better alternative
@ 2006-10-11 12:57 ` Amol Lad
  0 siblings, 0 replies; 20+ messages in thread
From: Amol Lad @ 2006-10-11 12:45 UTC (permalink / raw)
  To: linux kernel; +Cc: kernel Janitors

In 2.6, the semantics of calling yield() changed from "sleep for a
bit" to "I really don't want to run for a while".  This matches POSIX
better, but there's a lot of drivers still using yield() when they mean
cond_resched(), schedule() or even schedule_timeout().

For this driver cond_resched() seems to be a better
alternative

Tested compile only

Signed-off-by: Amol Lad <amol@verismonetworks.com>
---
diff -uprN -X linux-2.6.19-rc1-orig/Documentation/dontdiff linux-2.6.19-rc1-orig/drivers/mmc/mmc.c linux-2.6.19-rc1/drivers/mmc/mmc.c
--- linux-2.6.19-rc1-orig/drivers/mmc/mmc.c	2006-10-05 14:00:46.000000000 +0530
+++ linux-2.6.19-rc1/drivers/mmc/mmc.c	2006-10-11 17:57:02.000000000 +0530
@@ -454,7 +454,7 @@ static void mmc_deselect_cards(struct mm
 static inline void mmc_delay(unsigned int ms)
 {
 	if (ms < HZ / 1000) {
-		yield();
+		cond_resched();
 		mdelay(ms);
 	} else {
 		msleep_interruptible (ms);



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

end of thread, other threads:[~2006-10-22 20:24 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-11 12:45 [PATCH] drivers/mmc/mmc.c: Replacing yield() with a better alternative Amol Lad
2006-10-11 12:57 ` [KJ] [PATCH] drivers/mmc/mmc.c: Replacing yield() with a Amol Lad
2006-10-11 12:58 ` Arjan van de Ven
2006-10-11 12:58   ` [PATCH] drivers/mmc/mmc.c: Replacing yield() with a better alternative Arjan van de Ven
2006-10-11 14:16   ` [KJ] most users of msleep_interruptible are broken Matthew Wilcox
2006-10-11 14:16     ` Matthew Wilcox
2006-10-11 14:20     ` [KJ] " Pierre Ossman
2006-10-11 14:20       ` Pierre Ossman
2006-10-11 14:53       ` [KJ] " Arjan van de Ven
2006-10-11 14:53         ` Arjan van de Ven
2006-10-11 15:07         ` [KJ] " Pierre Ossman
2006-10-11 15:07           ` Pierre Ossman
2006-10-11 20:30     ` [KJ] " Pavel Machek
2006-10-11 20:30       ` Pavel Machek
2006-10-12  5:54   ` [KJ] [PATCH] drivers/mmc/mmc.c: Replacing yield() with a Nick Piggin
2006-10-12  5:54     ` [PATCH] drivers/mmc/mmc.c: Replacing yield() with a better alternative Nick Piggin
2006-10-16  6:49     ` [KJ] [PATCH] drivers/mmc/mmc.c: Replacing yield() with a Pierre Ossman
2006-10-16  6:49       ` [PATCH] drivers/mmc/mmc.c: Replacing yield() with a better alternative Pierre Ossman
2006-10-22 20:23 ` [KJ] [PATCH] drivers/mmc/mmc.c: Replacing yield() with a Pierre Ossman
2006-10-22 20:23   ` [PATCH] drivers/mmc/mmc.c: Replacing yield() with a better alternative Pierre Ossman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.