aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/console.c4
-rw-r--r--kernel/power/power.h16
-rw-r--r--kernel/power/swsusp.c6
3 files changed, 5 insertions, 21 deletions
diff --git a/kernel/power/console.c b/kernel/power/console.c
index 579d239d129f..623786d44159 100644
--- a/kernel/power/console.c
+++ b/kernel/power/console.c
@@ -9,7 +9,9 @@
9#include <linux/console.h> 9#include <linux/console.h>
10#include "power.h" 10#include "power.h"
11 11
12#ifdef SUSPEND_CONSOLE 12#if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
13#define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1)
14
13static int orig_fgconsole, orig_kmsg; 15static int orig_fgconsole, orig_kmsg;
14 16
15int pm_prepare_console(void) 17int pm_prepare_console(void)
diff --git a/kernel/power/power.h b/kernel/power/power.h
index d8f0d1a76bae..388dba680841 100644
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -1,14 +1,6 @@
1#include <linux/suspend.h> 1#include <linux/suspend.h>
2#include <linux/utsname.h> 2#include <linux/utsname.h>
3 3
4/* With SUSPEND_CONSOLE defined suspend looks *really* cool, but
5 we probably do not take enough locks for switching consoles, etc,
6 so bad things might happen.
7*/
8#if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
9#define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1)
10#endif
11
12struct swsusp_info { 4struct swsusp_info {
13 struct new_utsname uts; 5 struct new_utsname uts;
14 u32 version_code; 6 u32 version_code;
@@ -42,14 +34,6 @@ static struct subsys_attribute _name##_attr = { \
42 34
43extern struct subsystem power_subsys; 35extern struct subsystem power_subsys;
44 36
45#ifdef SUSPEND_CONSOLE
46extern int pm_prepare_console(void);
47extern void pm_restore_console(void);
48#else
49static int pm_prepare_console(void) { return 0; }
50static void pm_restore_console(void) {}
51#endif
52
53/* References to section boundaries */ 37/* References to section boundaries */
54extern const void __nosave_begin, __nosave_end; 38extern const void __nosave_begin, __nosave_end;
55 39
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
index 59c91c148e82..4e90905f0e87 100644
--- a/kernel/power/swsusp.c
+++ b/kernel/power/swsusp.c
@@ -743,7 +743,6 @@ static int submit(int rw, pgoff_t page_off, void *page)
743 if (!bio) 743 if (!bio)
744 return -ENOMEM; 744 return -ENOMEM;
745 bio->bi_sector = page_off * (PAGE_SIZE >> 9); 745 bio->bi_sector = page_off * (PAGE_SIZE >> 9);
746 bio_get(bio);
747 bio->bi_bdev = resume_bdev; 746 bio->bi_bdev = resume_bdev;
748 bio->bi_end_io = end_io; 747 bio->bi_end_io = end_io;
749 748
@@ -753,14 +752,13 @@ static int submit(int rw, pgoff_t page_off, void *page)
753 goto Done; 752 goto Done;
754 } 753 }
755 754
756 if (rw == WRITE)
757 bio_set_pages_dirty(bio);
758 755
759 atomic_set(&io_done, 1); 756 atomic_set(&io_done, 1);
760 submit_bio(rw | (1 << BIO_RW_SYNC), bio); 757 submit_bio(rw | (1 << BIO_RW_SYNC), bio);
761 while (atomic_read(&io_done)) 758 while (atomic_read(&io_done))
762 yield(); 759 yield();
763 760 if (rw == READ)
761 bio_set_pages_dirty(bio);
764 Done: 762 Done:
765 bio_put(bio); 763 bio_put(bio);
766 return error; 764 return error;