Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sdio: make sleep on error interruptable

Make sure we can be woken from the forced sleep that is done on errors.
Removing a card often results in -ENOMEDIUM or -EILSEQ so we previously
locked up the removal process for a second.

We could completely exit on -ENOMEDIUM, but it might be a transient
glitch so treat it like any other error.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>

+9 -4
+9 -4
drivers/mmc/core/sdio_irq.c
··· 5 5 * Created: June 18, 2007 6 6 * Copyright: MontaVista Software Inc. 7 7 * 8 + * Copyright 2008 Pierre Ossman 9 + * 8 10 * This program is free software; you can redistribute it and/or modify 9 11 * it under the terms of the GNU General Public License as published by 10 12 * the Free Software Foundation; either version 2 of the License, or (at ··· 109 107 110 108 /* 111 109 * Give other threads a chance to run in the presence of 112 - * errors. FIXME: determine if due to card removal and 113 - * possibly exit this thread if so. 110 + * errors. 114 111 */ 115 - if (ret < 0) 116 - ssleep(1); 112 + if (ret < 0) { 113 + set_current_state(TASK_INTERRUPTIBLE); 114 + if (!kthread_should_stop()) 115 + schedule_timeout(HZ); 116 + set_current_state(TASK_RUNNING); 117 + } 117 118 118 119 /* 119 120 * Adaptive polling frequency based on the assumption