From e633b7bcec8e26991d489a11615acf7674efbaf4 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Sun, 31 Aug 2008 13:38:54 +0200 Subject: 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 --- drivers/mmc/core/sdio_irq.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'drivers/mmc/core/sdio_irq.c') diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c index c292e124107..722924cdf59 100644 --- a/drivers/mmc/core/sdio_irq.c +++ b/drivers/mmc/core/sdio_irq.c @@ -5,6 +5,8 @@ * Created: June 18, 2007 * Copyright: MontaVista Software Inc. * + * Copyright 2008 Pierre Ossman + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at @@ -107,11 +109,14 @@ static int sdio_irq_thread(void *_host) /* * Give other threads a chance to run in the presence of - * errors. FIXME: determine if due to card removal and - * possibly exit this thread if so. + * errors. */ - if (ret < 0) - ssleep(1); + if (ret < 0) { + set_current_state(TASK_INTERRUPTIBLE); + if (!kthread_should_stop()) + schedule_timeout(HZ); + set_current_state(TASK_RUNNING); + } /* * Adaptive polling frequency based on the assumption -- cgit v1.2.3 From 6501ff604a5ae18697c9b4cd40a7738d3a68e7fe Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Sun, 31 Aug 2008 13:42:00 +0200 Subject: sdio: give sdio irq thread a host specific name There is one thread per host controller so make sure they all get unique names. Signed-off-by: Pierre Ossman --- drivers/mmc/core/sdio_irq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/mmc/core/sdio_irq.c') diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c index 722924cdf59..bb192f90e8e 100644 --- a/drivers/mmc/core/sdio_irq.c +++ b/drivers/mmc/core/sdio_irq.c @@ -159,7 +159,8 @@ static int sdio_card_irq_get(struct mmc_card *card) if (!host->sdio_irqs++) { atomic_set(&host->sdio_irq_thread_abort, 0); host->sdio_irq_thread = - kthread_run(sdio_irq_thread, host, "ksdiorqd"); + kthread_run(sdio_irq_thread, host, "ksdioirqd/%s", + mmc_hostname(host)); if (IS_ERR(host->sdio_irq_thread)) { int err = PTR_ERR(host->sdio_irq_thread); host->sdio_irqs--; -- cgit v1.2.3