[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1234877530-28490-1-git-send-email-ext-jorg.2.schummer@nokia.com>
Date: Tue, 17 Feb 2009 15:32:10 +0200
From: Jorg Schummer <ext-jorg.2.schummer@...ia.com>
To: drzeus-mmc@...eus.cx
Cc: linux-kernel@...r.kernel.org,
Jorg Schummer <ext-jorg.2.schummer@...ia.com>
Subject: [PATCH] MMC: core/core.c: fixed: delayed_work was never cancelled
The delayed work item mmc_host.detect is now cancelled before flushing
the work queue. This takes care of cases when delayed_work was scheduled
for mmc_host.detect, but not yet placed in the work queue.
Signed-off-by: Jorg Schummer <ext-jorg.2.schummer@...ia.com>
---
drivers/mmc/core/core.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index f7284b9..2ffae3d 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -57,8 +57,9 @@ static int mmc_schedule_delayed_work(struct delayed_work *work,
/*
* Internal function. Flush all scheduled work from the MMC work queue.
*/
-static void mmc_flush_scheduled_work(void)
+static void mmc_flush_scheduled_work(struct mmc_host *host)
{
+ cancel_delayed_work(&host->detect);
flush_workqueue(workqueue);
}
@@ -738,7 +739,7 @@ void mmc_stop_host(struct mmc_host *host)
spin_unlock_irqrestore(&host->lock, flags);
#endif
- mmc_flush_scheduled_work();
+ mmc_flush_scheduled_work(host);
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead) {
@@ -765,7 +766,7 @@ void mmc_stop_host(struct mmc_host *host)
*/
int mmc_suspend_host(struct mmc_host *host, pm_message_t state)
{
- mmc_flush_scheduled_work();
+ mmc_flush_scheduled_work(host);
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead) {
--
1.5.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists