diff options
author | Pierre Ossman <drzeus@drzeus.cx> | 2008-08-31 07:38:54 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2008-10-12 05:04:28 -0400 |
commit | e633b7bcec8e26991d489a11615acf7674efbaf4 (patch) | |
tree | b26362cc8a0695876b28c5dd52bd3a6812fe745a /drivers/mmc/core | |
parent | 04cf585d2902404ed06861c6dc27897100340dba (diff) |
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>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r-- | drivers/mmc/core/sdio_irq.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c index c292e124107a..722924cdf595 100644 --- a/drivers/mmc/core/sdio_irq.c +++ b/drivers/mmc/core/sdio_irq.c | |||
@@ -5,6 +5,8 @@ | |||
5 | * Created: June 18, 2007 | 5 | * Created: June 18, 2007 |
6 | * Copyright: MontaVista Software Inc. | 6 | * Copyright: MontaVista Software Inc. |
7 | * | 7 | * |
8 | * Copyright 2008 Pierre Ossman | ||
9 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 2 of the License, or (at | 12 | * the Free Software Foundation; either version 2 of the License, or (at |
@@ -107,11 +109,14 @@ static int sdio_irq_thread(void *_host) | |||
107 | 109 | ||
108 | /* | 110 | /* |
109 | * Give other threads a chance to run in the presence of | 111 | * Give other threads a chance to run in the presence of |
110 | * errors. FIXME: determine if due to card removal and | 112 | * errors. |
111 | * possibly exit this thread if so. | ||
112 | */ | 113 | */ |
113 | if (ret < 0) | 114 | if (ret < 0) { |
114 | ssleep(1); | 115 | set_current_state(TASK_INTERRUPTIBLE); |
116 | if (!kthread_should_stop()) | ||
117 | schedule_timeout(HZ); | ||
118 | set_current_state(TASK_RUNNING); | ||
119 | } | ||
115 | 120 | ||
116 | /* | 121 | /* |
117 | * Adaptive polling frequency based on the assumption | 122 | * Adaptive polling frequency based on the assumption |