public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/mmc/mmc.c: Replacing yield() with a better alternative
@ 2006-10-11 12:45 Amol Lad
  2006-10-11 12:58 ` Arjan van de Ven
  2006-10-22 20:23 ` Pierre Ossman
  0 siblings, 2 replies; 10+ 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] 10+ messages in thread

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

Thread overview: 10+ 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:58 ` Arjan van de Ven
2006-10-11 14:16   ` most users of msleep_interruptible are broken Matthew Wilcox
2006-10-11 14:20     ` Pierre Ossman
2006-10-11 14:53       ` Arjan van de Ven
2006-10-11 15:07         ` Pierre Ossman
2006-10-11 20:30     ` Pavel Machek
2006-10-12  5:54   ` [PATCH] drivers/mmc/mmc.c: Replacing yield() with a better alternative Nick Piggin
2006-10-16  6:49     ` Pierre Ossman
2006-10-22 20:23 ` Pierre Ossman

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