Merge branch 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 16 Jan 2012 23:02:30 +0000 (15:02 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 16 Jan 2012 23:02:30 +0000 (15:02 -0800)
* 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  PM / Hibernate: Drop the check of swap space size for compressed image
  PM / shmobile: fix A3SP suspend method
  PM / Domains: Skip governor functions for CONFIG_PM_RUNTIME unset
  PM / Domains: Fix build for CONFIG_PM_SLEEP unset
  PM: Make sysrq-o be available for CONFIG_PM unset

arch/arm/mach-shmobile/pm-sh7372.c
drivers/base/power/domain.c
drivers/base/power/domain_governor.c
kernel/Makefile
kernel/power/swap.c

index 77b8fc12fc2f1ab0000ae734fff09624ba7cbf44..fcf8b1761aef723c6f3e5f3bd1f2b42cf436e04a 100644 (file)
@@ -276,7 +276,7 @@ static int sh7372_a3sp_suspend(void)
         * Serial consoles make use of SCIF hardware located in A3SP,
         * keep such power domain on if "no_console_suspend" is set.
         */
-       return console_suspend_enabled ? -EBUSY : 0;
+       return console_suspend_enabled ? 0 : -EBUSY;
 }
 
 struct sh7372_pm_domain sh7372_a3sp = {
index 92e6a9048065eb567f3d9c857e689c2b4667dd15..978bbf7ac6af03bb26eed17329d3a24f6bf5337e 100644 (file)
@@ -1429,6 +1429,8 @@ static int pm_genpd_default_restore_state(struct device *dev)
        return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
+
 /**
  * pm_genpd_default_suspend - Default "device suspend" for PM domians.
  * @dev: Device to handle.
@@ -1517,6 +1519,19 @@ static int pm_genpd_default_thaw(struct device *dev)
        return cb ? cb(dev) : pm_generic_thaw(dev);
 }
 
+#else /* !CONFIG_PM_SLEEP */
+
+#define pm_genpd_default_suspend       NULL
+#define pm_genpd_default_suspend_late  NULL
+#define pm_genpd_default_resume_early  NULL
+#define pm_genpd_default_resume                NULL
+#define pm_genpd_default_freeze                NULL
+#define pm_genpd_default_freeze_late   NULL
+#define pm_genpd_default_thaw_early    NULL
+#define pm_genpd_default_thaw          NULL
+
+#endif /* !CONFIG_PM_SLEEP */
+
 /**
  * pm_genpd_init - Initialize a generic I/O PM domain object.
  * @genpd: PM domain object to initialize.
index 51527ee92d101018680cd5b633265105a2952df1..66a265bf5867d1b516a03f34e8e50946db4c1e3e 100644 (file)
@@ -12,6 +12,8 @@
 #include <linux/pm_qos.h>
 #include <linux/hrtimer.h>
 
+#ifdef CONFIG_PM_RUNTIME
+
 /**
  * default_stop_ok - Default PM domain governor routine for stopping devices.
  * @dev: Device to check.
@@ -137,16 +139,28 @@ static bool default_power_down_ok(struct dev_pm_domain *pd)
        return true;
 }
 
-struct dev_power_governor simple_qos_governor = {
-       .stop_ok = default_stop_ok,
-       .power_down_ok = default_power_down_ok,
-};
-
 static bool always_on_power_down_ok(struct dev_pm_domain *domain)
 {
        return false;
 }
 
+#else /* !CONFIG_PM_RUNTIME */
+
+bool default_stop_ok(struct device *dev)
+{
+       return false;
+}
+
+#define default_power_down_ok  NULL
+#define always_on_power_down_ok        NULL
+
+#endif /* !CONFIG_PM_RUNTIME */
+
+struct dev_power_governor simple_qos_governor = {
+       .stop_ok = default_stop_ok,
+       .power_down_ok = default_power_down_ok,
+};
+
 /**
  * pm_genpd_gov_always_on - A governor implementing an always-on policy
  */
index f70396e5a24b8cef95d994ed612aca85beaaac92..2d9de86b7e767f518e59183a98bf4c04e0038813 100644 (file)
@@ -23,6 +23,7 @@ CFLAGS_REMOVE_irq_work.o = -pg
 endif
 
 obj-y += sched/
+obj-y += power/
 
 obj-$(CONFIG_FREEZER) += freezer.o
 obj-$(CONFIG_PROFILING) += profile.o
@@ -52,8 +53,6 @@ obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
 obj-$(CONFIG_UID16) += uid16.o
 obj-$(CONFIG_MODULES) += module.o
 obj-$(CONFIG_KALLSYMS) += kallsyms.o
-obj-$(CONFIG_PM) += power/
-obj-$(CONFIG_FREEZER) += power/
 obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
 obj-$(CONFIG_KEXEC) += kexec.o
 obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
index 3739ecced085db0141557feec608bb3eccbb0c07..8742fd013a94e3b56efdbf91cf27c709679615e4 100644 (file)
@@ -773,8 +773,7 @@ static int enough_swap(unsigned int nr_pages, unsigned int flags)
 
        pr_debug("PM: Free swap pages: %u\n", free_swap);
 
-       required = PAGES_FOR_IO + ((flags & SF_NOCOMPRESS_MODE) ?
-               nr_pages : (nr_pages * LZO_CMP_PAGES) / LZO_UNC_PAGES + 1);
+       required = PAGES_FOR_IO + nr_pages;
        return free_swap > required;
 }
 
@@ -802,10 +801,12 @@ int swsusp_write(unsigned int flags)
                printk(KERN_ERR "PM: Cannot get swap writer\n");
                return error;
        }
-       if (!enough_swap(pages, flags)) {
-               printk(KERN_ERR "PM: Not enough free swap\n");
-               error = -ENOSPC;
-               goto out_finish;
+       if (flags & SF_NOCOMPRESS_MODE) {
+               if (!enough_swap(pages, flags)) {
+                       printk(KERN_ERR "PM: Not enough free swap\n");
+                       error = -ENOSPC;
+                       goto out_finish;
+               }
        }
        memset(&snapshot, 0, sizeof(struct snapshot_handle));
        error = snapshot_read_next(&snapshot);