Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
fix XEN_SAVE_RESTORE Kconfig dependencies
PM / Hibernate: Introduce CONFIG_HIBERNATE_CALLBACKS

+28 -28
+3 -3
arch/powerpc/kernel/ibmebus.c
··· 527 527 528 528 #endif /* !CONFIG_SUSPEND */ 529 529 530 - #ifdef CONFIG_HIBERNATION 530 + #ifdef CONFIG_HIBERNATE_CALLBACKS 531 531 532 532 static int ibmebus_bus_pm_freeze(struct device *dev) 533 533 { ··· 665 665 return ret; 666 666 } 667 667 668 - #else /* !CONFIG_HIBERNATION */ 668 + #else /* !CONFIG_HIBERNATE_CALLBACKS */ 669 669 670 670 #define ibmebus_bus_pm_freeze NULL 671 671 #define ibmebus_bus_pm_thaw NULL ··· 676 676 #define ibmebus_bus_pm_poweroff_noirq NULL 677 677 #define ibmebus_bus_pm_restore_noirq NULL 678 678 679 - #endif /* !CONFIG_HIBERNATION */ 679 + #endif /* !CONFIG_HIBERNATE_CALLBACKS */ 680 680 681 681 static struct dev_pm_ops ibmebus_bus_dev_pm_ops = { 682 682 .prepare = ibmebus_bus_pm_prepare,
+1
arch/x86/xen/Kconfig
··· 39 39 config XEN_SAVE_RESTORE 40 40 bool 41 41 depends on XEN 42 + select HIBERNATE_CALLBACKS 42 43 default y 43 44 44 45 config XEN_DEBUG_FS
+3 -3
drivers/amba/bus.c
··· 214 214 215 215 #endif /* !CONFIG_SUSPEND */ 216 216 217 - #ifdef CONFIG_HIBERNATION 217 + #ifdef CONFIG_HIBERNATE_CALLBACKS 218 218 219 219 static int amba_pm_freeze(struct device *dev) 220 220 { ··· 352 352 return ret; 353 353 } 354 354 355 - #else /* !CONFIG_HIBERNATION */ 355 + #else /* !CONFIG_HIBERNATE_CALLBACKS */ 356 356 357 357 #define amba_pm_freeze NULL 358 358 #define amba_pm_thaw NULL ··· 363 363 #define amba_pm_poweroff_noirq NULL 364 364 #define amba_pm_restore_noirq NULL 365 365 366 - #endif /* !CONFIG_HIBERNATION */ 366 + #endif /* !CONFIG_HIBERNATE_CALLBACKS */ 367 367 368 368 #ifdef CONFIG_PM 369 369
+3 -3
drivers/base/platform.c
··· 772 772 773 773 #endif /* !CONFIG_SUSPEND */ 774 774 775 - #ifdef CONFIG_HIBERNATION 775 + #ifdef CONFIG_HIBERNATE_CALLBACKS 776 776 777 777 static int platform_pm_freeze(struct device *dev) 778 778 { ··· 910 910 return ret; 911 911 } 912 912 913 - #else /* !CONFIG_HIBERNATION */ 913 + #else /* !CONFIG_HIBERNATE_CALLBACKS */ 914 914 915 915 #define platform_pm_freeze NULL 916 916 #define platform_pm_thaw NULL ··· 921 921 #define platform_pm_poweroff_noirq NULL 922 922 #define platform_pm_restore_noirq NULL 923 923 924 - #endif /* !CONFIG_HIBERNATION */ 924 + #endif /* !CONFIG_HIBERNATE_CALLBACKS */ 925 925 926 926 #ifdef CONFIG_PM_RUNTIME 927 927
+4 -4
drivers/base/power/main.c
··· 233 233 } 234 234 break; 235 235 #endif /* CONFIG_SUSPEND */ 236 - #ifdef CONFIG_HIBERNATION 236 + #ifdef CONFIG_HIBERNATE_CALLBACKS 237 237 case PM_EVENT_FREEZE: 238 238 case PM_EVENT_QUIESCE: 239 239 if (ops->freeze) { ··· 260 260 suspend_report_result(ops->restore, error); 261 261 } 262 262 break; 263 - #endif /* CONFIG_HIBERNATION */ 263 + #endif /* CONFIG_HIBERNATE_CALLBACKS */ 264 264 default: 265 265 error = -EINVAL; 266 266 } ··· 308 308 } 309 309 break; 310 310 #endif /* CONFIG_SUSPEND */ 311 - #ifdef CONFIG_HIBERNATION 311 + #ifdef CONFIG_HIBERNATE_CALLBACKS 312 312 case PM_EVENT_FREEZE: 313 313 case PM_EVENT_QUIESCE: 314 314 if (ops->freeze_noirq) { ··· 335 335 suspend_report_result(ops->restore_noirq, error); 336 336 } 337 337 break; 338 - #endif /* CONFIG_HIBERNATION */ 338 + #endif /* CONFIG_HIBERNATE_CALLBACKS */ 339 339 default: 340 340 error = -EINVAL; 341 341 }
+3 -3
drivers/pci/pci-driver.c
··· 781 781 782 782 #endif /* !CONFIG_SUSPEND */ 783 783 784 - #ifdef CONFIG_HIBERNATION 784 + #ifdef CONFIG_HIBERNATE_CALLBACKS 785 785 786 786 static int pci_pm_freeze(struct device *dev) 787 787 { ··· 970 970 return error; 971 971 } 972 972 973 - #else /* !CONFIG_HIBERNATION */ 973 + #else /* !CONFIG_HIBERNATE_CALLBACKS */ 974 974 975 975 #define pci_pm_freeze NULL 976 976 #define pci_pm_freeze_noirq NULL ··· 981 981 #define pci_pm_restore NULL 982 982 #define pci_pm_restore_noirq NULL 983 983 984 - #endif /* !CONFIG_HIBERNATION */ 984 + #endif /* !CONFIG_HIBERNATE_CALLBACKS */ 985 985 986 986 #ifdef CONFIG_PM_RUNTIME 987 987
+3 -3
drivers/xen/manage.c
··· 61 61 xen_mm_unpin_all(); 62 62 } 63 63 64 - #ifdef CONFIG_HIBERNATION 64 + #ifdef CONFIG_HIBERNATE_CALLBACKS 65 65 static int xen_suspend(void *data) 66 66 { 67 67 struct suspend_info *si = data; ··· 173 173 #endif 174 174 shutting_down = SHUTDOWN_INVALID; 175 175 } 176 - #endif /* CONFIG_HIBERNATION */ 176 + #endif /* CONFIG_HIBERNATE_CALLBACKS */ 177 177 178 178 struct shutdown_handler { 179 179 const char *command; ··· 202 202 { "poweroff", do_poweroff }, 203 203 { "halt", do_poweroff }, 204 204 { "reboot", do_reboot }, 205 - #ifdef CONFIG_HIBERNATION 205 + #ifdef CONFIG_HIBERNATE_CALLBACKS 206 206 { "suspend", do_suspend }, 207 207 #endif 208 208 {NULL, NULL},
+3 -8
include/linux/suspend.h
··· 249 249 extern int hibernate(void); 250 250 extern bool system_entering_hibernation(void); 251 251 #else /* CONFIG_HIBERNATION */ 252 + static inline void register_nosave_region(unsigned long b, unsigned long e) {} 253 + static inline void register_nosave_region_late(unsigned long b, unsigned long e) {} 252 254 static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } 253 255 static inline void swsusp_set_page_free(struct page *p) {} 254 256 static inline void swsusp_unset_page_free(struct page *p) {} ··· 299 297 300 298 extern struct mutex pm_mutex; 301 299 302 - #ifndef CONFIG_HIBERNATION 303 - static inline void register_nosave_region(unsigned long b, unsigned long e) 304 - { 305 - } 306 - static inline void register_nosave_region_late(unsigned long b, unsigned long e) 307 - { 308 - } 309 - 300 + #ifndef CONFIG_HIBERNATE_CALLBACKS 310 301 static inline void lock_system_sleep(void) {} 311 302 static inline void unlock_system_sleep(void) {} 312 303
+5 -1
kernel/power/Kconfig
··· 18 18 19 19 Turning OFF this setting is NOT recommended! If in doubt, say Y. 20 20 21 + config HIBERNATE_CALLBACKS 22 + bool 23 + 21 24 config HIBERNATION 22 25 bool "Hibernation (aka 'suspend to disk')" 23 26 depends on SWAP && ARCH_HIBERNATION_POSSIBLE 27 + select HIBERNATE_CALLBACKS 24 28 select LZO_COMPRESS 25 29 select LZO_DECOMPRESS 26 30 ---help--- ··· 89 85 90 86 config PM_SLEEP 91 87 def_bool y 92 - depends on SUSPEND || HIBERNATION || XEN_SAVE_RESTORE 88 + depends on SUSPEND || HIBERNATE_CALLBACKS 93 89 94 90 config PM_SLEEP_SMP 95 91 def_bool y