linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MMC: core/core.c: fixed: delayed_work was never cancelled
@ 2009-02-17 13:32 Jorg Schummer
  2009-02-18 20:19 ` Pierre Ossman
  0 siblings, 1 reply; 4+ messages in thread
From: Jorg Schummer @ 2009-02-17 13:32 UTC (permalink / raw)
  To: drzeus-mmc; +Cc: linux-kernel, Jorg Schummer

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@nokia.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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] MMC: core/core.c: fixed: delayed_work was never cancelled
  2009-02-17 13:32 [PATCH] MMC: core/core.c: fixed: delayed_work was never cancelled Jorg Schummer
@ 2009-02-18 20:19 ` Pierre Ossman
  2009-02-19 11:17   ` [PATCH][take 2] " Jorg Schummer
  0 siblings, 1 reply; 4+ messages in thread
From: Pierre Ossman @ 2009-02-18 20:19 UTC (permalink / raw)
  To: Jorg Schummer; +Cc: linux-kernel, Jorg Schummer

On Tue, 17 Feb 2009 15:32:10 +0200
Jorg Schummer <ext-jorg.2.schummer@nokia.com> wrote:

> 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@nokia.com>
> ---

Do the cancel in the caller instead. The flush routine is supposed to
mimic the global workqueue.

Rgds
-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  rdesktop, core developer          http://www.rdesktop.org

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH][take 2] MMC: core/core.c: fixed: delayed_work was never cancelled
  2009-02-18 20:19 ` Pierre Ossman
@ 2009-02-19 11:17   ` Jorg Schummer
  2009-02-21 16:11     ` Pierre Ossman
  0 siblings, 1 reply; 4+ messages in thread
From: Jorg Schummer @ 2009-02-19 11:17 UTC (permalink / raw)
  To: drzeus-mmc; +Cc: linux-kernel, Jorg Schummer

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@nokia.com>
---
 drivers/mmc/core/core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index df6ce4a..b5899e3 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -815,6 +815,7 @@ void mmc_stop_host(struct mmc_host *host)
 	spin_unlock_irqrestore(&host->lock, flags);
 #endif
 
+	cancel_delayed_work(&host->detect);
 	mmc_flush_scheduled_work();
 
 	mmc_bus_get(host);
@@ -842,6 +843,7 @@ void mmc_stop_host(struct mmc_host *host)
  */
 int mmc_suspend_host(struct mmc_host *host, pm_message_t state)
 {
+	cancel_delayed_work(&host->detect);
 	mmc_flush_scheduled_work();
 
 	mmc_bus_get(host);
-- 
1.5.4.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH][take 2] MMC: core/core.c: fixed: delayed_work was never cancelled
  2009-02-19 11:17   ` [PATCH][take 2] " Jorg Schummer
@ 2009-02-21 16:11     ` Pierre Ossman
  0 siblings, 0 replies; 4+ messages in thread
From: Pierre Ossman @ 2009-02-21 16:11 UTC (permalink / raw)
  To: Jorg Schummer; +Cc: linux-kernel, Jorg Schummer

On Thu, 19 Feb 2009 13:17:03 +0200
Jorg Schummer <ext-jorg.2.schummer@nokia.com> wrote:

> 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@nokia.com>
> ---

Queued, thanks.

Rgds
-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  rdesktop, core developer          http://www.rdesktop.org

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-21 16:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-17 13:32 [PATCH] MMC: core/core.c: fixed: delayed_work was never cancelled Jorg Schummer
2009-02-18 20:19 ` Pierre Ossman
2009-02-19 11:17   ` [PATCH][take 2] " Jorg Schummer
2009-02-21 16:11     ` Pierre Ossman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).