diff options
Diffstat (limited to 'meta-moblin/packages/linux/linux-moblin-2.6.29.1/linux-2.6.30-fix-suspend.patch')
-rw-r--r-- | meta-moblin/packages/linux/linux-moblin-2.6.29.1/linux-2.6.30-fix-suspend.patch | 139 |
1 files changed, 0 insertions, 139 deletions
diff --git a/meta-moblin/packages/linux/linux-moblin-2.6.29.1/linux-2.6.30-fix-suspend.patch b/meta-moblin/packages/linux/linux-moblin-2.6.29.1/linux-2.6.30-fix-suspend.patch deleted file mode 100644 index 3932a51ae0..0000000000 --- a/meta-moblin/packages/linux/linux-moblin-2.6.29.1/linux-2.6.30-fix-suspend.patch +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | From: Rafael J. Wysocki <rjw@suse.com> | ||
2 | Organization: SUSE | ||
3 | To: Arjan van de Ven <arjan@linux.intel.com> | ||
4 | CC: Linus Torvalds <torvalds@linux-foundation.org> | ||
5 | |||
6 | |||
7 | OK, updated patch follows, with a changelog. | ||
8 | |||
9 | I've added this check to user.c too, because that code can be called | ||
10 | independently of the one in disk.c . Also, if resume is user space-driven, | ||
11 | it's a good idea to wait for all of the device probes to complete before | ||
12 | continuing. | ||
13 | |||
14 | Thanks, | ||
15 | Rafael | ||
16 | |||
17 | --- | ||
18 | From: Rafael J. Wysocki <rjw@sisk.pl> | ||
19 | Subject: PM/Hibernate: Wait for SCSI devices scan to complete during resume | ||
20 | |||
21 | There is a race between resume from hibernation and the asynchronous | ||
22 | scanning of SCSI devices and to prevent it from happening we need to | ||
23 | call scsi_complete_async_scans() during resume from hibernation. | ||
24 | |||
25 | In addition, if the resume from hibernation is userland-driven, it's | ||
26 | better to wait for all device probes in the kernel to complete before | ||
27 | attempting to open the resume device. | ||
28 | |||
29 | Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> | ||
30 | --- | ||
31 | drivers/scsi/scsi_priv.h | 3 --- | ||
32 | drivers/scsi/scsi_wait_scan.c | 2 +- | ||
33 | include/scsi/scsi_scan.h | 11 +++++++++++ | ||
34 | kernel/power/disk.c | 8 ++++++++ | ||
35 | kernel/power/user.c | 9 +++++++++ | ||
36 | 5 files changed, 29 insertions(+), 4 deletions(-) | ||
37 | |||
38 | Index: linux-2.6/include/scsi/scsi_scan.h | ||
39 | =================================================================== | ||
40 | --- /dev/null | ||
41 | +++ linux-2.6/include/scsi/scsi_scan.h | ||
42 | @@ -0,0 +1,11 @@ | ||
43 | +#ifndef _SCSI_SCSI_SCAN_H | ||
44 | +#define _SCSI_SCSI_SCAN_H | ||
45 | + | ||
46 | +#ifdef CONFIG_SCSI | ||
47 | +/* drivers/scsi/scsi_scan.c */ | ||
48 | +extern int scsi_complete_async_scans(void); | ||
49 | +#else | ||
50 | +static inline int scsi_complete_async_scans(void) { return 0; } | ||
51 | +#endif | ||
52 | + | ||
53 | +#endif /* _SCSI_SCSI_SCAN_H */ | ||
54 | Index: linux-2.6/drivers/scsi/scsi_priv.h | ||
55 | =================================================================== | ||
56 | --- linux-2.6.orig/drivers/scsi/scsi_priv.h | ||
57 | +++ linux-2.6/drivers/scsi/scsi_priv.h | ||
58 | @@ -38,9 +38,6 @@ static inline void scsi_log_completion(s | ||
59 | { }; | ||
60 | #endif | ||
61 | |||
62 | -/* scsi_scan.c */ | ||
63 | -int scsi_complete_async_scans(void); | ||
64 | - | ||
65 | /* scsi_devinfo.c */ | ||
66 | extern int scsi_get_device_flags(struct scsi_device *sdev, | ||
67 | const unsigned char *vendor, | ||
68 | Index: linux-2.6/drivers/scsi/scsi_wait_scan.c | ||
69 | =================================================================== | ||
70 | --- linux-2.6.orig/drivers/scsi/scsi_wait_scan.c | ||
71 | +++ linux-2.6/drivers/scsi/scsi_wait_scan.c | ||
72 | @@ -11,7 +11,7 @@ | ||
73 | */ | ||
74 | |||
75 | #include <linux/module.h> | ||
76 | -#include "scsi_priv.h" | ||
77 | +#include <scsi/scsi_scan.h> | ||
78 | |||
79 | static int __init wait_scan_init(void) | ||
80 | { | ||
81 | Index: linux-2.6/kernel/power/disk.c | ||
82 | =================================================================== | ||
83 | --- linux-2.6.orig/kernel/power/disk.c | ||
84 | +++ linux-2.6/kernel/power/disk.c | ||
85 | @@ -22,5 +22,6 @@ | ||
86 | #include <linux/console.h> | ||
87 | #include <linux/cpu.h> | ||
88 | #include <linux/freezer.h> | ||
89 | +#include <scsi/scsi_scan.h> | ||
90 | |||
91 | #include "power.h" | ||
92 | @@ -645,6 +646,13 @@ static int software_resume(void) | ||
93 | return 0; | ||
94 | |||
95 | /* | ||
96 | + * We can't depend on SCSI devices being available after loading one of | ||
97 | + * their modules if scsi_complete_async_scans() is not called and the | ||
98 | + * resume device usually is a SCSI one. | ||
99 | + */ | ||
100 | + scsi_complete_async_scans(); | ||
101 | + | ||
102 | + /* | ||
103 | * name_to_dev_t() below takes a sysfs buffer mutex when sysfs | ||
104 | * is configured into the kernel. Since the regular hibernate | ||
105 | * trigger path is via sysfs which takes a buffer mutex before | ||
106 | Index: linux-2.6/kernel/power/user.c | ||
107 | =================================================================== | ||
108 | --- linux-2.6.orig/kernel/power/user.c | ||
109 | +++ linux-2.6/kernel/power/user.c | ||
110 | @@ -24,6 +24,7 @@ | ||
111 | #include <linux/cpu.h> | ||
112 | #include <linux/freezer.h> | ||
113 | #include <linux/smp_lock.h> | ||
114 | +#include <scsi/scsi_scan.h> | ||
115 | |||
116 | #include <asm/uaccess.h> | ||
117 | |||
118 | @@ -92,6 +93,7 @@ static int snapshot_open(struct inode *i | ||
119 | filp->private_data = data; | ||
120 | memset(&data->handle, 0, sizeof(struct snapshot_handle)); | ||
121 | if ((filp->f_flags & O_ACCMODE) == O_RDONLY) { | ||
122 | + /* Hibernating. The image device should be accessible. */ | ||
123 | data->swap = swsusp_resume_device ? | ||
124 | swap_type_of(swsusp_resume_device, 0, NULL) : -1; | ||
125 | data->mode = O_RDONLY; | ||
126 | @@ -99,6 +101,13 @@ static int snapshot_open(struct inode *i | ||
127 | if (error) | ||
128 | pm_notifier_call_chain(PM_POST_HIBERNATION); | ||
129 | } else { | ||
130 | + /* | ||
131 | + * Resuming. We may need to wait for the image device to | ||
132 | + * appear. | ||
133 | + */ | ||
134 | + wait_for_device_probe(); | ||
135 | + scsi_complete_async_scans(); | ||
136 | + | ||
137 | data->swap = -1; | ||
138 | data->mode = O_WRONLY; | ||
139 | error = pm_notifier_call_chain(PM_RESTORE_PREPARE); | ||