Revert "drivers: power: Add watchdog timer to catch drivers which lockup during suspend."
author黄涛 <huangtao@rock-chips.com>
Sat, 30 Jul 2011 14:31:35 +0000 (22:31 +0800)
committer黄涛 <huangtao@rock-chips.com>
Sat, 30 Jul 2011 14:31:35 +0000 (22:31 +0800)
This reverts commit d20c38c796134b43b46dc97faf9d09d3df437041.

Conflicts:

drivers/base/power/main.c

drivers/base/power/main.c

index 0855a10337ee00f6b8d2c526d82d3c8695c7380a..8aa2443182d517ddec760d594f8781029a3e9fe5 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/resume-trace.h>
 #include <linux/rwsem.h>
 #include <linux/interrupt.h>
-#include <linux/timer.h>
 
 #include "../base.h"
 #include "power.h"
@@ -44,13 +43,6 @@ LIST_HEAD(dpm_list);
 
 static DEFINE_MUTEX(dpm_list_mtx);
 
-static void dpm_drv_timeout(unsigned long data);
-static DEFINE_TIMER(dpm_drv_wd, dpm_drv_timeout, 0, 0);
-static struct {
-       struct device *dev;
-       struct task_struct *tsk;
-} dpm_drv_wd_data;
-
 /*
  * Set once the preparation of devices for a PM transition has started, reset
  * before starting to resume devices.  Protected by dpm_list_mtx.
@@ -439,52 +431,6 @@ static int device_resume(struct device *dev, pm_message_t state)
        return error;
 }
 
-/**
- *     dpm_drv_timeout - Driver suspend / resume watchdog handler
- *     @data: struct device which timed out
- *
- *     Called when a driver has timed out suspending or resuming.
- *     There's not much we can do here to recover so
- *     BUG() out for a crash-dump
- *
- */
-static void dpm_drv_timeout(unsigned long data)
-{
-       struct device *dev = dpm_drv_wd_data.dev;
-       struct task_struct *tsk = dpm_drv_wd_data.tsk;
-
-       printk(KERN_EMERG "**** DPM device timeout: %s (%s)\n", dev_name(dev),
-              (dev->driver ? dev->driver->name : "no driver"));
-
-       printk(KERN_EMERG "dpm suspend stack:\n");
-       show_stack(tsk, NULL);
-
-       BUG();
-}
-
-/**
- *     dpm_drv_wdset - Sets up driver suspend/resume watchdog timer.
- *     @dev: struct device which we're guarding.
- *
- */
-static void dpm_drv_wdset(struct device *dev)
-{
-       dpm_drv_wd_data.dev = dev;
-       dpm_drv_wd_data.tsk = get_current();
-       dpm_drv_wd.data = (unsigned long) &dpm_drv_wd_data;
-       mod_timer(&dpm_drv_wd, jiffies + (HZ * 3));
-}
-
-/**
- *     dpm_drv_wdclr - clears driver suspend/resume watchdog timer.
- *     @dev: struct device which we're no longer guarding.
- *
- */
-static void dpm_drv_wdclr(struct device *dev)
-{
-       del_timer_sync(&dpm_drv_wd);
-}
-
 /**
  * dpm_resume - Execute "resume" callbacks for non-sysdev devices.
  * @state: PM transition of the system being carried out.
@@ -743,9 +689,7 @@ static int dpm_suspend(pm_message_t state)
                get_device(dev);
                mutex_unlock(&dpm_list_mtx);
 
-               dpm_drv_wdset(dev);
                error = device_suspend(dev, state);
-               dpm_drv_wdclr(dev);
 
                mutex_lock(&dpm_list_mtx);
                if (error) {