diff options
author | Koen Kooi <koen@dominion.thruhere.net> | 2012-08-08 10:41:23 +0200 |
---|---|---|
committer | Denys Dmytriyenko <denys@ti.com> | 2012-09-14 01:50:52 -0400 |
commit | 6203cbca5c9df9095882544f1eaa370a9cbd364a (patch) | |
tree | 737bb49b9f53b00ef177a9efbf648d0c0e5b7f0a | |
parent | e4ea426bb5e7b9dc18cd9fc1e820744c05b63561 (diff) | |
download | meta-ti-6203cbca5c9df9095882544f1eaa370a9cbd364a.tar.gz |
linux-ti33x-psp 3.2: update to 3.2.25
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
184 files changed, 16831 insertions, 3 deletions
diff --git a/conf/machine/include/ti33x.inc b/conf/machine/include/ti33x.inc index 02759d51..9610881e 100644 --- a/conf/machine/include/ti33x.inc +++ b/conf/machine/include/ti33x.inc | |||
@@ -4,7 +4,7 @@ require conf/machine/include/soc-family.inc | |||
4 | require conf/machine/include/tune-cortexa8.inc | 4 | require conf/machine/include/tune-cortexa8.inc |
5 | PREFERRED_PROVIDER_virtual/kernel = "linux-ti33x-psp" | 5 | PREFERRED_PROVIDER_virtual/kernel = "linux-ti33x-psp" |
6 | # Increase this everytime you change something in the kernel | 6 | # Increase this everytime you change something in the kernel |
7 | MACHINE_KERNEL_PR = "r14" | 7 | MACHINE_KERNEL_PR = "r15" |
8 | 8 | ||
9 | KERNEL_IMAGETYPE = "uImage" | 9 | KERNEL_IMAGETYPE = "uImage" |
10 | 10 | ||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0001-samsung-laptop-make-the-dmi-check-less-strict.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0001-samsung-laptop-make-the-dmi-check-less-strict.patch new file mode 100644 index 00000000..613acd71 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0001-samsung-laptop-make-the-dmi-check-less-strict.patch | |||
@@ -0,0 +1,306 @@ | |||
1 | From fe36d7279bb09c09b2c07b1b8bfe786a3ab12486 Mon Sep 17 00:00:00 2001 | ||
2 | From: Corentin Chary <corentincj@iksaif.net> | ||
3 | Date: Sat, 26 Nov 2011 11:00:10 +0100 | ||
4 | Subject: [PATCH 001/109] samsung-laptop: make the dmi check less strict | ||
5 | |||
6 | commit 3be324a94df0c3f032178d04549dbfbf6cccb09a upstream. | ||
7 | |||
8 | This enable the driver for everything that look like | ||
9 | a laptop and is from vendor "SAMSUNG ELECTRONICS CO., LTD.". | ||
10 | Note that laptop supported by samsung-q10 seem to have a different | ||
11 | vendor strict. | ||
12 | |||
13 | Also remove every log output until we know that we have a SABI interface | ||
14 | (except if the driver is forced to load, or debug is enabled). | ||
15 | |||
16 | Keeping a whitelist of laptop with a model granularity is something that can't | ||
17 | work without close vendor cooperation (and we don't have that). | ||
18 | |||
19 | Signed-off-by: Corentin Chary <corentincj@iksaif.net> | ||
20 | Acked-by: Greg Kroah-Hartman <gregkh@suse.de> | ||
21 | Signed-off-by: Matthew Garrett <mjg@redhat.com> | ||
22 | [bwh: Backported to 3.2: | ||
23 | - Adjust context | ||
24 | - Drop changes relating to ACPI video] | ||
25 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
26 | --- | ||
27 | drivers/platform/x86/samsung-laptop.c | 225 ++------------------------------- | ||
28 | 1 files changed, 8 insertions(+), 217 deletions(-) | ||
29 | |||
30 | diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c | ||
31 | index 09e26bf..af1e296 100644 | ||
32 | --- a/drivers/platform/x86/samsung-laptop.c | ||
33 | +++ b/drivers/platform/x86/samsung-laptop.c | ||
34 | @@ -540,245 +540,34 @@ static DEVICE_ATTR(performance_level, S_IWUSR | S_IRUGO, | ||
35 | get_performance_level, set_performance_level); | ||
36 | |||
37 | |||
38 | -static int __init dmi_check_cb(const struct dmi_system_id *id) | ||
39 | -{ | ||
40 | - pr_info("found laptop model '%s'\n", | ||
41 | - id->ident); | ||
42 | - return 1; | ||
43 | -} | ||
44 | - | ||
45 | static struct dmi_system_id __initdata samsung_dmi_table[] = { | ||
46 | { | ||
47 | - .ident = "N128", | ||
48 | - .matches = { | ||
49 | - DMI_MATCH(DMI_SYS_VENDOR, | ||
50 | - "SAMSUNG ELECTRONICS CO., LTD."), | ||
51 | - DMI_MATCH(DMI_PRODUCT_NAME, "N128"), | ||
52 | - DMI_MATCH(DMI_BOARD_NAME, "N128"), | ||
53 | - }, | ||
54 | - .callback = dmi_check_cb, | ||
55 | - }, | ||
56 | - { | ||
57 | - .ident = "N130", | ||
58 | .matches = { | ||
59 | DMI_MATCH(DMI_SYS_VENDOR, | ||
60 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
61 | - DMI_MATCH(DMI_PRODUCT_NAME, "N130"), | ||
62 | - DMI_MATCH(DMI_BOARD_NAME, "N130"), | ||
63 | + DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */ | ||
64 | }, | ||
65 | - .callback = dmi_check_cb, | ||
66 | }, | ||
67 | { | ||
68 | - .ident = "N510", | ||
69 | .matches = { | ||
70 | DMI_MATCH(DMI_SYS_VENDOR, | ||
71 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
72 | - DMI_MATCH(DMI_PRODUCT_NAME, "N510"), | ||
73 | - DMI_MATCH(DMI_BOARD_NAME, "N510"), | ||
74 | + DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */ | ||
75 | }, | ||
76 | - .callback = dmi_check_cb, | ||
77 | }, | ||
78 | { | ||
79 | - .ident = "X125", | ||
80 | .matches = { | ||
81 | DMI_MATCH(DMI_SYS_VENDOR, | ||
82 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
83 | - DMI_MATCH(DMI_PRODUCT_NAME, "X125"), | ||
84 | - DMI_MATCH(DMI_BOARD_NAME, "X125"), | ||
85 | + DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */ | ||
86 | }, | ||
87 | - .callback = dmi_check_cb, | ||
88 | }, | ||
89 | { | ||
90 | - .ident = "X120/X170", | ||
91 | .matches = { | ||
92 | DMI_MATCH(DMI_SYS_VENDOR, | ||
93 | "SAMSUNG ELECTRONICS CO., LTD."), | ||
94 | - DMI_MATCH(DMI_PRODUCT_NAME, "X120/X170"), | ||
95 | - DMI_MATCH(DMI_BOARD_NAME, "X120/X170"), | ||
96 | - }, | ||
97 | - .callback = dmi_check_cb, | ||
98 | - }, | ||
99 | - { | ||
100 | - .ident = "NC10", | ||
101 | - .matches = { | ||
102 | - DMI_MATCH(DMI_SYS_VENDOR, | ||
103 | - "SAMSUNG ELECTRONICS CO., LTD."), | ||
104 | - DMI_MATCH(DMI_PRODUCT_NAME, "NC10"), | ||
105 | - DMI_MATCH(DMI_BOARD_NAME, "NC10"), | ||
106 | - }, | ||
107 | - .callback = dmi_check_cb, | ||
108 | - }, | ||
109 | - { | ||
110 | - .ident = "NP-Q45", | ||
111 | - .matches = { | ||
112 | - DMI_MATCH(DMI_SYS_VENDOR, | ||
113 | - "SAMSUNG ELECTRONICS CO., LTD."), | ||
114 | - DMI_MATCH(DMI_PRODUCT_NAME, "SQ45S70S"), | ||
115 | - DMI_MATCH(DMI_BOARD_NAME, "SQ45S70S"), | ||
116 | - }, | ||
117 | - .callback = dmi_check_cb, | ||
118 | - }, | ||
119 | - { | ||
120 | - .ident = "X360", | ||
121 | - .matches = { | ||
122 | - DMI_MATCH(DMI_SYS_VENDOR, | ||
123 | - "SAMSUNG ELECTRONICS CO., LTD."), | ||
124 | - DMI_MATCH(DMI_PRODUCT_NAME, "X360"), | ||
125 | - DMI_MATCH(DMI_BOARD_NAME, "X360"), | ||
126 | - }, | ||
127 | - .callback = dmi_check_cb, | ||
128 | - }, | ||
129 | - { | ||
130 | - .ident = "R410 Plus", | ||
131 | - .matches = { | ||
132 | - DMI_MATCH(DMI_SYS_VENDOR, | ||
133 | - "SAMSUNG ELECTRONICS CO., LTD."), | ||
134 | - DMI_MATCH(DMI_PRODUCT_NAME, "R410P"), | ||
135 | - DMI_MATCH(DMI_BOARD_NAME, "R460"), | ||
136 | - }, | ||
137 | - .callback = dmi_check_cb, | ||
138 | - }, | ||
139 | - { | ||
140 | - .ident = "R518", | ||
141 | - .matches = { | ||
142 | - DMI_MATCH(DMI_SYS_VENDOR, | ||
143 | - "SAMSUNG ELECTRONICS CO., LTD."), | ||
144 | - DMI_MATCH(DMI_PRODUCT_NAME, "R518"), | ||
145 | - DMI_MATCH(DMI_BOARD_NAME, "R518"), | ||
146 | - }, | ||
147 | - .callback = dmi_check_cb, | ||
148 | - }, | ||
149 | - { | ||
150 | - .ident = "R519/R719", | ||
151 | - .matches = { | ||
152 | - DMI_MATCH(DMI_SYS_VENDOR, | ||
153 | - "SAMSUNG ELECTRONICS CO., LTD."), | ||
154 | - DMI_MATCH(DMI_PRODUCT_NAME, "R519/R719"), | ||
155 | - DMI_MATCH(DMI_BOARD_NAME, "R519/R719"), | ||
156 | - }, | ||
157 | - .callback = dmi_check_cb, | ||
158 | - }, | ||
159 | - { | ||
160 | - .ident = "N150/N210/N220", | ||
161 | - .matches = { | ||
162 | - DMI_MATCH(DMI_SYS_VENDOR, | ||
163 | - "SAMSUNG ELECTRONICS CO., LTD."), | ||
164 | - DMI_MATCH(DMI_PRODUCT_NAME, "N150/N210/N220"), | ||
165 | - DMI_MATCH(DMI_BOARD_NAME, "N150/N210/N220"), | ||
166 | - }, | ||
167 | - .callback = dmi_check_cb, | ||
168 | - }, | ||
169 | - { | ||
170 | - .ident = "N220", | ||
171 | - .matches = { | ||
172 | - DMI_MATCH(DMI_SYS_VENDOR, | ||
173 | - "SAMSUNG ELECTRONICS CO., LTD."), | ||
174 | - DMI_MATCH(DMI_PRODUCT_NAME, "N220"), | ||
175 | - DMI_MATCH(DMI_BOARD_NAME, "N220"), | ||
176 | - }, | ||
177 | - .callback = dmi_check_cb, | ||
178 | - }, | ||
179 | - { | ||
180 | - .ident = "N150/N210/N220/N230", | ||
181 | - .matches = { | ||
182 | - DMI_MATCH(DMI_SYS_VENDOR, | ||
183 | - "SAMSUNG ELECTRONICS CO., LTD."), | ||
184 | - DMI_MATCH(DMI_PRODUCT_NAME, "N150/N210/N220/N230"), | ||
185 | - DMI_MATCH(DMI_BOARD_NAME, "N150/N210/N220/N230"), | ||
186 | - }, | ||
187 | - .callback = dmi_check_cb, | ||
188 | - }, | ||
189 | - { | ||
190 | - .ident = "N150P/N210P/N220P", | ||
191 | - .matches = { | ||
192 | - DMI_MATCH(DMI_SYS_VENDOR, | ||
193 | - "SAMSUNG ELECTRONICS CO., LTD."), | ||
194 | - DMI_MATCH(DMI_PRODUCT_NAME, "N150P/N210P/N220P"), | ||
195 | - DMI_MATCH(DMI_BOARD_NAME, "N150P/N210P/N220P"), | ||
196 | - }, | ||
197 | - .callback = dmi_check_cb, | ||
198 | - }, | ||
199 | - { | ||
200 | - .ident = "R700", | ||
201 | - .matches = { | ||
202 | - DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
203 | - DMI_MATCH(DMI_PRODUCT_NAME, "SR700"), | ||
204 | - DMI_MATCH(DMI_BOARD_NAME, "SR700"), | ||
205 | - }, | ||
206 | - .callback = dmi_check_cb, | ||
207 | - }, | ||
208 | - { | ||
209 | - .ident = "R530/R730", | ||
210 | - .matches = { | ||
211 | - DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
212 | - DMI_MATCH(DMI_PRODUCT_NAME, "R530/R730"), | ||
213 | - DMI_MATCH(DMI_BOARD_NAME, "R530/R730"), | ||
214 | - }, | ||
215 | - .callback = dmi_check_cb, | ||
216 | - }, | ||
217 | - { | ||
218 | - .ident = "NF110/NF210/NF310", | ||
219 | - .matches = { | ||
220 | - DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
221 | - DMI_MATCH(DMI_PRODUCT_NAME, "NF110/NF210/NF310"), | ||
222 | - DMI_MATCH(DMI_BOARD_NAME, "NF110/NF210/NF310"), | ||
223 | - }, | ||
224 | - .callback = dmi_check_cb, | ||
225 | - }, | ||
226 | - { | ||
227 | - .ident = "N145P/N250P/N260P", | ||
228 | - .matches = { | ||
229 | - DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
230 | - DMI_MATCH(DMI_PRODUCT_NAME, "N145P/N250P/N260P"), | ||
231 | - DMI_MATCH(DMI_BOARD_NAME, "N145P/N250P/N260P"), | ||
232 | - }, | ||
233 | - .callback = dmi_check_cb, | ||
234 | - }, | ||
235 | - { | ||
236 | - .ident = "R70/R71", | ||
237 | - .matches = { | ||
238 | - DMI_MATCH(DMI_SYS_VENDOR, | ||
239 | - "SAMSUNG ELECTRONICS CO., LTD."), | ||
240 | - DMI_MATCH(DMI_PRODUCT_NAME, "R70/R71"), | ||
241 | - DMI_MATCH(DMI_BOARD_NAME, "R70/R71"), | ||
242 | - }, | ||
243 | - .callback = dmi_check_cb, | ||
244 | - }, | ||
245 | - { | ||
246 | - .ident = "P460", | ||
247 | - .matches = { | ||
248 | - DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
249 | - DMI_MATCH(DMI_PRODUCT_NAME, "P460"), | ||
250 | - DMI_MATCH(DMI_BOARD_NAME, "P460"), | ||
251 | - }, | ||
252 | - .callback = dmi_check_cb, | ||
253 | - }, | ||
254 | - { | ||
255 | - .ident = "R528/R728", | ||
256 | - .matches = { | ||
257 | - DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
258 | - DMI_MATCH(DMI_PRODUCT_NAME, "R528/R728"), | ||
259 | - DMI_MATCH(DMI_BOARD_NAME, "R528/R728"), | ||
260 | - }, | ||
261 | - .callback = dmi_check_cb, | ||
262 | - }, | ||
263 | - { | ||
264 | - .ident = "NC210/NC110", | ||
265 | - .matches = { | ||
266 | - DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
267 | - DMI_MATCH(DMI_PRODUCT_NAME, "NC210/NC110"), | ||
268 | - DMI_MATCH(DMI_BOARD_NAME, "NC210/NC110"), | ||
269 | - }, | ||
270 | - .callback = dmi_check_cb, | ||
271 | - }, | ||
272 | - { | ||
273 | - .ident = "X520", | ||
274 | - .matches = { | ||
275 | - DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
276 | - DMI_MATCH(DMI_PRODUCT_NAME, "X520"), | ||
277 | - DMI_MATCH(DMI_BOARD_NAME, "X520"), | ||
278 | + DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */ | ||
279 | }, | ||
280 | - .callback = dmi_check_cb, | ||
281 | }, | ||
282 | { }, | ||
283 | }; | ||
284 | @@ -819,7 +608,8 @@ static int __init samsung_init(void) | ||
285 | |||
286 | f0000_segment = ioremap_nocache(0xf0000, 0xffff); | ||
287 | if (!f0000_segment) { | ||
288 | - pr_err("Can't map the segment at 0xf0000\n"); | ||
289 | + if (debug || force) | ||
290 | + pr_err("Can't map the segment at 0xf0000\n"); | ||
291 | return -EINVAL; | ||
292 | } | ||
293 | |||
294 | @@ -832,7 +622,8 @@ static int __init samsung_init(void) | ||
295 | } | ||
296 | |||
297 | if (loca == 0xffff) { | ||
298 | - pr_err("This computer does not support SABI\n"); | ||
299 | + if (debug || force) | ||
300 | + pr_err("This computer does not support SABI\n"); | ||
301 | goto error_no_signature; | ||
302 | } | ||
303 | |||
304 | -- | ||
305 | 1.7.7.6 | ||
306 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0002-raid5-delayed-stripe-fix.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0002-raid5-delayed-stripe-fix.patch new file mode 100644 index 00000000..bb9ebfa1 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0002-raid5-delayed-stripe-fix.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From c3041d04e675a5d38a1d57fee3c59d4f073f512e Mon Sep 17 00:00:00 2001 | ||
2 | From: Shaohua Li <shli@kernel.org> | ||
3 | Date: Tue, 3 Jul 2012 15:57:19 +1000 | ||
4 | Subject: [PATCH 002/109] raid5: delayed stripe fix | ||
5 | |||
6 | commit fab363b5ff502d1b39ddcfec04271f5858d9f26e upstream. | ||
7 | |||
8 | There isn't locking setting STRIPE_DELAYED and STRIPE_PREREAD_ACTIVE bits, but | ||
9 | the two bits have relationship. A delayed stripe can be moved to hold list only | ||
10 | when preread active stripe count is below IO_THRESHOLD. If a stripe has both | ||
11 | the bits set, such stripe will be in delayed list and preread count not 0, | ||
12 | which will make such stripe never leave delayed list. | ||
13 | |||
14 | Signed-off-by: Shaohua Li <shli@fusionio.com> | ||
15 | Signed-off-by: NeilBrown <neilb@suse.de> | ||
16 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
17 | --- | ||
18 | drivers/md/raid5.c | 4 +++- | ||
19 | 1 files changed, 3 insertions(+), 1 deletions(-) | ||
20 | |||
21 | diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c | ||
22 | index 6ba4954..26ef63a 100644 | ||
23 | --- a/drivers/md/raid5.c | ||
24 | +++ b/drivers/md/raid5.c | ||
25 | @@ -196,12 +196,14 @@ static void __release_stripe(struct r5conf *conf, struct stripe_head *sh) | ||
26 | BUG_ON(!list_empty(&sh->lru)); | ||
27 | BUG_ON(atomic_read(&conf->active_stripes)==0); | ||
28 | if (test_bit(STRIPE_HANDLE, &sh->state)) { | ||
29 | - if (test_bit(STRIPE_DELAYED, &sh->state)) | ||
30 | + if (test_bit(STRIPE_DELAYED, &sh->state) && | ||
31 | + !test_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) | ||
32 | list_add_tail(&sh->lru, &conf->delayed_list); | ||
33 | else if (test_bit(STRIPE_BIT_DELAY, &sh->state) && | ||
34 | sh->bm_seq - conf->seq_write > 0) | ||
35 | list_add_tail(&sh->lru, &conf->bitmap_list); | ||
36 | else { | ||
37 | + clear_bit(STRIPE_DELAYED, &sh->state); | ||
38 | clear_bit(STRIPE_BIT_DELAY, &sh->state); | ||
39 | list_add_tail(&sh->lru, &conf->handle_list); | ||
40 | } | ||
41 | -- | ||
42 | 1.7.7.6 | ||
43 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0003-tcp-drop-SYN-FIN-messages.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0003-tcp-drop-SYN-FIN-messages.patch new file mode 100644 index 00000000..6eb38244 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0003-tcp-drop-SYN-FIN-messages.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From ebf148a0ca2e0c9fb824a069c0fd5311bb6ae297 Mon Sep 17 00:00:00 2001 | ||
2 | From: Eric Dumazet <eric.dumazet@gmail.com> | ||
3 | Date: Fri, 2 Dec 2011 23:41:42 +0000 | ||
4 | Subject: [PATCH 003/109] tcp: drop SYN+FIN messages | ||
5 | |||
6 | commit fdf5af0daf8019cec2396cdef8fb042d80fe71fa upstream. | ||
7 | |||
8 | Denys Fedoryshchenko reported that SYN+FIN attacks were bringing his | ||
9 | linux machines to their limits. | ||
10 | |||
11 | Dont call conn_request() if the TCP flags includes SYN flag | ||
12 | |||
13 | Reported-by: Denys Fedoryshchenko <denys@visp.net.lb> | ||
14 | Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> | ||
15 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
16 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
17 | --- | ||
18 | net/ipv4/tcp_input.c | 2 ++ | ||
19 | 1 files changed, 2 insertions(+), 0 deletions(-) | ||
20 | |||
21 | diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c | ||
22 | index 9726927..32e6ca2 100644 | ||
23 | --- a/net/ipv4/tcp_input.c | ||
24 | +++ b/net/ipv4/tcp_input.c | ||
25 | @@ -5836,6 +5836,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | ||
26 | goto discard; | ||
27 | |||
28 | if (th->syn) { | ||
29 | + if (th->fin) | ||
30 | + goto discard; | ||
31 | if (icsk->icsk_af_ops->conn_request(sk, skb) < 0) | ||
32 | return 1; | ||
33 | |||
34 | -- | ||
35 | 1.7.7.6 | ||
36 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0004-tg3-Apply-short-DMA-frag-workaround-to-5906.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0004-tg3-Apply-short-DMA-frag-workaround-to-5906.patch new file mode 100644 index 00000000..15f59068 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0004-tg3-Apply-short-DMA-frag-workaround-to-5906.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 389c56a2dfc90eecb97841668a8d61fc3424f2c8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Matt Carlson <mcarlson@broadcom.com> | ||
3 | Date: Thu, 7 Jun 2012 12:56:54 +0000 | ||
4 | Subject: [PATCH 004/109] tg3: Apply short DMA frag workaround to 5906 | ||
5 | |||
6 | commit b7abee6ef888117f92db370620ebf116a38e3f4d upstream. | ||
7 | |||
8 | 5906 devices also need the short DMA fragment workaround. This patch | ||
9 | makes the necessary change. | ||
10 | |||
11 | Signed-off-by: Matt Carlson <mcarlson@broadcom.com> | ||
12 | Tested-by: Christian Kujau <lists@nerdbynature.de> | ||
13 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
14 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
15 | --- | ||
16 | drivers/net/ethernet/broadcom/tg3.c | 3 ++- | ||
17 | 1 files changed, 2 insertions(+), 1 deletions(-) | ||
18 | |||
19 | diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c | ||
20 | index 2dcac28..6b258d9 100644 | ||
21 | --- a/drivers/net/ethernet/broadcom/tg3.c | ||
22 | +++ b/drivers/net/ethernet/broadcom/tg3.c | ||
23 | @@ -14046,7 +14046,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | ||
24 | } | ||
25 | } | ||
26 | |||
27 | - if (tg3_flag(tp, 5755_PLUS)) | ||
28 | + if (tg3_flag(tp, 5755_PLUS) || | ||
29 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) | ||
30 | tg3_flag_set(tp, SHORT_DMA_BUG); | ||
31 | |||
32 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) | ||
33 | -- | ||
34 | 1.7.7.6 | ||
35 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0005-rtl8187-brightness_set-can-not-sleep.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0005-rtl8187-brightness_set-can-not-sleep.patch new file mode 100644 index 00000000..5a01a08c --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0005-rtl8187-brightness_set-can-not-sleep.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | From c8ad2074ce769ad8b16677e0a9bee9232be03acc Mon Sep 17 00:00:00 2001 | ||
2 | From: Stanislaw Gruszka <sgruszka@redhat.com> | ||
3 | Date: Wed, 16 May 2012 11:06:21 +0200 | ||
4 | Subject: [PATCH 005/109] rtl8187: ->brightness_set can not sleep | ||
5 | |||
6 | commit 0fde0a8cfd0ede7f310d6a681c8e5a7cb3e32406 upstream. | ||
7 | |||
8 | Fix: | ||
9 | |||
10 | BUG: sleeping function called from invalid context at kernel/workqueue.c:2547 | ||
11 | in_atomic(): 1, irqs_disabled(): 0, pid: 629, name: wpa_supplicant | ||
12 | 2 locks held by wpa_supplicant/629: | ||
13 | #0: (rtnl_mutex){+.+.+.}, at: [<c08b2b84>] rtnl_lock+0x14/0x20 | ||
14 | #1: (&trigger->leddev_list_lock){.+.?..}, at: [<c0867f41>] led_trigger_event+0x21/0x80 | ||
15 | Pid: 629, comm: wpa_supplicant Not tainted 3.3.0-0.rc3.git5.1.fc17.i686 | ||
16 | Call Trace: | ||
17 | [<c046a9f6>] __might_sleep+0x126/0x1d0 | ||
18 | [<c0457d6c>] wait_on_work+0x2c/0x1d0 | ||
19 | [<c045a09a>] __cancel_work_timer+0x6a/0x120 | ||
20 | [<c045a160>] cancel_delayed_work_sync+0x10/0x20 | ||
21 | [<f7dd3c22>] rtl8187_led_brightness_set+0x82/0xf0 [rtl8187] | ||
22 | [<c0867f7c>] led_trigger_event+0x5c/0x80 | ||
23 | [<f7ff5e6d>] ieee80211_led_radio+0x1d/0x40 [mac80211] | ||
24 | [<f7ff3583>] ieee80211_stop_device+0x13/0x230 [mac80211] | ||
25 | |||
26 | Removing _sync is ok, because if led_on work is currently running | ||
27 | it will be finished before led_off work start to perform, since | ||
28 | they are always queued on the same mac80211 local->workqueue. | ||
29 | |||
30 | Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=795176 | ||
31 | |||
32 | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> | ||
33 | Acked-by: Larry Finger <Larry.Finger@lwfinger.net> | ||
34 | Acked-by: Hin-Tak Leung <htl10@users.sourceforge.net> | ||
35 | Signed-off-by: John W. Linville <linville@tuxdriver.com> | ||
36 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
37 | --- | ||
38 | drivers/net/wireless/rtl818x/rtl8187/leds.c | 2 +- | ||
39 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
40 | |||
41 | diff --git a/drivers/net/wireless/rtl818x/rtl8187/leds.c b/drivers/net/wireless/rtl818x/rtl8187/leds.c | ||
42 | index 2e0de2f..c2d5b49 100644 | ||
43 | --- a/drivers/net/wireless/rtl818x/rtl8187/leds.c | ||
44 | +++ b/drivers/net/wireless/rtl818x/rtl8187/leds.c | ||
45 | @@ -117,7 +117,7 @@ static void rtl8187_led_brightness_set(struct led_classdev *led_dev, | ||
46 | radio_on = true; | ||
47 | } else if (radio_on) { | ||
48 | radio_on = false; | ||
49 | - cancel_delayed_work_sync(&priv->led_on); | ||
50 | + cancel_delayed_work(&priv->led_on); | ||
51 | ieee80211_queue_delayed_work(hw, &priv->led_off, 0); | ||
52 | } | ||
53 | } else if (radio_on) { | ||
54 | -- | ||
55 | 1.7.7.6 | ||
56 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0006-net-wireless-ipw2x00-add-supported-cipher-suites-to-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0006-net-wireless-ipw2x00-add-supported-cipher-suites-to-.patch new file mode 100644 index 00000000..68fca84d --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0006-net-wireless-ipw2x00-add-supported-cipher-suites-to-.patch | |||
@@ -0,0 +1,102 @@ | |||
1 | From 54490f32c07630f7c6bd6429bf73d7507b06e3db Mon Sep 17 00:00:00 2001 | ||
2 | From: Stanislav Yakovlev <stas.yakovlev@gmail.com> | ||
3 | Date: Tue, 10 Apr 2012 21:44:47 -0400 | ||
4 | Subject: [PATCH 006/109] net/wireless: ipw2x00: add supported cipher suites | ||
5 | to wiphy initialization | ||
6 | |||
7 | commit a141e6a0097118bb35024485f1faffc0d9042f5c upstream. | ||
8 | |||
9 | Driver doesn't report its supported cipher suites through cfg80211 | ||
10 | interface. It still uses wext interface and probably will not work | ||
11 | through nl80211, but will at least correctly advertise supported | ||
12 | features. | ||
13 | |||
14 | Bug was reported by Omar Siam. | ||
15 | https://bugzilla.kernel.org/show_bug.cgi?id=43049 | ||
16 | |||
17 | Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com> | ||
18 | Signed-off-by: John W. Linville <linville@tuxdriver.com> | ||
19 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
20 | --- | ||
21 | drivers/net/wireless/ipw2x00/ipw.h | 23 +++++++++++++++++++++++ | ||
22 | drivers/net/wireless/ipw2x00/ipw2100.c | 4 ++++ | ||
23 | drivers/net/wireless/ipw2x00/ipw2200.c | 4 ++++ | ||
24 | 3 files changed, 31 insertions(+), 0 deletions(-) | ||
25 | create mode 100644 drivers/net/wireless/ipw2x00/ipw.h | ||
26 | |||
27 | diff --git a/drivers/net/wireless/ipw2x00/ipw.h b/drivers/net/wireless/ipw2x00/ipw.h | ||
28 | new file mode 100644 | ||
29 | index 0000000..4007bf5 | ||
30 | --- /dev/null | ||
31 | +++ b/drivers/net/wireless/ipw2x00/ipw.h | ||
32 | @@ -0,0 +1,23 @@ | ||
33 | +/* | ||
34 | + * Intel Pro/Wireless 2100, 2200BG, 2915ABG network connection driver | ||
35 | + * | ||
36 | + * Copyright 2012 Stanislav Yakovlev <stas.yakovlev@gmail.com> | ||
37 | + * | ||
38 | + * This program is free software; you can redistribute it and/or modify | ||
39 | + * it under the terms of the GNU General Public License version 2 as | ||
40 | + * published by the Free Software Foundation. | ||
41 | + */ | ||
42 | + | ||
43 | +#ifndef __IPW_H__ | ||
44 | +#define __IPW_H__ | ||
45 | + | ||
46 | +#include <linux/ieee80211.h> | ||
47 | + | ||
48 | +static const u32 ipw_cipher_suites[] = { | ||
49 | + WLAN_CIPHER_SUITE_WEP40, | ||
50 | + WLAN_CIPHER_SUITE_WEP104, | ||
51 | + WLAN_CIPHER_SUITE_TKIP, | ||
52 | + WLAN_CIPHER_SUITE_CCMP, | ||
53 | +}; | ||
54 | + | ||
55 | +#endif | ||
56 | diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c | ||
57 | index 127e9c6..10862d4 100644 | ||
58 | --- a/drivers/net/wireless/ipw2x00/ipw2100.c | ||
59 | +++ b/drivers/net/wireless/ipw2x00/ipw2100.c | ||
60 | @@ -166,6 +166,7 @@ that only one external action is invoked at a time. | ||
61 | #include <net/lib80211.h> | ||
62 | |||
63 | #include "ipw2100.h" | ||
64 | +#include "ipw.h" | ||
65 | |||
66 | #define IPW2100_VERSION "git-1.2.2" | ||
67 | |||
68 | @@ -1955,6 +1956,9 @@ static int ipw2100_wdev_init(struct net_device *dev) | ||
69 | wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = bg_band; | ||
70 | } | ||
71 | |||
72 | + wdev->wiphy->cipher_suites = ipw_cipher_suites; | ||
73 | + wdev->wiphy->n_cipher_suites = ARRAY_SIZE(ipw_cipher_suites); | ||
74 | + | ||
75 | set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev); | ||
76 | if (wiphy_register(wdev->wiphy)) { | ||
77 | ipw2100_down(priv); | ||
78 | diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c | ||
79 | index 827889b..56bd370 100644 | ||
80 | --- a/drivers/net/wireless/ipw2x00/ipw2200.c | ||
81 | +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | ||
82 | @@ -34,6 +34,7 @@ | ||
83 | #include <linux/slab.h> | ||
84 | #include <net/cfg80211-wext.h> | ||
85 | #include "ipw2200.h" | ||
86 | +#include "ipw.h" | ||
87 | |||
88 | |||
89 | #ifndef KBUILD_EXTMOD | ||
90 | @@ -11535,6 +11536,9 @@ static int ipw_wdev_init(struct net_device *dev) | ||
91 | wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = a_band; | ||
92 | } | ||
93 | |||
94 | + wdev->wiphy->cipher_suites = ipw_cipher_suites; | ||
95 | + wdev->wiphy->n_cipher_suites = ARRAY_SIZE(ipw_cipher_suites); | ||
96 | + | ||
97 | set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev); | ||
98 | |||
99 | /* With that information in place, we can now register the wiphy... */ | ||
100 | -- | ||
101 | 1.7.7.6 | ||
102 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0007-drm-i915-do-not-enable-RC6p-on-Sandy-Bridge.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0007-drm-i915-do-not-enable-RC6p-on-Sandy-Bridge.patch new file mode 100644 index 00000000..ac8f0c72 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0007-drm-i915-do-not-enable-RC6p-on-Sandy-Bridge.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From ae8e28c4c0aaba535e88908a7a2c560bb55061f9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Eugeni Dodonov <eugeni.dodonov@intel.com> | ||
3 | Date: Tue, 14 Feb 2012 11:44:48 -0200 | ||
4 | Subject: [PATCH 007/109] drm/i915: do not enable RC6p on Sandy Bridge | ||
5 | |||
6 | commit 1c8ecf80fdee4e7b23a9e7da7ff9bd59ba2dcf96 upstream. | ||
7 | |||
8 | With base on latest findings, RC6p seems to be respondible for RC6-related | ||
9 | issues on Sandy Bridge platform. To work-around those issues, the previous | ||
10 | solution was to completely disable RC6 on Sandy Bridge for the past few | ||
11 | releases, even if plain RC6 was not giving any issues. | ||
12 | |||
13 | What this patch does is preventing RC6p from being enabled on Sandy Bridge | ||
14 | even if users enable RC6 via a kernel parameter. So it won't change the | ||
15 | defaults in any way, but will ensure that if users do enable RC6 manually | ||
16 | it won't break their machines by enabling this extra state. | ||
17 | |||
18 | Proper fix for this (enabling specific RC6 states according to the GPU | ||
19 | generation) were proposed for the -next kernel, but we are too late in the | ||
20 | release process now to pick such changes. | ||
21 | |||
22 | Acked-by: Keith Packard <keithp@keithp.com> | ||
23 | Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com> | ||
24 | Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> | ||
25 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
26 | --- | ||
27 | drivers/gpu/drm/i915/intel_display.c | 4 ++-- | ||
28 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
29 | |||
30 | diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c | ||
31 | index 6aa7716..c63ca5f 100644 | ||
32 | --- a/drivers/gpu/drm/i915/intel_display.c | ||
33 | +++ b/drivers/gpu/drm/i915/intel_display.c | ||
34 | @@ -8043,8 +8043,8 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv) | ||
35 | I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */ | ||
36 | |||
37 | if (intel_enable_rc6(dev_priv->dev)) | ||
38 | - rc6_mask = GEN6_RC_CTL_RC6p_ENABLE | | ||
39 | - GEN6_RC_CTL_RC6_ENABLE; | ||
40 | + rc6_mask = GEN6_RC_CTL_RC6_ENABLE | | ||
41 | + (IS_GEN7(dev_priv->dev)) ? GEN6_RC_CTL_RC6p_ENABLE : 0; | ||
42 | |||
43 | I915_WRITE(GEN6_RC_CONTROL, | ||
44 | rc6_mask | | ||
45 | -- | ||
46 | 1.7.7.6 | ||
47 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0008-drm-i915-fix-operator-precedence-when-enabling-RC6p.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0008-drm-i915-fix-operator-precedence-when-enabling-RC6p.patch new file mode 100644 index 00000000..18b111fc --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0008-drm-i915-fix-operator-precedence-when-enabling-RC6p.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 2c5df93ac56c5ec76f87a0daf418966abb25b03b Mon Sep 17 00:00:00 2001 | ||
2 | From: Eugeni Dodonov <eugeni.dodonov@intel.com> | ||
3 | Date: Thu, 23 Feb 2012 23:57:06 -0200 | ||
4 | Subject: [PATCH 008/109] drm/i915: fix operator precedence when enabling RC6p | ||
5 | |||
6 | commit c0e2ee1bc0cf82eec89e26b7afe7e4db0561b7d9 upstream. | ||
7 | |||
8 | As noticed by Torsten Kaiser, the operator precedence can play tricks with | ||
9 | us here. | ||
10 | |||
11 | CC: Dave Airlie <airlied@redhat.com> | ||
12 | Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com> | ||
13 | Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> | ||
14 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
15 | --- | ||
16 | drivers/gpu/drm/i915/intel_display.c | 2 +- | ||
17 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
18 | |||
19 | diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c | ||
20 | index c63ca5f..cc75c4b 100644 | ||
21 | --- a/drivers/gpu/drm/i915/intel_display.c | ||
22 | +++ b/drivers/gpu/drm/i915/intel_display.c | ||
23 | @@ -8044,7 +8044,7 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv) | ||
24 | |||
25 | if (intel_enable_rc6(dev_priv->dev)) | ||
26 | rc6_mask = GEN6_RC_CTL_RC6_ENABLE | | ||
27 | - (IS_GEN7(dev_priv->dev)) ? GEN6_RC_CTL_RC6p_ENABLE : 0; | ||
28 | + ((IS_GEN7(dev_priv->dev)) ? GEN6_RC_CTL_RC6p_ENABLE : 0); | ||
29 | |||
30 | I915_WRITE(GEN6_RC_CONTROL, | ||
31 | rc6_mask | | ||
32 | -- | ||
33 | 1.7.7.6 | ||
34 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0009-kbuild-do-not-check-for-ancient-modutils-tools.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0009-kbuild-do-not-check-for-ancient-modutils-tools.patch new file mode 100644 index 00000000..281b4e91 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0009-kbuild-do-not-check-for-ancient-modutils-tools.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 6ad602fb1ad21f96e203b4525aa56c7e0cc6ac4f Mon Sep 17 00:00:00 2001 | ||
2 | From: Lucas De Marchi <lucas.demarchi@profusion.mobi> | ||
3 | Date: Tue, 17 Jan 2012 14:50:51 -0200 | ||
4 | Subject: [PATCH 009/109] kbuild: do not check for ancient modutils tools | ||
5 | |||
6 | commit 620c231c7a7f48745094727bb612f6321cfc8844 upstream. | ||
7 | |||
8 | scripts/depmod.sh checks for the output of '-V' expecting that it has | ||
9 | module-init-tools in it. It's a hack to prevent users from using | ||
10 | modutils instead of module-init-tools, that only works with 2.4.x | ||
11 | kernels. This however prints an annoying warning for kmod tool, that is | ||
12 | currently replacing module-init-tools. | ||
13 | |||
14 | Rather than putting another check for kmod's version, just remove it | ||
15 | since users of 2.4.x kernel are unlikely to upgrade to 3.x, and if they | ||
16 | do, let depmod fail in that case because they should know what they are | ||
17 | doing. | ||
18 | |||
19 | Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi> | ||
20 | Acked-by: WANG Cong <amwang@redhat.com> | ||
21 | Acked-By: Kay Sievers <kay.sievers@vrfy.org> | ||
22 | Signed-off-by: Michal Marek <mmarek@suse.cz> | ||
23 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
24 | --- | ||
25 | scripts/depmod.sh | 6 ------ | ||
26 | 1 files changed, 0 insertions(+), 6 deletions(-) | ||
27 | |||
28 | diff --git a/scripts/depmod.sh b/scripts/depmod.sh | ||
29 | index a272356..2ae4817 100755 | ||
30 | --- a/scripts/depmod.sh | ||
31 | +++ b/scripts/depmod.sh | ||
32 | @@ -9,12 +9,6 @@ fi | ||
33 | DEPMOD=$1 | ||
34 | KERNELRELEASE=$2 | ||
35 | |||
36 | -if ! "$DEPMOD" -V 2>/dev/null | grep -q module-init-tools; then | ||
37 | - echo "Warning: you may need to install module-init-tools" >&2 | ||
38 | - echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt" >&2 | ||
39 | - sleep 1 | ||
40 | -fi | ||
41 | - | ||
42 | if ! test -r System.map -a -x "$DEPMOD"; then | ||
43 | exit 0 | ||
44 | fi | ||
45 | -- | ||
46 | 1.7.7.6 | ||
47 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0010-brcmsmac-INTERMEDIATE-but-not-AMPDU-only-when-tracin.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0010-brcmsmac-INTERMEDIATE-but-not-AMPDU-only-when-tracin.patch new file mode 100644 index 00000000..a22e50df --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0010-brcmsmac-INTERMEDIATE-but-not-AMPDU-only-when-tracin.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From bc3f81b80966fcd6e91b61c76408eed675a1b364 Mon Sep 17 00:00:00 2001 | ||
2 | From: Eldad Zack <eldad@fogrefinery.com> | ||
3 | Date: Sun, 22 Apr 2012 00:48:04 +0200 | ||
4 | Subject: [PATCH 010/109] brcmsmac: "INTERMEDIATE but not AMPDU" only when | ||
5 | tracing | ||
6 | |||
7 | commit 6ead629b27269c553c9092c47cd8f5ab0309ee3b upstream. | ||
8 | |||
9 | I keep getting the following messages on the log buffer: | ||
10 | [ 2167.097507] ieee80211 phy0: brcms_c_dotxstatus: INTERMEDIATE but not AMPDU | ||
11 | [ 2281.331305] ieee80211 phy0: brcms_c_dotxstatus: INTERMEDIATE but not AMPDU | ||
12 | [ 2281.332539] ieee80211 phy0: brcms_c_dotxstatus: INTERMEDIATE but not AMPDU | ||
13 | [ 2329.876605] ieee80211 phy0: brcms_c_dotxstatus: INTERMEDIATE but not AMPDU | ||
14 | [ 2329.877354] ieee80211 phy0: brcms_c_dotxstatus: INTERMEDIATE but not AMPDU | ||
15 | [ 2462.280756] ieee80211 phy0: brcms_c_dotxstatus: INTERMEDIATE but not AMPDU | ||
16 | [ 2615.651689] ieee80211 phy0: brcms_c_dotxstatus: INTERMEDIATE but not AMPDU | ||
17 | |||
18 | From the code comment I understand that this something that can - | ||
19 | and does, quite frequently - happen. | ||
20 | |||
21 | Signed-off-by: Eldad Zack <eldad@fogrefinery.com> | ||
22 | Acked-by: Franky Lin<frankyl@broadcom.com> | ||
23 | Signed-off-by: John W. Linville <linville@tuxdriver.com> | ||
24 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
25 | --- | ||
26 | drivers/net/wireless/brcm80211/brcmsmac/main.c | 3 +-- | ||
27 | 1 files changed, 1 insertions(+), 2 deletions(-) | ||
28 | |||
29 | diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c | ||
30 | index 833cbef..8a40ff9 100644 | ||
31 | --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c | ||
32 | +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c | ||
33 | @@ -900,8 +900,7 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs) | ||
34 | */ | ||
35 | if (!(txs->status & TX_STATUS_AMPDU) | ||
36 | && (txs->status & TX_STATUS_INTERMEDIATE)) { | ||
37 | - wiphy_err(wlc->wiphy, "%s: INTERMEDIATE but not AMPDU\n", | ||
38 | - __func__); | ||
39 | + BCMMSG(wlc->wiphy, "INTERMEDIATE but not AMPDU\n"); | ||
40 | return false; | ||
41 | } | ||
42 | |||
43 | -- | ||
44 | 1.7.7.6 | ||
45 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0011-NFSv4-Rate-limit-the-state-manager-for-lock-reclaim-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0011-NFSv4-Rate-limit-the-state-manager-for-lock-reclaim-.patch new file mode 100644 index 00000000..44b7c816 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0011-NFSv4-Rate-limit-the-state-manager-for-lock-reclaim-.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From 9c6259f9486461da338a097ae1655d55b7bead3a Mon Sep 17 00:00:00 2001 | ||
2 | From: William Dauchy <wdauchy@gmail.com> | ||
3 | Date: Wed, 14 Mar 2012 12:32:04 +0100 | ||
4 | Subject: [PATCH 011/109] NFSv4: Rate limit the state manager for lock reclaim | ||
5 | warning messages | ||
6 | |||
7 | commit 96dcadc2fdd111dca90d559f189a30c65394451a upstream. | ||
8 | |||
9 | Adding rate limit on `Lock reclaim failed` messages since it could fill | ||
10 | up system logs | ||
11 | Signed-off-by: William Dauchy <wdauchy@gmail.com> | ||
12 | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> | ||
13 | [bwh: Backported to 3.2: add the 'NFS:' prefix at the same time] | ||
14 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
15 | --- | ||
16 | fs/nfs/nfs4state.c | 5 +++-- | ||
17 | 1 files changed, 3 insertions(+), 2 deletions(-) | ||
18 | |||
19 | diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c | ||
20 | index 66020ac..07354b7 100644 | ||
21 | --- a/fs/nfs/nfs4state.c | ||
22 | +++ b/fs/nfs/nfs4state.c | ||
23 | @@ -1186,8 +1186,9 @@ restart: | ||
24 | spin_lock(&state->state_lock); | ||
25 | list_for_each_entry(lock, &state->lock_states, ls_locks) { | ||
26 | if (!(lock->ls_flags & NFS_LOCK_INITIALIZED)) | ||
27 | - printk("%s: Lock reclaim failed!\n", | ||
28 | - __func__); | ||
29 | + pr_warn_ratelimited("NFS: " | ||
30 | + "%s: Lock reclaim " | ||
31 | + "failed!\n", __func__); | ||
32 | } | ||
33 | spin_unlock(&state->state_lock); | ||
34 | nfs4_put_open_state(state); | ||
35 | -- | ||
36 | 1.7.7.6 | ||
37 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0012-ext4-Report-max_batch_time-option-correctly.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0012-ext4-Report-max_batch_time-option-correctly.patch new file mode 100644 index 00000000..5bd27b49 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0012-ext4-Report-max_batch_time-option-correctly.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From 877ee75ef7f45fd1022c37f6a8a957e9d1b098b7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ben Hutchings <ben@decadent.org.uk> | ||
3 | Date: Wed, 4 Jan 2012 21:22:51 -0500 | ||
4 | Subject: [PATCH 012/109] ext4: Report max_batch_time option correctly | ||
5 | |||
6 | commit 1d526fc91bea04ee35b7599bf8b82f86c0aaf46c upstream. | ||
7 | |||
8 | Currently the value reported for max_batch_time is really the | ||
9 | value of min_batch_time. | ||
10 | |||
11 | Reported-by: Russell Coker <russell@coker.com.au> | ||
12 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
13 | --- | ||
14 | fs/ext4/super.c | 2 +- | ||
15 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
16 | |||
17 | diff --git a/fs/ext4/super.c b/fs/ext4/super.c | ||
18 | index ab7aa3f..a93486e 100644 | ||
19 | --- a/fs/ext4/super.c | ||
20 | +++ b/fs/ext4/super.c | ||
21 | @@ -1097,7 +1097,7 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs) | ||
22 | } | ||
23 | if (sbi->s_max_batch_time != EXT4_DEF_MAX_BATCH_TIME) { | ||
24 | seq_printf(seq, ",max_batch_time=%u", | ||
25 | - (unsigned) sbi->s_min_batch_time); | ||
26 | + (unsigned) sbi->s_max_batch_time); | ||
27 | } | ||
28 | |||
29 | /* | ||
30 | -- | ||
31 | 1.7.7.6 | ||
32 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0013-hugepages-fix-use-after-free-bug-in-quota-handling.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0013-hugepages-fix-use-after-free-bug-in-quota-handling.patch new file mode 100644 index 00000000..bdfa3864 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0013-hugepages-fix-use-after-free-bug-in-quota-handling.patch | |||
@@ -0,0 +1,464 @@ | |||
1 | From 5babdc7487f6c78c06d8e085efe841d91a77ff48 Mon Sep 17 00:00:00 2001 | ||
2 | From: David Gibson <david@gibson.dropbear.id.au> | ||
3 | Date: Wed, 21 Mar 2012 16:34:12 -0700 | ||
4 | Subject: [PATCH 013/109] hugepages: fix use after free bug in "quota" | ||
5 | handling | ||
6 | |||
7 | commit 90481622d75715bfcb68501280a917dbfe516029 upstream. | ||
8 | |||
9 | hugetlbfs_{get,put}_quota() are badly named. They don't interact with the | ||
10 | general quota handling code, and they don't much resemble its behaviour. | ||
11 | Rather than being about maintaining limits on on-disk block usage by | ||
12 | particular users, they are instead about maintaining limits on in-memory | ||
13 | page usage (including anonymous MAP_PRIVATE copied-on-write pages) | ||
14 | associated with a particular hugetlbfs filesystem instance. | ||
15 | |||
16 | Worse, they work by having callbacks to the hugetlbfs filesystem code from | ||
17 | the low-level page handling code, in particular from free_huge_page(). | ||
18 | This is a layering violation of itself, but more importantly, if the | ||
19 | kernel does a get_user_pages() on hugepages (which can happen from KVM | ||
20 | amongst others), then the free_huge_page() can be delayed until after the | ||
21 | associated inode has already been freed. If an unmount occurs at the | ||
22 | wrong time, even the hugetlbfs superblock where the "quota" limits are | ||
23 | stored may have been freed. | ||
24 | |||
25 | Andrew Barry proposed a patch to fix this by having hugepages, instead of | ||
26 | storing a pointer to their address_space and reaching the superblock from | ||
27 | there, had the hugepages store pointers directly to the superblock, | ||
28 | bumping the reference count as appropriate to avoid it being freed. | ||
29 | Andrew Morton rejected that version, however, on the grounds that it made | ||
30 | the existing layering violation worse. | ||
31 | |||
32 | This is a reworked version of Andrew's patch, which removes the extra, and | ||
33 | some of the existing, layering violation. It works by introducing the | ||
34 | concept of a hugepage "subpool" at the lower hugepage mm layer - that is a | ||
35 | finite logical pool of hugepages to allocate from. hugetlbfs now creates | ||
36 | a subpool for each filesystem instance with a page limit set, and a | ||
37 | pointer to the subpool gets added to each allocated hugepage, instead of | ||
38 | the address_space pointer used now. The subpool has its own lifetime and | ||
39 | is only freed once all pages in it _and_ all other references to it (i.e. | ||
40 | superblocks) are gone. | ||
41 | |||
42 | subpools are optional - a NULL subpool pointer is taken by the code to | ||
43 | mean that no subpool limits are in effect. | ||
44 | |||
45 | Previous discussion of this bug found in: "Fix refcounting in hugetlbfs | ||
46 | quota handling.". See: https://lkml.org/lkml/2011/8/11/28 or | ||
47 | http://marc.info/?l=linux-mm&m=126928970510627&w=1 | ||
48 | |||
49 | v2: Fixed a bug spotted by Hillf Danton, and removed the extra parameter to | ||
50 | alloc_huge_page() - since it already takes the vma, it is not necessary. | ||
51 | |||
52 | Signed-off-by: Andrew Barry <abarry@cray.com> | ||
53 | Signed-off-by: David Gibson <david@gibson.dropbear.id.au> | ||
54 | Cc: Hugh Dickins <hughd@google.com> | ||
55 | Cc: Mel Gorman <mgorman@suse.de> | ||
56 | Cc: Minchan Kim <minchan.kim@gmail.com> | ||
57 | Cc: Hillf Danton <dhillf@gmail.com> | ||
58 | Cc: Paul Mackerras <paulus@samba.org> | ||
59 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
60 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
61 | [bwh: Backported to 3.2: adjust context to apply after commit | ||
62 | c50ac050811d6485616a193eb0f37bfbd191cc89 'hugetlb: fix resv_map leak in | ||
63 | error path', backported in 3.2.20] | ||
64 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
65 | --- | ||
66 | fs/hugetlbfs/inode.c | 54 +++++++----------- | ||
67 | include/linux/hugetlb.h | 14 ++++-- | ||
68 | mm/hugetlb.c | 135 +++++++++++++++++++++++++++++++++++++--------- | ||
69 | 3 files changed, 139 insertions(+), 64 deletions(-) | ||
70 | |||
71 | diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c | ||
72 | index 2d0ca24..ebc2f4d 100644 | ||
73 | --- a/fs/hugetlbfs/inode.c | ||
74 | +++ b/fs/hugetlbfs/inode.c | ||
75 | @@ -592,9 +592,15 @@ static int hugetlbfs_statfs(struct dentry *dentry, struct kstatfs *buf) | ||
76 | spin_lock(&sbinfo->stat_lock); | ||
77 | /* If no limits set, just report 0 for max/free/used | ||
78 | * blocks, like simple_statfs() */ | ||
79 | - if (sbinfo->max_blocks >= 0) { | ||
80 | - buf->f_blocks = sbinfo->max_blocks; | ||
81 | - buf->f_bavail = buf->f_bfree = sbinfo->free_blocks; | ||
82 | + if (sbinfo->spool) { | ||
83 | + long free_pages; | ||
84 | + | ||
85 | + spin_lock(&sbinfo->spool->lock); | ||
86 | + buf->f_blocks = sbinfo->spool->max_hpages; | ||
87 | + free_pages = sbinfo->spool->max_hpages | ||
88 | + - sbinfo->spool->used_hpages; | ||
89 | + buf->f_bavail = buf->f_bfree = free_pages; | ||
90 | + spin_unlock(&sbinfo->spool->lock); | ||
91 | buf->f_files = sbinfo->max_inodes; | ||
92 | buf->f_ffree = sbinfo->free_inodes; | ||
93 | } | ||
94 | @@ -610,6 +616,10 @@ static void hugetlbfs_put_super(struct super_block *sb) | ||
95 | |||
96 | if (sbi) { | ||
97 | sb->s_fs_info = NULL; | ||
98 | + | ||
99 | + if (sbi->spool) | ||
100 | + hugepage_put_subpool(sbi->spool); | ||
101 | + | ||
102 | kfree(sbi); | ||
103 | } | ||
104 | } | ||
105 | @@ -841,10 +851,14 @@ hugetlbfs_fill_super(struct super_block *sb, void *data, int silent) | ||
106 | sb->s_fs_info = sbinfo; | ||
107 | sbinfo->hstate = config.hstate; | ||
108 | spin_lock_init(&sbinfo->stat_lock); | ||
109 | - sbinfo->max_blocks = config.nr_blocks; | ||
110 | - sbinfo->free_blocks = config.nr_blocks; | ||
111 | sbinfo->max_inodes = config.nr_inodes; | ||
112 | sbinfo->free_inodes = config.nr_inodes; | ||
113 | + sbinfo->spool = NULL; | ||
114 | + if (config.nr_blocks != -1) { | ||
115 | + sbinfo->spool = hugepage_new_subpool(config.nr_blocks); | ||
116 | + if (!sbinfo->spool) | ||
117 | + goto out_free; | ||
118 | + } | ||
119 | sb->s_maxbytes = MAX_LFS_FILESIZE; | ||
120 | sb->s_blocksize = huge_page_size(config.hstate); | ||
121 | sb->s_blocksize_bits = huge_page_shift(config.hstate); | ||
122 | @@ -864,38 +878,12 @@ hugetlbfs_fill_super(struct super_block *sb, void *data, int silent) | ||
123 | sb->s_root = root; | ||
124 | return 0; | ||
125 | out_free: | ||
126 | + if (sbinfo->spool) | ||
127 | + kfree(sbinfo->spool); | ||
128 | kfree(sbinfo); | ||
129 | return -ENOMEM; | ||
130 | } | ||
131 | |||
132 | -int hugetlb_get_quota(struct address_space *mapping, long delta) | ||
133 | -{ | ||
134 | - int ret = 0; | ||
135 | - struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(mapping->host->i_sb); | ||
136 | - | ||
137 | - if (sbinfo->free_blocks > -1) { | ||
138 | - spin_lock(&sbinfo->stat_lock); | ||
139 | - if (sbinfo->free_blocks - delta >= 0) | ||
140 | - sbinfo->free_blocks -= delta; | ||
141 | - else | ||
142 | - ret = -ENOMEM; | ||
143 | - spin_unlock(&sbinfo->stat_lock); | ||
144 | - } | ||
145 | - | ||
146 | - return ret; | ||
147 | -} | ||
148 | - | ||
149 | -void hugetlb_put_quota(struct address_space *mapping, long delta) | ||
150 | -{ | ||
151 | - struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(mapping->host->i_sb); | ||
152 | - | ||
153 | - if (sbinfo->free_blocks > -1) { | ||
154 | - spin_lock(&sbinfo->stat_lock); | ||
155 | - sbinfo->free_blocks += delta; | ||
156 | - spin_unlock(&sbinfo->stat_lock); | ||
157 | - } | ||
158 | -} | ||
159 | - | ||
160 | static struct dentry *hugetlbfs_mount(struct file_system_type *fs_type, | ||
161 | int flags, const char *dev_name, void *data) | ||
162 | { | ||
163 | diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h | ||
164 | index d9d6c86..c5ed2f1 100644 | ||
165 | --- a/include/linux/hugetlb.h | ||
166 | +++ b/include/linux/hugetlb.h | ||
167 | @@ -14,6 +14,15 @@ struct user_struct; | ||
168 | #include <linux/shm.h> | ||
169 | #include <asm/tlbflush.h> | ||
170 | |||
171 | +struct hugepage_subpool { | ||
172 | + spinlock_t lock; | ||
173 | + long count; | ||
174 | + long max_hpages, used_hpages; | ||
175 | +}; | ||
176 | + | ||
177 | +struct hugepage_subpool *hugepage_new_subpool(long nr_blocks); | ||
178 | +void hugepage_put_subpool(struct hugepage_subpool *spool); | ||
179 | + | ||
180 | int PageHuge(struct page *page); | ||
181 | |||
182 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); | ||
183 | @@ -138,12 +147,11 @@ struct hugetlbfs_config { | ||
184 | }; | ||
185 | |||
186 | struct hugetlbfs_sb_info { | ||
187 | - long max_blocks; /* blocks allowed */ | ||
188 | - long free_blocks; /* blocks free */ | ||
189 | long max_inodes; /* inodes allowed */ | ||
190 | long free_inodes; /* inodes free */ | ||
191 | spinlock_t stat_lock; | ||
192 | struct hstate *hstate; | ||
193 | + struct hugepage_subpool *spool; | ||
194 | }; | ||
195 | |||
196 | |||
197 | @@ -166,8 +174,6 @@ extern const struct file_operations hugetlbfs_file_operations; | ||
198 | extern const struct vm_operations_struct hugetlb_vm_ops; | ||
199 | struct file *hugetlb_file_setup(const char *name, size_t size, vm_flags_t acct, | ||
200 | struct user_struct **user, int creat_flags); | ||
201 | -int hugetlb_get_quota(struct address_space *mapping, long delta); | ||
202 | -void hugetlb_put_quota(struct address_space *mapping, long delta); | ||
203 | |||
204 | static inline int is_file_hugepages(struct file *file) | ||
205 | { | ||
206 | diff --git a/mm/hugetlb.c b/mm/hugetlb.c | ||
207 | index 5f5c545..7c535b0 100644 | ||
208 | --- a/mm/hugetlb.c | ||
209 | +++ b/mm/hugetlb.c | ||
210 | @@ -53,6 +53,84 @@ static unsigned long __initdata default_hstate_size; | ||
211 | */ | ||
212 | static DEFINE_SPINLOCK(hugetlb_lock); | ||
213 | |||
214 | +static inline void unlock_or_release_subpool(struct hugepage_subpool *spool) | ||
215 | +{ | ||
216 | + bool free = (spool->count == 0) && (spool->used_hpages == 0); | ||
217 | + | ||
218 | + spin_unlock(&spool->lock); | ||
219 | + | ||
220 | + /* If no pages are used, and no other handles to the subpool | ||
221 | + * remain, free the subpool the subpool remain */ | ||
222 | + if (free) | ||
223 | + kfree(spool); | ||
224 | +} | ||
225 | + | ||
226 | +struct hugepage_subpool *hugepage_new_subpool(long nr_blocks) | ||
227 | +{ | ||
228 | + struct hugepage_subpool *spool; | ||
229 | + | ||
230 | + spool = kmalloc(sizeof(*spool), GFP_KERNEL); | ||
231 | + if (!spool) | ||
232 | + return NULL; | ||
233 | + | ||
234 | + spin_lock_init(&spool->lock); | ||
235 | + spool->count = 1; | ||
236 | + spool->max_hpages = nr_blocks; | ||
237 | + spool->used_hpages = 0; | ||
238 | + | ||
239 | + return spool; | ||
240 | +} | ||
241 | + | ||
242 | +void hugepage_put_subpool(struct hugepage_subpool *spool) | ||
243 | +{ | ||
244 | + spin_lock(&spool->lock); | ||
245 | + BUG_ON(!spool->count); | ||
246 | + spool->count--; | ||
247 | + unlock_or_release_subpool(spool); | ||
248 | +} | ||
249 | + | ||
250 | +static int hugepage_subpool_get_pages(struct hugepage_subpool *spool, | ||
251 | + long delta) | ||
252 | +{ | ||
253 | + int ret = 0; | ||
254 | + | ||
255 | + if (!spool) | ||
256 | + return 0; | ||
257 | + | ||
258 | + spin_lock(&spool->lock); | ||
259 | + if ((spool->used_hpages + delta) <= spool->max_hpages) { | ||
260 | + spool->used_hpages += delta; | ||
261 | + } else { | ||
262 | + ret = -ENOMEM; | ||
263 | + } | ||
264 | + spin_unlock(&spool->lock); | ||
265 | + | ||
266 | + return ret; | ||
267 | +} | ||
268 | + | ||
269 | +static void hugepage_subpool_put_pages(struct hugepage_subpool *spool, | ||
270 | + long delta) | ||
271 | +{ | ||
272 | + if (!spool) | ||
273 | + return; | ||
274 | + | ||
275 | + spin_lock(&spool->lock); | ||
276 | + spool->used_hpages -= delta; | ||
277 | + /* If hugetlbfs_put_super couldn't free spool due to | ||
278 | + * an outstanding quota reference, free it now. */ | ||
279 | + unlock_or_release_subpool(spool); | ||
280 | +} | ||
281 | + | ||
282 | +static inline struct hugepage_subpool *subpool_inode(struct inode *inode) | ||
283 | +{ | ||
284 | + return HUGETLBFS_SB(inode->i_sb)->spool; | ||
285 | +} | ||
286 | + | ||
287 | +static inline struct hugepage_subpool *subpool_vma(struct vm_area_struct *vma) | ||
288 | +{ | ||
289 | + return subpool_inode(vma->vm_file->f_dentry->d_inode); | ||
290 | +} | ||
291 | + | ||
292 | /* | ||
293 | * Region tracking -- allows tracking of reservations and instantiated pages | ||
294 | * across the pages in a mapping. | ||
295 | @@ -533,9 +611,9 @@ static void free_huge_page(struct page *page) | ||
296 | */ | ||
297 | struct hstate *h = page_hstate(page); | ||
298 | int nid = page_to_nid(page); | ||
299 | - struct address_space *mapping; | ||
300 | + struct hugepage_subpool *spool = | ||
301 | + (struct hugepage_subpool *)page_private(page); | ||
302 | |||
303 | - mapping = (struct address_space *) page_private(page); | ||
304 | set_page_private(page, 0); | ||
305 | page->mapping = NULL; | ||
306 | BUG_ON(page_count(page)); | ||
307 | @@ -551,8 +629,7 @@ static void free_huge_page(struct page *page) | ||
308 | enqueue_huge_page(h, page); | ||
309 | } | ||
310 | spin_unlock(&hugetlb_lock); | ||
311 | - if (mapping) | ||
312 | - hugetlb_put_quota(mapping, 1); | ||
313 | + hugepage_subpool_put_pages(spool, 1); | ||
314 | } | ||
315 | |||
316 | static void prep_new_huge_page(struct hstate *h, struct page *page, int nid) | ||
317 | @@ -966,11 +1043,12 @@ static void return_unused_surplus_pages(struct hstate *h, | ||
318 | /* | ||
319 | * Determine if the huge page at addr within the vma has an associated | ||
320 | * reservation. Where it does not we will need to logically increase | ||
321 | - * reservation and actually increase quota before an allocation can occur. | ||
322 | - * Where any new reservation would be required the reservation change is | ||
323 | - * prepared, but not committed. Once the page has been quota'd allocated | ||
324 | - * an instantiated the change should be committed via vma_commit_reservation. | ||
325 | - * No action is required on failure. | ||
326 | + * reservation and actually increase subpool usage before an allocation | ||
327 | + * can occur. Where any new reservation would be required the | ||
328 | + * reservation change is prepared, but not committed. Once the page | ||
329 | + * has been allocated from the subpool and instantiated the change should | ||
330 | + * be committed via vma_commit_reservation. No action is required on | ||
331 | + * failure. | ||
332 | */ | ||
333 | static long vma_needs_reservation(struct hstate *h, | ||
334 | struct vm_area_struct *vma, unsigned long addr) | ||
335 | @@ -1019,24 +1097,24 @@ static void vma_commit_reservation(struct hstate *h, | ||
336 | static struct page *alloc_huge_page(struct vm_area_struct *vma, | ||
337 | unsigned long addr, int avoid_reserve) | ||
338 | { | ||
339 | + struct hugepage_subpool *spool = subpool_vma(vma); | ||
340 | struct hstate *h = hstate_vma(vma); | ||
341 | struct page *page; | ||
342 | - struct address_space *mapping = vma->vm_file->f_mapping; | ||
343 | - struct inode *inode = mapping->host; | ||
344 | long chg; | ||
345 | |||
346 | /* | ||
347 | - * Processes that did not create the mapping will have no reserves and | ||
348 | - * will not have accounted against quota. Check that the quota can be | ||
349 | - * made before satisfying the allocation | ||
350 | - * MAP_NORESERVE mappings may also need pages and quota allocated | ||
351 | - * if no reserve mapping overlaps. | ||
352 | + * Processes that did not create the mapping will have no | ||
353 | + * reserves and will not have accounted against subpool | ||
354 | + * limit. Check that the subpool limit can be made before | ||
355 | + * satisfying the allocation MAP_NORESERVE mappings may also | ||
356 | + * need pages and subpool limit allocated allocated if no reserve | ||
357 | + * mapping overlaps. | ||
358 | */ | ||
359 | chg = vma_needs_reservation(h, vma, addr); | ||
360 | if (chg < 0) | ||
361 | return ERR_PTR(-VM_FAULT_OOM); | ||
362 | if (chg) | ||
363 | - if (hugetlb_get_quota(inode->i_mapping, chg)) | ||
364 | + if (hugepage_subpool_get_pages(spool, chg)) | ||
365 | return ERR_PTR(-VM_FAULT_SIGBUS); | ||
366 | |||
367 | spin_lock(&hugetlb_lock); | ||
368 | @@ -1046,12 +1124,12 @@ static struct page *alloc_huge_page(struct vm_area_struct *vma, | ||
369 | if (!page) { | ||
370 | page = alloc_buddy_huge_page(h, NUMA_NO_NODE); | ||
371 | if (!page) { | ||
372 | - hugetlb_put_quota(inode->i_mapping, chg); | ||
373 | + hugepage_subpool_put_pages(spool, chg); | ||
374 | return ERR_PTR(-VM_FAULT_SIGBUS); | ||
375 | } | ||
376 | } | ||
377 | |||
378 | - set_page_private(page, (unsigned long) mapping); | ||
379 | + set_page_private(page, (unsigned long)spool); | ||
380 | |||
381 | vma_commit_reservation(h, vma, addr); | ||
382 | |||
383 | @@ -2081,6 +2159,7 @@ static void hugetlb_vm_op_close(struct vm_area_struct *vma) | ||
384 | { | ||
385 | struct hstate *h = hstate_vma(vma); | ||
386 | struct resv_map *reservations = vma_resv_map(vma); | ||
387 | + struct hugepage_subpool *spool = subpool_vma(vma); | ||
388 | unsigned long reserve; | ||
389 | unsigned long start; | ||
390 | unsigned long end; | ||
391 | @@ -2096,7 +2175,7 @@ static void hugetlb_vm_op_close(struct vm_area_struct *vma) | ||
392 | |||
393 | if (reserve) { | ||
394 | hugetlb_acct_memory(h, -reserve); | ||
395 | - hugetlb_put_quota(vma->vm_file->f_mapping, reserve); | ||
396 | + hugepage_subpool_put_pages(spool, reserve); | ||
397 | } | ||
398 | } | ||
399 | } | ||
400 | @@ -2326,7 +2405,7 @@ static int unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma, | ||
401 | address = address & huge_page_mask(h); | ||
402 | pgoff = ((address - vma->vm_start) >> PAGE_SHIFT) | ||
403 | + (vma->vm_pgoff >> PAGE_SHIFT); | ||
404 | - mapping = (struct address_space *)page_private(page); | ||
405 | + mapping = vma->vm_file->f_dentry->d_inode->i_mapping; | ||
406 | |||
407 | /* | ||
408 | * Take the mapping lock for the duration of the table walk. As | ||
409 | @@ -2865,11 +2944,12 @@ int hugetlb_reserve_pages(struct inode *inode, | ||
410 | { | ||
411 | long ret, chg; | ||
412 | struct hstate *h = hstate_inode(inode); | ||
413 | + struct hugepage_subpool *spool = subpool_inode(inode); | ||
414 | |||
415 | /* | ||
416 | * Only apply hugepage reservation if asked. At fault time, an | ||
417 | * attempt will be made for VM_NORESERVE to allocate a page | ||
418 | - * and filesystem quota without using reserves | ||
419 | + * without using reserves | ||
420 | */ | ||
421 | if (vm_flags & VM_NORESERVE) | ||
422 | return 0; | ||
423 | @@ -2898,19 +2978,19 @@ int hugetlb_reserve_pages(struct inode *inode, | ||
424 | goto out_err; | ||
425 | } | ||
426 | |||
427 | - /* There must be enough filesystem quota for the mapping */ | ||
428 | - if (hugetlb_get_quota(inode->i_mapping, chg)) { | ||
429 | + /* There must be enough pages in the subpool for the mapping */ | ||
430 | + if (hugepage_subpool_get_pages(spool, chg)) { | ||
431 | ret = -ENOSPC; | ||
432 | goto out_err; | ||
433 | } | ||
434 | |||
435 | /* | ||
436 | * Check enough hugepages are available for the reservation. | ||
437 | - * Hand back the quota if there are not | ||
438 | + * Hand the pages back to the subpool if there are not | ||
439 | */ | ||
440 | ret = hugetlb_acct_memory(h, chg); | ||
441 | if (ret < 0) { | ||
442 | - hugetlb_put_quota(inode->i_mapping, chg); | ||
443 | + hugepage_subpool_put_pages(spool, chg); | ||
444 | goto out_err; | ||
445 | } | ||
446 | |||
447 | @@ -2938,12 +3018,13 @@ void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed) | ||
448 | { | ||
449 | struct hstate *h = hstate_inode(inode); | ||
450 | long chg = region_truncate(&inode->i_mapping->private_list, offset); | ||
451 | + struct hugepage_subpool *spool = subpool_inode(inode); | ||
452 | |||
453 | spin_lock(&inode->i_lock); | ||
454 | inode->i_blocks -= (blocks_per_huge_page(h) * freed); | ||
455 | spin_unlock(&inode->i_lock); | ||
456 | |||
457 | - hugetlb_put_quota(inode->i_mapping, (chg - freed)); | ||
458 | + hugepage_subpool_put_pages(spool, (chg - freed)); | ||
459 | hugetlb_acct_memory(h, -(chg - freed)); | ||
460 | } | ||
461 | |||
462 | -- | ||
463 | 1.7.7.6 | ||
464 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0014-NFSv4-Reduce-the-footprint-of-the-idmapper.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0014-NFSv4-Reduce-the-footprint-of-the-idmapper.patch new file mode 100644 index 00000000..008fc3ed --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0014-NFSv4-Reduce-the-footprint-of-the-idmapper.patch | |||
@@ -0,0 +1,69 @@ | |||
1 | From e45792228b6a4487d859334c757322554c960397 Mon Sep 17 00:00:00 2001 | ||
2 | From: Trond Myklebust <Trond.Myklebust@netapp.com> | ||
3 | Date: Tue, 7 Feb 2012 14:59:05 -0500 | ||
4 | Subject: [PATCH 014/109] NFSv4: Reduce the footprint of the idmapper | ||
5 | |||
6 | commit d073e9b541e1ac3f52d72c3a153855d9a9ee3278 upstream. | ||
7 | |||
8 | Instead of pre-allocating the storage for all the strings, we can | ||
9 | significantly reduce the size of that table by doing the allocation | ||
10 | when we do the downcall. | ||
11 | |||
12 | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> | ||
13 | Reviewed-by: Jeff Layton <jlayton@redhat.com> | ||
14 | [bwh: Backported to 3.2: adjust context in nfs_idmap_delete()] | ||
15 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
16 | --- | ||
17 | fs/nfs/idmap.c | 16 +++++++++++++--- | ||
18 | 1 files changed, 13 insertions(+), 3 deletions(-) | ||
19 | |||
20 | diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c | ||
21 | index 47d1c6f..b8c41c3 100644 | ||
22 | --- a/fs/nfs/idmap.c | ||
23 | +++ b/fs/nfs/idmap.c | ||
24 | @@ -318,7 +318,7 @@ struct idmap_hashent { | ||
25 | unsigned long ih_expires; | ||
26 | __u32 ih_id; | ||
27 | size_t ih_namelen; | ||
28 | - char ih_name[IDMAP_NAMESZ]; | ||
29 | + const char *ih_name; | ||
30 | }; | ||
31 | |||
32 | struct idmap_hashtable { | ||
33 | @@ -382,11 +382,16 @@ void | ||
34 | nfs_idmap_delete(struct nfs_client *clp) | ||
35 | { | ||
36 | struct idmap *idmap = clp->cl_idmap; | ||
37 | + int i; | ||
38 | |||
39 | if (!idmap) | ||
40 | return; | ||
41 | rpc_unlink(idmap->idmap_dentry); | ||
42 | clp->cl_idmap = NULL; | ||
43 | + for (i = 0; i < ARRAY_SIZE(idmap->idmap_user_hash.h_entries); i++) | ||
44 | + kfree(idmap->idmap_user_hash.h_entries[i].ih_name); | ||
45 | + for (i = 0; i < ARRAY_SIZE(idmap->idmap_group_hash.h_entries); i++) | ||
46 | + kfree(idmap->idmap_group_hash.h_entries[i].ih_name); | ||
47 | kfree(idmap); | ||
48 | } | ||
49 | |||
50 | @@ -449,9 +454,14 @@ static void | ||
51 | idmap_update_entry(struct idmap_hashent *he, const char *name, | ||
52 | size_t namelen, __u32 id) | ||
53 | { | ||
54 | + char *str = kmalloc(namelen + 1, GFP_KERNEL); | ||
55 | + if (str == NULL) | ||
56 | + return; | ||
57 | + kfree(he->ih_name); | ||
58 | he->ih_id = id; | ||
59 | - memcpy(he->ih_name, name, namelen); | ||
60 | - he->ih_name[namelen] = '\0'; | ||
61 | + memcpy(str, name, namelen); | ||
62 | + str[namelen] = '\0'; | ||
63 | + he->ih_name = str; | ||
64 | he->ih_namelen = namelen; | ||
65 | he->ih_expires = jiffies + nfs_idmap_cache_timeout; | ||
66 | } | ||
67 | -- | ||
68 | 1.7.7.6 | ||
69 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0015-NFSv4-Further-reduce-the-footprint-of-the-idmapper.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0015-NFSv4-Further-reduce-the-footprint-of-the-idmapper.patch new file mode 100644 index 00000000..018a5ef3 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0015-NFSv4-Further-reduce-the-footprint-of-the-idmapper.patch | |||
@@ -0,0 +1,131 @@ | |||
1 | From c297b1ec9340ec265bceeb8c1b8198ee476f0573 Mon Sep 17 00:00:00 2001 | ||
2 | From: Trond Myklebust <Trond.Myklebust@netapp.com> | ||
3 | Date: Wed, 8 Feb 2012 13:39:15 -0500 | ||
4 | Subject: [PATCH 015/109] NFSv4: Further reduce the footprint of the idmapper | ||
5 | |||
6 | commit 685f50f9188ac1e8244d0340a9d6ea36b6136cec upstream. | ||
7 | |||
8 | Don't allocate the legacy idmapper tables until we actually need | ||
9 | them. | ||
10 | |||
11 | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> | ||
12 | Reviewed-by: Jeff Layton <jlayton@redhat.com> | ||
13 | [bwh: Backported to 3.2: adjust context in nfs_idmap_delete()] | ||
14 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
15 | --- | ||
16 | fs/nfs/idmap.c | 42 ++++++++++++++++++++++++++++++++++++------ | ||
17 | 1 files changed, 36 insertions(+), 6 deletions(-) | ||
18 | |||
19 | diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c | ||
20 | index b8c41c3..b122af8 100644 | ||
21 | --- a/fs/nfs/idmap.c | ||
22 | +++ b/fs/nfs/idmap.c | ||
23 | @@ -323,7 +323,7 @@ struct idmap_hashent { | ||
24 | |||
25 | struct idmap_hashtable { | ||
26 | __u8 h_type; | ||
27 | - struct idmap_hashent h_entries[IDMAP_HASH_SZ]; | ||
28 | + struct idmap_hashent *h_entries; | ||
29 | }; | ||
30 | |||
31 | struct idmap { | ||
32 | @@ -378,20 +378,39 @@ nfs_idmap_new(struct nfs_client *clp) | ||
33 | return 0; | ||
34 | } | ||
35 | |||
36 | +static void | ||
37 | +idmap_alloc_hashtable(struct idmap_hashtable *h) | ||
38 | +{ | ||
39 | + if (h->h_entries != NULL) | ||
40 | + return; | ||
41 | + h->h_entries = kcalloc(IDMAP_HASH_SZ, | ||
42 | + sizeof(*h->h_entries), | ||
43 | + GFP_KERNEL); | ||
44 | +} | ||
45 | + | ||
46 | +static void | ||
47 | +idmap_free_hashtable(struct idmap_hashtable *h) | ||
48 | +{ | ||
49 | + int i; | ||
50 | + | ||
51 | + if (h->h_entries == NULL) | ||
52 | + return; | ||
53 | + for (i = 0; i < IDMAP_HASH_SZ; i++) | ||
54 | + kfree(h->h_entries[i].ih_name); | ||
55 | + kfree(h->h_entries); | ||
56 | +} | ||
57 | + | ||
58 | void | ||
59 | nfs_idmap_delete(struct nfs_client *clp) | ||
60 | { | ||
61 | struct idmap *idmap = clp->cl_idmap; | ||
62 | - int i; | ||
63 | |||
64 | if (!idmap) | ||
65 | return; | ||
66 | rpc_unlink(idmap->idmap_dentry); | ||
67 | clp->cl_idmap = NULL; | ||
68 | - for (i = 0; i < ARRAY_SIZE(idmap->idmap_user_hash.h_entries); i++) | ||
69 | - kfree(idmap->idmap_user_hash.h_entries[i].ih_name); | ||
70 | - for (i = 0; i < ARRAY_SIZE(idmap->idmap_group_hash.h_entries); i++) | ||
71 | - kfree(idmap->idmap_group_hash.h_entries[i].ih_name); | ||
72 | + idmap_free_hashtable(&idmap->idmap_user_hash); | ||
73 | + idmap_free_hashtable(&idmap->idmap_group_hash); | ||
74 | kfree(idmap); | ||
75 | } | ||
76 | |||
77 | @@ -401,6 +420,8 @@ nfs_idmap_delete(struct nfs_client *clp) | ||
78 | static inline struct idmap_hashent * | ||
79 | idmap_name_hash(struct idmap_hashtable* h, const char *name, size_t len) | ||
80 | { | ||
81 | + if (h->h_entries == NULL) | ||
82 | + return NULL; | ||
83 | return &h->h_entries[fnvhash32(name, len) % IDMAP_HASH_SZ]; | ||
84 | } | ||
85 | |||
86 | @@ -409,6 +430,8 @@ idmap_lookup_name(struct idmap_hashtable *h, const char *name, size_t len) | ||
87 | { | ||
88 | struct idmap_hashent *he = idmap_name_hash(h, name, len); | ||
89 | |||
90 | + if (he == NULL) | ||
91 | + return NULL; | ||
92 | if (he->ih_namelen != len || memcmp(he->ih_name, name, len) != 0) | ||
93 | return NULL; | ||
94 | if (time_after(jiffies, he->ih_expires)) | ||
95 | @@ -419,6 +442,8 @@ idmap_lookup_name(struct idmap_hashtable *h, const char *name, size_t len) | ||
96 | static inline struct idmap_hashent * | ||
97 | idmap_id_hash(struct idmap_hashtable* h, __u32 id) | ||
98 | { | ||
99 | + if (h->h_entries == NULL) | ||
100 | + return NULL; | ||
101 | return &h->h_entries[fnvhash32(&id, sizeof(id)) % IDMAP_HASH_SZ]; | ||
102 | } | ||
103 | |||
104 | @@ -426,6 +451,9 @@ static struct idmap_hashent * | ||
105 | idmap_lookup_id(struct idmap_hashtable *h, __u32 id) | ||
106 | { | ||
107 | struct idmap_hashent *he = idmap_id_hash(h, id); | ||
108 | + | ||
109 | + if (he == NULL) | ||
110 | + return NULL; | ||
111 | if (he->ih_id != id || he->ih_namelen == 0) | ||
112 | return NULL; | ||
113 | if (time_after(jiffies, he->ih_expires)) | ||
114 | @@ -441,12 +469,14 @@ idmap_lookup_id(struct idmap_hashtable *h, __u32 id) | ||
115 | static inline struct idmap_hashent * | ||
116 | idmap_alloc_name(struct idmap_hashtable *h, char *name, size_t len) | ||
117 | { | ||
118 | + idmap_alloc_hashtable(h); | ||
119 | return idmap_name_hash(h, name, len); | ||
120 | } | ||
121 | |||
122 | static inline struct idmap_hashent * | ||
123 | idmap_alloc_id(struct idmap_hashtable *h, __u32 id) | ||
124 | { | ||
125 | + idmap_alloc_hashtable(h); | ||
126 | return idmap_id_hash(h, id); | ||
127 | } | ||
128 | |||
129 | -- | ||
130 | 1.7.7.6 | ||
131 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0016-macvtap-zerocopy-fix-offset-calculation-when-buildin.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0016-macvtap-zerocopy-fix-offset-calculation-when-buildin.patch new file mode 100644 index 00000000..d19f672e --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0016-macvtap-zerocopy-fix-offset-calculation-when-buildin.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | From 6c4e2ff1b19d58c2a2f016d25b96eee0f733d7aa Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Wang <jasowang@redhat.com> | ||
3 | Date: Wed, 2 May 2012 11:41:30 +0800 | ||
4 | Subject: [PATCH 016/109] macvtap: zerocopy: fix offset calculation when | ||
5 | building skb | ||
6 | |||
7 | commit 3afc9621f15701c557e60f61eba9242bac2771dd upstream. | ||
8 | |||
9 | This patch fixes the offset calculation when building skb: | ||
10 | |||
11 | - offset1 were used as skb data offset not vector offset | ||
12 | - reset offset to zero only when we advance to next vector | ||
13 | |||
14 | Signed-off-by: Jason Wang <jasowang@redhat.com> | ||
15 | Signed-off-by: Michael S. Tsirkin <mst@redhat.com> | ||
16 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
17 | --- | ||
18 | drivers/net/macvtap.c | 13 +++++++------ | ||
19 | 1 files changed, 7 insertions(+), 6 deletions(-) | ||
20 | |||
21 | diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c | ||
22 | index 1b7082d..4505008 100644 | ||
23 | --- a/drivers/net/macvtap.c | ||
24 | +++ b/drivers/net/macvtap.c | ||
25 | @@ -504,10 +504,11 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from, | ||
26 | if (copy > size) { | ||
27 | ++from; | ||
28 | --count; | ||
29 | - } | ||
30 | + offset = 0; | ||
31 | + } else | ||
32 | + offset += size; | ||
33 | copy -= size; | ||
34 | offset1 += size; | ||
35 | - offset = 0; | ||
36 | } | ||
37 | |||
38 | if (len == offset1) | ||
39 | @@ -518,13 +519,13 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from, | ||
40 | int num_pages; | ||
41 | unsigned long base; | ||
42 | |||
43 | - len = from->iov_len - offset1; | ||
44 | + len = from->iov_len - offset; | ||
45 | if (!len) { | ||
46 | - offset1 = 0; | ||
47 | + offset = 0; | ||
48 | ++from; | ||
49 | continue; | ||
50 | } | ||
51 | - base = (unsigned long)from->iov_base + offset1; | ||
52 | + base = (unsigned long)from->iov_base + offset; | ||
53 | size = ((base & ~PAGE_MASK) + len + ~PAGE_MASK) >> PAGE_SHIFT; | ||
54 | num_pages = get_user_pages_fast(base, size, 0, &page[i]); | ||
55 | if ((num_pages != size) || | ||
56 | @@ -545,7 +546,7 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from, | ||
57 | len -= size; | ||
58 | i++; | ||
59 | } | ||
60 | - offset1 = 0; | ||
61 | + offset = 0; | ||
62 | ++from; | ||
63 | } | ||
64 | return 0; | ||
65 | -- | ||
66 | 1.7.7.6 | ||
67 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0017-macvtap-zerocopy-fix-truesize-underestimation.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0017-macvtap-zerocopy-fix-truesize-underestimation.patch new file mode 100644 index 00000000..b00f0b92 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0017-macvtap-zerocopy-fix-truesize-underestimation.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From e2261c8945dd5af5a0627ac72f7a39f676f3b657 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Wang <jasowang@redhat.com> | ||
3 | Date: Wed, 2 May 2012 11:41:44 +0800 | ||
4 | Subject: [PATCH 017/109] macvtap: zerocopy: fix truesize underestimation | ||
5 | |||
6 | commit 4ef67ebedffa44ed9939b34708ac2fee06d2f65f upstream. | ||
7 | |||
8 | As the skb fragment were pinned/built from user pages, we should | ||
9 | account the page instead of length for truesize. | ||
10 | |||
11 | Signed-off-by: Jason Wang <jasowang@redhat.com> | ||
12 | Signed-off-by: Michael S. Tsirkin <mst@redhat.com> | ||
13 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
14 | --- | ||
15 | drivers/net/macvtap.c | 6 ++++-- | ||
16 | 1 files changed, 4 insertions(+), 2 deletions(-) | ||
17 | |||
18 | diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c | ||
19 | index 4505008..c7a84eb 100644 | ||
20 | --- a/drivers/net/macvtap.c | ||
21 | +++ b/drivers/net/macvtap.c | ||
22 | @@ -518,6 +518,7 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from, | ||
23 | struct page *page[MAX_SKB_FRAGS]; | ||
24 | int num_pages; | ||
25 | unsigned long base; | ||
26 | + unsigned long truesize; | ||
27 | |||
28 | len = from->iov_len - offset; | ||
29 | if (!len) { | ||
30 | @@ -532,10 +533,11 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from, | ||
31 | (num_pages > MAX_SKB_FRAGS - skb_shinfo(skb)->nr_frags)) | ||
32 | /* put_page is in skb free */ | ||
33 | return -EFAULT; | ||
34 | + truesize = size * PAGE_SIZE; | ||
35 | skb->data_len += len; | ||
36 | skb->len += len; | ||
37 | - skb->truesize += len; | ||
38 | - atomic_add(len, &skb->sk->sk_wmem_alloc); | ||
39 | + skb->truesize += truesize; | ||
40 | + atomic_add(truesize, &skb->sk->sk_wmem_alloc); | ||
41 | while (len) { | ||
42 | int off = base & ~PAGE_MASK; | ||
43 | int size = min_t(int, len, PAGE_SIZE - off); | ||
44 | -- | ||
45 | 1.7.7.6 | ||
46 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0018-macvtap-zerocopy-put-page-when-fail-to-get-all-reque.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0018-macvtap-zerocopy-put-page-when-fail-to-get-all-reque.patch new file mode 100644 index 00000000..55fc0731 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0018-macvtap-zerocopy-put-page-when-fail-to-get-all-reque.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From 13d71d7ee644607d525480330c8b6a4268c18c0e Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Wang <jasowang@redhat.com> | ||
3 | Date: Wed, 2 May 2012 11:41:58 +0800 | ||
4 | Subject: [PATCH 018/109] macvtap: zerocopy: put page when fail to get all | ||
5 | requested user pages | ||
6 | |||
7 | commit 02ce04bb3d28c3333231f43bca677228dbc686fe upstream. | ||
8 | |||
9 | When get_user_pages_fast() fails to get all requested pages, we could not use | ||
10 | kfree_skb() to free it as it has not been put in the skb fragments. So we need | ||
11 | to call put_page() instead. | ||
12 | |||
13 | Signed-off-by: Jason Wang <jasowang@redhat.com> | ||
14 | Signed-off-by: Michael S. Tsirkin <mst@redhat.com> | ||
15 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
16 | --- | ||
17 | drivers/net/macvtap.c | 6 ++++-- | ||
18 | 1 files changed, 4 insertions(+), 2 deletions(-) | ||
19 | |||
20 | diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c | ||
21 | index c7a84eb..f217247 100644 | ||
22 | --- a/drivers/net/macvtap.c | ||
23 | +++ b/drivers/net/macvtap.c | ||
24 | @@ -530,9 +530,11 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from, | ||
25 | size = ((base & ~PAGE_MASK) + len + ~PAGE_MASK) >> PAGE_SHIFT; | ||
26 | num_pages = get_user_pages_fast(base, size, 0, &page[i]); | ||
27 | if ((num_pages != size) || | ||
28 | - (num_pages > MAX_SKB_FRAGS - skb_shinfo(skb)->nr_frags)) | ||
29 | - /* put_page is in skb free */ | ||
30 | + (num_pages > MAX_SKB_FRAGS - skb_shinfo(skb)->nr_frags)) { | ||
31 | + for (i = 0; i < num_pages; i++) | ||
32 | + put_page(page[i]); | ||
33 | return -EFAULT; | ||
34 | + } | ||
35 | truesize = size * PAGE_SIZE; | ||
36 | skb->data_len += len; | ||
37 | skb->len += len; | ||
38 | -- | ||
39 | 1.7.7.6 | ||
40 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0019-macvtap-zerocopy-set-SKBTX_DEV_ZEROCOPY-only-when-sk.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0019-macvtap-zerocopy-set-SKBTX_DEV_ZEROCOPY-only-when-sk.patch new file mode 100644 index 00000000..737ed5c9 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0019-macvtap-zerocopy-set-SKBTX_DEV_ZEROCOPY-only-when-sk.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From c57df8c118c4c11ef6023034aa454636dd8780db Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Wang <jasowang@redhat.com> | ||
3 | Date: Wed, 2 May 2012 11:42:06 +0800 | ||
4 | Subject: [PATCH 019/109] macvtap: zerocopy: set SKBTX_DEV_ZEROCOPY only when | ||
5 | skb is built successfully | ||
6 | |||
7 | commit 01d6657b388438def19c8baaea28e742b6ed32ec upstream. | ||
8 | |||
9 | Current the SKBTX_DEV_ZEROCOPY is set unconditionally after | ||
10 | zerocopy_sg_from_iovec(), this would lead NULL pointer when macvtap | ||
11 | fails to build zerocopy skb because destructor_arg was not | ||
12 | initialized. Solve this by set this flag after the skb were built | ||
13 | successfully. | ||
14 | |||
15 | Signed-off-by: Jason Wang <jasowang@redhat.com> | ||
16 | Signed-off-by: Michael S. Tsirkin <mst@redhat.com> | ||
17 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
18 | --- | ||
19 | drivers/net/macvtap.c | 9 +++++---- | ||
20 | 1 files changed, 5 insertions(+), 4 deletions(-) | ||
21 | |||
22 | diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c | ||
23 | index f217247..7fecd66 100644 | ||
24 | --- a/drivers/net/macvtap.c | ||
25 | +++ b/drivers/net/macvtap.c | ||
26 | @@ -698,10 +698,9 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m, | ||
27 | if (!skb) | ||
28 | goto err; | ||
29 | |||
30 | - if (zerocopy) { | ||
31 | + if (zerocopy) | ||
32 | err = zerocopy_sg_from_iovec(skb, iv, vnet_hdr_len, count); | ||
33 | - skb_shinfo(skb)->tx_flags |= SKBTX_DEV_ZEROCOPY; | ||
34 | - } else | ||
35 | + else | ||
36 | err = skb_copy_datagram_from_iovec(skb, 0, iv, vnet_hdr_len, | ||
37 | len); | ||
38 | if (err) | ||
39 | @@ -720,8 +719,10 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m, | ||
40 | rcu_read_lock_bh(); | ||
41 | vlan = rcu_dereference_bh(q->vlan); | ||
42 | /* copy skb_ubuf_info for callback when skb has no error */ | ||
43 | - if (zerocopy) | ||
44 | + if (zerocopy) { | ||
45 | skb_shinfo(skb)->destructor_arg = m->msg_control; | ||
46 | + skb_shinfo(skb)->tx_flags |= SKBTX_DEV_ZEROCOPY; | ||
47 | + } | ||
48 | if (vlan) | ||
49 | macvlan_start_xmit(skb, vlan->dev); | ||
50 | else | ||
51 | -- | ||
52 | 1.7.7.6 | ||
53 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0020-macvtap-zerocopy-validate-vectors-before-building-sk.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0020-macvtap-zerocopy-validate-vectors-before-building-sk.patch new file mode 100644 index 00000000..a46ddcbc --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0020-macvtap-zerocopy-validate-vectors-before-building-sk.patch | |||
@@ -0,0 +1,84 @@ | |||
1 | From c93ad33631e3efbb6f02f24c6b6817227b2c9252 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Wang <jasowang@redhat.com> | ||
3 | Date: Wed, 2 May 2012 11:42:15 +0800 | ||
4 | Subject: [PATCH 020/109] macvtap: zerocopy: validate vectors before building | ||
5 | skb | ||
6 | |||
7 | commit b92946e2919134ebe2a4083e4302236295ea2a73 upstream. | ||
8 | |||
9 | There're several reasons that the vectors need to be validated: | ||
10 | |||
11 | - Return error when caller provides vectors whose num is greater than UIO_MAXIOV. | ||
12 | - Linearize part of skb when userspace provides vectors grater than MAX_SKB_FRAGS. | ||
13 | - Return error when userspace provides vectors whose total length may exceed | ||
14 | - MAX_SKB_FRAGS * PAGE_SIZE. | ||
15 | |||
16 | Signed-off-by: Jason Wang <jasowang@redhat.com> | ||
17 | Signed-off-by: Michael S. Tsirkin <mst@redhat.com> | ||
18 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
19 | --- | ||
20 | drivers/net/macvtap.c | 25 +++++++++++++++++++++---- | ||
21 | 1 files changed, 21 insertions(+), 4 deletions(-) | ||
22 | |||
23 | diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c | ||
24 | index 7fecd66..26106c0 100644 | ||
25 | --- a/drivers/net/macvtap.c | ||
26 | +++ b/drivers/net/macvtap.c | ||
27 | @@ -528,9 +528,10 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from, | ||
28 | } | ||
29 | base = (unsigned long)from->iov_base + offset; | ||
30 | size = ((base & ~PAGE_MASK) + len + ~PAGE_MASK) >> PAGE_SHIFT; | ||
31 | + if (i + size > MAX_SKB_FRAGS) | ||
32 | + return -EMSGSIZE; | ||
33 | num_pages = get_user_pages_fast(base, size, 0, &page[i]); | ||
34 | - if ((num_pages != size) || | ||
35 | - (num_pages > MAX_SKB_FRAGS - skb_shinfo(skb)->nr_frags)) { | ||
36 | + if (num_pages != size) { | ||
37 | for (i = 0; i < num_pages; i++) | ||
38 | put_page(page[i]); | ||
39 | return -EFAULT; | ||
40 | @@ -650,7 +651,7 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m, | ||
41 | int err; | ||
42 | struct virtio_net_hdr vnet_hdr = { 0 }; | ||
43 | int vnet_hdr_len = 0; | ||
44 | - int copylen; | ||
45 | + int copylen = 0; | ||
46 | bool zerocopy = false; | ||
47 | |||
48 | if (q->flags & IFF_VNET_HDR) { | ||
49 | @@ -679,15 +680,31 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m, | ||
50 | if (unlikely(len < ETH_HLEN)) | ||
51 | goto err; | ||
52 | |||
53 | + err = -EMSGSIZE; | ||
54 | + if (unlikely(count > UIO_MAXIOV)) | ||
55 | + goto err; | ||
56 | + | ||
57 | if (m && m->msg_control && sock_flag(&q->sk, SOCK_ZEROCOPY)) | ||
58 | zerocopy = true; | ||
59 | |||
60 | if (zerocopy) { | ||
61 | + /* Userspace may produce vectors with count greater than | ||
62 | + * MAX_SKB_FRAGS, so we need to linearize parts of the skb | ||
63 | + * to let the rest of data to be fit in the frags. | ||
64 | + */ | ||
65 | + if (count > MAX_SKB_FRAGS) { | ||
66 | + copylen = iov_length(iv, count - MAX_SKB_FRAGS); | ||
67 | + if (copylen < vnet_hdr_len) | ||
68 | + copylen = 0; | ||
69 | + else | ||
70 | + copylen -= vnet_hdr_len; | ||
71 | + } | ||
72 | /* There are 256 bytes to be copied in skb, so there is enough | ||
73 | * room for skb expand head in case it is used. | ||
74 | * The rest buffer is mapped from userspace. | ||
75 | */ | ||
76 | - copylen = vnet_hdr.hdr_len; | ||
77 | + if (copylen < vnet_hdr.hdr_len) | ||
78 | + copylen = vnet_hdr.hdr_len; | ||
79 | if (!copylen) | ||
80 | copylen = GOODCOPY_LEN; | ||
81 | } else | ||
82 | -- | ||
83 | 1.7.7.6 | ||
84 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0021-KVM-Fix-buffer-overflow-in-kvm_set_irq.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0021-KVM-Fix-buffer-overflow-in-kvm_set_irq.patch new file mode 100644 index 00000000..45dfb2d6 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0021-KVM-Fix-buffer-overflow-in-kvm_set_irq.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 274c1b4b54a12df73eb5fc2763a294ff2a04669c Mon Sep 17 00:00:00 2001 | ||
2 | From: Avi Kivity <avi@redhat.com> | ||
3 | Date: Sun, 22 Apr 2012 17:02:11 +0300 | ||
4 | Subject: [PATCH 021/109] KVM: Fix buffer overflow in kvm_set_irq() | ||
5 | |||
6 | commit f2ebd422f71cda9c791f76f85d2ca102ae34a1ed upstream. | ||
7 | |||
8 | kvm_set_irq() has an internal buffer of three irq routing entries, allowing | ||
9 | connecting a GSI to three IRQ chips or on MSI. However setup_routing_entry() | ||
10 | does not properly enforce this, allowing three irqchip routes followed by | ||
11 | an MSI route to overflow the buffer. | ||
12 | |||
13 | Fix by ensuring that an MSI entry is added to an empty list. | ||
14 | |||
15 | Signed-off-by: Avi Kivity <avi@redhat.com> | ||
16 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
17 | --- | ||
18 | virt/kvm/irq_comm.c | 1 + | ||
19 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
20 | |||
21 | diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c | ||
22 | index 9f614b4..272407c 100644 | ||
23 | --- a/virt/kvm/irq_comm.c | ||
24 | +++ b/virt/kvm/irq_comm.c | ||
25 | @@ -318,6 +318,7 @@ static int setup_routing_entry(struct kvm_irq_routing_table *rt, | ||
26 | */ | ||
27 | hlist_for_each_entry(ei, n, &rt->map[ue->gsi], link) | ||
28 | if (ei->type == KVM_IRQ_ROUTING_MSI || | ||
29 | + ue->type == KVM_IRQ_ROUTING_MSI || | ||
30 | ue->u.irqchip.irqchip == ei->irqchip.irqchip) | ||
31 | return r; | ||
32 | |||
33 | -- | ||
34 | 1.7.7.6 | ||
35 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0022-scsi-Silence-unnecessary-warnings-about-ioctl-to-par.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0022-scsi-Silence-unnecessary-warnings-about-ioctl-to-par.patch new file mode 100644 index 00000000..86b471c8 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0022-scsi-Silence-unnecessary-warnings-about-ioctl-to-par.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | From d0ef0e99137f622218e0395ccc12210e4804b5ed Mon Sep 17 00:00:00 2001 | ||
2 | From: Jan Kara <jack@suse.cz> | ||
3 | Date: Fri, 15 Jun 2012 12:52:46 +0200 | ||
4 | Subject: [PATCH 022/109] scsi: Silence unnecessary warnings about ioctl to | ||
5 | partition | ||
6 | |||
7 | commit 6d9359280753d2955f86d6411047516a9431eb51 upstream. | ||
8 | |||
9 | Sometimes, warnings about ioctls to partition happen often enough that they | ||
10 | form majority of the warnings in the kernel log and users complain. In some | ||
11 | cases warnings are about ioctls such as SG_IO so it's not good to get rid of | ||
12 | the warnings completely as they can ease debugging of userspace problems | ||
13 | when ioctl is refused. | ||
14 | |||
15 | Since I have seen warnings from lots of commands, including some proprietary | ||
16 | userspace applications, I don't think disallowing the ioctls for processes | ||
17 | with CAP_SYS_RAWIO will happen in the near future if ever. So lets just | ||
18 | stop warning for processes with CAP_SYS_RAWIO for which ioctl is allowed. | ||
19 | |||
20 | CC: Paolo Bonzini <pbonzini@redhat.com> | ||
21 | CC: James Bottomley <JBottomley@parallels.com> | ||
22 | CC: linux-scsi@vger.kernel.org | ||
23 | Acked-by: Paolo Bonzini <pbonzini@redhat.com> | ||
24 | Signed-off-by: Jan Kara <jack@suse.cz> | ||
25 | Signed-off-by: Jens Axboe <axboe@kernel.dk> | ||
26 | [bwh: Backported to 3.2: use ENOTTY, not ENOIOCTLCMD] | ||
27 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
28 | --- | ||
29 | block/scsi_ioctl.c | 5 ++++- | ||
30 | 1 files changed, 4 insertions(+), 1 deletions(-) | ||
31 | |||
32 | diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c | ||
33 | index 688be8a..9e76a32 100644 | ||
34 | --- a/block/scsi_ioctl.c | ||
35 | +++ b/block/scsi_ioctl.c | ||
36 | @@ -721,11 +721,14 @@ int scsi_verify_blk_ioctl(struct block_device *bd, unsigned int cmd) | ||
37 | break; | ||
38 | } | ||
39 | |||
40 | + if (capable(CAP_SYS_RAWIO)) | ||
41 | + return 0; | ||
42 | + | ||
43 | /* In particular, rule out all resets and host-specific ioctls. */ | ||
44 | printk_ratelimited(KERN_WARNING | ||
45 | "%s: sending ioctl %x to a partition!\n", current->comm, cmd); | ||
46 | |||
47 | - return capable(CAP_SYS_RAWIO) ? 0 : -ENOTTY; | ||
48 | + return -ENOTTY; | ||
49 | } | ||
50 | EXPORT_SYMBOL(scsi_verify_blk_ioctl); | ||
51 | |||
52 | -- | ||
53 | 1.7.7.6 | ||
54 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0023-epoll-clear-the-tfile_check_list-on-ELOOP.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0023-epoll-clear-the-tfile_check_list-on-ELOOP.patch new file mode 100644 index 00000000..8dbe37d6 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0023-epoll-clear-the-tfile_check_list-on-ELOOP.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 4255dce0ae728fe63f19ded56b5dc2c324d6f18d Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Baron <jbaron@redhat.com> | ||
3 | Date: Wed, 25 Apr 2012 16:01:47 -0700 | ||
4 | Subject: [PATCH 023/109] epoll: clear the tfile_check_list on -ELOOP | ||
5 | |||
6 | commit 13d518074a952d33d47c428419693f63389547e9 upstream. | ||
7 | |||
8 | An epoll_ctl(,EPOLL_CTL_ADD,,) operation can return '-ELOOP' to prevent | ||
9 | circular epoll dependencies from being created. However, in that case we | ||
10 | do not properly clear the 'tfile_check_list'. Thus, add a call to | ||
11 | clear_tfile_check_list() for the -ELOOP case. | ||
12 | |||
13 | Signed-off-by: Jason Baron <jbaron@redhat.com> | ||
14 | Reported-by: Yurij M. Plotnikov <Yurij.Plotnikov@oktetlabs.ru> | ||
15 | Cc: Nelson Elhage <nelhage@nelhage.com> | ||
16 | Cc: Davide Libenzi <davidel@xmailserver.org> | ||
17 | Tested-by: Alexandra N. Kossovsky <Alexandra.Kossovsky@oktetlabs.ru> | ||
18 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
19 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
20 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
21 | --- | ||
22 | fs/eventpoll.c | 4 +++- | ||
23 | 1 files changed, 3 insertions(+), 1 deletions(-) | ||
24 | |||
25 | diff --git a/fs/eventpoll.c b/fs/eventpoll.c | ||
26 | index 4d9d3a4..a6f3763 100644 | ||
27 | --- a/fs/eventpoll.c | ||
28 | +++ b/fs/eventpoll.c | ||
29 | @@ -1629,8 +1629,10 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, | ||
30 | if (op == EPOLL_CTL_ADD) { | ||
31 | if (is_file_epoll(tfile)) { | ||
32 | error = -ELOOP; | ||
33 | - if (ep_loop_check(ep, tfile) != 0) | ||
34 | + if (ep_loop_check(ep, tfile) != 0) { | ||
35 | + clear_tfile_check_list(); | ||
36 | goto error_tgt_fput; | ||
37 | + } | ||
38 | } else | ||
39 | list_add(&tfile->f_tfile_llink, &tfile_check_list); | ||
40 | } | ||
41 | -- | ||
42 | 1.7.7.6 | ||
43 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0024-iommu-amd-Fix-missing-iommu_shutdown-initialization-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0024-iommu-amd-Fix-missing-iommu_shutdown-initialization-.patch new file mode 100644 index 00000000..4c75e8e8 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0024-iommu-amd-Fix-missing-iommu_shutdown-initialization-.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From be1ab01a00ec19b273050ad8f3fbb9472238b026 Mon Sep 17 00:00:00 2001 | ||
2 | From: Shuah Khan <shuah.khan@hp.com> | ||
3 | Date: Wed, 6 Jun 2012 10:50:06 -0600 | ||
4 | Subject: [PATCH 024/109] iommu/amd: Fix missing iommu_shutdown initialization | ||
5 | in passthrough mode | ||
6 | |||
7 | commit f2f12b6fc032c7b1419fd6db84e2868b5f05a878 upstream. | ||
8 | |||
9 | The iommu_shutdown callback is not initialized when the AMD | ||
10 | IOMMU driver runs in passthrough mode. Fix that by moving | ||
11 | the callback initialization before the check for | ||
12 | passthrough mode. | ||
13 | |||
14 | Signed-off-by: Shuah Khan <shuah.khan@hp.com> | ||
15 | Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> | ||
16 | [bwh: Backported to 3.2: adjust context] | ||
17 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
18 | --- | ||
19 | drivers/iommu/amd_iommu_init.c | 3 ++- | ||
20 | 1 files changed, 2 insertions(+), 1 deletions(-) | ||
21 | |||
22 | diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c | ||
23 | index 6269eb0..ef2d493 100644 | ||
24 | --- a/drivers/iommu/amd_iommu_init.c | ||
25 | +++ b/drivers/iommu/amd_iommu_init.c | ||
26 | @@ -1468,6 +1468,8 @@ static int __init amd_iommu_init(void) | ||
27 | |||
28 | register_syscore_ops(&amd_iommu_syscore_ops); | ||
29 | |||
30 | + x86_platform.iommu_shutdown = disable_iommus; | ||
31 | + | ||
32 | if (iommu_pass_through) | ||
33 | goto out; | ||
34 | |||
35 | @@ -1476,7 +1478,6 @@ static int __init amd_iommu_init(void) | ||
36 | else | ||
37 | printk(KERN_INFO "AMD-Vi: Lazy IO/TLB flushing enabled\n"); | ||
38 | |||
39 | - x86_platform.iommu_shutdown = disable_iommus; | ||
40 | out: | ||
41 | return ret; | ||
42 | |||
43 | -- | ||
44 | 1.7.7.6 | ||
45 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0025-iommu-amd-Initialize-dma_ops-for-hotplug-and-sriov-d.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0025-iommu-amd-Initialize-dma_ops-for-hotplug-and-sriov-d.patch new file mode 100644 index 00000000..053d5e73 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0025-iommu-amd-Initialize-dma_ops-for-hotplug-and-sriov-d.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From 60eec119060fbd35f569fd77fd448dbcd8d8f011 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joerg Roedel <joerg.roedel@amd.com> | ||
3 | Date: Thu, 21 Jun 2012 14:52:40 +0200 | ||
4 | Subject: [PATCH 025/109] iommu/amd: Initialize dma_ops for hotplug and sriov | ||
5 | devices | ||
6 | |||
7 | commit ac1534a55d1e87d59a21c09c570605933b551480 upstream. | ||
8 | |||
9 | When a device is added to the system at runtime the AMD | ||
10 | IOMMU driver initializes the necessary data structures to | ||
11 | handle translation for it. But it forgets to change the | ||
12 | per-device dma_ops to point to the AMD IOMMU driver. So | ||
13 | mapping actually never happens and all DMA accesses end in | ||
14 | an IO_PAGE_FAULT. Fix this. | ||
15 | |||
16 | Reported-by: Stefan Assmann <sassmann@redhat.com> | ||
17 | Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> | ||
18 | [bwh: Backported to 3.2: | ||
19 | - Adjust context | ||
20 | - Use global iommu_pass_through; there is no per-device pass_through] | ||
21 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
22 | --- | ||
23 | drivers/iommu/amd_iommu.c | 7 +++++++ | ||
24 | 1 files changed, 7 insertions(+), 0 deletions(-) | ||
25 | |||
26 | diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c | ||
27 | index f1d5408..a1b8caa 100644 | ||
28 | --- a/drivers/iommu/amd_iommu.c | ||
29 | +++ b/drivers/iommu/amd_iommu.c | ||
30 | @@ -59,6 +59,8 @@ static struct protection_domain *pt_domain; | ||
31 | |||
32 | static struct iommu_ops amd_iommu_ops; | ||
33 | |||
34 | +static struct dma_map_ops amd_iommu_dma_ops; | ||
35 | + | ||
36 | /* | ||
37 | * general struct to manage commands send to an IOMMU | ||
38 | */ | ||
39 | @@ -1878,6 +1880,11 @@ static int device_change_notifier(struct notifier_block *nb, | ||
40 | list_add_tail(&dma_domain->list, &iommu_pd_list); | ||
41 | spin_unlock_irqrestore(&iommu_pd_list_lock, flags); | ||
42 | |||
43 | + if (!iommu_pass_through) | ||
44 | + dev->archdata.dma_ops = &amd_iommu_dma_ops; | ||
45 | + else | ||
46 | + dev->archdata.dma_ops = &nommu_dma_ops; | ||
47 | + | ||
48 | break; | ||
49 | case BUS_NOTIFY_DEL_DEVICE: | ||
50 | |||
51 | -- | ||
52 | 1.7.7.6 | ||
53 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0026-usb-Add-support-for-root-hub-port-status-CAS.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0026-usb-Add-support-for-root-hub-port-status-CAS.patch new file mode 100644 index 00000000..827fceca --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0026-usb-Add-support-for-root-hub-port-status-CAS.patch | |||
@@ -0,0 +1,170 @@ | |||
1 | From 6455e1a5be4eb27a1587322e0ed3a7ff6c3d8e4f Mon Sep 17 00:00:00 2001 | ||
2 | From: Stanislaw Ledwon <staszek.ledwon@linux.jf.intel.com> | ||
3 | Date: Mon, 18 Jun 2012 15:20:00 +0200 | ||
4 | Subject: [PATCH 026/109] usb: Add support for root hub port status CAS | ||
5 | |||
6 | commit 8bea2bd37df08aaa599aa361a9f8b836ba98e554 upstream. | ||
7 | |||
8 | The host controller port status register supports CAS (Cold Attach | ||
9 | Status) bit. This bit could be set when USB3.0 device is connected | ||
10 | when system is in Sx state. When the system wakes to S0 this port | ||
11 | status with CAS bit is reported and this port can't be used by any | ||
12 | device. | ||
13 | |||
14 | When CAS bit is set the port should be reset by warm reset. This | ||
15 | was not supported by xhci driver. | ||
16 | |||
17 | The issue was found when pendrive was connected to suspended | ||
18 | platform. The link state of "Compliance Mode" was reported together | ||
19 | with CAS bit. This link state was also not supported by xhci and | ||
20 | core/hub.c. | ||
21 | |||
22 | The CAS bit is defined only for xhci root hub port and it is | ||
23 | not supported on regular hubs. The link status is used to force | ||
24 | warm reset on port. Make the USB core issue a warm reset when port | ||
25 | is in ether the 'inactive' or 'compliance mode'. Change the xHCI driver | ||
26 | to report 'compliance mode' when the CAS is set. This force warm reset | ||
27 | on the root hub port. | ||
28 | |||
29 | This patch should be backported to stable kernels as old as 3.2, that | ||
30 | contain the commit 10d674a82e553cb8a1f41027bb3c3e309b3f6804 "USB: When | ||
31 | hot reset for USB3 fails, try warm reset." | ||
32 | |||
33 | Signed-off-by: Stanislaw Ledwon <staszek.ledwon@linux.intel.com> | ||
34 | Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> | ||
35 | Acked-by: Andiry Xu <andiry.xu@amd.com> | ||
36 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
37 | --- | ||
38 | drivers/usb/core/hub.c | 18 +++++++++------- | ||
39 | drivers/usb/host/xhci-hub.c | 44 +++++++++++++++++++++++++++++++++++++----- | ||
40 | drivers/usb/host/xhci.h | 6 ++++- | ||
41 | 3 files changed, 53 insertions(+), 15 deletions(-) | ||
42 | |||
43 | diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c | ||
44 | index 50cf41a..2bc736f 100644 | ||
45 | --- a/drivers/usb/core/hub.c | ||
46 | +++ b/drivers/usb/core/hub.c | ||
47 | @@ -2039,12 +2039,16 @@ static unsigned hub_is_wusb(struct usb_hub *hub) | ||
48 | static int hub_port_reset(struct usb_hub *hub, int port1, | ||
49 | struct usb_device *udev, unsigned int delay, bool warm); | ||
50 | |||
51 | -/* Is a USB 3.0 port in the Inactive state? */ | ||
52 | -static bool hub_port_inactive(struct usb_hub *hub, u16 portstatus) | ||
53 | +/* Is a USB 3.0 port in the Inactive or Complinance Mode state? | ||
54 | + * Port worm reset is required to recover | ||
55 | + */ | ||
56 | +static bool hub_port_warm_reset_required(struct usb_hub *hub, u16 portstatus) | ||
57 | { | ||
58 | return hub_is_superspeed(hub->hdev) && | ||
59 | - (portstatus & USB_PORT_STAT_LINK_STATE) == | ||
60 | - USB_SS_PORT_LS_SS_INACTIVE; | ||
61 | + (((portstatus & USB_PORT_STAT_LINK_STATE) == | ||
62 | + USB_SS_PORT_LS_SS_INACTIVE) || | ||
63 | + ((portstatus & USB_PORT_STAT_LINK_STATE) == | ||
64 | + USB_SS_PORT_LS_COMP_MOD)) ; | ||
65 | } | ||
66 | |||
67 | static int hub_port_wait_reset(struct usb_hub *hub, int port1, | ||
68 | @@ -2080,7 +2084,7 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, | ||
69 | * | ||
70 | * See https://bugzilla.kernel.org/show_bug.cgi?id=41752 | ||
71 | */ | ||
72 | - if (hub_port_inactive(hub, portstatus)) { | ||
73 | + if (hub_port_warm_reset_required(hub, portstatus)) { | ||
74 | int ret; | ||
75 | |||
76 | if ((portchange & USB_PORT_STAT_C_CONNECTION)) | ||
77 | @@ -3646,9 +3650,7 @@ static void hub_events(void) | ||
78 | /* Warm reset a USB3 protocol port if it's in | ||
79 | * SS.Inactive state. | ||
80 | */ | ||
81 | - if (hub_is_superspeed(hub->hdev) && | ||
82 | - (portstatus & USB_PORT_STAT_LINK_STATE) | ||
83 | - == USB_SS_PORT_LS_SS_INACTIVE) { | ||
84 | + if (hub_port_warm_reset_required(hub, portstatus)) { | ||
85 | dev_dbg(hub_dev, "warm reset port %d\n", i); | ||
86 | hub_port_reset(hub, i, NULL, | ||
87 | HUB_BH_RESET_TIME, true); | ||
88 | diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c | ||
89 | index a8b2980..fd8a2c2 100644 | ||
90 | --- a/drivers/usb/host/xhci-hub.c | ||
91 | +++ b/drivers/usb/host/xhci-hub.c | ||
92 | @@ -438,6 +438,42 @@ void xhci_test_and_clear_bit(struct xhci_hcd *xhci, __le32 __iomem **port_array, | ||
93 | } | ||
94 | } | ||
95 | |||
96 | +/* Updates Link Status for super Speed port */ | ||
97 | +static void xhci_hub_report_link_state(u32 *status, u32 status_reg) | ||
98 | +{ | ||
99 | + u32 pls = status_reg & PORT_PLS_MASK; | ||
100 | + | ||
101 | + /* resume state is a xHCI internal state. | ||
102 | + * Do not report it to usb core. | ||
103 | + */ | ||
104 | + if (pls == XDEV_RESUME) | ||
105 | + return; | ||
106 | + | ||
107 | + /* When the CAS bit is set then warm reset | ||
108 | + * should be performed on port | ||
109 | + */ | ||
110 | + if (status_reg & PORT_CAS) { | ||
111 | + /* The CAS bit can be set while the port is | ||
112 | + * in any link state. | ||
113 | + * Only roothubs have CAS bit, so we | ||
114 | + * pretend to be in compliance mode | ||
115 | + * unless we're already in compliance | ||
116 | + * or the inactive state. | ||
117 | + */ | ||
118 | + if (pls != USB_SS_PORT_LS_COMP_MOD && | ||
119 | + pls != USB_SS_PORT_LS_SS_INACTIVE) { | ||
120 | + pls = USB_SS_PORT_LS_COMP_MOD; | ||
121 | + } | ||
122 | + /* Return also connection bit - | ||
123 | + * hub state machine resets port | ||
124 | + * when this bit is set. | ||
125 | + */ | ||
126 | + pls |= USB_PORT_STAT_CONNECTION; | ||
127 | + } | ||
128 | + /* update status field */ | ||
129 | + *status |= pls; | ||
130 | +} | ||
131 | + | ||
132 | int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | ||
133 | u16 wIndex, char *buf, u16 wLength) | ||
134 | { | ||
135 | @@ -579,13 +615,9 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | ||
136 | else | ||
137 | status |= USB_PORT_STAT_POWER; | ||
138 | } | ||
139 | - /* Port Link State */ | ||
140 | + /* Update Port Link State for super speed ports*/ | ||
141 | if (hcd->speed == HCD_USB3) { | ||
142 | - /* resume state is a xHCI internal state. | ||
143 | - * Do not report it to usb core. | ||
144 | - */ | ||
145 | - if ((temp & PORT_PLS_MASK) != XDEV_RESUME) | ||
146 | - status |= (temp & PORT_PLS_MASK); | ||
147 | + xhci_hub_report_link_state(&status, temp); | ||
148 | } | ||
149 | if (bus_state->port_c_suspend & (1 << wIndex)) | ||
150 | status |= 1 << USB_PORT_FEAT_C_SUSPEND; | ||
151 | diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h | ||
152 | index 363b141..7a56805 100644 | ||
153 | --- a/drivers/usb/host/xhci.h | ||
154 | +++ b/drivers/usb/host/xhci.h | ||
155 | @@ -341,7 +341,11 @@ struct xhci_op_regs { | ||
156 | #define PORT_PLC (1 << 22) | ||
157 | /* port configure error change - port failed to configure its link partner */ | ||
158 | #define PORT_CEC (1 << 23) | ||
159 | -/* bit 24 reserved */ | ||
160 | +/* Cold Attach Status - xHC can set this bit to report device attached during | ||
161 | + * Sx state. Warm port reset should be perfomed to clear this bit and move port | ||
162 | + * to connected state. | ||
163 | + */ | ||
164 | +#define PORT_CAS (1 << 24) | ||
165 | /* wake on connect (enable) */ | ||
166 | #define PORT_WKCONN_E (1 << 25) | ||
167 | /* wake on disconnect (enable) */ | ||
168 | -- | ||
169 | 1.7.7.6 | ||
170 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0027-gpiolib-wm8994-Pay-attention-to-the-value-set-when-e.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0027-gpiolib-wm8994-Pay-attention-to-the-value-set-when-e.patch new file mode 100644 index 00000000..706d9892 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0027-gpiolib-wm8994-Pay-attention-to-the-value-set-when-e.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From 5cdc2897a0bb7b11585d5b14eb3f2faa1505348c Mon Sep 17 00:00:00 2001 | ||
2 | From: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
3 | Date: Sat, 9 Jun 2012 11:07:56 +0800 | ||
4 | Subject: [PATCH 027/109] gpiolib: wm8994: Pay attention to the value set when | ||
5 | enabling as output | ||
6 | |||
7 | commit 8cd578b6e28693f357867a77598a88ef3deb6b39 upstream. | ||
8 | |||
9 | Not paying attention to the value being set is a bad thing because it | ||
10 | means that we'll not set the hardware up to reflect what was requested. | ||
11 | Not setting the hardware up to reflect what was requested means that the | ||
12 | caller won't get the results they wanted. | ||
13 | |||
14 | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
15 | Signed-off-by: Linus Walleij <linus.walleij@linaro.org> | ||
16 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
17 | --- | ||
18 | drivers/gpio/gpio-wm8994.c | 5 ++++- | ||
19 | 1 files changed, 4 insertions(+), 1 deletions(-) | ||
20 | |||
21 | diff --git a/drivers/gpio/gpio-wm8994.c b/drivers/gpio/gpio-wm8994.c | ||
22 | index 96198f3..a2da8f2 100644 | ||
23 | --- a/drivers/gpio/gpio-wm8994.c | ||
24 | +++ b/drivers/gpio/gpio-wm8994.c | ||
25 | @@ -89,8 +89,11 @@ static int wm8994_gpio_direction_out(struct gpio_chip *chip, | ||
26 | struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip); | ||
27 | struct wm8994 *wm8994 = wm8994_gpio->wm8994; | ||
28 | |||
29 | + if (value) | ||
30 | + value = WM8994_GPN_LVL; | ||
31 | + | ||
32 | return wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset, | ||
33 | - WM8994_GPN_DIR, 0); | ||
34 | + WM8994_GPN_DIR | WM8994_GPN_LVL, value); | ||
35 | } | ||
36 | |||
37 | static void wm8994_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | ||
38 | -- | ||
39 | 1.7.7.6 | ||
40 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0028-sched-nohz-Rewrite-and-fix-load-avg-computation-agai.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0028-sched-nohz-Rewrite-and-fix-load-avg-computation-agai.patch new file mode 100644 index 00000000..5659ce7b --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0028-sched-nohz-Rewrite-and-fix-load-avg-computation-agai.patch | |||
@@ -0,0 +1,462 @@ | |||
1 | From a7d3f237430003ca8d32d1703770f04d32a02b27 Mon Sep 17 00:00:00 2001 | ||
2 | From: Peter Zijlstra <a.p.zijlstra@chello.nl> | ||
3 | Date: Fri, 22 Jun 2012 15:52:09 +0200 | ||
4 | Subject: [PATCH 028/109] sched/nohz: Rewrite and fix load-avg computation -- | ||
5 | again | ||
6 | |||
7 | commit 5167e8d5417bf5c322a703d2927daec727ea40dd upstream. | ||
8 | |||
9 | Thanks to Charles Wang for spotting the defects in the current code: | ||
10 | |||
11 | - If we go idle during the sample window -- after sampling, we get a | ||
12 | negative bias because we can negate our own sample. | ||
13 | |||
14 | - If we wake up during the sample window we get a positive bias | ||
15 | because we push the sample to a known active period. | ||
16 | |||
17 | So rewrite the entire nohz load-avg muck once again, now adding | ||
18 | copious documentation to the code. | ||
19 | |||
20 | Reported-and-tested-by: Doug Smythies <dsmythies@telus.net> | ||
21 | Reported-and-tested-by: Charles Wang <muming.wq@gmail.com> | ||
22 | Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> | ||
23 | Cc: Linus Torvalds <torvalds@linux-foundation.org> | ||
24 | Cc: Andrew Morton <akpm@linux-foundation.org> | ||
25 | Link: http://lkml.kernel.org/r/1340373782.18025.74.camel@twins | ||
26 | [ minor edits ] | ||
27 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | ||
28 | [bwh: Backported to 3.2: adjust filenames, context] | ||
29 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
30 | --- | ||
31 | include/linux/sched.h | 8 ++ | ||
32 | kernel/sched.c | 276 ++++++++++++++++++++++++++++++++++------------ | ||
33 | kernel/sched_idletask.c | 1 - | ||
34 | kernel/time/tick-sched.c | 2 + | ||
35 | 4 files changed, 213 insertions(+), 74 deletions(-) | ||
36 | |||
37 | diff --git a/include/linux/sched.h b/include/linux/sched.h | ||
38 | index 1c4f3e9..5afa2a3 100644 | ||
39 | --- a/include/linux/sched.h | ||
40 | +++ b/include/linux/sched.h | ||
41 | @@ -1892,6 +1892,14 @@ static inline int set_cpus_allowed_ptr(struct task_struct *p, | ||
42 | } | ||
43 | #endif | ||
44 | |||
45 | +#ifdef CONFIG_NO_HZ | ||
46 | +void calc_load_enter_idle(void); | ||
47 | +void calc_load_exit_idle(void); | ||
48 | +#else | ||
49 | +static inline void calc_load_enter_idle(void) { } | ||
50 | +static inline void calc_load_exit_idle(void) { } | ||
51 | +#endif /* CONFIG_NO_HZ */ | ||
52 | + | ||
53 | #ifndef CONFIG_CPUMASK_OFFSTACK | ||
54 | static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) | ||
55 | { | ||
56 | diff --git a/kernel/sched.c b/kernel/sched.c | ||
57 | index 576a27f..52ac69b 100644 | ||
58 | --- a/kernel/sched.c | ||
59 | +++ b/kernel/sched.c | ||
60 | @@ -1885,7 +1885,6 @@ static void double_rq_unlock(struct rq *rq1, struct rq *rq2) | ||
61 | |||
62 | #endif | ||
63 | |||
64 | -static void calc_load_account_idle(struct rq *this_rq); | ||
65 | static void update_sysctl(void); | ||
66 | static int get_update_sysctl_factor(void); | ||
67 | static void update_cpu_load(struct rq *this_rq); | ||
68 | @@ -3401,11 +3400,73 @@ unsigned long this_cpu_load(void) | ||
69 | } | ||
70 | |||
71 | |||
72 | +/* | ||
73 | + * Global load-average calculations | ||
74 | + * | ||
75 | + * We take a distributed and async approach to calculating the global load-avg | ||
76 | + * in order to minimize overhead. | ||
77 | + * | ||
78 | + * The global load average is an exponentially decaying average of nr_running + | ||
79 | + * nr_uninterruptible. | ||
80 | + * | ||
81 | + * Once every LOAD_FREQ: | ||
82 | + * | ||
83 | + * nr_active = 0; | ||
84 | + * for_each_possible_cpu(cpu) | ||
85 | + * nr_active += cpu_of(cpu)->nr_running + cpu_of(cpu)->nr_uninterruptible; | ||
86 | + * | ||
87 | + * avenrun[n] = avenrun[0] * exp_n + nr_active * (1 - exp_n) | ||
88 | + * | ||
89 | + * Due to a number of reasons the above turns in the mess below: | ||
90 | + * | ||
91 | + * - for_each_possible_cpu() is prohibitively expensive on machines with | ||
92 | + * serious number of cpus, therefore we need to take a distributed approach | ||
93 | + * to calculating nr_active. | ||
94 | + * | ||
95 | + * \Sum_i x_i(t) = \Sum_i x_i(t) - x_i(t_0) | x_i(t_0) := 0 | ||
96 | + * = \Sum_i { \Sum_j=1 x_i(t_j) - x_i(t_j-1) } | ||
97 | + * | ||
98 | + * So assuming nr_active := 0 when we start out -- true per definition, we | ||
99 | + * can simply take per-cpu deltas and fold those into a global accumulate | ||
100 | + * to obtain the same result. See calc_load_fold_active(). | ||
101 | + * | ||
102 | + * Furthermore, in order to avoid synchronizing all per-cpu delta folding | ||
103 | + * across the machine, we assume 10 ticks is sufficient time for every | ||
104 | + * cpu to have completed this task. | ||
105 | + * | ||
106 | + * This places an upper-bound on the IRQ-off latency of the machine. Then | ||
107 | + * again, being late doesn't loose the delta, just wrecks the sample. | ||
108 | + * | ||
109 | + * - cpu_rq()->nr_uninterruptible isn't accurately tracked per-cpu because | ||
110 | + * this would add another cross-cpu cacheline miss and atomic operation | ||
111 | + * to the wakeup path. Instead we increment on whatever cpu the task ran | ||
112 | + * when it went into uninterruptible state and decrement on whatever cpu | ||
113 | + * did the wakeup. This means that only the sum of nr_uninterruptible over | ||
114 | + * all cpus yields the correct result. | ||
115 | + * | ||
116 | + * This covers the NO_HZ=n code, for extra head-aches, see the comment below. | ||
117 | + */ | ||
118 | + | ||
119 | /* Variables and functions for calc_load */ | ||
120 | static atomic_long_t calc_load_tasks; | ||
121 | static unsigned long calc_load_update; | ||
122 | unsigned long avenrun[3]; | ||
123 | -EXPORT_SYMBOL(avenrun); | ||
124 | +EXPORT_SYMBOL(avenrun); /* should be removed */ | ||
125 | + | ||
126 | +/** | ||
127 | + * get_avenrun - get the load average array | ||
128 | + * @loads: pointer to dest load array | ||
129 | + * @offset: offset to add | ||
130 | + * @shift: shift count to shift the result left | ||
131 | + * | ||
132 | + * These values are estimates at best, so no need for locking. | ||
133 | + */ | ||
134 | +void get_avenrun(unsigned long *loads, unsigned long offset, int shift) | ||
135 | +{ | ||
136 | + loads[0] = (avenrun[0] + offset) << shift; | ||
137 | + loads[1] = (avenrun[1] + offset) << shift; | ||
138 | + loads[2] = (avenrun[2] + offset) << shift; | ||
139 | +} | ||
140 | |||
141 | static long calc_load_fold_active(struct rq *this_rq) | ||
142 | { | ||
143 | @@ -3422,6 +3483,9 @@ static long calc_load_fold_active(struct rq *this_rq) | ||
144 | return delta; | ||
145 | } | ||
146 | |||
147 | +/* | ||
148 | + * a1 = a0 * e + a * (1 - e) | ||
149 | + */ | ||
150 | static unsigned long | ||
151 | calc_load(unsigned long load, unsigned long exp, unsigned long active) | ||
152 | { | ||
153 | @@ -3433,30 +3497,118 @@ calc_load(unsigned long load, unsigned long exp, unsigned long active) | ||
154 | |||
155 | #ifdef CONFIG_NO_HZ | ||
156 | /* | ||
157 | - * For NO_HZ we delay the active fold to the next LOAD_FREQ update. | ||
158 | + * Handle NO_HZ for the global load-average. | ||
159 | + * | ||
160 | + * Since the above described distributed algorithm to compute the global | ||
161 | + * load-average relies on per-cpu sampling from the tick, it is affected by | ||
162 | + * NO_HZ. | ||
163 | + * | ||
164 | + * The basic idea is to fold the nr_active delta into a global idle-delta upon | ||
165 | + * entering NO_HZ state such that we can include this as an 'extra' cpu delta | ||
166 | + * when we read the global state. | ||
167 | + * | ||
168 | + * Obviously reality has to ruin such a delightfully simple scheme: | ||
169 | + * | ||
170 | + * - When we go NO_HZ idle during the window, we can negate our sample | ||
171 | + * contribution, causing under-accounting. | ||
172 | + * | ||
173 | + * We avoid this by keeping two idle-delta counters and flipping them | ||
174 | + * when the window starts, thus separating old and new NO_HZ load. | ||
175 | + * | ||
176 | + * The only trick is the slight shift in index flip for read vs write. | ||
177 | + * | ||
178 | + * 0s 5s 10s 15s | ||
179 | + * +10 +10 +10 +10 | ||
180 | + * |-|-----------|-|-----------|-|-----------|-| | ||
181 | + * r:0 0 1 1 0 0 1 1 0 | ||
182 | + * w:0 1 1 0 0 1 1 0 0 | ||
183 | + * | ||
184 | + * This ensures we'll fold the old idle contribution in this window while | ||
185 | + * accumlating the new one. | ||
186 | + * | ||
187 | + * - When we wake up from NO_HZ idle during the window, we push up our | ||
188 | + * contribution, since we effectively move our sample point to a known | ||
189 | + * busy state. | ||
190 | + * | ||
191 | + * This is solved by pushing the window forward, and thus skipping the | ||
192 | + * sample, for this cpu (effectively using the idle-delta for this cpu which | ||
193 | + * was in effect at the time the window opened). This also solves the issue | ||
194 | + * of having to deal with a cpu having been in NOHZ idle for multiple | ||
195 | + * LOAD_FREQ intervals. | ||
196 | * | ||
197 | * When making the ILB scale, we should try to pull this in as well. | ||
198 | */ | ||
199 | -static atomic_long_t calc_load_tasks_idle; | ||
200 | +static atomic_long_t calc_load_idle[2]; | ||
201 | +static int calc_load_idx; | ||
202 | |||
203 | -static void calc_load_account_idle(struct rq *this_rq) | ||
204 | +static inline int calc_load_write_idx(void) | ||
205 | { | ||
206 | + int idx = calc_load_idx; | ||
207 | + | ||
208 | + /* | ||
209 | + * See calc_global_nohz(), if we observe the new index, we also | ||
210 | + * need to observe the new update time. | ||
211 | + */ | ||
212 | + smp_rmb(); | ||
213 | + | ||
214 | + /* | ||
215 | + * If the folding window started, make sure we start writing in the | ||
216 | + * next idle-delta. | ||
217 | + */ | ||
218 | + if (!time_before(jiffies, calc_load_update)) | ||
219 | + idx++; | ||
220 | + | ||
221 | + return idx & 1; | ||
222 | +} | ||
223 | + | ||
224 | +static inline int calc_load_read_idx(void) | ||
225 | +{ | ||
226 | + return calc_load_idx & 1; | ||
227 | +} | ||
228 | + | ||
229 | +void calc_load_enter_idle(void) | ||
230 | +{ | ||
231 | + struct rq *this_rq = this_rq(); | ||
232 | long delta; | ||
233 | |||
234 | + /* | ||
235 | + * We're going into NOHZ mode, if there's any pending delta, fold it | ||
236 | + * into the pending idle delta. | ||
237 | + */ | ||
238 | delta = calc_load_fold_active(this_rq); | ||
239 | - if (delta) | ||
240 | - atomic_long_add(delta, &calc_load_tasks_idle); | ||
241 | + if (delta) { | ||
242 | + int idx = calc_load_write_idx(); | ||
243 | + atomic_long_add(delta, &calc_load_idle[idx]); | ||
244 | + } | ||
245 | } | ||
246 | |||
247 | -static long calc_load_fold_idle(void) | ||
248 | +void calc_load_exit_idle(void) | ||
249 | { | ||
250 | - long delta = 0; | ||
251 | + struct rq *this_rq = this_rq(); | ||
252 | + | ||
253 | + /* | ||
254 | + * If we're still before the sample window, we're done. | ||
255 | + */ | ||
256 | + if (time_before(jiffies, this_rq->calc_load_update)) | ||
257 | + return; | ||
258 | |||
259 | /* | ||
260 | - * Its got a race, we don't care... | ||
261 | + * We woke inside or after the sample window, this means we're already | ||
262 | + * accounted through the nohz accounting, so skip the entire deal and | ||
263 | + * sync up for the next window. | ||
264 | */ | ||
265 | - if (atomic_long_read(&calc_load_tasks_idle)) | ||
266 | - delta = atomic_long_xchg(&calc_load_tasks_idle, 0); | ||
267 | + this_rq->calc_load_update = calc_load_update; | ||
268 | + if (time_before(jiffies, this_rq->calc_load_update + 10)) | ||
269 | + this_rq->calc_load_update += LOAD_FREQ; | ||
270 | +} | ||
271 | + | ||
272 | +static long calc_load_fold_idle(void) | ||
273 | +{ | ||
274 | + int idx = calc_load_read_idx(); | ||
275 | + long delta = 0; | ||
276 | + | ||
277 | + if (atomic_long_read(&calc_load_idle[idx])) | ||
278 | + delta = atomic_long_xchg(&calc_load_idle[idx], 0); | ||
279 | |||
280 | return delta; | ||
281 | } | ||
282 | @@ -3542,66 +3694,39 @@ static void calc_global_nohz(void) | ||
283 | { | ||
284 | long delta, active, n; | ||
285 | |||
286 | - /* | ||
287 | - * If we crossed a calc_load_update boundary, make sure to fold | ||
288 | - * any pending idle changes, the respective CPUs might have | ||
289 | - * missed the tick driven calc_load_account_active() update | ||
290 | - * due to NO_HZ. | ||
291 | - */ | ||
292 | - delta = calc_load_fold_idle(); | ||
293 | - if (delta) | ||
294 | - atomic_long_add(delta, &calc_load_tasks); | ||
295 | - | ||
296 | - /* | ||
297 | - * It could be the one fold was all it took, we done! | ||
298 | - */ | ||
299 | - if (time_before(jiffies, calc_load_update + 10)) | ||
300 | - return; | ||
301 | - | ||
302 | - /* | ||
303 | - * Catch-up, fold however many we are behind still | ||
304 | - */ | ||
305 | - delta = jiffies - calc_load_update - 10; | ||
306 | - n = 1 + (delta / LOAD_FREQ); | ||
307 | + if (!time_before(jiffies, calc_load_update + 10)) { | ||
308 | + /* | ||
309 | + * Catch-up, fold however many we are behind still | ||
310 | + */ | ||
311 | + delta = jiffies - calc_load_update - 10; | ||
312 | + n = 1 + (delta / LOAD_FREQ); | ||
313 | |||
314 | - active = atomic_long_read(&calc_load_tasks); | ||
315 | - active = active > 0 ? active * FIXED_1 : 0; | ||
316 | + active = atomic_long_read(&calc_load_tasks); | ||
317 | + active = active > 0 ? active * FIXED_1 : 0; | ||
318 | |||
319 | - avenrun[0] = calc_load_n(avenrun[0], EXP_1, active, n); | ||
320 | - avenrun[1] = calc_load_n(avenrun[1], EXP_5, active, n); | ||
321 | - avenrun[2] = calc_load_n(avenrun[2], EXP_15, active, n); | ||
322 | + avenrun[0] = calc_load_n(avenrun[0], EXP_1, active, n); | ||
323 | + avenrun[1] = calc_load_n(avenrun[1], EXP_5, active, n); | ||
324 | + avenrun[2] = calc_load_n(avenrun[2], EXP_15, active, n); | ||
325 | |||
326 | - calc_load_update += n * LOAD_FREQ; | ||
327 | -} | ||
328 | -#else | ||
329 | -static void calc_load_account_idle(struct rq *this_rq) | ||
330 | -{ | ||
331 | -} | ||
332 | + calc_load_update += n * LOAD_FREQ; | ||
333 | + } | ||
334 | |||
335 | -static inline long calc_load_fold_idle(void) | ||
336 | -{ | ||
337 | - return 0; | ||
338 | + /* | ||
339 | + * Flip the idle index... | ||
340 | + * | ||
341 | + * Make sure we first write the new time then flip the index, so that | ||
342 | + * calc_load_write_idx() will see the new time when it reads the new | ||
343 | + * index, this avoids a double flip messing things up. | ||
344 | + */ | ||
345 | + smp_wmb(); | ||
346 | + calc_load_idx++; | ||
347 | } | ||
348 | +#else /* !CONFIG_NO_HZ */ | ||
349 | |||
350 | -static void calc_global_nohz(void) | ||
351 | -{ | ||
352 | -} | ||
353 | -#endif | ||
354 | +static inline long calc_load_fold_idle(void) { return 0; } | ||
355 | +static inline void calc_global_nohz(void) { } | ||
356 | |||
357 | -/** | ||
358 | - * get_avenrun - get the load average array | ||
359 | - * @loads: pointer to dest load array | ||
360 | - * @offset: offset to add | ||
361 | - * @shift: shift count to shift the result left | ||
362 | - * | ||
363 | - * These values are estimates at best, so no need for locking. | ||
364 | - */ | ||
365 | -void get_avenrun(unsigned long *loads, unsigned long offset, int shift) | ||
366 | -{ | ||
367 | - loads[0] = (avenrun[0] + offset) << shift; | ||
368 | - loads[1] = (avenrun[1] + offset) << shift; | ||
369 | - loads[2] = (avenrun[2] + offset) << shift; | ||
370 | -} | ||
371 | +#endif /* CONFIG_NO_HZ */ | ||
372 | |||
373 | /* | ||
374 | * calc_load - update the avenrun load estimates 10 ticks after the | ||
375 | @@ -3609,11 +3734,18 @@ void get_avenrun(unsigned long *loads, unsigned long offset, int shift) | ||
376 | */ | ||
377 | void calc_global_load(unsigned long ticks) | ||
378 | { | ||
379 | - long active; | ||
380 | + long active, delta; | ||
381 | |||
382 | if (time_before(jiffies, calc_load_update + 10)) | ||
383 | return; | ||
384 | |||
385 | + /* | ||
386 | + * Fold the 'old' idle-delta to include all NO_HZ cpus. | ||
387 | + */ | ||
388 | + delta = calc_load_fold_idle(); | ||
389 | + if (delta) | ||
390 | + atomic_long_add(delta, &calc_load_tasks); | ||
391 | + | ||
392 | active = atomic_long_read(&calc_load_tasks); | ||
393 | active = active > 0 ? active * FIXED_1 : 0; | ||
394 | |||
395 | @@ -3624,12 +3756,7 @@ void calc_global_load(unsigned long ticks) | ||
396 | calc_load_update += LOAD_FREQ; | ||
397 | |||
398 | /* | ||
399 | - * Account one period with whatever state we found before | ||
400 | - * folding in the nohz state and ageing the entire idle period. | ||
401 | - * | ||
402 | - * This avoids loosing a sample when we go idle between | ||
403 | - * calc_load_account_active() (10 ticks ago) and now and thus | ||
404 | - * under-accounting. | ||
405 | + * In case we idled for multiple LOAD_FREQ intervals, catch up in bulk. | ||
406 | */ | ||
407 | calc_global_nohz(); | ||
408 | } | ||
409 | @@ -3646,7 +3773,6 @@ static void calc_load_account_active(struct rq *this_rq) | ||
410 | return; | ||
411 | |||
412 | delta = calc_load_fold_active(this_rq); | ||
413 | - delta += calc_load_fold_idle(); | ||
414 | if (delta) | ||
415 | atomic_long_add(delta, &calc_load_tasks); | ||
416 | |||
417 | @@ -3654,6 +3780,10 @@ static void calc_load_account_active(struct rq *this_rq) | ||
418 | } | ||
419 | |||
420 | /* | ||
421 | + * End of global load-average stuff | ||
422 | + */ | ||
423 | + | ||
424 | +/* | ||
425 | * The exact cpuload at various idx values, calculated at every tick would be | ||
426 | * load = (2^idx - 1) / 2^idx * load + 1 / 2^idx * cur_load | ||
427 | * | ||
428 | diff --git a/kernel/sched_idletask.c b/kernel/sched_idletask.c | ||
429 | index 0a51882..be92bfe 100644 | ||
430 | --- a/kernel/sched_idletask.c | ||
431 | +++ b/kernel/sched_idletask.c | ||
432 | @@ -23,7 +23,6 @@ static void check_preempt_curr_idle(struct rq *rq, struct task_struct *p, int fl | ||
433 | static struct task_struct *pick_next_task_idle(struct rq *rq) | ||
434 | { | ||
435 | schedstat_inc(rq, sched_goidle); | ||
436 | - calc_load_account_idle(rq); | ||
437 | return rq->idle; | ||
438 | } | ||
439 | |||
440 | diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c | ||
441 | index c923640..9955ebd 100644 | ||
442 | --- a/kernel/time/tick-sched.c | ||
443 | +++ b/kernel/time/tick-sched.c | ||
444 | @@ -430,6 +430,7 @@ void tick_nohz_stop_sched_tick(int inidle) | ||
445 | */ | ||
446 | if (!ts->tick_stopped) { | ||
447 | select_nohz_load_balancer(1); | ||
448 | + calc_load_enter_idle(); | ||
449 | |||
450 | ts->idle_tick = hrtimer_get_expires(&ts->sched_timer); | ||
451 | ts->tick_stopped = 1; | ||
452 | @@ -563,6 +564,7 @@ void tick_nohz_restart_sched_tick(void) | ||
453 | account_idle_ticks(ticks); | ||
454 | #endif | ||
455 | |||
456 | + calc_load_exit_idle(); | ||
457 | touch_softlockup_watchdog(); | ||
458 | /* | ||
459 | * Cancel the scheduled timer and restore the tick | ||
460 | -- | ||
461 | 1.7.7.6 | ||
462 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0029-USB-option-add-ZTE-MF60.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0029-USB-option-add-ZTE-MF60.patch new file mode 100644 index 00000000..0c6d8be0 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0029-USB-option-add-ZTE-MF60.patch | |||
@@ -0,0 +1,70 @@ | |||
1 | From 4090ab847de2c528ae152e864a7ce604ef300837 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no> | ||
3 | Date: Mon, 2 Jul 2012 19:53:55 +0200 | ||
4 | Subject: [PATCH 029/109] USB: option: add ZTE MF60 | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | commit 8e16e33c168a6efd0c9f7fa9dd4c1e1db9a74553 upstream. | ||
10 | |||
11 | Switches into a composite device by ejecting the initial | ||
12 | driver CD. The four interfaces are: QCDM, AT, QMI/wwan | ||
13 | and mass storage. Let this driver manage the two serial | ||
14 | interfaces: | ||
15 | |||
16 | T: Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 28 Spd=480 MxCh= 0 | ||
17 | D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 | ||
18 | P: Vendor=19d2 ProdID=1402 Rev= 0.00 | ||
19 | S: Manufacturer=ZTE,Incorporated | ||
20 | S: Product=ZTE WCDMA Technologies MSM | ||
21 | S: SerialNumber=xxxxx | ||
22 | C:* #Ifs= 4 Cfg#= 1 Atr=c0 MxPwr=500mA | ||
23 | I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option | ||
24 | E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms | ||
25 | E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms | ||
26 | I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option | ||
27 | E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms | ||
28 | E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms | ||
29 | I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan | ||
30 | E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=2ms | ||
31 | E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms | ||
32 | E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms | ||
33 | I:* If#= 3 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage | ||
34 | E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms | ||
35 | E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms | ||
36 | |||
37 | Signed-off-by: Bjørn Mork <bjorn@mork.no> | ||
38 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
39 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
40 | --- | ||
41 | drivers/usb/serial/option.c | 6 ++++++ | ||
42 | 1 files changed, 6 insertions(+), 0 deletions(-) | ||
43 | |||
44 | diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c | ||
45 | index 21a4734..5960c7b 100644 | ||
46 | --- a/drivers/usb/serial/option.c | ||
47 | +++ b/drivers/usb/serial/option.c | ||
48 | @@ -553,6 +553,10 @@ static const struct option_blacklist_info net_intf1_blacklist = { | ||
49 | .reserved = BIT(1), | ||
50 | }; | ||
51 | |||
52 | +static const struct option_blacklist_info net_intf2_blacklist = { | ||
53 | + .reserved = BIT(2), | ||
54 | +}; | ||
55 | + | ||
56 | static const struct option_blacklist_info net_intf3_blacklist = { | ||
57 | .reserved = BIT(3), | ||
58 | }; | ||
59 | @@ -1093,6 +1097,8 @@ static const struct usb_device_id option_ids[] = { | ||
60 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) }, | ||
61 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) }, | ||
62 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) }, | ||
63 | + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1402, 0xff, 0xff, 0xff), | ||
64 | + .driver_info = (kernel_ulong_t)&net_intf2_blacklist }, | ||
65 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, | ||
66 | 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist }, | ||
67 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) }, | ||
68 | -- | ||
69 | 1.7.7.6 | ||
70 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0030-USB-option-Add-MEDIATEK-product-ids.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0030-USB-option-Add-MEDIATEK-product-ids.patch new file mode 100644 index 00000000..0091085c --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0030-USB-option-Add-MEDIATEK-product-ids.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | From 26b05210d9f77b9b92fb12a73da5b9f6cb1b3f07 Mon Sep 17 00:00:00 2001 | ||
2 | From: Gaosen Zhang <gaosen.zhang@mediatek.com> | ||
3 | Date: Thu, 5 Jul 2012 21:49:00 +0800 | ||
4 | Subject: [PATCH 030/109] USB: option: Add MEDIATEK product ids | ||
5 | |||
6 | commit aacef9c561a693341566a6850c451ce3df68cb9a upstream. | ||
7 | |||
8 | Signed-off-by: Gaosen Zhang <gaosen.zhang@mediatek.com> | ||
9 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
10 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
11 | --- | ||
12 | drivers/usb/serial/option.c | 20 ++++++++++++++++++++ | ||
13 | 1 files changed, 20 insertions(+), 0 deletions(-) | ||
14 | |||
15 | diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c | ||
16 | index 5960c7b..5971c95 100644 | ||
17 | --- a/drivers/usb/serial/option.c | ||
18 | +++ b/drivers/usb/serial/option.c | ||
19 | @@ -496,6 +496,15 @@ static void option_instat_callback(struct urb *urb); | ||
20 | |||
21 | /* MediaTek products */ | ||
22 | #define MEDIATEK_VENDOR_ID 0x0e8d | ||
23 | +#define MEDIATEK_PRODUCT_DC_1COM 0x00a0 | ||
24 | +#define MEDIATEK_PRODUCT_DC_4COM 0x00a5 | ||
25 | +#define MEDIATEK_PRODUCT_DC_5COM 0x00a4 | ||
26 | +#define MEDIATEK_PRODUCT_7208_1COM 0x7101 | ||
27 | +#define MEDIATEK_PRODUCT_7208_2COM 0x7102 | ||
28 | +#define MEDIATEK_PRODUCT_FP_1COM 0x0003 | ||
29 | +#define MEDIATEK_PRODUCT_FP_2COM 0x0023 | ||
30 | +#define MEDIATEK_PRODUCT_FPDC_1COM 0x0043 | ||
31 | +#define MEDIATEK_PRODUCT_FPDC_2COM 0x0033 | ||
32 | |||
33 | /* Cellient products */ | ||
34 | #define CELLIENT_VENDOR_ID 0x2692 | ||
35 | @@ -1240,6 +1249,17 @@ static const struct usb_device_id option_ids[] = { | ||
36 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a1, 0xff, 0x02, 0x01) }, | ||
37 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x00, 0x00) }, | ||
38 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x02, 0x01) }, /* MediaTek MT6276M modem & app port */ | ||
39 | + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_1COM, 0x0a, 0x00, 0x00) }, | ||
40 | + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_5COM, 0xff, 0x02, 0x01) }, | ||
41 | + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_5COM, 0xff, 0x00, 0x00) }, | ||
42 | + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM, 0xff, 0x02, 0x01) }, | ||
43 | + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM, 0xff, 0x00, 0x00) }, | ||
44 | + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7208_1COM, 0x02, 0x00, 0x00) }, | ||
45 | + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7208_2COM, 0x02, 0x02, 0x01) }, | ||
46 | + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FP_1COM, 0x0a, 0x00, 0x00) }, | ||
47 | + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FP_2COM, 0x0a, 0x00, 0x00) }, | ||
48 | + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_1COM, 0x0a, 0x00, 0x00) }, | ||
49 | + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_2COM, 0x0a, 0x00, 0x00) }, | ||
50 | { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, | ||
51 | { } /* Terminating entry */ | ||
52 | }; | ||
53 | -- | ||
54 | 1.7.7.6 | ||
55 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0031-USB-cdc-wdm-fix-lockup-on-error-in-wdm_read.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0031-USB-cdc-wdm-fix-lockup-on-error-in-wdm_read.patch new file mode 100644 index 00000000..3fb9fae1 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0031-USB-cdc-wdm-fix-lockup-on-error-in-wdm_read.patch | |||
@@ -0,0 +1,78 @@ | |||
1 | From 6fb488dec8482c866a2c7cd4d1da06b85b8b28c7 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no> | ||
3 | Date: Mon, 2 Jul 2012 10:33:14 +0200 | ||
4 | Subject: [PATCH 031/109] USB: cdc-wdm: fix lockup on error in wdm_read | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | commit b086b6b10d9f182cd8d2f0dcfd7fd11edba93fc9 upstream. | ||
10 | |||
11 | Clear the WDM_READ flag on empty reads to avoid running | ||
12 | forever in an infinite tight loop, causing lockups: | ||
13 | |||
14 | Jul 1 21:58:11 nemi kernel: [ 3658.898647] qmi_wwan 2-1:1.2: Unexpected error -71 | ||
15 | Jul 1 21:58:36 nemi kernel: [ 3684.072021] BUG: soft lockup - CPU#0 stuck for 23s! [qmi.pl:12235] | ||
16 | Jul 1 21:58:36 nemi kernel: [ 3684.072212] CPU 0 | ||
17 | Jul 1 21:58:36 nemi kernel: [ 3684.072355] | ||
18 | Jul 1 21:58:36 nemi kernel: [ 3684.072367] Pid: 12235, comm: qmi.pl Tainted: P O 3.5.0-rc2+ #13 LENOVO 2776LEG/2776LEG | ||
19 | Jul 1 21:58:36 nemi kernel: [ 3684.072383] RIP: 0010:[<ffffffffa0635008>] [<ffffffffa0635008>] spin_unlock_irq+0x8/0xc [cdc_wdm] | ||
20 | Jul 1 21:58:36 nemi kernel: [ 3684.072388] RSP: 0018:ffff88022dca1e70 EFLAGS: 00000282 | ||
21 | Jul 1 21:58:36 nemi kernel: [ 3684.072393] RAX: ffff88022fc3f650 RBX: ffffffff811c56f7 RCX: 00000001000ce8c1 | ||
22 | Jul 1 21:58:36 nemi kernel: [ 3684.072398] RDX: 0000000000000010 RSI: 000000000267d810 RDI: ffff88022fc3f650 | ||
23 | Jul 1 21:58:36 nemi kernel: [ 3684.072403] RBP: ffff88022dca1eb0 R08: ffffffffa063578e R09: 0000000000000000 | ||
24 | Jul 1 21:58:36 nemi kernel: [ 3684.072407] R10: 0000000000000008 R11: 0000000000000246 R12: 0000000000000002 | ||
25 | Jul 1 21:58:36 nemi kernel: [ 3684.072412] R13: 0000000000000246 R14: ffffffff00000002 R15: ffff8802281d8c88 | ||
26 | Jul 1 21:58:36 nemi kernel: [ 3684.072418] FS: 00007f666a260700(0000) GS:ffff88023bc00000(0000) knlGS:0000000000000000 | ||
27 | Jul 1 21:58:36 nemi kernel: [ 3684.072423] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 | ||
28 | Jul 1 21:58:36 nemi kernel: [ 3684.072428] CR2: 000000000270d9d8 CR3: 000000022e865000 CR4: 00000000000007f0 | ||
29 | Jul 1 21:58:36 nemi kernel: [ 3684.072433] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 | ||
30 | Jul 1 21:58:36 nemi kernel: [ 3684.072438] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 | ||
31 | Jul 1 21:58:36 nemi kernel: [ 3684.072444] Process qmi.pl (pid: 12235, threadinfo ffff88022dca0000, task ffff88022ff76380) | ||
32 | Jul 1 21:58:36 nemi kernel: [ 3684.072448] Stack: | ||
33 | Jul 1 21:58:36 nemi kernel: [ 3684.072458] ffffffffa063592e 0000000100020000 ffff88022fc3f650 ffff88022fc3f6a8 | ||
34 | Jul 1 21:58:36 nemi kernel: [ 3684.072466] 0000000000000200 0000000100000000 000000000267d810 0000000000000000 | ||
35 | Jul 1 21:58:36 nemi kernel: [ 3684.072475] 0000000000000000 ffff880212cfb6d0 0000000000000200 ffff880212cfb6c0 | ||
36 | Jul 1 21:58:36 nemi kernel: [ 3684.072479] Call Trace: | ||
37 | Jul 1 21:58:36 nemi kernel: [ 3684.072489] [<ffffffffa063592e>] ? wdm_read+0x1a0/0x263 [cdc_wdm] | ||
38 | Jul 1 21:58:36 nemi kernel: [ 3684.072500] [<ffffffff8110adb7>] ? vfs_read+0xa1/0xfb | ||
39 | Jul 1 21:58:36 nemi kernel: [ 3684.072509] [<ffffffff81040589>] ? alarm_setitimer+0x35/0x64 | ||
40 | Jul 1 21:58:36 nemi kernel: [ 3684.072517] [<ffffffff8110aec7>] ? sys_read+0x45/0x6e | ||
41 | Jul 1 21:58:36 nemi kernel: [ 3684.072525] [<ffffffff813725f9>] ? system_call_fastpath+0x16/0x1b | ||
42 | Jul 1 21:58:36 nemi kernel: [ 3684.072557] Code: <66> 66 90 c3 83 ff ed 89 f8 74 16 7f 06 83 ff a1 75 0a c3 83 ff f4 | ||
43 | |||
44 | The WDM_READ flag is normally cleared by wdm_int_callback | ||
45 | before resubmitting the read urb, and set by wdm_in_callback | ||
46 | when this urb returns with data or an error. But a crashing | ||
47 | device may cause both a read error and cancelling all urbs. | ||
48 | Make sure that the flag is cleared by wdm_read if the buffer | ||
49 | is empty. | ||
50 | |||
51 | We don't clear the flag on errors, as there may be pending | ||
52 | data in the buffer which should be processed. The flag will | ||
53 | instead be cleared on the next wdm_read call. | ||
54 | |||
55 | Signed-off-by: Bjørn Mork <bjorn@mork.no> | ||
56 | Acked-by: Oliver Neukum <oneukum@suse.de> | ||
57 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
58 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
59 | --- | ||
60 | drivers/usb/class/cdc-wdm.c | 2 ++ | ||
61 | 1 files changed, 2 insertions(+), 0 deletions(-) | ||
62 | |||
63 | diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c | ||
64 | index 19fb5fa..9aaed0d 100644 | ||
65 | --- a/drivers/usb/class/cdc-wdm.c | ||
66 | +++ b/drivers/usb/class/cdc-wdm.c | ||
67 | @@ -473,6 +473,8 @@ retry: | ||
68 | goto retry; | ||
69 | } | ||
70 | if (!desc->reslength) { /* zero length read */ | ||
71 | + dev_dbg(&desc->intf->dev, "%s: zero length - clearing WDM_READ\n", __func__); | ||
72 | + clear_bit(WDM_READ, &desc->flags); | ||
73 | spin_unlock_irq(&desc->iuspin); | ||
74 | goto retry; | ||
75 | } | ||
76 | -- | ||
77 | 1.7.7.6 | ||
78 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0032-mtd-nandsim-don-t-open-code-a-do_div-helper.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0032-mtd-nandsim-don-t-open-code-a-do_div-helper.patch new file mode 100644 index 00000000..e96b5c56 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0032-mtd-nandsim-don-t-open-code-a-do_div-helper.patch | |||
@@ -0,0 +1,94 @@ | |||
1 | From bb5561cb838492a05e5dae25114d768828fe2dfe Mon Sep 17 00:00:00 2001 | ||
2 | From: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com> | ||
3 | Date: Wed, 16 May 2012 16:21:52 -0300 | ||
4 | Subject: [PATCH 032/109] mtd: nandsim: don't open code a do_div helper | ||
5 | |||
6 | commit 596fd46268634082314b3af1ded4612e1b7f3f03 upstream. | ||
7 | |||
8 | We don't need to open code the divide function, just use div_u64 that | ||
9 | already exists and do the same job. While this is a straightforward | ||
10 | clean up, there is more to that, the real motivation for this. | ||
11 | |||
12 | While building on a cross compiling environment in armel, using gcc | ||
13 | 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5), I was getting the following build | ||
14 | error: | ||
15 | |||
16 | ERROR: "__aeabi_uldivmod" [drivers/mtd/nand/nandsim.ko] undefined! | ||
17 | |||
18 | After investigating with objdump and hand built assembly version | ||
19 | generated with the compiler, I narrowed __aeabi_uldivmod as being | ||
20 | generated from the divide function. When nandsim.c is built with | ||
21 | -fno-inline-functions-called-once, that happens when | ||
22 | CONFIG_DEBUG_SECTION_MISMATCH is enabled, the do_div optimization in | ||
23 | arch/arm/include/asm/div64.h doesn't work as expected with the open | ||
24 | coded divide function: even if the do_div we are using doesn't have a | ||
25 | constant divisor, the compiler still includes the else parts of the | ||
26 | optimized do_div macro, and translates the divisions there to use | ||
27 | __aeabi_uldivmod, instead of only calling __do_div_asm -> __do_div64 and | ||
28 | optimizing/removing everything else out. | ||
29 | |||
30 | So to reproduce, gcc 4.6 plus CONFIG_DEBUG_SECTION_MISMATCH=y and | ||
31 | CONFIG_MTD_NAND_NANDSIM=m should do it, building on armel. | ||
32 | |||
33 | After this change, the compiler does the intended thing even with | ||
34 | -fno-inline-functions-called-once, and optimizes out as expected the | ||
35 | constant handling in the optimized do_div on arm. As this also avoids a | ||
36 | build issue, I'm marking for Stable, as I think is applicable for this | ||
37 | case. | ||
38 | |||
39 | Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com> | ||
40 | Acked-by: Nicolas Pitre <nico@linaro.org> | ||
41 | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | ||
42 | Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> | ||
43 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
44 | --- | ||
45 | drivers/mtd/nand/nandsim.c | 12 +++--------- | ||
46 | 1 files changed, 3 insertions(+), 9 deletions(-) | ||
47 | |||
48 | diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c | ||
49 | index 34c03be..83e8e1b 100644 | ||
50 | --- a/drivers/mtd/nand/nandsim.c | ||
51 | +++ b/drivers/mtd/nand/nandsim.c | ||
52 | @@ -28,7 +28,7 @@ | ||
53 | #include <linux/module.h> | ||
54 | #include <linux/moduleparam.h> | ||
55 | #include <linux/vmalloc.h> | ||
56 | -#include <asm/div64.h> | ||
57 | +#include <linux/math64.h> | ||
58 | #include <linux/slab.h> | ||
59 | #include <linux/errno.h> | ||
60 | #include <linux/string.h> | ||
61 | @@ -547,12 +547,6 @@ static char *get_partition_name(int i) | ||
62 | return kstrdup(buf, GFP_KERNEL); | ||
63 | } | ||
64 | |||
65 | -static uint64_t divide(uint64_t n, uint32_t d) | ||
66 | -{ | ||
67 | - do_div(n, d); | ||
68 | - return n; | ||
69 | -} | ||
70 | - | ||
71 | /* | ||
72 | * Initialize the nandsim structure. | ||
73 | * | ||
74 | @@ -581,7 +575,7 @@ static int init_nandsim(struct mtd_info *mtd) | ||
75 | ns->geom.oobsz = mtd->oobsize; | ||
76 | ns->geom.secsz = mtd->erasesize; | ||
77 | ns->geom.pgszoob = ns->geom.pgsz + ns->geom.oobsz; | ||
78 | - ns->geom.pgnum = divide(ns->geom.totsz, ns->geom.pgsz); | ||
79 | + ns->geom.pgnum = div_u64(ns->geom.totsz, ns->geom.pgsz); | ||
80 | ns->geom.totszoob = ns->geom.totsz + (uint64_t)ns->geom.pgnum * ns->geom.oobsz; | ||
81 | ns->geom.secshift = ffs(ns->geom.secsz) - 1; | ||
82 | ns->geom.pgshift = chip->page_shift; | ||
83 | @@ -924,7 +918,7 @@ static int setup_wear_reporting(struct mtd_info *mtd) | ||
84 | |||
85 | if (!rptwear) | ||
86 | return 0; | ||
87 | - wear_eb_count = divide(mtd->size, mtd->erasesize); | ||
88 | + wear_eb_count = div_u64(mtd->size, mtd->erasesize); | ||
89 | mem = wear_eb_count * sizeof(unsigned long); | ||
90 | if (mem / sizeof(unsigned long) != wear_eb_count) { | ||
91 | NS_ERR("Too many erase blocks for wear reporting\n"); | ||
92 | -- | ||
93 | 1.7.7.6 | ||
94 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0033-dvb-core-Release-semaphore-on-error-path-dvb_registe.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0033-dvb-core-Release-semaphore-on-error-path-dvb_registe.patch new file mode 100644 index 00000000..4ad1726f --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0033-dvb-core-Release-semaphore-on-error-path-dvb_registe.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From 9b4b8dd705a1a7f9c4b7c2128663d2e31b1d0265 Mon Sep 17 00:00:00 2001 | ||
2 | From: Santosh Nayak <santoshprasadnayak@gmail.com> | ||
3 | Date: Sat, 23 Jun 2012 07:59:54 -0300 | ||
4 | Subject: [PATCH 033/109] dvb-core: Release semaphore on error path | ||
5 | dvb_register_device() | ||
6 | |||
7 | commit 82163edcdfa4eb3d74516cc8e9f38dd3d039b67d upstream. | ||
8 | |||
9 | There is a missing "up_write()" here. Semaphore should be released | ||
10 | before returning error value. | ||
11 | |||
12 | Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com> | ||
13 | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> | ||
14 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
15 | --- | ||
16 | drivers/media/dvb/dvb-core/dvbdev.c | 1 + | ||
17 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
18 | |||
19 | diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c | ||
20 | index f732877..d5cda35 100644 | ||
21 | --- a/drivers/media/dvb/dvb-core/dvbdev.c | ||
22 | +++ b/drivers/media/dvb/dvb-core/dvbdev.c | ||
23 | @@ -243,6 +243,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, | ||
24 | if (minor == MAX_DVB_MINORS) { | ||
25 | kfree(dvbdevfops); | ||
26 | kfree(dvbdev); | ||
27 | + up_write(&minor_rwsem); | ||
28 | mutex_unlock(&dvbdev_register_lock); | ||
29 | return -EINVAL; | ||
30 | } | ||
31 | -- | ||
32 | 1.7.7.6 | ||
33 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0034-hwspinlock-core-use-global-ID-to-register-hwspinlock.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0034-hwspinlock-core-use-global-ID-to-register-hwspinlock.patch new file mode 100644 index 00000000..11ba36d2 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0034-hwspinlock-core-use-global-ID-to-register-hwspinlock.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From 6c6190dbd1e0054c77445ed61dcbc70db441d4d2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com> | ||
3 | Date: Sat, 7 Jul 2012 13:37:42 +0300 | ||
4 | Subject: [PATCH 034/109] hwspinlock/core: use global ID to register | ||
5 | hwspinlocks on multiple devices | ||
6 | |||
7 | commit 476a7eeb60e70ddab138e7cb4bc44ef5ac20782e upstream. | ||
8 | |||
9 | Commit 300bab9770 (hwspinlock/core: register a bank of hwspinlocks in a | ||
10 | single API call, 2011-09-06) introduced 'hwspin_lock_register_single()' | ||
11 | to register numerous (a bank of) hwspinlock instances in a single API, | ||
12 | 'hwspin_lock_register()'. | ||
13 | |||
14 | At which time, 'hwspin_lock_register()' accidentally passes 'local IDs' | ||
15 | to 'hwspin_lock_register_single()', despite that ..._single() requires | ||
16 | 'global IDs' to register hwspinlocks. | ||
17 | |||
18 | We have to convert into global IDs by supplying the missing 'base_id'. | ||
19 | |||
20 | Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com> | ||
21 | [ohad: fix error path of hwspin_lock_register, too] | ||
22 | Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> | ||
23 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
24 | --- | ||
25 | drivers/hwspinlock/hwspinlock_core.c | 4 ++-- | ||
26 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
27 | |||
28 | diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c | ||
29 | index 61c9cf1..1201a15 100644 | ||
30 | --- a/drivers/hwspinlock/hwspinlock_core.c | ||
31 | +++ b/drivers/hwspinlock/hwspinlock_core.c | ||
32 | @@ -345,7 +345,7 @@ int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev, | ||
33 | spin_lock_init(&hwlock->lock); | ||
34 | hwlock->bank = bank; | ||
35 | |||
36 | - ret = hwspin_lock_register_single(hwlock, i); | ||
37 | + ret = hwspin_lock_register_single(hwlock, base_id + i); | ||
38 | if (ret) | ||
39 | goto reg_failed; | ||
40 | } | ||
41 | @@ -354,7 +354,7 @@ int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev, | ||
42 | |||
43 | reg_failed: | ||
44 | while (--i >= 0) | ||
45 | - hwspin_lock_unregister_single(i); | ||
46 | + hwspin_lock_unregister_single(base_id + i); | ||
47 | return ret; | ||
48 | } | ||
49 | EXPORT_SYMBOL_GPL(hwspin_lock_register); | ||
50 | -- | ||
51 | 1.7.7.6 | ||
52 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0035-libsas-fix-taskfile-corruption-in-sas_ata_qc_fill_rt.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0035-libsas-fix-taskfile-corruption-in-sas_ata_qc_fill_rt.patch new file mode 100644 index 00000000..88c76273 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0035-libsas-fix-taskfile-corruption-in-sas_ata_qc_fill_rt.patch | |||
@@ -0,0 +1,116 @@ | |||
1 | From 65719aa5de077d1ccbfe535e9b934d6e91d11601 Mon Sep 17 00:00:00 2001 | ||
2 | From: Dan Williams <dan.j.williams@intel.com> | ||
3 | Date: Fri, 22 Jun 2012 10:52:34 -0700 | ||
4 | Subject: [PATCH 035/109] libsas: fix taskfile corruption in | ||
5 | sas_ata_qc_fill_rtf | ||
6 | |||
7 | commit 6ef1b512f4e6f936d89aa20be3d97a7ec7c290ac upstream. | ||
8 | |||
9 | fill_result_tf() grabs the taskfile flags from the originating qc which | ||
10 | sas_ata_qc_fill_rtf() promptly overwrites. The presence of an | ||
11 | ata_taskfile in the sata_device makes it tempting to just copy the full | ||
12 | contents in sas_ata_qc_fill_rtf(). However, libata really only wants | ||
13 | the fis contents and expects the other portions of the taskfile to not | ||
14 | be touched by ->qc_fill_rtf. To that end store a fis buffer in the | ||
15 | sata_device and use ata_tf_from_fis() like every other ->qc_fill_rtf() | ||
16 | implementation. | ||
17 | |||
18 | Reported-by: Praveen Murali <pmurali@logicube.com> | ||
19 | Tested-by: Praveen Murali <pmurali@logicube.com> | ||
20 | Signed-off-by: Dan Williams <dan.j.williams@intel.com> | ||
21 | Signed-off-by: James Bottomley <JBottomley@Parallels.com> | ||
22 | [bwh: Backported to 3.2: adjust context] | ||
23 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
24 | --- | ||
25 | drivers/scsi/aic94xx/aic94xx_task.c | 2 +- | ||
26 | drivers/scsi/libsas/sas_ata.c | 12 ++++++------ | ||
27 | include/scsi/libsas.h | 6 ++++-- | ||
28 | 3 files changed, 11 insertions(+), 9 deletions(-) | ||
29 | |||
30 | diff --git a/drivers/scsi/aic94xx/aic94xx_task.c b/drivers/scsi/aic94xx/aic94xx_task.c | ||
31 | index 532d212..393e7ce 100644 | ||
32 | --- a/drivers/scsi/aic94xx/aic94xx_task.c | ||
33 | +++ b/drivers/scsi/aic94xx/aic94xx_task.c | ||
34 | @@ -201,7 +201,7 @@ static void asd_get_response_tasklet(struct asd_ascb *ascb, | ||
35 | |||
36 | if (SAS_STATUS_BUF_SIZE >= sizeof(*resp)) { | ||
37 | resp->frame_len = le16_to_cpu(*(__le16 *)(r+6)); | ||
38 | - memcpy(&resp->ending_fis[0], r+16, 24); | ||
39 | + memcpy(&resp->ending_fis[0], r+16, ATA_RESP_FIS_SIZE); | ||
40 | ts->buf_valid_size = sizeof(*resp); | ||
41 | } | ||
42 | } | ||
43 | diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c | ||
44 | index db9238f..4868fc9 100644 | ||
45 | --- a/drivers/scsi/libsas/sas_ata.c | ||
46 | +++ b/drivers/scsi/libsas/sas_ata.c | ||
47 | @@ -112,12 +112,12 @@ static void sas_ata_task_done(struct sas_task *task) | ||
48 | if (stat->stat == SAS_PROTO_RESPONSE || stat->stat == SAM_STAT_GOOD || | ||
49 | ((stat->stat == SAM_STAT_CHECK_CONDITION && | ||
50 | dev->sata_dev.command_set == ATAPI_COMMAND_SET))) { | ||
51 | - ata_tf_from_fis(resp->ending_fis, &dev->sata_dev.tf); | ||
52 | + memcpy(dev->sata_dev.fis, resp->ending_fis, ATA_RESP_FIS_SIZE); | ||
53 | |||
54 | if (!link->sactive) { | ||
55 | - qc->err_mask |= ac_err_mask(dev->sata_dev.tf.command); | ||
56 | + qc->err_mask |= ac_err_mask(dev->sata_dev.fis[2]); | ||
57 | } else { | ||
58 | - link->eh_info.err_mask |= ac_err_mask(dev->sata_dev.tf.command); | ||
59 | + link->eh_info.err_mask |= ac_err_mask(dev->sata_dev.fis[2]); | ||
60 | if (unlikely(link->eh_info.err_mask)) | ||
61 | qc->flags |= ATA_QCFLAG_FAILED; | ||
62 | } | ||
63 | @@ -138,8 +138,8 @@ static void sas_ata_task_done(struct sas_task *task) | ||
64 | qc->flags |= ATA_QCFLAG_FAILED; | ||
65 | } | ||
66 | |||
67 | - dev->sata_dev.tf.feature = 0x04; /* status err */ | ||
68 | - dev->sata_dev.tf.command = ATA_ERR; | ||
69 | + dev->sata_dev.fis[3] = 0x04; /* status err */ | ||
70 | + dev->sata_dev.fis[2] = ATA_ERR; | ||
71 | } | ||
72 | } | ||
73 | |||
74 | @@ -252,7 +252,7 @@ static bool sas_ata_qc_fill_rtf(struct ata_queued_cmd *qc) | ||
75 | { | ||
76 | struct domain_device *dev = qc->ap->private_data; | ||
77 | |||
78 | - memcpy(&qc->result_tf, &dev->sata_dev.tf, sizeof(qc->result_tf)); | ||
79 | + ata_tf_from_fis(dev->sata_dev.fis, &qc->result_tf); | ||
80 | return true; | ||
81 | } | ||
82 | |||
83 | diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h | ||
84 | index 6a308d4..1e100c6 100644 | ||
85 | --- a/include/scsi/libsas.h | ||
86 | +++ b/include/scsi/libsas.h | ||
87 | @@ -159,6 +159,8 @@ enum ata_command_set { | ||
88 | ATAPI_COMMAND_SET = 1, | ||
89 | }; | ||
90 | |||
91 | +#define ATA_RESP_FIS_SIZE 24 | ||
92 | + | ||
93 | struct sata_device { | ||
94 | enum ata_command_set command_set; | ||
95 | struct smp_resp rps_resp; /* report_phy_sata_resp */ | ||
96 | @@ -170,7 +172,7 @@ struct sata_device { | ||
97 | |||
98 | struct ata_port *ap; | ||
99 | struct ata_host ata_host; | ||
100 | - struct ata_taskfile tf; | ||
101 | + u8 fis[ATA_RESP_FIS_SIZE]; | ||
102 | u32 sstatus; | ||
103 | u32 serror; | ||
104 | u32 scontrol; | ||
105 | @@ -486,7 +488,7 @@ enum exec_status { | ||
106 | */ | ||
107 | struct ata_task_resp { | ||
108 | u16 frame_len; | ||
109 | - u8 ending_fis[24]; /* dev to host or data-in */ | ||
110 | + u8 ending_fis[ATA_RESP_FIS_SIZE]; /* dev to host or data-in */ | ||
111 | u32 sstatus; | ||
112 | u32 serror; | ||
113 | u32 scontrol; | ||
114 | -- | ||
115 | 1.7.7.6 | ||
116 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0036-md-raid1-fix-use-after-free-bug-in-RAID1-data-check-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0036-md-raid1-fix-use-after-free-bug-in-RAID1-data-check-.patch new file mode 100644 index 00000000..442a6e24 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0036-md-raid1-fix-use-after-free-bug-in-RAID1-data-check-.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | From 2710006f98cf587ce6b3108f543689de1bb6d60b Mon Sep 17 00:00:00 2001 | ||
2 | From: NeilBrown <neilb@suse.de> | ||
3 | Date: Mon, 9 Jul 2012 11:34:13 +1000 | ||
4 | Subject: [PATCH 036/109] md/raid1: fix use-after-free bug in RAID1 data-check | ||
5 | code. | ||
6 | |||
7 | commit 2d4f4f3384d4ef4f7c571448e803a1ce721113d5 upstream. | ||
8 | |||
9 | This bug has been present ever since data-check was introduce | ||
10 | in 2.6.16. However it would only fire if a data-check were | ||
11 | done on a degraded array, which was only possible if the array | ||
12 | has 3 or more devices. This is certainly possible, but is quite | ||
13 | uncommon. | ||
14 | |||
15 | Since hot-replace was added in 3.3 it can happen more often as | ||
16 | the same condition can arise if not all possible replacements are | ||
17 | present. | ||
18 | |||
19 | The problem is that as soon as we submit the last read request, the | ||
20 | 'r1_bio' structure could be freed at any time, so we really should | ||
21 | stop looking at it. If the last device is being read from we will | ||
22 | stop looking at it. However if the last device is not due to be read | ||
23 | from, we will still check the bio pointer in the r1_bio, but the | ||
24 | r1_bio might already be free. | ||
25 | |||
26 | So use the read_targets counter to make sure we stop looking for bios | ||
27 | to submit as soon as we have submitted them all. | ||
28 | |||
29 | This fix is suitable for any -stable kernel since 2.6.16. | ||
30 | |||
31 | Reported-by: Arnold Schulz <arnysch@gmx.net> | ||
32 | Signed-off-by: NeilBrown <neilb@suse.de> | ||
33 | [bwh: Backported to 3.2: no doubling of conf->raid_disks; we don't have | ||
34 | hot-replace support] | ||
35 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
36 | --- | ||
37 | drivers/md/raid1.c | 3 ++- | ||
38 | 1 files changed, 2 insertions(+), 1 deletions(-) | ||
39 | |||
40 | diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c | ||
41 | index 7af60ec..58f0055 100644 | ||
42 | --- a/drivers/md/raid1.c | ||
43 | +++ b/drivers/md/raid1.c | ||
44 | @@ -2378,9 +2378,10 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipp | ||
45 | */ | ||
46 | if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) { | ||
47 | atomic_set(&r1_bio->remaining, read_targets); | ||
48 | - for (i=0; i<conf->raid_disks; i++) { | ||
49 | + for (i = 0; i < conf->raid_disks && read_targets; i++) { | ||
50 | bio = r1_bio->bios[i]; | ||
51 | if (bio->bi_end_io == end_sync_read) { | ||
52 | + read_targets--; | ||
53 | md_sync_acct(bio->bi_bdev, nr_sectors); | ||
54 | generic_make_request(bio); | ||
55 | } | ||
56 | -- | ||
57 | 1.7.7.6 | ||
58 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0037-PCI-EHCI-fix-crash-during-suspend-on-ASUS-computers.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0037-PCI-EHCI-fix-crash-during-suspend-on-ASUS-computers.patch new file mode 100644 index 00000000..a5540c3f --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0037-PCI-EHCI-fix-crash-during-suspend-on-ASUS-computers.patch | |||
@@ -0,0 +1,166 @@ | |||
1 | From 45cd1f6207fb66990e5f25e11fb4cd9486c31794 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alan Stern <stern@rowland.harvard.edu> | ||
3 | Date: Mon, 9 Jul 2012 11:09:21 -0400 | ||
4 | Subject: [PATCH 037/109] PCI: EHCI: fix crash during suspend on ASUS | ||
5 | computers | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | commit dbf0e4c7257f8d684ec1a3c919853464293de66e upstream. | ||
11 | |||
12 | Quite a few ASUS computers experience a nasty problem, related to the | ||
13 | EHCI controllers, when going into system suspend. It was observed | ||
14 | that the problem didn't occur if the controllers were not put into the | ||
15 | D3 power state before starting the suspend, and commit | ||
16 | 151b61284776be2d6f02d48c23c3625678960b97 (USB: EHCI: fix crash during | ||
17 | suspend on ASUS computers) was created to do this. | ||
18 | |||
19 | It turned out this approach messed up other computers that didn't have | ||
20 | the problem -- it prevented USB wakeup from working. Consequently | ||
21 | commit c2fb8a3fa25513de8fedb38509b1f15a5bbee47b (USB: add | ||
22 | NO_D3_DURING_SLEEP flag and revert 151b61284776be2) was merged; it | ||
23 | reverted the earlier commit and added a whitelist of known good board | ||
24 | names. | ||
25 | |||
26 | Now we know the actual cause of the problem. Thanks to AceLan Kao for | ||
27 | tracking it down. | ||
28 | |||
29 | According to him, an engineer at ASUS explained that some of their | ||
30 | BIOSes contain a bug that was added in an attempt to work around a | ||
31 | problem in early versions of Windows. When the computer goes into S3 | ||
32 | suspend, the BIOS tries to verify that the EHCI controllers were first | ||
33 | quiesced by the OS. Nothing's wrong with this, but the BIOS does it | ||
34 | by checking that the PCI COMMAND registers contain 0 without checking | ||
35 | the controllers' power state. If the register isn't 0, the BIOS | ||
36 | assumes the controller needs to be quiesced and tries to do so. This | ||
37 | involves making various MMIO accesses to the controller, which don't | ||
38 | work very well if the controller is already in D3. The end result is | ||
39 | a system hang or memory corruption. | ||
40 | |||
41 | Since the value in the PCI COMMAND register doesn't matter once the | ||
42 | controller has been suspended, and since the value will be restored | ||
43 | anyway when the controller is resumed, we can work around the BIOS bug | ||
44 | simply by setting the register to 0 during system suspend. This patch | ||
45 | (as1590) does so and also reverts the second commit mentioned above, | ||
46 | which is now unnecessary. | ||
47 | |||
48 | In theory we could do this for every PCI device. However to avoid | ||
49 | introducing new problems, the patch restricts itself to EHCI host | ||
50 | controllers. | ||
51 | |||
52 | Finally the affected systems can suspend with USB wakeup working | ||
53 | properly. | ||
54 | |||
55 | Reference: https://bugzilla.kernel.org/show_bug.cgi?id=37632 | ||
56 | Reference: https://bugzilla.kernel.org/show_bug.cgi?id=42728 | ||
57 | Based-on-patch-by: AceLan Kao <acelan.kao@canonical.com> | ||
58 | Signed-off-by: Alan Stern <stern@rowland.harvard.edu> | ||
59 | Tested-by: Dâniel Fraga <fragabr@gmail.com> | ||
60 | Tested-by: Javier Marcet <jmarcet@gmail.com> | ||
61 | Tested-by: Andrey Rahmatullin <wrar@wrar.name> | ||
62 | Tested-by: Oleksij Rempel <bug-track@fisher-privat.net> | ||
63 | Tested-by: Pavel Pisa <pisa@cmp.felk.cvut.cz> | ||
64 | Acked-by: Bjorn Helgaas <bhelgaas@google.com> | ||
65 | Acked-by: Rafael J. Wysocki <rjw@sisk.pl> | ||
66 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
67 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
68 | --- | ||
69 | drivers/pci/pci-driver.c | 12 ++++++++++++ | ||
70 | drivers/pci/pci.c | 5 ----- | ||
71 | drivers/pci/quirks.c | 26 -------------------------- | ||
72 | include/linux/pci.h | 2 -- | ||
73 | 4 files changed, 12 insertions(+), 33 deletions(-) | ||
74 | |||
75 | diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c | ||
76 | index 12d1e81..d024f83 100644 | ||
77 | --- a/drivers/pci/pci-driver.c | ||
78 | +++ b/drivers/pci/pci-driver.c | ||
79 | @@ -742,6 +742,18 @@ static int pci_pm_suspend_noirq(struct device *dev) | ||
80 | |||
81 | pci_pm_set_unknown_state(pci_dev); | ||
82 | |||
83 | + /* | ||
84 | + * Some BIOSes from ASUS have a bug: If a USB EHCI host controller's | ||
85 | + * PCI COMMAND register isn't 0, the BIOS assumes that the controller | ||
86 | + * hasn't been quiesced and tries to turn it off. If the controller | ||
87 | + * is already in D3, this can hang or cause memory corruption. | ||
88 | + * | ||
89 | + * Since the value of the COMMAND register doesn't matter once the | ||
90 | + * device has been suspended, we can safely set it to 0 here. | ||
91 | + */ | ||
92 | + if (pci_dev->class == PCI_CLASS_SERIAL_USB_EHCI) | ||
93 | + pci_write_config_word(pci_dev, PCI_COMMAND, 0); | ||
94 | + | ||
95 | return 0; | ||
96 | } | ||
97 | |||
98 | diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c | ||
99 | index e5b75eb..6d4a531 100644 | ||
100 | --- a/drivers/pci/pci.c | ||
101 | +++ b/drivers/pci/pci.c | ||
102 | @@ -1689,11 +1689,6 @@ int pci_prepare_to_sleep(struct pci_dev *dev) | ||
103 | if (target_state == PCI_POWER_ERROR) | ||
104 | return -EIO; | ||
105 | |||
106 | - /* Some devices mustn't be in D3 during system sleep */ | ||
107 | - if (target_state == PCI_D3hot && | ||
108 | - (dev->dev_flags & PCI_DEV_FLAGS_NO_D3_DURING_SLEEP)) | ||
109 | - return 0; | ||
110 | - | ||
111 | pci_enable_wake(dev, target_state, device_may_wakeup(&dev->dev)); | ||
112 | |||
113 | error = pci_set_power_state(dev, target_state); | ||
114 | diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c | ||
115 | index 3c56fec..78fda9c 100644 | ||
116 | --- a/drivers/pci/quirks.c | ||
117 | +++ b/drivers/pci/quirks.c | ||
118 | @@ -2940,32 +2940,6 @@ static void __devinit disable_igfx_irq(struct pci_dev *dev) | ||
119 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0102, disable_igfx_irq); | ||
120 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); | ||
121 | |||
122 | -/* | ||
123 | - * The Intel 6 Series/C200 Series chipset's EHCI controllers on many | ||
124 | - * ASUS motherboards will cause memory corruption or a system crash | ||
125 | - * if they are in D3 while the system is put into S3 sleep. | ||
126 | - */ | ||
127 | -static void __devinit asus_ehci_no_d3(struct pci_dev *dev) | ||
128 | -{ | ||
129 | - const char *sys_info; | ||
130 | - static const char good_Asus_board[] = "P8Z68-V"; | ||
131 | - | ||
132 | - if (dev->dev_flags & PCI_DEV_FLAGS_NO_D3_DURING_SLEEP) | ||
133 | - return; | ||
134 | - if (dev->subsystem_vendor != PCI_VENDOR_ID_ASUSTEK) | ||
135 | - return; | ||
136 | - sys_info = dmi_get_system_info(DMI_BOARD_NAME); | ||
137 | - if (sys_info && memcmp(sys_info, good_Asus_board, | ||
138 | - sizeof(good_Asus_board) - 1) == 0) | ||
139 | - return; | ||
140 | - | ||
141 | - dev_info(&dev->dev, "broken D3 during system sleep on ASUS\n"); | ||
142 | - dev->dev_flags |= PCI_DEV_FLAGS_NO_D3_DURING_SLEEP; | ||
143 | - device_set_wakeup_capable(&dev->dev, false); | ||
144 | -} | ||
145 | -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1c26, asus_ehci_no_d3); | ||
146 | -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1c2d, asus_ehci_no_d3); | ||
147 | - | ||
148 | static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, | ||
149 | struct pci_fixup *end) | ||
150 | { | ||
151 | diff --git a/include/linux/pci.h b/include/linux/pci.h | ||
152 | index c0cfa0d..7cda65b 100644 | ||
153 | --- a/include/linux/pci.h | ||
154 | +++ b/include/linux/pci.h | ||
155 | @@ -176,8 +176,6 @@ enum pci_dev_flags { | ||
156 | PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2, | ||
157 | /* Provide indication device is assigned by a Virtual Machine Manager */ | ||
158 | PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) 4, | ||
159 | - /* Device causes system crash if in D3 during S3 sleep */ | ||
160 | - PCI_DEV_FLAGS_NO_D3_DURING_SLEEP = (__force pci_dev_flags_t) 8, | ||
161 | }; | ||
162 | |||
163 | enum pci_irq_reroute_variant { | ||
164 | -- | ||
165 | 1.7.7.6 | ||
166 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0038-memory-hotplug-fix-invalid-memory-access-caused-by-s.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0038-memory-hotplug-fix-invalid-memory-access-caused-by-s.patch new file mode 100644 index 00000000..5d3cef24 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0038-memory-hotplug-fix-invalid-memory-access-caused-by-s.patch | |||
@@ -0,0 +1,114 @@ | |||
1 | From c9a4beeb70f62ec5976dcbb9086683fda56d6aec Mon Sep 17 00:00:00 2001 | ||
2 | From: Jiang Liu <jiang.liu@huawei.com> | ||
3 | Date: Wed, 11 Jul 2012 14:01:52 -0700 | ||
4 | Subject: [PATCH 038/109] memory hotplug: fix invalid memory access caused by | ||
5 | stale kswapd pointer | ||
6 | |||
7 | commit d8adde17e5f858427504725218c56aef90e90fc7 upstream. | ||
8 | |||
9 | kswapd_stop() is called to destroy the kswapd work thread when all memory | ||
10 | of a NUMA node has been offlined. But kswapd_stop() only terminates the | ||
11 | work thread without resetting NODE_DATA(nid)->kswapd to NULL. The stale | ||
12 | pointer will prevent kswapd_run() from creating a new work thread when | ||
13 | adding memory to the memory-less NUMA node again. Eventually the stale | ||
14 | pointer may cause invalid memory access. | ||
15 | |||
16 | An example stack dump as below. It's reproduced with 2.6.32, but latest | ||
17 | kernel has the same issue. | ||
18 | |||
19 | BUG: unable to handle kernel NULL pointer dereference at (null) | ||
20 | IP: [<ffffffff81051a94>] exit_creds+0x12/0x78 | ||
21 | PGD 0 | ||
22 | Oops: 0000 [#1] SMP | ||
23 | last sysfs file: /sys/devices/system/memory/memory391/state | ||
24 | CPU 11 | ||
25 | Modules linked in: cpufreq_conservative cpufreq_userspace cpufreq_powersave acpi_cpufreq microcode fuse loop dm_mod tpm_tis rtc_cmos i2c_i801 rtc_core tpm serio_raw pcspkr sg tpm_bios igb i2c_core iTCO_wdt rtc_lib mptctl iTCO_vendor_support button dca bnx2 usbhid hid uhci_hcd ehci_hcd usbcore sd_mod crc_t10dif edd ext3 mbcache jbd fan ide_pci_generic ide_core ata_generic ata_piix libata thermal processor thermal_sys hwmon mptsas mptscsih mptbase scsi_transport_sas scsi_mod | ||
26 | Pid: 7949, comm: sh Not tainted 2.6.32.12-qiuxishi-5-default #92 Tecal RH2285 | ||
27 | RIP: 0010:exit_creds+0x12/0x78 | ||
28 | RSP: 0018:ffff8806044f1d78 EFLAGS: 00010202 | ||
29 | RAX: 0000000000000000 RBX: ffff880604f22140 RCX: 0000000000019502 | ||
30 | RDX: 0000000000000000 RSI: 0000000000000202 RDI: 0000000000000000 | ||
31 | RBP: ffff880604f22150 R08: 0000000000000000 R09: ffffffff81a4dc10 | ||
32 | R10: 00000000000032a0 R11: ffff880006202500 R12: 0000000000000000 | ||
33 | R13: 0000000000c40000 R14: 0000000000008000 R15: 0000000000000001 | ||
34 | FS: 00007fbc03d066f0(0000) GS:ffff8800282e0000(0000) knlGS:0000000000000000 | ||
35 | CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b | ||
36 | CR2: 0000000000000000 CR3: 000000060f029000 CR4: 00000000000006e0 | ||
37 | DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 | ||
38 | DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 | ||
39 | Process sh (pid: 7949, threadinfo ffff8806044f0000, task ffff880603d7c600) | ||
40 | Stack: | ||
41 | ffff880604f22140 ffffffff8103aac5 ffff880604f22140 ffffffff8104d21e | ||
42 | ffff880006202500 0000000000008000 0000000000c38000 ffffffff810bd5b1 | ||
43 | 0000000000000000 ffff880603d7c600 00000000ffffdd29 0000000000000003 | ||
44 | Call Trace: | ||
45 | __put_task_struct+0x5d/0x97 | ||
46 | kthread_stop+0x50/0x58 | ||
47 | offline_pages+0x324/0x3da | ||
48 | memory_block_change_state+0x179/0x1db | ||
49 | store_mem_state+0x9e/0xbb | ||
50 | sysfs_write_file+0xd0/0x107 | ||
51 | vfs_write+0xad/0x169 | ||
52 | sys_write+0x45/0x6e | ||
53 | system_call_fastpath+0x16/0x1b | ||
54 | Code: ff 4d 00 0f 94 c0 84 c0 74 08 48 89 ef e8 1f fd ff ff 5b 5d 31 c0 41 5c c3 53 48 8b 87 20 06 00 00 48 89 fb 48 8b bf 18 06 00 00 <8b> 00 48 c7 83 18 06 00 00 00 00 00 00 f0 ff 0f 0f 94 c0 84 c0 | ||
55 | RIP exit_creds+0x12/0x78 | ||
56 | RSP <ffff8806044f1d78> | ||
57 | CR2: 0000000000000000 | ||
58 | |||
59 | [akpm@linux-foundation.org: add pglist_data.kswapd locking comments] | ||
60 | Signed-off-by: Xishi Qiu <qiuxishi@huawei.com> | ||
61 | Signed-off-by: Jiang Liu <jiang.liu@huawei.com> | ||
62 | Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | ||
63 | Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | ||
64 | Acked-by: Mel Gorman <mgorman@suse.de> | ||
65 | Acked-by: David Rientjes <rientjes@google.com> | ||
66 | Reviewed-by: Minchan Kim <minchan@kernel.org> | ||
67 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
68 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
69 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
70 | --- | ||
71 | include/linux/mmzone.h | 2 +- | ||
72 | mm/vmscan.c | 7 +++++-- | ||
73 | 2 files changed, 6 insertions(+), 3 deletions(-) | ||
74 | |||
75 | diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h | ||
76 | index 188cb2f..905b1e1 100644 | ||
77 | --- a/include/linux/mmzone.h | ||
78 | +++ b/include/linux/mmzone.h | ||
79 | @@ -652,7 +652,7 @@ typedef struct pglist_data { | ||
80 | range, including holes */ | ||
81 | int node_id; | ||
82 | wait_queue_head_t kswapd_wait; | ||
83 | - struct task_struct *kswapd; | ||
84 | + struct task_struct *kswapd; /* Protected by lock_memory_hotplug() */ | ||
85 | int kswapd_max_order; | ||
86 | enum zone_type classzone_idx; | ||
87 | } pg_data_t; | ||
88 | diff --git a/mm/vmscan.c b/mm/vmscan.c | ||
89 | index fbe2d2c..72cf498 100644 | ||
90 | --- a/mm/vmscan.c | ||
91 | +++ b/mm/vmscan.c | ||
92 | @@ -3090,14 +3090,17 @@ int kswapd_run(int nid) | ||
93 | } | ||
94 | |||
95 | /* | ||
96 | - * Called by memory hotplug when all memory in a node is offlined. | ||
97 | + * Called by memory hotplug when all memory in a node is offlined. Caller must | ||
98 | + * hold lock_memory_hotplug(). | ||
99 | */ | ||
100 | void kswapd_stop(int nid) | ||
101 | { | ||
102 | struct task_struct *kswapd = NODE_DATA(nid)->kswapd; | ||
103 | |||
104 | - if (kswapd) | ||
105 | + if (kswapd) { | ||
106 | kthread_stop(kswapd); | ||
107 | + NODE_DATA(nid)->kswapd = NULL; | ||
108 | + } | ||
109 | } | ||
110 | |||
111 | static int __init kswapd_init(void) | ||
112 | -- | ||
113 | 1.7.7.6 | ||
114 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0039-ocfs2-fix-NULL-pointer-dereference-in-__ocfs2_change.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0039-ocfs2-fix-NULL-pointer-dereference-in-__ocfs2_change.patch new file mode 100644 index 00000000..64d18e28 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0039-ocfs2-fix-NULL-pointer-dereference-in-__ocfs2_change.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 827be17f16d9325db1c05f012ceab345139f7cad Mon Sep 17 00:00:00 2001 | ||
2 | From: Luis Henriques <luis.henriques@canonical.com> | ||
3 | Date: Wed, 11 Jul 2012 14:02:10 -0700 | ||
4 | Subject: [PATCH 039/109] ocfs2: fix NULL pointer dereference in | ||
5 | __ocfs2_change_file_space() | ||
6 | |||
7 | commit a4e08d001f2e50bb8b3c4eebadcf08e5535f02ee upstream. | ||
8 | |||
9 | As ocfs2_fallocate() will invoke __ocfs2_change_file_space() with a NULL | ||
10 | as the first parameter (file), it may trigger a NULL pointer dereferrence | ||
11 | due to a missing check. | ||
12 | |||
13 | Addresses http://bugs.launchpad.net/bugs/1006012 | ||
14 | |||
15 | Signed-off-by: Luis Henriques <luis.henriques@canonical.com> | ||
16 | Reported-by: Bret Towe <magnade@gmail.com> | ||
17 | Tested-by: Bret Towe <magnade@gmail.com> | ||
18 | Cc: Sunil Mushran <sunil.mushran@oracle.com> | ||
19 | Acked-by: Joel Becker <jlbec@evilplan.org> | ||
20 | Acked-by: Mark Fasheh <mfasheh@suse.com> | ||
21 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
22 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
23 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
24 | --- | ||
25 | fs/ocfs2/file.c | 2 +- | ||
26 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
27 | |||
28 | diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c | ||
29 | index 07ee5b4..1c7d45e 100644 | ||
30 | --- a/fs/ocfs2/file.c | ||
31 | +++ b/fs/ocfs2/file.c | ||
32 | @@ -1950,7 +1950,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode, | ||
33 | if (ret < 0) | ||
34 | mlog_errno(ret); | ||
35 | |||
36 | - if (file->f_flags & O_SYNC) | ||
37 | + if (file && (file->f_flags & O_SYNC)) | ||
38 | handle->h_sync = 1; | ||
39 | |||
40 | ocfs2_commit_trans(osb, handle); | ||
41 | -- | ||
42 | 1.7.7.6 | ||
43 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0040-mm-thp-abort-compaction-if-migration-page-cannot-be-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0040-mm-thp-abort-compaction-if-migration-page-cannot-be-.patch new file mode 100644 index 00000000..74ca9bf6 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0040-mm-thp-abort-compaction-if-migration-page-cannot-be-.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From 6a918e81eb228757f20a244ee0d81c32ba7feedc Mon Sep 17 00:00:00 2001 | ||
2 | From: David Rientjes <rientjes@google.com> | ||
3 | Date: Wed, 11 Jul 2012 14:02:13 -0700 | ||
4 | Subject: [PATCH 040/109] mm, thp: abort compaction if migration page cannot | ||
5 | be charged to memcg | ||
6 | |||
7 | commit 4bf2bba3750f10aa9e62e6949bc7e8329990f01b upstream. | ||
8 | |||
9 | If page migration cannot charge the temporary page to the memcg, | ||
10 | migrate_pages() will return -ENOMEM. This isn't considered in memory | ||
11 | compaction however, and the loop continues to iterate over all | ||
12 | pageblocks trying to isolate and migrate pages. If a small number of | ||
13 | very large memcgs happen to be oom, however, these attempts will mostly | ||
14 | be futile leading to an enormous amout of cpu consumption due to the | ||
15 | page migration failures. | ||
16 | |||
17 | This patch will short circuit and fail memory compaction if | ||
18 | migrate_pages() returns -ENOMEM. COMPACT_PARTIAL is returned in case | ||
19 | some migrations were successful so that the page allocator will retry. | ||
20 | |||
21 | Signed-off-by: David Rientjes <rientjes@google.com> | ||
22 | Acked-by: Mel Gorman <mgorman@suse.de> | ||
23 | Cc: Minchan Kim <minchan@kernel.org> | ||
24 | Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | ||
25 | Cc: Rik van Riel <riel@redhat.com> | ||
26 | Cc: Andrea Arcangeli <aarcange@redhat.com> | ||
27 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
28 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
29 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
30 | --- | ||
31 | mm/compaction.c | 5 ++++- | ||
32 | 1 files changed, 4 insertions(+), 1 deletions(-) | ||
33 | |||
34 | diff --git a/mm/compaction.c b/mm/compaction.c | ||
35 | index 8fb8a40..50f1c60 100644 | ||
36 | --- a/mm/compaction.c | ||
37 | +++ b/mm/compaction.c | ||
38 | @@ -592,8 +592,11 @@ static int compact_zone(struct zone *zone, struct compact_control *cc) | ||
39 | if (err) { | ||
40 | putback_lru_pages(&cc->migratepages); | ||
41 | cc->nr_migratepages = 0; | ||
42 | + if (err == -ENOMEM) { | ||
43 | + ret = COMPACT_PARTIAL; | ||
44 | + goto out; | ||
45 | + } | ||
46 | } | ||
47 | - | ||
48 | } | ||
49 | |||
50 | out: | ||
51 | -- | ||
52 | 1.7.7.6 | ||
53 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0041-drivers-rtc-rtc-mxc.c-fix-irq-enabled-interrupts-war.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0041-drivers-rtc-rtc-mxc.c-fix-irq-enabled-interrupts-war.patch new file mode 100644 index 00000000..0df7b6ef --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0041-drivers-rtc-rtc-mxc.c-fix-irq-enabled-interrupts-war.patch | |||
@@ -0,0 +1,74 @@ | |||
1 | From 810c142eafb17318d32209a727060a756a57235d Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= | ||
3 | <benoit.thebaudeau@advansee.com> | ||
4 | Date: Wed, 11 Jul 2012 14:02:32 -0700 | ||
5 | Subject: [PATCH 041/109] drivers/rtc/rtc-mxc.c: fix irq enabled interrupts | ||
6 | warning | ||
7 | MIME-Version: 1.0 | ||
8 | Content-Type: text/plain; charset=UTF-8 | ||
9 | Content-Transfer-Encoding: 8bit | ||
10 | |||
11 | commit b59f6d1febd6cbe9fae4589bf72da0ed32bc69e0 upstream. | ||
12 | |||
13 | Fixes | ||
14 | |||
15 | WARNING: at irq/handle.c:146 handle_irq_event_percpu+0x19c/0x1b8() | ||
16 | irq 25 handler mxc_rtc_interrupt+0x0/0xac enabled interrupts | ||
17 | Modules linked in: | ||
18 | (unwind_backtrace+0x0/0xf0) from (warn_slowpath_common+0x4c/0x64) | ||
19 | (warn_slowpath_common+0x4c/0x64) from (warn_slowpath_fmt+0x30/0x40) | ||
20 | (warn_slowpath_fmt+0x30/0x40) from (handle_irq_event_percpu+0x19c/0x1b8) | ||
21 | (handle_irq_event_percpu+0x19c/0x1b8) from (handle_irq_event+0x28/0x38) | ||
22 | (handle_irq_event+0x28/0x38) from (handle_level_irq+0x80/0xc4) | ||
23 | (handle_level_irq+0x80/0xc4) from (generic_handle_irq+0x24/0x38) | ||
24 | (generic_handle_irq+0x24/0x38) from (handle_IRQ+0x30/0x84) | ||
25 | (handle_IRQ+0x30/0x84) from (avic_handle_irq+0x2c/0x4c) | ||
26 | (avic_handle_irq+0x2c/0x4c) from (__irq_svc+0x40/0x60) | ||
27 | Exception stack(0xc050bf60 to 0xc050bfa8) | ||
28 | bf60: 00000001 00000000 003c4208 c0018e20 c050a000 c050a000 c054a4c8 c050a000 | ||
29 | bf80: c05157a8 4117b363 80503bb4 00000000 01000000 c050bfa8 c0018e2c c000e808 | ||
30 | bfa0: 60000013 ffffffff | ||
31 | (__irq_svc+0x40/0x60) from (default_idle+0x1c/0x30) | ||
32 | (default_idle+0x1c/0x30) from (cpu_idle+0x68/0xa8) | ||
33 | (cpu_idle+0x68/0xa8) from (start_kernel+0x22c/0x26c) | ||
34 | |||
35 | Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> | ||
36 | Cc: Alessandro Zummo <a.zummo@towertech.it> | ||
37 | Cc: Sascha Hauer <kernel@pengutronix.de> | ||
38 | Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | ||
39 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
40 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
41 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
42 | --- | ||
43 | drivers/rtc/rtc-mxc.c | 5 +++-- | ||
44 | 1 files changed, 3 insertions(+), 2 deletions(-) | ||
45 | |||
46 | diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c | ||
47 | index 39e41fb..5160354 100644 | ||
48 | --- a/drivers/rtc/rtc-mxc.c | ||
49 | +++ b/drivers/rtc/rtc-mxc.c | ||
50 | @@ -191,10 +191,11 @@ static irqreturn_t mxc_rtc_interrupt(int irq, void *dev_id) | ||
51 | struct platform_device *pdev = dev_id; | ||
52 | struct rtc_plat_data *pdata = platform_get_drvdata(pdev); | ||
53 | void __iomem *ioaddr = pdata->ioaddr; | ||
54 | + unsigned long flags; | ||
55 | u32 status; | ||
56 | u32 events = 0; | ||
57 | |||
58 | - spin_lock_irq(&pdata->rtc->irq_lock); | ||
59 | + spin_lock_irqsave(&pdata->rtc->irq_lock, flags); | ||
60 | status = readw(ioaddr + RTC_RTCISR) & readw(ioaddr + RTC_RTCIENR); | ||
61 | /* clear interrupt sources */ | ||
62 | writew(status, ioaddr + RTC_RTCISR); | ||
63 | @@ -217,7 +218,7 @@ static irqreturn_t mxc_rtc_interrupt(int irq, void *dev_id) | ||
64 | rtc_update_alarm(&pdev->dev, &pdata->g_rtc_alarm); | ||
65 | |||
66 | rtc_update_irq(pdata->rtc, 1, events); | ||
67 | - spin_unlock_irq(&pdata->rtc->irq_lock); | ||
68 | + spin_unlock_irqrestore(&pdata->rtc->irq_lock, flags); | ||
69 | |||
70 | return IRQ_HANDLED; | ||
71 | } | ||
72 | -- | ||
73 | 1.7.7.6 | ||
74 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0042-fs-ramfs-file-nommu-add-SetPageUptodate.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0042-fs-ramfs-file-nommu-add-SetPageUptodate.patch new file mode 100644 index 00000000..89f0feac --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0042-fs-ramfs-file-nommu-add-SetPageUptodate.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From e3b50d463ce69af9fb5b2d4a54e6c37637c2ecef Mon Sep 17 00:00:00 2001 | ||
2 | From: Bob Liu <lliubbo@gmail.com> | ||
3 | Date: Wed, 11 Jul 2012 14:02:35 -0700 | ||
4 | Subject: [PATCH 042/109] fs: ramfs: file-nommu: add SetPageUptodate() | ||
5 | |||
6 | commit fea9f718b3d68147f162ed2d870183ce5e0ad8d8 upstream. | ||
7 | |||
8 | There is a bug in the below scenario for !CONFIG_MMU: | ||
9 | |||
10 | 1. create a new file | ||
11 | 2. mmap the file and write to it | ||
12 | 3. read the file can't get the correct value | ||
13 | |||
14 | Because | ||
15 | |||
16 | sys_read() -> generic_file_aio_read() -> simple_readpage() -> clear_page() | ||
17 | |||
18 | which causes the page to be zeroed. | ||
19 | |||
20 | Add SetPageUptodate() to ramfs_nommu_expand_for_mapping() so that | ||
21 | generic_file_aio_read() do not call simple_readpage(). | ||
22 | |||
23 | Signed-off-by: Bob Liu <lliubbo@gmail.com> | ||
24 | Cc: Hugh Dickins <hughd@google.com> | ||
25 | Cc: David Howells <dhowells@redhat.com> | ||
26 | Cc: Geert Uytterhoeven <geert@linux-m68k.org> | ||
27 | Cc: Greg Ungerer <gerg@uclinux.org> | ||
28 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
29 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
30 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
31 | --- | ||
32 | fs/ramfs/file-nommu.c | 1 + | ||
33 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
34 | |||
35 | diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c | ||
36 | index fbb0b47..d5378d0 100644 | ||
37 | --- a/fs/ramfs/file-nommu.c | ||
38 | +++ b/fs/ramfs/file-nommu.c | ||
39 | @@ -110,6 +110,7 @@ int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) | ||
40 | |||
41 | /* prevent the page from being discarded on memory pressure */ | ||
42 | SetPageDirty(page); | ||
43 | + SetPageUptodate(page); | ||
44 | |||
45 | unlock_page(page); | ||
46 | put_page(page); | ||
47 | -- | ||
48 | 1.7.7.6 | ||
49 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0043-cpufreq-ACPI-Fix-not-loading-acpi-cpufreq-driver-reg.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0043-cpufreq-ACPI-Fix-not-loading-acpi-cpufreq-driver-reg.patch new file mode 100644 index 00000000..21c973d3 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0043-cpufreq-ACPI-Fix-not-loading-acpi-cpufreq-driver-reg.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From 8d63c0484f5ed79f498c5bf3e5b90de29555bcb7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Thomas Renninger <trenn@suse.de> | ||
3 | Date: Thu, 12 Jul 2012 12:24:33 +0200 | ||
4 | Subject: [PATCH 043/109] cpufreq / ACPI: Fix not loading acpi-cpufreq driver | ||
5 | regression | ||
6 | |||
7 | commit c4686c71a9183f76e3ef59098da5c098748672f6 upstream. | ||
8 | |||
9 | Commit d640113fe80e45ebd4a5b420b introduced a regression on SMP | ||
10 | systems where the processor core with ACPI id zero is disabled | ||
11 | (typically should be the case because of hyperthreading). | ||
12 | The regression got spread through stable kernels. | ||
13 | On 3.0.X it got introduced via 3.0.18. | ||
14 | |||
15 | Such platforms may be rare, but do exist. | ||
16 | Look out for a disabled processor with acpi_id 0 in dmesg: | ||
17 | ACPI: LAPIC (acpi_id[0x00] lapic_id[0x10] disabled) | ||
18 | |||
19 | This problem has been observed on a: | ||
20 | HP Proliant BL280c G6 blade | ||
21 | |||
22 | This patch restricts the introduced workaround to platforms | ||
23 | with nr_cpu_ids <= 1. | ||
24 | |||
25 | Signed-off-by: Thomas Renninger <trenn@suse.de> | ||
26 | Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> | ||
27 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
28 | --- | ||
29 | drivers/acpi/processor_core.c | 6 ++++-- | ||
30 | 1 files changed, 4 insertions(+), 2 deletions(-) | ||
31 | |||
32 | diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c | ||
33 | index c850de4..eff7222 100644 | ||
34 | --- a/drivers/acpi/processor_core.c | ||
35 | +++ b/drivers/acpi/processor_core.c | ||
36 | @@ -189,10 +189,12 @@ int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id) | ||
37 | * Processor (CPU3, 0x03, 0x00000410, 0x06) {} | ||
38 | * } | ||
39 | * | ||
40 | - * Ignores apic_id and always return 0 for CPU0's handle. | ||
41 | + * Ignores apic_id and always returns 0 for the processor | ||
42 | + * handle with acpi id 0 if nr_cpu_ids is 1. | ||
43 | + * This should be the case if SMP tables are not found. | ||
44 | * Return -1 for other CPU's handle. | ||
45 | */ | ||
46 | - if (acpi_id == 0) | ||
47 | + if (nr_cpu_ids <= 1 && acpi_id == 0) | ||
48 | return acpi_id; | ||
49 | else | ||
50 | return apic_id; | ||
51 | -- | ||
52 | 1.7.7.6 | ||
53 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0044-hwmon-it87-Preserve-configuration-register-bits-on-i.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0044-hwmon-it87-Preserve-configuration-register-bits-on-i.patch new file mode 100644 index 00000000..f7d45cc3 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0044-hwmon-it87-Preserve-configuration-register-bits-on-i.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From 9b12ab6f8a8a5859e0165b3510dbecae16ca98e3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jean Delvare <khali@linux-fr.org> | ||
3 | Date: Thu, 12 Jul 2012 22:47:37 +0200 | ||
4 | Subject: [PATCH 044/109] hwmon: (it87) Preserve configuration register bits | ||
5 | on init | ||
6 | |||
7 | commit 41002f8dd5938d5ad1d008ce5bfdbfe47fa7b4e8 upstream. | ||
8 | |||
9 | We were accidentally losing one bit in the configuration register on | ||
10 | device initialization. It was reported to freeze one specific system | ||
11 | right away. Properly preserve all bits we don't explicitly want to | ||
12 | change in order to prevent that. | ||
13 | |||
14 | Reported-by: Stevie Trujillo <stevie.trujillo@gmail.com> | ||
15 | Signed-off-by: Jean Delvare <khali@linux-fr.org> | ||
16 | Reviewed-by: Guenter Roeck <linux@roeck-us.net> | ||
17 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
18 | --- | ||
19 | drivers/hwmon/it87.c | 2 +- | ||
20 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
21 | |||
22 | diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c | ||
23 | index d912649..1ba7af2 100644 | ||
24 | --- a/drivers/hwmon/it87.c | ||
25 | +++ b/drivers/hwmon/it87.c | ||
26 | @@ -2086,7 +2086,7 @@ static void __devinit it87_init_device(struct platform_device *pdev) | ||
27 | |||
28 | /* Start monitoring */ | ||
29 | it87_write_value(data, IT87_REG_CONFIG, | ||
30 | - (it87_read_value(data, IT87_REG_CONFIG) & 0x36) | ||
31 | + (it87_read_value(data, IT87_REG_CONFIG) & 0x3e) | ||
32 | | (update_vbat ? 0x41 : 0x01)); | ||
33 | } | ||
34 | |||
35 | -- | ||
36 | 1.7.7.6 | ||
37 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0045-ARM-SAMSUNG-fix-race-in-s3c_adc_start-for-ADC.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0045-ARM-SAMSUNG-fix-race-in-s3c_adc_start-for-ADC.patch new file mode 100644 index 00000000..be44eb37 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0045-ARM-SAMSUNG-fix-race-in-s3c_adc_start-for-ADC.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 81b7824449f04aec76681f7723b0f7911ad66f11 Mon Sep 17 00:00:00 2001 | ||
2 | From: Todd Poynor <toddpoynor@google.com> | ||
3 | Date: Fri, 13 Jul 2012 15:30:48 +0900 | ||
4 | Subject: [PATCH 045/109] ARM: SAMSUNG: fix race in s3c_adc_start for ADC | ||
5 | |||
6 | commit 8265981bb439f3ecc5356fb877a6c2a6636ac88a upstream. | ||
7 | |||
8 | Checking for adc->ts_pend already claimed should be done with the | ||
9 | lock held. | ||
10 | |||
11 | Signed-off-by: Todd Poynor <toddpoynor@google.com> | ||
12 | Acked-by: Ben Dooks <ben-linux@fluff.org> | ||
13 | Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> | ||
14 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
15 | --- | ||
16 | arch/arm/plat-samsung/adc.c | 8 +++++--- | ||
17 | 1 files changed, 5 insertions(+), 3 deletions(-) | ||
18 | |||
19 | diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c | ||
20 | index 33ecd0c..b1e05cc 100644 | ||
21 | --- a/arch/arm/plat-samsung/adc.c | ||
22 | +++ b/arch/arm/plat-samsung/adc.c | ||
23 | @@ -157,11 +157,13 @@ int s3c_adc_start(struct s3c_adc_client *client, | ||
24 | return -EINVAL; | ||
25 | } | ||
26 | |||
27 | - if (client->is_ts && adc->ts_pend) | ||
28 | - return -EAGAIN; | ||
29 | - | ||
30 | spin_lock_irqsave(&adc->lock, flags); | ||
31 | |||
32 | + if (client->is_ts && adc->ts_pend) { | ||
33 | + spin_unlock_irqrestore(&adc->lock, flags); | ||
34 | + return -EAGAIN; | ||
35 | + } | ||
36 | + | ||
37 | client->channel = channel; | ||
38 | client->nr_samples = nr_samples; | ||
39 | |||
40 | -- | ||
41 | 1.7.7.6 | ||
42 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0046-block-fix-infinite-loop-in-__getblk_slow.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0046-block-fix-infinite-loop-in-__getblk_slow.patch new file mode 100644 index 00000000..6c5d9b8b --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0046-block-fix-infinite-loop-in-__getblk_slow.patch | |||
@@ -0,0 +1,116 @@ | |||
1 | From 898f4d272514d19aafee8cd66b796c0553fca080 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jeff Moyer <jmoyer@redhat.com> | ||
3 | Date: Thu, 12 Jul 2012 09:43:14 -0400 | ||
4 | Subject: [PATCH 046/109] block: fix infinite loop in __getblk_slow | ||
5 | |||
6 | commit 91f68c89d8f35fe98ea04159b9a3b42d0149478f upstream. | ||
7 | |||
8 | Commit 080399aaaf35 ("block: don't mark buffers beyond end of disk as | ||
9 | mapped") exposed a bug in __getblk_slow that causes mount to hang as it | ||
10 | loops infinitely waiting for a buffer that lies beyond the end of the | ||
11 | disk to become uptodate. | ||
12 | |||
13 | The problem was initially reported by Torsten Hilbrich here: | ||
14 | |||
15 | https://lkml.org/lkml/2012/6/18/54 | ||
16 | |||
17 | and also reported independently here: | ||
18 | |||
19 | http://www.sysresccd.org/forums/viewtopic.php?f=13&t=4511 | ||
20 | |||
21 | and then Richard W.M. Jones and Marcos Mello noted a few separate | ||
22 | bugzillas also associated with the same issue. This patch has been | ||
23 | confirmed to fix: | ||
24 | |||
25 | https://bugzilla.redhat.com/show_bug.cgi?id=835019 | ||
26 | |||
27 | The main problem is here, in __getblk_slow: | ||
28 | |||
29 | for (;;) { | ||
30 | struct buffer_head * bh; | ||
31 | int ret; | ||
32 | |||
33 | bh = __find_get_block(bdev, block, size); | ||
34 | if (bh) | ||
35 | return bh; | ||
36 | |||
37 | ret = grow_buffers(bdev, block, size); | ||
38 | if (ret < 0) | ||
39 | return NULL; | ||
40 | if (ret == 0) | ||
41 | free_more_memory(); | ||
42 | } | ||
43 | |||
44 | __find_get_block does not find the block, since it will not be marked as | ||
45 | mapped, and so grow_buffers is called to fill in the buffers for the | ||
46 | associated page. I believe the for (;;) loop is there primarily to | ||
47 | retry in the case of memory pressure keeping grow_buffers from | ||
48 | succeeding. However, we also continue to loop for other cases, like the | ||
49 | block lying beond the end of the disk. So, the fix I came up with is to | ||
50 | only loop when grow_buffers fails due to memory allocation issues | ||
51 | (return value of 0). | ||
52 | |||
53 | The attached patch was tested by myself, Torsten, and Rich, and was | ||
54 | found to resolve the problem in call cases. | ||
55 | |||
56 | Signed-off-by: Jeff Moyer <jmoyer@redhat.com> | ||
57 | Reported-and-Tested-by: Torsten Hilbrich <torsten.hilbrich@secunet.com> | ||
58 | Tested-by: Richard W.M. Jones <rjones@redhat.com> | ||
59 | Reviewed-by: Josh Boyer <jwboyer@redhat.com> | ||
60 | [ Jens is on vacation, taking this directly - Linus ] | ||
61 | -- | ||
62 | Stable Notes: this patch requires backport to 3.0, 3.2 and 3.3. | ||
63 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
64 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
65 | --- | ||
66 | fs/buffer.c | 22 +++++++++++++--------- | ||
67 | 1 files changed, 13 insertions(+), 9 deletions(-) | ||
68 | |||
69 | diff --git a/fs/buffer.c b/fs/buffer.c | ||
70 | index c807931..4115eca 100644 | ||
71 | --- a/fs/buffer.c | ||
72 | +++ b/fs/buffer.c | ||
73 | @@ -1087,6 +1087,9 @@ grow_buffers(struct block_device *bdev, sector_t block, int size) | ||
74 | static struct buffer_head * | ||
75 | __getblk_slow(struct block_device *bdev, sector_t block, int size) | ||
76 | { | ||
77 | + int ret; | ||
78 | + struct buffer_head *bh; | ||
79 | + | ||
80 | /* Size must be multiple of hard sectorsize */ | ||
81 | if (unlikely(size & (bdev_logical_block_size(bdev)-1) || | ||
82 | (size < 512 || size > PAGE_SIZE))) { | ||
83 | @@ -1099,20 +1102,21 @@ __getblk_slow(struct block_device *bdev, sector_t block, int size) | ||
84 | return NULL; | ||
85 | } | ||
86 | |||
87 | - for (;;) { | ||
88 | - struct buffer_head * bh; | ||
89 | - int ret; | ||
90 | +retry: | ||
91 | + bh = __find_get_block(bdev, block, size); | ||
92 | + if (bh) | ||
93 | + return bh; | ||
94 | |||
95 | + ret = grow_buffers(bdev, block, size); | ||
96 | + if (ret == 0) { | ||
97 | + free_more_memory(); | ||
98 | + goto retry; | ||
99 | + } else if (ret > 0) { | ||
100 | bh = __find_get_block(bdev, block, size); | ||
101 | if (bh) | ||
102 | return bh; | ||
103 | - | ||
104 | - ret = grow_buffers(bdev, block, size); | ||
105 | - if (ret < 0) | ||
106 | - return NULL; | ||
107 | - if (ret == 0) | ||
108 | - free_more_memory(); | ||
109 | } | ||
110 | + return NULL; | ||
111 | } | ||
112 | |||
113 | /* | ||
114 | -- | ||
115 | 1.7.7.6 | ||
116 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0047-Remove-easily-user-triggerable-BUG-from-generic_setl.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0047-Remove-easily-user-triggerable-BUG-from-generic_setl.patch new file mode 100644 index 00000000..87472202 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0047-Remove-easily-user-triggerable-BUG-from-generic_setl.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 51b23c5c8a3aacf16acf8b723c35a23c07c37115 Mon Sep 17 00:00:00 2001 | ||
2 | From: Dave Jones <davej@redhat.com> | ||
3 | Date: Fri, 13 Jul 2012 13:35:36 -0400 | ||
4 | Subject: [PATCH 047/109] Remove easily user-triggerable BUG from | ||
5 | generic_setlease | ||
6 | |||
7 | commit 8d657eb3b43861064d36241e88d9d61c709f33f0 upstream. | ||
8 | |||
9 | This can be trivially triggered from userspace by passing in something unexpected. | ||
10 | |||
11 | kernel BUG at fs/locks.c:1468! | ||
12 | invalid opcode: 0000 [#1] SMP | ||
13 | RIP: 0010:generic_setlease+0xc2/0x100 | ||
14 | Call Trace: | ||
15 | __vfs_setlease+0x35/0x40 | ||
16 | fcntl_setlease+0x76/0x150 | ||
17 | sys_fcntl+0x1c6/0x810 | ||
18 | system_call_fastpath+0x1a/0x1f | ||
19 | |||
20 | Signed-off-by: Dave Jones <davej@redhat.com> | ||
21 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
22 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
23 | --- | ||
24 | fs/locks.c | 2 +- | ||
25 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
26 | |||
27 | diff --git a/fs/locks.c b/fs/locks.c | ||
28 | index 0d68f1f..6a64f15 100644 | ||
29 | --- a/fs/locks.c | ||
30 | +++ b/fs/locks.c | ||
31 | @@ -1465,7 +1465,7 @@ int generic_setlease(struct file *filp, long arg, struct file_lock **flp) | ||
32 | case F_WRLCK: | ||
33 | return generic_add_lease(filp, arg, flp); | ||
34 | default: | ||
35 | - BUG(); | ||
36 | + return -EINVAL; | ||
37 | } | ||
38 | } | ||
39 | EXPORT_SYMBOL(generic_setlease); | ||
40 | -- | ||
41 | 1.7.7.6 | ||
42 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0048-NFC-Export-nfc.h-to-userland.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0048-NFC-Export-nfc.h-to-userland.patch new file mode 100644 index 00000000..90d6d7b9 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0048-NFC-Export-nfc.h-to-userland.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From 8750544d6522f38e7f5722ee263d0f95941c9bd8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Samuel Ortiz <sameo@linux.intel.com> | ||
3 | Date: Thu, 10 May 2012 19:45:51 +0200 | ||
4 | Subject: [PATCH 048/109] NFC: Export nfc.h to userland | ||
5 | |||
6 | commit dbd4fcaf8d664fab4163b1f8682e41ad8bff3444 upstream. | ||
7 | |||
8 | The netlink commands and attributes, along with the socket structure | ||
9 | definitions need to be exported. | ||
10 | |||
11 | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> | ||
12 | Signed-off-by: John W. Linville <linville@tuxdriver.com> | ||
13 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
14 | --- | ||
15 | include/linux/Kbuild | 1 + | ||
16 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
17 | |||
18 | diff --git a/include/linux/Kbuild b/include/linux/Kbuild | ||
19 | index bd21ecd..a3ce901 100644 | ||
20 | --- a/include/linux/Kbuild | ||
21 | +++ b/include/linux/Kbuild | ||
22 | @@ -268,6 +268,7 @@ header-y += netfilter_ipv4.h | ||
23 | header-y += netfilter_ipv6.h | ||
24 | header-y += netlink.h | ||
25 | header-y += netrom.h | ||
26 | +header-y += nfc.h | ||
27 | header-y += nfs.h | ||
28 | header-y += nfs2.h | ||
29 | header-y += nfs3.h | ||
30 | -- | ||
31 | 1.7.7.6 | ||
32 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0049-PM-Hibernate-Hibernate-thaw-fixes-improvements.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0049-PM-Hibernate-Hibernate-thaw-fixes-improvements.patch new file mode 100644 index 00000000..b0b708b6 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0049-PM-Hibernate-Hibernate-thaw-fixes-improvements.patch | |||
@@ -0,0 +1,178 @@ | |||
1 | From b6807062ada796cdfde2c0f5ca59390b0c916aae Mon Sep 17 00:00:00 2001 | ||
2 | From: Bojan Smojver <bojan@rexursive.com> | ||
3 | Date: Sun, 29 Apr 2012 22:42:06 +0200 | ||
4 | Subject: [PATCH 049/109] PM / Hibernate: Hibernate/thaw fixes/improvements | ||
5 | |||
6 | commit 5a21d489fd9541a4a66b9a500659abaca1b19a51 upstream. | ||
7 | |||
8 | 1. Do not allocate memory for buffers from emergency pools, unless | ||
9 | absolutely required. Do not warn about and do not retry non-essential | ||
10 | failed allocations. | ||
11 | |||
12 | 2. Do not check the amount of free pages left on every single page | ||
13 | write, but wait until one map is completely populated and then check. | ||
14 | |||
15 | 3. Set maximum number of pages for read buffering consistently, instead | ||
16 | of inadvertently depending on the size of the sector type. | ||
17 | |||
18 | 4. Fix copyright line, which I missed when I submitted the hibernation | ||
19 | threading patch. | ||
20 | |||
21 | 5. Dispense with bit shifting arithmetic to improve readability. | ||
22 | |||
23 | 6. Really recalculate the number of pages required to be free after all | ||
24 | allocations have been done. | ||
25 | |||
26 | 7. Fix calculation of pages required for read buffering. Only count in | ||
27 | pages that do not belong to high memory. | ||
28 | |||
29 | Signed-off-by: Bojan Smojver <bojan@rexursive.com> | ||
30 | Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> | ||
31 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
32 | --- | ||
33 | kernel/power/swap.c | 62 ++++++++++++++++++++++++++++++++------------------- | ||
34 | 1 files changed, 39 insertions(+), 23 deletions(-) | ||
35 | |||
36 | diff --git a/kernel/power/swap.c b/kernel/power/swap.c | ||
37 | index b313086..64f8f97 100644 | ||
38 | --- a/kernel/power/swap.c | ||
39 | +++ b/kernel/power/swap.c | ||
40 | @@ -6,7 +6,7 @@ | ||
41 | * | ||
42 | * Copyright (C) 1998,2001-2005 Pavel Machek <pavel@ucw.cz> | ||
43 | * Copyright (C) 2006 Rafael J. Wysocki <rjw@sisk.pl> | ||
44 | - * Copyright (C) 2010 Bojan Smojver <bojan@rexursive.com> | ||
45 | + * Copyright (C) 2010-2012 Bojan Smojver <bojan@rexursive.com> | ||
46 | * | ||
47 | * This file is released under the GPLv2. | ||
48 | * | ||
49 | @@ -283,14 +283,17 @@ static int write_page(void *buf, sector_t offset, struct bio **bio_chain) | ||
50 | return -ENOSPC; | ||
51 | |||
52 | if (bio_chain) { | ||
53 | - src = (void *)__get_free_page(__GFP_WAIT | __GFP_HIGH); | ||
54 | + src = (void *)__get_free_page(__GFP_WAIT | __GFP_NOWARN | | ||
55 | + __GFP_NORETRY); | ||
56 | if (src) { | ||
57 | copy_page(src, buf); | ||
58 | } else { | ||
59 | ret = hib_wait_on_bio_chain(bio_chain); /* Free pages */ | ||
60 | if (ret) | ||
61 | return ret; | ||
62 | - src = (void *)__get_free_page(__GFP_WAIT | __GFP_HIGH); | ||
63 | + src = (void *)__get_free_page(__GFP_WAIT | | ||
64 | + __GFP_NOWARN | | ||
65 | + __GFP_NORETRY); | ||
66 | if (src) { | ||
67 | copy_page(src, buf); | ||
68 | } else { | ||
69 | @@ -368,12 +371,17 @@ static int swap_write_page(struct swap_map_handle *handle, void *buf, | ||
70 | clear_page(handle->cur); | ||
71 | handle->cur_swap = offset; | ||
72 | handle->k = 0; | ||
73 | - } | ||
74 | - if (bio_chain && low_free_pages() <= handle->reqd_free_pages) { | ||
75 | - error = hib_wait_on_bio_chain(bio_chain); | ||
76 | - if (error) | ||
77 | - goto out; | ||
78 | - handle->reqd_free_pages = reqd_free_pages(); | ||
79 | + | ||
80 | + if (bio_chain && low_free_pages() <= handle->reqd_free_pages) { | ||
81 | + error = hib_wait_on_bio_chain(bio_chain); | ||
82 | + if (error) | ||
83 | + goto out; | ||
84 | + /* | ||
85 | + * Recalculate the number of required free pages, to | ||
86 | + * make sure we never take more than half. | ||
87 | + */ | ||
88 | + handle->reqd_free_pages = reqd_free_pages(); | ||
89 | + } | ||
90 | } | ||
91 | out: | ||
92 | return error; | ||
93 | @@ -420,8 +428,9 @@ static int swap_writer_finish(struct swap_map_handle *handle, | ||
94 | /* Maximum number of threads for compression/decompression. */ | ||
95 | #define LZO_THREADS 3 | ||
96 | |||
97 | -/* Maximum number of pages for read buffering. */ | ||
98 | -#define LZO_READ_PAGES (MAP_PAGE_ENTRIES * 8) | ||
99 | +/* Minimum/maximum number of pages for read buffering. */ | ||
100 | +#define LZO_MIN_RD_PAGES 1024 | ||
101 | +#define LZO_MAX_RD_PAGES 8192 | ||
102 | |||
103 | |||
104 | /** | ||
105 | @@ -632,12 +641,6 @@ static int save_image_lzo(struct swap_map_handle *handle, | ||
106 | } | ||
107 | |||
108 | /* | ||
109 | - * Adjust number of free pages after all allocations have been done. | ||
110 | - * We don't want to run out of pages when writing. | ||
111 | - */ | ||
112 | - handle->reqd_free_pages = reqd_free_pages(); | ||
113 | - | ||
114 | - /* | ||
115 | * Start the CRC32 thread. | ||
116 | */ | ||
117 | init_waitqueue_head(&crc->go); | ||
118 | @@ -658,6 +661,12 @@ static int save_image_lzo(struct swap_map_handle *handle, | ||
119 | goto out_clean; | ||
120 | } | ||
121 | |||
122 | + /* | ||
123 | + * Adjust the number of required free pages after all allocations have | ||
124 | + * been done. We don't want to run out of pages when writing. | ||
125 | + */ | ||
126 | + handle->reqd_free_pages = reqd_free_pages(); | ||
127 | + | ||
128 | printk(KERN_INFO | ||
129 | "PM: Using %u thread(s) for compression.\n" | ||
130 | "PM: Compressing and saving image data (%u pages) ... ", | ||
131 | @@ -1067,7 +1076,7 @@ static int load_image_lzo(struct swap_map_handle *handle, | ||
132 | unsigned i, thr, run_threads, nr_threads; | ||
133 | unsigned ring = 0, pg = 0, ring_size = 0, | ||
134 | have = 0, want, need, asked = 0; | ||
135 | - unsigned long read_pages; | ||
136 | + unsigned long read_pages = 0; | ||
137 | unsigned char **page = NULL; | ||
138 | struct dec_data *data = NULL; | ||
139 | struct crc_data *crc = NULL; | ||
140 | @@ -1079,7 +1088,7 @@ static int load_image_lzo(struct swap_map_handle *handle, | ||
141 | nr_threads = num_online_cpus() - 1; | ||
142 | nr_threads = clamp_val(nr_threads, 1, LZO_THREADS); | ||
143 | |||
144 | - page = vmalloc(sizeof(*page) * LZO_READ_PAGES); | ||
145 | + page = vmalloc(sizeof(*page) * LZO_MAX_RD_PAGES); | ||
146 | if (!page) { | ||
147 | printk(KERN_ERR "PM: Failed to allocate LZO page\n"); | ||
148 | ret = -ENOMEM; | ||
149 | @@ -1144,15 +1153,22 @@ static int load_image_lzo(struct swap_map_handle *handle, | ||
150 | } | ||
151 | |||
152 | /* | ||
153 | - * Adjust number of pages for read buffering, in case we are short. | ||
154 | + * Set the number of pages for read buffering. | ||
155 | + * This is complete guesswork, because we'll only know the real | ||
156 | + * picture once prepare_image() is called, which is much later on | ||
157 | + * during the image load phase. We'll assume the worst case and | ||
158 | + * say that none of the image pages are from high memory. | ||
159 | */ | ||
160 | - read_pages = (nr_free_pages() - snapshot_get_image_size()) >> 1; | ||
161 | - read_pages = clamp_val(read_pages, LZO_CMP_PAGES, LZO_READ_PAGES); | ||
162 | + if (low_free_pages() > snapshot_get_image_size()) | ||
163 | + read_pages = (low_free_pages() - snapshot_get_image_size()) / 2; | ||
164 | + read_pages = clamp_val(read_pages, LZO_MIN_RD_PAGES, LZO_MAX_RD_PAGES); | ||
165 | |||
166 | for (i = 0; i < read_pages; i++) { | ||
167 | page[i] = (void *)__get_free_page(i < LZO_CMP_PAGES ? | ||
168 | __GFP_WAIT | __GFP_HIGH : | ||
169 | - __GFP_WAIT); | ||
170 | + __GFP_WAIT | __GFP_NOWARN | | ||
171 | + __GFP_NORETRY); | ||
172 | + | ||
173 | if (!page[i]) { | ||
174 | if (i < LZO_CMP_PAGES) { | ||
175 | ring_size = i; | ||
176 | -- | ||
177 | 1.7.7.6 | ||
178 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0050-cfg80211-check-iface-combinations-only-when-iface-is.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0050-cfg80211-check-iface-combinations-only-when-iface-is.patch new file mode 100644 index 00000000..c9a9c98a --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0050-cfg80211-check-iface-combinations-only-when-iface-is.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From c83354ed38bbb4ebfa25f954d825594453b160c1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michal Kazior <michal.kazior@tieto.com> | ||
3 | Date: Fri, 8 Jun 2012 10:55:44 +0200 | ||
4 | Subject: [PATCH 050/109] cfg80211: check iface combinations only when iface | ||
5 | is running | ||
6 | |||
7 | commit f8cdddb8d61d16a156229f0910f7ecfc7a82c003 upstream. | ||
8 | |||
9 | Don't validate interface combinations on a stopped | ||
10 | interface. Otherwise we might end up being able to | ||
11 | create a new interface with a certain type, but | ||
12 | won't be able to change an existing interface | ||
13 | into that type. | ||
14 | |||
15 | This also skips some other functions when | ||
16 | interface is stopped and changing interface type. | ||
17 | |||
18 | Signed-off-by: Michal Kazior <michal.kazior@tieto.com> | ||
19 | Signed-off-by: Johannes Berg <johannes.berg@intel.com> | ||
20 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
21 | --- | ||
22 | net/wireless/util.c | 2 +- | ||
23 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
24 | |||
25 | diff --git a/net/wireless/util.c b/net/wireless/util.c | ||
26 | index d38815d..74d5292 100644 | ||
27 | --- a/net/wireless/util.c | ||
28 | +++ b/net/wireless/util.c | ||
29 | @@ -813,7 +813,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev, | ||
30 | ntype == NL80211_IFTYPE_P2P_CLIENT)) | ||
31 | return -EBUSY; | ||
32 | |||
33 | - if (ntype != otype) { | ||
34 | + if (ntype != otype && netif_running(dev)) { | ||
35 | err = cfg80211_can_change_interface(rdev, dev->ieee80211_ptr, | ||
36 | ntype); | ||
37 | if (err) | ||
38 | -- | ||
39 | 1.7.7.6 | ||
40 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0051-intel_ips-blacklist-HP-ProBook-laptops.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0051-intel_ips-blacklist-HP-ProBook-laptops.patch new file mode 100644 index 00000000..d1c0f9bc --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0051-intel_ips-blacklist-HP-ProBook-laptops.patch | |||
@@ -0,0 +1,70 @@ | |||
1 | From ea2ca0ebd427d4a745043e6e030619221fe9a55b Mon Sep 17 00:00:00 2001 | ||
2 | From: Takashi Iwai <tiwai@suse.de> | ||
3 | Date: Mon, 25 Jun 2012 15:07:17 +0200 | ||
4 | Subject: [PATCH 051/109] intel_ips: blacklist HP ProBook laptops | ||
5 | |||
6 | commit 88ca518b0bb4161e5f20f8a1d9cc477cae294e54 upstream. | ||
7 | |||
8 | intel_ips driver spews the warning message | ||
9 | "ME failed to update for more than 1s, likely hung" | ||
10 | at each second endlessly on HP ProBook laptops with IronLake. | ||
11 | |||
12 | As this has never worked, better to blacklist the driver for now. | ||
13 | |||
14 | Signed-off-by: Takashi Iwai <tiwai@suse.de> | ||
15 | Signed-off-by: Matthew Garrett <mjg@redhat.com> | ||
16 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
17 | --- | ||
18 | drivers/platform/x86/intel_ips.c | 22 ++++++++++++++++++++++ | ||
19 | 1 files changed, 22 insertions(+), 0 deletions(-) | ||
20 | |||
21 | diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c | ||
22 | index 809a3ae..b46ec11 100644 | ||
23 | --- a/drivers/platform/x86/intel_ips.c | ||
24 | +++ b/drivers/platform/x86/intel_ips.c | ||
25 | @@ -72,6 +72,7 @@ | ||
26 | #include <linux/string.h> | ||
27 | #include <linux/tick.h> | ||
28 | #include <linux/timer.h> | ||
29 | +#include <linux/dmi.h> | ||
30 | #include <drm/i915_drm.h> | ||
31 | #include <asm/msr.h> | ||
32 | #include <asm/processor.h> | ||
33 | @@ -1505,6 +1506,24 @@ static DEFINE_PCI_DEVICE_TABLE(ips_id_table) = { | ||
34 | |||
35 | MODULE_DEVICE_TABLE(pci, ips_id_table); | ||
36 | |||
37 | +static int ips_blacklist_callback(const struct dmi_system_id *id) | ||
38 | +{ | ||
39 | + pr_info("Blacklisted intel_ips for %s\n", id->ident); | ||
40 | + return 1; | ||
41 | +} | ||
42 | + | ||
43 | +static const struct dmi_system_id ips_blacklist[] = { | ||
44 | + { | ||
45 | + .callback = ips_blacklist_callback, | ||
46 | + .ident = "HP ProBook", | ||
47 | + .matches = { | ||
48 | + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
49 | + DMI_MATCH(DMI_PRODUCT_NAME, "HP ProBook"), | ||
50 | + }, | ||
51 | + }, | ||
52 | + { } /* terminating entry */ | ||
53 | +}; | ||
54 | + | ||
55 | static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id) | ||
56 | { | ||
57 | u64 platform_info; | ||
58 | @@ -1514,6 +1533,9 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id) | ||
59 | u16 htshi, trc, trc_required_mask; | ||
60 | u8 tse; | ||
61 | |||
62 | + if (dmi_check_system(ips_blacklist)) | ||
63 | + return -ENODEV; | ||
64 | + | ||
65 | ips = kzalloc(sizeof(struct ips_driver), GFP_KERNEL); | ||
66 | if (!ips) | ||
67 | return -ENOMEM; | ||
68 | -- | ||
69 | 1.7.7.6 | ||
70 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0052-atl1c-fix-issue-of-transmit-queue-0-timed-out.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0052-atl1c-fix-issue-of-transmit-queue-0-timed-out.patch new file mode 100644 index 00000000..92f5a277 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0052-atl1c-fix-issue-of-transmit-queue-0-timed-out.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 0e6bee2eb164145946ea6ca49c4fd1e02c7177fa Mon Sep 17 00:00:00 2001 | ||
2 | From: Cloud Ren <cjren@qca.qualcomm.com> | ||
3 | Date: Tue, 3 Jul 2012 16:51:48 +0000 | ||
4 | Subject: [PATCH 052/109] atl1c: fix issue of transmit queue 0 timed out | ||
5 | |||
6 | commit b94e52f62683dc0b00c6d1b58b80929a078c0fd5 upstream. | ||
7 | |||
8 | some people report atl1c could cause system hang with following | ||
9 | kernel trace info: | ||
10 | --------------------------------------- | ||
11 | WARNING: at.../net/sched/sch_generic.c:258 dev_watchdog+0x1db/0x1d0() | ||
12 | ... | ||
13 | NETDEV WATCHDOG: eth0 (atl1c): transmit queue 0 timed out | ||
14 | ... | ||
15 | --------------------------------------- | ||
16 | This is caused by netif_stop_queue calling when cable Link is down. | ||
17 | So remove netif_stop_queue, because link_watch will take it over. | ||
18 | |||
19 | Signed-off-by: xiong <xiong@qca.qualcomm.com> | ||
20 | Signed-off-by: Cloud Ren <cjren@qca.qualcomm.com> | ||
21 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
22 | [bwh: Backported to 3.2: adjust context] | ||
23 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
24 | --- | ||
25 | drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 1 - | ||
26 | 1 files changed, 0 insertions(+), 1 deletions(-) | ||
27 | |||
28 | diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c | ||
29 | index eccdcff..5ae7df7 100644 | ||
30 | --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c | ||
31 | +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c | ||
32 | @@ -267,7 +267,6 @@ static void atl1c_check_link_status(struct atl1c_adapter *adapter) | ||
33 | dev_warn(&pdev->dev, "stop mac failed\n"); | ||
34 | atl1c_set_aspm(hw, false); | ||
35 | netif_carrier_off(netdev); | ||
36 | - netif_stop_queue(netdev); | ||
37 | atl1c_phy_reset(hw); | ||
38 | atl1c_phy_init(&adapter->hw); | ||
39 | } else { | ||
40 | -- | ||
41 | 1.7.7.6 | ||
42 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0053-rt2x00usb-fix-indexes-ordering-on-RX-queue-kick.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0053-rt2x00usb-fix-indexes-ordering-on-RX-queue-kick.patch new file mode 100644 index 00000000..17d4e14a --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0053-rt2x00usb-fix-indexes-ordering-on-RX-queue-kick.patch | |||
@@ -0,0 +1,51 @@ | |||
1 | From 6b52d1306665e9da06ac76126a97888849dbf290 Mon Sep 17 00:00:00 2001 | ||
2 | From: Stanislaw Gruszka <sgruszka@redhat.com> | ||
3 | Date: Wed, 4 Jul 2012 13:10:02 +0200 | ||
4 | Subject: [PATCH 053/109] rt2x00usb: fix indexes ordering on RX queue kick | ||
5 | |||
6 | commit efd821182cec8c92babef6e00a95066d3252fda4 upstream. | ||
7 | |||
8 | On rt2x00_dmastart() we increase index specified by Q_INDEX and on | ||
9 | rt2x00_dmadone() we increase index specified by Q_INDEX_DONE. So entries | ||
10 | between Q_INDEX_DONE and Q_INDEX are those we currently process in the | ||
11 | hardware. Entries between Q_INDEX and Q_INDEX_DONE are those we can | ||
12 | submit to the hardware. | ||
13 | |||
14 | According to that fix rt2x00usb_kick_queue(), as we need to submit RX | ||
15 | entries that are not processed by the hardware. It worked before only | ||
16 | for empty queue, otherwise was broken. | ||
17 | |||
18 | Note that for TX queues indexes ordering are ok. We need to kick entries | ||
19 | that have filled skb, but was not submitted to the hardware, i.e. | ||
20 | started from Q_INDEX_DONE and have ENTRY_DATA_PENDING bit set. | ||
21 | |||
22 | From practical standpoint this fixes RX queue stall, usually reproducible | ||
23 | in AP mode, like for example reported here: | ||
24 | https://bugzilla.redhat.com/show_bug.cgi?id=828824 | ||
25 | |||
26 | Reported-and-tested-by: Franco Miceli <fmiceli@plan.ceibal.edu.uy> | ||
27 | Reported-and-tested-by: Tom Horsley <horsley1953@gmail.com> | ||
28 | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> | ||
29 | Signed-off-by: John W. Linville <linville@tuxdriver.com> | ||
30 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
31 | --- | ||
32 | drivers/net/wireless/rt2x00/rt2x00usb.c | 2 +- | ||
33 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
34 | |||
35 | diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c | ||
36 | index 1e31050..ba28807 100644 | ||
37 | --- a/drivers/net/wireless/rt2x00/rt2x00usb.c | ||
38 | +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | ||
39 | @@ -426,8 +426,8 @@ void rt2x00usb_kick_queue(struct data_queue *queue) | ||
40 | case QID_RX: | ||
41 | if (!rt2x00queue_full(queue)) | ||
42 | rt2x00queue_for_each_entry(queue, | ||
43 | - Q_INDEX_DONE, | ||
44 | Q_INDEX, | ||
45 | + Q_INDEX_DONE, | ||
46 | NULL, | ||
47 | rt2x00usb_kick_rx_entry); | ||
48 | break; | ||
49 | -- | ||
50 | 1.7.7.6 | ||
51 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0054-iwlegacy-always-monitor-for-stuck-queues.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0054-iwlegacy-always-monitor-for-stuck-queues.patch new file mode 100644 index 00000000..83172fb9 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0054-iwlegacy-always-monitor-for-stuck-queues.patch | |||
@@ -0,0 +1,65 @@ | |||
1 | From b7d2c1e70d2c94585ac5839e38b861bdc6d469d2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Stanislaw Gruszka <sgruszka@redhat.com> | ||
3 | Date: Wed, 4 Jul 2012 13:20:20 +0200 | ||
4 | Subject: [PATCH 054/109] iwlegacy: always monitor for stuck queues | ||
5 | |||
6 | commit c2ca7d92ed4bbd779516beb6eb226e19f7f7ab0f upstream. | ||
7 | |||
8 | This is iwlegacy version of: | ||
9 | |||
10 | commit 342bbf3fee2fa9a18147e74b2e3c4229a4564912 | ||
11 | Author: Johannes Berg <johannes.berg@intel.com> | ||
12 | Date: Sun Mar 4 08:50:46 2012 -0800 | ||
13 | |||
14 | iwlwifi: always monitor for stuck queues | ||
15 | |||
16 | If we only monitor while associated, the following | ||
17 | can happen: | ||
18 | - we're associated, and the queue stuck check | ||
19 | runs, setting the queue "touch" time to X | ||
20 | - we disassociate, stopping the monitoring, | ||
21 | which leaves the time set to X | ||
22 | - almost 2s later, we associate, and enqueue | ||
23 | a frame | ||
24 | - before the frame is transmitted, we monitor | ||
25 | for stuck queues, and find the time set to | ||
26 | X, although it is now later than X + 2000ms, | ||
27 | so we decide that the queue is stuck and | ||
28 | erroneously restart the device | ||
29 | |||
30 | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> | ||
31 | Signed-off-by: John W. Linville <linville@tuxdriver.com> | ||
32 | [bwh: Backported to 3.2: adjust filename, function and variable names] | ||
33 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
34 | --- | ||
35 | drivers/net/wireless/iwlegacy/iwl-core.c | 14 ++++++-------- | ||
36 | 1 files changed, 6 insertions(+), 8 deletions(-) | ||
37 | |||
38 | diff --git a/drivers/net/wireless/iwlegacy/iwl-core.c b/drivers/net/wireless/iwlegacy/iwl-core.c | ||
39 | index 2bd5659..1bb64c9 100644 | ||
40 | --- a/drivers/net/wireless/iwlegacy/iwl-core.c | ||
41 | +++ b/drivers/net/wireless/iwlegacy/iwl-core.c | ||
42 | @@ -1884,14 +1884,12 @@ void iwl_legacy_bg_watchdog(unsigned long data) | ||
43 | return; | ||
44 | |||
45 | /* monitor and check for other stuck queues */ | ||
46 | - if (iwl_legacy_is_any_associated(priv)) { | ||
47 | - for (cnt = 0; cnt < priv->hw_params.max_txq_num; cnt++) { | ||
48 | - /* skip as we already checked the command queue */ | ||
49 | - if (cnt == priv->cmd_queue) | ||
50 | - continue; | ||
51 | - if (iwl_legacy_check_stuck_queue(priv, cnt)) | ||
52 | - return; | ||
53 | - } | ||
54 | + for (cnt = 0; cnt < priv->hw_params.max_txq_num; cnt++) { | ||
55 | + /* skip as we already checked the command queue */ | ||
56 | + if (cnt == priv->cmd_queue) | ||
57 | + continue; | ||
58 | + if (iwl_legacy_check_stuck_queue(priv, cnt)) | ||
59 | + return; | ||
60 | } | ||
61 | |||
62 | mod_timer(&priv->watchdog, jiffies + | ||
63 | -- | ||
64 | 1.7.7.6 | ||
65 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0055-iwlegacy-don-t-mess-up-the-SCD-when-removing-a-key.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0055-iwlegacy-don-t-mess-up-the-SCD-when-removing-a-key.patch new file mode 100644 index 00000000..f5bbca6a --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0055-iwlegacy-don-t-mess-up-the-SCD-when-removing-a-key.patch | |||
@@ -0,0 +1,51 @@ | |||
1 | From 910c9012a7e02b93cc1f877aa8ef245dd1d99fbe Mon Sep 17 00:00:00 2001 | ||
2 | From: Emmanuel Grumbach <emmanuel.grumbach@intel.com> | ||
3 | Date: Wed, 4 Jul 2012 13:59:08 +0200 | ||
4 | Subject: [PATCH 055/109] iwlegacy: don't mess up the SCD when removing a key | ||
5 | |||
6 | commit b48d96652626b315229b1b82c6270eead6a77a6d upstream. | ||
7 | |||
8 | When we remove a key, we put a key index which was supposed | ||
9 | to tell the fw that we are actually removing the key. But | ||
10 | instead the fw took that index as a valid index and messed | ||
11 | up the SRAM of the device. | ||
12 | |||
13 | This memory corruption on the device mangled the data of | ||
14 | the SCD. The impact on the user is that SCD queue 2 got | ||
15 | stuck after having removed keys. | ||
16 | |||
17 | Reported-by: Paul Bolle <pebolle@tiscali.nl> | ||
18 | Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> | ||
19 | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> | ||
20 | Signed-off-by: John W. Linville <linville@tuxdriver.com> | ||
21 | [bwh: Backported to 3.2: adjust filename, context and variable name] | ||
22 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
23 | --- | ||
24 | drivers/net/wireless/iwlegacy/iwl-4965-sta.c | 4 ++-- | ||
25 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
26 | |||
27 | diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-sta.c b/drivers/net/wireless/iwlegacy/iwl-4965-sta.c | ||
28 | index a262c23..0116ca8 100644 | ||
29 | --- a/drivers/net/wireless/iwlegacy/iwl-4965-sta.c | ||
30 | +++ b/drivers/net/wireless/iwlegacy/iwl-4965-sta.c | ||
31 | @@ -466,7 +466,7 @@ int iwl4965_remove_dynamic_key(struct iwl_priv *priv, | ||
32 | return 0; | ||
33 | } | ||
34 | |||
35 | - if (priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET) { | ||
36 | + if (priv->stations[sta_id].sta.key.key_flags & STA_KEY_FLG_INVALID) { | ||
37 | IWL_WARN(priv, "Removing wrong key %d 0x%x\n", | ||
38 | keyconf->keyidx, key_flags); | ||
39 | spin_unlock_irqrestore(&priv->sta_lock, flags); | ||
40 | @@ -483,7 +483,7 @@ int iwl4965_remove_dynamic_key(struct iwl_priv *priv, | ||
41 | sizeof(struct iwl4965_keyinfo)); | ||
42 | priv->stations[sta_id].sta.key.key_flags = | ||
43 | STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID; | ||
44 | - priv->stations[sta_id].sta.key.key_offset = WEP_INVALID_OFFSET; | ||
45 | + priv->stations[sta_id].sta.key.key_offset = keyconf->hw_key_idx; | ||
46 | priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; | ||
47 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; | ||
48 | |||
49 | -- | ||
50 | 1.7.7.6 | ||
51 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0056-e1000e-Correct-link-check-logic-for-82571-serdes.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0056-e1000e-Correct-link-check-logic-for-82571-serdes.patch new file mode 100644 index 00000000..b7cf9003 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0056-e1000e-Correct-link-check-logic-for-82571-serdes.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From c82dafb3ba87352cb605641f7d709ec76dc64168 Mon Sep 17 00:00:00 2001 | ||
2 | From: Tushar Dave <tushar.n.dave@intel.com> | ||
3 | Date: Thu, 12 Jul 2012 08:56:56 +0000 | ||
4 | Subject: [PATCH 056/109] e1000e: Correct link check logic for 82571 serdes | ||
5 | |||
6 | commit d0efa8f23a644f7cb7d1f8e78dd9a223efa412a3 upstream. | ||
7 | |||
8 | SYNCH bit and IV bit of RXCW register are sticky. Before examining these bits, | ||
9 | RXCW should be read twice to filter out one-time false events and have correct | ||
10 | values for these bits. Incorrect values of these bits in link check logic can | ||
11 | cause weird link stability issues if auto-negotiation fails. | ||
12 | |||
13 | Reported-by: Dean Nelson <dnelson@redhat.com> | ||
14 | Signed-off-by: Tushar Dave <tushar.n.dave@intel.com> | ||
15 | Reviewed-by: Bruce Allan <bruce.w.allan@intel.com> | ||
16 | Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> | ||
17 | Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> | ||
18 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
19 | --- | ||
20 | drivers/net/ethernet/intel/e1000e/82571.c | 3 +++ | ||
21 | 1 files changed, 3 insertions(+), 0 deletions(-) | ||
22 | |||
23 | diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c | ||
24 | index e556fc3..3072d35 100644 | ||
25 | --- a/drivers/net/ethernet/intel/e1000e/82571.c | ||
26 | +++ b/drivers/net/ethernet/intel/e1000e/82571.c | ||
27 | @@ -1571,6 +1571,9 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) | ||
28 | ctrl = er32(CTRL); | ||
29 | status = er32(STATUS); | ||
30 | rxcw = er32(RXCW); | ||
31 | + /* SYNCH bit and IV bit are sticky */ | ||
32 | + udelay(10); | ||
33 | + rxcw = er32(RXCW); | ||
34 | |||
35 | if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) { | ||
36 | |||
37 | -- | ||
38 | 1.7.7.6 | ||
39 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0057-tcm_fc-Fix-crash-seen-with-aborts-and-large-reads.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0057-tcm_fc-Fix-crash-seen-with-aborts-and-large-reads.patch new file mode 100644 index 00000000..eb1e62d2 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0057-tcm_fc-Fix-crash-seen-with-aborts-and-large-reads.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From f846f3528f3dcd02646a919a50696d026e0864ae Mon Sep 17 00:00:00 2001 | ||
2 | From: Mark Rustad <mark.d.rustad@intel.com> | ||
3 | Date: Fri, 13 Jul 2012 18:18:04 -0700 | ||
4 | Subject: [PATCH 057/109] tcm_fc: Fix crash seen with aborts and large reads | ||
5 | |||
6 | commit 3cc5d2a6b9a2fd1bf024aa5e52dd22961eecaf13 upstream. | ||
7 | |||
8 | This patch fixes a crash seen when large reads have their exchange | ||
9 | aborted by either timing out or being reset. Because the exchange | ||
10 | abort results in the seq pointer being set to NULL, because the | ||
11 | sequence is no longer valid, it must not be dereferenced. This | ||
12 | patch changes the function ft_get_task_tag to return ~0 if it is | ||
13 | unable to get the tag for this reason. Because the get_task_tag | ||
14 | interface provides no means of returning an error, this seems | ||
15 | like the best way to fix this issue at the moment. | ||
16 | |||
17 | Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> | ||
18 | Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> | ||
19 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
20 | --- | ||
21 | drivers/target/tcm_fc/tfc_cmd.c | 2 ++ | ||
22 | 1 files changed, 2 insertions(+), 0 deletions(-) | ||
23 | |||
24 | diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c | ||
25 | index d95cfe2..278819c 100644 | ||
26 | --- a/drivers/target/tcm_fc/tfc_cmd.c | ||
27 | +++ b/drivers/target/tcm_fc/tfc_cmd.c | ||
28 | @@ -249,6 +249,8 @@ u32 ft_get_task_tag(struct se_cmd *se_cmd) | ||
29 | { | ||
30 | struct ft_cmd *cmd = container_of(se_cmd, struct ft_cmd, se_cmd); | ||
31 | |||
32 | + if (cmd->aborted) | ||
33 | + return ~0; | ||
34 | return fc_seq_exch(cmd->seq)->rxid; | ||
35 | } | ||
36 | |||
37 | -- | ||
38 | 1.7.7.6 | ||
39 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0058-fifo-Do-not-restart-open-if-it-already-found-a-partn.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0058-fifo-Do-not-restart-open-if-it-already-found-a-partn.patch new file mode 100644 index 00000000..99a8db5a --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0058-fifo-Do-not-restart-open-if-it-already-found-a-partn.patch | |||
@@ -0,0 +1,115 @@ | |||
1 | From 13d0304203a528b1c1c76b5c9b6f5b8dc093f996 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anders Kaseorg <andersk@MIT.EDU> | ||
3 | Date: Sun, 15 Jul 2012 17:14:25 -0400 | ||
4 | Subject: [PATCH 058/109] fifo: Do not restart open() if it already found a | ||
5 | partner | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | commit 05d290d66be6ef77a0b962ebecf01911bd984a78 upstream. | ||
11 | |||
12 | If a parent and child process open the two ends of a fifo, and the | ||
13 | child immediately exits, the parent may receive a SIGCHLD before its | ||
14 | open() returns. In that case, we need to make sure that open() will | ||
15 | return successfully after the SIGCHLD handler returns, instead of | ||
16 | throwing EINTR or being restarted. Otherwise, the restarted open() | ||
17 | would incorrectly wait for a second partner on the other end. | ||
18 | |||
19 | The following test demonstrates the EINTR that was wrongly thrown from | ||
20 | the parent’s open(). Change .sa_flags = 0 to .sa_flags = SA_RESTART | ||
21 | to see a deadlock instead, in which the restarted open() waits for a | ||
22 | second reader that will never come. (On my systems, this happens | ||
23 | pretty reliably within about 5 to 500 iterations. Others report that | ||
24 | it manages to loop ~forever sometimes; YMMV.) | ||
25 | |||
26 | #include <sys/stat.h> | ||
27 | #include <sys/types.h> | ||
28 | #include <sys/wait.h> | ||
29 | #include <fcntl.h> | ||
30 | #include <signal.h> | ||
31 | #include <stdio.h> | ||
32 | #include <stdlib.h> | ||
33 | #include <unistd.h> | ||
34 | |||
35 | #define CHECK(x) do if ((x) == -1) {perror(#x); abort();} while(0) | ||
36 | |||
37 | void handler(int signum) {} | ||
38 | |||
39 | int main() | ||
40 | { | ||
41 | struct sigaction act = {.sa_handler = handler, .sa_flags = 0}; | ||
42 | CHECK(sigaction(SIGCHLD, &act, NULL)); | ||
43 | CHECK(mknod("fifo", S_IFIFO | S_IRWXU, 0)); | ||
44 | for (;;) { | ||
45 | int fd; | ||
46 | pid_t pid; | ||
47 | putc('.', stderr); | ||
48 | CHECK(pid = fork()); | ||
49 | if (pid == 0) { | ||
50 | CHECK(fd = open("fifo", O_RDONLY)); | ||
51 | _exit(0); | ||
52 | } | ||
53 | CHECK(fd = open("fifo", O_WRONLY)); | ||
54 | CHECK(close(fd)); | ||
55 | CHECK(waitpid(pid, NULL, 0)); | ||
56 | } | ||
57 | } | ||
58 | |||
59 | This is what I suspect was causing the Git test suite to fail in | ||
60 | t9010-svn-fe.sh: | ||
61 | |||
62 | http://bugs.debian.org/678852 | ||
63 | |||
64 | Signed-off-by: Anders Kaseorg <andersk@mit.edu> | ||
65 | Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> | ||
66 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
67 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
68 | --- | ||
69 | fs/fifo.c | 9 ++++----- | ||
70 | 1 files changed, 4 insertions(+), 5 deletions(-) | ||
71 | |||
72 | diff --git a/fs/fifo.c b/fs/fifo.c | ||
73 | index b1a524d..cf6f434 100644 | ||
74 | --- a/fs/fifo.c | ||
75 | +++ b/fs/fifo.c | ||
76 | @@ -14,7 +14,7 @@ | ||
77 | #include <linux/sched.h> | ||
78 | #include <linux/pipe_fs_i.h> | ||
79 | |||
80 | -static void wait_for_partner(struct inode* inode, unsigned int *cnt) | ||
81 | +static int wait_for_partner(struct inode* inode, unsigned int *cnt) | ||
82 | { | ||
83 | int cur = *cnt; | ||
84 | |||
85 | @@ -23,6 +23,7 @@ static void wait_for_partner(struct inode* inode, unsigned int *cnt) | ||
86 | if (signal_pending(current)) | ||
87 | break; | ||
88 | } | ||
89 | + return cur == *cnt ? -ERESTARTSYS : 0; | ||
90 | } | ||
91 | |||
92 | static void wake_up_partner(struct inode* inode) | ||
93 | @@ -67,8 +68,7 @@ static int fifo_open(struct inode *inode, struct file *filp) | ||
94 | * seen a writer */ | ||
95 | filp->f_version = pipe->w_counter; | ||
96 | } else { | ||
97 | - wait_for_partner(inode, &pipe->w_counter); | ||
98 | - if(signal_pending(current)) | ||
99 | + if (wait_for_partner(inode, &pipe->w_counter)) | ||
100 | goto err_rd; | ||
101 | } | ||
102 | } | ||
103 | @@ -90,8 +90,7 @@ static int fifo_open(struct inode *inode, struct file *filp) | ||
104 | wake_up_partner(inode); | ||
105 | |||
106 | if (!pipe->readers) { | ||
107 | - wait_for_partner(inode, &pipe->r_counter); | ||
108 | - if (signal_pending(current)) | ||
109 | + if (wait_for_partner(inode, &pipe->r_counter)) | ||
110 | goto err_wr; | ||
111 | } | ||
112 | break; | ||
113 | -- | ||
114 | 1.7.7.6 | ||
115 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0059-target-Clean-up-returning-errors-in-PR-handling-code.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0059-target-Clean-up-returning-errors-in-PR-handling-code.patch new file mode 100644 index 00000000..273c119f --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0059-target-Clean-up-returning-errors-in-PR-handling-code.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | From ab68c7b575aff70124f83d2ec207d06c60eea003 Mon Sep 17 00:00:00 2001 | ||
2 | From: Roland Dreier <roland@purestorage.com> | ||
3 | Date: Mon, 16 Jul 2012 15:17:10 -0700 | ||
4 | Subject: [PATCH 059/109] target: Clean up returning errors in PR handling | ||
5 | code | ||
6 | |||
7 | commit d35212f3ca3bf4fb49d15e37f530c9931e2d2183 upstream. | ||
8 | |||
9 | - instead of (PTR_ERR(file) < 0) just use IS_ERR(file) | ||
10 | - return -EINVAL instead of EINVAL | ||
11 | - all other error returns in target_scsi3_emulate_pr_out() use | ||
12 | "goto out" -- get rid of the one remaining straight "return." | ||
13 | |||
14 | Signed-off-by: Roland Dreier <roland@purestorage.com> | ||
15 | Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> | ||
16 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
17 | --- | ||
18 | drivers/target/target_core_pr.c | 7 ++++--- | ||
19 | 1 files changed, 4 insertions(+), 3 deletions(-) | ||
20 | |||
21 | diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c | ||
22 | index b75bc92..9145141 100644 | ||
23 | --- a/drivers/target/target_core_pr.c | ||
24 | +++ b/drivers/target/target_core_pr.c | ||
25 | @@ -2042,7 +2042,7 @@ static int __core_scsi3_write_aptpl_to_file( | ||
26 | if (IS_ERR(file) || !file || !file->f_dentry) { | ||
27 | pr_err("filp_open(%s) for APTPL metadata" | ||
28 | " failed\n", path); | ||
29 | - return (PTR_ERR(file) < 0 ? PTR_ERR(file) : -ENOENT); | ||
30 | + return IS_ERR(file) ? PTR_ERR(file) : -ENOENT; | ||
31 | } | ||
32 | |||
33 | iov[0].iov_base = &buf[0]; | ||
34 | @@ -3853,7 +3853,7 @@ int target_scsi3_emulate_pr_out(struct se_task *task) | ||
35 | " SPC-2 reservation is held, returning" | ||
36 | " RESERVATION_CONFLICT\n"); | ||
37 | cmd->scsi_sense_reason = TCM_RESERVATION_CONFLICT; | ||
38 | - ret = EINVAL; | ||
39 | + ret = -EINVAL; | ||
40 | goto out; | ||
41 | } | ||
42 | |||
43 | @@ -3863,7 +3863,8 @@ int target_scsi3_emulate_pr_out(struct se_task *task) | ||
44 | */ | ||
45 | if (!cmd->se_sess) { | ||
46 | cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | ||
47 | - return -EINVAL; | ||
48 | + ret = -EINVAL; | ||
49 | + goto out; | ||
50 | } | ||
51 | |||
52 | if (cmd->data_length < 24) { | ||
53 | -- | ||
54 | 1.7.7.6 | ||
55 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0060-target-Fix-range-calculation-in-WRITE-SAME-emulation.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0060-target-Fix-range-calculation-in-WRITE-SAME-emulation.patch new file mode 100644 index 00000000..264206d6 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0060-target-Fix-range-calculation-in-WRITE-SAME-emulation.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From 63a96e329f2c66af145a93d6f42067e54ef932af Mon Sep 17 00:00:00 2001 | ||
2 | From: Roland Dreier <roland@purestorage.com> | ||
3 | Date: Mon, 16 Jul 2012 17:10:17 -0700 | ||
4 | Subject: [PATCH 060/109] target: Fix range calculation in WRITE SAME | ||
5 | emulation when num blocks == 0 | ||
6 | |||
7 | commit 1765fe5edcb83f53fc67edeb559fcf4bc82c6460 upstream. | ||
8 | |||
9 | When NUMBER OF LOGICAL BLOCKS is 0, WRITE SAME is supposed to write | ||
10 | all the blocks from the specified LBA through the end of the device. | ||
11 | However, dev->transport->get_blocks(dev) (perhaps confusingly) returns | ||
12 | the last valid LBA rather than the number of blocks, so the correct | ||
13 | number of blocks to write starting with lba is | ||
14 | |||
15 | dev->transport->get_blocks(dev) - lba + 1 | ||
16 | |||
17 | (nab: Backport roland's for-3.6 patch to for-3.5) | ||
18 | |||
19 | Signed-off-by: Roland Dreier <roland@purestorage.com> | ||
20 | Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> | ||
21 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
22 | --- | ||
23 | drivers/target/target_core_cdb.c | 2 +- | ||
24 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
25 | |||
26 | diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c | ||
27 | index 65ea65a..93b9406 100644 | ||
28 | --- a/drivers/target/target_core_cdb.c | ||
29 | +++ b/drivers/target/target_core_cdb.c | ||
30 | @@ -1199,7 +1199,7 @@ int target_emulate_write_same(struct se_task *task) | ||
31 | if (num_blocks != 0) | ||
32 | range = num_blocks; | ||
33 | else | ||
34 | - range = (dev->transport->get_blocks(dev) - lba); | ||
35 | + range = (dev->transport->get_blocks(dev) - lba) + 1; | ||
36 | |||
37 | pr_debug("WRITE_SAME UNMAP: LBA: %llu Range: %llu\n", | ||
38 | (unsigned long long)lba, (unsigned long long)range); | ||
39 | -- | ||
40 | 1.7.7.6 | ||
41 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0061-cifs-on-CONFIG_HIGHMEM-machines-limit-the-rsize-wsiz.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0061-cifs-on-CONFIG_HIGHMEM-machines-limit-the-rsize-wsiz.patch new file mode 100644 index 00000000..e3fc6d09 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0061-cifs-on-CONFIG_HIGHMEM-machines-limit-the-rsize-wsiz.patch | |||
@@ -0,0 +1,82 @@ | |||
1 | From 0028855e0b717cadb5fc6b05934af9bd9d2cc4c1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jeff Layton <jlayton@redhat.com> | ||
3 | Date: Wed, 11 Jul 2012 09:09:35 -0400 | ||
4 | Subject: [PATCH 061/109] cifs: on CONFIG_HIGHMEM machines, limit the | ||
5 | rsize/wsize to the kmap space | ||
6 | |||
7 | commit 3ae629d98bd5ed77585a878566f04f310adbc591 upstream. | ||
8 | |||
9 | We currently rely on being able to kmap all of the pages in an async | ||
10 | read or write request. If you're on a machine that has CONFIG_HIGHMEM | ||
11 | set then that kmap space is limited, sometimes to as low as 512 slots. | ||
12 | |||
13 | With 512 slots, we can only support up to a 2M r/wsize, and that's | ||
14 | assuming that we can get our greedy little hands on all of them. There | ||
15 | are other users however, so it's possible we'll end up stuck with a | ||
16 | size that large. | ||
17 | |||
18 | Since we can't handle a rsize or wsize larger than that currently, cap | ||
19 | those options at the number of kmap slots we have. We could consider | ||
20 | capping it even lower, but we currently default to a max of 1M. Might as | ||
21 | well allow those luddites on 32 bit arches enough rope to hang | ||
22 | themselves. | ||
23 | |||
24 | A more robust fix would be to teach the send and receive routines how | ||
25 | to contend with an array of pages so we don't need to marshal up a kvec | ||
26 | array at all. That's a fairly significant overhaul though, so we'll need | ||
27 | this limit in place until that's ready. | ||
28 | |||
29 | Reported-by: Jian Li <jiali@redhat.com> | ||
30 | Signed-off-by: Jeff Layton <jlayton@redhat.com> | ||
31 | Signed-off-by: Steve French <smfrench@gmail.com> | ||
32 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
33 | --- | ||
34 | fs/cifs/connect.c | 18 ++++++++++++++++++ | ||
35 | 1 files changed, 18 insertions(+), 0 deletions(-) | ||
36 | |||
37 | diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c | ||
38 | index b21670c..56c152d 100644 | ||
39 | --- a/fs/cifs/connect.c | ||
40 | +++ b/fs/cifs/connect.c | ||
41 | @@ -2925,6 +2925,18 @@ void cifs_setup_cifs_sb(struct smb_vol *pvolume_info, | ||
42 | #define CIFS_DEFAULT_NON_POSIX_RSIZE (60 * 1024) | ||
43 | #define CIFS_DEFAULT_NON_POSIX_WSIZE (65536) | ||
44 | |||
45 | +/* | ||
46 | + * On hosts with high memory, we can't currently support wsize/rsize that are | ||
47 | + * larger than we can kmap at once. Cap the rsize/wsize at | ||
48 | + * LAST_PKMAP * PAGE_SIZE. We'll never be able to fill a read or write request | ||
49 | + * larger than that anyway. | ||
50 | + */ | ||
51 | +#ifdef CONFIG_HIGHMEM | ||
52 | +#define CIFS_KMAP_SIZE_LIMIT (LAST_PKMAP * PAGE_CACHE_SIZE) | ||
53 | +#else /* CONFIG_HIGHMEM */ | ||
54 | +#define CIFS_KMAP_SIZE_LIMIT (1<<24) | ||
55 | +#endif /* CONFIG_HIGHMEM */ | ||
56 | + | ||
57 | static unsigned int | ||
58 | cifs_negotiate_wsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info) | ||
59 | { | ||
60 | @@ -2955,6 +2967,9 @@ cifs_negotiate_wsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info) | ||
61 | wsize = min_t(unsigned int, wsize, | ||
62 | server->maxBuf - sizeof(WRITE_REQ) + 4); | ||
63 | |||
64 | + /* limit to the amount that we can kmap at once */ | ||
65 | + wsize = min_t(unsigned int, wsize, CIFS_KMAP_SIZE_LIMIT); | ||
66 | + | ||
67 | /* hard limit of CIFS_MAX_WSIZE */ | ||
68 | wsize = min_t(unsigned int, wsize, CIFS_MAX_WSIZE); | ||
69 | |||
70 | @@ -2996,6 +3011,9 @@ cifs_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info) | ||
71 | if (!(server->capabilities & CAP_LARGE_READ_X)) | ||
72 | rsize = min_t(unsigned int, CIFSMaxBufSize, rsize); | ||
73 | |||
74 | + /* limit to the amount that we can kmap at once */ | ||
75 | + rsize = min_t(unsigned int, rsize, CIFS_KMAP_SIZE_LIMIT); | ||
76 | + | ||
77 | /* hard limit of CIFS_MAX_RSIZE */ | ||
78 | rsize = min_t(unsigned int, rsize, CIFS_MAX_RSIZE); | ||
79 | |||
80 | -- | ||
81 | 1.7.7.6 | ||
82 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0062-cifs-always-update-the-inode-cache-with-the-results-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0062-cifs-always-update-the-inode-cache-with-the-results-.patch new file mode 100644 index 00000000..6e67cc93 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0062-cifs-always-update-the-inode-cache-with-the-results-.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 3d7e548a161a109e404e1068901f834c69eeb0ea Mon Sep 17 00:00:00 2001 | ||
2 | From: Jeff Layton <jlayton@redhat.com> | ||
3 | Date: Fri, 6 Jul 2012 07:09:42 -0400 | ||
4 | Subject: [PATCH 062/109] cifs: always update the inode cache with the results | ||
5 | from a FIND_* | ||
6 | |||
7 | commit cd60042cc1392e79410dc8de9e9c1abb38a29e57 upstream. | ||
8 | |||
9 | When we get back a FIND_FIRST/NEXT result, we have some info about the | ||
10 | dentry that we use to instantiate a new inode. We were ignoring and | ||
11 | discarding that info when we had an existing dentry in the cache. | ||
12 | |||
13 | Fix this by updating the inode in place when we find an existing dentry | ||
14 | and the uniqueid is the same. | ||
15 | |||
16 | Reported-and-Tested-by: Andrew Bartlett <abartlet@samba.org> | ||
17 | Reported-by: Bill Robertson <bill_robertson@debortoli.com.au> | ||
18 | Reported-by: Dion Edwards <dion_edwards@debortoli.com.au> | ||
19 | Signed-off-by: Jeff Layton <jlayton@redhat.com> | ||
20 | Signed-off-by: Steve French <smfrench@gmail.com> | ||
21 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
22 | --- | ||
23 | fs/cifs/readdir.c | 7 +++++-- | ||
24 | 1 files changed, 5 insertions(+), 2 deletions(-) | ||
25 | |||
26 | diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c | ||
27 | index db4a138..4c37ed4 100644 | ||
28 | --- a/fs/cifs/readdir.c | ||
29 | +++ b/fs/cifs/readdir.c | ||
30 | @@ -86,9 +86,12 @@ cifs_readdir_lookup(struct dentry *parent, struct qstr *name, | ||
31 | |||
32 | dentry = d_lookup(parent, name); | ||
33 | if (dentry) { | ||
34 | - /* FIXME: check for inode number changes? */ | ||
35 | - if (dentry->d_inode != NULL) | ||
36 | + inode = dentry->d_inode; | ||
37 | + /* update inode in place if i_ino didn't change */ | ||
38 | + if (inode && CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) { | ||
39 | + cifs_fattr_to_inode(inode, fattr); | ||
40 | return dentry; | ||
41 | + } | ||
42 | d_drop(dentry); | ||
43 | dput(dentry); | ||
44 | } | ||
45 | -- | ||
46 | 1.7.7.6 | ||
47 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0063-mm-fix-lost-kswapd-wakeup-in-kswapd_stop.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0063-mm-fix-lost-kswapd-wakeup-in-kswapd_stop.patch new file mode 100644 index 00000000..198dc151 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0063-mm-fix-lost-kswapd-wakeup-in-kswapd_stop.patch | |||
@@ -0,0 +1,84 @@ | |||
1 | From 6ece4e48bfa223f77eff8fc4d2fcc4808214f42e Mon Sep 17 00:00:00 2001 | ||
2 | From: Aaditya Kumar <aaditya.kumar.30@gmail.com> | ||
3 | Date: Tue, 17 Jul 2012 15:48:07 -0700 | ||
4 | Subject: [PATCH 063/109] mm: fix lost kswapd wakeup in kswapd_stop() | ||
5 | |||
6 | commit 1c7e7f6c0703d03af6bcd5ccc11fc15d23e5ecbe upstream. | ||
7 | |||
8 | Offlining memory may block forever, waiting for kswapd() to wake up | ||
9 | because kswapd() does not check the event kthread->should_stop before | ||
10 | sleeping. | ||
11 | |||
12 | The proper pattern, from Documentation/memory-barriers.txt, is: | ||
13 | |||
14 | --- waker --- | ||
15 | event_indicated = 1; | ||
16 | wake_up_process(event_daemon); | ||
17 | |||
18 | --- sleeper --- | ||
19 | for (;;) { | ||
20 | set_current_state(TASK_UNINTERRUPTIBLE); | ||
21 | if (event_indicated) | ||
22 | break; | ||
23 | schedule(); | ||
24 | } | ||
25 | |||
26 | set_current_state() may be wrapped by: | ||
27 | prepare_to_wait(); | ||
28 | |||
29 | In the kswapd() case, event_indicated is kthread->should_stop. | ||
30 | |||
31 | === offlining memory (waker) === | ||
32 | kswapd_stop() | ||
33 | kthread_stop() | ||
34 | kthread->should_stop = 1 | ||
35 | wake_up_process() | ||
36 | wait_for_completion() | ||
37 | |||
38 | === kswapd_try_to_sleep (sleeper) === | ||
39 | kswapd_try_to_sleep() | ||
40 | prepare_to_wait() | ||
41 | . | ||
42 | . | ||
43 | schedule() | ||
44 | . | ||
45 | . | ||
46 | finish_wait() | ||
47 | |||
48 | The schedule() needs to be protected by a test of kthread->should_stop, | ||
49 | which is wrapped by kthread_should_stop(). | ||
50 | |||
51 | Reproducer: | ||
52 | Do heavy file I/O in background. | ||
53 | Do a memory offline/online in a tight loop | ||
54 | |||
55 | Signed-off-by: Aaditya Kumar <aaditya.kumar@ap.sony.com> | ||
56 | Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | ||
57 | Reviewed-by: Minchan Kim <minchan@kernel.org> | ||
58 | Acked-by: Mel Gorman <mel@csn.ul.ie> | ||
59 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
60 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
61 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
62 | --- | ||
63 | mm/vmscan.c | 5 ++++- | ||
64 | 1 files changed, 4 insertions(+), 1 deletions(-) | ||
65 | |||
66 | diff --git a/mm/vmscan.c b/mm/vmscan.c | ||
67 | index 72cf498..8342119 100644 | ||
68 | --- a/mm/vmscan.c | ||
69 | +++ b/mm/vmscan.c | ||
70 | @@ -2824,7 +2824,10 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int order, int classzone_idx) | ||
71 | * them before going back to sleep. | ||
72 | */ | ||
73 | set_pgdat_percpu_threshold(pgdat, calculate_normal_threshold); | ||
74 | - schedule(); | ||
75 | + | ||
76 | + if (!kthread_should_stop()) | ||
77 | + schedule(); | ||
78 | + | ||
79 | set_pgdat_percpu_threshold(pgdat, calculate_pressure_threshold); | ||
80 | } else { | ||
81 | if (remaining) | ||
82 | -- | ||
83 | 1.7.7.6 | ||
84 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0064-md-avoid-crash-when-stopping-md-array-races-with-clo.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0064-md-avoid-crash-when-stopping-md-array-races-with-clo.patch new file mode 100644 index 00000000..3ef68e9f --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0064-md-avoid-crash-when-stopping-md-array-races-with-clo.patch | |||
@@ -0,0 +1,164 @@ | |||
1 | From 22c2c30192d85ffa042433e89e929b4ea08ab528 Mon Sep 17 00:00:00 2001 | ||
2 | From: NeilBrown <neilb@suse.de> | ||
3 | Date: Thu, 19 Jul 2012 15:59:18 +1000 | ||
4 | Subject: [PATCH 064/109] md: avoid crash when stopping md array races with | ||
5 | closing other open fds. | ||
6 | |||
7 | commit a05b7ea03d72f36edb0cec05e8893803335c61a0 upstream. | ||
8 | |||
9 | md will refuse to stop an array if any other fd (or mounted fs) is | ||
10 | using it. | ||
11 | When any fs is unmounted of when the last open fd is closed all | ||
12 | pending IO will be flushed (e.g. sync_blockdev call in __blkdev_put) | ||
13 | so there will be no pending IO to worry about when the array is | ||
14 | stopped. | ||
15 | |||
16 | However in order to send the STOP_ARRAY ioctl to stop the array one | ||
17 | must first get and open fd on the block device. | ||
18 | If some fd is being used to write to the block device and it is closed | ||
19 | after mdadm open the block device, but before mdadm issues the | ||
20 | STOP_ARRAY ioctl, then there will be no last-close on the md device so | ||
21 | __blkdev_put will not call sync_blockdev. | ||
22 | |||
23 | If this happens, then IO can still be in-flight while md tears down | ||
24 | the array and bad things can happen (use-after-free and subsequent | ||
25 | havoc). | ||
26 | |||
27 | So in the case where do_md_stop is being called from an open file | ||
28 | descriptor, call sync_block after taking the mutex to ensure there | ||
29 | will be no new openers. | ||
30 | |||
31 | This is needed when setting a read-write device to read-only too. | ||
32 | |||
33 | Reported-by: majianpeng <majianpeng@gmail.com> | ||
34 | Signed-off-by: NeilBrown <neilb@suse.de> | ||
35 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
36 | --- | ||
37 | drivers/md/md.c | 36 +++++++++++++++++++++++------------- | ||
38 | 1 files changed, 23 insertions(+), 13 deletions(-) | ||
39 | |||
40 | diff --git a/drivers/md/md.c b/drivers/md/md.c | ||
41 | index 700ecae..d8646d7 100644 | ||
42 | --- a/drivers/md/md.c | ||
43 | +++ b/drivers/md/md.c | ||
44 | @@ -3700,8 +3700,8 @@ array_state_show(struct mddev *mddev, char *page) | ||
45 | return sprintf(page, "%s\n", array_states[st]); | ||
46 | } | ||
47 | |||
48 | -static int do_md_stop(struct mddev * mddev, int ro, int is_open); | ||
49 | -static int md_set_readonly(struct mddev * mddev, int is_open); | ||
50 | +static int do_md_stop(struct mddev * mddev, int ro, struct block_device *bdev); | ||
51 | +static int md_set_readonly(struct mddev * mddev, struct block_device *bdev); | ||
52 | static int do_md_run(struct mddev * mddev); | ||
53 | static int restart_array(struct mddev *mddev); | ||
54 | |||
55 | @@ -3717,14 +3717,14 @@ array_state_store(struct mddev *mddev, const char *buf, size_t len) | ||
56 | /* stopping an active array */ | ||
57 | if (atomic_read(&mddev->openers) > 0) | ||
58 | return -EBUSY; | ||
59 | - err = do_md_stop(mddev, 0, 0); | ||
60 | + err = do_md_stop(mddev, 0, NULL); | ||
61 | break; | ||
62 | case inactive: | ||
63 | /* stopping an active array */ | ||
64 | if (mddev->pers) { | ||
65 | if (atomic_read(&mddev->openers) > 0) | ||
66 | return -EBUSY; | ||
67 | - err = do_md_stop(mddev, 2, 0); | ||
68 | + err = do_md_stop(mddev, 2, NULL); | ||
69 | } else | ||
70 | err = 0; /* already inactive */ | ||
71 | break; | ||
72 | @@ -3732,7 +3732,7 @@ array_state_store(struct mddev *mddev, const char *buf, size_t len) | ||
73 | break; /* not supported yet */ | ||
74 | case readonly: | ||
75 | if (mddev->pers) | ||
76 | - err = md_set_readonly(mddev, 0); | ||
77 | + err = md_set_readonly(mddev, NULL); | ||
78 | else { | ||
79 | mddev->ro = 1; | ||
80 | set_disk_ro(mddev->gendisk, 1); | ||
81 | @@ -3742,7 +3742,7 @@ array_state_store(struct mddev *mddev, const char *buf, size_t len) | ||
82 | case read_auto: | ||
83 | if (mddev->pers) { | ||
84 | if (mddev->ro == 0) | ||
85 | - err = md_set_readonly(mddev, 0); | ||
86 | + err = md_set_readonly(mddev, NULL); | ||
87 | else if (mddev->ro == 1) | ||
88 | err = restart_array(mddev); | ||
89 | if (err == 0) { | ||
90 | @@ -5078,15 +5078,17 @@ void md_stop(struct mddev *mddev) | ||
91 | } | ||
92 | EXPORT_SYMBOL_GPL(md_stop); | ||
93 | |||
94 | -static int md_set_readonly(struct mddev *mddev, int is_open) | ||
95 | +static int md_set_readonly(struct mddev *mddev, struct block_device *bdev) | ||
96 | { | ||
97 | int err = 0; | ||
98 | mutex_lock(&mddev->open_mutex); | ||
99 | - if (atomic_read(&mddev->openers) > is_open) { | ||
100 | + if (atomic_read(&mddev->openers) > !!bdev) { | ||
101 | printk("md: %s still in use.\n",mdname(mddev)); | ||
102 | err = -EBUSY; | ||
103 | goto out; | ||
104 | } | ||
105 | + if (bdev) | ||
106 | + sync_blockdev(bdev); | ||
107 | if (mddev->pers) { | ||
108 | __md_stop_writes(mddev); | ||
109 | |||
110 | @@ -5108,18 +5110,26 @@ out: | ||
111 | * 0 - completely stop and dis-assemble array | ||
112 | * 2 - stop but do not disassemble array | ||
113 | */ | ||
114 | -static int do_md_stop(struct mddev * mddev, int mode, int is_open) | ||
115 | +static int do_md_stop(struct mddev * mddev, int mode, | ||
116 | + struct block_device *bdev) | ||
117 | { | ||
118 | struct gendisk *disk = mddev->gendisk; | ||
119 | struct md_rdev *rdev; | ||
120 | |||
121 | mutex_lock(&mddev->open_mutex); | ||
122 | - if (atomic_read(&mddev->openers) > is_open || | ||
123 | + if (atomic_read(&mddev->openers) > !!bdev || | ||
124 | mddev->sysfs_active) { | ||
125 | printk("md: %s still in use.\n",mdname(mddev)); | ||
126 | mutex_unlock(&mddev->open_mutex); | ||
127 | return -EBUSY; | ||
128 | } | ||
129 | + if (bdev) | ||
130 | + /* It is possible IO was issued on some other | ||
131 | + * open file which was closed before we took ->open_mutex. | ||
132 | + * As that was not the last close __blkdev_put will not | ||
133 | + * have called sync_blockdev, so we must. | ||
134 | + */ | ||
135 | + sync_blockdev(bdev); | ||
136 | |||
137 | if (mddev->pers) { | ||
138 | if (mddev->ro) | ||
139 | @@ -5193,7 +5203,7 @@ static void autorun_array(struct mddev *mddev) | ||
140 | err = do_md_run(mddev); | ||
141 | if (err) { | ||
142 | printk(KERN_WARNING "md: do_md_run() returned %d\n", err); | ||
143 | - do_md_stop(mddev, 0, 0); | ||
144 | + do_md_stop(mddev, 0, NULL); | ||
145 | } | ||
146 | } | ||
147 | |||
148 | @@ -6184,11 +6194,11 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode, | ||
149 | goto done_unlock; | ||
150 | |||
151 | case STOP_ARRAY: | ||
152 | - err = do_md_stop(mddev, 0, 1); | ||
153 | + err = do_md_stop(mddev, 0, bdev); | ||
154 | goto done_unlock; | ||
155 | |||
156 | case STOP_ARRAY_RO: | ||
157 | - err = md_set_readonly(mddev, 1); | ||
158 | + err = md_set_readonly(mddev, bdev); | ||
159 | goto done_unlock; | ||
160 | |||
161 | case BLKROSET: | ||
162 | -- | ||
163 | 1.7.7.6 | ||
164 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0065-md-raid1-close-some-possible-races-on-write-errors-d.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0065-md-raid1-close-some-possible-races-on-write-errors-d.patch new file mode 100644 index 00000000..b3bd32c3 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0065-md-raid1-close-some-possible-races-on-write-errors-d.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | From a5f676adf9ef247dd5363de5f0e26d0bdb6597bc Mon Sep 17 00:00:00 2001 | ||
2 | From: NeilBrown <neilb@suse.de> | ||
3 | Date: Thu, 19 Jul 2012 15:59:18 +1000 | ||
4 | Subject: [PATCH 065/109] md/raid1: close some possible races on write errors | ||
5 | during resync | ||
6 | |||
7 | commit 58e94ae18478c08229626daece2fc108a4a23261 upstream. | ||
8 | |||
9 | commit 4367af556133723d0f443e14ca8170d9447317cb | ||
10 | md/raid1: clear bad-block record when write succeeds. | ||
11 | |||
12 | Added a 'reschedule_retry' call possibility at the end of | ||
13 | end_sync_write, but didn't add matching code at the end of | ||
14 | sync_request_write. So if the writes complete very quickly, or | ||
15 | scheduling makes it seem that way, then we can miss rescheduling | ||
16 | the request and the resync could hang. | ||
17 | |||
18 | Also commit 73d5c38a9536142e062c35997b044e89166e063b | ||
19 | md: avoid races when stopping resync. | ||
20 | |||
21 | Fix a race condition in this same code in end_sync_write but didn't | ||
22 | make the change in sync_request_write. | ||
23 | |||
24 | This patch updates sync_request_write to fix both of those. | ||
25 | Patch is suitable for 3.1 and later kernels. | ||
26 | |||
27 | Reported-by: Alexander Lyakas <alex.bolshoy@gmail.com> | ||
28 | Original-version-by: Alexander Lyakas <alex.bolshoy@gmail.com> | ||
29 | Signed-off-by: NeilBrown <neilb@suse.de> | ||
30 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
31 | --- | ||
32 | drivers/md/raid1.c | 10 ++++++++-- | ||
33 | 1 files changed, 8 insertions(+), 2 deletions(-) | ||
34 | |||
35 | diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c | ||
36 | index 58f0055..2d97bf0 100644 | ||
37 | --- a/drivers/md/raid1.c | ||
38 | +++ b/drivers/md/raid1.c | ||
39 | @@ -1713,8 +1713,14 @@ static void sync_request_write(struct mddev *mddev, struct r1bio *r1_bio) | ||
40 | |||
41 | if (atomic_dec_and_test(&r1_bio->remaining)) { | ||
42 | /* if we're here, all write(s) have completed, so clean up */ | ||
43 | - md_done_sync(mddev, r1_bio->sectors, 1); | ||
44 | - put_buf(r1_bio); | ||
45 | + int s = r1_bio->sectors; | ||
46 | + if (test_bit(R1BIO_MadeGood, &r1_bio->state) || | ||
47 | + test_bit(R1BIO_WriteError, &r1_bio->state)) | ||
48 | + reschedule_retry(r1_bio); | ||
49 | + else { | ||
50 | + put_buf(r1_bio); | ||
51 | + md_done_sync(mddev, s, 1); | ||
52 | + } | ||
53 | } | ||
54 | } | ||
55 | |||
56 | -- | ||
57 | 1.7.7.6 | ||
58 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0066-MIPS-Properly-align-the-.data.init_task-section.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0066-MIPS-Properly-align-the-.data.init_task-section.patch new file mode 100644 index 00000000..c9ab6f8e --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0066-MIPS-Properly-align-the-.data.init_task-section.patch | |||
@@ -0,0 +1,70 @@ | |||
1 | From 892d35f24ea2801daef7e48e41d8ec4e9bac34e8 Mon Sep 17 00:00:00 2001 | ||
2 | From: David Daney <david.daney@cavium.com> | ||
3 | Date: Thu, 19 Jul 2012 09:11:14 +0200 | ||
4 | Subject: [PATCH 066/109] MIPS: Properly align the .data..init_task section. | ||
5 | |||
6 | commit 7b1c0d26a8e272787f0f9fcc5f3e8531df3b3409 upstream. | ||
7 | |||
8 | Improper alignment can lead to unbootable systems and/or random | ||
9 | crashes. | ||
10 | |||
11 | [ralf@linux-mips.org: This is a lond standing bug since | ||
12 | 6eb10bc9e2deab06630261cd05c4cb1e9a60e980 (kernel.org) rsp. | ||
13 | c422a10917f75fd19fa7fe070aaaa23e384dae6f (lmo) [MIPS: Clean up linker script | ||
14 | using new linker script macros.] so dates back to 2.6.32.] | ||
15 | |||
16 | Signed-off-by: David Daney <david.daney@cavium.com> | ||
17 | Cc: linux-mips@linux-mips.org | ||
18 | Patchwork: https://patchwork.linux-mips.org/patch/3881/ | ||
19 | Signed-off-by: Ralf Baechle <ralf@linux-mips.org> | ||
20 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
21 | --- | ||
22 | arch/mips/include/asm/thread_info.h | 4 ++-- | ||
23 | arch/mips/kernel/vmlinux.lds.S | 3 ++- | ||
24 | 2 files changed, 4 insertions(+), 3 deletions(-) | ||
25 | |||
26 | diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h | ||
27 | index 97f8bf6..adda036 100644 | ||
28 | --- a/arch/mips/include/asm/thread_info.h | ||
29 | +++ b/arch/mips/include/asm/thread_info.h | ||
30 | @@ -60,6 +60,8 @@ struct thread_info { | ||
31 | register struct thread_info *__current_thread_info __asm__("$28"); | ||
32 | #define current_thread_info() __current_thread_info | ||
33 | |||
34 | +#endif /* !__ASSEMBLY__ */ | ||
35 | + | ||
36 | /* thread information allocation */ | ||
37 | #if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_32BIT) | ||
38 | #define THREAD_SIZE_ORDER (1) | ||
39 | @@ -97,8 +99,6 @@ register struct thread_info *__current_thread_info __asm__("$28"); | ||
40 | |||
41 | #define free_thread_info(info) kfree(info) | ||
42 | |||
43 | -#endif /* !__ASSEMBLY__ */ | ||
44 | - | ||
45 | #define PREEMPT_ACTIVE 0x10000000 | ||
46 | |||
47 | /* | ||
48 | diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S | ||
49 | index a81176f..be281c6 100644 | ||
50 | --- a/arch/mips/kernel/vmlinux.lds.S | ||
51 | +++ b/arch/mips/kernel/vmlinux.lds.S | ||
52 | @@ -1,5 +1,6 @@ | ||
53 | #include <asm/asm-offsets.h> | ||
54 | #include <asm/page.h> | ||
55 | +#include <asm/thread_info.h> | ||
56 | #include <asm-generic/vmlinux.lds.h> | ||
57 | |||
58 | #undef mips | ||
59 | @@ -73,7 +74,7 @@ SECTIONS | ||
60 | .data : { /* Data */ | ||
61 | . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */ | ||
62 | |||
63 | - INIT_TASK_DATA(PAGE_SIZE) | ||
64 | + INIT_TASK_DATA(THREAD_SIZE) | ||
65 | NOSAVE_DATA | ||
66 | CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT) | ||
67 | READ_MOSTLY_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT) | ||
68 | -- | ||
69 | 1.7.7.6 | ||
70 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0067-UBIFS-fix-a-bug-in-empty-space-fix-up.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0067-UBIFS-fix-a-bug-in-empty-space-fix-up.patch new file mode 100644 index 00000000..c51b1770 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0067-UBIFS-fix-a-bug-in-empty-space-fix-up.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | From f6ba94c29333fa6df9b3b553415e93bafbd3c831 Mon Sep 17 00:00:00 2001 | ||
2 | From: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> | ||
3 | Date: Sat, 14 Jul 2012 14:33:09 +0300 | ||
4 | Subject: [PATCH 067/109] UBIFS: fix a bug in empty space fix-up | ||
5 | |||
6 | commit c6727932cfdb13501108b16c38463c09d5ec7a74 upstream. | ||
7 | |||
8 | UBIFS has a feature called "empty space fix-up" which is a quirk to work-around | ||
9 | limitations of dumb flasher programs. Namely, of those flashers that are unable | ||
10 | to skip NAND pages full of 0xFFs while flashing, resulting in empty space at | ||
11 | the end of half-filled eraseblocks to be unusable for UBIFS. This feature is | ||
12 | relatively new (introduced in v3.0). | ||
13 | |||
14 | The fix-up routine (fixup_free_space()) is executed only once at the very first | ||
15 | mount if the superblock has the 'space_fixup' flag set (can be done with -F | ||
16 | option of mkfs.ubifs). It basically reads all the UBIFS data and metadata and | ||
17 | writes it back to the same LEB. The routine assumes the image is pristine and | ||
18 | does not have anything in the journal. | ||
19 | |||
20 | There was a bug in 'fixup_free_space()' where it fixed up the log incorrectly. | ||
21 | All but one LEB of the log of a pristine file-system are empty. And one | ||
22 | contains just a commit start node. And 'fixup_free_space()' just unmapped this | ||
23 | LEB, which resulted in wiping the commit start node. As a result, some users | ||
24 | were unable to mount the file-system next time with the following symptom: | ||
25 | |||
26 | UBIFS error (pid 1): replay_log_leb: first log node at LEB 3:0 is not CS node | ||
27 | UBIFS error (pid 1): replay_log_leb: log error detected while replaying the log at LEB 3:0 | ||
28 | |||
29 | The root-cause of this bug was that 'fixup_free_space()' wrongly assumed | ||
30 | that the beginning of empty space in the log head (c->lhead_offs) was known | ||
31 | on mount. However, it is not the case - it was always 0. UBIFS does not store | ||
32 | in it the master node and finds out by scanning the log on every mount. | ||
33 | |||
34 | The fix is simple - just pass commit start node size instead of 0 to | ||
35 | 'fixup_leb()'. | ||
36 | |||
37 | Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> | ||
38 | Reported-by: Iwo Mergler <Iwo.Mergler@netcommwireless.com> | ||
39 | Tested-by: Iwo Mergler <Iwo.Mergler@netcommwireless.com> | ||
40 | Reported-by: James Nute <newten82@gmail.com> | ||
41 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
42 | --- | ||
43 | fs/ubifs/sb.c | 8 ++++++-- | ||
44 | 1 files changed, 6 insertions(+), 2 deletions(-) | ||
45 | |||
46 | diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c | ||
47 | index 6094c5a..b73ecd8 100644 | ||
48 | --- a/fs/ubifs/sb.c | ||
49 | +++ b/fs/ubifs/sb.c | ||
50 | @@ -715,8 +715,12 @@ static int fixup_free_space(struct ubifs_info *c) | ||
51 | lnum = ubifs_next_log_lnum(c, lnum); | ||
52 | } | ||
53 | |||
54 | - /* Fixup the current log head */ | ||
55 | - err = fixup_leb(c, c->lhead_lnum, c->lhead_offs); | ||
56 | + /* | ||
57 | + * Fixup the log head which contains the only a CS node at the | ||
58 | + * beginning. | ||
59 | + */ | ||
60 | + err = fixup_leb(c, c->lhead_lnum, | ||
61 | + ALIGN(UBIFS_CS_NODE_SZ, c->min_io_size)); | ||
62 | if (err) | ||
63 | goto out; | ||
64 | |||
65 | -- | ||
66 | 1.7.7.6 | ||
67 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0068-ore-Fix-NFS-crash-by-supporting-any-unaligned-RAID-I.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0068-ore-Fix-NFS-crash-by-supporting-any-unaligned-RAID-I.patch new file mode 100644 index 00000000..0dabe3b9 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0068-ore-Fix-NFS-crash-by-supporting-any-unaligned-RAID-I.patch | |||
@@ -0,0 +1,211 @@ | |||
1 | From b4c39a3690fd0d723f50eba441fe567e8fee68f1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Boaz Harrosh <bharrosh@panasas.com> | ||
3 | Date: Fri, 8 Jun 2012 01:19:07 +0300 | ||
4 | Subject: [PATCH 068/109] ore: Fix NFS crash by supporting any unaligned RAID | ||
5 | IO | ||
6 | |||
7 | commit 9ff19309a9623f2963ac5a136782ea4d8b5d67fb upstream. | ||
8 | |||
9 | In RAID_5/6 We used to not permit an IO that it's end | ||
10 | byte is not stripe_size aligned and spans more than one stripe. | ||
11 | .i.e the caller must check if after submission the actual | ||
12 | transferred bytes is shorter, and would need to resubmit | ||
13 | a new IO with the remainder. | ||
14 | |||
15 | Exofs supports this, and NFS was supposed to support this | ||
16 | as well with it's short write mechanism. But late testing has | ||
17 | exposed a CRASH when this is used with none-RPC layout-drivers. | ||
18 | |||
19 | The change at NFS is deep and risky, in it's place the fix | ||
20 | at ORE to lift the limitation is actually clean and simple. | ||
21 | So here it is below. | ||
22 | |||
23 | The principal here is that in the case of unaligned IO on | ||
24 | both ends, beginning and end, we will send two read requests | ||
25 | one like old code, before the calculation of the first stripe, | ||
26 | and also a new site, before the calculation of the last stripe. | ||
27 | If any "boundary" is aligned or the complete IO is within a single | ||
28 | stripe. we do a single read like before. | ||
29 | |||
30 | The code is clean and simple by splitting the old _read_4_write | ||
31 | into 3 even parts: | ||
32 | 1._read_4_write_first_stripe | ||
33 | 2. _read_4_write_last_stripe | ||
34 | 3. _read_4_write_execute | ||
35 | |||
36 | And calling 1+3 at the same place as before. 2+3 before last | ||
37 | stripe, and in the case of all in a single stripe then 1+2+3 | ||
38 | is preformed additively. | ||
39 | |||
40 | Why did I not think of it before. Well I had a strike of | ||
41 | genius because I have stared at this code for 2 years, and did | ||
42 | not find this simple solution, til today. Not that I did not try. | ||
43 | |||
44 | This solution is much better for NFS than the previous supposedly | ||
45 | solution because the short write was dealt with out-of-band after | ||
46 | IO_done, which would cause for a seeky IO pattern where as in here | ||
47 | we execute in order. At both solutions we do 2 separate reads, only | ||
48 | here we do it within a single IO request. (And actually combine two | ||
49 | writes into a single submission) | ||
50 | |||
51 | NFS/exofs code need not change since the ORE API communicates the new | ||
52 | shorter length on return, what will happen is that this case would not | ||
53 | occur anymore. | ||
54 | |||
55 | hurray!! | ||
56 | |||
57 | [Stable this is an NFS bug since 3.2 Kernel should apply cleanly] | ||
58 | Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> | ||
59 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
60 | --- | ||
61 | fs/exofs/ore_raid.c | 67 +++++++++++++++++++++++++++----------------------- | ||
62 | 1 files changed, 36 insertions(+), 31 deletions(-) | ||
63 | |||
64 | diff --git a/fs/exofs/ore_raid.c b/fs/exofs/ore_raid.c | ||
65 | index d222c77..fff2070 100644 | ||
66 | --- a/fs/exofs/ore_raid.c | ||
67 | +++ b/fs/exofs/ore_raid.c | ||
68 | @@ -461,16 +461,12 @@ static void _mark_read4write_pages_uptodate(struct ore_io_state *ios, int ret) | ||
69 | * ios->sp2d[p][*], xor is calculated the same way. These pages are | ||
70 | * allocated/freed and don't go through cache | ||
71 | */ | ||
72 | -static int _read_4_write(struct ore_io_state *ios) | ||
73 | +static int _read_4_write_first_stripe(struct ore_io_state *ios) | ||
74 | { | ||
75 | - struct ore_io_state *ios_read; | ||
76 | struct ore_striping_info read_si; | ||
77 | struct __stripe_pages_2d *sp2d = ios->sp2d; | ||
78 | u64 offset = ios->si.first_stripe_start; | ||
79 | - u64 last_stripe_end; | ||
80 | - unsigned bytes_in_stripe = ios->si.bytes_in_stripe; | ||
81 | - unsigned i, c, p, min_p = sp2d->pages_in_unit, max_p = -1; | ||
82 | - int ret; | ||
83 | + unsigned c, p, min_p = sp2d->pages_in_unit, max_p = -1; | ||
84 | |||
85 | if (offset == ios->offset) /* Go to start collect $200 */ | ||
86 | goto read_last_stripe; | ||
87 | @@ -478,6 +474,9 @@ static int _read_4_write(struct ore_io_state *ios) | ||
88 | min_p = _sp2d_min_pg(sp2d); | ||
89 | max_p = _sp2d_max_pg(sp2d); | ||
90 | |||
91 | + ORE_DBGMSG("stripe_start=0x%llx ios->offset=0x%llx min_p=%d max_p=%d\n", | ||
92 | + offset, ios->offset, min_p, max_p); | ||
93 | + | ||
94 | for (c = 0; ; c++) { | ||
95 | ore_calc_stripe_info(ios->layout, offset, 0, &read_si); | ||
96 | read_si.obj_offset += min_p * PAGE_SIZE; | ||
97 | @@ -512,6 +511,18 @@ static int _read_4_write(struct ore_io_state *ios) | ||
98 | } | ||
99 | |||
100 | read_last_stripe: | ||
101 | + return 0; | ||
102 | +} | ||
103 | + | ||
104 | +static int _read_4_write_last_stripe(struct ore_io_state *ios) | ||
105 | +{ | ||
106 | + struct ore_striping_info read_si; | ||
107 | + struct __stripe_pages_2d *sp2d = ios->sp2d; | ||
108 | + u64 offset; | ||
109 | + u64 last_stripe_end; | ||
110 | + unsigned bytes_in_stripe = ios->si.bytes_in_stripe; | ||
111 | + unsigned c, p, min_p = sp2d->pages_in_unit, max_p = -1; | ||
112 | + | ||
113 | offset = ios->offset + ios->length; | ||
114 | if (offset % PAGE_SIZE) | ||
115 | _add_to_r4w_last_page(ios, &offset); | ||
116 | @@ -527,15 +538,15 @@ read_last_stripe: | ||
117 | c = _dev_order(ios->layout->group_width * ios->layout->mirrors_p1, | ||
118 | ios->layout->mirrors_p1, read_si.par_dev, read_si.dev); | ||
119 | |||
120 | - BUG_ON(ios->si.first_stripe_start + bytes_in_stripe != last_stripe_end); | ||
121 | - /* unaligned IO must be within a single stripe */ | ||
122 | - | ||
123 | if (min_p == sp2d->pages_in_unit) { | ||
124 | /* Didn't do it yet */ | ||
125 | min_p = _sp2d_min_pg(sp2d); | ||
126 | max_p = _sp2d_max_pg(sp2d); | ||
127 | } | ||
128 | |||
129 | + ORE_DBGMSG("offset=0x%llx stripe_end=0x%llx min_p=%d max_p=%d\n", | ||
130 | + offset, last_stripe_end, min_p, max_p); | ||
131 | + | ||
132 | while (offset < last_stripe_end) { | ||
133 | struct __1_page_stripe *_1ps = &sp2d->_1p_stripes[p]; | ||
134 | |||
135 | @@ -568,6 +579,15 @@ read_last_stripe: | ||
136 | } | ||
137 | |||
138 | read_it: | ||
139 | + return 0; | ||
140 | +} | ||
141 | + | ||
142 | +static int _read_4_write_execute(struct ore_io_state *ios) | ||
143 | +{ | ||
144 | + struct ore_io_state *ios_read; | ||
145 | + unsigned i; | ||
146 | + int ret; | ||
147 | + | ||
148 | ios_read = ios->ios_read_4_write; | ||
149 | if (!ios_read) | ||
150 | return 0; | ||
151 | @@ -591,6 +611,8 @@ read_it: | ||
152 | } | ||
153 | |||
154 | _mark_read4write_pages_uptodate(ios_read, ret); | ||
155 | + ore_put_io_state(ios_read); | ||
156 | + ios->ios_read_4_write = NULL; /* Might need a reuse at last stripe */ | ||
157 | return 0; | ||
158 | } | ||
159 | |||
160 | @@ -626,8 +648,11 @@ int _ore_add_parity_unit(struct ore_io_state *ios, | ||
161 | /* If first stripe, Read in all read4write pages | ||
162 | * (if needed) before we calculate the first parity. | ||
163 | */ | ||
164 | - _read_4_write(ios); | ||
165 | + _read_4_write_first_stripe(ios); | ||
166 | } | ||
167 | + if (!cur_len) /* If last stripe r4w pages of last stripe */ | ||
168 | + _read_4_write_last_stripe(ios); | ||
169 | + _read_4_write_execute(ios); | ||
170 | |||
171 | for (i = 0; i < num_pages; i++) { | ||
172 | pages[i] = _raid_page_alloc(); | ||
173 | @@ -654,34 +679,14 @@ int _ore_add_parity_unit(struct ore_io_state *ios, | ||
174 | |||
175 | int _ore_post_alloc_raid_stuff(struct ore_io_state *ios) | ||
176 | { | ||
177 | - struct ore_layout *layout = ios->layout; | ||
178 | - | ||
179 | if (ios->parity_pages) { | ||
180 | + struct ore_layout *layout = ios->layout; | ||
181 | unsigned pages_in_unit = layout->stripe_unit / PAGE_SIZE; | ||
182 | - unsigned stripe_size = ios->si.bytes_in_stripe; | ||
183 | - u64 last_stripe, first_stripe; | ||
184 | |||
185 | if (_sp2d_alloc(pages_in_unit, layout->group_width, | ||
186 | layout->parity, &ios->sp2d)) { | ||
187 | return -ENOMEM; | ||
188 | } | ||
189 | - | ||
190 | - /* Round io down to last full strip */ | ||
191 | - first_stripe = div_u64(ios->offset, stripe_size); | ||
192 | - last_stripe = div_u64(ios->offset + ios->length, stripe_size); | ||
193 | - | ||
194 | - /* If an IO spans more then a single stripe it must end at | ||
195 | - * a stripe boundary. The reminder at the end is pushed into the | ||
196 | - * next IO. | ||
197 | - */ | ||
198 | - if (last_stripe != first_stripe) { | ||
199 | - ios->length = last_stripe * stripe_size - ios->offset; | ||
200 | - | ||
201 | - BUG_ON(!ios->length); | ||
202 | - ios->nr_pages = (ios->length + PAGE_SIZE - 1) / | ||
203 | - PAGE_SIZE; | ||
204 | - ios->si.length = ios->length; /*make it consistent */ | ||
205 | - } | ||
206 | } | ||
207 | return 0; | ||
208 | } | ||
209 | -- | ||
210 | 1.7.7.6 | ||
211 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0069-ore-Remove-support-of-partial-IO-request-NFS-crash.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0069-ore-Remove-support-of-partial-IO-request-NFS-crash.patch new file mode 100644 index 00000000..dade1128 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0069-ore-Remove-support-of-partial-IO-request-NFS-crash.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From a2f43c94b074e0bf567ddc35e17504bbcd237ae1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Boaz Harrosh <bharrosh@panasas.com> | ||
3 | Date: Fri, 8 Jun 2012 04:30:40 +0300 | ||
4 | Subject: [PATCH 069/109] ore: Remove support of partial IO request (NFS | ||
5 | crash) | ||
6 | |||
7 | commit 62b62ad873f2accad9222a4d7ffbe1e93f6714c1 upstream. | ||
8 | |||
9 | Do to OOM situations the ore might fail to allocate all resources | ||
10 | needed for IO of the full request. If some progress was possible | ||
11 | it would proceed with a partial/short request, for the sake of | ||
12 | forward progress. | ||
13 | |||
14 | Since this crashes NFS-core and exofs is just fine without it just | ||
15 | remove this contraption, and fail. | ||
16 | |||
17 | TODO: | ||
18 | Support real forward progress with some reserved allocations | ||
19 | of resources, such as mem pools and/or bio_sets | ||
20 | |||
21 | [Bug since 3.2 Kernel] | ||
22 | CC: Benny Halevy <bhalevy@tonian.com> | ||
23 | Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> | ||
24 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
25 | --- | ||
26 | fs/exofs/ore.c | 8 +------- | ||
27 | 1 files changed, 1 insertions(+), 7 deletions(-) | ||
28 | |||
29 | diff --git a/fs/exofs/ore.c b/fs/exofs/ore.c | ||
30 | index 49cf230..24a49d4 100644 | ||
31 | --- a/fs/exofs/ore.c | ||
32 | +++ b/fs/exofs/ore.c | ||
33 | @@ -735,13 +735,7 @@ static int _prepare_for_striping(struct ore_io_state *ios) | ||
34 | out: | ||
35 | ios->numdevs = devs_in_group; | ||
36 | ios->pages_consumed = cur_pg; | ||
37 | - if (unlikely(ret)) { | ||
38 | - if (length == ios->length) | ||
39 | - return ret; | ||
40 | - else | ||
41 | - ios->length -= length; | ||
42 | - } | ||
43 | - return 0; | ||
44 | + return ret; | ||
45 | } | ||
46 | |||
47 | int ore_create(struct ore_io_state *ios) | ||
48 | -- | ||
49 | 1.7.7.6 | ||
50 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0070-pnfs-obj-don-t-leak-objio_state-if-ore_write-read-fa.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0070-pnfs-obj-don-t-leak-objio_state-if-ore_write-read-fa.patch new file mode 100644 index 00000000..c1659cab --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0070-pnfs-obj-don-t-leak-objio_state-if-ore_write-read-fa.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From 7b47a0e2114e8530614a25d7ec998fd52d069853 Mon Sep 17 00:00:00 2001 | ||
2 | From: Boaz Harrosh <bharrosh@panasas.com> | ||
3 | Date: Fri, 8 Jun 2012 05:29:40 +0300 | ||
4 | Subject: [PATCH 070/109] pnfs-obj: don't leak objio_state if ore_write/read | ||
5 | fails | ||
6 | |||
7 | commit 9909d45a8557455ca5f8ee7af0f253debc851f1a upstream. | ||
8 | |||
9 | [Bug since 3.2 Kernel] | ||
10 | Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> | ||
11 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
12 | --- | ||
13 | fs/nfs/objlayout/objio_osd.c | 9 +++++++-- | ||
14 | 1 files changed, 7 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c | ||
17 | index 55d0128..0e7b3fc 100644 | ||
18 | --- a/fs/nfs/objlayout/objio_osd.c | ||
19 | +++ b/fs/nfs/objlayout/objio_osd.c | ||
20 | @@ -433,7 +433,10 @@ int objio_read_pagelist(struct nfs_read_data *rdata) | ||
21 | objios->ios->done = _read_done; | ||
22 | dprintk("%s: offset=0x%llx length=0x%x\n", __func__, | ||
23 | rdata->args.offset, rdata->args.count); | ||
24 | - return ore_read(objios->ios); | ||
25 | + ret = ore_read(objios->ios); | ||
26 | + if (unlikely(ret)) | ||
27 | + objio_free_result(&objios->oir); | ||
28 | + return ret; | ||
29 | } | ||
30 | |||
31 | /* | ||
32 | @@ -517,8 +520,10 @@ int objio_write_pagelist(struct nfs_write_data *wdata, int how) | ||
33 | dprintk("%s: offset=0x%llx length=0x%x\n", __func__, | ||
34 | wdata->args.offset, wdata->args.count); | ||
35 | ret = ore_write(objios->ios); | ||
36 | - if (unlikely(ret)) | ||
37 | + if (unlikely(ret)) { | ||
38 | + objio_free_result(&objios->oir); | ||
39 | return ret; | ||
40 | + } | ||
41 | |||
42 | if (objios->sync) | ||
43 | _write_done(objios->ios, objios); | ||
44 | -- | ||
45 | 1.7.7.6 | ||
46 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0071-pnfs-obj-Fix-__r4w_get_page-when-offset-is-beyond-i_.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0071-pnfs-obj-Fix-__r4w_get_page-when-offset-is-beyond-i_.patch new file mode 100644 index 00000000..95152cc7 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0071-pnfs-obj-Fix-__r4w_get_page-when-offset-is-beyond-i_.patch | |||
@@ -0,0 +1,71 @@ | |||
1 | From e4750a0414e24bcd0106493a2f8f251dd02264bf Mon Sep 17 00:00:00 2001 | ||
2 | From: Boaz Harrosh <bharrosh@panasas.com> | ||
3 | Date: Fri, 8 Jun 2012 02:02:30 +0300 | ||
4 | Subject: [PATCH 071/109] pnfs-obj: Fix __r4w_get_page when offset is beyond | ||
5 | i_size | ||
6 | |||
7 | commit c999ff68029ebd0f56ccae75444f640f6d5a27d2 upstream. | ||
8 | |||
9 | It is very common for the end of the file to be unaligned on | ||
10 | stripe size. But since we know it's beyond file's end then | ||
11 | the XOR should be preformed with all zeros. | ||
12 | |||
13 | Old code used to just read zeros out of the OSD devices, which is a great | ||
14 | waist. But what scares me more about this situation is that, we now have | ||
15 | pages attached to the file's mapping that are beyond i_size. I don't | ||
16 | like the kind of bugs this calls for. | ||
17 | |||
18 | Fix both birds, by returning a global zero_page, if offset is beyond | ||
19 | i_size. | ||
20 | |||
21 | TODO: | ||
22 | Change the API to ->__r4w_get_page() so a NULL can be | ||
23 | returned without being considered as error, since XOR API | ||
24 | treats NULL entries as zero_pages. | ||
25 | |||
26 | [Bug since 3.2. Should apply the same way to all Kernels since] | ||
27 | Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> | ||
28 | [bwh: Backported to 3.2: adjust for lack of wdata->header] | ||
29 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
30 | --- | ||
31 | fs/nfs/objlayout/objio_osd.c | 16 +++++++++++++--- | ||
32 | 1 files changed, 13 insertions(+), 3 deletions(-) | ||
33 | |||
34 | diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c | ||
35 | index 0e7b3fc..a03ee52 100644 | ||
36 | --- a/fs/nfs/objlayout/objio_osd.c | ||
37 | +++ b/fs/nfs/objlayout/objio_osd.c | ||
38 | @@ -467,8 +467,16 @@ static struct page *__r4w_get_page(void *priv, u64 offset, bool *uptodate) | ||
39 | struct objio_state *objios = priv; | ||
40 | struct nfs_write_data *wdata = objios->oir.rpcdata; | ||
41 | pgoff_t index = offset / PAGE_SIZE; | ||
42 | - struct page *page = find_get_page(wdata->inode->i_mapping, index); | ||
43 | + struct page *page; | ||
44 | + loff_t i_size = i_size_read(wdata->inode); | ||
45 | |||
46 | + if (offset >= i_size) { | ||
47 | + *uptodate = true; | ||
48 | + dprintk("%s: g_zero_page index=0x%lx\n", __func__, index); | ||
49 | + return ZERO_PAGE(0); | ||
50 | + } | ||
51 | + | ||
52 | + page = find_get_page(wdata->inode->i_mapping, index); | ||
53 | if (!page) { | ||
54 | page = find_or_create_page(wdata->inode->i_mapping, | ||
55 | index, GFP_NOFS); | ||
56 | @@ -489,8 +497,10 @@ static struct page *__r4w_get_page(void *priv, u64 offset, bool *uptodate) | ||
57 | |||
58 | static void __r4w_put_page(void *priv, struct page *page) | ||
59 | { | ||
60 | - dprintk("%s: index=0x%lx\n", __func__, page->index); | ||
61 | - page_cache_release(page); | ||
62 | + dprintk("%s: index=0x%lx\n", __func__, | ||
63 | + (page == ZERO_PAGE(0)) ? -1UL : page->index); | ||
64 | + if (ZERO_PAGE(0) != page) | ||
65 | + page_cache_release(page); | ||
66 | return; | ||
67 | } | ||
68 | |||
69 | -- | ||
70 | 1.7.7.6 | ||
71 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0072-dm-raid1-fix-crash-with-mirror-recovery-and-discard.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0072-dm-raid1-fix-crash-with-mirror-recovery-and-discard.patch new file mode 100644 index 00000000..60a39d30 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0072-dm-raid1-fix-crash-with-mirror-recovery-and-discard.patch | |||
@@ -0,0 +1,114 @@ | |||
1 | From 035afb0de8406d0f820abf43471d51a377add326 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mikulas Patocka <mpatocka@redhat.com> | ||
3 | Date: Fri, 20 Jul 2012 14:25:03 +0100 | ||
4 | Subject: [PATCH 072/109] dm raid1: fix crash with mirror recovery and discard | ||
5 | |||
6 | commit 751f188dd5ab95b3f2b5f2f467c38aae5a2877eb upstream. | ||
7 | |||
8 | This patch fixes a crash when a discard request is sent during mirror | ||
9 | recovery. | ||
10 | |||
11 | Firstly, some background. Generally, the following sequence happens during | ||
12 | mirror synchronization: | ||
13 | - function do_recovery is called | ||
14 | - do_recovery calls dm_rh_recovery_prepare | ||
15 | - dm_rh_recovery_prepare uses a semaphore to limit the number | ||
16 | simultaneously recovered regions (by default the semaphore value is 1, | ||
17 | so only one region at a time is recovered) | ||
18 | - dm_rh_recovery_prepare calls __rh_recovery_prepare, | ||
19 | __rh_recovery_prepare asks the log driver for the next region to | ||
20 | recover. Then, it sets the region state to DM_RH_RECOVERING. If there | ||
21 | are no pending I/Os on this region, the region is added to | ||
22 | quiesced_regions list. If there are pending I/Os, the region is not | ||
23 | added to any list. It is added to the quiesced_regions list later (by | ||
24 | dm_rh_dec function) when all I/Os finish. | ||
25 | - when the region is on quiesced_regions list, there are no I/Os in | ||
26 | flight on this region. The region is popped from the list in | ||
27 | dm_rh_recovery_start function. Then, a kcopyd job is started in the | ||
28 | recover function. | ||
29 | - when the kcopyd job finishes, recovery_complete is called. It calls | ||
30 | dm_rh_recovery_end. dm_rh_recovery_end adds the region to | ||
31 | recovered_regions or failed_recovered_regions list (depending on | ||
32 | whether the copy operation was successful or not). | ||
33 | |||
34 | The above mechanism assumes that if the region is in DM_RH_RECOVERING | ||
35 | state, no new I/Os are started on this region. When I/O is started, | ||
36 | dm_rh_inc_pending is called, which increases reg->pending count. When | ||
37 | I/O is finished, dm_rh_dec is called. It decreases reg->pending count. | ||
38 | If the count is zero and the region was in DM_RH_RECOVERING state, | ||
39 | dm_rh_dec adds it to the quiesced_regions list. | ||
40 | |||
41 | Consequently, if we call dm_rh_inc_pending/dm_rh_dec while the region is | ||
42 | in DM_RH_RECOVERING state, it could be added to quiesced_regions list | ||
43 | multiple times or it could be added to this list when kcopyd is copying | ||
44 | data (it is assumed that the region is not on any list while kcopyd does | ||
45 | its jobs). This results in memory corruption and crash. | ||
46 | |||
47 | There already exist bypasses for REQ_FLUSH requests: REQ_FLUSH requests | ||
48 | do not belong to any region, so they are always added to the sync list | ||
49 | in do_writes. dm_rh_inc_pending does not increase count for REQ_FLUSH | ||
50 | requests. In mirror_end_io, dm_rh_dec is never called for REQ_FLUSH | ||
51 | requests. These bypasses avoid the crash possibility described above. | ||
52 | |||
53 | These bypasses were improperly implemented for REQ_DISCARD when | ||
54 | the mirror target gained discard support in commit | ||
55 | 5fc2ffeabb9ee0fc0e71ff16b49f34f0ed3d05b4 (dm raid1: support discard). | ||
56 | |||
57 | In do_writes, REQ_DISCARD requests is always added to the sync queue and | ||
58 | immediately dispatched (even if the region is in DM_RH_RECOVERING). However, | ||
59 | dm_rh_inc and dm_rh_dec is called for REQ_DISCARD resusts. So it violates the | ||
60 | rule that no I/Os are started on DM_RH_RECOVERING regions, and causes the list | ||
61 | corruption described above. | ||
62 | |||
63 | This patch changes it so that REQ_DISCARD requests follow the same path | ||
64 | as REQ_FLUSH. This avoids the crash. | ||
65 | |||
66 | Reference: https://bugzilla.redhat.com/837607 | ||
67 | |||
68 | Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> | ||
69 | Signed-off-by: Alasdair G Kergon <agk@redhat.com> | ||
70 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
71 | --- | ||
72 | drivers/md/dm-raid1.c | 2 +- | ||
73 | drivers/md/dm-region-hash.c | 5 ++++- | ||
74 | 2 files changed, 5 insertions(+), 2 deletions(-) | ||
75 | |||
76 | diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c | ||
77 | index 9bfd057..42ef54f 100644 | ||
78 | --- a/drivers/md/dm-raid1.c | ||
79 | +++ b/drivers/md/dm-raid1.c | ||
80 | @@ -1210,7 +1210,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, | ||
81 | * We need to dec pending if this was a write. | ||
82 | */ | ||
83 | if (rw == WRITE) { | ||
84 | - if (!(bio->bi_rw & REQ_FLUSH)) | ||
85 | + if (!(bio->bi_rw & (REQ_FLUSH | REQ_DISCARD))) | ||
86 | dm_rh_dec(ms->rh, map_context->ll); | ||
87 | return error; | ||
88 | } | ||
89 | diff --git a/drivers/md/dm-region-hash.c b/drivers/md/dm-region-hash.c | ||
90 | index 7771ed2..69732e0 100644 | ||
91 | --- a/drivers/md/dm-region-hash.c | ||
92 | +++ b/drivers/md/dm-region-hash.c | ||
93 | @@ -404,6 +404,9 @@ void dm_rh_mark_nosync(struct dm_region_hash *rh, struct bio *bio) | ||
94 | return; | ||
95 | } | ||
96 | |||
97 | + if (bio->bi_rw & REQ_DISCARD) | ||
98 | + return; | ||
99 | + | ||
100 | /* We must inform the log that the sync count has changed. */ | ||
101 | log->type->set_region_sync(log, region, 0); | ||
102 | |||
103 | @@ -524,7 +527,7 @@ void dm_rh_inc_pending(struct dm_region_hash *rh, struct bio_list *bios) | ||
104 | struct bio *bio; | ||
105 | |||
106 | for (bio = bios->head; bio; bio = bio->bi_next) { | ||
107 | - if (bio->bi_rw & REQ_FLUSH) | ||
108 | + if (bio->bi_rw & (REQ_FLUSH | REQ_DISCARD)) | ||
109 | continue; | ||
110 | rh_inc(rh, dm_rh_bio_to_region(rh, bio)); | ||
111 | } | ||
112 | -- | ||
113 | 1.7.7.6 | ||
114 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0073-dm-raid1-set-discard_zeroes_data_unsupported.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0073-dm-raid1-set-discard_zeroes_data_unsupported.patch new file mode 100644 index 00000000..b5f81f28 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0073-dm-raid1-set-discard_zeroes_data_unsupported.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From e8cf7231ce4f6464f8962ae6ef0421da40ddad15 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mikulas Patocka <mpatocka@redhat.com> | ||
3 | Date: Fri, 20 Jul 2012 14:25:07 +0100 | ||
4 | Subject: [PATCH 073/109] dm raid1: set discard_zeroes_data_unsupported | ||
5 | |||
6 | commit 7c8d3a42fe1c58a7e8fd3f6a013e7d7b474ff931 upstream. | ||
7 | |||
8 | We can't guarantee that REQ_DISCARD on dm-mirror zeroes the data even if | ||
9 | the underlying disks support zero on discard. So this patch sets | ||
10 | ti->discard_zeroes_data_unsupported. | ||
11 | |||
12 | For example, if the mirror is in the process of resynchronizing, it may | ||
13 | happen that kcopyd reads a piece of data, then discard is sent on the | ||
14 | same area and then kcopyd writes the piece of data to another leg. | ||
15 | Consequently, the data is not zeroed. | ||
16 | |||
17 | The flag was made available by commit 983c7db347db8ce2d8453fd1d89b7a4bb6920d56 | ||
18 | (dm crypt: always disable discard_zeroes_data). | ||
19 | |||
20 | Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> | ||
21 | Signed-off-by: Alasdair G Kergon <agk@redhat.com> | ||
22 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
23 | --- | ||
24 | drivers/md/dm-raid1.c | 1 + | ||
25 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
26 | |||
27 | diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c | ||
28 | index 42ef54f..dae2b7a 100644 | ||
29 | --- a/drivers/md/dm-raid1.c | ||
30 | +++ b/drivers/md/dm-raid1.c | ||
31 | @@ -1080,6 +1080,7 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv) | ||
32 | ti->split_io = dm_rh_get_region_size(ms->rh); | ||
33 | ti->num_flush_requests = 1; | ||
34 | ti->num_discard_requests = 1; | ||
35 | + ti->discard_zeroes_data_unsupported = 1; | ||
36 | |||
37 | ms->kmirrord_wq = alloc_workqueue("kmirrord", | ||
38 | WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0); | ||
39 | -- | ||
40 | 1.7.7.6 | ||
41 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0074-ntp-Fix-leap-second-hrtimer-livelock.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0074-ntp-Fix-leap-second-hrtimer-livelock.patch new file mode 100644 index 00000000..5042065c --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0074-ntp-Fix-leap-second-hrtimer-livelock.patch | |||
@@ -0,0 +1,349 @@ | |||
1 | From 19aeba1469884ed9a789b143cf73ce047663c095 Mon Sep 17 00:00:00 2001 | ||
2 | From: John Stultz <john.stultz@linaro.org> | ||
3 | Date: Tue, 17 Jul 2012 03:05:14 -0400 | ||
4 | Subject: [PATCH 074/109] ntp: Fix leap-second hrtimer livelock | ||
5 | |||
6 | This is a backport of 6b43ae8a619d17c4935c3320d2ef9e92bdeed05d | ||
7 | |||
8 | This should have been backported when it was commited, but I | ||
9 | mistook the problem as requiring the ntp_lock changes | ||
10 | that landed in 3.4 in order for it to occur. | ||
11 | |||
12 | Unfortunately the same issue can happen (with only one cpu) | ||
13 | as follows: | ||
14 | do_adjtimex() | ||
15 | write_seqlock_irq(&xtime_lock); | ||
16 | process_adjtimex_modes() | ||
17 | process_adj_status() | ||
18 | ntp_start_leap_timer() | ||
19 | hrtimer_start() | ||
20 | hrtimer_reprogram() | ||
21 | tick_program_event() | ||
22 | clockevents_program_event() | ||
23 | ktime_get() | ||
24 | seq = req_seqbegin(xtime_lock); [DEADLOCK] | ||
25 | |||
26 | This deadlock will no always occur, as it requires the | ||
27 | leap_timer to force a hrtimer_reprogram which only happens | ||
28 | if its set and there's no sooner timer to expire. | ||
29 | |||
30 | NOTE: This patch, being faithful to the original commit, | ||
31 | introduces a bug (we don't update wall_to_monotonic), | ||
32 | which will be resovled by backporting a following fix. | ||
33 | |||
34 | Original commit message below: | ||
35 | |||
36 | Since commit 7dffa3c673fbcf835cd7be80bb4aec8ad3f51168 the ntp | ||
37 | subsystem has used an hrtimer for triggering the leapsecond | ||
38 | adjustment. However, this can cause a potential livelock. | ||
39 | |||
40 | Thomas diagnosed this as the following pattern: | ||
41 | CPU 0 CPU 1 | ||
42 | do_adjtimex() | ||
43 | spin_lock_irq(&ntp_lock); | ||
44 | process_adjtimex_modes(); timer_interrupt() | ||
45 | process_adj_status(); do_timer() | ||
46 | ntp_start_leap_timer(); write_lock(&xtime_lock); | ||
47 | hrtimer_start(); update_wall_time(); | ||
48 | hrtimer_reprogram(); ntp_tick_length() | ||
49 | tick_program_event() spin_lock(&ntp_lock); | ||
50 | clockevents_program_event() | ||
51 | ktime_get() | ||
52 | seq = req_seqbegin(xtime_lock); | ||
53 | |||
54 | This patch tries to avoid the problem by reverting back to not using | ||
55 | an hrtimer to inject leapseconds, and instead we handle the leapsecond | ||
56 | processing in the second_overflow() function. | ||
57 | |||
58 | The downside to this change is that on systems that support highres | ||
59 | timers, the leap second processing will occur on a HZ tick boundary, | ||
60 | (ie: ~1-10ms, depending on HZ) after the leap second instead of | ||
61 | possibly sooner (~34us in my tests w/ x86_64 lapic). | ||
62 | |||
63 | This patch applies on top of tip/timers/core. | ||
64 | |||
65 | CC: Sasha Levin <levinsasha928@gmail.com> | ||
66 | CC: Thomas Gleixner <tglx@linutronix.de> | ||
67 | Reported-by: Sasha Levin <levinsasha928@gmail.com> | ||
68 | Diagnoised-by: Thomas Gleixner <tglx@linutronix.de> | ||
69 | Tested-by: Sasha Levin <levinsasha928@gmail.com> | ||
70 | Cc: Prarit Bhargava <prarit@redhat.com> | ||
71 | Cc: Thomas Gleixner <tglx@linutronix.de> | ||
72 | Cc: Linux Kernel <linux-kernel@vger.kernel.org> | ||
73 | Signed-off-by: John Stultz <john.stultz@linaro.org> | ||
74 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
75 | --- | ||
76 | include/linux/timex.h | 2 +- | ||
77 | kernel/time/ntp.c | 122 +++++++++++++++------------------------------ | ||
78 | kernel/time/timekeeping.c | 18 +++---- | ||
79 | 3 files changed, 48 insertions(+), 94 deletions(-) | ||
80 | |||
81 | diff --git a/include/linux/timex.h b/include/linux/timex.h | ||
82 | index aa60fe7..08e90fb 100644 | ||
83 | --- a/include/linux/timex.h | ||
84 | +++ b/include/linux/timex.h | ||
85 | @@ -266,7 +266,7 @@ static inline int ntp_synced(void) | ||
86 | /* Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT. */ | ||
87 | extern u64 tick_length; | ||
88 | |||
89 | -extern void second_overflow(void); | ||
90 | +extern int second_overflow(unsigned long secs); | ||
91 | extern void update_ntp_one_tick(void); | ||
92 | extern int do_adjtimex(struct timex *); | ||
93 | extern void hardpps(const struct timespec *, const struct timespec *); | ||
94 | diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c | ||
95 | index 4b85a7a..4508f7f 100644 | ||
96 | --- a/kernel/time/ntp.c | ||
97 | +++ b/kernel/time/ntp.c | ||
98 | @@ -31,8 +31,6 @@ unsigned long tick_nsec; | ||
99 | u64 tick_length; | ||
100 | static u64 tick_length_base; | ||
101 | |||
102 | -static struct hrtimer leap_timer; | ||
103 | - | ||
104 | #define MAX_TICKADJ 500LL /* usecs */ | ||
105 | #define MAX_TICKADJ_SCALED \ | ||
106 | (((MAX_TICKADJ * NSEC_PER_USEC) << NTP_SCALE_SHIFT) / NTP_INTERVAL_FREQ) | ||
107 | @@ -350,60 +348,60 @@ void ntp_clear(void) | ||
108 | } | ||
109 | |||
110 | /* | ||
111 | - * Leap second processing. If in leap-insert state at the end of the | ||
112 | - * day, the system clock is set back one second; if in leap-delete | ||
113 | - * state, the system clock is set ahead one second. | ||
114 | + * this routine handles the overflow of the microsecond field | ||
115 | + * | ||
116 | + * The tricky bits of code to handle the accurate clock support | ||
117 | + * were provided by Dave Mills (Mills@UDEL.EDU) of NTP fame. | ||
118 | + * They were originally developed for SUN and DEC kernels. | ||
119 | + * All the kudos should go to Dave for this stuff. | ||
120 | + * | ||
121 | + * Also handles leap second processing, and returns leap offset | ||
122 | */ | ||
123 | -static enum hrtimer_restart ntp_leap_second(struct hrtimer *timer) | ||
124 | +int second_overflow(unsigned long secs) | ||
125 | { | ||
126 | - enum hrtimer_restart res = HRTIMER_NORESTART; | ||
127 | - | ||
128 | - write_seqlock(&xtime_lock); | ||
129 | + int leap = 0; | ||
130 | + s64 delta; | ||
131 | |||
132 | + /* | ||
133 | + * Leap second processing. If in leap-insert state at the end of the | ||
134 | + * day, the system clock is set back one second; if in leap-delete | ||
135 | + * state, the system clock is set ahead one second. | ||
136 | + */ | ||
137 | switch (time_state) { | ||
138 | case TIME_OK: | ||
139 | + if (time_status & STA_INS) | ||
140 | + time_state = TIME_INS; | ||
141 | + else if (time_status & STA_DEL) | ||
142 | + time_state = TIME_DEL; | ||
143 | break; | ||
144 | case TIME_INS: | ||
145 | - timekeeping_leap_insert(-1); | ||
146 | - time_state = TIME_OOP; | ||
147 | - printk(KERN_NOTICE | ||
148 | - "Clock: inserting leap second 23:59:60 UTC\n"); | ||
149 | - hrtimer_add_expires_ns(&leap_timer, NSEC_PER_SEC); | ||
150 | - res = HRTIMER_RESTART; | ||
151 | + if (secs % 86400 == 0) { | ||
152 | + leap = -1; | ||
153 | + time_state = TIME_OOP; | ||
154 | + printk(KERN_NOTICE | ||
155 | + "Clock: inserting leap second 23:59:60 UTC\n"); | ||
156 | + } | ||
157 | break; | ||
158 | case TIME_DEL: | ||
159 | - timekeeping_leap_insert(1); | ||
160 | - time_tai--; | ||
161 | - time_state = TIME_WAIT; | ||
162 | - printk(KERN_NOTICE | ||
163 | - "Clock: deleting leap second 23:59:59 UTC\n"); | ||
164 | + if ((secs + 1) % 86400 == 0) { | ||
165 | + leap = 1; | ||
166 | + time_tai--; | ||
167 | + time_state = TIME_WAIT; | ||
168 | + printk(KERN_NOTICE | ||
169 | + "Clock: deleting leap second 23:59:59 UTC\n"); | ||
170 | + } | ||
171 | break; | ||
172 | case TIME_OOP: | ||
173 | time_tai++; | ||
174 | time_state = TIME_WAIT; | ||
175 | - /* fall through */ | ||
176 | + break; | ||
177 | + | ||
178 | case TIME_WAIT: | ||
179 | if (!(time_status & (STA_INS | STA_DEL))) | ||
180 | time_state = TIME_OK; | ||
181 | break; | ||
182 | } | ||
183 | |||
184 | - write_sequnlock(&xtime_lock); | ||
185 | - | ||
186 | - return res; | ||
187 | -} | ||
188 | - | ||
189 | -/* | ||
190 | - * this routine handles the overflow of the microsecond field | ||
191 | - * | ||
192 | - * The tricky bits of code to handle the accurate clock support | ||
193 | - * were provided by Dave Mills (Mills@UDEL.EDU) of NTP fame. | ||
194 | - * They were originally developed for SUN and DEC kernels. | ||
195 | - * All the kudos should go to Dave for this stuff. | ||
196 | - */ | ||
197 | -void second_overflow(void) | ||
198 | -{ | ||
199 | - s64 delta; | ||
200 | |||
201 | /* Bump the maxerror field */ | ||
202 | time_maxerror += MAXFREQ / NSEC_PER_USEC; | ||
203 | @@ -423,23 +421,25 @@ void second_overflow(void) | ||
204 | pps_dec_valid(); | ||
205 | |||
206 | if (!time_adjust) | ||
207 | - return; | ||
208 | + goto out; | ||
209 | |||
210 | if (time_adjust > MAX_TICKADJ) { | ||
211 | time_adjust -= MAX_TICKADJ; | ||
212 | tick_length += MAX_TICKADJ_SCALED; | ||
213 | - return; | ||
214 | + goto out; | ||
215 | } | ||
216 | |||
217 | if (time_adjust < -MAX_TICKADJ) { | ||
218 | time_adjust += MAX_TICKADJ; | ||
219 | tick_length -= MAX_TICKADJ_SCALED; | ||
220 | - return; | ||
221 | + goto out; | ||
222 | } | ||
223 | |||
224 | tick_length += (s64)(time_adjust * NSEC_PER_USEC / NTP_INTERVAL_FREQ) | ||
225 | << NTP_SCALE_SHIFT; | ||
226 | time_adjust = 0; | ||
227 | +out: | ||
228 | + return leap; | ||
229 | } | ||
230 | |||
231 | #ifdef CONFIG_GENERIC_CMOS_UPDATE | ||
232 | @@ -501,27 +501,6 @@ static void notify_cmos_timer(void) | ||
233 | static inline void notify_cmos_timer(void) { } | ||
234 | #endif | ||
235 | |||
236 | -/* | ||
237 | - * Start the leap seconds timer: | ||
238 | - */ | ||
239 | -static inline void ntp_start_leap_timer(struct timespec *ts) | ||
240 | -{ | ||
241 | - long now = ts->tv_sec; | ||
242 | - | ||
243 | - if (time_status & STA_INS) { | ||
244 | - time_state = TIME_INS; | ||
245 | - now += 86400 - now % 86400; | ||
246 | - hrtimer_start(&leap_timer, ktime_set(now, 0), HRTIMER_MODE_ABS); | ||
247 | - | ||
248 | - return; | ||
249 | - } | ||
250 | - | ||
251 | - if (time_status & STA_DEL) { | ||
252 | - time_state = TIME_DEL; | ||
253 | - now += 86400 - (now + 1) % 86400; | ||
254 | - hrtimer_start(&leap_timer, ktime_set(now, 0), HRTIMER_MODE_ABS); | ||
255 | - } | ||
256 | -} | ||
257 | |||
258 | /* | ||
259 | * Propagate a new txc->status value into the NTP state: | ||
260 | @@ -546,22 +525,6 @@ static inline void process_adj_status(struct timex *txc, struct timespec *ts) | ||
261 | time_status &= STA_RONLY; | ||
262 | time_status |= txc->status & ~STA_RONLY; | ||
263 | |||
264 | - switch (time_state) { | ||
265 | - case TIME_OK: | ||
266 | - ntp_start_leap_timer(ts); | ||
267 | - break; | ||
268 | - case TIME_INS: | ||
269 | - case TIME_DEL: | ||
270 | - time_state = TIME_OK; | ||
271 | - ntp_start_leap_timer(ts); | ||
272 | - case TIME_WAIT: | ||
273 | - if (!(time_status & (STA_INS | STA_DEL))) | ||
274 | - time_state = TIME_OK; | ||
275 | - break; | ||
276 | - case TIME_OOP: | ||
277 | - hrtimer_restart(&leap_timer); | ||
278 | - break; | ||
279 | - } | ||
280 | } | ||
281 | /* | ||
282 | * Called with the xtime lock held, so we can access and modify | ||
283 | @@ -643,9 +606,6 @@ int do_adjtimex(struct timex *txc) | ||
284 | (txc->tick < 900000/USER_HZ || | ||
285 | txc->tick > 1100000/USER_HZ)) | ||
286 | return -EINVAL; | ||
287 | - | ||
288 | - if (txc->modes & ADJ_STATUS && time_state != TIME_OK) | ||
289 | - hrtimer_cancel(&leap_timer); | ||
290 | } | ||
291 | |||
292 | if (txc->modes & ADJ_SETOFFSET) { | ||
293 | @@ -967,6 +927,4 @@ __setup("ntp_tick_adj=", ntp_tick_adj_setup); | ||
294 | void __init ntp_init(void) | ||
295 | { | ||
296 | ntp_clear(); | ||
297 | - hrtimer_init(&leap_timer, CLOCK_REALTIME, HRTIMER_MODE_ABS); | ||
298 | - leap_timer.function = ntp_leap_second; | ||
299 | } | ||
300 | diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c | ||
301 | index 2378413..4780a7d 100644 | ||
302 | --- a/kernel/time/timekeeping.c | ||
303 | +++ b/kernel/time/timekeeping.c | ||
304 | @@ -169,15 +169,6 @@ static struct timespec raw_time; | ||
305 | /* flag for if timekeeping is suspended */ | ||
306 | int __read_mostly timekeeping_suspended; | ||
307 | |||
308 | -/* must hold xtime_lock */ | ||
309 | -void timekeeping_leap_insert(int leapsecond) | ||
310 | -{ | ||
311 | - xtime.tv_sec += leapsecond; | ||
312 | - wall_to_monotonic.tv_sec -= leapsecond; | ||
313 | - update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, | ||
314 | - timekeeper.mult); | ||
315 | -} | ||
316 | - | ||
317 | /** | ||
318 | * timekeeping_forward_now - update clock to the current time | ||
319 | * | ||
320 | @@ -942,9 +933,11 @@ static cycle_t logarithmic_accumulation(cycle_t offset, int shift) | ||
321 | |||
322 | timekeeper.xtime_nsec += timekeeper.xtime_interval << shift; | ||
323 | while (timekeeper.xtime_nsec >= nsecps) { | ||
324 | + int leap; | ||
325 | timekeeper.xtime_nsec -= nsecps; | ||
326 | xtime.tv_sec++; | ||
327 | - second_overflow(); | ||
328 | + leap = second_overflow(xtime.tv_sec); | ||
329 | + xtime.tv_sec += leap; | ||
330 | } | ||
331 | |||
332 | /* Accumulate raw time */ | ||
333 | @@ -1050,9 +1043,12 @@ static void update_wall_time(void) | ||
334 | * xtime.tv_nsec isn't larger then NSEC_PER_SEC | ||
335 | */ | ||
336 | if (unlikely(xtime.tv_nsec >= NSEC_PER_SEC)) { | ||
337 | + int leap; | ||
338 | xtime.tv_nsec -= NSEC_PER_SEC; | ||
339 | xtime.tv_sec++; | ||
340 | - second_overflow(); | ||
341 | + leap = second_overflow(xtime.tv_sec); | ||
342 | + xtime.tv_sec += leap; | ||
343 | + | ||
344 | } | ||
345 | |||
346 | /* check to see if there is a new clocksource to use */ | ||
347 | -- | ||
348 | 1.7.7.6 | ||
349 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0075-ntp-Correct-TAI-offset-during-leap-second.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0075-ntp-Correct-TAI-offset-during-leap-second.patch new file mode 100644 index 00000000..ec72a792 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0075-ntp-Correct-TAI-offset-during-leap-second.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 106227da17ad8a279e7e104b8592ada4e81dbd8b Mon Sep 17 00:00:00 2001 | ||
2 | From: Richard Cochran <richardcochran@gmail.com> | ||
3 | Date: Thu, 26 Apr 2012 14:11:32 +0200 | ||
4 | Subject: [PATCH 075/109] ntp: Correct TAI offset during leap second | ||
5 | |||
6 | commit dd48d708ff3e917f6d6b6c2b696c3f18c019feed upstream. | ||
7 | |||
8 | When repeating a UTC time value during a leap second (when the UTC | ||
9 | time should be 23:59:60), the TAI timescale should not stop. The kernel | ||
10 | NTP code increments the TAI offset one second too late. This patch fixes | ||
11 | the issue by incrementing the offset during the leap second itself. | ||
12 | |||
13 | Signed-off-by: Richard Cochran <richardcochran@gmail.com> | ||
14 | Signed-off-by: John Stultz <john.stultz@linaro.org> | ||
15 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
16 | --- | ||
17 | kernel/time/ntp.c | 2 +- | ||
18 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
19 | |||
20 | diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c | ||
21 | index 4508f7f..f1eb182 100644 | ||
22 | --- a/kernel/time/ntp.c | ||
23 | +++ b/kernel/time/ntp.c | ||
24 | @@ -378,6 +378,7 @@ int second_overflow(unsigned long secs) | ||
25 | if (secs % 86400 == 0) { | ||
26 | leap = -1; | ||
27 | time_state = TIME_OOP; | ||
28 | + time_tai++; | ||
29 | printk(KERN_NOTICE | ||
30 | "Clock: inserting leap second 23:59:60 UTC\n"); | ||
31 | } | ||
32 | @@ -392,7 +393,6 @@ int second_overflow(unsigned long secs) | ||
33 | } | ||
34 | break; | ||
35 | case TIME_OOP: | ||
36 | - time_tai++; | ||
37 | time_state = TIME_WAIT; | ||
38 | break; | ||
39 | |||
40 | -- | ||
41 | 1.7.7.6 | ||
42 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0076-timekeeping-Fix-CLOCK_MONOTONIC-inconsistency-during.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0076-timekeeping-Fix-CLOCK_MONOTONIC-inconsistency-during.patch new file mode 100644 index 00000000..cd6cd916 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0076-timekeeping-Fix-CLOCK_MONOTONIC-inconsistency-during.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From 7a063ddaad98f05f7976e0e8c9c1455cc9d0f5da Mon Sep 17 00:00:00 2001 | ||
2 | From: John Stultz <john.stultz@linaro.org> | ||
3 | Date: Wed, 30 May 2012 10:54:57 -0700 | ||
4 | Subject: [PATCH 076/109] timekeeping: Fix CLOCK_MONOTONIC inconsistency | ||
5 | during leapsecond | ||
6 | |||
7 | This is a backport of fad0c66c4bb836d57a5f125ecd38bed653ca863a | ||
8 | which resolves a bug the previous commit. | ||
9 | |||
10 | Commit 6b43ae8a61 (ntp: Fix leap-second hrtimer livelock) broke the | ||
11 | leapsecond update of CLOCK_MONOTONIC. The missing leapsecond update to | ||
12 | wall_to_monotonic causes discontinuities in CLOCK_MONOTONIC. | ||
13 | |||
14 | Adjust wall_to_monotonic when NTP inserted a leapsecond. | ||
15 | |||
16 | Reported-by: Richard Cochran <richardcochran@gmail.com> | ||
17 | Signed-off-by: John Stultz <john.stultz@linaro.org> | ||
18 | Tested-by: Richard Cochran <richardcochran@gmail.com> | ||
19 | Link: http://lkml.kernel.org/r/1338400497-12420-1-git-send-email-john.stultz@linaro.org | ||
20 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | ||
21 | Cc: Prarit Bhargava <prarit@redhat.com> | ||
22 | Cc: Thomas Gleixner <tglx@linutronix.de> | ||
23 | Cc: Linux Kernel <linux-kernel@vger.kernel.org> | ||
24 | Signed-off-by: John Stultz <johnstul@us.ibm.com> | ||
25 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
26 | --- | ||
27 | kernel/time/timekeeping.c | 3 ++- | ||
28 | 1 files changed, 2 insertions(+), 1 deletions(-) | ||
29 | |||
30 | diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c | ||
31 | index 4780a7d..5c9b67e 100644 | ||
32 | --- a/kernel/time/timekeeping.c | ||
33 | +++ b/kernel/time/timekeeping.c | ||
34 | @@ -938,6 +938,7 @@ static cycle_t logarithmic_accumulation(cycle_t offset, int shift) | ||
35 | xtime.tv_sec++; | ||
36 | leap = second_overflow(xtime.tv_sec); | ||
37 | xtime.tv_sec += leap; | ||
38 | + wall_to_monotonic.tv_sec -= leap; | ||
39 | } | ||
40 | |||
41 | /* Accumulate raw time */ | ||
42 | @@ -1048,7 +1049,7 @@ static void update_wall_time(void) | ||
43 | xtime.tv_sec++; | ||
44 | leap = second_overflow(xtime.tv_sec); | ||
45 | xtime.tv_sec += leap; | ||
46 | - | ||
47 | + wall_to_monotonic.tv_sec -= leap; | ||
48 | } | ||
49 | |||
50 | /* check to see if there is a new clocksource to use */ | ||
51 | -- | ||
52 | 1.7.7.6 | ||
53 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0077-time-Move-common-updates-to-a-function.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0077-time-Move-common-updates-to-a-function.patch new file mode 100644 index 00000000..792fe390 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0077-time-Move-common-updates-to-a-function.patch | |||
@@ -0,0 +1,99 @@ | |||
1 | From 540e83f9da352839ff29ce5445fc499de8d54570 Mon Sep 17 00:00:00 2001 | ||
2 | From: Thomas Gleixner <tglx@linutronix.de> | ||
3 | Date: Sun, 13 Nov 2011 23:19:49 +0000 | ||
4 | Subject: [PATCH 077/109] time: Move common updates to a function | ||
5 | |||
6 | This is a backport of cc06268c6a87db156af2daed6e96a936b955cc82 | ||
7 | |||
8 | [John Stultz: While not a bugfix itself, it allows following fixes | ||
9 | to backport in a more straightforward manner.] | ||
10 | |||
11 | CC: Thomas Gleixner <tglx@linutronix.de> | ||
12 | CC: Eric Dumazet <eric.dumazet@gmail.com> | ||
13 | CC: Richard Cochran <richardcochran@gmail.com> | ||
14 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | ||
15 | Cc: Prarit Bhargava <prarit@redhat.com> | ||
16 | Cc: Thomas Gleixner <tglx@linutronix.de> | ||
17 | Cc: Linux Kernel <linux-kernel@vger.kernel.org> | ||
18 | Signed-off-by: John Stultz <john.stultz@linaro.org> | ||
19 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
20 | --- | ||
21 | kernel/time/timekeeping.c | 34 +++++++++++++++++----------------- | ||
22 | 1 files changed, 17 insertions(+), 17 deletions(-) | ||
23 | |||
24 | diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c | ||
25 | index 5c9b67e..5d55185 100644 | ||
26 | --- a/kernel/time/timekeeping.c | ||
27 | +++ b/kernel/time/timekeeping.c | ||
28 | @@ -166,6 +166,19 @@ static struct timespec total_sleep_time; | ||
29 | */ | ||
30 | static struct timespec raw_time; | ||
31 | |||
32 | +/* must hold write on xtime_lock */ | ||
33 | +static void timekeeping_update(bool clearntp) | ||
34 | +{ | ||
35 | + if (clearntp) { | ||
36 | + timekeeper.ntp_error = 0; | ||
37 | + ntp_clear(); | ||
38 | + } | ||
39 | + update_vsyscall(&xtime, &wall_to_monotonic, | ||
40 | + timekeeper.clock, timekeeper.mult); | ||
41 | +} | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | /* flag for if timekeeping is suspended */ | ||
46 | int __read_mostly timekeeping_suspended; | ||
47 | |||
48 | @@ -366,11 +379,7 @@ int do_settimeofday(const struct timespec *tv) | ||
49 | |||
50 | xtime = *tv; | ||
51 | |||
52 | - timekeeper.ntp_error = 0; | ||
53 | - ntp_clear(); | ||
54 | - | ||
55 | - update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, | ||
56 | - timekeeper.mult); | ||
57 | + timekeeping_update(true); | ||
58 | |||
59 | write_sequnlock_irqrestore(&xtime_lock, flags); | ||
60 | |||
61 | @@ -403,11 +412,7 @@ int timekeeping_inject_offset(struct timespec *ts) | ||
62 | xtime = timespec_add(xtime, *ts); | ||
63 | wall_to_monotonic = timespec_sub(wall_to_monotonic, *ts); | ||
64 | |||
65 | - timekeeper.ntp_error = 0; | ||
66 | - ntp_clear(); | ||
67 | - | ||
68 | - update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, | ||
69 | - timekeeper.mult); | ||
70 | + timekeeping_update(true); | ||
71 | |||
72 | write_sequnlock_irqrestore(&xtime_lock, flags); | ||
73 | |||
74 | @@ -636,10 +641,7 @@ void timekeeping_inject_sleeptime(struct timespec *delta) | ||
75 | |||
76 | __timekeeping_inject_sleeptime(delta); | ||
77 | |||
78 | - timekeeper.ntp_error = 0; | ||
79 | - ntp_clear(); | ||
80 | - update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, | ||
81 | - timekeeper.mult); | ||
82 | + timekeeping_update(true); | ||
83 | |||
84 | write_sequnlock_irqrestore(&xtime_lock, flags); | ||
85 | |||
86 | @@ -1052,9 +1054,7 @@ static void update_wall_time(void) | ||
87 | wall_to_monotonic.tv_sec -= leap; | ||
88 | } | ||
89 | |||
90 | - /* check to see if there is a new clocksource to use */ | ||
91 | - update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, | ||
92 | - timekeeper.mult); | ||
93 | + timekeeping_update(false); | ||
94 | } | ||
95 | |||
96 | /** | ||
97 | -- | ||
98 | 1.7.7.6 | ||
99 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0078-hrtimer-Provide-clock_was_set_delayed.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0078-hrtimer-Provide-clock_was_set_delayed.patch new file mode 100644 index 00000000..90b76394 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0078-hrtimer-Provide-clock_was_set_delayed.patch | |||
@@ -0,0 +1,118 @@ | |||
1 | From b6da5d5a3a7e128fd17b15dc64fda7c1aea694e6 Mon Sep 17 00:00:00 2001 | ||
2 | From: John Stultz <johnstul@us.ibm.com> | ||
3 | Date: Tue, 10 Jul 2012 18:43:19 -0400 | ||
4 | Subject: [PATCH 078/109] hrtimer: Provide clock_was_set_delayed() | ||
5 | |||
6 | commit f55a6faa384304c89cfef162768e88374d3312cb upstream. | ||
7 | |||
8 | clock_was_set() cannot be called from hard interrupt context because | ||
9 | it calls on_each_cpu(). | ||
10 | |||
11 | For fixing the widely reported leap seconds issue it is necessary to | ||
12 | call it from hard interrupt context, i.e. the timer tick code, which | ||
13 | does the timekeeping updates. | ||
14 | |||
15 | Provide a new function which denotes it in the hrtimer cpu base | ||
16 | structure of the cpu on which it is called and raise the hrtimer | ||
17 | softirq. We then execute the clock_was_set() notificiation from | ||
18 | softirq context in run_hrtimer_softirq(). The hrtimer softirq is | ||
19 | rarely used, so polling the flag there is not a performance issue. | ||
20 | |||
21 | [ tglx: Made it depend on CONFIG_HIGH_RES_TIMERS. We really should get | ||
22 | rid of all this ifdeffery ASAP ] | ||
23 | |||
24 | Signed-off-by: John Stultz <johnstul@us.ibm.com> | ||
25 | Reported-by: Jan Engelhardt <jengelh@inai.de> | ||
26 | Reviewed-by: Ingo Molnar <mingo@kernel.org> | ||
27 | Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> | ||
28 | Acked-by: Prarit Bhargava <prarit@redhat.com> | ||
29 | Link: http://lkml.kernel.org/r/1341960205-56738-2-git-send-email-johnstul@us.ibm.com | ||
30 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | ||
31 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
32 | --- | ||
33 | include/linux/hrtimer.h | 9 ++++++++- | ||
34 | kernel/hrtimer.c | 20 ++++++++++++++++++++ | ||
35 | 2 files changed, 28 insertions(+), 1 deletions(-) | ||
36 | |||
37 | diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h | ||
38 | index fd0dc30..c9ec940 100644 | ||
39 | --- a/include/linux/hrtimer.h | ||
40 | +++ b/include/linux/hrtimer.h | ||
41 | @@ -165,6 +165,7 @@ enum hrtimer_base_type { | ||
42 | * @lock: lock protecting the base and associated clock bases | ||
43 | * and timers | ||
44 | * @active_bases: Bitfield to mark bases with active timers | ||
45 | + * @clock_was_set: Indicates that clock was set from irq context. | ||
46 | * @expires_next: absolute time of the next event which was scheduled | ||
47 | * via clock_set_next_event() | ||
48 | * @hres_active: State of high resolution mode | ||
49 | @@ -177,7 +178,8 @@ enum hrtimer_base_type { | ||
50 | */ | ||
51 | struct hrtimer_cpu_base { | ||
52 | raw_spinlock_t lock; | ||
53 | - unsigned long active_bases; | ||
54 | + unsigned int active_bases; | ||
55 | + unsigned int clock_was_set; | ||
56 | #ifdef CONFIG_HIGH_RES_TIMERS | ||
57 | ktime_t expires_next; | ||
58 | int hres_active; | ||
59 | @@ -286,6 +288,8 @@ extern void hrtimer_peek_ahead_timers(void); | ||
60 | # define MONOTONIC_RES_NSEC HIGH_RES_NSEC | ||
61 | # define KTIME_MONOTONIC_RES KTIME_HIGH_RES | ||
62 | |||
63 | +extern void clock_was_set_delayed(void); | ||
64 | + | ||
65 | #else | ||
66 | |||
67 | # define MONOTONIC_RES_NSEC LOW_RES_NSEC | ||
68 | @@ -306,6 +310,9 @@ static inline int hrtimer_is_hres_active(struct hrtimer *timer) | ||
69 | { | ||
70 | return 0; | ||
71 | } | ||
72 | + | ||
73 | +static inline void clock_was_set_delayed(void) { } | ||
74 | + | ||
75 | #endif | ||
76 | |||
77 | extern void clock_was_set(void); | ||
78 | diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c | ||
79 | index ae34bf5..3c24fb2 100644 | ||
80 | --- a/kernel/hrtimer.c | ||
81 | +++ b/kernel/hrtimer.c | ||
82 | @@ -717,6 +717,19 @@ static int hrtimer_switch_to_hres(void) | ||
83 | return 1; | ||
84 | } | ||
85 | |||
86 | +/* | ||
87 | + * Called from timekeeping code to reprogramm the hrtimer interrupt | ||
88 | + * device. If called from the timer interrupt context we defer it to | ||
89 | + * softirq context. | ||
90 | + */ | ||
91 | +void clock_was_set_delayed(void) | ||
92 | +{ | ||
93 | + struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases); | ||
94 | + | ||
95 | + cpu_base->clock_was_set = 1; | ||
96 | + __raise_softirq_irqoff(HRTIMER_SOFTIRQ); | ||
97 | +} | ||
98 | + | ||
99 | #else | ||
100 | |||
101 | static inline int hrtimer_hres_active(void) { return 0; } | ||
102 | @@ -1395,6 +1408,13 @@ void hrtimer_peek_ahead_timers(void) | ||
103 | |||
104 | static void run_hrtimer_softirq(struct softirq_action *h) | ||
105 | { | ||
106 | + struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases); | ||
107 | + | ||
108 | + if (cpu_base->clock_was_set) { | ||
109 | + cpu_base->clock_was_set = 0; | ||
110 | + clock_was_set(); | ||
111 | + } | ||
112 | + | ||
113 | hrtimer_peek_ahead_timers(); | ||
114 | } | ||
115 | |||
116 | -- | ||
117 | 1.7.7.6 | ||
118 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0079-timekeeping-Fix-leapsecond-triggered-load-spike-issu.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0079-timekeeping-Fix-leapsecond-triggered-load-spike-issu.patch new file mode 100644 index 00000000..8965a592 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0079-timekeeping-Fix-leapsecond-triggered-load-spike-issu.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | From 61642041369832a7f8d29d27fcd9e88d523f3163 Mon Sep 17 00:00:00 2001 | ||
2 | From: John Stultz <johnstul@us.ibm.com> | ||
3 | Date: Tue, 10 Jul 2012 18:43:20 -0400 | ||
4 | Subject: [PATCH 079/109] timekeeping: Fix leapsecond triggered load spike | ||
5 | issue | ||
6 | |||
7 | This is a backport of 4873fa070ae84a4115f0b3c9dfabc224f1bc7c51 | ||
8 | |||
9 | The timekeeping code misses an update of the hrtimer subsystem after a | ||
10 | leap second happened. Due to that timers based on CLOCK_REALTIME are | ||
11 | either expiring a second early or late depending on whether a leap | ||
12 | second has been inserted or deleted until an operation is initiated | ||
13 | which causes that update. Unless the update happens by some other | ||
14 | means this discrepancy between the timekeeping and the hrtimer data | ||
15 | stays forever and timers are expired either early or late. | ||
16 | |||
17 | The reported immediate workaround - $ data -s "`date`" - is causing a | ||
18 | call to clock_was_set() which updates the hrtimer data structures. | ||
19 | See: http://www.sheeri.com/content/mysql-and-leap-second-high-cpu-and-fix | ||
20 | |||
21 | Add the missing clock_was_set() call to update_wall_time() in case of | ||
22 | a leap second event. The actual update is deferred to softirq context | ||
23 | as the necessary smp function call cannot be invoked from hard | ||
24 | interrupt context. | ||
25 | |||
26 | Signed-off-by: John Stultz <johnstul@us.ibm.com> | ||
27 | Reported-by: Jan Engelhardt <jengelh@inai.de> | ||
28 | Reviewed-by: Ingo Molnar <mingo@kernel.org> | ||
29 | Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> | ||
30 | Acked-by: Prarit Bhargava <prarit@redhat.com> | ||
31 | Link: http://lkml.kernel.org/r/1341960205-56738-3-git-send-email-johnstul@us.ibm.com | ||
32 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | ||
33 | Cc: Prarit Bhargava <prarit@redhat.com> | ||
34 | Cc: Thomas Gleixner <tglx@linutronix.de> | ||
35 | Cc: Linux Kernel <linux-kernel@vger.kernel.org> | ||
36 | Signed-off-by: John Stultz <johnstul@us.ibm.com> | ||
37 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
38 | --- | ||
39 | kernel/time/timekeeping.c | 4 ++++ | ||
40 | 1 files changed, 4 insertions(+), 0 deletions(-) | ||
41 | |||
42 | diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c | ||
43 | index 5d55185..8958ad7 100644 | ||
44 | --- a/kernel/time/timekeeping.c | ||
45 | +++ b/kernel/time/timekeeping.c | ||
46 | @@ -941,6 +941,8 @@ static cycle_t logarithmic_accumulation(cycle_t offset, int shift) | ||
47 | leap = second_overflow(xtime.tv_sec); | ||
48 | xtime.tv_sec += leap; | ||
49 | wall_to_monotonic.tv_sec -= leap; | ||
50 | + if (leap) | ||
51 | + clock_was_set_delayed(); | ||
52 | } | ||
53 | |||
54 | /* Accumulate raw time */ | ||
55 | @@ -1052,6 +1054,8 @@ static void update_wall_time(void) | ||
56 | leap = second_overflow(xtime.tv_sec); | ||
57 | xtime.tv_sec += leap; | ||
58 | wall_to_monotonic.tv_sec -= leap; | ||
59 | + if (leap) | ||
60 | + clock_was_set_delayed(); | ||
61 | } | ||
62 | |||
63 | timekeeping_update(false); | ||
64 | -- | ||
65 | 1.7.7.6 | ||
66 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0080-timekeeping-Maintain-ktime_t-based-offsets-for-hrtim.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0080-timekeeping-Maintain-ktime_t-based-offsets-for-hrtim.patch new file mode 100644 index 00000000..f00962df --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0080-timekeeping-Maintain-ktime_t-based-offsets-for-hrtim.patch | |||
@@ -0,0 +1,104 @@ | |||
1 | From 711cebfd4050d5a41606f9f8ad56986d0377df08 Mon Sep 17 00:00:00 2001 | ||
2 | From: Thomas Gleixner <tglx@linutronix.de> | ||
3 | Date: Tue, 10 Jul 2012 18:43:21 -0400 | ||
4 | Subject: [PATCH 080/109] timekeeping: Maintain ktime_t based offsets for | ||
5 | hrtimers | ||
6 | |||
7 | This is a backport of 5b9fe759a678e05be4937ddf03d50e950207c1c0 | ||
8 | |||
9 | We need to update the hrtimer clock offsets from the hrtimer interrupt | ||
10 | context. To avoid conversions from timespec to ktime_t maintain a | ||
11 | ktime_t based representation of those offsets in the timekeeper. This | ||
12 | puts the conversion overhead into the code which updates the | ||
13 | underlying offsets and provides fast accessible values in the hrtimer | ||
14 | interrupt. | ||
15 | |||
16 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | ||
17 | Signed-off-by: John Stultz <johnstul@us.ibm.com> | ||
18 | Reviewed-by: Ingo Molnar <mingo@kernel.org> | ||
19 | Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> | ||
20 | Acked-by: Prarit Bhargava <prarit@redhat.com> | ||
21 | Link: http://lkml.kernel.org/r/1341960205-56738-4-git-send-email-johnstul@us.ibm.com | ||
22 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | ||
23 | [John Stultz: Backported to 3.2] | ||
24 | Cc: Prarit Bhargava <prarit@redhat.com> | ||
25 | Cc: Thomas Gleixner <tglx@linutronix.de> | ||
26 | Cc: Linux Kernel <linux-kernel@vger.kernel.org> | ||
27 | Signed-off-by: John Stultz <johnstul@us.ibm.com> | ||
28 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
29 | --- | ||
30 | kernel/time/timekeeping.c | 25 ++++++++++++++++++++++++- | ||
31 | 1 files changed, 24 insertions(+), 1 deletions(-) | ||
32 | |||
33 | diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c | ||
34 | index 8958ad7..d5d0e5d 100644 | ||
35 | --- a/kernel/time/timekeeping.c | ||
36 | +++ b/kernel/time/timekeeping.c | ||
37 | @@ -161,18 +161,34 @@ static struct timespec xtime __attribute__ ((aligned (16))); | ||
38 | static struct timespec wall_to_monotonic __attribute__ ((aligned (16))); | ||
39 | static struct timespec total_sleep_time; | ||
40 | |||
41 | +/* Offset clock monotonic -> clock realtime */ | ||
42 | +static ktime_t offs_real; | ||
43 | + | ||
44 | +/* Offset clock monotonic -> clock boottime */ | ||
45 | +static ktime_t offs_boot; | ||
46 | + | ||
47 | /* | ||
48 | * The raw monotonic time for the CLOCK_MONOTONIC_RAW posix clock. | ||
49 | */ | ||
50 | static struct timespec raw_time; | ||
51 | |||
52 | /* must hold write on xtime_lock */ | ||
53 | +static void update_rt_offset(void) | ||
54 | +{ | ||
55 | + struct timespec tmp, *wtm = &wall_to_monotonic; | ||
56 | + | ||
57 | + set_normalized_timespec(&tmp, -wtm->tv_sec, -wtm->tv_nsec); | ||
58 | + offs_real = timespec_to_ktime(tmp); | ||
59 | +} | ||
60 | + | ||
61 | +/* must hold write on xtime_lock */ | ||
62 | static void timekeeping_update(bool clearntp) | ||
63 | { | ||
64 | if (clearntp) { | ||
65 | timekeeper.ntp_error = 0; | ||
66 | ntp_clear(); | ||
67 | } | ||
68 | + update_rt_offset(); | ||
69 | update_vsyscall(&xtime, &wall_to_monotonic, | ||
70 | timekeeper.clock, timekeeper.mult); | ||
71 | } | ||
72 | @@ -587,6 +603,7 @@ void __init timekeeping_init(void) | ||
73 | } | ||
74 | set_normalized_timespec(&wall_to_monotonic, | ||
75 | -boot.tv_sec, -boot.tv_nsec); | ||
76 | + update_rt_offset(); | ||
77 | total_sleep_time.tv_sec = 0; | ||
78 | total_sleep_time.tv_nsec = 0; | ||
79 | write_sequnlock_irqrestore(&xtime_lock, flags); | ||
80 | @@ -595,6 +612,12 @@ void __init timekeeping_init(void) | ||
81 | /* time in seconds when suspend began */ | ||
82 | static struct timespec timekeeping_suspend_time; | ||
83 | |||
84 | +static void update_sleep_time(struct timespec t) | ||
85 | +{ | ||
86 | + total_sleep_time = t; | ||
87 | + offs_boot = timespec_to_ktime(t); | ||
88 | +} | ||
89 | + | ||
90 | /** | ||
91 | * __timekeeping_inject_sleeptime - Internal function to add sleep interval | ||
92 | * @delta: pointer to a timespec delta value | ||
93 | @@ -612,7 +635,7 @@ static void __timekeeping_inject_sleeptime(struct timespec *delta) | ||
94 | |||
95 | xtime = timespec_add(xtime, *delta); | ||
96 | wall_to_monotonic = timespec_sub(wall_to_monotonic, *delta); | ||
97 | - total_sleep_time = timespec_add(total_sleep_time, *delta); | ||
98 | + update_sleep_time(timespec_add(total_sleep_time, *delta)); | ||
99 | } | ||
100 | |||
101 | |||
102 | -- | ||
103 | 1.7.7.6 | ||
104 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0081-hrtimers-Move-lock-held-region-in-hrtimer_interrupt.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0081-hrtimers-Move-lock-held-region-in-hrtimer_interrupt.patch new file mode 100644 index 00000000..5444d540 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0081-hrtimers-Move-lock-held-region-in-hrtimer_interrupt.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From 6783d1f7e46f4450b489d970bbf4d62db9296c1f Mon Sep 17 00:00:00 2001 | ||
2 | From: Thomas Gleixner <tglx@linutronix.de> | ||
3 | Date: Tue, 10 Jul 2012 18:43:23 -0400 | ||
4 | Subject: [PATCH 081/109] hrtimers: Move lock held region in | ||
5 | hrtimer_interrupt() | ||
6 | |||
7 | commit 196951e91262fccda81147d2bcf7fdab08668b40 upstream. | ||
8 | |||
9 | We need to update the base offsets from this code and we need to do | ||
10 | that under base->lock. Move the lock held region around the | ||
11 | ktime_get() calls. The ktime_get() calls are going to be replaced with | ||
12 | a function which gets the time and the offsets atomically. | ||
13 | |||
14 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | ||
15 | Reviewed-by: Ingo Molnar <mingo@kernel.org> | ||
16 | Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> | ||
17 | Acked-by: Prarit Bhargava <prarit@redhat.com> | ||
18 | Signed-off-by: John Stultz <johnstul@us.ibm.com> | ||
19 | Link: http://lkml.kernel.org/r/1341960205-56738-6-git-send-email-johnstul@us.ibm.com | ||
20 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | ||
21 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
22 | --- | ||
23 | kernel/hrtimer.c | 5 +++-- | ||
24 | 1 files changed, 3 insertions(+), 2 deletions(-) | ||
25 | |||
26 | diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c | ||
27 | index 3c24fb2..8f320af 100644 | ||
28 | --- a/kernel/hrtimer.c | ||
29 | +++ b/kernel/hrtimer.c | ||
30 | @@ -1263,11 +1263,10 @@ void hrtimer_interrupt(struct clock_event_device *dev) | ||
31 | cpu_base->nr_events++; | ||
32 | dev->next_event.tv64 = KTIME_MAX; | ||
33 | |||
34 | + raw_spin_lock(&cpu_base->lock); | ||
35 | entry_time = now = ktime_get(); | ||
36 | retry: | ||
37 | expires_next.tv64 = KTIME_MAX; | ||
38 | - | ||
39 | - raw_spin_lock(&cpu_base->lock); | ||
40 | /* | ||
41 | * We set expires_next to KTIME_MAX here with cpu_base->lock | ||
42 | * held to prevent that a timer is enqueued in our queue via | ||
43 | @@ -1344,6 +1343,7 @@ retry: | ||
44 | * interrupt routine. We give it 3 attempts to avoid | ||
45 | * overreacting on some spurious event. | ||
46 | */ | ||
47 | + raw_spin_lock(&cpu_base->lock); | ||
48 | now = ktime_get(); | ||
49 | cpu_base->nr_retries++; | ||
50 | if (++retries < 3) | ||
51 | @@ -1356,6 +1356,7 @@ retry: | ||
52 | */ | ||
53 | cpu_base->nr_hangs++; | ||
54 | cpu_base->hang_detected = 1; | ||
55 | + raw_spin_unlock(&cpu_base->lock); | ||
56 | delta = ktime_sub(now, entry_time); | ||
57 | if (delta.tv64 > cpu_base->max_hang_time.tv64) | ||
58 | cpu_base->max_hang_time = delta; | ||
59 | -- | ||
60 | 1.7.7.6 | ||
61 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0082-timekeeping-Provide-hrtimer-update-function.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0082-timekeeping-Provide-hrtimer-update-function.patch new file mode 100644 index 00000000..a9735408 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0082-timekeeping-Provide-hrtimer-update-function.patch | |||
@@ -0,0 +1,94 @@ | |||
1 | From d6cadfb2bf29a5913562d3f63c49a937bc98540d Mon Sep 17 00:00:00 2001 | ||
2 | From: Thomas Gleixner <tglx@linutronix.de> | ||
3 | Date: Tue, 10 Jul 2012 18:43:24 -0400 | ||
4 | Subject: [PATCH 082/109] timekeeping: Provide hrtimer update function | ||
5 | |||
6 | This is a backport of f6c06abfb3972ad4914cef57d8348fcb2932bc3b | ||
7 | |||
8 | To finally fix the infamous leap second issue and other race windows | ||
9 | caused by functions which change the offsets between the various time | ||
10 | bases (CLOCK_MONOTONIC, CLOCK_REALTIME and CLOCK_BOOTTIME) we need a | ||
11 | function which atomically gets the current monotonic time and updates | ||
12 | the offsets of CLOCK_REALTIME and CLOCK_BOOTTIME with minimalistic | ||
13 | overhead. The previous patch which provides ktime_t offsets allows us | ||
14 | to make this function almost as cheap as ktime_get() which is going to | ||
15 | be replaced in hrtimer_interrupt(). | ||
16 | |||
17 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | ||
18 | Reviewed-by: Ingo Molnar <mingo@kernel.org> | ||
19 | Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> | ||
20 | Acked-by: Prarit Bhargava <prarit@redhat.com> | ||
21 | Signed-off-by: John Stultz <johnstul@us.ibm.com> | ||
22 | Link: http://lkml.kernel.org/r/1341960205-56738-7-git-send-email-johnstul@us.ibm.com | ||
23 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | ||
24 | [John Stultz: Backported to 3.2] | ||
25 | Cc: Prarit Bhargava <prarit@redhat.com> | ||
26 | Cc: Thomas Gleixner <tglx@linutronix.de> | ||
27 | Cc: Linux Kernel <linux-kernel@vger.kernel.org> | ||
28 | Signed-off-by: John Stultz <johnstul@us.ibm.com> | ||
29 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
30 | --- | ||
31 | include/linux/hrtimer.h | 1 + | ||
32 | kernel/time/timekeeping.c | 34 ++++++++++++++++++++++++++++++++++ | ||
33 | 2 files changed, 35 insertions(+), 0 deletions(-) | ||
34 | |||
35 | diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h | ||
36 | index c9ec940..cc07d27 100644 | ||
37 | --- a/include/linux/hrtimer.h | ||
38 | +++ b/include/linux/hrtimer.h | ||
39 | @@ -327,6 +327,7 @@ extern ktime_t ktime_get(void); | ||
40 | extern ktime_t ktime_get_real(void); | ||
41 | extern ktime_t ktime_get_boottime(void); | ||
42 | extern ktime_t ktime_get_monotonic_offset(void); | ||
43 | +extern ktime_t ktime_get_update_offsets(ktime_t *offs_real, ktime_t *offs_boot); | ||
44 | |||
45 | DECLARE_PER_CPU(struct tick_device, tick_cpu_device); | ||
46 | |||
47 | diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c | ||
48 | index d5d0e5d..4938c5e 100644 | ||
49 | --- a/kernel/time/timekeeping.c | ||
50 | +++ b/kernel/time/timekeeping.c | ||
51 | @@ -1240,6 +1240,40 @@ void get_xtime_and_monotonic_and_sleep_offset(struct timespec *xtim, | ||
52 | } while (read_seqretry(&xtime_lock, seq)); | ||
53 | } | ||
54 | |||
55 | +#ifdef CONFIG_HIGH_RES_TIMERS | ||
56 | +/** | ||
57 | + * ktime_get_update_offsets - hrtimer helper | ||
58 | + * @real: pointer to storage for monotonic -> realtime offset | ||
59 | + * @_boot: pointer to storage for monotonic -> boottime offset | ||
60 | + * | ||
61 | + * Returns current monotonic time and updates the offsets | ||
62 | + * Called from hrtimer_interupt() or retrigger_next_event() | ||
63 | + */ | ||
64 | +ktime_t ktime_get_update_offsets(ktime_t *real, ktime_t *boot) | ||
65 | +{ | ||
66 | + ktime_t now; | ||
67 | + unsigned int seq; | ||
68 | + u64 secs, nsecs; | ||
69 | + | ||
70 | + do { | ||
71 | + seq = read_seqbegin(&xtime_lock); | ||
72 | + | ||
73 | + secs = xtime.tv_sec; | ||
74 | + nsecs = xtime.tv_nsec; | ||
75 | + nsecs += timekeeping_get_ns(); | ||
76 | + /* If arch requires, add in gettimeoffset() */ | ||
77 | + nsecs += arch_gettimeoffset(); | ||
78 | + | ||
79 | + *real = offs_real; | ||
80 | + *boot = offs_boot; | ||
81 | + } while (read_seqretry(&xtime_lock, seq)); | ||
82 | + | ||
83 | + now = ktime_add_ns(ktime_set(secs, 0), nsecs); | ||
84 | + now = ktime_sub(now, *real); | ||
85 | + return now; | ||
86 | +} | ||
87 | +#endif | ||
88 | + | ||
89 | /** | ||
90 | * ktime_get_monotonic_offset() - get wall_to_monotonic in ktime_t format | ||
91 | */ | ||
92 | -- | ||
93 | 1.7.7.6 | ||
94 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0083-hrtimer-Update-hrtimer-base-offsets-each-hrtimer_int.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0083-hrtimer-Update-hrtimer-base-offsets-each-hrtimer_int.patch new file mode 100644 index 00000000..d047f31b --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0083-hrtimer-Update-hrtimer-base-offsets-each-hrtimer_int.patch | |||
@@ -0,0 +1,125 @@ | |||
1 | From 532c526ac9349430b41f6a16f32fc808c4270647 Mon Sep 17 00:00:00 2001 | ||
2 | From: John Stultz <johnstul@us.ibm.com> | ||
3 | Date: Tue, 10 Jul 2012 18:43:25 -0400 | ||
4 | Subject: [PATCH 083/109] hrtimer: Update hrtimer base offsets each | ||
5 | hrtimer_interrupt | ||
6 | |||
7 | commit 5baefd6d84163443215f4a99f6a20f054ef11236 upstream. | ||
8 | |||
9 | The update of the hrtimer base offsets on all cpus cannot be made | ||
10 | atomically from the timekeeper.lock held and interrupt disabled region | ||
11 | as smp function calls are not allowed there. | ||
12 | |||
13 | clock_was_set(), which enforces the update on all cpus, is called | ||
14 | either from preemptible process context in case of do_settimeofday() | ||
15 | or from the softirq context when the offset modification happened in | ||
16 | the timer interrupt itself due to a leap second. | ||
17 | |||
18 | In both cases there is a race window for an hrtimer interrupt between | ||
19 | dropping timekeeper lock, enabling interrupts and clock_was_set() | ||
20 | issuing the updates. Any interrupt which arrives in that window will | ||
21 | see the new time but operate on stale offsets. | ||
22 | |||
23 | So we need to make sure that an hrtimer interrupt always sees a | ||
24 | consistent state of time and offsets. | ||
25 | |||
26 | ktime_get_update_offsets() allows us to get the current monotonic time | ||
27 | and update the per cpu hrtimer base offsets from hrtimer_interrupt() | ||
28 | to capture a consistent state of monotonic time and the offsets. The | ||
29 | function replaces the existing ktime_get() calls in hrtimer_interrupt(). | ||
30 | |||
31 | The overhead of the new function vs. ktime_get() is minimal as it just | ||
32 | adds two store operations. | ||
33 | |||
34 | This ensures that any changes to realtime or boottime offsets are | ||
35 | noticed and stored into the per-cpu hrtimer base structures, prior to | ||
36 | any hrtimer expiration and guarantees that timers are not expired early. | ||
37 | |||
38 | Signed-off-by: John Stultz <johnstul@us.ibm.com> | ||
39 | Reviewed-by: Ingo Molnar <mingo@kernel.org> | ||
40 | Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> | ||
41 | Acked-by: Prarit Bhargava <prarit@redhat.com> | ||
42 | Link: http://lkml.kernel.org/r/1341960205-56738-8-git-send-email-johnstul@us.ibm.com | ||
43 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | ||
44 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
45 | --- | ||
46 | kernel/hrtimer.c | 28 ++++++++++++++-------------- | ||
47 | 1 files changed, 14 insertions(+), 14 deletions(-) | ||
48 | |||
49 | diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c | ||
50 | index 8f320af..6db7a5e 100644 | ||
51 | --- a/kernel/hrtimer.c | ||
52 | +++ b/kernel/hrtimer.c | ||
53 | @@ -657,6 +657,14 @@ static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer, | ||
54 | return 0; | ||
55 | } | ||
56 | |||
57 | +static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) | ||
58 | +{ | ||
59 | + ktime_t *offs_real = &base->clock_base[HRTIMER_BASE_REALTIME].offset; | ||
60 | + ktime_t *offs_boot = &base->clock_base[HRTIMER_BASE_BOOTTIME].offset; | ||
61 | + | ||
62 | + return ktime_get_update_offsets(offs_real, offs_boot); | ||
63 | +} | ||
64 | + | ||
65 | /* | ||
66 | * Retrigger next event is called after clock was set | ||
67 | * | ||
68 | @@ -665,22 +673,12 @@ static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer, | ||
69 | static void retrigger_next_event(void *arg) | ||
70 | { | ||
71 | struct hrtimer_cpu_base *base = &__get_cpu_var(hrtimer_bases); | ||
72 | - struct timespec realtime_offset, xtim, wtm, sleep; | ||
73 | |||
74 | if (!hrtimer_hres_active()) | ||
75 | return; | ||
76 | |||
77 | - /* Optimized out for !HIGH_RES */ | ||
78 | - get_xtime_and_monotonic_and_sleep_offset(&xtim, &wtm, &sleep); | ||
79 | - set_normalized_timespec(&realtime_offset, -wtm.tv_sec, -wtm.tv_nsec); | ||
80 | - | ||
81 | - /* Adjust CLOCK_REALTIME offset */ | ||
82 | raw_spin_lock(&base->lock); | ||
83 | - base->clock_base[HRTIMER_BASE_REALTIME].offset = | ||
84 | - timespec_to_ktime(realtime_offset); | ||
85 | - base->clock_base[HRTIMER_BASE_BOOTTIME].offset = | ||
86 | - timespec_to_ktime(sleep); | ||
87 | - | ||
88 | + hrtimer_update_base(base); | ||
89 | hrtimer_force_reprogram(base, 0); | ||
90 | raw_spin_unlock(&base->lock); | ||
91 | } | ||
92 | @@ -710,7 +708,6 @@ static int hrtimer_switch_to_hres(void) | ||
93 | base->clock_base[i].resolution = KTIME_HIGH_RES; | ||
94 | |||
95 | tick_setup_sched_timer(); | ||
96 | - | ||
97 | /* "Retrigger" the interrupt to get things going */ | ||
98 | retrigger_next_event(NULL); | ||
99 | local_irq_restore(flags); | ||
100 | @@ -1264,7 +1261,7 @@ void hrtimer_interrupt(struct clock_event_device *dev) | ||
101 | dev->next_event.tv64 = KTIME_MAX; | ||
102 | |||
103 | raw_spin_lock(&cpu_base->lock); | ||
104 | - entry_time = now = ktime_get(); | ||
105 | + entry_time = now = hrtimer_update_base(cpu_base); | ||
106 | retry: | ||
107 | expires_next.tv64 = KTIME_MAX; | ||
108 | /* | ||
109 | @@ -1342,9 +1339,12 @@ retry: | ||
110 | * We need to prevent that we loop forever in the hrtimer | ||
111 | * interrupt routine. We give it 3 attempts to avoid | ||
112 | * overreacting on some spurious event. | ||
113 | + * | ||
114 | + * Acquire base lock for updating the offsets and retrieving | ||
115 | + * the current time. | ||
116 | */ | ||
117 | raw_spin_lock(&cpu_base->lock); | ||
118 | - now = ktime_get(); | ||
119 | + now = hrtimer_update_base(cpu_base); | ||
120 | cpu_base->nr_retries++; | ||
121 | if (++retries < 3) | ||
122 | goto retry; | ||
123 | -- | ||
124 | 1.7.7.6 | ||
125 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0084-timekeeping-Add-missing-update-call-in-timekeeping_r.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0084-timekeeping-Add-missing-update-call-in-timekeeping_r.patch new file mode 100644 index 00000000..06445f04 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0084-timekeeping-Add-missing-update-call-in-timekeeping_r.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | From 666e725f56fc4c9a6e4f0e00b5a180866863f724 Mon Sep 17 00:00:00 2001 | ||
2 | From: Thomas Gleixner <tglx@linutronix.de> | ||
3 | Date: Mon, 16 Jul 2012 12:50:42 -0400 | ||
4 | Subject: [PATCH 084/109] timekeeping: Add missing update call in | ||
5 | timekeeping_resume() | ||
6 | |||
7 | This is a backport of 3e997130bd2e8c6f5aaa49d6e3161d4d29b43ab0 | ||
8 | |||
9 | The leap second rework unearthed another issue of inconsistent data. | ||
10 | |||
11 | On timekeeping_resume() the timekeeper data is updated, but nothing | ||
12 | calls timekeeping_update(), so now the update code in the timer | ||
13 | interrupt sees stale values. | ||
14 | |||
15 | This has been the case before those changes, but then the timer | ||
16 | interrupt was using stale data as well so this went unnoticed for quite | ||
17 | some time. | ||
18 | |||
19 | Add the missing update call, so all the data is consistent everywhere. | ||
20 | |||
21 | Reported-by: Andreas Schwab <schwab@linux-m68k.org> | ||
22 | Reported-and-tested-by: "Rafael J. Wysocki" <rjw@sisk.pl> | ||
23 | Reported-and-tested-by: Martin Steigerwald <Martin@lichtvoll.de> | ||
24 | Cc: LKML <linux-kernel@vger.kernel.org> | ||
25 | Cc: Linux PM list <linux-pm@vger.kernel.org> | ||
26 | Cc: John Stultz <johnstul@us.ibm.com> | ||
27 | Cc: Ingo Molnar <mingo@kernel.org> | ||
28 | Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>, | ||
29 | Cc: Prarit Bhargava <prarit@redhat.com> | ||
30 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | ||
31 | Signed-off-by: John Stultz <johnstul@us.ibm.com> | ||
32 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
33 | [John Stultz: Backported to 3.2] | ||
34 | Cc: Prarit Bhargava <prarit@redhat.com> | ||
35 | Cc: Thomas Gleixner <tglx@linutronix.de> | ||
36 | Cc: Linux Kernel <linux-kernel@vger.kernel.org> | ||
37 | Signed-off-by: John Stultz <johnstul@us.ibm.com> | ||
38 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
39 | --- | ||
40 | kernel/time/timekeeping.c | 1 + | ||
41 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
42 | |||
43 | diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c | ||
44 | index 4938c5e..03e67d4 100644 | ||
45 | --- a/kernel/time/timekeeping.c | ||
46 | +++ b/kernel/time/timekeeping.c | ||
47 | @@ -699,6 +699,7 @@ static void timekeeping_resume(void) | ||
48 | timekeeper.clock->cycle_last = timekeeper.clock->read(timekeeper.clock); | ||
49 | timekeeper.ntp_error = 0; | ||
50 | timekeeping_suspended = 0; | ||
51 | + timekeeping_update(false); | ||
52 | write_sequnlock_irqrestore(&xtime_lock, flags); | ||
53 | |||
54 | touch_softlockup_watchdog(); | ||
55 | -- | ||
56 | 1.7.7.6 | ||
57 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0085-powerpc-Fix-wrong-divisor-in-usecs_to_cputime.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0085-powerpc-Fix-wrong-divisor-in-usecs_to_cputime.patch new file mode 100644 index 00000000..eb4249f4 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0085-powerpc-Fix-wrong-divisor-in-usecs_to_cputime.patch | |||
@@ -0,0 +1,87 @@ | |||
1 | From ec9436c865d11ebd0fd6909a9ef2a63e5536ff29 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andreas Schwab <schwab@linux-m68k.org> | ||
3 | Date: Fri, 9 Dec 2011 11:35:08 +0000 | ||
4 | Subject: [PATCH 085/109] powerpc: Fix wrong divisor in usecs_to_cputime | ||
5 | |||
6 | commit 9f5072d4f63f28d30d343573830ac6c85fc0deff upstream. | ||
7 | |||
8 | Commit d57af9b (taskstats: use real microsecond granularity for CPU times) | ||
9 | renamed msecs_to_cputime to usecs_to_cputime, but failed to update all | ||
10 | numbers on the way. This causes nonsensical cpu idle/iowait values to be | ||
11 | displayed in /proc/stat (the only user of usecs_to_cputime so far). | ||
12 | |||
13 | This also renames __cputime_msec_factor to __cputime_usec_factor, adapting | ||
14 | its value and using it directly in cputime_to_usecs instead of doing two | ||
15 | multiplications. | ||
16 | |||
17 | Signed-off-by: Andreas Schwab <schwab@linux-m68k.org> | ||
18 | Acked-by: Anton Blanchard <anton@samba.org> | ||
19 | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> | ||
20 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
21 | --- | ||
22 | arch/powerpc/include/asm/cputime.h | 6 +++--- | ||
23 | arch/powerpc/kernel/time.c | 10 +++++----- | ||
24 | 2 files changed, 8 insertions(+), 8 deletions(-) | ||
25 | |||
26 | diff --git a/arch/powerpc/include/asm/cputime.h b/arch/powerpc/include/asm/cputime.h | ||
27 | index 98b7c4b..fa3f921 100644 | ||
28 | --- a/arch/powerpc/include/asm/cputime.h | ||
29 | +++ b/arch/powerpc/include/asm/cputime.h | ||
30 | @@ -126,11 +126,11 @@ static inline u64 cputime64_to_jiffies64(const cputime_t ct) | ||
31 | /* | ||
32 | * Convert cputime <-> microseconds | ||
33 | */ | ||
34 | -extern u64 __cputime_msec_factor; | ||
35 | +extern u64 __cputime_usec_factor; | ||
36 | |||
37 | static inline unsigned long cputime_to_usecs(const cputime_t ct) | ||
38 | { | ||
39 | - return mulhdu(ct, __cputime_msec_factor) * USEC_PER_MSEC; | ||
40 | + return mulhdu(ct, __cputime_usec_factor); | ||
41 | } | ||
42 | |||
43 | static inline cputime_t usecs_to_cputime(const unsigned long us) | ||
44 | @@ -143,7 +143,7 @@ static inline cputime_t usecs_to_cputime(const unsigned long us) | ||
45 | sec = us / 1000000; | ||
46 | if (ct) { | ||
47 | ct *= tb_ticks_per_sec; | ||
48 | - do_div(ct, 1000); | ||
49 | + do_div(ct, 1000000); | ||
50 | } | ||
51 | if (sec) | ||
52 | ct += (cputime_t) sec * tb_ticks_per_sec; | ||
53 | diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c | ||
54 | index 5db163c..ec8affe 100644 | ||
55 | --- a/arch/powerpc/kernel/time.c | ||
56 | +++ b/arch/powerpc/kernel/time.c | ||
57 | @@ -168,13 +168,13 @@ EXPORT_SYMBOL_GPL(ppc_tb_freq); | ||
58 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | ||
59 | /* | ||
60 | * Factors for converting from cputime_t (timebase ticks) to | ||
61 | - * jiffies, milliseconds, seconds, and clock_t (1/USER_HZ seconds). | ||
62 | + * jiffies, microseconds, seconds, and clock_t (1/USER_HZ seconds). | ||
63 | * These are all stored as 0.64 fixed-point binary fractions. | ||
64 | */ | ||
65 | u64 __cputime_jiffies_factor; | ||
66 | EXPORT_SYMBOL(__cputime_jiffies_factor); | ||
67 | -u64 __cputime_msec_factor; | ||
68 | -EXPORT_SYMBOL(__cputime_msec_factor); | ||
69 | +u64 __cputime_usec_factor; | ||
70 | +EXPORT_SYMBOL(__cputime_usec_factor); | ||
71 | u64 __cputime_sec_factor; | ||
72 | EXPORT_SYMBOL(__cputime_sec_factor); | ||
73 | u64 __cputime_clockt_factor; | ||
74 | @@ -192,8 +192,8 @@ static void calc_cputime_factors(void) | ||
75 | |||
76 | div128_by_32(HZ, 0, tb_ticks_per_sec, &res); | ||
77 | __cputime_jiffies_factor = res.result_low; | ||
78 | - div128_by_32(1000, 0, tb_ticks_per_sec, &res); | ||
79 | - __cputime_msec_factor = res.result_low; | ||
80 | + div128_by_32(1000000, 0, tb_ticks_per_sec, &res); | ||
81 | + __cputime_usec_factor = res.result_low; | ||
82 | div128_by_32(1, 0, tb_ticks_per_sec, &res); | ||
83 | __cputime_sec_factor = res.result_low; | ||
84 | div128_by_32(USER_HZ, 0, tb_ticks_per_sec, &res); | ||
85 | -- | ||
86 | 1.7.7.6 | ||
87 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0086-vhost-don-t-forget-to-schedule.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0086-vhost-don-t-forget-to-schedule.patch new file mode 100644 index 00000000..fded3c6c --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0086-vhost-don-t-forget-to-schedule.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | From 164965e103d2cfc11c59b563aa95ce2e8c372b65 Mon Sep 17 00:00:00 2001 | ||
2 | From: Nadav Har'El <nyh@math.technion.ac.il> | ||
3 | Date: Mon, 27 Feb 2012 15:07:29 +0200 | ||
4 | Subject: [PATCH 086/109] vhost: don't forget to schedule() | ||
5 | |||
6 | commit d550dda192c1bd039afb774b99485e88b70d7cb8 upstream. | ||
7 | |||
8 | This is a tiny, but important, patch to vhost. | ||
9 | |||
10 | Vhost's worker thread only called schedule() when it had no work to do, and | ||
11 | it wanted to go to sleep. But if there's always work to do, e.g., the guest | ||
12 | is running a network-intensive program like netperf with small message sizes, | ||
13 | schedule() was *never* called. This had several negative implications (on | ||
14 | non-preemptive kernels): | ||
15 | |||
16 | 1. Passing time was not properly accounted to the "vhost" process (ps and | ||
17 | top would wrongly show it using zero CPU time). | ||
18 | |||
19 | 2. Sometimes error messages about RCU timeouts would be printed, if the | ||
20 | core running the vhost thread didn't schedule() for a very long time. | ||
21 | |||
22 | 3. Worst of all, a vhost thread would "hog" the core. If several vhost | ||
23 | threads need to share the same core, typically one would get most of the | ||
24 | CPU time (and its associated guest most of the performance), while the | ||
25 | others hardly get any work done. | ||
26 | |||
27 | The trivial solution is to add | ||
28 | |||
29 | if (need_resched()) | ||
30 | schedule(); | ||
31 | |||
32 | After doing every piece of work. This will not do the heavy schedule() all | ||
33 | the time, just when the timer interrupt decided a reschedule is warranted | ||
34 | (so need_resched returns true). | ||
35 | |||
36 | Thanks to Abel Gordon for this patch. | ||
37 | |||
38 | Signed-off-by: Nadav Har'El <nyh@il.ibm.com> | ||
39 | Signed-off-by: Michael S. Tsirkin <mst@redhat.com> | ||
40 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
41 | --- | ||
42 | drivers/vhost/vhost.c | 2 ++ | ||
43 | 1 files changed, 2 insertions(+), 0 deletions(-) | ||
44 | |||
45 | diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c | ||
46 | index c14c42b..ae66278 100644 | ||
47 | --- a/drivers/vhost/vhost.c | ||
48 | +++ b/drivers/vhost/vhost.c | ||
49 | @@ -222,6 +222,8 @@ static int vhost_worker(void *data) | ||
50 | if (work) { | ||
51 | __set_current_state(TASK_RUNNING); | ||
52 | work->fn(work); | ||
53 | + if (need_resched()) | ||
54 | + schedule(); | ||
55 | } else | ||
56 | schedule(); | ||
57 | |||
58 | -- | ||
59 | 1.7.7.6 | ||
60 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0087-r8169-call-netif_napi_del-at-errpaths-and-at-driver-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0087-r8169-call-netif_napi_del-at-errpaths-and-at-driver-.patch new file mode 100644 index 00000000..8fd5527a --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0087-r8169-call-netif_napi_del-at-errpaths-and-at-driver-.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 87b62a139d4385f3726820674127eaee29fc7cff Mon Sep 17 00:00:00 2001 | ||
2 | From: Devendra Naga <devendra.aaru@gmail.com> | ||
3 | Date: Thu, 31 May 2012 01:51:20 +0000 | ||
4 | Subject: [PATCH 087/109] r8169: call netif_napi_del at errpaths and at driver | ||
5 | unload | ||
6 | |||
7 | commit ad1be8d345416a794dea39761a374032aa471a76 upstream. | ||
8 | |||
9 | when register_netdev fails, the init'ed NAPIs by netif_napi_add must be | ||
10 | deleted with netif_napi_del, and also when driver unloads, it should | ||
11 | delete the NAPI before unregistering netdevice using unregister_netdev. | ||
12 | |||
13 | Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> | ||
14 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
15 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
16 | --- | ||
17 | drivers/net/ethernet/realtek/r8169.c | 3 +++ | ||
18 | 1 files changed, 3 insertions(+), 0 deletions(-) | ||
19 | |||
20 | diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c | ||
21 | index cc2565c..9e61d6b 100644 | ||
22 | --- a/drivers/net/ethernet/realtek/r8169.c | ||
23 | +++ b/drivers/net/ethernet/realtek/r8169.c | ||
24 | @@ -4185,6 +4185,7 @@ out: | ||
25 | return rc; | ||
26 | |||
27 | err_out_msi_4: | ||
28 | + netif_napi_del(&tp->napi); | ||
29 | rtl_disable_msi(pdev, tp); | ||
30 | iounmap(ioaddr); | ||
31 | err_out_free_res_3: | ||
32 | @@ -4210,6 +4211,8 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev) | ||
33 | |||
34 | cancel_delayed_work_sync(&tp->task); | ||
35 | |||
36 | + netif_napi_del(&tp->napi); | ||
37 | + | ||
38 | unregister_netdev(dev); | ||
39 | |||
40 | rtl_release_firmware(tp); | ||
41 | -- | ||
42 | 1.7.7.6 | ||
43 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0088-bnx2x-fix-checksum-validation.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0088-bnx2x-fix-checksum-validation.patch new file mode 100644 index 00000000..1a6bce5b --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0088-bnx2x-fix-checksum-validation.patch | |||
@@ -0,0 +1,112 @@ | |||
1 | From 4ffefa650ebbe2ef8bc2babff2e5686c33a2dab3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Eric Dumazet <edumazet@google.com> | ||
3 | Date: Tue, 12 Jun 2012 23:50:04 +0000 | ||
4 | Subject: [PATCH 088/109] bnx2x: fix checksum validation | ||
5 | |||
6 | commit d6cb3e41386f20fb0777d0b59a2def82c65d37f7 upstream. | ||
7 | |||
8 | bnx2x driver incorrectly sets ip_summed to CHECKSUM_UNNECESSARY on | ||
9 | encapsulated segments. TCP stack happily accepts frames with bad | ||
10 | checksums, if they are inside a GRE or IPIP encapsulation. | ||
11 | |||
12 | Our understanding is that if no IP or L4 csum validation was done by the | ||
13 | hardware, we should leave ip_summed as is (CHECKSUM_NONE), since | ||
14 | hardware doesn't provide CHECKSUM_COMPLETE support in its cqe. | ||
15 | |||
16 | Then, if IP/L4 checksumming was done by the hardware, set | ||
17 | CHECKSUM_UNNECESSARY if no error was flagged. | ||
18 | |||
19 | Patch based on findings and analysis from Robert Evans | ||
20 | |||
21 | Signed-off-by: Eric Dumazet <edumazet@google.com> | ||
22 | Cc: Eilon Greenstein <eilong@broadcom.com> | ||
23 | Cc: Yaniv Rosner <yanivr@broadcom.com> | ||
24 | Cc: Merav Sicron <meravs@broadcom.com> | ||
25 | Cc: Tom Herbert <therbert@google.com> | ||
26 | Cc: Robert Evans <evansr@google.com> | ||
27 | Cc: Willem de Bruijn <willemb@google.com> | ||
28 | Acked-by: Eilon Greenstein <eilong@broadcom.com> | ||
29 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
30 | [bwh: Backported to 3.2: adjust context, indentation] | ||
31 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
32 | --- | ||
33 | drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 15 ------------ | ||
34 | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 28 ++++++++++++++++++----- | ||
35 | 2 files changed, 22 insertions(+), 21 deletions(-) | ||
36 | |||
37 | diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | ||
38 | index aec7212..8dda46a 100644 | ||
39 | --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | ||
40 | +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | ||
41 | @@ -723,21 +723,6 @@ struct bnx2x_fastpath { | ||
42 | |||
43 | #define ETH_RX_ERROR_FALGS ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG | ||
44 | |||
45 | -#define BNX2X_IP_CSUM_ERR(cqe) \ | ||
46 | - (!((cqe)->fast_path_cqe.status_flags & \ | ||
47 | - ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG) && \ | ||
48 | - ((cqe)->fast_path_cqe.type_error_flags & \ | ||
49 | - ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG)) | ||
50 | - | ||
51 | -#define BNX2X_L4_CSUM_ERR(cqe) \ | ||
52 | - (!((cqe)->fast_path_cqe.status_flags & \ | ||
53 | - ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG) && \ | ||
54 | - ((cqe)->fast_path_cqe.type_error_flags & \ | ||
55 | - ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG)) | ||
56 | - | ||
57 | -#define BNX2X_RX_CSUM_OK(cqe) \ | ||
58 | - (!(BNX2X_L4_CSUM_ERR(cqe) || BNX2X_IP_CSUM_ERR(cqe))) | ||
59 | - | ||
60 | #define BNX2X_PRS_FLAG_OVERETH_IPV4(flags) \ | ||
61 | (((le16_to_cpu(flags) & \ | ||
62 | PARSING_FLAGS_OVER_ETHERNET_PROTOCOL) >> \ | ||
63 | diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | ||
64 | index 580b44e..27d6d6c 100644 | ||
65 | --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | ||
66 | +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | ||
67 | @@ -551,6 +551,26 @@ static inline void bnx2x_set_skb_rxhash(struct bnx2x *bp, union eth_rx_cqe *cqe, | ||
68 | le32_to_cpu(cqe->fast_path_cqe.rss_hash_result); | ||
69 | } | ||
70 | |||
71 | +static void bnx2x_csum_validate(struct sk_buff *skb, union eth_rx_cqe *cqe, | ||
72 | + struct bnx2x_fastpath *fp) | ||
73 | +{ | ||
74 | + /* Do nothing if no IP/L4 csum validation was done */ | ||
75 | + | ||
76 | + if (cqe->fast_path_cqe.status_flags & | ||
77 | + (ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG | | ||
78 | + ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG)) | ||
79 | + return; | ||
80 | + | ||
81 | + /* If both IP/L4 validation were done, check if an error was found. */ | ||
82 | + | ||
83 | + if (cqe->fast_path_cqe.type_error_flags & | ||
84 | + (ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG | | ||
85 | + ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG)) | ||
86 | + fp->eth_q_stats.hw_csum_err++; | ||
87 | + else | ||
88 | + skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
89 | +} | ||
90 | + | ||
91 | int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget) | ||
92 | { | ||
93 | struct bnx2x *bp = fp->bp; | ||
94 | @@ -746,13 +766,9 @@ reuse_rx: | ||
95 | |||
96 | skb_checksum_none_assert(skb); | ||
97 | |||
98 | - if (bp->dev->features & NETIF_F_RXCSUM) { | ||
99 | + if (bp->dev->features & NETIF_F_RXCSUM) | ||
100 | + bnx2x_csum_validate(skb, cqe, fp); | ||
101 | |||
102 | - if (likely(BNX2X_RX_CSUM_OK(cqe))) | ||
103 | - skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
104 | - else | ||
105 | - fp->eth_q_stats.hw_csum_err++; | ||
106 | - } | ||
107 | } | ||
108 | |||
109 | skb_record_rx_queue(skb, fp->index); | ||
110 | -- | ||
111 | 1.7.7.6 | ||
112 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0089-bnx2x-fix-panic-when-TX-ring-is-full.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0089-bnx2x-fix-panic-when-TX-ring-is-full.patch new file mode 100644 index 00000000..d21ce221 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0089-bnx2x-fix-panic-when-TX-ring-is-full.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | From 9a59f534e5f1d432bf63f0ed6cb184b1ce988063 Mon Sep 17 00:00:00 2001 | ||
2 | From: Eric Dumazet <edumazet@google.com> | ||
3 | Date: Wed, 13 Jun 2012 09:45:16 +0000 | ||
4 | Subject: [PATCH 089/109] bnx2x: fix panic when TX ring is full | ||
5 | |||
6 | commit bc14786a100cc6a81cd060e8031ec481241b418c upstream. | ||
7 | |||
8 | There is a off by one error in the minimal number of BD in | ||
9 | bnx2x_start_xmit() and bnx2x_tx_int() before stopping/resuming tx queue. | ||
10 | |||
11 | A full size GSO packet, with data included in skb->head really needs | ||
12 | (MAX_SKB_FRAGS + 4) BDs, because of bnx2x_tx_split() | ||
13 | |||
14 | This error triggers if BQL is disabled and heavy TCP transmit traffic | ||
15 | occurs. | ||
16 | |||
17 | bnx2x_tx_split() definitely can be called, remove a wrong comment. | ||
18 | |||
19 | Reported-by: Tomas Hruby <thruby@google.com> | ||
20 | Signed-off-by: Eric Dumazet <edumazet@google.com> | ||
21 | Cc: Eilon Greenstein <eilong@broadcom.com> | ||
22 | Cc: Yaniv Rosner <yanivr@broadcom.com> | ||
23 | Cc: Merav Sicron <meravs@broadcom.com> | ||
24 | Cc: Tom Herbert <therbert@google.com> | ||
25 | Cc: Robert Evans <evansr@google.com> | ||
26 | Cc: Willem de Bruijn <willemb@google.com> | ||
27 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
28 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
29 | --- | ||
30 | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 8 +++----- | ||
31 | 1 files changed, 3 insertions(+), 5 deletions(-) | ||
32 | |||
33 | diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | ||
34 | index 27d6d6c..2c1a5c0 100644 | ||
35 | --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | ||
36 | +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | ||
37 | @@ -220,7 +220,7 @@ int bnx2x_tx_int(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata) | ||
38 | |||
39 | if ((netif_tx_queue_stopped(txq)) && | ||
40 | (bp->state == BNX2X_STATE_OPEN) && | ||
41 | - (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 3)) | ||
42 | + (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 4)) | ||
43 | netif_tx_wake_queue(txq); | ||
44 | |||
45 | __netif_tx_unlock(txq); | ||
46 | @@ -2254,8 +2254,6 @@ int bnx2x_poll(struct napi_struct *napi, int budget) | ||
47 | /* we split the first BD into headers and data BDs | ||
48 | * to ease the pain of our fellow microcode engineers | ||
49 | * we use one mapping for both BDs | ||
50 | - * So far this has only been observed to happen | ||
51 | - * in Other Operating Systems(TM) | ||
52 | */ | ||
53 | static noinline u16 bnx2x_tx_split(struct bnx2x *bp, | ||
54 | struct bnx2x_fp_txdata *txdata, | ||
55 | @@ -2906,7 +2904,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | ||
56 | |||
57 | txdata->tx_bd_prod += nbd; | ||
58 | |||
59 | - if (unlikely(bnx2x_tx_avail(bp, txdata) < MAX_SKB_FRAGS + 3)) { | ||
60 | + if (unlikely(bnx2x_tx_avail(bp, txdata) < MAX_SKB_FRAGS + 4)) { | ||
61 | netif_tx_stop_queue(txq); | ||
62 | |||
63 | /* paired memory barrier is in bnx2x_tx_int(), we have to keep | ||
64 | @@ -2915,7 +2913,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | ||
65 | smp_mb(); | ||
66 | |||
67 | fp->eth_q_stats.driver_xoff++; | ||
68 | - if (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 3) | ||
69 | + if (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 4) | ||
70 | netif_tx_wake_queue(txq); | ||
71 | } | ||
72 | txdata->tx_pkt++; | ||
73 | -- | ||
74 | 1.7.7.6 | ||
75 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0090-net-remove-skb_orphan_try.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0090-net-remove-skb_orphan_try.patch new file mode 100644 index 00000000..60728039 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0090-net-remove-skb_orphan_try.patch | |||
@@ -0,0 +1,135 @@ | |||
1 | From 401354ebe4d79d6edf536ad7b69e59afeec81308 Mon Sep 17 00:00:00 2001 | ||
2 | From: Eric Dumazet <edumazet@google.com> | ||
3 | Date: Thu, 14 Jun 2012 06:42:44 +0000 | ||
4 | Subject: [PATCH 090/109] net: remove skb_orphan_try() | ||
5 | |||
6 | commit 62b1a8ab9b3660bb820d8dfe23148ed6cda38574 upstream. | ||
7 | |||
8 | Orphaning skb in dev_hard_start_xmit() makes bonding behavior | ||
9 | unfriendly for applications sending big UDP bursts : Once packets | ||
10 | pass the bonding device and come to real device, they might hit a full | ||
11 | qdisc and be dropped. Without orphaning, the sender is automatically | ||
12 | throttled because sk->sk_wmemalloc reaches sk->sk_sndbuf (assuming | ||
13 | sk_sndbuf is not too big) | ||
14 | |||
15 | We could try to defer the orphaning adding another test in | ||
16 | dev_hard_start_xmit(), but all this seems of little gain, | ||
17 | now that BQL tends to make packets more likely to be parked | ||
18 | in Qdisc queues instead of NIC TX ring, in cases where performance | ||
19 | matters. | ||
20 | |||
21 | Reverts commits : | ||
22 | fc6055a5ba31 net: Introduce skb_orphan_try() | ||
23 | 87fd308cfc6b net: skb_tx_hash() fix relative to skb_orphan_try() | ||
24 | and removes SKBTX_DRV_NEEDS_SK_REF flag | ||
25 | |||
26 | Reported-and-bisected-by: Jean-Michel Hautbois <jhautbois@gmail.com> | ||
27 | Signed-off-by: Eric Dumazet <edumazet@google.com> | ||
28 | Tested-by: Oliver Hartkopp <socketcan@hartkopp.net> | ||
29 | Acked-by: Oliver Hartkopp <socketcan@hartkopp.net> | ||
30 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
31 | [bwh: Backported to 3.2: | ||
32 | - Adjust context | ||
33 | - SKBTX_WIFI_STATUS is not defined] | ||
34 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
35 | --- | ||
36 | include/linux/skbuff.h | 5 +---- | ||
37 | net/can/raw.c | 3 --- | ||
38 | net/core/dev.c | 23 +---------------------- | ||
39 | net/iucv/af_iucv.c | 1 - | ||
40 | 4 files changed, 2 insertions(+), 30 deletions(-) | ||
41 | |||
42 | diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h | ||
43 | index bdb4590..53dc7e7 100644 | ||
44 | --- a/include/linux/skbuff.h | ||
45 | +++ b/include/linux/skbuff.h | ||
46 | @@ -213,11 +213,8 @@ enum { | ||
47 | /* device driver is going to provide hardware time stamp */ | ||
48 | SKBTX_IN_PROGRESS = 1 << 2, | ||
49 | |||
50 | - /* ensure the originating sk reference is available on driver level */ | ||
51 | - SKBTX_DRV_NEEDS_SK_REF = 1 << 3, | ||
52 | - | ||
53 | /* device driver supports TX zero-copy buffers */ | ||
54 | - SKBTX_DEV_ZEROCOPY = 1 << 4, | ||
55 | + SKBTX_DEV_ZEROCOPY = 1 << 3, | ||
56 | }; | ||
57 | |||
58 | /* | ||
59 | diff --git a/net/can/raw.c b/net/can/raw.c | ||
60 | index cde1b4a..46cca3a 100644 | ||
61 | --- a/net/can/raw.c | ||
62 | +++ b/net/can/raw.c | ||
63 | @@ -681,9 +681,6 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock, | ||
64 | if (err < 0) | ||
65 | goto free_skb; | ||
66 | |||
67 | - /* to be able to check the received tx sock reference in raw_rcv() */ | ||
68 | - skb_shinfo(skb)->tx_flags |= SKBTX_DRV_NEEDS_SK_REF; | ||
69 | - | ||
70 | skb->dev = dev; | ||
71 | skb->sk = sk; | ||
72 | |||
73 | diff --git a/net/core/dev.c b/net/core/dev.c | ||
74 | index 1cbddc9..5738654 100644 | ||
75 | --- a/net/core/dev.c | ||
76 | +++ b/net/core/dev.c | ||
77 | @@ -2079,25 +2079,6 @@ static int dev_gso_segment(struct sk_buff *skb, int features) | ||
78 | return 0; | ||
79 | } | ||
80 | |||
81 | -/* | ||
82 | - * Try to orphan skb early, right before transmission by the device. | ||
83 | - * We cannot orphan skb if tx timestamp is requested or the sk-reference | ||
84 | - * is needed on driver level for other reasons, e.g. see net/can/raw.c | ||
85 | - */ | ||
86 | -static inline void skb_orphan_try(struct sk_buff *skb) | ||
87 | -{ | ||
88 | - struct sock *sk = skb->sk; | ||
89 | - | ||
90 | - if (sk && !skb_shinfo(skb)->tx_flags) { | ||
91 | - /* skb_tx_hash() wont be able to get sk. | ||
92 | - * We copy sk_hash into skb->rxhash | ||
93 | - */ | ||
94 | - if (!skb->rxhash) | ||
95 | - skb->rxhash = sk->sk_hash; | ||
96 | - skb_orphan(skb); | ||
97 | - } | ||
98 | -} | ||
99 | - | ||
100 | static bool can_checksum_protocol(unsigned long features, __be16 protocol) | ||
101 | { | ||
102 | return ((features & NETIF_F_GEN_CSUM) || | ||
103 | @@ -2182,8 +2163,6 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, | ||
104 | if (!list_empty(&ptype_all)) | ||
105 | dev_queue_xmit_nit(skb, dev); | ||
106 | |||
107 | - skb_orphan_try(skb); | ||
108 | - | ||
109 | features = netif_skb_features(skb); | ||
110 | |||
111 | if (vlan_tx_tag_present(skb) && | ||
112 | @@ -2293,7 +2272,7 @@ u16 __skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb, | ||
113 | if (skb->sk && skb->sk->sk_hash) | ||
114 | hash = skb->sk->sk_hash; | ||
115 | else | ||
116 | - hash = (__force u16) skb->protocol ^ skb->rxhash; | ||
117 | + hash = (__force u16) skb->protocol; | ||
118 | hash = jhash_1word(hash, hashrnd); | ||
119 | |||
120 | return (u16) (((u64) hash * qcount) >> 32) + qoffset; | ||
121 | diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c | ||
122 | index 274d150..cf98d62 100644 | ||
123 | --- a/net/iucv/af_iucv.c | ||
124 | +++ b/net/iucv/af_iucv.c | ||
125 | @@ -380,7 +380,6 @@ static int afiucv_hs_send(struct iucv_message *imsg, struct sock *sock, | ||
126 | skb_trim(skb, skb->dev->mtu); | ||
127 | } | ||
128 | skb->protocol = ETH_P_AF_IUCV; | ||
129 | - skb_shinfo(skb)->tx_flags |= SKBTX_DRV_NEEDS_SK_REF; | ||
130 | nskb = skb_clone(skb, GFP_ATOMIC); | ||
131 | if (!nskb) | ||
132 | return -ENOMEM; | ||
133 | -- | ||
134 | 1.7.7.6 | ||
135 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0091-ACPI-Make-acpi_skip_timer_override-cover-all-source_.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0091-ACPI-Make-acpi_skip_timer_override-cover-all-source_.patch new file mode 100644 index 00000000..6db854d5 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0091-ACPI-Make-acpi_skip_timer_override-cover-all-source_.patch | |||
@@ -0,0 +1,78 @@ | |||
1 | From 16fe1810332abe3998fa2e0760af7f8ca5f701d6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Feng Tang <feng.tang@intel.com> | ||
3 | Date: Mon, 4 Jun 2012 15:00:04 +0800 | ||
4 | Subject: [PATCH 091/109] ACPI: Make acpi_skip_timer_override cover all | ||
5 | source_irq==0 cases | ||
6 | |||
7 | commit ae10ccdc3093486f8c2369d227583f9d79f628e5 upstream. | ||
8 | |||
9 | Currently when acpi_skip_timer_override is set, it only cover the | ||
10 | (source_irq == 0 && global_irq == 2) cases. While there is also | ||
11 | platform which need use this option and its global_irq is not 2. | ||
12 | This patch will extend acpi_skip_timer_override to cover all | ||
13 | timer overriding cases as long as the source irq is 0. | ||
14 | |||
15 | This is the first part of a fix to kernel bug bugzilla 40002: | ||
16 | "IRQ 0 assigned to VGA" | ||
17 | https://bugzilla.kernel.org/show_bug.cgi?id=40002 | ||
18 | |||
19 | Reported-and-tested-by: Szymon Kowalczyk <fazerxlo@o2.pl> | ||
20 | Signed-off-by: Feng Tang <feng.tang@intel.com> | ||
21 | Signed-off-by: Len Brown <len.brown@intel.com> | ||
22 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
23 | --- | ||
24 | arch/x86/kernel/acpi/boot.c | 14 ++++++++------ | ||
25 | 1 files changed, 8 insertions(+), 6 deletions(-) | ||
26 | |||
27 | diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c | ||
28 | index 4558f0d..a94dc95 100644 | ||
29 | --- a/arch/x86/kernel/acpi/boot.c | ||
30 | +++ b/arch/x86/kernel/acpi/boot.c | ||
31 | @@ -416,12 +416,14 @@ acpi_parse_int_src_ovr(struct acpi_subtable_header * header, | ||
32 | return 0; | ||
33 | } | ||
34 | |||
35 | - if (intsrc->source_irq == 0 && intsrc->global_irq == 2) { | ||
36 | + if (intsrc->source_irq == 0) { | ||
37 | if (acpi_skip_timer_override) { | ||
38 | - printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n"); | ||
39 | + printk(PREFIX "BIOS IRQ0 override ignored.\n"); | ||
40 | return 0; | ||
41 | } | ||
42 | - if (acpi_fix_pin2_polarity && (intsrc->inti_flags & ACPI_MADT_POLARITY_MASK)) { | ||
43 | + | ||
44 | + if ((intsrc->global_irq == 2) && acpi_fix_pin2_polarity | ||
45 | + && (intsrc->inti_flags & ACPI_MADT_POLARITY_MASK)) { | ||
46 | intsrc->inti_flags &= ~ACPI_MADT_POLARITY_MASK; | ||
47 | printk(PREFIX "BIOS IRQ0 pin2 override: forcing polarity to high active.\n"); | ||
48 | } | ||
49 | @@ -1327,7 +1329,7 @@ static int __init dmi_disable_acpi(const struct dmi_system_id *d) | ||
50 | } | ||
51 | |||
52 | /* | ||
53 | - * Force ignoring BIOS IRQ0 pin2 override | ||
54 | + * Force ignoring BIOS IRQ0 override | ||
55 | */ | ||
56 | static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d) | ||
57 | { | ||
58 | @@ -1337,7 +1339,7 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d) | ||
59 | */ | ||
60 | if (!acpi_skip_timer_override) { | ||
61 | WARN(1, KERN_ERR "ati_ixp4x0 quirk not complete.\n"); | ||
62 | - pr_notice("%s detected: Ignoring BIOS IRQ0 pin2 override\n", | ||
63 | + pr_notice("%s detected: Ignoring BIOS IRQ0 override\n", | ||
64 | d->ident); | ||
65 | acpi_skip_timer_override = 1; | ||
66 | } | ||
67 | @@ -1431,7 +1433,7 @@ static struct dmi_system_id __initdata acpi_dmi_table_late[] = { | ||
68 | * is enabled. This input is incorrectly designated the | ||
69 | * ISA IRQ 0 via an interrupt source override even though | ||
70 | * it is wired to the output of the master 8259A and INTIN0 | ||
71 | - * is not connected at all. Force ignoring BIOS IRQ0 pin2 | ||
72 | + * is not connected at all. Force ignoring BIOS IRQ0 | ||
73 | * override in that cases. | ||
74 | */ | ||
75 | { | ||
76 | -- | ||
77 | 1.7.7.6 | ||
78 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0092-ACPI-Remove-one-board-specific-WARN-when-ignoring-ti.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0092-ACPI-Remove-one-board-specific-WARN-when-ignoring-ti.patch new file mode 100644 index 00000000..b7b8f11b --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0092-ACPI-Remove-one-board-specific-WARN-when-ignoring-ti.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From b9c36e346bdb1c7bd2edd7489561f94155195e6e Mon Sep 17 00:00:00 2001 | ||
2 | From: Feng Tang <feng.tang@intel.com> | ||
3 | Date: Mon, 4 Jun 2012 15:00:05 +0800 | ||
4 | Subject: [PATCH 092/109] ACPI: Remove one board specific WARN when ignoring | ||
5 | timer overriding | ||
6 | |||
7 | commit 5752cdb805ff89942d99d12118e2844e7db34df8 upstream. | ||
8 | |||
9 | commit 7f68b4c2e158019c2ec494b5cfbd9c83b4e5b253 upstream. | ||
10 | |||
11 | Current WARN msg is only for the ati_ixp4x0 board, while this function | ||
12 | is used by mulitple platforms. So this one board specific warning | ||
13 | is not appropriate any more. | ||
14 | |||
15 | Signed-off-by: Feng Tang <feng.tang@intel.com> | ||
16 | Signed-off-by: Len Brown <len.brown@intel.com> | ||
17 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
18 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
19 | --- | ||
20 | arch/x86/kernel/acpi/boot.c | 5 ----- | ||
21 | 1 files changed, 0 insertions(+), 5 deletions(-) | ||
22 | |||
23 | diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c | ||
24 | index a94dc95..882960e 100644 | ||
25 | --- a/arch/x86/kernel/acpi/boot.c | ||
26 | +++ b/arch/x86/kernel/acpi/boot.c | ||
27 | @@ -1333,12 +1333,7 @@ static int __init dmi_disable_acpi(const struct dmi_system_id *d) | ||
28 | */ | ||
29 | static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d) | ||
30 | { | ||
31 | - /* | ||
32 | - * The ati_ixp4x0_rev() early PCI quirk should have set | ||
33 | - * the acpi_skip_timer_override flag already: | ||
34 | - */ | ||
35 | if (!acpi_skip_timer_override) { | ||
36 | - WARN(1, KERN_ERR "ati_ixp4x0 quirk not complete.\n"); | ||
37 | pr_notice("%s detected: Ignoring BIOS IRQ0 override\n", | ||
38 | d->ident); | ||
39 | acpi_skip_timer_override = 1; | ||
40 | -- | ||
41 | 1.7.7.6 | ||
42 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0093-ACPI-Add-a-quirk-for-AMILO-PRO-V2030-to-ignore-the-t.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0093-ACPI-Add-a-quirk-for-AMILO-PRO-V2030-to-ignore-the-t.patch new file mode 100644 index 00000000..b1b5ff57 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0093-ACPI-Add-a-quirk-for-AMILO-PRO-V2030-to-ignore-the-t.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 0430a8402ee6125c909ae3f4c3a89696e9a24077 Mon Sep 17 00:00:00 2001 | ||
2 | From: Feng Tang <feng.tang@intel.com> | ||
3 | Date: Mon, 4 Jun 2012 15:00:06 +0800 | ||
4 | Subject: [PATCH 093/109] ACPI: Add a quirk for "AMILO PRO V2030" to ignore | ||
5 | the timer overriding | ||
6 | |||
7 | commit b939c2acf1dc42b08407ef5174f2e8d6f43dd5ea upstream. | ||
8 | |||
9 | commit f6b54f083cc66cf9b11d2120d8df3c2ad4e0836d upstream. | ||
10 | |||
11 | This is the 2nd part of fix for kernel bugzilla 40002: | ||
12 | "IRQ 0 assigned to VGA" | ||
13 | https://bugzilla.kernel.org/show_bug.cgi?id=40002 | ||
14 | |||
15 | The root cause is the buggy FW, whose ACPI tables assign the GSI 16 | ||
16 | to 2 irqs 0 and 16(VGA), and the VGA is the right owner of GSI 16. | ||
17 | So add a quirk to ignore the irq0 overriding GSI 16 for the | ||
18 | FUJITSU SIEMENS AMILO PRO V2030 platform will solve this issue. | ||
19 | |||
20 | Reported-and-tested-by: Szymon Kowalczyk <fazerxlo@o2.pl> | ||
21 | Signed-off-by: Feng Tang <feng.tang@intel.com> | ||
22 | Signed-off-by: Len Brown <len.brown@intel.com> | ||
23 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
24 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
25 | --- | ||
26 | arch/x86/kernel/acpi/boot.c | 8 ++++++++ | ||
27 | 1 files changed, 8 insertions(+), 0 deletions(-) | ||
28 | |||
29 | diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c | ||
30 | index 882960e..479d03c 100644 | ||
31 | --- a/arch/x86/kernel/acpi/boot.c | ||
32 | +++ b/arch/x86/kernel/acpi/boot.c | ||
33 | @@ -1463,6 +1463,14 @@ static struct dmi_system_id __initdata acpi_dmi_table_late[] = { | ||
34 | DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq 6715b"), | ||
35 | }, | ||
36 | }, | ||
37 | + { | ||
38 | + .callback = dmi_ignore_irq0_timer_override, | ||
39 | + .ident = "FUJITSU SIEMENS", | ||
40 | + .matches = { | ||
41 | + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), | ||
42 | + DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"), | ||
43 | + }, | ||
44 | + }, | ||
45 | {} | ||
46 | }; | ||
47 | |||
48 | -- | ||
49 | 1.7.7.6 | ||
50 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0094-ACPI-x86-fix-Dell-M6600-ACPI-reboot-regression-via-D.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0094-ACPI-x86-fix-Dell-M6600-ACPI-reboot-regression-via-D.patch new file mode 100644 index 00000000..8cdbeaa2 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0094-ACPI-x86-fix-Dell-M6600-ACPI-reboot-regression-via-D.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 66b7502a0d37876e547c5440aa34bee18e3b0f1e Mon Sep 17 00:00:00 2001 | ||
2 | From: Zhang Rui <rui.zhang@intel.com> | ||
3 | Date: Mon, 20 Feb 2012 14:20:06 +0800 | ||
4 | Subject: [PATCH 094/109] ACPI, x86: fix Dell M6600 ACPI reboot regression via | ||
5 | DMI | ||
6 | |||
7 | commit 76eb9a30db4bc8fd172f9155247264b5f2686d7b upstream. | ||
8 | |||
9 | Dell Precision M6600 is known to require PCI reboot, so add it to | ||
10 | the reboot blacklist in pci_reboot_dmi_table[]. | ||
11 | |||
12 | https://bugzilla.kernel.org/show_bug.cgi?id=42749 | ||
13 | |||
14 | cc: x86@kernel.org | ||
15 | Signed-off-by: Zhang Rui <rui.zhang@intel.com> | ||
16 | Signed-off-by: Len Brown <len.brown@intel.com> | ||
17 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
18 | --- | ||
19 | arch/x86/kernel/reboot.c | 8 ++++++++ | ||
20 | 1 files changed, 8 insertions(+), 0 deletions(-) | ||
21 | |||
22 | diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c | ||
23 | index 37a458b..e61f79c 100644 | ||
24 | --- a/arch/x86/kernel/reboot.c | ||
25 | +++ b/arch/x86/kernel/reboot.c | ||
26 | @@ -460,6 +460,14 @@ static struct dmi_system_id __initdata pci_reboot_dmi_table[] = { | ||
27 | DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"), | ||
28 | }, | ||
29 | }, | ||
30 | + { /* Handle problems with rebooting on the Precision M6600. */ | ||
31 | + .callback = set_pci_reboot, | ||
32 | + .ident = "Dell OptiPlex 990", | ||
33 | + .matches = { | ||
34 | + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
35 | + DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600"), | ||
36 | + }, | ||
37 | + }, | ||
38 | { } | ||
39 | }; | ||
40 | |||
41 | -- | ||
42 | 1.7.7.6 | ||
43 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0095-ACPI-sysfs.c-strlen-fix.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0095-ACPI-sysfs.c-strlen-fix.patch new file mode 100644 index 00000000..61a570b5 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0095-ACPI-sysfs.c-strlen-fix.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From b563da2fc80658815355acc804d1b8c21d1a88f9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Pavel Vasilyev <pavel@pavlinux.ru> | ||
3 | Date: Tue, 5 Jun 2012 00:02:05 -0400 | ||
4 | Subject: [PATCH 095/109] ACPI sysfs.c strlen fix | ||
5 | |||
6 | commit 9f132652d94c96476b0b0a8caf0c10e96ab10fa8 upstream. | ||
7 | |||
8 | Current code is ignoring the last character of "enable" and "disable" | ||
9 | in comparisons. | ||
10 | |||
11 | https://bugzilla.kernel.org/show_bug.cgi?id=33732 | ||
12 | |||
13 | Signed-off-by: Len Brown <len.brown@intel.com> | ||
14 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
15 | --- | ||
16 | drivers/acpi/sysfs.c | 4 ++-- | ||
17 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
18 | |||
19 | diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c | ||
20 | index 9f66181..240a244 100644 | ||
21 | --- a/drivers/acpi/sysfs.c | ||
22 | +++ b/drivers/acpi/sysfs.c | ||
23 | @@ -173,7 +173,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp) | ||
24 | { | ||
25 | int result = 0; | ||
26 | |||
27 | - if (!strncmp(val, "enable", strlen("enable") - 1)) { | ||
28 | + if (!strncmp(val, "enable", strlen("enable"))) { | ||
29 | result = acpi_debug_trace(trace_method_name, trace_debug_level, | ||
30 | trace_debug_layer, 0); | ||
31 | if (result) | ||
32 | @@ -181,7 +181,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp) | ||
33 | goto exit; | ||
34 | } | ||
35 | |||
36 | - if (!strncmp(val, "disable", strlen("disable") - 1)) { | ||
37 | + if (!strncmp(val, "disable", strlen("disable"))) { | ||
38 | int name = 0; | ||
39 | result = acpi_debug_trace((char *)&name, trace_debug_level, | ||
40 | trace_debug_layer, 0); | ||
41 | -- | ||
42 | 1.7.7.6 | ||
43 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0096-eCryptfs-Gracefully-refuse-miscdev-file-ops-on-inher.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0096-eCryptfs-Gracefully-refuse-miscdev-file-ops-on-inher.patch new file mode 100644 index 00000000..ba3b5582 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0096-eCryptfs-Gracefully-refuse-miscdev-file-ops-on-inher.patch | |||
@@ -0,0 +1,98 @@ | |||
1 | From 5daf178c74f17e523291b0c4eabbf3b3f3740b75 Mon Sep 17 00:00:00 2001 | ||
2 | From: Tyler Hicks <tyhicks@canonical.com> | ||
3 | Date: Mon, 11 Jun 2012 09:24:11 -0700 | ||
4 | Subject: [PATCH 096/109] eCryptfs: Gracefully refuse miscdev file ops on | ||
5 | inherited/passed files | ||
6 | |||
7 | commit 8dc6780587c99286c0d3de747a2946a76989414a upstream. | ||
8 | |||
9 | File operations on /dev/ecryptfs would BUG() when the operations were | ||
10 | performed by processes other than the process that originally opened the | ||
11 | file. This could happen with open files inherited after fork() or file | ||
12 | descriptors passed through IPC mechanisms. Rather than calling BUG(), an | ||
13 | error code can be safely returned in most situations. | ||
14 | |||
15 | In ecryptfs_miscdev_release(), eCryptfs still needs to handle the | ||
16 | release even if the last file reference is being held by a process that | ||
17 | didn't originally open the file. ecryptfs_find_daemon_by_euid() will not | ||
18 | be successful, so a pointer to the daemon is stored in the file's | ||
19 | private_data. The private_data pointer is initialized when the miscdev | ||
20 | file is opened and only used when the file is released. | ||
21 | |||
22 | https://launchpad.net/bugs/994247 | ||
23 | |||
24 | Signed-off-by: Tyler Hicks <tyhicks@canonical.com> | ||
25 | Reported-by: Sasha Levin <levinsasha928@gmail.com> | ||
26 | Tested-by: Sasha Levin <levinsasha928@gmail.com> | ||
27 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
28 | --- | ||
29 | fs/ecryptfs/miscdev.c | 23 ++++++++++++++++------- | ||
30 | 1 files changed, 16 insertions(+), 7 deletions(-) | ||
31 | |||
32 | diff --git a/fs/ecryptfs/miscdev.c b/fs/ecryptfs/miscdev.c | ||
33 | index 0dc5a3d..a050e4b 100644 | ||
34 | --- a/fs/ecryptfs/miscdev.c | ||
35 | +++ b/fs/ecryptfs/miscdev.c | ||
36 | @@ -49,7 +49,10 @@ ecryptfs_miscdev_poll(struct file *file, poll_table *pt) | ||
37 | mutex_lock(&ecryptfs_daemon_hash_mux); | ||
38 | /* TODO: Just use file->private_data? */ | ||
39 | rc = ecryptfs_find_daemon_by_euid(&daemon, euid, current_user_ns()); | ||
40 | - BUG_ON(rc || !daemon); | ||
41 | + if (rc || !daemon) { | ||
42 | + mutex_unlock(&ecryptfs_daemon_hash_mux); | ||
43 | + return -EINVAL; | ||
44 | + } | ||
45 | mutex_lock(&daemon->mux); | ||
46 | mutex_unlock(&ecryptfs_daemon_hash_mux); | ||
47 | if (daemon->flags & ECRYPTFS_DAEMON_ZOMBIE) { | ||
48 | @@ -122,6 +125,7 @@ ecryptfs_miscdev_open(struct inode *inode, struct file *file) | ||
49 | goto out_unlock_daemon; | ||
50 | } | ||
51 | daemon->flags |= ECRYPTFS_DAEMON_MISCDEV_OPEN; | ||
52 | + file->private_data = daemon; | ||
53 | atomic_inc(&ecryptfs_num_miscdev_opens); | ||
54 | out_unlock_daemon: | ||
55 | mutex_unlock(&daemon->mux); | ||
56 | @@ -152,9 +156,9 @@ ecryptfs_miscdev_release(struct inode *inode, struct file *file) | ||
57 | |||
58 | mutex_lock(&ecryptfs_daemon_hash_mux); | ||
59 | rc = ecryptfs_find_daemon_by_euid(&daemon, euid, current_user_ns()); | ||
60 | - BUG_ON(rc || !daemon); | ||
61 | + if (rc || !daemon) | ||
62 | + daemon = file->private_data; | ||
63 | mutex_lock(&daemon->mux); | ||
64 | - BUG_ON(daemon->pid != task_pid(current)); | ||
65 | BUG_ON(!(daemon->flags & ECRYPTFS_DAEMON_MISCDEV_OPEN)); | ||
66 | daemon->flags &= ~ECRYPTFS_DAEMON_MISCDEV_OPEN; | ||
67 | atomic_dec(&ecryptfs_num_miscdev_opens); | ||
68 | @@ -246,8 +250,16 @@ ecryptfs_miscdev_read(struct file *file, char __user *buf, size_t count, | ||
69 | mutex_lock(&ecryptfs_daemon_hash_mux); | ||
70 | /* TODO: Just use file->private_data? */ | ||
71 | rc = ecryptfs_find_daemon_by_euid(&daemon, euid, current_user_ns()); | ||
72 | - BUG_ON(rc || !daemon); | ||
73 | + if (rc || !daemon) { | ||
74 | + mutex_unlock(&ecryptfs_daemon_hash_mux); | ||
75 | + return -EINVAL; | ||
76 | + } | ||
77 | mutex_lock(&daemon->mux); | ||
78 | + if (task_pid(current) != daemon->pid) { | ||
79 | + mutex_unlock(&daemon->mux); | ||
80 | + mutex_unlock(&ecryptfs_daemon_hash_mux); | ||
81 | + return -EPERM; | ||
82 | + } | ||
83 | if (daemon->flags & ECRYPTFS_DAEMON_ZOMBIE) { | ||
84 | rc = 0; | ||
85 | mutex_unlock(&ecryptfs_daemon_hash_mux); | ||
86 | @@ -284,9 +296,6 @@ check_list: | ||
87 | * message from the queue; try again */ | ||
88 | goto check_list; | ||
89 | } | ||
90 | - BUG_ON(euid != daemon->euid); | ||
91 | - BUG_ON(current_user_ns() != daemon->user_ns); | ||
92 | - BUG_ON(task_pid(current) != daemon->pid); | ||
93 | msg_ctx = list_first_entry(&daemon->msg_ctx_out_queue, | ||
94 | struct ecryptfs_msg_ctx, daemon_out_list); | ||
95 | BUG_ON(!msg_ctx); | ||
96 | -- | ||
97 | 1.7.7.6 | ||
98 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0097-eCryptfs-Fix-lockdep-warning-in-miscdev-operations.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0097-eCryptfs-Fix-lockdep-warning-in-miscdev-operations.patch new file mode 100644 index 00000000..d4e453e4 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0097-eCryptfs-Fix-lockdep-warning-in-miscdev-operations.patch | |||
@@ -0,0 +1,105 @@ | |||
1 | From 3b0dfe936fb38efde98e2650ff18587c3285eb2a Mon Sep 17 00:00:00 2001 | ||
2 | From: Tyler Hicks <tyhicks@canonical.com> | ||
3 | Date: Mon, 11 Jun 2012 10:21:34 -0700 | ||
4 | Subject: [PATCH 097/109] eCryptfs: Fix lockdep warning in miscdev operations | ||
5 | |||
6 | commit 60d65f1f07a7d81d3eb3b91fc13fca80f2fdbb12 upstream. | ||
7 | |||
8 | Don't grab the daemon mutex while holding the message context mutex. | ||
9 | Addresses this lockdep warning: | ||
10 | |||
11 | ecryptfsd/2141 is trying to acquire lock: | ||
12 | (&ecryptfs_msg_ctx_arr[i].mux){+.+.+.}, at: [<ffffffffa029c213>] ecryptfs_miscdev_read+0x143/0x470 [ecryptfs] | ||
13 | |||
14 | but task is already holding lock: | ||
15 | (&(*daemon)->mux){+.+...}, at: [<ffffffffa029c2ec>] ecryptfs_miscdev_read+0x21c/0x470 [ecryptfs] | ||
16 | |||
17 | which lock already depends on the new lock. | ||
18 | |||
19 | the existing dependency chain (in reverse order) is: | ||
20 | |||
21 | -> #1 (&(*daemon)->mux){+.+...}: | ||
22 | [<ffffffff810a3b8d>] lock_acquire+0x9d/0x220 | ||
23 | [<ffffffff8151c6da>] __mutex_lock_common+0x5a/0x4b0 | ||
24 | [<ffffffff8151cc64>] mutex_lock_nested+0x44/0x50 | ||
25 | [<ffffffffa029c5d7>] ecryptfs_send_miscdev+0x97/0x120 [ecryptfs] | ||
26 | [<ffffffffa029b744>] ecryptfs_send_message+0x134/0x1e0 [ecryptfs] | ||
27 | [<ffffffffa029a24e>] ecryptfs_generate_key_packet_set+0x2fe/0xa80 [ecryptfs] | ||
28 | [<ffffffffa02960f8>] ecryptfs_write_metadata+0x108/0x250 [ecryptfs] | ||
29 | [<ffffffffa0290f80>] ecryptfs_create+0x130/0x250 [ecryptfs] | ||
30 | [<ffffffff811963a4>] vfs_create+0xb4/0x120 | ||
31 | [<ffffffff81197865>] do_last+0x8c5/0xa10 | ||
32 | [<ffffffff811998f9>] path_openat+0xd9/0x460 | ||
33 | [<ffffffff81199da2>] do_filp_open+0x42/0xa0 | ||
34 | [<ffffffff81187998>] do_sys_open+0xf8/0x1d0 | ||
35 | [<ffffffff81187a91>] sys_open+0x21/0x30 | ||
36 | [<ffffffff81527d69>] system_call_fastpath+0x16/0x1b | ||
37 | |||
38 | -> #0 (&ecryptfs_msg_ctx_arr[i].mux){+.+.+.}: | ||
39 | [<ffffffff810a3418>] __lock_acquire+0x1bf8/0x1c50 | ||
40 | [<ffffffff810a3b8d>] lock_acquire+0x9d/0x220 | ||
41 | [<ffffffff8151c6da>] __mutex_lock_common+0x5a/0x4b0 | ||
42 | [<ffffffff8151cc64>] mutex_lock_nested+0x44/0x50 | ||
43 | [<ffffffffa029c213>] ecryptfs_miscdev_read+0x143/0x470 [ecryptfs] | ||
44 | [<ffffffff811887d3>] vfs_read+0xb3/0x180 | ||
45 | [<ffffffff811888ed>] sys_read+0x4d/0x90 | ||
46 | [<ffffffff81527d69>] system_call_fastpath+0x16/0x1b | ||
47 | |||
48 | Signed-off-by: Tyler Hicks <tyhicks@canonical.com> | ||
49 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
50 | --- | ||
51 | fs/ecryptfs/miscdev.c | 25 +++++++++++++------------ | ||
52 | 1 files changed, 13 insertions(+), 12 deletions(-) | ||
53 | |||
54 | diff --git a/fs/ecryptfs/miscdev.c b/fs/ecryptfs/miscdev.c | ||
55 | index a050e4b..de42310 100644 | ||
56 | --- a/fs/ecryptfs/miscdev.c | ||
57 | +++ b/fs/ecryptfs/miscdev.c | ||
58 | @@ -195,31 +195,32 @@ int ecryptfs_send_miscdev(char *data, size_t data_size, | ||
59 | struct ecryptfs_msg_ctx *msg_ctx, u8 msg_type, | ||
60 | u16 msg_flags, struct ecryptfs_daemon *daemon) | ||
61 | { | ||
62 | - int rc = 0; | ||
63 | + struct ecryptfs_message *msg; | ||
64 | |||
65 | - mutex_lock(&msg_ctx->mux); | ||
66 | - msg_ctx->msg = kmalloc((sizeof(*msg_ctx->msg) + data_size), | ||
67 | - GFP_KERNEL); | ||
68 | - if (!msg_ctx->msg) { | ||
69 | - rc = -ENOMEM; | ||
70 | + msg = kmalloc((sizeof(*msg) + data_size), GFP_KERNEL); | ||
71 | + if (!msg) { | ||
72 | printk(KERN_ERR "%s: Out of memory whilst attempting " | ||
73 | "to kmalloc(%zd, GFP_KERNEL)\n", __func__, | ||
74 | - (sizeof(*msg_ctx->msg) + data_size)); | ||
75 | - goto out_unlock; | ||
76 | + (sizeof(*msg) + data_size)); | ||
77 | + return -ENOMEM; | ||
78 | } | ||
79 | + | ||
80 | + mutex_lock(&msg_ctx->mux); | ||
81 | + msg_ctx->msg = msg; | ||
82 | msg_ctx->msg->index = msg_ctx->index; | ||
83 | msg_ctx->msg->data_len = data_size; | ||
84 | msg_ctx->type = msg_type; | ||
85 | memcpy(msg_ctx->msg->data, data, data_size); | ||
86 | msg_ctx->msg_size = (sizeof(*msg_ctx->msg) + data_size); | ||
87 | - mutex_lock(&daemon->mux); | ||
88 | list_add_tail(&msg_ctx->daemon_out_list, &daemon->msg_ctx_out_queue); | ||
89 | + mutex_unlock(&msg_ctx->mux); | ||
90 | + | ||
91 | + mutex_lock(&daemon->mux); | ||
92 | daemon->num_queued_msg_ctx++; | ||
93 | wake_up_interruptible(&daemon->wait); | ||
94 | mutex_unlock(&daemon->mux); | ||
95 | -out_unlock: | ||
96 | - mutex_unlock(&msg_ctx->mux); | ||
97 | - return rc; | ||
98 | + | ||
99 | + return 0; | ||
100 | } | ||
101 | |||
102 | /** | ||
103 | -- | ||
104 | 1.7.7.6 | ||
105 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0098-eCryptfs-Properly-check-for-O_RDONLY-flag-before-doi.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0098-eCryptfs-Properly-check-for-O_RDONLY-flag-before-doi.patch new file mode 100644 index 00000000..2758ec07 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0098-eCryptfs-Properly-check-for-O_RDONLY-flag-before-doi.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From 590d0b9de4bb4ef7a84bb0a8a13d85353556e7ae Mon Sep 17 00:00:00 2001 | ||
2 | From: Tyler Hicks <tyhicks@canonical.com> | ||
3 | Date: Tue, 12 Jun 2012 11:17:01 -0700 | ||
4 | Subject: [PATCH 098/109] eCryptfs: Properly check for O_RDONLY flag before | ||
5 | doing privileged open | ||
6 | |||
7 | commit 9fe79d7600497ed8a95c3981cbe5b73ab98222f0 upstream. | ||
8 | |||
9 | If the first attempt at opening the lower file read/write fails, | ||
10 | eCryptfs will retry using a privileged kthread. However, the privileged | ||
11 | retry should not happen if the lower file's inode is read-only because a | ||
12 | read/write open will still be unsuccessful. | ||
13 | |||
14 | The check for determining if the open should be retried was intended to | ||
15 | be based on the access mode of the lower file's open flags being | ||
16 | O_RDONLY, but the check was incorrectly performed. This would cause the | ||
17 | open to be retried by the privileged kthread, resulting in a second | ||
18 | failed open of the lower file. This patch corrects the check to | ||
19 | determine if the open request should be handled by the privileged | ||
20 | kthread. | ||
21 | |||
22 | Signed-off-by: Tyler Hicks <tyhicks@canonical.com> | ||
23 | Reported-by: Dan Carpenter <dan.carpenter@oracle.com> | ||
24 | Acked-by: Dan Carpenter <dan.carpenter@oracle.com> | ||
25 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
26 | --- | ||
27 | fs/ecryptfs/kthread.c | 2 +- | ||
28 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
29 | |||
30 | diff --git a/fs/ecryptfs/kthread.c b/fs/ecryptfs/kthread.c | ||
31 | index 69f994a..0dbe58a 100644 | ||
32 | --- a/fs/ecryptfs/kthread.c | ||
33 | +++ b/fs/ecryptfs/kthread.c | ||
34 | @@ -149,7 +149,7 @@ int ecryptfs_privileged_open(struct file **lower_file, | ||
35 | (*lower_file) = dentry_open(lower_dentry, lower_mnt, flags, cred); | ||
36 | if (!IS_ERR(*lower_file)) | ||
37 | goto out; | ||
38 | - if (flags & O_RDONLY) { | ||
39 | + if ((flags & O_ACCMODE) == O_RDONLY) { | ||
40 | rc = PTR_ERR((*lower_file)); | ||
41 | goto out; | ||
42 | } | ||
43 | -- | ||
44 | 1.7.7.6 | ||
45 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0099-ACPI-PM-Make-acpi_pm_device_sleep_state-follow-the-s.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0099-ACPI-PM-Make-acpi_pm_device_sleep_state-follow-the-s.patch new file mode 100644 index 00000000..2b7bedaa --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0099-ACPI-PM-Make-acpi_pm_device_sleep_state-follow-the-s.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From 074935f3d2b0e862c66af5032619659b070e1ebb Mon Sep 17 00:00:00 2001 | ||
2 | From: "Rafael J. Wysocki" <rjw@sisk.pl> | ||
3 | Date: Tue, 29 May 2012 21:21:07 +0200 | ||
4 | Subject: [PATCH 099/109] ACPI / PM: Make acpi_pm_device_sleep_state() follow | ||
5 | the specification | ||
6 | |||
7 | commit dbe9a2edd17d843d80faf2b99f20a691c1853418 upstream. | ||
8 | |||
9 | The comparison between the system sleep state being entered | ||
10 | and the lowest system sleep state the given device may wake up | ||
11 | from in acpi_pm_device_sleep_state() is reversed, because the | ||
12 | specification (ACPI 5.0) says that for wakeup to work: | ||
13 | |||
14 | "The sleeping state being entered must be less than or equal to the | ||
15 | power state declared in element 1 of the _PRW object." | ||
16 | |||
17 | In other words, the state returned by _PRW is the deepest | ||
18 | (lowest-power) system sleep state the device is capable of waking up | ||
19 | the system from. | ||
20 | |||
21 | Moreover, acpi_pm_device_sleep_state() also should check if the | ||
22 | wakeup capability is supported through ACPI, because in principle it | ||
23 | may be done via native PCIe PME, for example, in which case _SxW | ||
24 | should not be evaluated. | ||
25 | |||
26 | Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> | ||
27 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
28 | --- | ||
29 | drivers/acpi/sleep.c | 4 ++-- | ||
30 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
31 | |||
32 | diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c | ||
33 | index ca191ff..ed6bc52 100644 | ||
34 | --- a/drivers/acpi/sleep.c | ||
35 | +++ b/drivers/acpi/sleep.c | ||
36 | @@ -702,8 +702,8 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p) | ||
37 | * can wake the system. _S0W may be valid, too. | ||
38 | */ | ||
39 | if (acpi_target_sleep_state == ACPI_STATE_S0 || | ||
40 | - (device_may_wakeup(dev) && | ||
41 | - adev->wakeup.sleep_state <= acpi_target_sleep_state)) { | ||
42 | + (device_may_wakeup(dev) && adev->wakeup.flags.valid && | ||
43 | + adev->wakeup.sleep_state >= acpi_target_sleep_state)) { | ||
44 | acpi_status status; | ||
45 | |||
46 | acpi_method[3] = 'W'; | ||
47 | -- | ||
48 | 1.7.7.6 | ||
49 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0100-ipheth-add-support-for-iPad.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0100-ipheth-add-support-for-iPad.patch new file mode 100644 index 00000000..1eadc881 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0100-ipheth-add-support-for-iPad.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 0c6658ce9402f6e184fad5386d86a3a2bb2a2d67 Mon Sep 17 00:00:00 2001 | ||
2 | From: Davide Gerhard <rainbow@irh.it> | ||
3 | Date: Mon, 25 Jun 2012 09:04:47 +0200 | ||
4 | Subject: [PATCH 100/109] ipheth: add support for iPad | ||
5 | |||
6 | commit 6de0298ec9c1edaf330b71b57346241ece8f3346 upstream. | ||
7 | |||
8 | This adds support for the iPad to the ipheth driver. | ||
9 | (product id = 0x129a) | ||
10 | |||
11 | Signed-off-by: Davide Gerhard <rainbow@irh.it> | ||
12 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
13 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
14 | --- | ||
15 | drivers/net/usb/ipheth.c | 5 +++++ | ||
16 | 1 files changed, 5 insertions(+), 0 deletions(-) | ||
17 | |||
18 | diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c | ||
19 | index ad96164..00ed9c1 100644 | ||
20 | --- a/drivers/net/usb/ipheth.c | ||
21 | +++ b/drivers/net/usb/ipheth.c | ||
22 | @@ -59,6 +59,7 @@ | ||
23 | #define USB_PRODUCT_IPHONE_3G 0x1292 | ||
24 | #define USB_PRODUCT_IPHONE_3GS 0x1294 | ||
25 | #define USB_PRODUCT_IPHONE_4 0x1297 | ||
26 | +#define USB_PRODUCT_IPAD 0x129a | ||
27 | #define USB_PRODUCT_IPHONE_4_VZW 0x129c | ||
28 | #define USB_PRODUCT_IPHONE_4S 0x12a0 | ||
29 | |||
30 | @@ -101,6 +102,10 @@ static struct usb_device_id ipheth_table[] = { | ||
31 | IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, | ||
32 | IPHETH_USBINTF_PROTO) }, | ||
33 | { USB_DEVICE_AND_INTERFACE_INFO( | ||
34 | + USB_VENDOR_APPLE, USB_PRODUCT_IPAD, | ||
35 | + IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, | ||
36 | + IPHETH_USBINTF_PROTO) }, | ||
37 | + { USB_DEVICE_AND_INTERFACE_INFO( | ||
38 | USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW, | ||
39 | IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, | ||
40 | IPHETH_USBINTF_PROTO) }, | ||
41 | -- | ||
42 | 1.7.7.6 | ||
43 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0101-stmmac-Fix-for-nfs-hang-on-multiple-reboot.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0101-stmmac-Fix-for-nfs-hang-on-multiple-reboot.patch new file mode 100644 index 00000000..76313cab --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0101-stmmac-Fix-for-nfs-hang-on-multiple-reboot.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | From b50133363ad0f4fa9ca46317aaa7261a21f22305 Mon Sep 17 00:00:00 2001 | ||
2 | From: Deepak Sikri <deepak.sikri@st.com> | ||
3 | Date: Sun, 8 Jul 2012 21:14:45 +0000 | ||
4 | Subject: [PATCH 101/109] stmmac: Fix for nfs hang on multiple reboot | ||
5 | |||
6 | commit 8e83989106562326bfd6aaf92174fe138efd026b upstream. | ||
7 | |||
8 | It was observed that during multiple reboots nfs hangs. The status of | ||
9 | receive descriptors shows that all the descriptors were in control of | ||
10 | CPU, and none were assigned to DMA. | ||
11 | Also the DMA status register confirmed that the Rx buffer is | ||
12 | unavailable. | ||
13 | |||
14 | This patch adds the fix for the same by adding the memory barriers to | ||
15 | ascertain that the all instructions before enabling the Rx or Tx DMA are | ||
16 | completed which involves the proper setting of the ownership bit in DMA | ||
17 | descriptors. | ||
18 | |||
19 | Signed-off-by: Deepak Sikri <deepak.sikri@st.com> | ||
20 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
21 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
22 | --- | ||
23 | drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++ | ||
24 | 1 files changed, 3 insertions(+), 0 deletions(-) | ||
25 | |||
26 | diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | ||
27 | index 72cd190..d4d2bc1 100644 | ||
28 | --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | ||
29 | +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | ||
30 | @@ -1174,6 +1174,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) | ||
31 | priv->hw->desc->prepare_tx_desc(desc, 0, len, csum_insertion); | ||
32 | wmb(); | ||
33 | priv->hw->desc->set_tx_owner(desc); | ||
34 | + wmb(); | ||
35 | } | ||
36 | |||
37 | /* Interrupt on completition only for the latest segment */ | ||
38 | @@ -1189,6 +1190,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) | ||
39 | |||
40 | /* To avoid raise condition */ | ||
41 | priv->hw->desc->set_tx_owner(first); | ||
42 | + wmb(); | ||
43 | |||
44 | priv->cur_tx++; | ||
45 | |||
46 | @@ -1252,6 +1254,7 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv) | ||
47 | } | ||
48 | wmb(); | ||
49 | priv->hw->desc->set_rx_owner(p + entry); | ||
50 | + wmb(); | ||
51 | } | ||
52 | } | ||
53 | |||
54 | -- | ||
55 | 1.7.7.6 | ||
56 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0102-bonding-debugfs-and-network-namespaces-are-incompati.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0102-bonding-debugfs-and-network-namespaces-are-incompati.patch new file mode 100644 index 00000000..9449afb6 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0102-bonding-debugfs-and-network-namespaces-are-incompati.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From 4def3e67f9744a1010a27b55034269076ea6cffc Mon Sep 17 00:00:00 2001 | ||
2 | From: "Eric W. Biederman" <ebiederm@xmission.com> | ||
3 | Date: Mon, 9 Jul 2012 10:52:43 +0000 | ||
4 | Subject: [PATCH 102/109] bonding: debugfs and network namespaces are | ||
5 | incompatible | ||
6 | |||
7 | commit 96ca7ffe748bf91f851e6aa4479aa11c8b1122ba upstream. | ||
8 | |||
9 | The bonding debugfs support has been broken in the presence of network | ||
10 | namespaces since it has been added. The debugfs support does not handle | ||
11 | multiple bonding devices with the same name in different network | ||
12 | namespaces. | ||
13 | |||
14 | I haven't had any bug reports, and I'm not interested in getting any. | ||
15 | Disable the debugfs support when network namespaces are enabled. | ||
16 | |||
17 | Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> | ||
18 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
19 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
20 | --- | ||
21 | drivers/net/bonding/bond_debugfs.c | 2 +- | ||
22 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
23 | |||
24 | diff --git a/drivers/net/bonding/bond_debugfs.c b/drivers/net/bonding/bond_debugfs.c | ||
25 | index 3680aa2..2cf084e 100644 | ||
26 | --- a/drivers/net/bonding/bond_debugfs.c | ||
27 | +++ b/drivers/net/bonding/bond_debugfs.c | ||
28 | @@ -6,7 +6,7 @@ | ||
29 | #include "bonding.h" | ||
30 | #include "bond_alb.h" | ||
31 | |||
32 | -#ifdef CONFIG_DEBUG_FS | ||
33 | +#if defined(CONFIG_DEBUG_FS) && !defined(CONFIG_NET_NS) | ||
34 | |||
35 | #include <linux/debugfs.h> | ||
36 | #include <linux/seq_file.h> | ||
37 | -- | ||
38 | 1.7.7.6 | ||
39 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0103-bonding-Manage-proc-net-bonding-entries-from-the-net.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0103-bonding-Manage-proc-net-bonding-entries-from-the-net.patch new file mode 100644 index 00000000..4180a9d1 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0103-bonding-Manage-proc-net-bonding-entries-from-the-net.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From 9a6163ec597d5cd83bb9a4ea19b64236ea8499b6 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Eric W. Biederman" <ebiederm@xmission.com> | ||
3 | Date: Mon, 9 Jul 2012 10:51:45 +0000 | ||
4 | Subject: [PATCH 103/109] bonding: Manage /proc/net/bonding/ entries from the | ||
5 | netdev events | ||
6 | |||
7 | commit a64d49c3dd504b685f9742a2f3dcb11fb8e4345f upstream. | ||
8 | |||
9 | It was recently reported that moving a bonding device between network | ||
10 | namespaces causes warnings from /proc. It turns out after the move we | ||
11 | were trying to add and to remove the /proc/net/bonding entries from the | ||
12 | wrong network namespace. | ||
13 | |||
14 | Move the bonding /proc registration code into the NETDEV_REGISTER and | ||
15 | NETDEV_UNREGISTER events where the proc registration and unregistration | ||
16 | will always happen at the right time. | ||
17 | |||
18 | Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> | ||
19 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
20 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
21 | --- | ||
22 | drivers/net/bonding/bond_main.c | 9 ++++++--- | ||
23 | 1 files changed, 6 insertions(+), 3 deletions(-) | ||
24 | |||
25 | diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c | ||
26 | index 1a88e38..6c284d1 100644 | ||
27 | --- a/drivers/net/bonding/bond_main.c | ||
28 | +++ b/drivers/net/bonding/bond_main.c | ||
29 | @@ -3184,6 +3184,12 @@ static int bond_master_netdev_event(unsigned long event, | ||
30 | switch (event) { | ||
31 | case NETDEV_CHANGENAME: | ||
32 | return bond_event_changename(event_bond); | ||
33 | + case NETDEV_UNREGISTER: | ||
34 | + bond_remove_proc_entry(event_bond); | ||
35 | + break; | ||
36 | + case NETDEV_REGISTER: | ||
37 | + bond_create_proc_entry(event_bond); | ||
38 | + break; | ||
39 | default: | ||
40 | break; | ||
41 | } | ||
42 | @@ -4391,8 +4397,6 @@ static void bond_uninit(struct net_device *bond_dev) | ||
43 | |||
44 | bond_work_cancel_all(bond); | ||
45 | |||
46 | - bond_remove_proc_entry(bond); | ||
47 | - | ||
48 | bond_debug_unregister(bond); | ||
49 | |||
50 | __hw_addr_flush(&bond->mc_list); | ||
51 | @@ -4794,7 +4798,6 @@ static int bond_init(struct net_device *bond_dev) | ||
52 | |||
53 | bond_set_lockdep_class(bond_dev); | ||
54 | |||
55 | - bond_create_proc_entry(bond); | ||
56 | list_add_tail(&bond->bond_list, &bn->dev_list); | ||
57 | |||
58 | bond_prepare_sysfs_group(bond); | ||
59 | -- | ||
60 | 1.7.7.6 | ||
61 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0104-Input-bcm5974-Add-support-for-2012-MacBook-Pro-Retin.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0104-Input-bcm5974-Add-support-for-2012-MacBook-Pro-Retin.patch new file mode 100644 index 00000000..fb73f302 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0104-Input-bcm5974-Add-support-for-2012-MacBook-Pro-Retin.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | From d622494f403ba2a79ac08f83e7b016d0687c4ce5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Henrik Rydberg <rydberg@euromail.se> | ||
3 | Date: Tue, 10 Jul 2012 09:43:57 -0700 | ||
4 | Subject: [PATCH 104/109] Input: bcm5974 - Add support for 2012 MacBook Pro | ||
5 | Retina | ||
6 | |||
7 | commit 3dde22a98e94eb18527f0ff0068fb2fb945e58d4 upstream. | ||
8 | |||
9 | Add support for the 15'' MacBook Pro Retina model (MacBookPro10,1). | ||
10 | |||
11 | Patch originally written by clipcarl (forums.opensuse.org). | ||
12 | |||
13 | Signed-off-by: Henrik Rydberg <rydberg@euromail.se> | ||
14 | Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> | ||
15 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
16 | --- | ||
17 | drivers/input/mouse/bcm5974.c | 20 ++++++++++++++++++++ | ||
18 | 1 files changed, 20 insertions(+), 0 deletions(-) | ||
19 | |||
20 | diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c | ||
21 | index 5ec617e..ec58f48 100644 | ||
22 | --- a/drivers/input/mouse/bcm5974.c | ||
23 | +++ b/drivers/input/mouse/bcm5974.c | ||
24 | @@ -79,6 +79,10 @@ | ||
25 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI 0x0252 | ||
26 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO 0x0253 | ||
27 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS 0x0254 | ||
28 | +/* MacbookPro10,1 (unibody, June 2012) */ | ||
29 | +#define USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI 0x0262 | ||
30 | +#define USB_DEVICE_ID_APPLE_WELLSPRING7_ISO 0x0263 | ||
31 | +#define USB_DEVICE_ID_APPLE_WELLSPRING7_JIS 0x0264 | ||
32 | |||
33 | #define BCM5974_DEVICE(prod) { \ | ||
34 | .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \ | ||
35 | @@ -128,6 +132,10 @@ static const struct usb_device_id bcm5974_table[] = { | ||
36 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI), | ||
37 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO), | ||
38 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS), | ||
39 | + /* MacbookPro10,1 */ | ||
40 | + BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI), | ||
41 | + BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_ISO), | ||
42 | + BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_JIS), | ||
43 | /* Terminating entry */ | ||
44 | {} | ||
45 | }; | ||
46 | @@ -354,6 +362,18 @@ static const struct bcm5974_config bcm5974_config_table[] = { | ||
47 | { DIM_X, DIM_X / SN_COORD, -4620, 5140 }, | ||
48 | { DIM_Y, DIM_Y / SN_COORD, -150, 6600 } | ||
49 | }, | ||
50 | + { | ||
51 | + USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI, | ||
52 | + USB_DEVICE_ID_APPLE_WELLSPRING7_ISO, | ||
53 | + USB_DEVICE_ID_APPLE_WELLSPRING7_JIS, | ||
54 | + HAS_INTEGRATED_BUTTON, | ||
55 | + 0x84, sizeof(struct bt_data), | ||
56 | + 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, | ||
57 | + { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 }, | ||
58 | + { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, | ||
59 | + { DIM_X, DIM_X / SN_COORD, -4750, 5280 }, | ||
60 | + { DIM_Y, DIM_Y / SN_COORD, -150, 6730 } | ||
61 | + }, | ||
62 | {} | ||
63 | }; | ||
64 | |||
65 | -- | ||
66 | 1.7.7.6 | ||
67 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0105-Input-xpad-handle-all-variations-of-Mad-Catz-Beat-Pa.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0105-Input-xpad-handle-all-variations-of-Mad-Catz-Beat-Pa.patch new file mode 100644 index 00000000..cf26e8f0 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0105-Input-xpad-handle-all-variations-of-Mad-Catz-Beat-Pa.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From f8acffc53848df78a3d1683f4ab3f1236a20512d Mon Sep 17 00:00:00 2001 | ||
2 | From: Yuri Khan <yurivkhan@gmail.com> | ||
3 | Date: Wed, 11 Jul 2012 00:49:18 -0700 | ||
4 | Subject: [PATCH 105/109] Input: xpad - handle all variations of Mad Catz Beat | ||
5 | Pad | ||
6 | |||
7 | commit 3ffb62cb9ac2430c2504c6ff9727d0f2476ef0bd upstream. | ||
8 | |||
9 | The device should be handled by xpad driver instead of generic HID driver. | ||
10 | |||
11 | Signed-off-by: Yuri Khan <yurivkhan@gmail.com> | ||
12 | Acked-by: Jiri Kosina <jkosina@suse.cz> | ||
13 | Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> | ||
14 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
15 | --- | ||
16 | drivers/hid/hid-core.c | 1 + | ||
17 | drivers/hid/hid-ids.h | 3 +++ | ||
18 | drivers/input/joystick/xpad.c | 1 + | ||
19 | 3 files changed, 5 insertions(+), 0 deletions(-) | ||
20 | |||
21 | diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c | ||
22 | index c27b402..cfa053e 100644 | ||
23 | --- a/drivers/hid/hid-core.c | ||
24 | +++ b/drivers/hid/hid-core.c | ||
25 | @@ -1884,6 +1884,7 @@ static const struct hid_device_id hid_ignore_list[] = { | ||
26 | { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MCT) }, | ||
27 | { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HYBRID) }, | ||
28 | { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HEATCONTROL) }, | ||
29 | + { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_BEATPAD) }, | ||
30 | { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1024LS) }, | ||
31 | { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1208LS) }, | ||
32 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT1) }, | ||
33 | diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h | ||
34 | index fba3fc4..07a91a0 100644 | ||
35 | --- a/drivers/hid/hid-ids.h | ||
36 | +++ b/drivers/hid/hid-ids.h | ||
37 | @@ -491,6 +491,9 @@ | ||
38 | #define USB_DEVICE_ID_CRYSTALTOUCH 0x0006 | ||
39 | #define USB_DEVICE_ID_CRYSTALTOUCH_DUAL 0x0007 | ||
40 | |||
41 | +#define USB_VENDOR_ID_MADCATZ 0x0738 | ||
42 | +#define USB_DEVICE_ID_MADCATZ_BEATPAD 0x4540 | ||
43 | + | ||
44 | #define USB_VENDOR_ID_MCC 0x09db | ||
45 | #define USB_DEVICE_ID_MCC_PMD1024LS 0x0076 | ||
46 | #define USB_DEVICE_ID_MCC_PMD1208LS 0x007a | ||
47 | diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c | ||
48 | index d728875..a2daf38 100644 | ||
49 | --- a/drivers/input/joystick/xpad.c | ||
50 | +++ b/drivers/input/joystick/xpad.c | ||
51 | @@ -238,6 +238,7 @@ static struct usb_device_id xpad_table [] = { | ||
52 | XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */ | ||
53 | XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */ | ||
54 | XPAD_XBOX360_VENDOR(0x0738), /* Mad Catz X-Box 360 controllers */ | ||
55 | + { USB_DEVICE(0x0738, 0x4540) }, /* Mad Catz Beat Pad */ | ||
56 | XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f X-Box 360 controllers */ | ||
57 | XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */ | ||
58 | XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */ | ||
59 | -- | ||
60 | 1.7.7.6 | ||
61 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0106-Input-xpad-add-signature-for-Razer-Onza-Tournament-E.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0106-Input-xpad-add-signature-for-Razer-Onza-Tournament-E.patch new file mode 100644 index 00000000..4dff8595 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0106-Input-xpad-add-signature-for-Razer-Onza-Tournament-E.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From 08a3e81aa5cc67fd0ce0b2f9608aaec9f497ca11 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ilia Katsnelson <k0009000@gmail.com> | ||
3 | Date: Wed, 11 Jul 2012 00:54:20 -0700 | ||
4 | Subject: [PATCH 106/109] Input: xpad - add signature for Razer Onza | ||
5 | Tournament Edition | ||
6 | |||
7 | commit cc71a7e899cc6b2ff41e1be48756782ed004d802 upstream. | ||
8 | |||
9 | Signed-off-by: Ilia Katsnelson <k0009000@gmail.com> | ||
10 | Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> | ||
11 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
12 | --- | ||
13 | drivers/input/joystick/xpad.c | 4 +++- | ||
14 | 1 files changed, 3 insertions(+), 1 deletions(-) | ||
15 | |||
16 | diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c | ||
17 | index a2daf38..ddfabc4 100644 | ||
18 | --- a/drivers/input/joystick/xpad.c | ||
19 | +++ b/drivers/input/joystick/xpad.c | ||
20 | @@ -164,6 +164,7 @@ static const struct xpad_device { | ||
21 | { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, | ||
22 | { 0x0f0d, 0x0016, "Hori Real Arcade Pro.EX", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, | ||
23 | { 0x0f0d, 0x000d, "Hori Fighting Stick EX2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, | ||
24 | + { 0x1689, 0xfd00, "Razer Onza Tournament Edition", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, | ||
25 | { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX }, | ||
26 | { 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN } | ||
27 | }; | ||
28 | @@ -244,7 +245,8 @@ static struct usb_device_id xpad_table [] = { | ||
29 | XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */ | ||
30 | XPAD_XBOX360_VENDOR(0x146b), /* BigBen Interactive Controllers */ | ||
31 | XPAD_XBOX360_VENDOR(0x1bad), /* Harminix Rock Band Guitar and Drums */ | ||
32 | - XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */ | ||
33 | + XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */ | ||
34 | + XPAD_XBOX360_VENDOR(0x1689), /* Razer Onza */ | ||
35 | { } | ||
36 | }; | ||
37 | |||
38 | -- | ||
39 | 1.7.7.6 | ||
40 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0107-Input-xpad-add-Andamiro-Pump-It-Up-pad.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0107-Input-xpad-add-Andamiro-Pump-It-Up-pad.patch new file mode 100644 index 00000000..d591ad18 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0107-Input-xpad-add-Andamiro-Pump-It-Up-pad.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From 5c62e66de78b65d8dd3f21df7d856eaefc694c8e Mon Sep 17 00:00:00 2001 | ||
2 | From: Yuri Khan <yurivkhan@gmail.com> | ||
3 | Date: Wed, 11 Jul 2012 22:12:31 -0700 | ||
4 | Subject: [PATCH 107/109] Input: xpad - add Andamiro Pump It Up pad | ||
5 | |||
6 | commit e76b8ee25e034ab601b525abb95cea14aa167ed3 upstream. | ||
7 | |||
8 | I couldn't find the vendor ID in any of the online databases, but this | ||
9 | mat has a Pump It Up logo on the top side of the controller compartment, | ||
10 | and a disclaimer stating that Andamiro will not be liable on the bottom. | ||
11 | |||
12 | Signed-off-by: Yuri Khan <yurivkhan@gmail.com> | ||
13 | Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> | ||
14 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
15 | --- | ||
16 | drivers/input/joystick/xpad.c | 1 + | ||
17 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
18 | |||
19 | diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c | ||
20 | index ddfabc4..2189cbf 100644 | ||
21 | --- a/drivers/input/joystick/xpad.c | ||
22 | +++ b/drivers/input/joystick/xpad.c | ||
23 | @@ -142,6 +142,7 @@ static const struct xpad_device { | ||
24 | { 0x0c12, 0x880a, "Pelican Eclipse PL-2023", 0, XTYPE_XBOX }, | ||
25 | { 0x0c12, 0x8810, "Zeroplus Xbox Controller", 0, XTYPE_XBOX }, | ||
26 | { 0x0c12, 0x9902, "HAMA VibraX - *FAULTY HARDWARE*", 0, XTYPE_XBOX }, | ||
27 | + { 0x0d2f, 0x0002, "Andamiro Pump It Up pad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, | ||
28 | { 0x0e4c, 0x1097, "Radica Gamester Controller", 0, XTYPE_XBOX }, | ||
29 | { 0x0e4c, 0x2390, "Radica Games Jtech Controller", 0, XTYPE_XBOX }, | ||
30 | { 0x0e6f, 0x0003, "Logic3 Freebird wireless Controller", 0, XTYPE_XBOX }, | ||
31 | -- | ||
32 | 1.7.7.6 | ||
33 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0108-HID-add-support-for-2012-MacBook-Pro-Retina.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0108-HID-add-support-for-2012-MacBook-Pro-Retina.patch new file mode 100644 index 00000000..fd76af3f --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0108-HID-add-support-for-2012-MacBook-Pro-Retina.patch | |||
@@ -0,0 +1,85 @@ | |||
1 | From 4be420efc64c25fbe44fbc002e74c117d652a1d5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ryan Bourgeois <bluedragonx@gmail.com> | ||
3 | Date: Tue, 10 Jul 2012 09:43:33 -0700 | ||
4 | Subject: [PATCH 108/109] HID: add support for 2012 MacBook Pro Retina | ||
5 | |||
6 | commit b2e6ad7dfe26aac5bf136962d0b11d180b820d44 upstream. | ||
7 | |||
8 | Add support for the 15'' MacBook Pro Retina. The keyboard is | ||
9 | the same as recent models. | ||
10 | |||
11 | The patch needs to be synchronized with the bcm5974 patch for | ||
12 | the trackpad - as usual. | ||
13 | |||
14 | Patch originally written by clipcarl (forums.opensuse.org). | ||
15 | |||
16 | [rydberg@euromail.se: Amended mouse ignore lines] | ||
17 | Signed-off-by: Ryan Bourgeois <bluedragonx@gmail.com> | ||
18 | Signed-off-by: Henrik Rydberg <rydberg@euromail.se> | ||
19 | Acked-by: Jiri Kosina <jkosina@suse.cz> | ||
20 | Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> | ||
21 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
22 | --- | ||
23 | drivers/hid/hid-apple.c | 6 ++++++ | ||
24 | drivers/hid/hid-core.c | 6 ++++++ | ||
25 | drivers/hid/hid-ids.h | 3 +++ | ||
26 | 3 files changed, 15 insertions(+), 0 deletions(-) | ||
27 | |||
28 | diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c | ||
29 | index 299d238..899c712 100644 | ||
30 | --- a/drivers/hid/hid-apple.c | ||
31 | +++ b/drivers/hid/hid-apple.c | ||
32 | @@ -514,6 +514,12 @@ static const struct hid_device_id apple_devices[] = { | ||
33 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, | ||
34 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS), | ||
35 | .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, | ||
36 | + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI), | ||
37 | + .driver_data = APPLE_HAS_FN }, | ||
38 | + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO), | ||
39 | + .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, | ||
40 | + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS), | ||
41 | + .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, | ||
42 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), | ||
43 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, | ||
44 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO), | ||
45 | diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c | ||
46 | index cfa053e..95430a0 100644 | ||
47 | --- a/drivers/hid/hid-core.c | ||
48 | +++ b/drivers/hid/hid-core.c | ||
49 | @@ -1374,6 +1374,9 @@ static const struct hid_device_id hid_have_special_driver[] = { | ||
50 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI) }, | ||
51 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO) }, | ||
52 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS) }, | ||
53 | + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI) }, | ||
54 | + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO) }, | ||
55 | + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS) }, | ||
56 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) }, | ||
57 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) }, | ||
58 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) }, | ||
59 | @@ -1969,6 +1972,9 @@ static const struct hid_device_id hid_mouse_ignore_list[] = { | ||
60 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI) }, | ||
61 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO) }, | ||
62 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS) }, | ||
63 | + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI) }, | ||
64 | + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO) }, | ||
65 | + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS) }, | ||
66 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, | ||
67 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, | ||
68 | { } | ||
69 | diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h | ||
70 | index 07a91a0..7db934d 100644 | ||
71 | --- a/drivers/hid/hid-ids.h | ||
72 | +++ b/drivers/hid/hid-ids.h | ||
73 | @@ -125,6 +125,9 @@ | ||
74 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI 0x024c | ||
75 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO 0x024d | ||
76 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_JIS 0x024e | ||
77 | +#define USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI 0x0262 | ||
78 | +#define USB_DEVICE_ID_APPLE_WELLSPRING7_ISO 0x0263 | ||
79 | +#define USB_DEVICE_ID_APPLE_WELLSPRING7_JIS 0x0264 | ||
80 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI 0x0239 | ||
81 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO 0x023a | ||
82 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b | ||
83 | -- | ||
84 | 1.7.7.6 | ||
85 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0109-Linux-3.2.24.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0109-Linux-3.2.24.patch new file mode 100644 index 00000000..7c4e2acf --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0109-Linux-3.2.24.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | From b356d49fb84a5f890bd91feedf0d67078e27a3a9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ben Hutchings <ben@decadent.org.uk> | ||
3 | Date: Wed, 25 Jul 2012 04:11:50 +0100 | ||
4 | Subject: [PATCH 109/109] Linux 3.2.24 | ||
5 | |||
6 | --- | ||
7 | Makefile | 2 +- | ||
8 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
9 | |||
10 | diff --git a/Makefile b/Makefile | ||
11 | index 40d1e3b..80bb4fd 100644 | ||
12 | --- a/Makefile | ||
13 | +++ b/Makefile | ||
14 | @@ -1,6 +1,6 @@ | ||
15 | VERSION = 3 | ||
16 | PATCHLEVEL = 2 | ||
17 | -SUBLEVEL = 23 | ||
18 | +SUBLEVEL = 24 | ||
19 | EXTRAVERSION = | ||
20 | NAME = Saber-toothed Squirrel | ||
21 | |||
22 | -- | ||
23 | 1.7.7.6 | ||
24 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0001-mm-reduce-the-amount-of-work-done-when-updating-min_.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0001-mm-reduce-the-amount-of-work-done-when-updating-min_.patch new file mode 100644 index 00000000..d7cf5811 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0001-mm-reduce-the-amount-of-work-done-when-updating-min_.patch | |||
@@ -0,0 +1,88 @@ | |||
1 | From ce43a5bb3c28d87f36ff91fcc2fc210db2b6fd4b Mon Sep 17 00:00:00 2001 | ||
2 | From: Mel Gorman <mgorman@suse.de> | ||
3 | Date: Tue, 10 Jan 2012 15:07:14 -0800 | ||
4 | Subject: [PATCH 01/73] mm: reduce the amount of work done when updating | ||
5 | min_free_kbytes | ||
6 | |||
7 | commit 938929f14cb595f43cd1a4e63e22d36cab1e4a1f upstream. | ||
8 | |||
9 | Stable note: Fixes https://bugzilla.novell.com/show_bug.cgi?id=726210 . | ||
10 | Large machines with 1TB or more of RAM take a long time to boot | ||
11 | without this patch and may spew out soft lockup warnings. | ||
12 | |||
13 | When min_free_kbytes is updated, some pageblocks are marked | ||
14 | MIGRATE_RESERVE. Ordinarily, this work is unnoticable as it happens early | ||
15 | in boot but on large machines with 1TB of memory, this has been reported | ||
16 | to delay boot times, probably due to the NUMA distances involved. | ||
17 | |||
18 | The bulk of the work is due to calling calling pageblock_is_reserved() an | ||
19 | unnecessary amount of times and accessing far more struct page metadata | ||
20 | than is necessary. This patch significantly reduces the amount of work | ||
21 | done by setup_zone_migrate_reserve() improving boot times on 1TB machines. | ||
22 | |||
23 | [akpm@linux-foundation.org: coding-style fixes] | ||
24 | Signed-off-by: Mel Gorman <mgorman@suse.de> | ||
25 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
26 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
27 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
28 | --- | ||
29 | mm/page_alloc.c | 40 ++++++++++++++++++++++++---------------- | ||
30 | 1 files changed, 24 insertions(+), 16 deletions(-) | ||
31 | |||
32 | diff --git a/mm/page_alloc.c b/mm/page_alloc.c | ||
33 | index 485be89..cb3460e 100644 | ||
34 | --- a/mm/page_alloc.c | ||
35 | +++ b/mm/page_alloc.c | ||
36 | @@ -3407,25 +3407,33 @@ static void setup_zone_migrate_reserve(struct zone *zone) | ||
37 | if (page_to_nid(page) != zone_to_nid(zone)) | ||
38 | continue; | ||
39 | |||
40 | - /* Blocks with reserved pages will never free, skip them. */ | ||
41 | - block_end_pfn = min(pfn + pageblock_nr_pages, end_pfn); | ||
42 | - if (pageblock_is_reserved(pfn, block_end_pfn)) | ||
43 | - continue; | ||
44 | - | ||
45 | block_migratetype = get_pageblock_migratetype(page); | ||
46 | |||
47 | - /* If this block is reserved, account for it */ | ||
48 | - if (reserve > 0 && block_migratetype == MIGRATE_RESERVE) { | ||
49 | - reserve--; | ||
50 | - continue; | ||
51 | - } | ||
52 | + /* Only test what is necessary when the reserves are not met */ | ||
53 | + if (reserve > 0) { | ||
54 | + /* | ||
55 | + * Blocks with reserved pages will never free, skip | ||
56 | + * them. | ||
57 | + */ | ||
58 | + block_end_pfn = min(pfn + pageblock_nr_pages, end_pfn); | ||
59 | + if (pageblock_is_reserved(pfn, block_end_pfn)) | ||
60 | + continue; | ||
61 | |||
62 | - /* Suitable for reserving if this block is movable */ | ||
63 | - if (reserve > 0 && block_migratetype == MIGRATE_MOVABLE) { | ||
64 | - set_pageblock_migratetype(page, MIGRATE_RESERVE); | ||
65 | - move_freepages_block(zone, page, MIGRATE_RESERVE); | ||
66 | - reserve--; | ||
67 | - continue; | ||
68 | + /* If this block is reserved, account for it */ | ||
69 | + if (block_migratetype == MIGRATE_RESERVE) { | ||
70 | + reserve--; | ||
71 | + continue; | ||
72 | + } | ||
73 | + | ||
74 | + /* Suitable for reserving if this block is movable */ | ||
75 | + if (block_migratetype == MIGRATE_MOVABLE) { | ||
76 | + set_pageblock_migratetype(page, | ||
77 | + MIGRATE_RESERVE); | ||
78 | + move_freepages_block(zone, page, | ||
79 | + MIGRATE_RESERVE); | ||
80 | + reserve--; | ||
81 | + continue; | ||
82 | + } | ||
83 | } | ||
84 | |||
85 | /* | ||
86 | -- | ||
87 | 1.7.7.6 | ||
88 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0002-mm-compaction-allow-compaction-to-isolate-dirty-page.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0002-mm-compaction-allow-compaction-to-isolate-dirty-page.patch new file mode 100644 index 00000000..cbcecd14 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0002-mm-compaction-allow-compaction-to-isolate-dirty-page.patch | |||
@@ -0,0 +1,436 @@ | |||
1 | From 50bec8b86d1ffdec691586e017499cb3f5e0b6a0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mel Gorman <mgorman@suse.de> | ||
3 | Date: Thu, 12 Jan 2012 17:19:22 -0800 | ||
4 | Subject: [PATCH 02/73] mm: compaction: allow compaction to isolate dirty | ||
5 | pages | ||
6 | |||
7 | commit a77ebd333cd810d7b680d544be88c875131c2bd3 upstream. | ||
8 | |||
9 | Stable note: Not tracked in Bugzilla. A fix aimed at preserving page aging | ||
10 | information by reducing LRU list churning had the side-effect of | ||
11 | reducing THP allocation success rates. This was part of a series | ||
12 | to restore the success rates while preserving the reclaim fix. | ||
13 | |||
14 | Short summary: There are severe stalls when a USB stick using VFAT is | ||
15 | used with THP enabled that are reduced by this series. If you are | ||
16 | experiencing this problem, please test and report back and considering I | ||
17 | have seen complaints from openSUSE and Fedora users on this as well as a | ||
18 | few private mails, I'm guessing it's a widespread issue. This is a new | ||
19 | type of USB-related stall because it is due to synchronous compaction | ||
20 | writing where as in the past the big problem was dirty pages reaching | ||
21 | the end of the LRU and being written by reclaim. | ||
22 | |||
23 | Am cc'ing Andrew this time and this series would replace | ||
24 | mm-do-not-stall-in-synchronous-compaction-for-thp-allocations.patch. | ||
25 | I'm also cc'ing Dave Jones as he might have merged that patch to Fedora | ||
26 | for wider testing and ideally it would be reverted and replaced by this | ||
27 | series. | ||
28 | |||
29 | That said, the later patches could really do with some review. If this | ||
30 | series is not the answer then a new direction needs to be discussed | ||
31 | because as it is, the stalls are unacceptable as the results in this | ||
32 | leader show. | ||
33 | |||
34 | For testers that try backporting this to 3.1, it won't work because | ||
35 | there is a non-obvious dependency on not writing back pages in direct | ||
36 | reclaim so you need those patches too. | ||
37 | |||
38 | Changelog since V5 | ||
39 | o Rebase to 3.2-rc5 | ||
40 | o Tidy up the changelogs a bit | ||
41 | |||
42 | Changelog since V4 | ||
43 | o Added reviewed-bys, credited Andrea properly for sync-light | ||
44 | o Allow dirty pages without mappings to be considered for migration | ||
45 | o Bound the number of pages freed for compaction | ||
46 | o Isolate PageReclaim pages on their own LRU list | ||
47 | |||
48 | This is against 3.2-rc5 and follows on from discussions on "mm: Do | ||
49 | not stall in synchronous compaction for THP allocations" and "[RFC | ||
50 | PATCH 0/5] Reduce compaction-related stalls". Initially, the proposed | ||
51 | patch eliminated stalls due to compaction which sometimes resulted in | ||
52 | user-visible interactivity problems on browsers by simply never using | ||
53 | sync compaction. The downside was that THP success allocation rates | ||
54 | were lower because dirty pages were not being migrated as reported by | ||
55 | Andrea. His approach at fixing this was nacked on the grounds that | ||
56 | it reverted fixes from Rik merged that reduced the amount of pages | ||
57 | reclaimed as it severely impacted his workloads performance. | ||
58 | |||
59 | This series attempts to reconcile the requirements of maximising THP | ||
60 | usage, without stalling in a user-visible fashion due to compaction | ||
61 | or cheating by reclaiming an excessive number of pages. | ||
62 | |||
63 | Patch 1 partially reverts commit 39deaf85 to allow migration to isolate | ||
64 | dirty pages. This is because migration can move some dirty | ||
65 | pages without blocking. | ||
66 | |||
67 | Patch 2 notes that the /proc/sys/vm/compact_memory handler is not using | ||
68 | synchronous compaction when it should be. This is unrelated | ||
69 | to the reported stalls but is worth fixing. | ||
70 | |||
71 | Patch 3 checks if we isolated a compound page during lumpy scan and | ||
72 | account for it properly. For the most part, this affects | ||
73 | tracing so it's unrelated to the stalls but worth fixing. | ||
74 | |||
75 | Patch 4 notes that it is possible to abort reclaim early for compaction | ||
76 | and return 0 to the page allocator potentially entering the | ||
77 | "may oom" path. This has not been observed in practice but | ||
78 | the rest of the series potentially makes it easier to happen. | ||
79 | |||
80 | Patch 5 adds a sync parameter to the migratepage callback and gives | ||
81 | the callback responsibility for migrating the page without | ||
82 | blocking if sync==false. For example, fallback_migrate_page | ||
83 | will not call writepage if sync==false. This increases the | ||
84 | number of pages that can be handled by asynchronous compaction | ||
85 | thereby reducing stalls. | ||
86 | |||
87 | Patch 6 restores filter-awareness to isolate_lru_page for migration. | ||
88 | In practice, it means that pages under writeback and pages | ||
89 | without a ->migratepage callback will not be isolated | ||
90 | for migration. | ||
91 | |||
92 | Patch 7 avoids calling direct reclaim if compaction is deferred but | ||
93 | makes sure that compaction is only deferred if sync | ||
94 | compaction was used. | ||
95 | |||
96 | Patch 8 introduces a sync-light migration mechanism that sync compaction | ||
97 | uses. The objective is to allow some stalls but to not call | ||
98 | ->writepage which can lead to significant user-visible stalls. | ||
99 | |||
100 | Patch 9 notes that while we want to abort reclaim ASAP to allow | ||
101 | compation to go ahead that we leave a very small window of | ||
102 | opportunity for compaction to run. This patch allows more pages | ||
103 | to be freed by reclaim but bounds the number to a reasonable | ||
104 | level based on the high watermark on each zone. | ||
105 | |||
106 | Patch 10 allows slabs to be shrunk even after compaction_ready() is | ||
107 | true for one zone. This is to avoid a problem whereby a single | ||
108 | small zone can abort reclaim even though no pages have been | ||
109 | reclaimed and no suitably large zone is in a usable state. | ||
110 | |||
111 | Patch 11 fixes a problem with the rate of page scanning. As reclaim is | ||
112 | rarely stalling on pages under writeback it means that scan | ||
113 | rates are very high. This is particularly true for direct | ||
114 | reclaim which is not calling writepage. The vmstat figures | ||
115 | implied that much of this was busy work with PageReclaim pages | ||
116 | marked for immediate reclaim. This patch is a prototype that | ||
117 | moves these pages to their own LRU list. | ||
118 | |||
119 | This has been tested and other than 2 USB keys getting trashed, | ||
120 | nothing horrible fell out. That said, I am a bit unhappy with the | ||
121 | rescue logic in patch 11 but did not find a better way around it. It | ||
122 | does significantly reduce scan rates and System CPU time indicating | ||
123 | it is the right direction to take. | ||
124 | |||
125 | What is of critical importance is that stalls due to compaction | ||
126 | are massively reduced even though sync compaction was still | ||
127 | allowed. Testing from people complaining about stalls copying to USBs | ||
128 | with THP enabled are particularly welcome. | ||
129 | |||
130 | The following tests all involve THP usage and USB keys in some | ||
131 | way. Each test follows this type of pattern | ||
132 | |||
133 | 1. Read from some fast fast storage, be it raw device or file. Each time | ||
134 | the copy finishes, start again until the test ends | ||
135 | 2. Write a large file to a filesystem on a USB stick. Each time the copy | ||
136 | finishes, start again until the test ends | ||
137 | 3. When memory is low, start an alloc process that creates a mapping | ||
138 | the size of physical memory to stress THP allocation. This is the | ||
139 | "real" part of the test and the part that is meant to trigger | ||
140 | stalls when THP is enabled. Copying continues in the background. | ||
141 | 4. Record the CPU usage and time to execute of the alloc process | ||
142 | 5. Record the number of THP allocs and fallbacks as well as the number of THP | ||
143 | pages in use a the end of the test just before alloc exited | ||
144 | 6. Run the test 5 times to get an idea of variability | ||
145 | 7. Between each run, sync is run and caches dropped and the test | ||
146 | waits until nr_dirty is a small number to avoid interference | ||
147 | or caching between iterations that would skew the figures. | ||
148 | |||
149 | The individual tests were then | ||
150 | |||
151 | writebackCPDeviceBasevfat | ||
152 | Disable THP, read from a raw device (sda), vfat on USB stick | ||
153 | writebackCPDeviceBaseext4 | ||
154 | Disable THP, read from a raw device (sda), ext4 on USB stick | ||
155 | writebackCPDevicevfat | ||
156 | THP enabled, read from a raw device (sda), vfat on USB stick | ||
157 | writebackCPDeviceext4 | ||
158 | THP enabled, read from a raw device (sda), ext4 on USB stick | ||
159 | writebackCPFilevfat | ||
160 | THP enabled, read from a file on fast storage and USB, both vfat | ||
161 | writebackCPFileext4 | ||
162 | THP enabled, read from a file on fast storage and USB, both ext4 | ||
163 | |||
164 | The kernels tested were | ||
165 | |||
166 | 3.1 3.1 | ||
167 | vanilla 3.2-rc5 | ||
168 | freemore Patches 1-10 | ||
169 | immediate Patches 1-11 | ||
170 | andrea The 8 patches Andrea posted as a basis of comparison | ||
171 | |||
172 | The results are very long unfortunately. I'll start with the case | ||
173 | where we are not using THP at all | ||
174 | |||
175 | writebackCPDeviceBasevfat | ||
176 | 3.1.0-vanilla rc5-vanilla freemore-v6r1 isolate-v6r1 andrea-v2r1 | ||
177 | System Time 1.28 ( 0.00%) 54.49 (-4143.46%) 48.63 (-3687.69%) 4.69 ( -265.11%) 51.88 (-3940.81%) | ||
178 | +/- 0.06 ( 0.00%) 2.45 (-4305.55%) 4.75 (-8430.57%) 7.46 (-13282.76%) 4.76 (-8440.70%) | ||
179 | User Time 0.09 ( 0.00%) 0.05 ( 40.91%) 0.06 ( 29.55%) 0.07 ( 15.91%) 0.06 ( 27.27%) | ||
180 | +/- 0.02 ( 0.00%) 0.01 ( 45.39%) 0.02 ( 25.07%) 0.00 ( 77.06%) 0.01 ( 52.24%) | ||
181 | Elapsed Time 110.27 ( 0.00%) 56.38 ( 48.87%) 49.95 ( 54.70%) 11.77 ( 89.33%) 53.43 ( 51.54%) | ||
182 | +/- 7.33 ( 0.00%) 3.77 ( 48.61%) 4.94 ( 32.63%) 6.71 ( 8.50%) 4.76 ( 35.03%) | ||
183 | THP Active 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) | ||
184 | +/- 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) | ||
185 | Fault Alloc 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) | ||
186 | +/- 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) | ||
187 | Fault Fallback 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) | ||
188 | +/- 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) 0.00 ( 0.00%) | ||
189 | |||
190 | The THP figures are obviously all 0 because THP was enabled. The | ||
191 | main thing to watch is the elapsed times and how they compare to | ||
192 | times when THP is enabled later. It's also important to note that | ||
193 | elapsed time is improved by this series as System CPu time is much | ||
194 | reduced. | ||
195 | |||
196 | writebackCPDevicevfat | ||
197 | |||
198 | 3.1.0-vanilla rc5-vanilla freemore-v6r1 isolate-v6r1 andrea-v2r1 | ||
199 | System Time 1.22 ( 0.00%) 13.89 (-1040.72%) 46.40 (-3709.20%) 4.44 ( -264.37%) 47.37 (-3789.33%) | ||
200 | +/- 0.06 ( 0.00%) 22.82 (-37635.56%) 3.84 (-6249.44%) 6.48 (-10618.92%) 6.60 | ||
201 | (-10818.53%) | ||
202 | User Time 0.06 ( 0.00%) 0.06 ( -6.90%) 0.05 ( 17.24%) 0.05 ( 13.79%) 0.04 ( 31.03%) | ||
203 | +/- 0.01 ( 0.00%) 0.01 ( 33.33%) 0.01 ( 33.33%) 0.01 ( 39.14%) 0.01 ( 25.46%) | ||
204 | Elapsed Time 10445.54 ( 0.00%) 2249.92 ( 78.46%) 70.06 ( 99.33%) 16.59 ( 99.84%) 472.43 ( | ||
205 | 95.48%) | ||
206 | +/- 643.98 ( 0.00%) 811.62 ( -26.03%) 10.02 ( 98.44%) 7.03 ( 98.91%) 59.99 ( 90.68%) | ||
207 | THP Active 15.60 ( 0.00%) 35.20 ( 225.64%) 65.00 ( 416.67%) 70.80 ( 453.85%) 62.20 ( 398.72%) | ||
208 | +/- 18.48 ( 0.00%) 51.29 ( 277.59%) 15.99 ( 86.52%) 37.91 ( 205.18%) 22.02 ( 119.18%) | ||
209 | Fault Alloc 121.80 ( 0.00%) 76.60 ( 62.89%) 155.40 ( 127.59%) 181.20 ( 148.77%) 286.60 ( 235.30%) | ||
210 | +/- 73.51 ( 0.00%) 61.11 ( 83.12%) 34.89 ( 47.46%) 31.88 ( 43.36%) 68.13 ( 92.68%) | ||
211 | Fault Fallback 881.20 ( 0.00%) 926.60 ( -5.15%) 847.60 ( 3.81%) 822.00 ( 6.72%) 716.60 ( 18.68%) | ||
212 | +/- 73.51 ( 0.00%) 61.26 ( 16.67%) 34.89 ( 52.54%) 31.65 ( 56.94%) 67.75 ( 7.84%) | ||
213 | MMTests Statistics: duration | ||
214 | User/Sys Time Running Test (seconds) 3540.88 1945.37 716.04 64.97 1937.03 | ||
215 | Total Elapsed Time (seconds) 52417.33 11425.90 501.02 230.95 2520.28 | ||
216 | |||
217 | The first thing to note is the "Elapsed Time" for the vanilla kernels | ||
218 | of 2249 seconds versus 56 with THP disabled which might explain the | ||
219 | reports of USB stalls with THP enabled. Applying the patches brings | ||
220 | performance in line with THP-disabled performance while isolating | ||
221 | pages for immediate reclaim from the LRU cuts down System CPU time. | ||
222 | |||
223 | The "Fault Alloc" success rate figures are also improved. The vanilla | ||
224 | kernel only managed to allocate 76.6 pages on average over the course | ||
225 | of 5 iterations where as applying the series allocated 181.20 on | ||
226 | average albeit it is well within variance. It's worth noting that | ||
227 | applies the series at least descreases the amount of variance which | ||
228 | implies an improvement. | ||
229 | |||
230 | Andrea's series had a higher success rate for THP allocations but | ||
231 | at a severe cost to elapsed time which is still better than vanilla | ||
232 | but still much worse than disabling THP altogether. One can bring my | ||
233 | series close to Andrea's by removing this check | ||
234 | |||
235 | /* | ||
236 | * If compaction is deferred for high-order allocations, it is because | ||
237 | * sync compaction recently failed. In this is the case and the caller | ||
238 | * has requested the system not be heavily disrupted, fail the | ||
239 | * allocation now instead of entering direct reclaim | ||
240 | */ | ||
241 | if (deferred_compaction && (gfp_mask & __GFP_NO_KSWAPD)) | ||
242 | goto nopage; | ||
243 | |||
244 | I didn't include a patch that removed the above check because hurting | ||
245 | overall performance to improve the THP figure is not what the average | ||
246 | user wants. It's something to consider though if someone really wants | ||
247 | to maximise THP usage no matter what it does to the workload initially. | ||
248 | |||
249 | This is summary of vmstat figures from the same test. | ||
250 | |||
251 | 3.1.0-vanilla rc5-vanilla freemore-v6r1 isolate-v6r1 andrea-v2r1 | ||
252 | Page Ins 3257266139 1111844061 17263623 10901575 161423219 | ||
253 | Page Outs 81054922 30364312 3626530 3657687 8753730 | ||
254 | Swap Ins 3294 2851 6560 4964 4592 | ||
255 | Swap Outs 390073 528094 620197 790912 698285 | ||
256 | Direct pages scanned 1077581700 3024951463 1764930052 115140570 5901188831 | ||
257 | Kswapd pages scanned 34826043 7112868 2131265 1686942 1893966 | ||
258 | Kswapd pages reclaimed 28950067 4911036 1246044 966475 1497726 | ||
259 | Direct pages reclaimed 805148398 280167837 3623473 2215044 40809360 | ||
260 | Kswapd efficiency 83% 69% 58% 57% 79% | ||
261 | Kswapd velocity 664.399 622.521 4253.852 7304.360 751.490 | ||
262 | Direct efficiency 74% 9% 0% 1% 0% | ||
263 | Direct velocity 20557.737 264745.137 3522673.849 498551.938 2341481.435 | ||
264 | Percentage direct scans 96% 99% 99% 98% 99% | ||
265 | Page writes by reclaim 722646 529174 620319 791018 699198 | ||
266 | Page writes file 332573 1080 122 106 913 | ||
267 | Page writes anon 390073 528094 620197 790912 698285 | ||
268 | Page reclaim immediate 0 2552514720 1635858848 111281140 5478375032 | ||
269 | Page rescued immediate 0 0 0 87848 0 | ||
270 | Slabs scanned 23552 23552 9216 8192 9216 | ||
271 | Direct inode steals 231 0 0 0 0 | ||
272 | Kswapd inode steals 0 0 0 0 0 | ||
273 | Kswapd skipped wait 28076 786 0 61 6 | ||
274 | THP fault alloc 609 383 753 906 1433 | ||
275 | THP collapse alloc 12 6 0 0 6 | ||
276 | THP splits 536 211 456 593 1136 | ||
277 | THP fault fallback 4406 4633 4263 4110 3583 | ||
278 | THP collapse fail 120 127 0 0 4 | ||
279 | Compaction stalls 1810 728 623 779 3200 | ||
280 | Compaction success 196 53 60 80 123 | ||
281 | Compaction failures 1614 675 563 699 3077 | ||
282 | Compaction pages moved 193158 53545 243185 333457 226688 | ||
283 | Compaction move failure 9952 9396 16424 23676 45070 | ||
284 | |||
285 | The main things to look at are | ||
286 | |||
287 | 1. Page In/out figures are much reduced by the series. | ||
288 | |||
289 | 2. Direct page scanning is incredibly high (264745.137 pages scanned | ||
290 | per second on the vanilla kernel) but isolating PageReclaim pages | ||
291 | on their own list reduces the number of pages scanned significantly. | ||
292 | |||
293 | 3. The fact that "Page rescued immediate" is a positive number implies | ||
294 | that we sometimes race removing pages from the LRU_IMMEDIATE list | ||
295 | that need to be put back on a normal LRU but it happens only for | ||
296 | 0.07% of the pages marked for immediate reclaim. | ||
297 | |||
298 | writebackCPDeviceext4 | ||
299 | 3.1.0-vanilla rc5-vanilla freemore-v6r1 isolate-v6r1 andrea-v2r1 | ||
300 | System Time 1.51 ( 0.00%) 1.77 ( -17.66%) 1.46 ( 2.92%) 1.15 ( 23.77%) 1.89 ( -25.63%) | ||
301 | +/- 0.27 ( 0.00%) 0.67 ( -148.52%) 0.33 ( -22.76%) 0.30 ( -11.15%) 0.19 ( 30.16%) | ||
302 | User Time 0.03 ( 0.00%) 0.04 ( -37.50%) 0.05 ( -62.50%) 0.07 ( -112.50%) 0.04 ( -18.75%) | ||
303 | +/- 0.01 ( 0.00%) 0.02 ( -146.64%) 0.02 ( -97.91%) 0.02 ( -75.59%) 0.02 ( -63.30%) | ||
304 | Elapsed Time 124.93 ( 0.00%) 114.49 ( 8.36%) 96.77 ( 22.55%) 27.48 ( 78.00%) 205.70 ( -64.65%) | ||
305 | +/- 20.20 ( 0.00%) 74.39 ( -268.34%) 59.88 ( -196.48%) 7.72 ( 61.79%) 25.03 ( -23.95%) | ||
306 | THP Active 161.80 ( 0.00%) 83.60 ( 51.67%) 141.20 ( 87.27%) 84.60 ( 52.29%) 82.60 ( 51.05%) | ||
307 | +/- 71.95 ( 0.00%) 43.80 ( 60.88%) 26.91 ( 37.40%) 59.02 ( 82.03%) 52.13 ( 72.45%) | ||
308 | Fault Alloc 471.40 ( 0.00%) 228.60 ( 48.49%) 282.20 ( 59.86%) 225.20 ( 47.77%) 388.40 ( 82.39%) | ||
309 | +/- 88.07 ( 0.00%) 87.42 ( 99.26%) 73.79 ( 83.78%) 109.62 ( 124.47%) 82.62 ( 93.81%) | ||
310 | Fault Fallback 531.60 ( 0.00%) 774.60 ( -45.71%) 720.80 ( -35.59%) 777.80 ( -46.31%) 614.80 ( -15.65%) | ||
311 | +/- 88.07 ( 0.00%) 87.26 ( 0.92%) 73.79 ( 16.22%) 109.62 ( -24.47%) 82.29 ( 6.56%) | ||
312 | MMTests Statistics: duration | ||
313 | User/Sys Time Running Test (seconds) 50.22 33.76 30.65 24.14 128.45 | ||
314 | Total Elapsed Time (seconds) 1113.73 1132.19 1029.45 759.49 1707.26 | ||
315 | |||
316 | Similar test but the USB stick is using ext4 instead of vfat. As | ||
317 | ext4 does not use writepage for migration, the large stalls due to | ||
318 | compaction when THP is enabled are not observed. Still, isolating | ||
319 | PageReclaim pages on their own list helped completion time largely | ||
320 | by reducing the number of pages scanned by direct reclaim although | ||
321 | time spend in congestion_wait could also be a factor. | ||
322 | |||
323 | Again, Andrea's series had far higher success rates for THP allocation | ||
324 | at the cost of elapsed time. I didn't look too closely but a quick | ||
325 | look at the vmstat figures tells me kswapd reclaimed 8 times more pages | ||
326 | than the patch series and direct reclaim reclaimed roughly three times | ||
327 | as many pages. It follows that if memory is aggressively reclaimed, | ||
328 | there will be more available for THP. | ||
329 | |||
330 | writebackCPFilevfat | ||
331 | 3.1.0-vanilla rc5-vanilla freemore-v6r1 isolate-v6r1 andrea-v2r1 | ||
332 | System Time 1.76 ( 0.00%) 29.10 (-1555.52%) 46.01 (-2517.18%) 4.79 ( -172.35%) 54.89 (-3022.53%) | ||
333 | +/- 0.14 ( 0.00%) 25.61 (-18185.17%) 2.15 (-1434.83%) 6.60 (-4610.03%) 9.75 | ||
334 | (-6863.76%) | ||
335 | User Time 0.05 ( 0.00%) 0.07 ( -45.83%) 0.05 ( -4.17%) 0.06 ( -29.17%) 0.06 ( -16.67%) | ||
336 | +/- 0.02 ( 0.00%) 0.02 ( 20.11%) 0.02 ( -3.14%) 0.01 ( 31.58%) 0.01 ( 47.41%) | ||
337 | Elapsed Time 22520.79 ( 0.00%) 1082.85 ( 95.19%) 73.30 ( 99.67%) 32.43 ( 99.86%) 291.84 ( 98.70%) | ||
338 | +/- 7277.23 ( 0.00%) 706.29 ( 90.29%) 19.05 ( 99.74%) 17.05 ( 99.77%) 125.55 ( 98.27%) | ||
339 | THP Active 83.80 ( 0.00%) 12.80 ( 15.27%) 15.60 ( 18.62%) 13.00 ( 15.51%) 0.80 ( 0.95%) | ||
340 | +/- 66.81 ( 0.00%) 20.19 ( 30.22%) 5.92 ( 8.86%) 15.06 ( 22.54%) 1.17 ( 1.75%) | ||
341 | Fault Alloc 171.00 ( 0.00%) 67.80 ( 39.65%) 97.40 ( 56.96%) 125.60 ( 73.45%) 133.00 ( 77.78%) | ||
342 | +/- 82.91 ( 0.00%) 30.69 ( 37.02%) 53.91 ( 65.02%) 55.05 ( 66.40%) 21.19 ( 25.56%) | ||
343 | Fault Fallback 832.00 ( 0.00%) 935.20 ( -12.40%) 906.00 ( -8.89%) 877.40 ( -5.46%) 870.20 ( -4.59%) | ||
344 | +/- 82.91 ( 0.00%) 30.69 ( 62.98%) 54.01 ( 34.86%) 55.05 ( 33.60%) 20.91 ( 74.78%) | ||
345 | MMTests Statistics: duration | ||
346 | User/Sys Time Running Test (seconds) 7229.81 928.42 704.52 80.68 1330.76 | ||
347 | Total Elapsed Time (seconds) 112849.04 5618.69 571.11 360.54 1664.28 | ||
348 | |||
349 | In this case, the test is reading/writing only from filesystems but as | ||
350 | it's vfat, it's slow due to calling writepage during compaction. Little | ||
351 | to observe really - the time to complete the test goes way down | ||
352 | with the series applied and THP allocation success rates go up in | ||
353 | comparison to 3.2-rc5. The success rates are lower than 3.1.0 but | ||
354 | the elapsed time for that kernel is abysmal so it is not really a | ||
355 | sensible comparison. | ||
356 | |||
357 | As before, Andrea's series allocates more THPs at the cost of overall | ||
358 | performance. | ||
359 | |||
360 | writebackCPFileext4 | ||
361 | 3.1.0-vanilla rc5-vanilla freemore-v6r1 isolate-v6r1 andrea-v2r1 | ||
362 | System Time 1.51 ( 0.00%) 1.77 ( -17.66%) 1.46 ( 2.92%) 1.15 ( 23.77%) 1.89 ( -25.63%) | ||
363 | +/- 0.27 ( 0.00%) 0.67 ( -148.52%) 0.33 ( -22.76%) 0.30 ( -11.15%) 0.19 ( 30.16%) | ||
364 | User Time 0.03 ( 0.00%) 0.04 ( -37.50%) 0.05 ( -62.50%) 0.07 ( -112.50%) 0.04 ( -18.75%) | ||
365 | +/- 0.01 ( 0.00%) 0.02 ( -146.64%) 0.02 ( -97.91%) 0.02 ( -75.59%) 0.02 ( -63.30%) | ||
366 | Elapsed Time 124.93 ( 0.00%) 114.49 ( 8.36%) 96.77 ( 22.55%) 27.48 ( 78.00%) 205.70 ( -64.65%) | ||
367 | +/- 20.20 ( 0.00%) 74.39 ( -268.34%) 59.88 ( -196.48%) 7.72 ( 61.79%) 25.03 ( -23.95%) | ||
368 | THP Active 161.80 ( 0.00%) 83.60 ( 51.67%) 141.20 ( 87.27%) 84.60 ( 52.29%) 82.60 ( 51.05%) | ||
369 | +/- 71.95 ( 0.00%) 43.80 ( 60.88%) 26.91 ( 37.40%) 59.02 ( 82.03%) 52.13 ( 72.45%) | ||
370 | Fault Alloc 471.40 ( 0.00%) 228.60 ( 48.49%) 282.20 ( 59.86%) 225.20 ( 47.77%) 388.40 ( 82.39%) | ||
371 | +/- 88.07 ( 0.00%) 87.42 ( 99.26%) 73.79 ( 83.78%) 109.62 ( 124.47%) 82.62 ( 93.81%) | ||
372 | Fault Fallback 531.60 ( 0.00%) 774.60 ( -45.71%) 720.80 ( -35.59%) 777.80 ( -46.31%) 614.80 ( -15.65%) | ||
373 | +/- 88.07 ( 0.00%) 87.26 ( 0.92%) 73.79 ( 16.22%) 109.62 ( -24.47%) 82.29 ( 6.56%) | ||
374 | MMTests Statistics: duration | ||
375 | User/Sys Time Running Test (seconds) 50.22 33.76 30.65 24.14 128.45 | ||
376 | Total Elapsed Time (seconds) 1113.73 1132.19 1029.45 759.49 1707.26 | ||
377 | |||
378 | Same type of story - elapsed times go down. In this case, allocation | ||
379 | success rates are roughtly the same. As before, Andrea's has higher | ||
380 | success rates but takes a lot longer. | ||
381 | |||
382 | Overall the series does reduce latencies and while the tests are | ||
383 | inherency racy as alloc competes with the cp processes, the variability | ||
384 | was included. The THP allocation rates are not as high as they could | ||
385 | be but that is because we would have to be more aggressive about | ||
386 | reclaim and compaction impacting overall performance. | ||
387 | |||
388 | This patch: | ||
389 | |||
390 | Commit 39deaf85 ("mm: compaction: make isolate_lru_page() filter-aware") | ||
391 | noted that compaction does not migrate dirty or writeback pages and that | ||
392 | is was meaningless to pick the page and re-add it to the LRU list. | ||
393 | |||
394 | What was missed during review is that asynchronous migration moves dirty | ||
395 | pages if their ->migratepage callback is migrate_page() because these can | ||
396 | be moved without blocking. This potentially impacted hugepage allocation | ||
397 | success rates by a factor depending on how many dirty pages are in the | ||
398 | system. | ||
399 | |||
400 | This patch partially reverts 39deaf85 to allow migration to isolate dirty | ||
401 | pages again. This increases how much compaction disrupts the LRU but that | ||
402 | is addressed later in the series. | ||
403 | |||
404 | Signed-off-by: Mel Gorman <mgorman@suse.de> | ||
405 | Reviewed-by: Andrea Arcangeli <aarcange@redhat.com> | ||
406 | Reviewed-by: Rik van Riel <riel@redhat.com> | ||
407 | Reviewed-by: Minchan Kim <minchan.kim@gmail.com> | ||
408 | Cc: Dave Jones <davej@redhat.com> | ||
409 | Cc: Jan Kara <jack@suse.cz> | ||
410 | Cc: Andy Isaacson <adi@hexapodia.org> | ||
411 | Cc: Nai Xia <nai.xia@gmail.com> | ||
412 | Cc: Johannes Weiner <jweiner@redhat.com> | ||
413 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
414 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
415 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
416 | --- | ||
417 | mm/compaction.c | 3 --- | ||
418 | 1 files changed, 0 insertions(+), 3 deletions(-) | ||
419 | |||
420 | diff --git a/mm/compaction.c b/mm/compaction.c | ||
421 | index 50f1c60..b81625d 100644 | ||
422 | --- a/mm/compaction.c | ||
423 | +++ b/mm/compaction.c | ||
424 | @@ -371,9 +371,6 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone, | ||
425 | continue; | ||
426 | } | ||
427 | |||
428 | - if (!cc->sync) | ||
429 | - mode |= ISOLATE_CLEAN; | ||
430 | - | ||
431 | /* Try isolate the page */ | ||
432 | if (__isolate_lru_page(page, mode, 0) != 0) | ||
433 | continue; | ||
434 | -- | ||
435 | 1.7.7.6 | ||
436 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0003-mm-compaction-determine-if-dirty-pages-can-be-migrat.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0003-mm-compaction-determine-if-dirty-pages-can-be-migrat.patch new file mode 100644 index 00000000..b6a461b0 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0003-mm-compaction-determine-if-dirty-pages-can-be-migrat.patch | |||
@@ -0,0 +1,376 @@ | |||
1 | From 45d9f4db29d9a2f44900c90ab81514c7e04cb1b9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mel Gorman <mgorman@suse.de> | ||
3 | Date: Thu, 12 Jan 2012 17:19:34 -0800 | ||
4 | Subject: [PATCH 03/73] mm: compaction: determine if dirty pages can be | ||
5 | migrated without blocking within ->migratepage | ||
6 | |||
7 | commit b969c4ab9f182a6e1b2a0848be349f99714947b0 upstream. | ||
8 | |||
9 | Stable note: Not tracked in Bugzilla. A fix aimed at preserving page | ||
10 | aging information by reducing LRU list churning had the side-effect | ||
11 | of reducing THP allocation success rates. This was part of a series | ||
12 | to restore the success rates while preserving the reclaim fix. | ||
13 | |||
14 | Asynchronous compaction is used when allocating transparent hugepages to | ||
15 | avoid blocking for long periods of time. Due to reports of stalling, | ||
16 | there was a debate on disabling synchronous compaction but this severely | ||
17 | impacted allocation success rates. Part of the reason was that many dirty | ||
18 | pages are skipped in asynchronous compaction by the following check; | ||
19 | |||
20 | if (PageDirty(page) && !sync && | ||
21 | mapping->a_ops->migratepage != migrate_page) | ||
22 | rc = -EBUSY; | ||
23 | |||
24 | This skips over all mapping aops using buffer_migrate_page() even though | ||
25 | it is possible to migrate some of these pages without blocking. This | ||
26 | patch updates the ->migratepage callback with a "sync" parameter. It is | ||
27 | the responsibility of the callback to fail gracefully if migration would | ||
28 | block. | ||
29 | |||
30 | Signed-off-by: Mel Gorman <mgorman@suse.de> | ||
31 | Reviewed-by: Rik van Riel <riel@redhat.com> | ||
32 | Cc: Andrea Arcangeli <aarcange@redhat.com> | ||
33 | Cc: Minchan Kim <minchan.kim@gmail.com> | ||
34 | Cc: Dave Jones <davej@redhat.com> | ||
35 | Cc: Jan Kara <jack@suse.cz> | ||
36 | Cc: Andy Isaacson <adi@hexapodia.org> | ||
37 | Cc: Nai Xia <nai.xia@gmail.com> | ||
38 | Cc: Johannes Weiner <jweiner@redhat.com> | ||
39 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
40 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
41 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
42 | --- | ||
43 | fs/btrfs/disk-io.c | 4 +- | ||
44 | fs/hugetlbfs/inode.c | 3 +- | ||
45 | fs/nfs/internal.h | 2 +- | ||
46 | fs/nfs/write.c | 4 +- | ||
47 | include/linux/fs.h | 9 ++- | ||
48 | include/linux/migrate.h | 2 +- | ||
49 | mm/migrate.c | 129 +++++++++++++++++++++++++++++++++------------- | ||
50 | 7 files changed, 106 insertions(+), 47 deletions(-) | ||
51 | |||
52 | diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c | ||
53 | index f44b392..fa7cddf 100644 | ||
54 | --- a/fs/btrfs/disk-io.c | ||
55 | +++ b/fs/btrfs/disk-io.c | ||
56 | @@ -872,7 +872,7 @@ static int btree_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, | ||
57 | |||
58 | #ifdef CONFIG_MIGRATION | ||
59 | static int btree_migratepage(struct address_space *mapping, | ||
60 | - struct page *newpage, struct page *page) | ||
61 | + struct page *newpage, struct page *page, bool sync) | ||
62 | { | ||
63 | /* | ||
64 | * we can't safely write a btree page from here, | ||
65 | @@ -887,7 +887,7 @@ static int btree_migratepage(struct address_space *mapping, | ||
66 | if (page_has_private(page) && | ||
67 | !try_to_release_page(page, GFP_KERNEL)) | ||
68 | return -EAGAIN; | ||
69 | - return migrate_page(mapping, newpage, page); | ||
70 | + return migrate_page(mapping, newpage, page, sync); | ||
71 | } | ||
72 | #endif | ||
73 | |||
74 | diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c | ||
75 | index ebc2f4d..217b771 100644 | ||
76 | --- a/fs/hugetlbfs/inode.c | ||
77 | +++ b/fs/hugetlbfs/inode.c | ||
78 | @@ -569,7 +569,8 @@ static int hugetlbfs_set_page_dirty(struct page *page) | ||
79 | } | ||
80 | |||
81 | static int hugetlbfs_migrate_page(struct address_space *mapping, | ||
82 | - struct page *newpage, struct page *page) | ||
83 | + struct page *newpage, struct page *page, | ||
84 | + bool sync) | ||
85 | { | ||
86 | int rc; | ||
87 | |||
88 | diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h | ||
89 | index 3f4d957..8d96ed6 100644 | ||
90 | --- a/fs/nfs/internal.h | ||
91 | +++ b/fs/nfs/internal.h | ||
92 | @@ -330,7 +330,7 @@ void nfs_commit_release_pages(struct nfs_write_data *data); | ||
93 | |||
94 | #ifdef CONFIG_MIGRATION | ||
95 | extern int nfs_migrate_page(struct address_space *, | ||
96 | - struct page *, struct page *); | ||
97 | + struct page *, struct page *, bool); | ||
98 | #else | ||
99 | #define nfs_migrate_page NULL | ||
100 | #endif | ||
101 | diff --git a/fs/nfs/write.c b/fs/nfs/write.c | ||
102 | index 4efd421..31b2461 100644 | ||
103 | --- a/fs/nfs/write.c | ||
104 | +++ b/fs/nfs/write.c | ||
105 | @@ -1711,7 +1711,7 @@ out_error: | ||
106 | |||
107 | #ifdef CONFIG_MIGRATION | ||
108 | int nfs_migrate_page(struct address_space *mapping, struct page *newpage, | ||
109 | - struct page *page) | ||
110 | + struct page *page, bool sync) | ||
111 | { | ||
112 | /* | ||
113 | * If PagePrivate is set, then the page is currently associated with | ||
114 | @@ -1726,7 +1726,7 @@ int nfs_migrate_page(struct address_space *mapping, struct page *newpage, | ||
115 | |||
116 | nfs_fscache_release_page(page, GFP_KERNEL); | ||
117 | |||
118 | - return migrate_page(mapping, newpage, page); | ||
119 | + return migrate_page(mapping, newpage, page, sync); | ||
120 | } | ||
121 | #endif | ||
122 | |||
123 | diff --git a/include/linux/fs.h b/include/linux/fs.h | ||
124 | index 43d36b7..2ae90d3 100644 | ||
125 | --- a/include/linux/fs.h | ||
126 | +++ b/include/linux/fs.h | ||
127 | @@ -609,9 +609,12 @@ struct address_space_operations { | ||
128 | loff_t offset, unsigned long nr_segs); | ||
129 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, | ||
130 | void **, unsigned long *); | ||
131 | - /* migrate the contents of a page to the specified target */ | ||
132 | + /* | ||
133 | + * migrate the contents of a page to the specified target. If sync | ||
134 | + * is false, it must not block. | ||
135 | + */ | ||
136 | int (*migratepage) (struct address_space *, | ||
137 | - struct page *, struct page *); | ||
138 | + struct page *, struct page *, bool); | ||
139 | int (*launder_page) (struct page *); | ||
140 | int (*is_partially_uptodate) (struct page *, read_descriptor_t *, | ||
141 | unsigned long); | ||
142 | @@ -2586,7 +2589,7 @@ extern int generic_check_addressable(unsigned, u64); | ||
143 | |||
144 | #ifdef CONFIG_MIGRATION | ||
145 | extern int buffer_migrate_page(struct address_space *, | ||
146 | - struct page *, struct page *); | ||
147 | + struct page *, struct page *, bool); | ||
148 | #else | ||
149 | #define buffer_migrate_page NULL | ||
150 | #endif | ||
151 | diff --git a/include/linux/migrate.h b/include/linux/migrate.h | ||
152 | index e39aeec..14e6d2a 100644 | ||
153 | --- a/include/linux/migrate.h | ||
154 | +++ b/include/linux/migrate.h | ||
155 | @@ -11,7 +11,7 @@ typedef struct page *new_page_t(struct page *, unsigned long private, int **); | ||
156 | |||
157 | extern void putback_lru_pages(struct list_head *l); | ||
158 | extern int migrate_page(struct address_space *, | ||
159 | - struct page *, struct page *); | ||
160 | + struct page *, struct page *, bool); | ||
161 | extern int migrate_pages(struct list_head *l, new_page_t x, | ||
162 | unsigned long private, bool offlining, | ||
163 | bool sync); | ||
164 | diff --git a/mm/migrate.c b/mm/migrate.c | ||
165 | index 177aca4..65c12d2 100644 | ||
166 | --- a/mm/migrate.c | ||
167 | +++ b/mm/migrate.c | ||
168 | @@ -220,6 +220,55 @@ out: | ||
169 | pte_unmap_unlock(ptep, ptl); | ||
170 | } | ||
171 | |||
172 | +#ifdef CONFIG_BLOCK | ||
173 | +/* Returns true if all buffers are successfully locked */ | ||
174 | +static bool buffer_migrate_lock_buffers(struct buffer_head *head, bool sync) | ||
175 | +{ | ||
176 | + struct buffer_head *bh = head; | ||
177 | + | ||
178 | + /* Simple case, sync compaction */ | ||
179 | + if (sync) { | ||
180 | + do { | ||
181 | + get_bh(bh); | ||
182 | + lock_buffer(bh); | ||
183 | + bh = bh->b_this_page; | ||
184 | + | ||
185 | + } while (bh != head); | ||
186 | + | ||
187 | + return true; | ||
188 | + } | ||
189 | + | ||
190 | + /* async case, we cannot block on lock_buffer so use trylock_buffer */ | ||
191 | + do { | ||
192 | + get_bh(bh); | ||
193 | + if (!trylock_buffer(bh)) { | ||
194 | + /* | ||
195 | + * We failed to lock the buffer and cannot stall in | ||
196 | + * async migration. Release the taken locks | ||
197 | + */ | ||
198 | + struct buffer_head *failed_bh = bh; | ||
199 | + put_bh(failed_bh); | ||
200 | + bh = head; | ||
201 | + while (bh != failed_bh) { | ||
202 | + unlock_buffer(bh); | ||
203 | + put_bh(bh); | ||
204 | + bh = bh->b_this_page; | ||
205 | + } | ||
206 | + return false; | ||
207 | + } | ||
208 | + | ||
209 | + bh = bh->b_this_page; | ||
210 | + } while (bh != head); | ||
211 | + return true; | ||
212 | +} | ||
213 | +#else | ||
214 | +static inline bool buffer_migrate_lock_buffers(struct buffer_head *head, | ||
215 | + bool sync) | ||
216 | +{ | ||
217 | + return true; | ||
218 | +} | ||
219 | +#endif /* CONFIG_BLOCK */ | ||
220 | + | ||
221 | /* | ||
222 | * Replace the page in the mapping. | ||
223 | * | ||
224 | @@ -229,7 +278,8 @@ out: | ||
225 | * 3 for pages with a mapping and PagePrivate/PagePrivate2 set. | ||
226 | */ | ||
227 | static int migrate_page_move_mapping(struct address_space *mapping, | ||
228 | - struct page *newpage, struct page *page) | ||
229 | + struct page *newpage, struct page *page, | ||
230 | + struct buffer_head *head, bool sync) | ||
231 | { | ||
232 | int expected_count; | ||
233 | void **pslot; | ||
234 | @@ -259,6 +309,19 @@ static int migrate_page_move_mapping(struct address_space *mapping, | ||
235 | } | ||
236 | |||
237 | /* | ||
238 | + * In the async migration case of moving a page with buffers, lock the | ||
239 | + * buffers using trylock before the mapping is moved. If the mapping | ||
240 | + * was moved, we later failed to lock the buffers and could not move | ||
241 | + * the mapping back due to an elevated page count, we would have to | ||
242 | + * block waiting on other references to be dropped. | ||
243 | + */ | ||
244 | + if (!sync && head && !buffer_migrate_lock_buffers(head, sync)) { | ||
245 | + page_unfreeze_refs(page, expected_count); | ||
246 | + spin_unlock_irq(&mapping->tree_lock); | ||
247 | + return -EAGAIN; | ||
248 | + } | ||
249 | + | ||
250 | + /* | ||
251 | * Now we know that no one else is looking at the page. | ||
252 | */ | ||
253 | get_page(newpage); /* add cache reference */ | ||
254 | @@ -415,13 +478,13 @@ EXPORT_SYMBOL(fail_migrate_page); | ||
255 | * Pages are locked upon entry and exit. | ||
256 | */ | ||
257 | int migrate_page(struct address_space *mapping, | ||
258 | - struct page *newpage, struct page *page) | ||
259 | + struct page *newpage, struct page *page, bool sync) | ||
260 | { | ||
261 | int rc; | ||
262 | |||
263 | BUG_ON(PageWriteback(page)); /* Writeback must be complete */ | ||
264 | |||
265 | - rc = migrate_page_move_mapping(mapping, newpage, page); | ||
266 | + rc = migrate_page_move_mapping(mapping, newpage, page, NULL, sync); | ||
267 | |||
268 | if (rc) | ||
269 | return rc; | ||
270 | @@ -438,28 +501,28 @@ EXPORT_SYMBOL(migrate_page); | ||
271 | * exist. | ||
272 | */ | ||
273 | int buffer_migrate_page(struct address_space *mapping, | ||
274 | - struct page *newpage, struct page *page) | ||
275 | + struct page *newpage, struct page *page, bool sync) | ||
276 | { | ||
277 | struct buffer_head *bh, *head; | ||
278 | int rc; | ||
279 | |||
280 | if (!page_has_buffers(page)) | ||
281 | - return migrate_page(mapping, newpage, page); | ||
282 | + return migrate_page(mapping, newpage, page, sync); | ||
283 | |||
284 | head = page_buffers(page); | ||
285 | |||
286 | - rc = migrate_page_move_mapping(mapping, newpage, page); | ||
287 | + rc = migrate_page_move_mapping(mapping, newpage, page, head, sync); | ||
288 | |||
289 | if (rc) | ||
290 | return rc; | ||
291 | |||
292 | - bh = head; | ||
293 | - do { | ||
294 | - get_bh(bh); | ||
295 | - lock_buffer(bh); | ||
296 | - bh = bh->b_this_page; | ||
297 | - | ||
298 | - } while (bh != head); | ||
299 | + /* | ||
300 | + * In the async case, migrate_page_move_mapping locked the buffers | ||
301 | + * with an IRQ-safe spinlock held. In the sync case, the buffers | ||
302 | + * need to be locked now | ||
303 | + */ | ||
304 | + if (sync) | ||
305 | + BUG_ON(!buffer_migrate_lock_buffers(head, sync)); | ||
306 | |||
307 | ClearPagePrivate(page); | ||
308 | set_page_private(newpage, page_private(page)); | ||
309 | @@ -536,10 +599,13 @@ static int writeout(struct address_space *mapping, struct page *page) | ||
310 | * Default handling if a filesystem does not provide a migration function. | ||
311 | */ | ||
312 | static int fallback_migrate_page(struct address_space *mapping, | ||
313 | - struct page *newpage, struct page *page) | ||
314 | + struct page *newpage, struct page *page, bool sync) | ||
315 | { | ||
316 | - if (PageDirty(page)) | ||
317 | + if (PageDirty(page)) { | ||
318 | + if (!sync) | ||
319 | + return -EBUSY; | ||
320 | return writeout(mapping, page); | ||
321 | + } | ||
322 | |||
323 | /* | ||
324 | * Buffers may be managed in a filesystem specific way. | ||
325 | @@ -549,7 +615,7 @@ static int fallback_migrate_page(struct address_space *mapping, | ||
326 | !try_to_release_page(page, GFP_KERNEL)) | ||
327 | return -EAGAIN; | ||
328 | |||
329 | - return migrate_page(mapping, newpage, page); | ||
330 | + return migrate_page(mapping, newpage, page, sync); | ||
331 | } | ||
332 | |||
333 | /* | ||
334 | @@ -585,29 +651,18 @@ static int move_to_new_page(struct page *newpage, struct page *page, | ||
335 | |||
336 | mapping = page_mapping(page); | ||
337 | if (!mapping) | ||
338 | - rc = migrate_page(mapping, newpage, page); | ||
339 | - else { | ||
340 | + rc = migrate_page(mapping, newpage, page, sync); | ||
341 | + else if (mapping->a_ops->migratepage) | ||
342 | /* | ||
343 | - * Do not writeback pages if !sync and migratepage is | ||
344 | - * not pointing to migrate_page() which is nonblocking | ||
345 | - * (swapcache/tmpfs uses migratepage = migrate_page). | ||
346 | + * Most pages have a mapping and most filesystems provide a | ||
347 | + * migratepage callback. Anonymous pages are part of swap | ||
348 | + * space which also has its own migratepage callback. This | ||
349 | + * is the most common path for page migration. | ||
350 | */ | ||
351 | - if (PageDirty(page) && !sync && | ||
352 | - mapping->a_ops->migratepage != migrate_page) | ||
353 | - rc = -EBUSY; | ||
354 | - else if (mapping->a_ops->migratepage) | ||
355 | - /* | ||
356 | - * Most pages have a mapping and most filesystems | ||
357 | - * should provide a migration function. Anonymous | ||
358 | - * pages are part of swap space which also has its | ||
359 | - * own migration function. This is the most common | ||
360 | - * path for page migration. | ||
361 | - */ | ||
362 | - rc = mapping->a_ops->migratepage(mapping, | ||
363 | - newpage, page); | ||
364 | - else | ||
365 | - rc = fallback_migrate_page(mapping, newpage, page); | ||
366 | - } | ||
367 | + rc = mapping->a_ops->migratepage(mapping, | ||
368 | + newpage, page, sync); | ||
369 | + else | ||
370 | + rc = fallback_migrate_page(mapping, newpage, page, sync); | ||
371 | |||
372 | if (rc) { | ||
373 | newpage->mapping = NULL; | ||
374 | -- | ||
375 | 1.7.7.6 | ||
376 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0004-mm-page-allocator-do-not-call-direct-reclaim-for-THP.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0004-mm-page-allocator-do-not-call-direct-reclaim-for-THP.patch new file mode 100644 index 00000000..7d71a05f --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0004-mm-page-allocator-do-not-call-direct-reclaim-for-THP.patch | |||
@@ -0,0 +1,143 @@ | |||
1 | From 246126d86b5c74067beda5a972d4c0e1a03ec9ef Mon Sep 17 00:00:00 2001 | ||
2 | From: Mel Gorman <mgorman@suse.de> | ||
3 | Date: Thu, 12 Jan 2012 17:19:41 -0800 | ||
4 | Subject: [PATCH 04/73] mm: page allocator: do not call direct reclaim for THP | ||
5 | allocations while compaction is deferred | ||
6 | |||
7 | commit 66199712e9eef5aede09dbcd9dfff87798a66917 upstream. | ||
8 | |||
9 | Stable note: Not tracked in Buzilla. This was part of a series that | ||
10 | reduced interactivity stalls experienced when THP was enabled. | ||
11 | |||
12 | If compaction is deferred, direct reclaim is used to try to free enough | ||
13 | pages for the allocation to succeed. For small high-orders, this has a | ||
14 | reasonable chance of success. However, if the caller has specified | ||
15 | __GFP_NO_KSWAPD to limit the disruption to the system, it makes more sense | ||
16 | to fail the allocation rather than stall the caller in direct reclaim. | ||
17 | This patch skips direct reclaim if compaction is deferred and the caller | ||
18 | specifies __GFP_NO_KSWAPD. | ||
19 | |||
20 | Async compaction only considers a subset of pages so it is possible for | ||
21 | compaction to be deferred prematurely and not enter direct reclaim even in | ||
22 | cases where it should. To compensate for this, this patch also defers | ||
23 | compaction only if sync compaction failed. | ||
24 | |||
25 | Signed-off-by: Mel Gorman <mgorman@suse.de> | ||
26 | Acked-by: Minchan Kim <minchan.kim@gmail.com> | ||
27 | Reviewed-by: Rik van Riel<riel@redhat.com> | ||
28 | Cc: Andrea Arcangeli <aarcange@redhat.com> | ||
29 | Cc: Dave Jones <davej@redhat.com> | ||
30 | Cc: Jan Kara <jack@suse.cz> | ||
31 | Cc: Andy Isaacson <adi@hexapodia.org> | ||
32 | Cc: Nai Xia <nai.xia@gmail.com> | ||
33 | Cc: Johannes Weiner <jweiner@redhat.com> | ||
34 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
35 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
36 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
37 | --- | ||
38 | mm/page_alloc.c | 45 +++++++++++++++++++++++++++++++++++---------- | ||
39 | 1 files changed, 35 insertions(+), 10 deletions(-) | ||
40 | |||
41 | diff --git a/mm/page_alloc.c b/mm/page_alloc.c | ||
42 | index cb3460e..ef6e1a1 100644 | ||
43 | --- a/mm/page_alloc.c | ||
44 | +++ b/mm/page_alloc.c | ||
45 | @@ -1886,14 +1886,20 @@ static struct page * | ||
46 | __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order, | ||
47 | struct zonelist *zonelist, enum zone_type high_zoneidx, | ||
48 | nodemask_t *nodemask, int alloc_flags, struct zone *preferred_zone, | ||
49 | - int migratetype, unsigned long *did_some_progress, | ||
50 | - bool sync_migration) | ||
51 | + int migratetype, bool sync_migration, | ||
52 | + bool *deferred_compaction, | ||
53 | + unsigned long *did_some_progress) | ||
54 | { | ||
55 | struct page *page; | ||
56 | |||
57 | - if (!order || compaction_deferred(preferred_zone)) | ||
58 | + if (!order) | ||
59 | return NULL; | ||
60 | |||
61 | + if (compaction_deferred(preferred_zone)) { | ||
62 | + *deferred_compaction = true; | ||
63 | + return NULL; | ||
64 | + } | ||
65 | + | ||
66 | current->flags |= PF_MEMALLOC; | ||
67 | *did_some_progress = try_to_compact_pages(zonelist, order, gfp_mask, | ||
68 | nodemask, sync_migration); | ||
69 | @@ -1921,7 +1927,13 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order, | ||
70 | * but not enough to satisfy watermarks. | ||
71 | */ | ||
72 | count_vm_event(COMPACTFAIL); | ||
73 | - defer_compaction(preferred_zone); | ||
74 | + | ||
75 | + /* | ||
76 | + * As async compaction considers a subset of pageblocks, only | ||
77 | + * defer if the failure was a sync compaction failure. | ||
78 | + */ | ||
79 | + if (sync_migration) | ||
80 | + defer_compaction(preferred_zone); | ||
81 | |||
82 | cond_resched(); | ||
83 | } | ||
84 | @@ -1933,8 +1945,9 @@ static inline struct page * | ||
85 | __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order, | ||
86 | struct zonelist *zonelist, enum zone_type high_zoneidx, | ||
87 | nodemask_t *nodemask, int alloc_flags, struct zone *preferred_zone, | ||
88 | - int migratetype, unsigned long *did_some_progress, | ||
89 | - bool sync_migration) | ||
90 | + int migratetype, bool sync_migration, | ||
91 | + bool *deferred_compaction, | ||
92 | + unsigned long *did_some_progress) | ||
93 | { | ||
94 | return NULL; | ||
95 | } | ||
96 | @@ -2084,6 +2097,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, | ||
97 | unsigned long pages_reclaimed = 0; | ||
98 | unsigned long did_some_progress; | ||
99 | bool sync_migration = false; | ||
100 | + bool deferred_compaction = false; | ||
101 | |||
102 | /* | ||
103 | * In the slowpath, we sanity check order to avoid ever trying to | ||
104 | @@ -2164,12 +2178,22 @@ rebalance: | ||
105 | zonelist, high_zoneidx, | ||
106 | nodemask, | ||
107 | alloc_flags, preferred_zone, | ||
108 | - migratetype, &did_some_progress, | ||
109 | - sync_migration); | ||
110 | + migratetype, sync_migration, | ||
111 | + &deferred_compaction, | ||
112 | + &did_some_progress); | ||
113 | if (page) | ||
114 | goto got_pg; | ||
115 | sync_migration = true; | ||
116 | |||
117 | + /* | ||
118 | + * If compaction is deferred for high-order allocations, it is because | ||
119 | + * sync compaction recently failed. In this is the case and the caller | ||
120 | + * has requested the system not be heavily disrupted, fail the | ||
121 | + * allocation now instead of entering direct reclaim | ||
122 | + */ | ||
123 | + if (deferred_compaction && (gfp_mask & __GFP_NO_KSWAPD)) | ||
124 | + goto nopage; | ||
125 | + | ||
126 | /* Try direct reclaim and then allocating */ | ||
127 | page = __alloc_pages_direct_reclaim(gfp_mask, order, | ||
128 | zonelist, high_zoneidx, | ||
129 | @@ -2232,8 +2256,9 @@ rebalance: | ||
130 | zonelist, high_zoneidx, | ||
131 | nodemask, | ||
132 | alloc_flags, preferred_zone, | ||
133 | - migratetype, &did_some_progress, | ||
134 | - sync_migration); | ||
135 | + migratetype, sync_migration, | ||
136 | + &deferred_compaction, | ||
137 | + &did_some_progress); | ||
138 | if (page) | ||
139 | goto got_pg; | ||
140 | } | ||
141 | -- | ||
142 | 1.7.7.6 | ||
143 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0005-mm-compaction-make-isolate_lru_page-filter-aware-aga.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0005-mm-compaction-make-isolate_lru_page-filter-aware-aga.patch new file mode 100644 index 00000000..1cf5109f --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0005-mm-compaction-make-isolate_lru_page-filter-aware-aga.patch | |||
@@ -0,0 +1,117 @@ | |||
1 | From 67c64d699499fd5b83ca0be6f66eaca18cc29601 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mel Gorman <mgorman@suse.de> | ||
3 | Date: Thu, 12 Jan 2012 17:19:38 -0800 | ||
4 | Subject: [PATCH 05/73] mm: compaction: make isolate_lru_page() filter-aware | ||
5 | again | ||
6 | |||
7 | commit c82449352854ff09e43062246af86bdeb628f0c3 upstream. | ||
8 | |||
9 | Stable note: Not tracked in Bugzilla. A fix aimed at preserving page aging | ||
10 | information by reducing LRU list churning had the side-effect of | ||
11 | reducing THP allocation success rates. This was part of a series | ||
12 | to restore the success rates while preserving the reclaim fix. | ||
13 | |||
14 | Commit 39deaf85 ("mm: compaction: make isolate_lru_page() filter-aware") | ||
15 | noted that compaction does not migrate dirty or writeback pages and that | ||
16 | is was meaningless to pick the page and re-add it to the LRU list. This | ||
17 | had to be partially reverted because some dirty pages can be migrated by | ||
18 | compaction without blocking. | ||
19 | |||
20 | This patch updates "mm: compaction: make isolate_lru_page" by skipping | ||
21 | over pages that migration has no possibility of migrating to minimise LRU | ||
22 | disruption. | ||
23 | |||
24 | Signed-off-by: Mel Gorman <mgorman@suse.de> | ||
25 | Reviewed-by: Rik van Riel<riel@redhat.com> | ||
26 | Cc: Andrea Arcangeli <aarcange@redhat.com> | ||
27 | Reviewed-by: Minchan Kim <minchan@kernel.org> | ||
28 | Cc: Dave Jones <davej@redhat.com> | ||
29 | Cc: Jan Kara <jack@suse.cz> | ||
30 | Cc: Andy Isaacson <adi@hexapodia.org> | ||
31 | Cc: Nai Xia <nai.xia@gmail.com> | ||
32 | Cc: Johannes Weiner <jweiner@redhat.com> | ||
33 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
34 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
35 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
36 | --- | ||
37 | include/linux/mmzone.h | 2 ++ | ||
38 | mm/compaction.c | 3 +++ | ||
39 | mm/vmscan.c | 35 +++++++++++++++++++++++++++++++++-- | ||
40 | 3 files changed, 38 insertions(+), 2 deletions(-) | ||
41 | |||
42 | diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h | ||
43 | index 905b1e1..25842b6 100644 | ||
44 | --- a/include/linux/mmzone.h | ||
45 | +++ b/include/linux/mmzone.h | ||
46 | @@ -173,6 +173,8 @@ static inline int is_unevictable_lru(enum lru_list l) | ||
47 | #define ISOLATE_CLEAN ((__force isolate_mode_t)0x4) | ||
48 | /* Isolate unmapped file */ | ||
49 | #define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x8) | ||
50 | +/* Isolate for asynchronous migration */ | ||
51 | +#define ISOLATE_ASYNC_MIGRATE ((__force isolate_mode_t)0x10) | ||
52 | |||
53 | /* LRU Isolation modes. */ | ||
54 | typedef unsigned __bitwise__ isolate_mode_t; | ||
55 | diff --git a/mm/compaction.c b/mm/compaction.c | ||
56 | index b81625d..979a919 100644 | ||
57 | --- a/mm/compaction.c | ||
58 | +++ b/mm/compaction.c | ||
59 | @@ -371,6 +371,9 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone, | ||
60 | continue; | ||
61 | } | ||
62 | |||
63 | + if (!cc->sync) | ||
64 | + mode |= ISOLATE_ASYNC_MIGRATE; | ||
65 | + | ||
66 | /* Try isolate the page */ | ||
67 | if (__isolate_lru_page(page, mode, 0) != 0) | ||
68 | continue; | ||
69 | diff --git a/mm/vmscan.c b/mm/vmscan.c | ||
70 | index 8342119..1b95e4c 100644 | ||
71 | --- a/mm/vmscan.c | ||
72 | +++ b/mm/vmscan.c | ||
73 | @@ -1061,8 +1061,39 @@ int __isolate_lru_page(struct page *page, isolate_mode_t mode, int file) | ||
74 | |||
75 | ret = -EBUSY; | ||
76 | |||
77 | - if ((mode & ISOLATE_CLEAN) && (PageDirty(page) || PageWriteback(page))) | ||
78 | - return ret; | ||
79 | + /* | ||
80 | + * To minimise LRU disruption, the caller can indicate that it only | ||
81 | + * wants to isolate pages it will be able to operate on without | ||
82 | + * blocking - clean pages for the most part. | ||
83 | + * | ||
84 | + * ISOLATE_CLEAN means that only clean pages should be isolated. This | ||
85 | + * is used by reclaim when it is cannot write to backing storage | ||
86 | + * | ||
87 | + * ISOLATE_ASYNC_MIGRATE is used to indicate that it only wants to pages | ||
88 | + * that it is possible to migrate without blocking | ||
89 | + */ | ||
90 | + if (mode & (ISOLATE_CLEAN|ISOLATE_ASYNC_MIGRATE)) { | ||
91 | + /* All the caller can do on PageWriteback is block */ | ||
92 | + if (PageWriteback(page)) | ||
93 | + return ret; | ||
94 | + | ||
95 | + if (PageDirty(page)) { | ||
96 | + struct address_space *mapping; | ||
97 | + | ||
98 | + /* ISOLATE_CLEAN means only clean pages */ | ||
99 | + if (mode & ISOLATE_CLEAN) | ||
100 | + return ret; | ||
101 | + | ||
102 | + /* | ||
103 | + * Only pages without mappings or that have a | ||
104 | + * ->migratepage callback are possible to migrate | ||
105 | + * without blocking | ||
106 | + */ | ||
107 | + mapping = page_mapping(page); | ||
108 | + if (mapping && !mapping->a_ops->migratepage) | ||
109 | + return ret; | ||
110 | + } | ||
111 | + } | ||
112 | |||
113 | if ((mode & ISOLATE_UNMAPPED) && page_mapped(page)) | ||
114 | return ret; | ||
115 | -- | ||
116 | 1.7.7.6 | ||
117 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0006-mm-compaction-introduce-sync-light-migration-for-use.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0006-mm-compaction-introduce-sync-light-migration-for-use.patch new file mode 100644 index 00000000..25e33ab4 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0006-mm-compaction-introduce-sync-light-migration-for-use.patch | |||
@@ -0,0 +1,547 @@ | |||
1 | From 0fe5ee08804cfadf02801cf6d82f0e2594cd04bd Mon Sep 17 00:00:00 2001 | ||
2 | From: Mel Gorman <mgorman@suse.de> | ||
3 | Date: Thu, 12 Jan 2012 17:19:43 -0800 | ||
4 | Subject: [PATCH 06/73] mm: compaction: introduce sync-light migration for use | ||
5 | by compaction | ||
6 | |||
7 | commit a6bc32b899223a877f595ef9ddc1e89ead5072b8 upstream. | ||
8 | |||
9 | Stable note: Not tracked in Buzilla. This was part of a series that | ||
10 | reduced interactivity stalls experienced when THP was enabled. | ||
11 | These stalls were particularly noticable when copying data | ||
12 | to a USB stick but the experiences for users varied a lot. | ||
13 | |||
14 | This patch adds a lightweight sync migrate operation MIGRATE_SYNC_LIGHT | ||
15 | mode that avoids writing back pages to backing storage. Async compaction | ||
16 | maps to MIGRATE_ASYNC while sync compaction maps to MIGRATE_SYNC_LIGHT. | ||
17 | For other migrate_pages users such as memory hotplug, MIGRATE_SYNC is | ||
18 | used. | ||
19 | |||
20 | This avoids sync compaction stalling for an excessive length of time, | ||
21 | particularly when copying files to a USB stick where there might be a | ||
22 | large number of dirty pages backed by a filesystem that does not support | ||
23 | ->writepages. | ||
24 | |||
25 | [aarcange@redhat.com: This patch is heavily based on Andrea's work] | ||
26 | [akpm@linux-foundation.org: fix fs/nfs/write.c build] | ||
27 | [akpm@linux-foundation.org: fix fs/btrfs/disk-io.c build] | ||
28 | Signed-off-by: Mel Gorman <mgorman@suse.de> | ||
29 | Reviewed-by: Rik van Riel <riel@redhat.com> | ||
30 | Cc: Andrea Arcangeli <aarcange@redhat.com> | ||
31 | Cc: Minchan Kim <minchan.kim@gmail.com> | ||
32 | Cc: Dave Jones <davej@redhat.com> | ||
33 | Cc: Jan Kara <jack@suse.cz> | ||
34 | Cc: Andy Isaacson <adi@hexapodia.org> | ||
35 | Cc: Nai Xia <nai.xia@gmail.com> | ||
36 | Cc: Johannes Weiner <jweiner@redhat.com> | ||
37 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
38 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
39 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
40 | --- | ||
41 | fs/btrfs/disk-io.c | 5 ++- | ||
42 | fs/hugetlbfs/inode.c | 2 +- | ||
43 | fs/nfs/internal.h | 2 +- | ||
44 | fs/nfs/write.c | 4 +- | ||
45 | include/linux/fs.h | 6 ++- | ||
46 | include/linux/migrate.h | 23 +++++++++++--- | ||
47 | mm/compaction.c | 2 +- | ||
48 | mm/memory-failure.c | 2 +- | ||
49 | mm/memory_hotplug.c | 2 +- | ||
50 | mm/mempolicy.c | 2 +- | ||
51 | mm/migrate.c | 78 ++++++++++++++++++++++++++--------------------- | ||
52 | 11 files changed, 76 insertions(+), 52 deletions(-) | ||
53 | |||
54 | diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c | ||
55 | index fa7cddf..6b2a724 100644 | ||
56 | --- a/fs/btrfs/disk-io.c | ||
57 | +++ b/fs/btrfs/disk-io.c | ||
58 | @@ -872,7 +872,8 @@ static int btree_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, | ||
59 | |||
60 | #ifdef CONFIG_MIGRATION | ||
61 | static int btree_migratepage(struct address_space *mapping, | ||
62 | - struct page *newpage, struct page *page, bool sync) | ||
63 | + struct page *newpage, struct page *page, | ||
64 | + enum migrate_mode mode) | ||
65 | { | ||
66 | /* | ||
67 | * we can't safely write a btree page from here, | ||
68 | @@ -887,7 +888,7 @@ static int btree_migratepage(struct address_space *mapping, | ||
69 | if (page_has_private(page) && | ||
70 | !try_to_release_page(page, GFP_KERNEL)) | ||
71 | return -EAGAIN; | ||
72 | - return migrate_page(mapping, newpage, page, sync); | ||
73 | + return migrate_page(mapping, newpage, page, mode); | ||
74 | } | ||
75 | #endif | ||
76 | |||
77 | diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c | ||
78 | index 217b771..0aa424a 100644 | ||
79 | --- a/fs/hugetlbfs/inode.c | ||
80 | +++ b/fs/hugetlbfs/inode.c | ||
81 | @@ -570,7 +570,7 @@ static int hugetlbfs_set_page_dirty(struct page *page) | ||
82 | |||
83 | static int hugetlbfs_migrate_page(struct address_space *mapping, | ||
84 | struct page *newpage, struct page *page, | ||
85 | - bool sync) | ||
86 | + enum migrate_mode mode) | ||
87 | { | ||
88 | int rc; | ||
89 | |||
90 | diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h | ||
91 | index 8d96ed6..68b3f20 100644 | ||
92 | --- a/fs/nfs/internal.h | ||
93 | +++ b/fs/nfs/internal.h | ||
94 | @@ -330,7 +330,7 @@ void nfs_commit_release_pages(struct nfs_write_data *data); | ||
95 | |||
96 | #ifdef CONFIG_MIGRATION | ||
97 | extern int nfs_migrate_page(struct address_space *, | ||
98 | - struct page *, struct page *, bool); | ||
99 | + struct page *, struct page *, enum migrate_mode); | ||
100 | #else | ||
101 | #define nfs_migrate_page NULL | ||
102 | #endif | ||
103 | diff --git a/fs/nfs/write.c b/fs/nfs/write.c | ||
104 | index 31b2461..c6e523a 100644 | ||
105 | --- a/fs/nfs/write.c | ||
106 | +++ b/fs/nfs/write.c | ||
107 | @@ -1711,7 +1711,7 @@ out_error: | ||
108 | |||
109 | #ifdef CONFIG_MIGRATION | ||
110 | int nfs_migrate_page(struct address_space *mapping, struct page *newpage, | ||
111 | - struct page *page, bool sync) | ||
112 | + struct page *page, enum migrate_mode mode) | ||
113 | { | ||
114 | /* | ||
115 | * If PagePrivate is set, then the page is currently associated with | ||
116 | @@ -1726,7 +1726,7 @@ int nfs_migrate_page(struct address_space *mapping, struct page *newpage, | ||
117 | |||
118 | nfs_fscache_release_page(page, GFP_KERNEL); | ||
119 | |||
120 | - return migrate_page(mapping, newpage, page, sync); | ||
121 | + return migrate_page(mapping, newpage, page, mode); | ||
122 | } | ||
123 | #endif | ||
124 | |||
125 | diff --git a/include/linux/fs.h b/include/linux/fs.h | ||
126 | index 2ae90d3..29b6353 100644 | ||
127 | --- a/include/linux/fs.h | ||
128 | +++ b/include/linux/fs.h | ||
129 | @@ -525,6 +525,7 @@ enum positive_aop_returns { | ||
130 | struct page; | ||
131 | struct address_space; | ||
132 | struct writeback_control; | ||
133 | +enum migrate_mode; | ||
134 | |||
135 | struct iov_iter { | ||
136 | const struct iovec *iov; | ||
137 | @@ -614,7 +615,7 @@ struct address_space_operations { | ||
138 | * is false, it must not block. | ||
139 | */ | ||
140 | int (*migratepage) (struct address_space *, | ||
141 | - struct page *, struct page *, bool); | ||
142 | + struct page *, struct page *, enum migrate_mode); | ||
143 | int (*launder_page) (struct page *); | ||
144 | int (*is_partially_uptodate) (struct page *, read_descriptor_t *, | ||
145 | unsigned long); | ||
146 | @@ -2589,7 +2590,8 @@ extern int generic_check_addressable(unsigned, u64); | ||
147 | |||
148 | #ifdef CONFIG_MIGRATION | ||
149 | extern int buffer_migrate_page(struct address_space *, | ||
150 | - struct page *, struct page *, bool); | ||
151 | + struct page *, struct page *, | ||
152 | + enum migrate_mode); | ||
153 | #else | ||
154 | #define buffer_migrate_page NULL | ||
155 | #endif | ||
156 | diff --git a/include/linux/migrate.h b/include/linux/migrate.h | ||
157 | index 14e6d2a..eaf8674 100644 | ||
158 | --- a/include/linux/migrate.h | ||
159 | +++ b/include/linux/migrate.h | ||
160 | @@ -6,18 +6,31 @@ | ||
161 | |||
162 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); | ||
163 | |||
164 | +/* | ||
165 | + * MIGRATE_ASYNC means never block | ||
166 | + * MIGRATE_SYNC_LIGHT in the current implementation means to allow blocking | ||
167 | + * on most operations but not ->writepage as the potential stall time | ||
168 | + * is too significant | ||
169 | + * MIGRATE_SYNC will block when migrating pages | ||
170 | + */ | ||
171 | +enum migrate_mode { | ||
172 | + MIGRATE_ASYNC, | ||
173 | + MIGRATE_SYNC_LIGHT, | ||
174 | + MIGRATE_SYNC, | ||
175 | +}; | ||
176 | + | ||
177 | #ifdef CONFIG_MIGRATION | ||
178 | #define PAGE_MIGRATION 1 | ||
179 | |||
180 | extern void putback_lru_pages(struct list_head *l); | ||
181 | extern int migrate_page(struct address_space *, | ||
182 | - struct page *, struct page *, bool); | ||
183 | + struct page *, struct page *, enum migrate_mode); | ||
184 | extern int migrate_pages(struct list_head *l, new_page_t x, | ||
185 | unsigned long private, bool offlining, | ||
186 | - bool sync); | ||
187 | + enum migrate_mode mode); | ||
188 | extern int migrate_huge_pages(struct list_head *l, new_page_t x, | ||
189 | unsigned long private, bool offlining, | ||
190 | - bool sync); | ||
191 | + enum migrate_mode mode); | ||
192 | |||
193 | extern int fail_migrate_page(struct address_space *, | ||
194 | struct page *, struct page *); | ||
195 | @@ -36,10 +49,10 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping, | ||
196 | static inline void putback_lru_pages(struct list_head *l) {} | ||
197 | static inline int migrate_pages(struct list_head *l, new_page_t x, | ||
198 | unsigned long private, bool offlining, | ||
199 | - bool sync) { return -ENOSYS; } | ||
200 | + enum migrate_mode mode) { return -ENOSYS; } | ||
201 | static inline int migrate_huge_pages(struct list_head *l, new_page_t x, | ||
202 | unsigned long private, bool offlining, | ||
203 | - bool sync) { return -ENOSYS; } | ||
204 | + enum migrate_mode mode) { return -ENOSYS; } | ||
205 | |||
206 | static inline int migrate_prep(void) { return -ENOSYS; } | ||
207 | static inline int migrate_prep_local(void) { return -ENOSYS; } | ||
208 | diff --git a/mm/compaction.c b/mm/compaction.c | ||
209 | index 979a919..46973fb 100644 | ||
210 | --- a/mm/compaction.c | ||
211 | +++ b/mm/compaction.c | ||
212 | @@ -577,7 +577,7 @@ static int compact_zone(struct zone *zone, struct compact_control *cc) | ||
213 | nr_migrate = cc->nr_migratepages; | ||
214 | err = migrate_pages(&cc->migratepages, compaction_alloc, | ||
215 | (unsigned long)cc, false, | ||
216 | - cc->sync); | ||
217 | + cc->sync ? MIGRATE_SYNC_LIGHT : MIGRATE_ASYNC); | ||
218 | update_nr_listpages(cc); | ||
219 | nr_remaining = cc->nr_migratepages; | ||
220 | |||
221 | diff --git a/mm/memory-failure.c b/mm/memory-failure.c | ||
222 | index 06d3479..56080ea 100644 | ||
223 | --- a/mm/memory-failure.c | ||
224 | +++ b/mm/memory-failure.c | ||
225 | @@ -1557,7 +1557,7 @@ int soft_offline_page(struct page *page, int flags) | ||
226 | page_is_file_cache(page)); | ||
227 | list_add(&page->lru, &pagelist); | ||
228 | ret = migrate_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL, | ||
229 | - 0, true); | ||
230 | + 0, MIGRATE_SYNC); | ||
231 | if (ret) { | ||
232 | putback_lru_pages(&pagelist); | ||
233 | pr_info("soft offline: %#lx: migration failed %d, type %lx\n", | ||
234 | diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c | ||
235 | index 2168489..6629faf 100644 | ||
236 | --- a/mm/memory_hotplug.c | ||
237 | +++ b/mm/memory_hotplug.c | ||
238 | @@ -809,7 +809,7 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) | ||
239 | } | ||
240 | /* this function returns # of failed pages */ | ||
241 | ret = migrate_pages(&source, hotremove_migrate_alloc, 0, | ||
242 | - true, true); | ||
243 | + true, MIGRATE_SYNC); | ||
244 | if (ret) | ||
245 | putback_lru_pages(&source); | ||
246 | } | ||
247 | diff --git a/mm/mempolicy.c b/mm/mempolicy.c | ||
248 | index b26aae2..f2650bc 100644 | ||
249 | --- a/mm/mempolicy.c | ||
250 | +++ b/mm/mempolicy.c | ||
251 | @@ -942,7 +942,7 @@ static int migrate_to_node(struct mm_struct *mm, int source, int dest, | ||
252 | |||
253 | if (!list_empty(&pagelist)) { | ||
254 | err = migrate_pages(&pagelist, new_node_page, dest, | ||
255 | - false, true); | ||
256 | + false, MIGRATE_SYNC); | ||
257 | if (err) | ||
258 | putback_lru_pages(&pagelist); | ||
259 | } | ||
260 | diff --git a/mm/migrate.c b/mm/migrate.c | ||
261 | index 65c12d2..180d97f 100644 | ||
262 | --- a/mm/migrate.c | ||
263 | +++ b/mm/migrate.c | ||
264 | @@ -222,12 +222,13 @@ out: | ||
265 | |||
266 | #ifdef CONFIG_BLOCK | ||
267 | /* Returns true if all buffers are successfully locked */ | ||
268 | -static bool buffer_migrate_lock_buffers(struct buffer_head *head, bool sync) | ||
269 | +static bool buffer_migrate_lock_buffers(struct buffer_head *head, | ||
270 | + enum migrate_mode mode) | ||
271 | { | ||
272 | struct buffer_head *bh = head; | ||
273 | |||
274 | /* Simple case, sync compaction */ | ||
275 | - if (sync) { | ||
276 | + if (mode != MIGRATE_ASYNC) { | ||
277 | do { | ||
278 | get_bh(bh); | ||
279 | lock_buffer(bh); | ||
280 | @@ -263,7 +264,7 @@ static bool buffer_migrate_lock_buffers(struct buffer_head *head, bool sync) | ||
281 | } | ||
282 | #else | ||
283 | static inline bool buffer_migrate_lock_buffers(struct buffer_head *head, | ||
284 | - bool sync) | ||
285 | + enum migrate_mode mode) | ||
286 | { | ||
287 | return true; | ||
288 | } | ||
289 | @@ -279,7 +280,7 @@ static inline bool buffer_migrate_lock_buffers(struct buffer_head *head, | ||
290 | */ | ||
291 | static int migrate_page_move_mapping(struct address_space *mapping, | ||
292 | struct page *newpage, struct page *page, | ||
293 | - struct buffer_head *head, bool sync) | ||
294 | + struct buffer_head *head, enum migrate_mode mode) | ||
295 | { | ||
296 | int expected_count; | ||
297 | void **pslot; | ||
298 | @@ -315,7 +316,8 @@ static int migrate_page_move_mapping(struct address_space *mapping, | ||
299 | * the mapping back due to an elevated page count, we would have to | ||
300 | * block waiting on other references to be dropped. | ||
301 | */ | ||
302 | - if (!sync && head && !buffer_migrate_lock_buffers(head, sync)) { | ||
303 | + if (mode == MIGRATE_ASYNC && head && | ||
304 | + !buffer_migrate_lock_buffers(head, mode)) { | ||
305 | page_unfreeze_refs(page, expected_count); | ||
306 | spin_unlock_irq(&mapping->tree_lock); | ||
307 | return -EAGAIN; | ||
308 | @@ -478,13 +480,14 @@ EXPORT_SYMBOL(fail_migrate_page); | ||
309 | * Pages are locked upon entry and exit. | ||
310 | */ | ||
311 | int migrate_page(struct address_space *mapping, | ||
312 | - struct page *newpage, struct page *page, bool sync) | ||
313 | + struct page *newpage, struct page *page, | ||
314 | + enum migrate_mode mode) | ||
315 | { | ||
316 | int rc; | ||
317 | |||
318 | BUG_ON(PageWriteback(page)); /* Writeback must be complete */ | ||
319 | |||
320 | - rc = migrate_page_move_mapping(mapping, newpage, page, NULL, sync); | ||
321 | + rc = migrate_page_move_mapping(mapping, newpage, page, NULL, mode); | ||
322 | |||
323 | if (rc) | ||
324 | return rc; | ||
325 | @@ -501,17 +504,17 @@ EXPORT_SYMBOL(migrate_page); | ||
326 | * exist. | ||
327 | */ | ||
328 | int buffer_migrate_page(struct address_space *mapping, | ||
329 | - struct page *newpage, struct page *page, bool sync) | ||
330 | + struct page *newpage, struct page *page, enum migrate_mode mode) | ||
331 | { | ||
332 | struct buffer_head *bh, *head; | ||
333 | int rc; | ||
334 | |||
335 | if (!page_has_buffers(page)) | ||
336 | - return migrate_page(mapping, newpage, page, sync); | ||
337 | + return migrate_page(mapping, newpage, page, mode); | ||
338 | |||
339 | head = page_buffers(page); | ||
340 | |||
341 | - rc = migrate_page_move_mapping(mapping, newpage, page, head, sync); | ||
342 | + rc = migrate_page_move_mapping(mapping, newpage, page, head, mode); | ||
343 | |||
344 | if (rc) | ||
345 | return rc; | ||
346 | @@ -521,8 +524,8 @@ int buffer_migrate_page(struct address_space *mapping, | ||
347 | * with an IRQ-safe spinlock held. In the sync case, the buffers | ||
348 | * need to be locked now | ||
349 | */ | ||
350 | - if (sync) | ||
351 | - BUG_ON(!buffer_migrate_lock_buffers(head, sync)); | ||
352 | + if (mode != MIGRATE_ASYNC) | ||
353 | + BUG_ON(!buffer_migrate_lock_buffers(head, mode)); | ||
354 | |||
355 | ClearPagePrivate(page); | ||
356 | set_page_private(newpage, page_private(page)); | ||
357 | @@ -599,10 +602,11 @@ static int writeout(struct address_space *mapping, struct page *page) | ||
358 | * Default handling if a filesystem does not provide a migration function. | ||
359 | */ | ||
360 | static int fallback_migrate_page(struct address_space *mapping, | ||
361 | - struct page *newpage, struct page *page, bool sync) | ||
362 | + struct page *newpage, struct page *page, enum migrate_mode mode) | ||
363 | { | ||
364 | if (PageDirty(page)) { | ||
365 | - if (!sync) | ||
366 | + /* Only writeback pages in full synchronous migration */ | ||
367 | + if (mode != MIGRATE_SYNC) | ||
368 | return -EBUSY; | ||
369 | return writeout(mapping, page); | ||
370 | } | ||
371 | @@ -615,7 +619,7 @@ static int fallback_migrate_page(struct address_space *mapping, | ||
372 | !try_to_release_page(page, GFP_KERNEL)) | ||
373 | return -EAGAIN; | ||
374 | |||
375 | - return migrate_page(mapping, newpage, page, sync); | ||
376 | + return migrate_page(mapping, newpage, page, mode); | ||
377 | } | ||
378 | |||
379 | /* | ||
380 | @@ -630,7 +634,7 @@ static int fallback_migrate_page(struct address_space *mapping, | ||
381 | * == 0 - success | ||
382 | */ | ||
383 | static int move_to_new_page(struct page *newpage, struct page *page, | ||
384 | - int remap_swapcache, bool sync) | ||
385 | + int remap_swapcache, enum migrate_mode mode) | ||
386 | { | ||
387 | struct address_space *mapping; | ||
388 | int rc; | ||
389 | @@ -651,7 +655,7 @@ static int move_to_new_page(struct page *newpage, struct page *page, | ||
390 | |||
391 | mapping = page_mapping(page); | ||
392 | if (!mapping) | ||
393 | - rc = migrate_page(mapping, newpage, page, sync); | ||
394 | + rc = migrate_page(mapping, newpage, page, mode); | ||
395 | else if (mapping->a_ops->migratepage) | ||
396 | /* | ||
397 | * Most pages have a mapping and most filesystems provide a | ||
398 | @@ -660,9 +664,9 @@ static int move_to_new_page(struct page *newpage, struct page *page, | ||
399 | * is the most common path for page migration. | ||
400 | */ | ||
401 | rc = mapping->a_ops->migratepage(mapping, | ||
402 | - newpage, page, sync); | ||
403 | + newpage, page, mode); | ||
404 | else | ||
405 | - rc = fallback_migrate_page(mapping, newpage, page, sync); | ||
406 | + rc = fallback_migrate_page(mapping, newpage, page, mode); | ||
407 | |||
408 | if (rc) { | ||
409 | newpage->mapping = NULL; | ||
410 | @@ -677,7 +681,7 @@ static int move_to_new_page(struct page *newpage, struct page *page, | ||
411 | } | ||
412 | |||
413 | static int __unmap_and_move(struct page *page, struct page *newpage, | ||
414 | - int force, bool offlining, bool sync) | ||
415 | + int force, bool offlining, enum migrate_mode mode) | ||
416 | { | ||
417 | int rc = -EAGAIN; | ||
418 | int remap_swapcache = 1; | ||
419 | @@ -686,7 +690,7 @@ static int __unmap_and_move(struct page *page, struct page *newpage, | ||
420 | struct anon_vma *anon_vma = NULL; | ||
421 | |||
422 | if (!trylock_page(page)) { | ||
423 | - if (!force || !sync) | ||
424 | + if (!force || mode == MIGRATE_ASYNC) | ||
425 | goto out; | ||
426 | |||
427 | /* | ||
428 | @@ -732,10 +736,12 @@ static int __unmap_and_move(struct page *page, struct page *newpage, | ||
429 | |||
430 | if (PageWriteback(page)) { | ||
431 | /* | ||
432 | - * For !sync, there is no point retrying as the retry loop | ||
433 | - * is expected to be too short for PageWriteback to be cleared | ||
434 | + * Only in the case of a full syncronous migration is it | ||
435 | + * necessary to wait for PageWriteback. In the async case, | ||
436 | + * the retry loop is too short and in the sync-light case, | ||
437 | + * the overhead of stalling is too much | ||
438 | */ | ||
439 | - if (!sync) { | ||
440 | + if (mode != MIGRATE_SYNC) { | ||
441 | rc = -EBUSY; | ||
442 | goto uncharge; | ||
443 | } | ||
444 | @@ -806,7 +812,7 @@ static int __unmap_and_move(struct page *page, struct page *newpage, | ||
445 | |||
446 | skip_unmap: | ||
447 | if (!page_mapped(page)) | ||
448 | - rc = move_to_new_page(newpage, page, remap_swapcache, sync); | ||
449 | + rc = move_to_new_page(newpage, page, remap_swapcache, mode); | ||
450 | |||
451 | if (rc && remap_swapcache) | ||
452 | remove_migration_ptes(page, page); | ||
453 | @@ -829,7 +835,8 @@ out: | ||
454 | * to the newly allocated page in newpage. | ||
455 | */ | ||
456 | static int unmap_and_move(new_page_t get_new_page, unsigned long private, | ||
457 | - struct page *page, int force, bool offlining, bool sync) | ||
458 | + struct page *page, int force, bool offlining, | ||
459 | + enum migrate_mode mode) | ||
460 | { | ||
461 | int rc = 0; | ||
462 | int *result = NULL; | ||
463 | @@ -847,7 +854,7 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private, | ||
464 | if (unlikely(split_huge_page(page))) | ||
465 | goto out; | ||
466 | |||
467 | - rc = __unmap_and_move(page, newpage, force, offlining, sync); | ||
468 | + rc = __unmap_and_move(page, newpage, force, offlining, mode); | ||
469 | out: | ||
470 | if (rc != -EAGAIN) { | ||
471 | /* | ||
472 | @@ -895,7 +902,8 @@ out: | ||
473 | */ | ||
474 | static int unmap_and_move_huge_page(new_page_t get_new_page, | ||
475 | unsigned long private, struct page *hpage, | ||
476 | - int force, bool offlining, bool sync) | ||
477 | + int force, bool offlining, | ||
478 | + enum migrate_mode mode) | ||
479 | { | ||
480 | int rc = 0; | ||
481 | int *result = NULL; | ||
482 | @@ -908,7 +916,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page, | ||
483 | rc = -EAGAIN; | ||
484 | |||
485 | if (!trylock_page(hpage)) { | ||
486 | - if (!force || !sync) | ||
487 | + if (!force || mode != MIGRATE_SYNC) | ||
488 | goto out; | ||
489 | lock_page(hpage); | ||
490 | } | ||
491 | @@ -919,7 +927,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page, | ||
492 | try_to_unmap(hpage, TTU_MIGRATION|TTU_IGNORE_MLOCK|TTU_IGNORE_ACCESS); | ||
493 | |||
494 | if (!page_mapped(hpage)) | ||
495 | - rc = move_to_new_page(new_hpage, hpage, 1, sync); | ||
496 | + rc = move_to_new_page(new_hpage, hpage, 1, mode); | ||
497 | |||
498 | if (rc) | ||
499 | remove_migration_ptes(hpage, hpage); | ||
500 | @@ -962,7 +970,7 @@ out: | ||
501 | */ | ||
502 | int migrate_pages(struct list_head *from, | ||
503 | new_page_t get_new_page, unsigned long private, bool offlining, | ||
504 | - bool sync) | ||
505 | + enum migrate_mode mode) | ||
506 | { | ||
507 | int retry = 1; | ||
508 | int nr_failed = 0; | ||
509 | @@ -983,7 +991,7 @@ int migrate_pages(struct list_head *from, | ||
510 | |||
511 | rc = unmap_and_move(get_new_page, private, | ||
512 | page, pass > 2, offlining, | ||
513 | - sync); | ||
514 | + mode); | ||
515 | |||
516 | switch(rc) { | ||
517 | case -ENOMEM: | ||
518 | @@ -1013,7 +1021,7 @@ out: | ||
519 | |||
520 | int migrate_huge_pages(struct list_head *from, | ||
521 | new_page_t get_new_page, unsigned long private, bool offlining, | ||
522 | - bool sync) | ||
523 | + enum migrate_mode mode) | ||
524 | { | ||
525 | int retry = 1; | ||
526 | int nr_failed = 0; | ||
527 | @@ -1030,7 +1038,7 @@ int migrate_huge_pages(struct list_head *from, | ||
528 | |||
529 | rc = unmap_and_move_huge_page(get_new_page, | ||
530 | private, page, pass > 2, offlining, | ||
531 | - sync); | ||
532 | + mode); | ||
533 | |||
534 | switch(rc) { | ||
535 | case -ENOMEM: | ||
536 | @@ -1159,7 +1167,7 @@ set_status: | ||
537 | err = 0; | ||
538 | if (!list_empty(&pagelist)) { | ||
539 | err = migrate_pages(&pagelist, new_page_node, | ||
540 | - (unsigned long)pm, 0, true); | ||
541 | + (unsigned long)pm, 0, MIGRATE_SYNC); | ||
542 | if (err) | ||
543 | putback_lru_pages(&pagelist); | ||
544 | } | ||
545 | -- | ||
546 | 1.7.7.6 | ||
547 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0007-mm-vmscan-when-reclaiming-for-compaction-ensure-ther.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0007-mm-vmscan-when-reclaiming-for-compaction-ensure-ther.patch new file mode 100644 index 00000000..a3746f10 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0007-mm-vmscan-when-reclaiming-for-compaction-ensure-ther.patch | |||
@@ -0,0 +1,120 @@ | |||
1 | From 70bd5ad826ce15eedd0434f9926730716a1d5c53 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mel Gorman <mgorman@suse.de> | ||
3 | Date: Thu, 12 Jan 2012 17:19:45 -0800 | ||
4 | Subject: [PATCH 07/73] mm: vmscan: when reclaiming for compaction, ensure | ||
5 | there are sufficient free pages available | ||
6 | |||
7 | commit fe4b1b244bdb96136855f2c694071cb09d140766 upstream. | ||
8 | |||
9 | Stable note: Not tracked on Bugzilla. THP and compaction was found to | ||
10 | aggressively reclaim pages and stall systems under different | ||
11 | situations that was addressed piecemeal over time. This patch | ||
12 | addresses a problem where the fix regressed THP allocation | ||
13 | success rates. | ||
14 | |||
15 | In commit e0887c19 ("vmscan: limit direct reclaim for higher order | ||
16 | allocations"), Rik noted that reclaim was too aggressive when THP was | ||
17 | enabled. In his initial patch he used the number of free pages to decide | ||
18 | if reclaim should abort for compaction. My feedback was that reclaim and | ||
19 | compaction should be using the same logic when deciding if reclaim should | ||
20 | be aborted. | ||
21 | |||
22 | Unfortunately, this had the effect of reducing THP success rates when the | ||
23 | workload included something like streaming reads that continually | ||
24 | allocated pages. The window during which compaction could run and return | ||
25 | a THP was too small. | ||
26 | |||
27 | This patch combines Rik's two patches together. compaction_suitable() is | ||
28 | still used to decide if reclaim should be aborted to allow compaction is | ||
29 | used. However, it will also ensure that there is a reasonable buffer of | ||
30 | free pages available. This improves upon the THP allocation success rates | ||
31 | but bounds the number of pages that are freed for compaction. | ||
32 | |||
33 | Signed-off-by: Mel Gorman <mgorman@suse.de> | ||
34 | Reviewed-by: Rik van Riel<riel@redhat.com> | ||
35 | Cc: Andrea Arcangeli <aarcange@redhat.com> | ||
36 | Cc: Minchan Kim <minchan.kim@gmail.com> | ||
37 | Cc: Dave Jones <davej@redhat.com> | ||
38 | Cc: Jan Kara <jack@suse.cz> | ||
39 | Cc: Andy Isaacson <adi@hexapodia.org> | ||
40 | Cc: Nai Xia <nai.xia@gmail.com> | ||
41 | Cc: Johannes Weiner <jweiner@redhat.com> | ||
42 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
43 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
44 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
45 | --- | ||
46 | mm/vmscan.c | 44 +++++++++++++++++++++++++++++++++++++++----- | ||
47 | 1 files changed, 39 insertions(+), 5 deletions(-) | ||
48 | |||
49 | diff --git a/mm/vmscan.c b/mm/vmscan.c | ||
50 | index 1b95e4c..fd47744 100644 | ||
51 | --- a/mm/vmscan.c | ||
52 | +++ b/mm/vmscan.c | ||
53 | @@ -2119,6 +2119,42 @@ restart: | ||
54 | throttle_vm_writeout(sc->gfp_mask); | ||
55 | } | ||
56 | |||
57 | +/* Returns true if compaction should go ahead for a high-order request */ | ||
58 | +static inline bool compaction_ready(struct zone *zone, struct scan_control *sc) | ||
59 | +{ | ||
60 | + unsigned long balance_gap, watermark; | ||
61 | + bool watermark_ok; | ||
62 | + | ||
63 | + /* Do not consider compaction for orders reclaim is meant to satisfy */ | ||
64 | + if (sc->order <= PAGE_ALLOC_COSTLY_ORDER) | ||
65 | + return false; | ||
66 | + | ||
67 | + /* | ||
68 | + * Compaction takes time to run and there are potentially other | ||
69 | + * callers using the pages just freed. Continue reclaiming until | ||
70 | + * there is a buffer of free pages available to give compaction | ||
71 | + * a reasonable chance of completing and allocating the page | ||
72 | + */ | ||
73 | + balance_gap = min(low_wmark_pages(zone), | ||
74 | + (zone->present_pages + KSWAPD_ZONE_BALANCE_GAP_RATIO-1) / | ||
75 | + KSWAPD_ZONE_BALANCE_GAP_RATIO); | ||
76 | + watermark = high_wmark_pages(zone) + balance_gap + (2UL << sc->order); | ||
77 | + watermark_ok = zone_watermark_ok_safe(zone, 0, watermark, 0, 0); | ||
78 | + | ||
79 | + /* | ||
80 | + * If compaction is deferred, reclaim up to a point where | ||
81 | + * compaction will have a chance of success when re-enabled | ||
82 | + */ | ||
83 | + if (compaction_deferred(zone)) | ||
84 | + return watermark_ok; | ||
85 | + | ||
86 | + /* If compaction is not ready to start, keep reclaiming */ | ||
87 | + if (!compaction_suitable(zone, sc->order)) | ||
88 | + return false; | ||
89 | + | ||
90 | + return watermark_ok; | ||
91 | +} | ||
92 | + | ||
93 | /* | ||
94 | * This is the direct reclaim path, for page-allocating processes. We only | ||
95 | * try to reclaim pages from zones which will satisfy the caller's allocation | ||
96 | @@ -2136,8 +2172,8 @@ restart: | ||
97 | * scan then give up on it. | ||
98 | * | ||
99 | * This function returns true if a zone is being reclaimed for a costly | ||
100 | - * high-order allocation and compaction is either ready to begin or deferred. | ||
101 | - * This indicates to the caller that it should retry the allocation or fail. | ||
102 | + * high-order allocation and compaction is ready to begin. This indicates to | ||
103 | + * the caller that it should retry the allocation or fail. | ||
104 | */ | ||
105 | static bool shrink_zones(int priority, struct zonelist *zonelist, | ||
106 | struct scan_control *sc) | ||
107 | @@ -2171,9 +2207,7 @@ static bool shrink_zones(int priority, struct zonelist *zonelist, | ||
108 | * noticable problem, like transparent huge page | ||
109 | * allocations. | ||
110 | */ | ||
111 | - if (sc->order > PAGE_ALLOC_COSTLY_ORDER && | ||
112 | - (compaction_suitable(zone, sc->order) || | ||
113 | - compaction_deferred(zone))) { | ||
114 | + if (compaction_ready(zone, sc)) { | ||
115 | should_abort_reclaim = true; | ||
116 | continue; | ||
117 | } | ||
118 | -- | ||
119 | 1.7.7.6 | ||
120 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0008-mm-vmscan-do-not-OOM-if-aborting-reclaim-to-start-co.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0008-mm-vmscan-do-not-OOM-if-aborting-reclaim-to-start-co.patch new file mode 100644 index 00000000..3531d783 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0008-mm-vmscan-do-not-OOM-if-aborting-reclaim-to-start-co.patch | |||
@@ -0,0 +1,71 @@ | |||
1 | From c60330596c8497a94d53b80c5b96799b01846248 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mel Gorman <mgorman@suse.de> | ||
3 | Date: Thu, 12 Jan 2012 17:19:33 -0800 | ||
4 | Subject: [PATCH 08/73] mm: vmscan: do not OOM if aborting reclaim to start | ||
5 | compaction | ||
6 | |||
7 | commit 7335084d446b83cbcb15da80497d03f0c1dc9e21 upstream. | ||
8 | |||
9 | Stable note: Not tracked in Bugzilla. This patch makes later patches | ||
10 | easier to apply but otherwise has little to justify it. The | ||
11 | problem it fixes was never observed but the source of the | ||
12 | theoretical problem did not exist for very long. | ||
13 | |||
14 | During direct reclaim it is possible that reclaim will be aborted so that | ||
15 | compaction can be attempted to satisfy a high-order allocation. If this | ||
16 | decision is made before any pages are reclaimed, it is possible that 0 is | ||
17 | returned to the page allocator potentially triggering an OOM. This has | ||
18 | not been observed but it is a possibility so this patch addresses it. | ||
19 | |||
20 | Signed-off-by: Mel Gorman <mgorman@suse.de> | ||
21 | Reviewed-by: Rik van Riel <riel@redhat.com> | ||
22 | Cc: Andrea Arcangeli <aarcange@redhat.com> | ||
23 | Cc: Minchan Kim <minchan.kim@gmail.com> | ||
24 | Cc: Dave Jones <davej@redhat.com> | ||
25 | Cc: Jan Kara <jack@suse.cz> | ||
26 | Cc: Andy Isaacson <adi@hexapodia.org> | ||
27 | Cc: Nai Xia <nai.xia@gmail.com> | ||
28 | Cc: Johannes Weiner <jweiner@redhat.com> | ||
29 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
30 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
31 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
32 | --- | ||
33 | mm/vmscan.c | 8 +++++++- | ||
34 | 1 files changed, 7 insertions(+), 1 deletions(-) | ||
35 | |||
36 | diff --git a/mm/vmscan.c b/mm/vmscan.c | ||
37 | index fd47744..662a5ea 100644 | ||
38 | --- a/mm/vmscan.c | ||
39 | +++ b/mm/vmscan.c | ||
40 | @@ -2284,6 +2284,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | ||
41 | struct zoneref *z; | ||
42 | struct zone *zone; | ||
43 | unsigned long writeback_threshold; | ||
44 | + bool should_abort_reclaim; | ||
45 | |||
46 | get_mems_allowed(); | ||
47 | delayacct_freepages_start(); | ||
48 | @@ -2295,7 +2296,8 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | ||
49 | sc->nr_scanned = 0; | ||
50 | if (!priority) | ||
51 | disable_swap_token(sc->mem_cgroup); | ||
52 | - if (shrink_zones(priority, zonelist, sc)) | ||
53 | + should_abort_reclaim = shrink_zones(priority, zonelist, sc); | ||
54 | + if (should_abort_reclaim) | ||
55 | break; | ||
56 | |||
57 | /* | ||
58 | @@ -2363,6 +2365,10 @@ out: | ||
59 | if (oom_killer_disabled) | ||
60 | return 0; | ||
61 | |||
62 | + /* Aborting reclaim to try compaction? don't OOM, then */ | ||
63 | + if (should_abort_reclaim) | ||
64 | + return 1; | ||
65 | + | ||
66 | /* top priority shrink_zones still had more to do? don't OOM, then */ | ||
67 | if (scanning_global_lru(sc) && !all_unreclaimable(zonelist, sc)) | ||
68 | return 1; | ||
69 | -- | ||
70 | 1.7.7.6 | ||
71 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0009-mm-vmscan-check-if-reclaim-should-really-abort-even-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0009-mm-vmscan-check-if-reclaim-should-really-abort-even-.patch new file mode 100644 index 00000000..76a434de --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0009-mm-vmscan-check-if-reclaim-should-really-abort-even-.patch | |||
@@ -0,0 +1,119 @@ | |||
1 | From 0f7e2171b241704ee17ab27e4b8a7ef8c7f1dc32 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mel Gorman <mgorman@suse.de> | ||
3 | Date: Thu, 12 Jan 2012 17:19:49 -0800 | ||
4 | Subject: [PATCH 09/73] mm: vmscan: check if reclaim should really abort even | ||
5 | if compaction_ready() is true for one zone | ||
6 | |||
7 | commit 0cee34fd72c582b4f8ad8ce00645b75fb4168199 upstream. | ||
8 | |||
9 | Stable note: Not tracked on Bugzilla. THP and compaction was found to | ||
10 | aggressively reclaim pages and stall systems under different | ||
11 | situations that was addressed piecemeal over time. | ||
12 | |||
13 | If compaction can proceed for a given zone, shrink_zones() does not | ||
14 | reclaim any more pages from it. After commit [e0c2327: vmscan: abort | ||
15 | reclaim/compaction if compaction can proceed], do_try_to_free_pages() | ||
16 | tries to finish as soon as possible once one zone can compact. | ||
17 | |||
18 | This was intended to prevent slabs being shrunk unnecessarily but there | ||
19 | are side-effects. One is that a small zone that is ready for compaction | ||
20 | will abort reclaim even if the chances of successfully allocating a THP | ||
21 | from that zone is small. It also means that reclaim can return too early | ||
22 | even though sc->nr_to_reclaim pages were not reclaimed. | ||
23 | |||
24 | This partially reverts the commit until it is proven that slabs are really | ||
25 | being shrunk unnecessarily but preserves the check to return 1 to avoid | ||
26 | OOM if reclaim was aborted prematurely. | ||
27 | |||
28 | [aarcange@redhat.com: This patch replaces a revert from Andrea] | ||
29 | Signed-off-by: Mel Gorman <mgorman@suse.de> | ||
30 | Reviewed-by: Rik van Riel <riel@redhat.com> | ||
31 | Cc: Andrea Arcangeli <aarcange@redhat.com> | ||
32 | Cc: Minchan Kim <minchan.kim@gmail.com> | ||
33 | Cc: Dave Jones <davej@redhat.com> | ||
34 | Cc: Jan Kara <jack@suse.cz> | ||
35 | Cc: Andy Isaacson <adi@hexapodia.org> | ||
36 | Cc: Nai Xia <nai.xia@gmail.com> | ||
37 | Cc: Johannes Weiner <jweiner@redhat.com> | ||
38 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
39 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
40 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
41 | --- | ||
42 | mm/vmscan.c | 19 +++++++++---------- | ||
43 | 1 files changed, 9 insertions(+), 10 deletions(-) | ||
44 | |||
45 | diff --git a/mm/vmscan.c b/mm/vmscan.c | ||
46 | index 662a5ea..9e89de6 100644 | ||
47 | --- a/mm/vmscan.c | ||
48 | +++ b/mm/vmscan.c | ||
49 | @@ -2173,7 +2173,8 @@ static inline bool compaction_ready(struct zone *zone, struct scan_control *sc) | ||
50 | * | ||
51 | * This function returns true if a zone is being reclaimed for a costly | ||
52 | * high-order allocation and compaction is ready to begin. This indicates to | ||
53 | - * the caller that it should retry the allocation or fail. | ||
54 | + * the caller that it should consider retrying the allocation instead of | ||
55 | + * further reclaim. | ||
56 | */ | ||
57 | static bool shrink_zones(int priority, struct zonelist *zonelist, | ||
58 | struct scan_control *sc) | ||
59 | @@ -2182,7 +2183,7 @@ static bool shrink_zones(int priority, struct zonelist *zonelist, | ||
60 | struct zone *zone; | ||
61 | unsigned long nr_soft_reclaimed; | ||
62 | unsigned long nr_soft_scanned; | ||
63 | - bool should_abort_reclaim = false; | ||
64 | + bool aborted_reclaim = false; | ||
65 | |||
66 | for_each_zone_zonelist_nodemask(zone, z, zonelist, | ||
67 | gfp_zone(sc->gfp_mask), sc->nodemask) { | ||
68 | @@ -2208,7 +2209,7 @@ static bool shrink_zones(int priority, struct zonelist *zonelist, | ||
69 | * allocations. | ||
70 | */ | ||
71 | if (compaction_ready(zone, sc)) { | ||
72 | - should_abort_reclaim = true; | ||
73 | + aborted_reclaim = true; | ||
74 | continue; | ||
75 | } | ||
76 | } | ||
77 | @@ -2230,7 +2231,7 @@ static bool shrink_zones(int priority, struct zonelist *zonelist, | ||
78 | shrink_zone(priority, zone, sc); | ||
79 | } | ||
80 | |||
81 | - return should_abort_reclaim; | ||
82 | + return aborted_reclaim; | ||
83 | } | ||
84 | |||
85 | static bool zone_reclaimable(struct zone *zone) | ||
86 | @@ -2284,7 +2285,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | ||
87 | struct zoneref *z; | ||
88 | struct zone *zone; | ||
89 | unsigned long writeback_threshold; | ||
90 | - bool should_abort_reclaim; | ||
91 | + bool aborted_reclaim; | ||
92 | |||
93 | get_mems_allowed(); | ||
94 | delayacct_freepages_start(); | ||
95 | @@ -2296,9 +2297,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | ||
96 | sc->nr_scanned = 0; | ||
97 | if (!priority) | ||
98 | disable_swap_token(sc->mem_cgroup); | ||
99 | - should_abort_reclaim = shrink_zones(priority, zonelist, sc); | ||
100 | - if (should_abort_reclaim) | ||
101 | - break; | ||
102 | + aborted_reclaim = shrink_zones(priority, zonelist, sc); | ||
103 | |||
104 | /* | ||
105 | * Don't shrink slabs when reclaiming memory from | ||
106 | @@ -2365,8 +2364,8 @@ out: | ||
107 | if (oom_killer_disabled) | ||
108 | return 0; | ||
109 | |||
110 | - /* Aborting reclaim to try compaction? don't OOM, then */ | ||
111 | - if (should_abort_reclaim) | ||
112 | + /* Aborted reclaim to try compaction? don't OOM, then */ | ||
113 | + if (aborted_reclaim) | ||
114 | return 1; | ||
115 | |||
116 | /* top priority shrink_zones still had more to do? don't OOM, then */ | ||
117 | -- | ||
118 | 1.7.7.6 | ||
119 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0010-vmscan-promote-shared-file-mapped-pages.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0010-vmscan-promote-shared-file-mapped-pages.patch new file mode 100644 index 00000000..e1037d4e --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0010-vmscan-promote-shared-file-mapped-pages.patch | |||
@@ -0,0 +1,82 @@ | |||
1 | From 2a487f6e48c8ee80432e512e3618a6837f6ff448 Mon Sep 17 00:00:00 2001 | ||
2 | From: Konstantin Khlebnikov <khlebnikov@openvz.org> | ||
3 | Date: Tue, 10 Jan 2012 15:06:59 -0800 | ||
4 | Subject: [PATCH 10/73] vmscan: promote shared file mapped pages | ||
5 | |||
6 | commit 34dbc67a644f11ab3475d822d72e25409911e760 upstream. | ||
7 | |||
8 | Stable note: Not tracked in Bugzilla. There were reports of shared | ||
9 | mapped pages being unfairly reclaimed in comparison to older kernels. | ||
10 | This is being addressed over time. The specific workload being | ||
11 | addressed here in described in paragraph four and while paragraph | ||
12 | five says it did not help performance as such, it made a difference | ||
13 | to major page faults. I'm aware of at least one bug for a large | ||
14 | vendor that was due to increased major faults. | ||
15 | |||
16 | Commit 645747462435 ("vmscan: detect mapped file pages used only once") | ||
17 | greatly decreases lifetime of single-used mapped file pages. | ||
18 | Unfortunately it also decreases life time of all shared mapped file | ||
19 | pages. Because after commit bf3f3bc5e7347 ("mm: don't mark_page_accessed | ||
20 | in fault path") page-fault handler does not mark page active or even | ||
21 | referenced. | ||
22 | |||
23 | Thus page_check_references() activates file page only if it was used twice | ||
24 | while it stays in inactive list, meanwhile it activates anon pages after | ||
25 | first access. Inactive list can be small enough, this way reclaimer can | ||
26 | accidentally throw away any widely used page if it wasn't used twice in | ||
27 | short period. | ||
28 | |||
29 | After this patch page_check_references() also activate file mapped page at | ||
30 | first inactive list scan if this page is already used multiple times via | ||
31 | several ptes. | ||
32 | |||
33 | I found this while trying to fix degragation in rhel6 (~2.6.32) from rhel5 | ||
34 | (~2.6.18). There a complete mess with >100 web/mail/spam/ftp containers, | ||
35 | they share all their files but there a lot of anonymous pages: ~500mb | ||
36 | shared file mapped memory and 15-20Gb non-shared anonymous memory. In | ||
37 | this situation major-pagefaults are very costly, because all containers | ||
38 | share the same page. In my load kernel created a disproportionate | ||
39 | pressure on the file memory, compared with the anonymous, they equaled | ||
40 | only if I raise swappiness up to 150 =) | ||
41 | |||
42 | These patches actually wasn't helped a lot in my problem, but I saw | ||
43 | noticable (10-20 times) reduce in count and average time of | ||
44 | major-pagefault in file-mapped areas. | ||
45 | |||
46 | Actually both patches are fixes for commit v2.6.33-5448-g6457474, because | ||
47 | it was aimed at one scenario (singly used pages), but it breaks the logic | ||
48 | in other scenarios (shared and/or executable pages) | ||
49 | |||
50 | Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org> | ||
51 | Acked-by: Pekka Enberg <penberg@kernel.org> | ||
52 | Acked-by: Minchan Kim <minchan.kim@gmail.com> | ||
53 | Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | ||
54 | Cc: Wu Fengguang <fengguang.wu@intel.com> | ||
55 | Cc: Johannes Weiner <hannes@cmpxchg.org> | ||
56 | Cc: Nick Piggin <npiggin@kernel.dk> | ||
57 | Cc: Mel Gorman <mel@csn.ul.ie> | ||
58 | Cc: Shaohua Li <shaohua.li@intel.com> | ||
59 | Cc: Rik van Riel <riel@redhat.com> | ||
60 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
61 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
62 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
63 | --- | ||
64 | mm/vmscan.c | 2 +- | ||
65 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
66 | |||
67 | diff --git a/mm/vmscan.c b/mm/vmscan.c | ||
68 | index 9e89de6..cd27455 100644 | ||
69 | --- a/mm/vmscan.c | ||
70 | +++ b/mm/vmscan.c | ||
71 | @@ -715,7 +715,7 @@ static enum page_references page_check_references(struct page *page, | ||
72 | */ | ||
73 | SetPageReferenced(page); | ||
74 | |||
75 | - if (referenced_page) | ||
76 | + if (referenced_page || referenced_ptes > 1) | ||
77 | return PAGEREF_ACTIVATE; | ||
78 | |||
79 | return PAGEREF_KEEP; | ||
80 | -- | ||
81 | 1.7.7.6 | ||
82 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0011-vmscan-activate-executable-pages-after-first-usage.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0011-vmscan-activate-executable-pages-after-first-usage.patch new file mode 100644 index 00000000..0f242088 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0011-vmscan-activate-executable-pages-after-first-usage.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | From 7560f662e5e895619c356365f675715d7f4ea577 Mon Sep 17 00:00:00 2001 | ||
2 | From: Konstantin Khlebnikov <khlebnikov@openvz.org> | ||
3 | Date: Tue, 10 Jan 2012 15:07:03 -0800 | ||
4 | Subject: [PATCH 11/73] vmscan: activate executable pages after first usage | ||
5 | |||
6 | commit c909e99364c8b6ca07864d752950b6b4ecf6bef4 upstream. | ||
7 | |||
8 | Stable note: Not tracked in Bugzilla. There were reports of shared | ||
9 | mapped pages being unfairly reclaimed in comparison to older kernels. | ||
10 | This is being addressed over time. | ||
11 | |||
12 | Logic added in commit 8cab4754d24a0 ("vmscan: make mapped executable pages | ||
13 | the first class citizen") was noticeably weakened in commit | ||
14 | 645747462435d84 ("vmscan: detect mapped file pages used only once"). | ||
15 | |||
16 | Currently these pages can become "first class citizens" only after second | ||
17 | usage. After this patch page_check_references() will activate they after | ||
18 | first usage, and executable code gets yet better chance to stay in memory. | ||
19 | |||
20 | Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org> | ||
21 | Cc: Pekka Enberg <penberg@kernel.org> | ||
22 | Cc: Minchan Kim <minchan.kim@gmail.com> | ||
23 | Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | ||
24 | Cc: Wu Fengguang <fengguang.wu@intel.com> | ||
25 | Cc: Johannes Weiner <hannes@cmpxchg.org> | ||
26 | Cc: Nick Piggin <npiggin@kernel.dk> | ||
27 | Cc: Mel Gorman <mel@csn.ul.ie> | ||
28 | Cc: Shaohua Li <shaohua.li@intel.com> | ||
29 | Cc: Rik van Riel <riel@redhat.com> | ||
30 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
31 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
32 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
33 | --- | ||
34 | mm/vmscan.c | 6 ++++++ | ||
35 | 1 files changed, 6 insertions(+), 0 deletions(-) | ||
36 | |||
37 | diff --git a/mm/vmscan.c b/mm/vmscan.c | ||
38 | index cd27455..87de9c6 100644 | ||
39 | --- a/mm/vmscan.c | ||
40 | +++ b/mm/vmscan.c | ||
41 | @@ -718,6 +718,12 @@ static enum page_references page_check_references(struct page *page, | ||
42 | if (referenced_page || referenced_ptes > 1) | ||
43 | return PAGEREF_ACTIVATE; | ||
44 | |||
45 | + /* | ||
46 | + * Activate file-backed executable pages after first usage. | ||
47 | + */ | ||
48 | + if (vm_flags & VM_EXEC) | ||
49 | + return PAGEREF_ACTIVATE; | ||
50 | + | ||
51 | return PAGEREF_KEEP; | ||
52 | } | ||
53 | |||
54 | -- | ||
55 | 1.7.7.6 | ||
56 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0012-mm-vmscan.c-consider-swap-space-when-deciding-whethe.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0012-mm-vmscan.c-consider-swap-space-when-deciding-whethe.patch new file mode 100644 index 00000000..63186e3a --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0012-mm-vmscan.c-consider-swap-space-when-deciding-whethe.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 2f1cec6b7649ab76eb3b0f736028388e4a7e9047 Mon Sep 17 00:00:00 2001 | ||
2 | From: Minchan Kim <minchan@kernel.org> | ||
3 | Date: Tue, 10 Jan 2012 15:08:18 -0800 | ||
4 | Subject: [PATCH 12/73] mm/vmscan.c: consider swap space when deciding whether | ||
5 | to continue reclaim | ||
6 | |||
7 | commit 86cfd3a45042ab242d47f3935a02811a402beab6 upstream. | ||
8 | |||
9 | Stable note: Not tracked in Bugzilla. This patch reduces kswapd CPU | ||
10 | usage on swapless systems with high anonymous memory usage. | ||
11 | |||
12 | It's pointless to continue reclaiming when we have no swap space and lots | ||
13 | of anon pages in the inactive list. | ||
14 | |||
15 | Without this patch, it is possible when swap is disabled to continue | ||
16 | trying to reclaim when there are only anonymous pages in the system even | ||
17 | though that will not make any progress. | ||
18 | |||
19 | Signed-off-by: Minchan Kim <minchan@kernel.org> | ||
20 | Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | ||
21 | Acked-by: Mel Gorman <mgorman@suse.de> | ||
22 | Reviewed-by: Rik van Riel <riel@redhat.com> | ||
23 | Cc: Johannes Weiner <jweiner@redhat.com> | ||
24 | Cc: Andrea Arcangeli <aarcange@redhat.com> | ||
25 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
26 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
27 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
28 | --- | ||
29 | mm/vmscan.c | 5 +++-- | ||
30 | 1 files changed, 3 insertions(+), 2 deletions(-) | ||
31 | |||
32 | diff --git a/mm/vmscan.c b/mm/vmscan.c | ||
33 | index 87de9c6..ba763be 100644 | ||
34 | --- a/mm/vmscan.c | ||
35 | +++ b/mm/vmscan.c | ||
36 | @@ -2049,8 +2049,9 @@ static inline bool should_continue_reclaim(struct zone *zone, | ||
37 | * inactive lists are large enough, continue reclaiming | ||
38 | */ | ||
39 | pages_for_compaction = (2UL << sc->order); | ||
40 | - inactive_lru_pages = zone_nr_lru_pages(zone, sc, LRU_INACTIVE_ANON) + | ||
41 | - zone_nr_lru_pages(zone, sc, LRU_INACTIVE_FILE); | ||
42 | + inactive_lru_pages = zone_nr_lru_pages(zone, sc, LRU_INACTIVE_FILE); | ||
43 | + if (nr_swap_pages > 0) | ||
44 | + inactive_lru_pages += zone_nr_lru_pages(zone, sc, LRU_INACTIVE_ANON); | ||
45 | if (sc->nr_reclaimed < pages_for_compaction && | ||
46 | inactive_lru_pages > pages_for_compaction) | ||
47 | return true; | ||
48 | -- | ||
49 | 1.7.7.6 | ||
50 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0013-mm-test-PageSwapBacked-in-lumpy-reclaim.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0013-mm-test-PageSwapBacked-in-lumpy-reclaim.patch new file mode 100644 index 00000000..fe39de94 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0013-mm-test-PageSwapBacked-in-lumpy-reclaim.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 0b642dde6e6cd5dc940498c7cdb676fc56e4cdf4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Hugh Dickins <hughd@google.com> | ||
3 | Date: Tue, 10 Jan 2012 15:08:33 -0800 | ||
4 | Subject: [PATCH 13/73] mm: test PageSwapBacked in lumpy reclaim | ||
5 | |||
6 | commit 043bcbe5ec51e0478ef2b44acef17193e01d7f70 upstream. | ||
7 | |||
8 | Stable note: Not tracked in Bugzilla. There were reports of shared | ||
9 | mapped pages being unfairly reclaimed in comparison to older kernels. | ||
10 | This is being addressed over time. Even though the subject | ||
11 | refers to lumpy reclaim, it impacts compaction as well. | ||
12 | |||
13 | Lumpy reclaim does well to stop at a PageAnon when there's no swap, but | ||
14 | better is to stop at any PageSwapBacked, which includes shmem/tmpfs too. | ||
15 | |||
16 | Signed-off-by: Hugh Dickins <hughd@google.com> | ||
17 | Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | ||
18 | Reviewed-by: Minchan Kim <minchan@kernel.org> | ||
19 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
20 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
21 | Signed-off-by: Mel Gorman <mgorman@suse.de> | ||
22 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
23 | --- | ||
24 | mm/vmscan.c | 2 +- | ||
25 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
26 | |||
27 | diff --git a/mm/vmscan.c b/mm/vmscan.c | ||
28 | index ba763be..b9eaa06 100644 | ||
29 | --- a/mm/vmscan.c | ||
30 | +++ b/mm/vmscan.c | ||
31 | @@ -1215,7 +1215,7 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, | ||
32 | * anon page which don't already have a swap slot is | ||
33 | * pointless. | ||
34 | */ | ||
35 | - if (nr_swap_pages <= 0 && PageAnon(cursor_page) && | ||
36 | + if (nr_swap_pages <= 0 && PageSwapBacked(cursor_page) && | ||
37 | !PageSwapCache(cursor_page)) | ||
38 | break; | ||
39 | |||
40 | -- | ||
41 | 1.7.7.6 | ||
42 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0014-mm-vmscan-convert-global-reclaim-to-per-memcg-LRU-li.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0014-mm-vmscan-convert-global-reclaim-to-per-memcg-LRU-li.patch new file mode 100644 index 00000000..0be1dd45 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0014-mm-vmscan-convert-global-reclaim-to-per-memcg-LRU-li.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | From 2c44243518b5d2a8bb5cd67691efe747e4424cc1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Johannes Weiner <jweiner@redhat.com> | ||
3 | Date: Thu, 12 Jan 2012 17:18:06 -0800 | ||
4 | Subject: [PATCH 14/73] mm: vmscan: convert global reclaim to per-memcg LRU | ||
5 | lists | ||
6 | |||
7 | commit b95a2f2d486d0d768a92879c023a03757b9c7e58 upstream - WARNING: this is a substitute patch. | ||
8 | |||
9 | Stable note: Not tracked in Bugzilla. This is a partial backport of an | ||
10 | upstream commit addressing a completely different issue | ||
11 | that accidentally contained an important fix. The workload | ||
12 | this patch helps was memcached when IO is started in the | ||
13 | background. memcached should stay resident but without this patch | ||
14 | it gets swapped. Sometimes this manifests as a drop in throughput | ||
15 | but mostly it was observed through /proc/vmstat. | ||
16 | |||
17 | Commit [246e87a9: memcg: fix get_scan_count() for small targets] was meant | ||
18 | to fix a problem whereby small scan targets on memcg were ignored causing | ||
19 | priority to raise too sharply. It forced scanning to take place if the | ||
20 | target was small, memcg or kswapd. | ||
21 | |||
22 | From the time it was introduced it caused excessive reclaim by kswapd | ||
23 | with workloads being pushed to swap that previously would have stayed | ||
24 | resident. This was accidentally fixed in commit [b95a2f2d: mm: vmscan: | ||
25 | convert global reclaim to per-memcg LRU lists] by making it harder for | ||
26 | kswapd to force scan small targets but that patchset is not suitable for | ||
27 | backporting. This was later changed again by commit [90126375: mm/vmscan: | ||
28 | push lruvec pointer into get_scan_count()] into a format that looks | ||
29 | like it would be a straight-forward backport but there is a subtle | ||
30 | difference due to the use of lruvecs. | ||
31 | |||
32 | The impact of the accidental fix is to make it harder for kswapd to force | ||
33 | scan small targets by taking zone->all_unreclaimable into account. This | ||
34 | patch is the closest equivalent available based on what is backported. | ||
35 | |||
36 | Signed-off-by: Mel Gorman <mgorman@suse.de> | ||
37 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
38 | --- | ||
39 | mm/vmscan.c | 3 ++- | ||
40 | 1 files changed, 2 insertions(+), 1 deletions(-) | ||
41 | |||
42 | diff --git a/mm/vmscan.c b/mm/vmscan.c | ||
43 | index b9eaa06..ded1857 100644 | ||
44 | --- a/mm/vmscan.c | ||
45 | +++ b/mm/vmscan.c | ||
46 | @@ -1911,7 +1911,8 @@ static void get_scan_count(struct zone *zone, struct scan_control *sc, | ||
47 | * latencies, so it's better to scan a minimum amount there as | ||
48 | * well. | ||
49 | */ | ||
50 | - if (scanning_global_lru(sc) && current_is_kswapd()) | ||
51 | + if (scanning_global_lru(sc) && current_is_kswapd() && | ||
52 | + zone->all_unreclaimable) | ||
53 | force_scan = true; | ||
54 | if (!scanning_global_lru(sc)) | ||
55 | force_scan = true; | ||
56 | -- | ||
57 | 1.7.7.6 | ||
58 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0015-cpuset-mm-reduce-large-amounts-of-memory-barrier-rel.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0015-cpuset-mm-reduce-large-amounts-of-memory-barrier-rel.patch new file mode 100644 index 00000000..d834bc2a --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0015-cpuset-mm-reduce-large-amounts-of-memory-barrier-rel.patch | |||
@@ -0,0 +1,655 @@ | |||
1 | From 8d847c6e95dab1977636cd9d3d5da5851f5c95aa Mon Sep 17 00:00:00 2001 | ||
2 | From: Mel Gorman <mgorman@suse.de> | ||
3 | Date: Wed, 21 Mar 2012 16:34:11 -0700 | ||
4 | Subject: [PATCH 15/73] cpuset: mm: reduce large amounts of memory barrier | ||
5 | related damage v3 | ||
6 | |||
7 | commit cc9a6c8776615f9c194ccf0b63a0aa5628235545 upstream. | ||
8 | |||
9 | Stable note: Not tracked in Bugzilla. [get|put]_mems_allowed() is extremely | ||
10 | expensive and severely impacted page allocator performance. This | ||
11 | is part of a series of patches that reduce page allocator overhead. | ||
12 | |||
13 | Commit c0ff7453bb5c ("cpuset,mm: fix no node to alloc memory when | ||
14 | changing cpuset's mems") wins a super prize for the largest number of | ||
15 | memory barriers entered into fast paths for one commit. | ||
16 | |||
17 | [get|put]_mems_allowed is incredibly heavy with pairs of full memory | ||
18 | barriers inserted into a number of hot paths. This was detected while | ||
19 | investigating at large page allocator slowdown introduced some time | ||
20 | after 2.6.32. The largest portion of this overhead was shown by | ||
21 | oprofile to be at an mfence introduced by this commit into the page | ||
22 | allocator hot path. | ||
23 | |||
24 | For extra style points, the commit introduced the use of yield() in an | ||
25 | implementation of what looks like a spinning mutex. | ||
26 | |||
27 | This patch replaces the full memory barriers on both read and write | ||
28 | sides with a sequence counter with just read barriers on the fast path | ||
29 | side. This is much cheaper on some architectures, including x86. The | ||
30 | main bulk of the patch is the retry logic if the nodemask changes in a | ||
31 | manner that can cause a false failure. | ||
32 | |||
33 | While updating the nodemask, a check is made to see if a false failure | ||
34 | is a risk. If it is, the sequence number gets bumped and parallel | ||
35 | allocators will briefly stall while the nodemask update takes place. | ||
36 | |||
37 | In a page fault test microbenchmark, oprofile samples from | ||
38 | __alloc_pages_nodemask went from 4.53% of all samples to 1.15%. The | ||
39 | actual results were | ||
40 | |||
41 | 3.3.0-rc3 3.3.0-rc3 | ||
42 | rc3-vanilla nobarrier-v2r1 | ||
43 | Clients 1 UserTime 0.07 ( 0.00%) 0.08 (-14.19%) | ||
44 | Clients 2 UserTime 0.07 ( 0.00%) 0.07 ( 2.72%) | ||
45 | Clients 4 UserTime 0.08 ( 0.00%) 0.07 ( 3.29%) | ||
46 | Clients 1 SysTime 0.70 ( 0.00%) 0.65 ( 6.65%) | ||
47 | Clients 2 SysTime 0.85 ( 0.00%) 0.82 ( 3.65%) | ||
48 | Clients 4 SysTime 1.41 ( 0.00%) 1.41 ( 0.32%) | ||
49 | Clients 1 WallTime 0.77 ( 0.00%) 0.74 ( 4.19%) | ||
50 | Clients 2 WallTime 0.47 ( 0.00%) 0.45 ( 3.73%) | ||
51 | Clients 4 WallTime 0.38 ( 0.00%) 0.37 ( 1.58%) | ||
52 | Clients 1 Flt/sec/cpu 497620.28 ( 0.00%) 520294.53 ( 4.56%) | ||
53 | Clients 2 Flt/sec/cpu 414639.05 ( 0.00%) 429882.01 ( 3.68%) | ||
54 | Clients 4 Flt/sec/cpu 257959.16 ( 0.00%) 258761.48 ( 0.31%) | ||
55 | Clients 1 Flt/sec 495161.39 ( 0.00%) 517292.87 ( 4.47%) | ||
56 | Clients 2 Flt/sec 820325.95 ( 0.00%) 850289.77 ( 3.65%) | ||
57 | Clients 4 Flt/sec 1020068.93 ( 0.00%) 1022674.06 ( 0.26%) | ||
58 | MMTests Statistics: duration | ||
59 | Sys Time Running Test (seconds) 135.68 132.17 | ||
60 | User+Sys Time Running Test (seconds) 164.2 160.13 | ||
61 | Total Elapsed Time (seconds) 123.46 120.87 | ||
62 | |||
63 | The overall improvement is small but the System CPU time is much | ||
64 | improved and roughly in correlation to what oprofile reported (these | ||
65 | performance figures are without profiling so skew is expected). The | ||
66 | actual number of page faults is noticeably improved. | ||
67 | |||
68 | For benchmarks like kernel builds, the overall benefit is marginal but | ||
69 | the system CPU time is slightly reduced. | ||
70 | |||
71 | To test the actual bug the commit fixed I opened two terminals. The | ||
72 | first ran within a cpuset and continually ran a small program that | ||
73 | faulted 100M of anonymous data. In a second window, the nodemask of the | ||
74 | cpuset was continually randomised in a loop. | ||
75 | |||
76 | Without the commit, the program would fail every so often (usually | ||
77 | within 10 seconds) and obviously with the commit everything worked fine. | ||
78 | With this patch applied, it also worked fine so the fix should be | ||
79 | functionally equivalent. | ||
80 | |||
81 | Signed-off-by: Mel Gorman <mgorman@suse.de> | ||
82 | Cc: Miao Xie <miaox@cn.fujitsu.com> | ||
83 | Cc: David Rientjes <rientjes@google.com> | ||
84 | Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> | ||
85 | Cc: Christoph Lameter <cl@linux.com> | ||
86 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
87 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
88 | Signed-off-by: Mel Gorman <mgorman@suse.de> | ||
89 | [bwh: Forward-ported from 3.0 to 3.2: apply the upstream changes | ||
90 | to get_any_partial()] | ||
91 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
92 | --- | ||
93 | include/linux/cpuset.h | 47 +++++++++++++++++++------------------------- | ||
94 | include/linux/init_task.h | 8 +++++++ | ||
95 | include/linux/sched.h | 2 +- | ||
96 | kernel/cpuset.c | 43 +++++++--------------------------------- | ||
97 | kernel/fork.c | 3 ++ | ||
98 | mm/filemap.c | 11 ++++++--- | ||
99 | mm/hugetlb.c | 15 ++++++++++--- | ||
100 | mm/mempolicy.c | 28 ++++++++++++++++++++------ | ||
101 | mm/page_alloc.c | 33 ++++++++++++++++++++++--------- | ||
102 | mm/slab.c | 13 +++++++---- | ||
103 | mm/slub.c | 40 +++++++++++++++++++++++-------------- | ||
104 | mm/vmscan.c | 2 - | ||
105 | 12 files changed, 135 insertions(+), 110 deletions(-) | ||
106 | |||
107 | diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h | ||
108 | index e9eaec5..7a7e5fd 100644 | ||
109 | --- a/include/linux/cpuset.h | ||
110 | +++ b/include/linux/cpuset.h | ||
111 | @@ -89,42 +89,33 @@ extern void rebuild_sched_domains(void); | ||
112 | extern void cpuset_print_task_mems_allowed(struct task_struct *p); | ||
113 | |||
114 | /* | ||
115 | - * reading current mems_allowed and mempolicy in the fastpath must protected | ||
116 | - * by get_mems_allowed() | ||
117 | + * get_mems_allowed is required when making decisions involving mems_allowed | ||
118 | + * such as during page allocation. mems_allowed can be updated in parallel | ||
119 | + * and depending on the new value an operation can fail potentially causing | ||
120 | + * process failure. A retry loop with get_mems_allowed and put_mems_allowed | ||
121 | + * prevents these artificial failures. | ||
122 | */ | ||
123 | -static inline void get_mems_allowed(void) | ||
124 | +static inline unsigned int get_mems_allowed(void) | ||
125 | { | ||
126 | - current->mems_allowed_change_disable++; | ||
127 | - | ||
128 | - /* | ||
129 | - * ensure that reading mems_allowed and mempolicy happens after the | ||
130 | - * update of ->mems_allowed_change_disable. | ||
131 | - * | ||
132 | - * the write-side task finds ->mems_allowed_change_disable is not 0, | ||
133 | - * and knows the read-side task is reading mems_allowed or mempolicy, | ||
134 | - * so it will clear old bits lazily. | ||
135 | - */ | ||
136 | - smp_mb(); | ||
137 | + return read_seqcount_begin(¤t->mems_allowed_seq); | ||
138 | } | ||
139 | |||
140 | -static inline void put_mems_allowed(void) | ||
141 | +/* | ||
142 | + * If this returns false, the operation that took place after get_mems_allowed | ||
143 | + * may have failed. It is up to the caller to retry the operation if | ||
144 | + * appropriate. | ||
145 | + */ | ||
146 | +static inline bool put_mems_allowed(unsigned int seq) | ||
147 | { | ||
148 | - /* | ||
149 | - * ensure that reading mems_allowed and mempolicy before reducing | ||
150 | - * mems_allowed_change_disable. | ||
151 | - * | ||
152 | - * the write-side task will know that the read-side task is still | ||
153 | - * reading mems_allowed or mempolicy, don't clears old bits in the | ||
154 | - * nodemask. | ||
155 | - */ | ||
156 | - smp_mb(); | ||
157 | - --ACCESS_ONCE(current->mems_allowed_change_disable); | ||
158 | + return !read_seqcount_retry(¤t->mems_allowed_seq, seq); | ||
159 | } | ||
160 | |||
161 | static inline void set_mems_allowed(nodemask_t nodemask) | ||
162 | { | ||
163 | task_lock(current); | ||
164 | + write_seqcount_begin(¤t->mems_allowed_seq); | ||
165 | current->mems_allowed = nodemask; | ||
166 | + write_seqcount_end(¤t->mems_allowed_seq); | ||
167 | task_unlock(current); | ||
168 | } | ||
169 | |||
170 | @@ -234,12 +225,14 @@ static inline void set_mems_allowed(nodemask_t nodemask) | ||
171 | { | ||
172 | } | ||
173 | |||
174 | -static inline void get_mems_allowed(void) | ||
175 | +static inline unsigned int get_mems_allowed(void) | ||
176 | { | ||
177 | + return 0; | ||
178 | } | ||
179 | |||
180 | -static inline void put_mems_allowed(void) | ||
181 | +static inline bool put_mems_allowed(unsigned int seq) | ||
182 | { | ||
183 | + return true; | ||
184 | } | ||
185 | |||
186 | #endif /* !CONFIG_CPUSETS */ | ||
187 | diff --git a/include/linux/init_task.h b/include/linux/init_task.h | ||
188 | index 32574ee..df53fdf 100644 | ||
189 | --- a/include/linux/init_task.h | ||
190 | +++ b/include/linux/init_task.h | ||
191 | @@ -30,6 +30,13 @@ extern struct fs_struct init_fs; | ||
192 | #define INIT_THREADGROUP_FORK_LOCK(sig) | ||
193 | #endif | ||
194 | |||
195 | +#ifdef CONFIG_CPUSETS | ||
196 | +#define INIT_CPUSET_SEQ \ | ||
197 | + .mems_allowed_seq = SEQCNT_ZERO, | ||
198 | +#else | ||
199 | +#define INIT_CPUSET_SEQ | ||
200 | +#endif | ||
201 | + | ||
202 | #define INIT_SIGNALS(sig) { \ | ||
203 | .nr_threads = 1, \ | ||
204 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ | ||
205 | @@ -193,6 +200,7 @@ extern struct cred init_cred; | ||
206 | INIT_FTRACE_GRAPH \ | ||
207 | INIT_TRACE_RECURSION \ | ||
208 | INIT_TASK_RCU_PREEMPT(tsk) \ | ||
209 | + INIT_CPUSET_SEQ \ | ||
210 | } | ||
211 | |||
212 | |||
213 | diff --git a/include/linux/sched.h b/include/linux/sched.h | ||
214 | index 5afa2a3..a96cb8c 100644 | ||
215 | --- a/include/linux/sched.h | ||
216 | +++ b/include/linux/sched.h | ||
217 | @@ -1481,7 +1481,7 @@ struct task_struct { | ||
218 | #endif | ||
219 | #ifdef CONFIG_CPUSETS | ||
220 | nodemask_t mems_allowed; /* Protected by alloc_lock */ | ||
221 | - int mems_allowed_change_disable; | ||
222 | + seqcount_t mems_allowed_seq; /* Seqence no to catch updates */ | ||
223 | int cpuset_mem_spread_rotor; | ||
224 | int cpuset_slab_spread_rotor; | ||
225 | #endif | ||
226 | diff --git a/kernel/cpuset.c b/kernel/cpuset.c | ||
227 | index 0b1712d..46a1d3c 100644 | ||
228 | --- a/kernel/cpuset.c | ||
229 | +++ b/kernel/cpuset.c | ||
230 | @@ -964,7 +964,6 @@ static void cpuset_change_task_nodemask(struct task_struct *tsk, | ||
231 | { | ||
232 | bool need_loop; | ||
233 | |||
234 | -repeat: | ||
235 | /* | ||
236 | * Allow tasks that have access to memory reserves because they have | ||
237 | * been OOM killed to get memory anywhere. | ||
238 | @@ -983,45 +982,19 @@ repeat: | ||
239 | */ | ||
240 | need_loop = task_has_mempolicy(tsk) || | ||
241 | !nodes_intersects(*newmems, tsk->mems_allowed); | ||
242 | - nodes_or(tsk->mems_allowed, tsk->mems_allowed, *newmems); | ||
243 | - mpol_rebind_task(tsk, newmems, MPOL_REBIND_STEP1); | ||
244 | |||
245 | - /* | ||
246 | - * ensure checking ->mems_allowed_change_disable after setting all new | ||
247 | - * allowed nodes. | ||
248 | - * | ||
249 | - * the read-side task can see an nodemask with new allowed nodes and | ||
250 | - * old allowed nodes. and if it allocates page when cpuset clears newly | ||
251 | - * disallowed ones continuous, it can see the new allowed bits. | ||
252 | - * | ||
253 | - * And if setting all new allowed nodes is after the checking, setting | ||
254 | - * all new allowed nodes and clearing newly disallowed ones will be done | ||
255 | - * continuous, and the read-side task may find no node to alloc page. | ||
256 | - */ | ||
257 | - smp_mb(); | ||
258 | + if (need_loop) | ||
259 | + write_seqcount_begin(&tsk->mems_allowed_seq); | ||
260 | |||
261 | - /* | ||
262 | - * Allocation of memory is very fast, we needn't sleep when waiting | ||
263 | - * for the read-side. | ||
264 | - */ | ||
265 | - while (need_loop && ACCESS_ONCE(tsk->mems_allowed_change_disable)) { | ||
266 | - task_unlock(tsk); | ||
267 | - if (!task_curr(tsk)) | ||
268 | - yield(); | ||
269 | - goto repeat; | ||
270 | - } | ||
271 | - | ||
272 | - /* | ||
273 | - * ensure checking ->mems_allowed_change_disable before clearing all new | ||
274 | - * disallowed nodes. | ||
275 | - * | ||
276 | - * if clearing newly disallowed bits before the checking, the read-side | ||
277 | - * task may find no node to alloc page. | ||
278 | - */ | ||
279 | - smp_mb(); | ||
280 | + nodes_or(tsk->mems_allowed, tsk->mems_allowed, *newmems); | ||
281 | + mpol_rebind_task(tsk, newmems, MPOL_REBIND_STEP1); | ||
282 | |||
283 | mpol_rebind_task(tsk, newmems, MPOL_REBIND_STEP2); | ||
284 | tsk->mems_allowed = *newmems; | ||
285 | + | ||
286 | + if (need_loop) | ||
287 | + write_seqcount_end(&tsk->mems_allowed_seq); | ||
288 | + | ||
289 | task_unlock(tsk); | ||
290 | } | ||
291 | |||
292 | diff --git a/kernel/fork.c b/kernel/fork.c | ||
293 | index 79ee71f..222457a 100644 | ||
294 | --- a/kernel/fork.c | ||
295 | +++ b/kernel/fork.c | ||
296 | @@ -979,6 +979,9 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) | ||
297 | #ifdef CONFIG_CGROUPS | ||
298 | init_rwsem(&sig->threadgroup_fork_lock); | ||
299 | #endif | ||
300 | +#ifdef CONFIG_CPUSETS | ||
301 | + seqcount_init(&tsk->mems_allowed_seq); | ||
302 | +#endif | ||
303 | |||
304 | sig->oom_adj = current->signal->oom_adj; | ||
305 | sig->oom_score_adj = current->signal->oom_score_adj; | ||
306 | diff --git a/mm/filemap.c b/mm/filemap.c | ||
307 | index 03c5b0e..556858c 100644 | ||
308 | --- a/mm/filemap.c | ||
309 | +++ b/mm/filemap.c | ||
310 | @@ -500,10 +500,13 @@ struct page *__page_cache_alloc(gfp_t gfp) | ||
311 | struct page *page; | ||
312 | |||
313 | if (cpuset_do_page_mem_spread()) { | ||
314 | - get_mems_allowed(); | ||
315 | - n = cpuset_mem_spread_node(); | ||
316 | - page = alloc_pages_exact_node(n, gfp, 0); | ||
317 | - put_mems_allowed(); | ||
318 | + unsigned int cpuset_mems_cookie; | ||
319 | + do { | ||
320 | + cpuset_mems_cookie = get_mems_allowed(); | ||
321 | + n = cpuset_mem_spread_node(); | ||
322 | + page = alloc_pages_exact_node(n, gfp, 0); | ||
323 | + } while (!put_mems_allowed(cpuset_mems_cookie) && !page); | ||
324 | + | ||
325 | return page; | ||
326 | } | ||
327 | return alloc_pages(gfp, 0); | ||
328 | diff --git a/mm/hugetlb.c b/mm/hugetlb.c | ||
329 | index 7c535b0..1e747e4 100644 | ||
330 | --- a/mm/hugetlb.c | ||
331 | +++ b/mm/hugetlb.c | ||
332 | @@ -532,14 +532,16 @@ static struct page *dequeue_huge_page_vma(struct hstate *h, | ||
333 | struct vm_area_struct *vma, | ||
334 | unsigned long address, int avoid_reserve) | ||
335 | { | ||
336 | - struct page *page = NULL; | ||
337 | + struct page *page; | ||
338 | struct mempolicy *mpol; | ||
339 | nodemask_t *nodemask; | ||
340 | struct zonelist *zonelist; | ||
341 | struct zone *zone; | ||
342 | struct zoneref *z; | ||
343 | + unsigned int cpuset_mems_cookie; | ||
344 | |||
345 | - get_mems_allowed(); | ||
346 | +retry_cpuset: | ||
347 | + cpuset_mems_cookie = get_mems_allowed(); | ||
348 | zonelist = huge_zonelist(vma, address, | ||
349 | htlb_alloc_mask, &mpol, &nodemask); | ||
350 | /* | ||
351 | @@ -566,10 +568,15 @@ static struct page *dequeue_huge_page_vma(struct hstate *h, | ||
352 | } | ||
353 | } | ||
354 | } | ||
355 | -err: | ||
356 | + | ||
357 | mpol_cond_put(mpol); | ||
358 | - put_mems_allowed(); | ||
359 | + if (unlikely(!put_mems_allowed(cpuset_mems_cookie) && !page)) | ||
360 | + goto retry_cpuset; | ||
361 | return page; | ||
362 | + | ||
363 | +err: | ||
364 | + mpol_cond_put(mpol); | ||
365 | + return NULL; | ||
366 | } | ||
367 | |||
368 | static void update_and_free_page(struct hstate *h, struct page *page) | ||
369 | diff --git a/mm/mempolicy.c b/mm/mempolicy.c | ||
370 | index f2650bc..c0007f9 100644 | ||
371 | --- a/mm/mempolicy.c | ||
372 | +++ b/mm/mempolicy.c | ||
373 | @@ -1843,18 +1843,24 @@ struct page * | ||
374 | alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, | ||
375 | unsigned long addr, int node) | ||
376 | { | ||
377 | - struct mempolicy *pol = get_vma_policy(current, vma, addr); | ||
378 | + struct mempolicy *pol; | ||
379 | struct zonelist *zl; | ||
380 | struct page *page; | ||
381 | + unsigned int cpuset_mems_cookie; | ||
382 | + | ||
383 | +retry_cpuset: | ||
384 | + pol = get_vma_policy(current, vma, addr); | ||
385 | + cpuset_mems_cookie = get_mems_allowed(); | ||
386 | |||
387 | - get_mems_allowed(); | ||
388 | if (unlikely(pol->mode == MPOL_INTERLEAVE)) { | ||
389 | unsigned nid; | ||
390 | |||
391 | nid = interleave_nid(pol, vma, addr, PAGE_SHIFT + order); | ||
392 | mpol_cond_put(pol); | ||
393 | page = alloc_page_interleave(gfp, order, nid); | ||
394 | - put_mems_allowed(); | ||
395 | + if (unlikely(!put_mems_allowed(cpuset_mems_cookie) && !page)) | ||
396 | + goto retry_cpuset; | ||
397 | + | ||
398 | return page; | ||
399 | } | ||
400 | zl = policy_zonelist(gfp, pol, node); | ||
401 | @@ -1865,7 +1871,8 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, | ||
402 | struct page *page = __alloc_pages_nodemask(gfp, order, | ||
403 | zl, policy_nodemask(gfp, pol)); | ||
404 | __mpol_put(pol); | ||
405 | - put_mems_allowed(); | ||
406 | + if (unlikely(!put_mems_allowed(cpuset_mems_cookie) && !page)) | ||
407 | + goto retry_cpuset; | ||
408 | return page; | ||
409 | } | ||
410 | /* | ||
411 | @@ -1873,7 +1880,8 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, | ||
412 | */ | ||
413 | page = __alloc_pages_nodemask(gfp, order, zl, | ||
414 | policy_nodemask(gfp, pol)); | ||
415 | - put_mems_allowed(); | ||
416 | + if (unlikely(!put_mems_allowed(cpuset_mems_cookie) && !page)) | ||
417 | + goto retry_cpuset; | ||
418 | return page; | ||
419 | } | ||
420 | |||
421 | @@ -1900,11 +1908,14 @@ struct page *alloc_pages_current(gfp_t gfp, unsigned order) | ||
422 | { | ||
423 | struct mempolicy *pol = current->mempolicy; | ||
424 | struct page *page; | ||
425 | + unsigned int cpuset_mems_cookie; | ||
426 | |||
427 | if (!pol || in_interrupt() || (gfp & __GFP_THISNODE)) | ||
428 | pol = &default_policy; | ||
429 | |||
430 | - get_mems_allowed(); | ||
431 | +retry_cpuset: | ||
432 | + cpuset_mems_cookie = get_mems_allowed(); | ||
433 | + | ||
434 | /* | ||
435 | * No reference counting needed for current->mempolicy | ||
436 | * nor system default_policy | ||
437 | @@ -1915,7 +1926,10 @@ struct page *alloc_pages_current(gfp_t gfp, unsigned order) | ||
438 | page = __alloc_pages_nodemask(gfp, order, | ||
439 | policy_zonelist(gfp, pol, numa_node_id()), | ||
440 | policy_nodemask(gfp, pol)); | ||
441 | - put_mems_allowed(); | ||
442 | + | ||
443 | + if (unlikely(!put_mems_allowed(cpuset_mems_cookie) && !page)) | ||
444 | + goto retry_cpuset; | ||
445 | + | ||
446 | return page; | ||
447 | } | ||
448 | EXPORT_SYMBOL(alloc_pages_current); | ||
449 | diff --git a/mm/page_alloc.c b/mm/page_alloc.c | ||
450 | index ef6e1a1..065dbe8 100644 | ||
451 | --- a/mm/page_alloc.c | ||
452 | +++ b/mm/page_alloc.c | ||
453 | @@ -2282,8 +2282,9 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, | ||
454 | { | ||
455 | enum zone_type high_zoneidx = gfp_zone(gfp_mask); | ||
456 | struct zone *preferred_zone; | ||
457 | - struct page *page; | ||
458 | + struct page *page = NULL; | ||
459 | int migratetype = allocflags_to_migratetype(gfp_mask); | ||
460 | + unsigned int cpuset_mems_cookie; | ||
461 | |||
462 | gfp_mask &= gfp_allowed_mask; | ||
463 | |||
464 | @@ -2302,15 +2303,15 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, | ||
465 | if (unlikely(!zonelist->_zonerefs->zone)) | ||
466 | return NULL; | ||
467 | |||
468 | - get_mems_allowed(); | ||
469 | +retry_cpuset: | ||
470 | + cpuset_mems_cookie = get_mems_allowed(); | ||
471 | + | ||
472 | /* The preferred zone is used for statistics later */ | ||
473 | first_zones_zonelist(zonelist, high_zoneidx, | ||
474 | nodemask ? : &cpuset_current_mems_allowed, | ||
475 | &preferred_zone); | ||
476 | - if (!preferred_zone) { | ||
477 | - put_mems_allowed(); | ||
478 | - return NULL; | ||
479 | - } | ||
480 | + if (!preferred_zone) | ||
481 | + goto out; | ||
482 | |||
483 | /* First allocation attempt */ | ||
484 | page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, nodemask, order, | ||
485 | @@ -2320,9 +2321,19 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, | ||
486 | page = __alloc_pages_slowpath(gfp_mask, order, | ||
487 | zonelist, high_zoneidx, nodemask, | ||
488 | preferred_zone, migratetype); | ||
489 | - put_mems_allowed(); | ||
490 | |||
491 | trace_mm_page_alloc(page, order, gfp_mask, migratetype); | ||
492 | + | ||
493 | +out: | ||
494 | + /* | ||
495 | + * When updating a task's mems_allowed, it is possible to race with | ||
496 | + * parallel threads in such a way that an allocation can fail while | ||
497 | + * the mask is being updated. If a page allocation is about to fail, | ||
498 | + * check if the cpuset changed during allocation and if so, retry. | ||
499 | + */ | ||
500 | + if (unlikely(!put_mems_allowed(cpuset_mems_cookie) && !page)) | ||
501 | + goto retry_cpuset; | ||
502 | + | ||
503 | return page; | ||
504 | } | ||
505 | EXPORT_SYMBOL(__alloc_pages_nodemask); | ||
506 | @@ -2546,13 +2557,15 @@ void si_meminfo_node(struct sysinfo *val, int nid) | ||
507 | bool skip_free_areas_node(unsigned int flags, int nid) | ||
508 | { | ||
509 | bool ret = false; | ||
510 | + unsigned int cpuset_mems_cookie; | ||
511 | |||
512 | if (!(flags & SHOW_MEM_FILTER_NODES)) | ||
513 | goto out; | ||
514 | |||
515 | - get_mems_allowed(); | ||
516 | - ret = !node_isset(nid, cpuset_current_mems_allowed); | ||
517 | - put_mems_allowed(); | ||
518 | + do { | ||
519 | + cpuset_mems_cookie = get_mems_allowed(); | ||
520 | + ret = !node_isset(nid, cpuset_current_mems_allowed); | ||
521 | + } while (!put_mems_allowed(cpuset_mems_cookie)); | ||
522 | out: | ||
523 | return ret; | ||
524 | } | ||
525 | diff --git a/mm/slab.c b/mm/slab.c | ||
526 | index 83311c9a..cd3ab93 100644 | ||
527 | --- a/mm/slab.c | ||
528 | +++ b/mm/slab.c | ||
529 | @@ -3267,12 +3267,10 @@ static void *alternate_node_alloc(struct kmem_cache *cachep, gfp_t flags) | ||
530 | if (in_interrupt() || (flags & __GFP_THISNODE)) | ||
531 | return NULL; | ||
532 | nid_alloc = nid_here = numa_mem_id(); | ||
533 | - get_mems_allowed(); | ||
534 | if (cpuset_do_slab_mem_spread() && (cachep->flags & SLAB_MEM_SPREAD)) | ||
535 | nid_alloc = cpuset_slab_spread_node(); | ||
536 | else if (current->mempolicy) | ||
537 | nid_alloc = slab_node(current->mempolicy); | ||
538 | - put_mems_allowed(); | ||
539 | if (nid_alloc != nid_here) | ||
540 | return ____cache_alloc_node(cachep, flags, nid_alloc); | ||
541 | return NULL; | ||
542 | @@ -3295,14 +3293,17 @@ static void *fallback_alloc(struct kmem_cache *cache, gfp_t flags) | ||
543 | enum zone_type high_zoneidx = gfp_zone(flags); | ||
544 | void *obj = NULL; | ||
545 | int nid; | ||
546 | + unsigned int cpuset_mems_cookie; | ||
547 | |||
548 | if (flags & __GFP_THISNODE) | ||
549 | return NULL; | ||
550 | |||
551 | - get_mems_allowed(); | ||
552 | - zonelist = node_zonelist(slab_node(current->mempolicy), flags); | ||
553 | local_flags = flags & (GFP_CONSTRAINT_MASK|GFP_RECLAIM_MASK); | ||
554 | |||
555 | +retry_cpuset: | ||
556 | + cpuset_mems_cookie = get_mems_allowed(); | ||
557 | + zonelist = node_zonelist(slab_node(current->mempolicy), flags); | ||
558 | + | ||
559 | retry: | ||
560 | /* | ||
561 | * Look through allowed nodes for objects available | ||
562 | @@ -3355,7 +3356,9 @@ retry: | ||
563 | } | ||
564 | } | ||
565 | } | ||
566 | - put_mems_allowed(); | ||
567 | + | ||
568 | + if (unlikely(!put_mems_allowed(cpuset_mems_cookie) && !obj)) | ||
569 | + goto retry_cpuset; | ||
570 | return obj; | ||
571 | } | ||
572 | |||
573 | diff --git a/mm/slub.c b/mm/slub.c | ||
574 | index af47188..5710788 100644 | ||
575 | --- a/mm/slub.c | ||
576 | +++ b/mm/slub.c | ||
577 | @@ -1582,6 +1582,7 @@ static struct page *get_any_partial(struct kmem_cache *s, gfp_t flags, | ||
578 | struct zone *zone; | ||
579 | enum zone_type high_zoneidx = gfp_zone(flags); | ||
580 | void *object; | ||
581 | + unsigned int cpuset_mems_cookie; | ||
582 | |||
583 | /* | ||
584 | * The defrag ratio allows a configuration of the tradeoffs between | ||
585 | @@ -1605,23 +1606,32 @@ static struct page *get_any_partial(struct kmem_cache *s, gfp_t flags, | ||
586 | get_cycles() % 1024 > s->remote_node_defrag_ratio) | ||
587 | return NULL; | ||
588 | |||
589 | - get_mems_allowed(); | ||
590 | - zonelist = node_zonelist(slab_node(current->mempolicy), flags); | ||
591 | - for_each_zone_zonelist(zone, z, zonelist, high_zoneidx) { | ||
592 | - struct kmem_cache_node *n; | ||
593 | - | ||
594 | - n = get_node(s, zone_to_nid(zone)); | ||
595 | - | ||
596 | - if (n && cpuset_zone_allowed_hardwall(zone, flags) && | ||
597 | - n->nr_partial > s->min_partial) { | ||
598 | - object = get_partial_node(s, n, c); | ||
599 | - if (object) { | ||
600 | - put_mems_allowed(); | ||
601 | - return object; | ||
602 | + do { | ||
603 | + cpuset_mems_cookie = get_mems_allowed(); | ||
604 | + zonelist = node_zonelist(slab_node(current->mempolicy), flags); | ||
605 | + for_each_zone_zonelist(zone, z, zonelist, high_zoneidx) { | ||
606 | + struct kmem_cache_node *n; | ||
607 | + | ||
608 | + n = get_node(s, zone_to_nid(zone)); | ||
609 | + | ||
610 | + if (n && cpuset_zone_allowed_hardwall(zone, flags) && | ||
611 | + n->nr_partial > s->min_partial) { | ||
612 | + object = get_partial_node(s, n, c); | ||
613 | + if (object) { | ||
614 | + /* | ||
615 | + * Return the object even if | ||
616 | + * put_mems_allowed indicated that | ||
617 | + * the cpuset mems_allowed was | ||
618 | + * updated in parallel. It's a | ||
619 | + * harmless race between the alloc | ||
620 | + * and the cpuset update. | ||
621 | + */ | ||
622 | + put_mems_allowed(cpuset_mems_cookie); | ||
623 | + return object; | ||
624 | + } | ||
625 | } | ||
626 | } | ||
627 | - } | ||
628 | - put_mems_allowed(); | ||
629 | + } while (!put_mems_allowed(cpuset_mems_cookie)); | ||
630 | #endif | ||
631 | return NULL; | ||
632 | } | ||
633 | diff --git a/mm/vmscan.c b/mm/vmscan.c | ||
634 | index ded1857..48febd7 100644 | ||
635 | --- a/mm/vmscan.c | ||
636 | +++ b/mm/vmscan.c | ||
637 | @@ -2295,7 +2295,6 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | ||
638 | unsigned long writeback_threshold; | ||
639 | bool aborted_reclaim; | ||
640 | |||
641 | - get_mems_allowed(); | ||
642 | delayacct_freepages_start(); | ||
643 | |||
644 | if (scanning_global_lru(sc)) | ||
645 | @@ -2359,7 +2358,6 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | ||
646 | |||
647 | out: | ||
648 | delayacct_freepages_end(); | ||
649 | - put_mems_allowed(); | ||
650 | |||
651 | if (sc->nr_reclaimed) | ||
652 | return sc->nr_reclaimed; | ||
653 | -- | ||
654 | 1.7.7.6 | ||
655 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0016-mm-hugetlb-fix-warning-in-alloc_huge_page-dequeue_hu.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0016-mm-hugetlb-fix-warning-in-alloc_huge_page-dequeue_hu.patch new file mode 100644 index 00000000..9c4a09a4 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0016-mm-hugetlb-fix-warning-in-alloc_huge_page-dequeue_hu.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From f9871f8705a930f3c3c4588a8c990cf76db2b95e Mon Sep 17 00:00:00 2001 | ||
2 | From: Konstantin Khlebnikov <khlebnikov@openvz.org> | ||
3 | Date: Wed, 25 Apr 2012 16:01:46 -0700 | ||
4 | Subject: [PATCH 16/73] mm/hugetlb: fix warning in | ||
5 | alloc_huge_page/dequeue_huge_page_vma | ||
6 | |||
7 | commit b1c12cbcd0a02527c180a862e8971e249d3b347d upstream. | ||
8 | |||
9 | Stable note: Not tracked in Bugzilla. [get|put]_mems_allowed() is extremely | ||
10 | expensive and severely impacted page allocator performance. This | ||
11 | is part of a series of patches that reduce page allocator overhead. | ||
12 | |||
13 | Fix a gcc warning (and bug?) introduced in cc9a6c877 ("cpuset: mm: reduce | ||
14 | large amounts of memory barrier related damage v3") | ||
15 | |||
16 | Local variable "page" can be uninitialized if the nodemask from vma policy | ||
17 | does not intersects with nodemask from cpuset. Even if it doesn't happens | ||
18 | it is better to initialize this variable explicitly than to introduce | ||
19 | a kernel oops in a weird corner case. | ||
20 | |||
21 | mm/hugetlb.c: In function `alloc_huge_page': | ||
22 | mm/hugetlb.c:1135:5: warning: `page' may be used uninitialized in this function | ||
23 | |||
24 | Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org> | ||
25 | Acked-by: Mel Gorman <mgorman@suse.de> | ||
26 | Acked-by: David Rientjes <rientjes@google.com> | ||
27 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
28 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
29 | Signed-off-by: Mel Gorman <mgorman@suse.de> | ||
30 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
31 | --- | ||
32 | mm/hugetlb.c | 2 +- | ||
33 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
34 | |||
35 | diff --git a/mm/hugetlb.c b/mm/hugetlb.c | ||
36 | index 1e747e4..b1e1bad 100644 | ||
37 | --- a/mm/hugetlb.c | ||
38 | +++ b/mm/hugetlb.c | ||
39 | @@ -532,7 +532,7 @@ static struct page *dequeue_huge_page_vma(struct hstate *h, | ||
40 | struct vm_area_struct *vma, | ||
41 | unsigned long address, int avoid_reserve) | ||
42 | { | ||
43 | - struct page *page; | ||
44 | + struct page *page = NULL; | ||
45 | struct mempolicy *mpol; | ||
46 | nodemask_t *nodemask; | ||
47 | struct zonelist *zonelist; | ||
48 | -- | ||
49 | 1.7.7.6 | ||
50 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0017-Fix-NULL-dereferences-in-scsi_cmd_to_driver.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0017-Fix-NULL-dereferences-in-scsi_cmd_to_driver.patch new file mode 100644 index 00000000..b56b57e5 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0017-Fix-NULL-dereferences-in-scsi_cmd_to_driver.patch | |||
@@ -0,0 +1,71 @@ | |||
1 | From 67fed15f639763628507a2e704441acabcce4bdd Mon Sep 17 00:00:00 2001 | ||
2 | From: Mark Rustad <mark.d.rustad@intel.com> | ||
3 | Date: Thu, 21 Jun 2012 12:23:42 -0700 | ||
4 | Subject: [PATCH 17/73] Fix NULL dereferences in scsi_cmd_to_driver | ||
5 | |||
6 | commit 222a806af830fda34ad1f6bc991cd226916de060 upstream. | ||
7 | |||
8 | Avoid crashing if the private_data pointer happens to be NULL. This has | ||
9 | been seen sometimes when a host reset happens, notably when there are | ||
10 | many LUNs: | ||
11 | |||
12 | host3: Assigned Port ID 0c1601 | ||
13 | scsi host3: libfc: Host reset succeeded on port (0c1601) | ||
14 | BUG: unable to handle kernel NULL pointer dereference at 0000000000000350 | ||
15 | IP: [<ffffffff81352bb8>] scsi_send_eh_cmnd+0x58/0x3a0 | ||
16 | <snip> | ||
17 | Process scsi_eh_3 (pid: 4144, threadinfo ffff88030920c000, task ffff880326b160c0) | ||
18 | Stack: | ||
19 | 000000010372e6ba 0000000000000282 000027100920dca0 ffffffffa0038ee0 | ||
20 | 0000000000000000 0000000000030003 ffff88030920dc80 ffff88030920dc80 | ||
21 | 00000002000e0000 0000000a00004000 ffff8803242f7760 ffff88031326ed80 | ||
22 | Call Trace: | ||
23 | [<ffffffff8105b590>] ? lock_timer_base+0x70/0x70 | ||
24 | [<ffffffff81352fbe>] scsi_eh_tur+0x3e/0xc0 | ||
25 | [<ffffffff81353a36>] scsi_eh_test_devices+0x76/0x170 | ||
26 | [<ffffffff81354125>] scsi_eh_host_reset+0x85/0x160 | ||
27 | [<ffffffff81354291>] scsi_eh_ready_devs+0x91/0x110 | ||
28 | [<ffffffff813543fd>] scsi_unjam_host+0xed/0x1f0 | ||
29 | [<ffffffff813546a8>] scsi_error_handler+0x1a8/0x200 | ||
30 | [<ffffffff81354500>] ? scsi_unjam_host+0x1f0/0x1f0 | ||
31 | [<ffffffff8106ec3e>] kthread+0x9e/0xb0 | ||
32 | [<ffffffff81509264>] kernel_thread_helper+0x4/0x10 | ||
33 | [<ffffffff8106eba0>] ? kthread_freezable_should_stop+0x70/0x70 | ||
34 | [<ffffffff81509260>] ? gs_change+0x13/0x13 | ||
35 | Code: 25 28 00 00 00 48 89 45 c8 31 c0 48 8b 87 80 00 00 00 48 8d b5 60 ff ff ff 89 d1 48 89 fb 41 89 d6 4c 89 fa 48 8b 80 b8 00 00 00 | ||
36 | <48> 8b 80 50 03 00 00 48 8b 00 48 89 85 38 ff ff ff 48 8b 07 4c | ||
37 | RIP [<ffffffff81352bb8>] scsi_send_eh_cmnd+0x58/0x3a0 | ||
38 | RSP <ffff88030920dc50> | ||
39 | CR2: 0000000000000350 | ||
40 | |||
41 | Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> | ||
42 | Tested-by: Marcus Dennis <marcusx.e.dennis@intel.com> | ||
43 | Signed-off-by: James Bottomley <JBottomley@Parallels.com> | ||
44 | [bwh: Backported to 3.2: adjust filename, context] | ||
45 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
46 | --- | ||
47 | drivers/scsi/scsi.c | 8 +++++++- | ||
48 | 1 files changed, 7 insertions(+), 1 deletions(-) | ||
49 | |||
50 | diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c | ||
51 | index 2aeb2e9..831db24 100644 | ||
52 | --- a/drivers/scsi/scsi.c | ||
53 | +++ b/drivers/scsi/scsi.c | ||
54 | @@ -785,7 +785,13 @@ static void scsi_done(struct scsi_cmnd *cmd) | ||
55 | /* Move this to a header if it becomes more generally useful */ | ||
56 | static struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd) | ||
57 | { | ||
58 | - return *(struct scsi_driver **)cmd->request->rq_disk->private_data; | ||
59 | + struct scsi_driver **sdp; | ||
60 | + | ||
61 | + sdp = (struct scsi_driver **)cmd->request->rq_disk->private_data; | ||
62 | + if (!sdp) | ||
63 | + return NULL; | ||
64 | + | ||
65 | + return *sdp; | ||
66 | } | ||
67 | |||
68 | /** | ||
69 | -- | ||
70 | 1.7.7.6 | ||
71 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0018-sched-nohz-Fix-rq-cpu_load-calculations.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0018-sched-nohz-Fix-rq-cpu_load-calculations.patch new file mode 100644 index 00000000..6548d426 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0018-sched-nohz-Fix-rq-cpu_load-calculations.patch | |||
@@ -0,0 +1,137 @@ | |||
1 | From af56d9e56ec0729f6aa8c3a51b9bddbdcd8dfcf0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Peter Zijlstra <a.p.zijlstra@chello.nl> | ||
3 | Date: Fri, 11 May 2012 17:31:26 +0200 | ||
4 | Subject: [PATCH 18/73] sched/nohz: Fix rq->cpu_load[] calculations | ||
5 | |||
6 | commit 556061b00c9f2fd6a5524b6bde823ef12f299ecf upstream. | ||
7 | |||
8 | While investigating why the load-balancer did funny I found that the | ||
9 | rq->cpu_load[] tables were completely screwy.. a bit more digging | ||
10 | revealed that the updates that got through were missing ticks followed | ||
11 | by a catchup of 2 ticks. | ||
12 | |||
13 | The catchup assumes the cpu was idle during that time (since only nohz | ||
14 | can cause missed ticks and the machine is idle etc..) this means that | ||
15 | esp. the higher indices were significantly lower than they ought to | ||
16 | be. | ||
17 | |||
18 | The reason for this is that its not correct to compare against jiffies | ||
19 | on every jiffy on any other cpu than the cpu that updates jiffies. | ||
20 | |||
21 | This patch cludges around it by only doing the catch-up stuff from | ||
22 | nohz_idle_balance() and doing the regular stuff unconditionally from | ||
23 | the tick. | ||
24 | |||
25 | Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> | ||
26 | Cc: pjt@google.com | ||
27 | Cc: Venkatesh Pallipadi <venki@google.com> | ||
28 | Link: http://lkml.kernel.org/n/tip-tp4kj18xdd5aj4vvj0qg55s2@git.kernel.org | ||
29 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | ||
30 | [bwh: Backported to 3.2: adjust filenames and context; keep functions static] | ||
31 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
32 | --- | ||
33 | kernel/sched.c | 53 ++++++++++++++++++++++++++++++++++++++------------ | ||
34 | kernel/sched_fair.c | 2 +- | ||
35 | 2 files changed, 41 insertions(+), 14 deletions(-) | ||
36 | |||
37 | diff --git a/kernel/sched.c b/kernel/sched.c | ||
38 | index 52ac69b..a409d81 100644 | ||
39 | --- a/kernel/sched.c | ||
40 | +++ b/kernel/sched.c | ||
41 | @@ -1887,7 +1887,7 @@ static void double_rq_unlock(struct rq *rq1, struct rq *rq2) | ||
42 | |||
43 | static void update_sysctl(void); | ||
44 | static int get_update_sysctl_factor(void); | ||
45 | -static void update_cpu_load(struct rq *this_rq); | ||
46 | +static void update_idle_cpu_load(struct rq *this_rq); | ||
47 | |||
48 | static inline void __set_task_cpu(struct task_struct *p, unsigned int cpu) | ||
49 | { | ||
50 | @@ -3855,22 +3855,13 @@ decay_load_missed(unsigned long load, unsigned long missed_updates, int idx) | ||
51 | * scheduler tick (TICK_NSEC). With tickless idle this will not be called | ||
52 | * every tick. We fix it up based on jiffies. | ||
53 | */ | ||
54 | -static void update_cpu_load(struct rq *this_rq) | ||
55 | +static void __update_cpu_load(struct rq *this_rq, unsigned long this_load, | ||
56 | + unsigned long pending_updates) | ||
57 | { | ||
58 | - unsigned long this_load = this_rq->load.weight; | ||
59 | - unsigned long curr_jiffies = jiffies; | ||
60 | - unsigned long pending_updates; | ||
61 | int i, scale; | ||
62 | |||
63 | this_rq->nr_load_updates++; | ||
64 | |||
65 | - /* Avoid repeated calls on same jiffy, when moving in and out of idle */ | ||
66 | - if (curr_jiffies == this_rq->last_load_update_tick) | ||
67 | - return; | ||
68 | - | ||
69 | - pending_updates = curr_jiffies - this_rq->last_load_update_tick; | ||
70 | - this_rq->last_load_update_tick = curr_jiffies; | ||
71 | - | ||
72 | /* Update our load: */ | ||
73 | this_rq->cpu_load[0] = this_load; /* Fasttrack for idx 0 */ | ||
74 | for (i = 1, scale = 2; i < CPU_LOAD_IDX_MAX; i++, scale += scale) { | ||
75 | @@ -3895,9 +3886,45 @@ static void update_cpu_load(struct rq *this_rq) | ||
76 | sched_avg_update(this_rq); | ||
77 | } | ||
78 | |||
79 | +/* | ||
80 | + * Called from nohz_idle_balance() to update the load ratings before doing the | ||
81 | + * idle balance. | ||
82 | + */ | ||
83 | +static void update_idle_cpu_load(struct rq *this_rq) | ||
84 | +{ | ||
85 | + unsigned long curr_jiffies = jiffies; | ||
86 | + unsigned long load = this_rq->load.weight; | ||
87 | + unsigned long pending_updates; | ||
88 | + | ||
89 | + /* | ||
90 | + * Bloody broken means of dealing with nohz, but better than nothing.. | ||
91 | + * jiffies is updated by one cpu, another cpu can drift wrt the jiffy | ||
92 | + * update and see 0 difference the one time and 2 the next, even though | ||
93 | + * we ticked at roughtly the same rate. | ||
94 | + * | ||
95 | + * Hence we only use this from nohz_idle_balance() and skip this | ||
96 | + * nonsense when called from the scheduler_tick() since that's | ||
97 | + * guaranteed a stable rate. | ||
98 | + */ | ||
99 | + if (load || curr_jiffies == this_rq->last_load_update_tick) | ||
100 | + return; | ||
101 | + | ||
102 | + pending_updates = curr_jiffies - this_rq->last_load_update_tick; | ||
103 | + this_rq->last_load_update_tick = curr_jiffies; | ||
104 | + | ||
105 | + __update_cpu_load(this_rq, load, pending_updates); | ||
106 | +} | ||
107 | + | ||
108 | +/* | ||
109 | + * Called from scheduler_tick() | ||
110 | + */ | ||
111 | static void update_cpu_load_active(struct rq *this_rq) | ||
112 | { | ||
113 | - update_cpu_load(this_rq); | ||
114 | + /* | ||
115 | + * See the mess in update_idle_cpu_load(). | ||
116 | + */ | ||
117 | + this_rq->last_load_update_tick = jiffies; | ||
118 | + __update_cpu_load(this_rq, this_rq->load.weight, 1); | ||
119 | |||
120 | calc_load_account_active(this_rq); | ||
121 | } | ||
122 | diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c | ||
123 | index 8a39fa3..66e4576 100644 | ||
124 | --- a/kernel/sched_fair.c | ||
125 | +++ b/kernel/sched_fair.c | ||
126 | @@ -4735,7 +4735,7 @@ static void nohz_idle_balance(int this_cpu, enum cpu_idle_type idle) | ||
127 | |||
128 | raw_spin_lock_irq(&this_rq->lock); | ||
129 | update_rq_clock(this_rq); | ||
130 | - update_cpu_load(this_rq); | ||
131 | + update_idle_cpu_load(this_rq); | ||
132 | raw_spin_unlock_irq(&this_rq->lock); | ||
133 | |||
134 | rebalance_domains(balance_cpu, CPU_IDLE); | ||
135 | -- | ||
136 | 1.7.7.6 | ||
137 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0019-sched-nohz-Fix-rq-cpu_load-calculations-some-more.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0019-sched-nohz-Fix-rq-cpu_load-calculations-some-more.patch new file mode 100644 index 00000000..130bbe6f --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0019-sched-nohz-Fix-rq-cpu_load-calculations-some-more.patch | |||
@@ -0,0 +1,147 @@ | |||
1 | From 5886fe4d82654fa7b041fcc2dd81794d28e2f0a7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Peter Zijlstra <a.p.zijlstra@chello.nl> | ||
3 | Date: Thu, 17 May 2012 17:15:29 +0200 | ||
4 | Subject: [PATCH 19/73] sched/nohz: Fix rq->cpu_load calculations some more | ||
5 | |||
6 | commit 5aaa0b7a2ed5b12692c9ffb5222182bd558d3146 upstream. | ||
7 | |||
8 | Follow up on commit 556061b00 ("sched/nohz: Fix rq->cpu_load[] | ||
9 | calculations") since while that fixed the busy case it regressed the | ||
10 | mostly idle case. | ||
11 | |||
12 | Add a callback from the nohz exit to also age the rq->cpu_load[] | ||
13 | array. This closes the hole where either there was no nohz load | ||
14 | balance pass during the nohz, or there was a 'significant' amount of | ||
15 | idle time between the last nohz balance and the nohz exit. | ||
16 | |||
17 | So we'll update unconditionally from the tick to not insert any | ||
18 | accidental 0 load periods while busy, and we try and catch up from | ||
19 | nohz idle balance and nohz exit. Both these are still prone to missing | ||
20 | a jiffy, but that has always been the case. | ||
21 | |||
22 | Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> | ||
23 | Cc: pjt@google.com | ||
24 | Cc: Venkatesh Pallipadi <venki@google.com> | ||
25 | Link: http://lkml.kernel.org/n/tip-kt0trz0apodbf84ucjfdbr1a@git.kernel.org | ||
26 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | ||
27 | [bwh: Backported to 3.2: adjust filenames and context] | ||
28 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
29 | --- | ||
30 | include/linux/sched.h | 1 + | ||
31 | kernel/sched.c | 53 +++++++++++++++++++++++++++++++++++++-------- | ||
32 | kernel/time/tick-sched.c | 1 + | ||
33 | 3 files changed, 45 insertions(+), 10 deletions(-) | ||
34 | |||
35 | diff --git a/include/linux/sched.h b/include/linux/sched.h | ||
36 | index a96cb8c..d336c35 100644 | ||
37 | --- a/include/linux/sched.h | ||
38 | +++ b/include/linux/sched.h | ||
39 | @@ -145,6 +145,7 @@ extern unsigned long this_cpu_load(void); | ||
40 | |||
41 | |||
42 | extern void calc_global_load(unsigned long ticks); | ||
43 | +extern void update_cpu_load_nohz(void); | ||
44 | |||
45 | extern unsigned long get_parent_ip(unsigned long addr); | ||
46 | |||
47 | diff --git a/kernel/sched.c b/kernel/sched.c | ||
48 | index a409d81..9cd8ca7 100644 | ||
49 | --- a/kernel/sched.c | ||
50 | +++ b/kernel/sched.c | ||
51 | @@ -3886,25 +3886,32 @@ static void __update_cpu_load(struct rq *this_rq, unsigned long this_load, | ||
52 | sched_avg_update(this_rq); | ||
53 | } | ||
54 | |||
55 | +#ifdef CONFIG_NO_HZ | ||
56 | +/* | ||
57 | + * There is no sane way to deal with nohz on smp when using jiffies because the | ||
58 | + * cpu doing the jiffies update might drift wrt the cpu doing the jiffy reading | ||
59 | + * causing off-by-one errors in observed deltas; {0,2} instead of {1,1}. | ||
60 | + * | ||
61 | + * Therefore we cannot use the delta approach from the regular tick since that | ||
62 | + * would seriously skew the load calculation. However we'll make do for those | ||
63 | + * updates happening while idle (nohz_idle_balance) or coming out of idle | ||
64 | + * (tick_nohz_idle_exit). | ||
65 | + * | ||
66 | + * This means we might still be one tick off for nohz periods. | ||
67 | + */ | ||
68 | + | ||
69 | /* | ||
70 | * Called from nohz_idle_balance() to update the load ratings before doing the | ||
71 | * idle balance. | ||
72 | */ | ||
73 | static void update_idle_cpu_load(struct rq *this_rq) | ||
74 | { | ||
75 | - unsigned long curr_jiffies = jiffies; | ||
76 | + unsigned long curr_jiffies = ACCESS_ONCE(jiffies); | ||
77 | unsigned long load = this_rq->load.weight; | ||
78 | unsigned long pending_updates; | ||
79 | |||
80 | /* | ||
81 | - * Bloody broken means of dealing with nohz, but better than nothing.. | ||
82 | - * jiffies is updated by one cpu, another cpu can drift wrt the jiffy | ||
83 | - * update and see 0 difference the one time and 2 the next, even though | ||
84 | - * we ticked at roughtly the same rate. | ||
85 | - * | ||
86 | - * Hence we only use this from nohz_idle_balance() and skip this | ||
87 | - * nonsense when called from the scheduler_tick() since that's | ||
88 | - * guaranteed a stable rate. | ||
89 | + * bail if there's load or we're actually up-to-date. | ||
90 | */ | ||
91 | if (load || curr_jiffies == this_rq->last_load_update_tick) | ||
92 | return; | ||
93 | @@ -3916,12 +3923,38 @@ static void update_idle_cpu_load(struct rq *this_rq) | ||
94 | } | ||
95 | |||
96 | /* | ||
97 | + * Called from tick_nohz_idle_exit() -- try and fix up the ticks we missed. | ||
98 | + */ | ||
99 | +void update_cpu_load_nohz(void) | ||
100 | +{ | ||
101 | + struct rq *this_rq = this_rq(); | ||
102 | + unsigned long curr_jiffies = ACCESS_ONCE(jiffies); | ||
103 | + unsigned long pending_updates; | ||
104 | + | ||
105 | + if (curr_jiffies == this_rq->last_load_update_tick) | ||
106 | + return; | ||
107 | + | ||
108 | + raw_spin_lock(&this_rq->lock); | ||
109 | + pending_updates = curr_jiffies - this_rq->last_load_update_tick; | ||
110 | + if (pending_updates) { | ||
111 | + this_rq->last_load_update_tick = curr_jiffies; | ||
112 | + /* | ||
113 | + * We were idle, this means load 0, the current load might be | ||
114 | + * !0 due to remote wakeups and the sort. | ||
115 | + */ | ||
116 | + __update_cpu_load(this_rq, 0, pending_updates); | ||
117 | + } | ||
118 | + raw_spin_unlock(&this_rq->lock); | ||
119 | +} | ||
120 | +#endif /* CONFIG_NO_HZ */ | ||
121 | + | ||
122 | +/* | ||
123 | * Called from scheduler_tick() | ||
124 | */ | ||
125 | static void update_cpu_load_active(struct rq *this_rq) | ||
126 | { | ||
127 | /* | ||
128 | - * See the mess in update_idle_cpu_load(). | ||
129 | + * See the mess around update_idle_cpu_load() / update_cpu_load_nohz(). | ||
130 | */ | ||
131 | this_rq->last_load_update_tick = jiffies; | ||
132 | __update_cpu_load(this_rq, this_rq->load.weight, 1); | ||
133 | diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c | ||
134 | index 9955ebd..793548c 100644 | ||
135 | --- a/kernel/time/tick-sched.c | ||
136 | +++ b/kernel/time/tick-sched.c | ||
137 | @@ -549,6 +549,7 @@ void tick_nohz_restart_sched_tick(void) | ||
138 | /* Update jiffies first */ | ||
139 | select_nohz_load_balancer(0); | ||
140 | tick_do_update_jiffies64(now); | ||
141 | + update_cpu_load_nohz(); | ||
142 | |||
143 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | ||
144 | /* | ||
145 | -- | ||
146 | 1.7.7.6 | ||
147 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0020-powerpc-ftrace-Fix-assembly-trampoline-register-usag.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0020-powerpc-ftrace-Fix-assembly-trampoline-register-usag.patch new file mode 100644 index 00000000..f55431da --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0020-powerpc-ftrace-Fix-assembly-trampoline-register-usag.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 033f6d41630ea9916446d27526cad10233c43839 Mon Sep 17 00:00:00 2001 | ||
2 | From: roger blofeld <blofeldus@yahoo.com> | ||
3 | Date: Thu, 21 Jun 2012 05:27:14 +0000 | ||
4 | Subject: [PATCH 20/73] powerpc/ftrace: Fix assembly trampoline register usage | ||
5 | |||
6 | commit fd5a42980e1cf327b7240adf5e7b51ea41c23437 upstream. | ||
7 | |||
8 | Just like the module loader, ftrace needs to be updated to use r12 | ||
9 | instead of r11 with newer gcc's. | ||
10 | |||
11 | Signed-off-by: Roger Blofeld <blofeldus@yahoo.com> | ||
12 | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> | ||
13 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
14 | --- | ||
15 | arch/powerpc/kernel/ftrace.c | 12 ++++++------ | ||
16 | 1 files changed, 6 insertions(+), 6 deletions(-) | ||
17 | |||
18 | diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c | ||
19 | index bf99cfa..6324008 100644 | ||
20 | --- a/arch/powerpc/kernel/ftrace.c | ||
21 | +++ b/arch/powerpc/kernel/ftrace.c | ||
22 | @@ -245,9 +245,9 @@ __ftrace_make_nop(struct module *mod, | ||
23 | |||
24 | /* | ||
25 | * On PPC32 the trampoline looks like: | ||
26 | - * 0x3d, 0x60, 0x00, 0x00 lis r11,sym@ha | ||
27 | - * 0x39, 0x6b, 0x00, 0x00 addi r11,r11,sym@l | ||
28 | - * 0x7d, 0x69, 0x03, 0xa6 mtctr r11 | ||
29 | + * 0x3d, 0x80, 0x00, 0x00 lis r12,sym@ha | ||
30 | + * 0x39, 0x8c, 0x00, 0x00 addi r12,r12,sym@l | ||
31 | + * 0x7d, 0x89, 0x03, 0xa6 mtctr r12 | ||
32 | * 0x4e, 0x80, 0x04, 0x20 bctr | ||
33 | */ | ||
34 | |||
35 | @@ -262,9 +262,9 @@ __ftrace_make_nop(struct module *mod, | ||
36 | pr_devel(" %08x %08x ", jmp[0], jmp[1]); | ||
37 | |||
38 | /* verify that this is what we expect it to be */ | ||
39 | - if (((jmp[0] & 0xffff0000) != 0x3d600000) || | ||
40 | - ((jmp[1] & 0xffff0000) != 0x396b0000) || | ||
41 | - (jmp[2] != 0x7d6903a6) || | ||
42 | + if (((jmp[0] & 0xffff0000) != 0x3d800000) || | ||
43 | + ((jmp[1] & 0xffff0000) != 0x398c0000) || | ||
44 | + (jmp[2] != 0x7d8903a6) || | ||
45 | (jmp[3] != 0x4e800420)) { | ||
46 | printk(KERN_ERR "Not a trampoline\n"); | ||
47 | return -EINVAL; | ||
48 | -- | ||
49 | 1.7.7.6 | ||
50 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0021-cx25821-Remove-bad-strcpy-to-read-only-char.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0021-cx25821-Remove-bad-strcpy-to-read-only-char.patch new file mode 100644 index 00000000..bc425dc8 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0021-cx25821-Remove-bad-strcpy-to-read-only-char.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From 030eee1110a4bb7e4bce1cb32eb0f1a4fbd9923a Mon Sep 17 00:00:00 2001 | ||
2 | From: Ezequiel Garcia <elezegarcia@gmail.com> | ||
3 | Date: Wed, 18 Jul 2012 10:05:26 -0300 | ||
4 | Subject: [PATCH 21/73] cx25821: Remove bad strcpy to read-only char* | ||
5 | |||
6 | commit 380e99fc44d79bc35af9ff1d3316ef4027ce775e upstream. | ||
7 | |||
8 | The strcpy was being used to set the name of the board. Since the | ||
9 | destination char* was read-only and the name is set statically at | ||
10 | compile time; this was both wrong and redundant. | ||
11 | |||
12 | The type of char* is changed to const char* to prevent future errors. | ||
13 | |||
14 | Reported-by: Radek Masin <radek@masin.eu> | ||
15 | Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com> | ||
16 | [ Taking directly due to vacations - Linus ] | ||
17 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
18 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
19 | --- | ||
20 | drivers/media/video/cx25821/cx25821-core.c | 3 --- | ||
21 | drivers/media/video/cx25821/cx25821.h | 2 +- | ||
22 | 2 files changed, 1 insertions(+), 4 deletions(-) | ||
23 | |||
24 | diff --git a/drivers/media/video/cx25821/cx25821-core.c b/drivers/media/video/cx25821/cx25821-core.c | ||
25 | index a7fa38f..e572ce5 100644 | ||
26 | --- a/drivers/media/video/cx25821/cx25821-core.c | ||
27 | +++ b/drivers/media/video/cx25821/cx25821-core.c | ||
28 | @@ -914,9 +914,6 @@ static int cx25821_dev_setup(struct cx25821_dev *dev) | ||
29 | list_add_tail(&dev->devlist, &cx25821_devlist); | ||
30 | mutex_unlock(&cx25821_devlist_mutex); | ||
31 | |||
32 | - strcpy(cx25821_boards[UNKNOWN_BOARD].name, "unknown"); | ||
33 | - strcpy(cx25821_boards[CX25821_BOARD].name, "cx25821"); | ||
34 | - | ||
35 | if (dev->pci->device != 0x8210) { | ||
36 | pr_info("%s(): Exiting. Incorrect Hardware device = 0x%02x\n", | ||
37 | __func__, dev->pci->device); | ||
38 | diff --git a/drivers/media/video/cx25821/cx25821.h b/drivers/media/video/cx25821/cx25821.h | ||
39 | index 2d2d009..bf54360 100644 | ||
40 | --- a/drivers/media/video/cx25821/cx25821.h | ||
41 | +++ b/drivers/media/video/cx25821/cx25821.h | ||
42 | @@ -187,7 +187,7 @@ enum port { | ||
43 | }; | ||
44 | |||
45 | struct cx25821_board { | ||
46 | - char *name; | ||
47 | + const char *name; | ||
48 | enum port porta; | ||
49 | enum port portb; | ||
50 | enum port portc; | ||
51 | -- | ||
52 | 1.7.7.6 | ||
53 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0022-x86-Fix-boot-on-Twinhead-H12Y.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0022-x86-Fix-boot-on-Twinhead-H12Y.patch new file mode 100644 index 00000000..b5eccde1 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0022-x86-Fix-boot-on-Twinhead-H12Y.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | From 25b4c57c33b9972f3b03d5a74c827b27cd9babcf Mon Sep 17 00:00:00 2001 | ||
2 | From: Alan Cox <alan@linux.intel.com> | ||
3 | Date: Tue, 15 May 2012 18:44:15 +0100 | ||
4 | Subject: [PATCH 22/73] x86: Fix boot on Twinhead H12Y | ||
5 | |||
6 | commit 80b3e557371205566a71e569fbfcce5b11f92dbe upstream. | ||
7 | |||
8 | Despite lots of investigation into why this is needed we don't | ||
9 | know or have an elegant cure. The only answer found on this | ||
10 | laptop is to mark a problem region as used so that Linux doesn't | ||
11 | put anything there. | ||
12 | |||
13 | Currently all the users add reserve= command lines and anyone | ||
14 | not knowing this needs to find the magic page that documents it. | ||
15 | Automate it instead. | ||
16 | |||
17 | Signed-off-by: Alan Cox <alan@linux.intel.com> | ||
18 | Tested-and-bugfixed-by: Arne Fitzenreiter <arne@fitzenreiter.de> | ||
19 | Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=10231 | ||
20 | Link: http://lkml.kernel.org/r/20120515174347.5109.94551.stgit@bluebook | ||
21 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | ||
22 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
23 | --- | ||
24 | arch/x86/pci/fixup.c | 17 +++++++++++++++++ | ||
25 | 1 files changed, 17 insertions(+), 0 deletions(-) | ||
26 | |||
27 | diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c | ||
28 | index 6dd8955..0951b81 100644 | ||
29 | --- a/arch/x86/pci/fixup.c | ||
30 | +++ b/arch/x86/pci/fixup.c | ||
31 | @@ -521,3 +521,20 @@ static void sb600_disable_hpet_bar(struct pci_dev *dev) | ||
32 | } | ||
33 | } | ||
34 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATI, 0x4385, sb600_disable_hpet_bar); | ||
35 | + | ||
36 | +/* | ||
37 | + * Twinhead H12Y needs us to block out a region otherwise we map devices | ||
38 | + * there and any access kills the box. | ||
39 | + * | ||
40 | + * See: https://bugzilla.kernel.org/show_bug.cgi?id=10231 | ||
41 | + * | ||
42 | + * Match off the LPC and svid/sdid (older kernels lose the bridge subvendor) | ||
43 | + */ | ||
44 | +static void __devinit twinhead_reserve_killing_zone(struct pci_dev *dev) | ||
45 | +{ | ||
46 | + if (dev->subsystem_vendor == 0x14FF && dev->subsystem_device == 0xA003) { | ||
47 | + pr_info("Reserving memory on Twinhead H12Y\n"); | ||
48 | + request_mem_region(0xFFB00000, 0x100000, "twinhead"); | ||
49 | + } | ||
50 | +} | ||
51 | +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x27B9, twinhead_reserve_killing_zone); | ||
52 | -- | ||
53 | 1.7.7.6 | ||
54 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0023-r8169-RxConfig-hack-for-the-8168evl.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0023-r8169-RxConfig-hack-for-the-8168evl.patch new file mode 100644 index 00000000..35d29c7b --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0023-r8169-RxConfig-hack-for-the-8168evl.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 57961c5a47473e6a6aa03292828484bb2d293f04 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu@fr.zoreil.com> | ||
3 | Date: Wed, 20 Jun 2012 12:09:18 +0000 | ||
4 | Subject: [PATCH 23/73] r8169: RxConfig hack for the 8168evl. | ||
5 | |||
6 | commit eb2dc35d99028b698cdedba4f5522bc43e576bd2 upstream. | ||
7 | |||
8 | The 8168evl (RTL_GIGA_MAC_VER_34) based Gigabyte GA-990FXA motherboards | ||
9 | are very prone to NETDEV watchdog problems without this change. See | ||
10 | https://bugzilla.kernel.org/show_bug.cgi?id=42899 for instance. | ||
11 | |||
12 | I don't know why it *works*. It's depressingly effective though. | ||
13 | |||
14 | For the record: | ||
15 | - the problem may go along IOMMU (AMD-Vi) errors but it really looks | ||
16 | like a red herring. | ||
17 | - the patch sets the RX_MULTI_EN bit. If the 8168c doc is any guide, | ||
18 | the chipset now fetches several Rx descriptors at a time. | ||
19 | - long ago the driver ignored the RX_MULTI_EN bit. | ||
20 | e542a2269f232d61270ceddd42b73a4348dee2bb changed the RxConfig | ||
21 | settings. Whatever the problem it's now labeled a regression. | ||
22 | - Realtek's own driver can identify two different 8168evl devices | ||
23 | (CFG_METHOD_16 and CFG_METHOD_17) where the r8169 driver only | ||
24 | sees one. It sucks. | ||
25 | |||
26 | Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> | ||
27 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
28 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
29 | --- | ||
30 | drivers/net/ethernet/realtek/r8169.c | 1 + | ||
31 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
32 | |||
33 | diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c | ||
34 | index 9e61d6b..ed1be8a 100644 | ||
35 | --- a/drivers/net/ethernet/realtek/r8169.c | ||
36 | +++ b/drivers/net/ethernet/realtek/r8169.c | ||
37 | @@ -3770,6 +3770,7 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp) | ||
38 | case RTL_GIGA_MAC_VER_22: | ||
39 | case RTL_GIGA_MAC_VER_23: | ||
40 | case RTL_GIGA_MAC_VER_24: | ||
41 | + case RTL_GIGA_MAC_VER_34: | ||
42 | RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST); | ||
43 | break; | ||
44 | default: | ||
45 | -- | ||
46 | 1.7.7.6 | ||
47 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0024-cifs-when-CONFIG_HIGHMEM-is-set-serialize-the-read-w.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0024-cifs-when-CONFIG_HIGHMEM-is-set-serialize-the-read-w.patch new file mode 100644 index 00000000..004839e6 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0024-cifs-when-CONFIG_HIGHMEM-is-set-serialize-the-read-w.patch | |||
@@ -0,0 +1,124 @@ | |||
1 | From 3e3da899949f18869c6958a30a861d89f2d4b73c Mon Sep 17 00:00:00 2001 | ||
2 | From: Jeff Layton <jlayton@redhat.com> | ||
3 | Date: Wed, 11 Jul 2012 09:09:36 -0400 | ||
4 | Subject: [PATCH 24/73] cifs: when CONFIG_HIGHMEM is set, serialize the | ||
5 | read/write kmaps | ||
6 | |||
7 | commit 3cf003c08be785af4bee9ac05891a15bcbff856a upstream. | ||
8 | |||
9 | Jian found that when he ran fsx on a 32 bit arch with a large wsize the | ||
10 | process and one of the bdi writeback kthreads would sometimes deadlock | ||
11 | with a stack trace like this: | ||
12 | |||
13 | crash> bt | ||
14 | PID: 2789 TASK: f02edaa0 CPU: 3 COMMAND: "fsx" | ||
15 | #0 [eed63cbc] schedule at c083c5b3 | ||
16 | #1 [eed63d80] kmap_high at c0500ec8 | ||
17 | #2 [eed63db0] cifs_async_writev at f7fabcd7 [cifs] | ||
18 | #3 [eed63df0] cifs_writepages at f7fb7f5c [cifs] | ||
19 | #4 [eed63e50] do_writepages at c04f3e32 | ||
20 | #5 [eed63e54] __filemap_fdatawrite_range at c04e152a | ||
21 | #6 [eed63ea4] filemap_fdatawrite at c04e1b3e | ||
22 | #7 [eed63eb4] cifs_file_aio_write at f7fa111a [cifs] | ||
23 | #8 [eed63ecc] do_sync_write at c052d202 | ||
24 | #9 [eed63f74] vfs_write at c052d4ee | ||
25 | #10 [eed63f94] sys_write at c052df4c | ||
26 | #11 [eed63fb0] ia32_sysenter_target at c0409a98 | ||
27 | EAX: 00000004 EBX: 00000003 ECX: abd73b73 EDX: 012a65c6 | ||
28 | DS: 007b ESI: 012a65c6 ES: 007b EDI: 00000000 | ||
29 | SS: 007b ESP: bf8db178 EBP: bf8db1f8 GS: 0033 | ||
30 | CS: 0073 EIP: 40000424 ERR: 00000004 EFLAGS: 00000246 | ||
31 | |||
32 | Each task would kmap part of its address array before getting stuck, but | ||
33 | not enough to actually issue the write. | ||
34 | |||
35 | This patch fixes this by serializing the marshal_iov operations for | ||
36 | async reads and writes. The idea here is to ensure that cifs | ||
37 | aggressively tries to populate a request before attempting to fulfill | ||
38 | another one. As soon as all of the pages are kmapped for a request, then | ||
39 | we can unlock and allow another one to proceed. | ||
40 | |||
41 | There's no need to do this serialization on non-CONFIG_HIGHMEM arches | ||
42 | however, so optimize all of this out when CONFIG_HIGHMEM isn't set. | ||
43 | |||
44 | Reported-by: Jian Li <jiali@redhat.com> | ||
45 | Signed-off-by: Jeff Layton <jlayton@redhat.com> | ||
46 | Signed-off-by: Steve French <smfrench@gmail.com> | ||
47 | [bwh: Backported to 3.2: adjust context] | ||
48 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
49 | --- | ||
50 | fs/cifs/cifssmb.c | 30 ++++++++++++++++++++++++++++++ | ||
51 | 1 files changed, 30 insertions(+), 0 deletions(-) | ||
52 | |||
53 | diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c | ||
54 | index 6aa7457..c858a29 100644 | ||
55 | --- a/fs/cifs/cifssmb.c | ||
56 | +++ b/fs/cifs/cifssmb.c | ||
57 | @@ -89,6 +89,32 @@ static struct { | ||
58 | /* Forward declarations */ | ||
59 | static void cifs_readv_complete(struct work_struct *work); | ||
60 | |||
61 | +#ifdef CONFIG_HIGHMEM | ||
62 | +/* | ||
63 | + * On arches that have high memory, kmap address space is limited. By | ||
64 | + * serializing the kmap operations on those arches, we ensure that we don't | ||
65 | + * end up with a bunch of threads in writeback with partially mapped page | ||
66 | + * arrays, stuck waiting for kmap to come back. That situation prevents | ||
67 | + * progress and can deadlock. | ||
68 | + */ | ||
69 | +static DEFINE_MUTEX(cifs_kmap_mutex); | ||
70 | + | ||
71 | +static inline void | ||
72 | +cifs_kmap_lock(void) | ||
73 | +{ | ||
74 | + mutex_lock(&cifs_kmap_mutex); | ||
75 | +} | ||
76 | + | ||
77 | +static inline void | ||
78 | +cifs_kmap_unlock(void) | ||
79 | +{ | ||
80 | + mutex_unlock(&cifs_kmap_mutex); | ||
81 | +} | ||
82 | +#else /* !CONFIG_HIGHMEM */ | ||
83 | +#define cifs_kmap_lock() do { ; } while(0) | ||
84 | +#define cifs_kmap_unlock() do { ; } while(0) | ||
85 | +#endif /* CONFIG_HIGHMEM */ | ||
86 | + | ||
87 | /* Mark as invalid, all open files on tree connections since they | ||
88 | were closed when session to server was lost */ | ||
89 | static void mark_open_files_invalid(struct cifs_tcon *pTcon) | ||
90 | @@ -1540,6 +1566,7 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid) | ||
91 | eof_index = eof ? (eof - 1) >> PAGE_CACHE_SHIFT : 0; | ||
92 | cFYI(1, "eof=%llu eof_index=%lu", eof, eof_index); | ||
93 | |||
94 | + cifs_kmap_lock(); | ||
95 | list_for_each_entry_safe(page, tpage, &rdata->pages, lru) { | ||
96 | if (remaining >= PAGE_CACHE_SIZE) { | ||
97 | /* enough data to fill the page */ | ||
98 | @@ -1589,6 +1616,7 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid) | ||
99 | page_cache_release(page); | ||
100 | } | ||
101 | } | ||
102 | + cifs_kmap_unlock(); | ||
103 | |||
104 | /* issue the read if we have any iovecs left to fill */ | ||
105 | if (rdata->nr_iov > 1) { | ||
106 | @@ -2171,6 +2199,7 @@ cifs_async_writev(struct cifs_writedata *wdata) | ||
107 | iov[0].iov_base = smb; | ||
108 | |||
109 | /* marshal up the pages into iov array */ | ||
110 | + cifs_kmap_lock(); | ||
111 | wdata->bytes = 0; | ||
112 | for (i = 0; i < wdata->nr_pages; i++) { | ||
113 | iov[i + 1].iov_len = min(inode->i_size - | ||
114 | @@ -2179,6 +2208,7 @@ cifs_async_writev(struct cifs_writedata *wdata) | ||
115 | iov[i + 1].iov_base = kmap(wdata->pages[i]); | ||
116 | wdata->bytes += iov[i + 1].iov_len; | ||
117 | } | ||
118 | + cifs_kmap_unlock(); | ||
119 | |||
120 | cFYI(1, "async write at %llu %u bytes", wdata->offset, wdata->bytes); | ||
121 | |||
122 | -- | ||
123 | 1.7.7.6 | ||
124 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0025-wireless-rt2x00-rt2800usb-add-more-devices-ids.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0025-wireless-rt2x00-rt2800usb-add-more-devices-ids.patch new file mode 100644 index 00000000..71216d76 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0025-wireless-rt2x00-rt2800usb-add-more-devices-ids.patch | |||
@@ -0,0 +1,89 @@ | |||
1 | From 1b993bd614946837177ce94e29f3d6febec2d7dc Mon Sep 17 00:00:00 2001 | ||
2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
3 | Date: Tue, 17 Apr 2012 01:50:32 +0200 | ||
4 | Subject: [PATCH 25/73] wireless: rt2x00: rt2800usb add more devices ids | ||
5 | |||
6 | commit 63b376411173c343bbcb450f95539da91f079e0c upstream. | ||
7 | |||
8 | They were taken from ralink drivers: | ||
9 | 2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO | ||
10 | 2012_03_22_RT5572_Linux_STA_v2.6.0.0_DPO | ||
11 | |||
12 | 0x1eda,0x2210 RT3070 Airties | ||
13 | |||
14 | 0x083a,0xb511 RT3370 Panasonic | ||
15 | 0x0471,0x20dd RT3370 Philips | ||
16 | |||
17 | 0x1690,0x0764 RT35xx Askey | ||
18 | 0x0df6,0x0065 RT35xx Sitecom | ||
19 | 0x0df6,0x0066 RT35xx Sitecom | ||
20 | 0x0df6,0x0068 RT35xx Sitecom | ||
21 | |||
22 | 0x2001,0x3c1c RT5370 DLink | ||
23 | 0x2001,0x3c1d RT5370 DLink | ||
24 | |||
25 | 2001 is D-Link not Alpha | ||
26 | |||
27 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
28 | Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> | ||
29 | Signed-off-by: John W. Linville <linville@tuxdriver.com> | ||
30 | [bwh: Backported to 3.2: drop the 5372 devices] | ||
31 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
32 | --- | ||
33 | drivers/net/wireless/rt2x00/rt2800usb.c | 12 ++++++++++++ | ||
34 | 1 files changed, 12 insertions(+), 0 deletions(-) | ||
35 | |||
36 | diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c | ||
37 | index 0ffa111..f05a12d 100644 | ||
38 | --- a/drivers/net/wireless/rt2x00/rt2800usb.c | ||
39 | +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | ||
40 | @@ -876,6 +876,7 @@ static struct usb_device_id rt2800usb_device_table[] = { | ||
41 | { USB_DEVICE(0x1482, 0x3c09) }, | ||
42 | /* AirTies */ | ||
43 | { USB_DEVICE(0x1eda, 0x2012) }, | ||
44 | + { USB_DEVICE(0x1eda, 0x2210) }, | ||
45 | { USB_DEVICE(0x1eda, 0x2310) }, | ||
46 | /* Allwin */ | ||
47 | { USB_DEVICE(0x8516, 0x2070) }, | ||
48 | @@ -1088,6 +1089,10 @@ static struct usb_device_id rt2800usb_device_table[] = { | ||
49 | #ifdef CONFIG_RT2800USB_RT33XX | ||
50 | /* Belkin */ | ||
51 | { USB_DEVICE(0x050d, 0x945b) }, | ||
52 | + /* Panasonic */ | ||
53 | + { USB_DEVICE(0x083a, 0xb511) }, | ||
54 | + /* Philips */ | ||
55 | + { USB_DEVICE(0x0471, 0x20dd) }, | ||
56 | /* Ralink */ | ||
57 | { USB_DEVICE(0x148f, 0x3370) }, | ||
58 | { USB_DEVICE(0x148f, 0x8070) }, | ||
59 | @@ -1099,6 +1104,7 @@ static struct usb_device_id rt2800usb_device_table[] = { | ||
60 | { USB_DEVICE(0x8516, 0x3572) }, | ||
61 | /* Askey */ | ||
62 | { USB_DEVICE(0x1690, 0x0744) }, | ||
63 | + { USB_DEVICE(0x1690, 0x0764) }, | ||
64 | /* Cisco */ | ||
65 | { USB_DEVICE(0x167b, 0x4001) }, | ||
66 | /* EnGenius */ | ||
67 | @@ -1113,6 +1119,9 @@ static struct usb_device_id rt2800usb_device_table[] = { | ||
68 | /* Sitecom */ | ||
69 | { USB_DEVICE(0x0df6, 0x0041) }, | ||
70 | { USB_DEVICE(0x0df6, 0x0062) }, | ||
71 | + { USB_DEVICE(0x0df6, 0x0065) }, | ||
72 | + { USB_DEVICE(0x0df6, 0x0066) }, | ||
73 | + { USB_DEVICE(0x0df6, 0x0068) }, | ||
74 | /* Toshiba */ | ||
75 | { USB_DEVICE(0x0930, 0x0a07) }, | ||
76 | /* Zinwell */ | ||
77 | @@ -1122,6 +1131,9 @@ static struct usb_device_id rt2800usb_device_table[] = { | ||
78 | /* Azurewave */ | ||
79 | { USB_DEVICE(0x13d3, 0x3329) }, | ||
80 | { USB_DEVICE(0x13d3, 0x3365) }, | ||
81 | + /* D-Link */ | ||
82 | + { USB_DEVICE(0x2001, 0x3c1c) }, | ||
83 | + { USB_DEVICE(0x2001, 0x3c1d) }, | ||
84 | /* Ralink */ | ||
85 | { USB_DEVICE(0x148f, 0x5370) }, | ||
86 | { USB_DEVICE(0x148f, 0x5372) }, | ||
87 | -- | ||
88 | 1.7.7.6 | ||
89 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0026-wireless-rt2x00-rt2800usb-more-devices-were-identifi.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0026-wireless-rt2x00-rt2800usb-more-devices-were-identifi.patch new file mode 100644 index 00000000..afed1376 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0026-wireless-rt2x00-rt2800usb-more-devices-were-identifi.patch | |||
@@ -0,0 +1,79 @@ | |||
1 | From 53157c2a7eda6ba98def241f183a06a6f28f852f Mon Sep 17 00:00:00 2001 | ||
2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
3 | Date: Tue, 17 Apr 2012 16:28:05 +0200 | ||
4 | Subject: [PATCH 26/73] wireless: rt2x00: rt2800usb more devices were | ||
5 | identified | ||
6 | |||
7 | commit e828b9fb4f6c3513950759d5fb902db5bd054048 upstream. | ||
8 | |||
9 | found in 2012_03_22_RT5572_Linux_STA_v2.6.0.0_DPO | ||
10 | |||
11 | RT3070: | ||
12 | (0x2019,0x5201) Planex Communications, Inc. RT8070 | ||
13 | (0x7392,0x4085) 2L Central Europe BV 8070 | ||
14 | 7392 is Edimax | ||
15 | |||
16 | RT35xx: | ||
17 | (0x1690,0x0761) Askey | ||
18 | was Fujitsu Stylistic 550, but 1690 is Askey | ||
19 | |||
20 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
21 | Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> | ||
22 | Signed-off-by: John W. Linville <linville@tuxdriver.com> | ||
23 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
24 | --- | ||
25 | drivers/net/wireless/rt2x00/rt2800usb.c | 8 +++----- | ||
26 | 1 files changed, 3 insertions(+), 5 deletions(-) | ||
27 | |||
28 | diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c | ||
29 | index f05a12d..76ebba4 100644 | ||
30 | --- a/drivers/net/wireless/rt2x00/rt2800usb.c | ||
31 | +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | ||
32 | @@ -946,6 +946,7 @@ static struct usb_device_id rt2800usb_device_table[] = { | ||
33 | /* DVICO */ | ||
34 | { USB_DEVICE(0x0fe9, 0xb307) }, | ||
35 | /* Edimax */ | ||
36 | + { USB_DEVICE(0x7392, 0x4085) }, | ||
37 | { USB_DEVICE(0x7392, 0x7711) }, | ||
38 | { USB_DEVICE(0x7392, 0x7717) }, | ||
39 | { USB_DEVICE(0x7392, 0x7718) }, | ||
40 | @@ -1021,6 +1022,7 @@ static struct usb_device_id rt2800usb_device_table[] = { | ||
41 | /* Philips */ | ||
42 | { USB_DEVICE(0x0471, 0x200f) }, | ||
43 | /* Planex */ | ||
44 | + { USB_DEVICE(0x2019, 0x5201) }, | ||
45 | { USB_DEVICE(0x2019, 0xab25) }, | ||
46 | { USB_DEVICE(0x2019, 0xed06) }, | ||
47 | /* Quanta */ | ||
48 | @@ -1104,6 +1106,7 @@ static struct usb_device_id rt2800usb_device_table[] = { | ||
49 | { USB_DEVICE(0x8516, 0x3572) }, | ||
50 | /* Askey */ | ||
51 | { USB_DEVICE(0x1690, 0x0744) }, | ||
52 | + { USB_DEVICE(0x1690, 0x0761) }, | ||
53 | { USB_DEVICE(0x1690, 0x0764) }, | ||
54 | /* Cisco */ | ||
55 | { USB_DEVICE(0x167b, 0x4001) }, | ||
56 | @@ -1176,12 +1179,8 @@ static struct usb_device_id rt2800usb_device_table[] = { | ||
57 | { USB_DEVICE(0x07d1, 0x3c0b) }, | ||
58 | { USB_DEVICE(0x07d1, 0x3c17) }, | ||
59 | { USB_DEVICE(0x2001, 0x3c17) }, | ||
60 | - /* Edimax */ | ||
61 | - { USB_DEVICE(0x7392, 0x4085) }, | ||
62 | /* Encore */ | ||
63 | { USB_DEVICE(0x203d, 0x14a1) }, | ||
64 | - /* Fujitsu Stylistic 550 */ | ||
65 | - { USB_DEVICE(0x1690, 0x0761) }, | ||
66 | /* Gemtek */ | ||
67 | { USB_DEVICE(0x15a9, 0x0010) }, | ||
68 | /* Gigabyte */ | ||
69 | @@ -1202,7 +1201,6 @@ static struct usb_device_id rt2800usb_device_table[] = { | ||
70 | { USB_DEVICE(0x05a6, 0x0101) }, | ||
71 | { USB_DEVICE(0x1d4d, 0x0010) }, | ||
72 | /* Planex */ | ||
73 | - { USB_DEVICE(0x2019, 0x5201) }, | ||
74 | { USB_DEVICE(0x2019, 0xab24) }, | ||
75 | /* Qcom */ | ||
76 | { USB_DEVICE(0x18e8, 0x6259) }, | ||
77 | -- | ||
78 | 1.7.7.6 | ||
79 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0027-rt2800usb-2001-3c17-is-an-RT3370-device.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0027-rt2800usb-2001-3c17-is-an-RT3370-device.patch new file mode 100644 index 00000000..fb65d15a --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0027-rt2800usb-2001-3c17-is-an-RT3370-device.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From b35733e76251b308e5a65e60630261571c85f9f3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Albert Pool <albertpool@solcon.nl> | ||
3 | Date: Mon, 14 May 2012 18:08:32 +0200 | ||
4 | Subject: [PATCH 27/73] rt2800usb: 2001:3c17 is an RT3370 device | ||
5 | |||
6 | commit 8fd9d059af12786341dec5a688e607bcdb372238 upstream. | ||
7 | |||
8 | D-Link DWA-123 rev A1 | ||
9 | |||
10 | Signed-off-by: Albert Pool<albertpool@solcon.nl> | ||
11 | Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> | ||
12 | Signed-off-by: John W. Linville <linville@tuxdriver.com> | ||
13 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
14 | --- | ||
15 | drivers/net/wireless/rt2x00/rt2800usb.c | 3 ++- | ||
16 | 1 files changed, 2 insertions(+), 1 deletions(-) | ||
17 | |||
18 | diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c | ||
19 | index 76ebba4..bdf960b 100644 | ||
20 | --- a/drivers/net/wireless/rt2x00/rt2800usb.c | ||
21 | +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | ||
22 | @@ -1091,6 +1091,8 @@ static struct usb_device_id rt2800usb_device_table[] = { | ||
23 | #ifdef CONFIG_RT2800USB_RT33XX | ||
24 | /* Belkin */ | ||
25 | { USB_DEVICE(0x050d, 0x945b) }, | ||
26 | + /* D-Link */ | ||
27 | + { USB_DEVICE(0x2001, 0x3c17) }, | ||
28 | /* Panasonic */ | ||
29 | { USB_DEVICE(0x083a, 0xb511) }, | ||
30 | /* Philips */ | ||
31 | @@ -1178,7 +1180,6 @@ static struct usb_device_id rt2800usb_device_table[] = { | ||
32 | /* D-Link */ | ||
33 | { USB_DEVICE(0x07d1, 0x3c0b) }, | ||
34 | { USB_DEVICE(0x07d1, 0x3c17) }, | ||
35 | - { USB_DEVICE(0x2001, 0x3c17) }, | ||
36 | /* Encore */ | ||
37 | { USB_DEVICE(0x203d, 0x14a1) }, | ||
38 | /* Gemtek */ | ||
39 | -- | ||
40 | 1.7.7.6 | ||
41 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0028-usb-gadget-Fix-g_ether-interface-link-status.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0028-usb-gadget-Fix-g_ether-interface-link-status.patch new file mode 100644 index 00000000..2dcadb88 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0028-usb-gadget-Fix-g_ether-interface-link-status.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From f91bc4d604edd5b09021245b6643cfeebc707f2b Mon Sep 17 00:00:00 2001 | ||
2 | From: Kevin Cernekee <cernekee@gmail.com> | ||
3 | Date: Sun, 24 Jun 2012 21:11:22 -0700 | ||
4 | Subject: [PATCH 28/73] usb: gadget: Fix g_ether interface link status | ||
5 | |||
6 | commit 31bde1ceaa873bcaecd49e829bfabceacc4c512d upstream. | ||
7 | |||
8 | A "usb0" interface that has never been connected to a host has an unknown | ||
9 | operstate, and therefore the IFF_RUNNING flag is (incorrectly) asserted | ||
10 | when queried by ifconfig, ifplugd, etc. This is a result of calling | ||
11 | netif_carrier_off() too early in the probe function; it should be called | ||
12 | after register_netdev(). | ||
13 | |||
14 | Similar problems have been fixed in many other drivers, e.g.: | ||
15 | |||
16 | e826eafa6 (bonding: Call netif_carrier_off after register_netdevice) | ||
17 | 0d672e9f8 (drivers/net: Call netif_carrier_off at the end of the probe) | ||
18 | 6a3c869a6 (cxgb4: fix reported state of interfaces without link) | ||
19 | |||
20 | Fix is to move netif_carrier_off() to the end of the function. | ||
21 | |||
22 | Signed-off-by: Kevin Cernekee <cernekee@gmail.com> | ||
23 | Signed-off-by: Felipe Balbi <balbi@ti.com> | ||
24 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
25 | --- | ||
26 | drivers/usb/gadget/u_ether.c | 12 ++++++------ | ||
27 | 1 files changed, 6 insertions(+), 6 deletions(-) | ||
28 | |||
29 | diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c | ||
30 | index 29c854b..4e1f0aa 100644 | ||
31 | --- a/drivers/usb/gadget/u_ether.c | ||
32 | +++ b/drivers/usb/gadget/u_ether.c | ||
33 | @@ -796,12 +796,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN]) | ||
34 | |||
35 | SET_ETHTOOL_OPS(net, &ops); | ||
36 | |||
37 | - /* two kinds of host-initiated state changes: | ||
38 | - * - iff DATA transfer is active, carrier is "on" | ||
39 | - * - tx queueing enabled if open *and* carrier is "on" | ||
40 | - */ | ||
41 | - netif_carrier_off(net); | ||
42 | - | ||
43 | dev->gadget = g; | ||
44 | SET_NETDEV_DEV(net, &g->dev); | ||
45 | SET_NETDEV_DEVTYPE(net, &gadget_type); | ||
46 | @@ -815,6 +809,12 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN]) | ||
47 | INFO(dev, "HOST MAC %pM\n", dev->host_mac); | ||
48 | |||
49 | the_dev = dev; | ||
50 | + | ||
51 | + /* two kinds of host-initiated state changes: | ||
52 | + * - iff DATA transfer is active, carrier is "on" | ||
53 | + * - tx queueing enabled if open *and* carrier is "on" | ||
54 | + */ | ||
55 | + netif_carrier_off(net); | ||
56 | } | ||
57 | |||
58 | return status; | ||
59 | -- | ||
60 | 1.7.7.6 | ||
61 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0029-ext4-pass-a-char-to-ext4_count_free-instead-of-a-buf.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0029-ext4-pass-a-char-to-ext4_count_free-instead-of-a-buf.patch new file mode 100644 index 00000000..9286436a --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0029-ext4-pass-a-char-to-ext4_count_free-instead-of-a-buf.patch | |||
@@ -0,0 +1,88 @@ | |||
1 | From e872f4ac0de4e1898a669e2c8a7185ef76f266fb Mon Sep 17 00:00:00 2001 | ||
2 | From: Theodore Ts'o <tytso@mit.edu> | ||
3 | Date: Sat, 30 Jun 2012 19:14:57 -0400 | ||
4 | Subject: [PATCH 29/73] ext4: pass a char * to ext4_count_free() instead of a | ||
5 | buffer_head ptr | ||
6 | |||
7 | commit f6fb99cadcd44660c68e13f6eab28333653621e6 upstream. | ||
8 | |||
9 | Make it possible for ext4_count_free to operate on buffers and not | ||
10 | just data in buffer_heads. | ||
11 | |||
12 | Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> | ||
13 | [bwh: Backported to 3.2: adjust context] | ||
14 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
15 | --- | ||
16 | fs/ext4/balloc.c | 3 ++- | ||
17 | fs/ext4/bitmap.c | 8 +++----- | ||
18 | fs/ext4/ext4.h | 2 +- | ||
19 | fs/ext4/ialloc.c | 3 ++- | ||
20 | 4 files changed, 8 insertions(+), 8 deletions(-) | ||
21 | |||
22 | diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c | ||
23 | index 914bf9e..d6970f7 100644 | ||
24 | --- a/fs/ext4/balloc.c | ||
25 | +++ b/fs/ext4/balloc.c | ||
26 | @@ -557,7 +557,8 @@ ext4_fsblk_t ext4_count_free_clusters(struct super_block *sb) | ||
27 | if (bitmap_bh == NULL) | ||
28 | continue; | ||
29 | |||
30 | - x = ext4_count_free(bitmap_bh, sb->s_blocksize); | ||
31 | + x = ext4_count_free(bitmap_bh->b_data, | ||
32 | + EXT4_BLOCKS_PER_GROUP(sb) / 8); | ||
33 | printk(KERN_DEBUG "group %u: stored = %d, counted = %u\n", | ||
34 | i, ext4_free_group_clusters(sb, gdp), x); | ||
35 | bitmap_count += x; | ||
36 | diff --git a/fs/ext4/bitmap.c b/fs/ext4/bitmap.c | ||
37 | index fa3af81..012faaa 100644 | ||
38 | --- a/fs/ext4/bitmap.c | ||
39 | +++ b/fs/ext4/bitmap.c | ||
40 | @@ -15,15 +15,13 @@ | ||
41 | |||
42 | static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0}; | ||
43 | |||
44 | -unsigned int ext4_count_free(struct buffer_head *map, unsigned int numchars) | ||
45 | +unsigned int ext4_count_free(char *bitmap, unsigned int numchars) | ||
46 | { | ||
47 | unsigned int i, sum = 0; | ||
48 | |||
49 | - if (!map) | ||
50 | - return 0; | ||
51 | for (i = 0; i < numchars; i++) | ||
52 | - sum += nibblemap[map->b_data[i] & 0xf] + | ||
53 | - nibblemap[(map->b_data[i] >> 4) & 0xf]; | ||
54 | + sum += nibblemap[bitmap[i] & 0xf] + | ||
55 | + nibblemap[(bitmap[i] >> 4) & 0xf]; | ||
56 | return sum; | ||
57 | } | ||
58 | |||
59 | diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h | ||
60 | index 7b1cd5c..873897c 100644 | ||
61 | --- a/fs/ext4/ext4.h | ||
62 | +++ b/fs/ext4/ext4.h | ||
63 | @@ -1757,7 +1757,7 @@ struct mmpd_data { | ||
64 | # define NORET_AND noreturn, | ||
65 | |||
66 | /* bitmap.c */ | ||
67 | -extern unsigned int ext4_count_free(struct buffer_head *, unsigned); | ||
68 | +extern unsigned int ext4_count_free(char *bitmap, unsigned numchars); | ||
69 | |||
70 | /* balloc.c */ | ||
71 | extern unsigned int ext4_block_group(struct super_block *sb, | ||
72 | diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c | ||
73 | index 8fb6844..6266799 100644 | ||
74 | --- a/fs/ext4/ialloc.c | ||
75 | +++ b/fs/ext4/ialloc.c | ||
76 | @@ -1057,7 +1057,8 @@ unsigned long ext4_count_free_inodes(struct super_block *sb) | ||
77 | if (!bitmap_bh) | ||
78 | continue; | ||
79 | |||
80 | - x = ext4_count_free(bitmap_bh, EXT4_INODES_PER_GROUP(sb) / 8); | ||
81 | + x = ext4_count_free(bitmap_bh->b_data, | ||
82 | + EXT4_INODES_PER_GROUP(sb) / 8); | ||
83 | printk(KERN_DEBUG "group %lu: stored = %d, counted = %lu\n", | ||
84 | (unsigned long) i, ext4_free_inodes_count(sb, gdp), x); | ||
85 | bitmap_count += x; | ||
86 | -- | ||
87 | 1.7.7.6 | ||
88 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0030-ftrace-Disable-function-tracing-during-suspend-resum.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0030-ftrace-Disable-function-tracing-during-suspend-resum.patch new file mode 100644 index 00000000..3ec5202b --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0030-ftrace-Disable-function-tracing-during-suspend-resum.patch | |||
@@ -0,0 +1,113 @@ | |||
1 | From 951ac5885b5a314d394ea0668dedccd7ed9216e5 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com> | ||
3 | Date: Sat, 16 Jun 2012 15:30:45 +0200 | ||
4 | Subject: [PATCH 30/73] ftrace: Disable function tracing during suspend/resume | ||
5 | and hibernation, again | ||
6 | |||
7 | commit 443772d408a25af62498793f6f805ce3c559309a upstream. | ||
8 | |||
9 | If function tracing is enabled for some of the low-level suspend/resume | ||
10 | functions, it leads to triple fault during resume from suspend, ultimately | ||
11 | ending up in a reboot instead of a resume (or a total refusal to come out | ||
12 | of suspended state, on some machines). | ||
13 | |||
14 | This issue was explained in more detail in commit f42ac38c59e0a03d (ftrace: | ||
15 | disable tracing for suspend to ram). However, the changes made by that commit | ||
16 | got reverted by commit cbe2f5a6e84eebb (tracing: allow tracing of | ||
17 | suspend/resume & hibernation code again). So, unfortunately since things are | ||
18 | not yet robust enough to allow tracing of low-level suspend/resume functions, | ||
19 | suspend/resume is still broken when ftrace is enabled. | ||
20 | |||
21 | So fix this by disabling function tracing during suspend/resume & hibernation. | ||
22 | |||
23 | Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> | ||
24 | Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> | ||
25 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
26 | --- | ||
27 | kernel/power/hibernate.c | 6 ++++++ | ||
28 | kernel/power/suspend.c | 3 +++ | ||
29 | 2 files changed, 9 insertions(+), 0 deletions(-) | ||
30 | |||
31 | diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c | ||
32 | index 7c0d578..013bd2e 100644 | ||
33 | --- a/kernel/power/hibernate.c | ||
34 | +++ b/kernel/power/hibernate.c | ||
35 | @@ -367,6 +367,7 @@ int hibernation_snapshot(int platform_mode) | ||
36 | } | ||
37 | |||
38 | suspend_console(); | ||
39 | + ftrace_stop(); | ||
40 | pm_restrict_gfp_mask(); | ||
41 | error = dpm_suspend(PMSG_FREEZE); | ||
42 | if (error) | ||
43 | @@ -392,6 +393,7 @@ int hibernation_snapshot(int platform_mode) | ||
44 | if (error || !in_suspend) | ||
45 | pm_restore_gfp_mask(); | ||
46 | |||
47 | + ftrace_start(); | ||
48 | resume_console(); | ||
49 | dpm_complete(msg); | ||
50 | |||
51 | @@ -496,6 +498,7 @@ int hibernation_restore(int platform_mode) | ||
52 | |||
53 | pm_prepare_console(); | ||
54 | suspend_console(); | ||
55 | + ftrace_stop(); | ||
56 | pm_restrict_gfp_mask(); | ||
57 | error = dpm_suspend_start(PMSG_QUIESCE); | ||
58 | if (!error) { | ||
59 | @@ -503,6 +506,7 @@ int hibernation_restore(int platform_mode) | ||
60 | dpm_resume_end(PMSG_RECOVER); | ||
61 | } | ||
62 | pm_restore_gfp_mask(); | ||
63 | + ftrace_start(); | ||
64 | resume_console(); | ||
65 | pm_restore_console(); | ||
66 | return error; | ||
67 | @@ -529,6 +533,7 @@ int hibernation_platform_enter(void) | ||
68 | |||
69 | entering_platform_hibernation = true; | ||
70 | suspend_console(); | ||
71 | + ftrace_stop(); | ||
72 | error = dpm_suspend_start(PMSG_HIBERNATE); | ||
73 | if (error) { | ||
74 | if (hibernation_ops->recover) | ||
75 | @@ -572,6 +577,7 @@ int hibernation_platform_enter(void) | ||
76 | Resume_devices: | ||
77 | entering_platform_hibernation = false; | ||
78 | dpm_resume_end(PMSG_RESTORE); | ||
79 | + ftrace_start(); | ||
80 | resume_console(); | ||
81 | |||
82 | Close: | ||
83 | diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c | ||
84 | index 4953dc0..af48faa 100644 | ||
85 | --- a/kernel/power/suspend.c | ||
86 | +++ b/kernel/power/suspend.c | ||
87 | @@ -25,6 +25,7 @@ | ||
88 | #include <linux/export.h> | ||
89 | #include <linux/suspend.h> | ||
90 | #include <linux/syscore_ops.h> | ||
91 | +#include <linux/ftrace.h> | ||
92 | #include <trace/events/power.h> | ||
93 | |||
94 | #include "power.h" | ||
95 | @@ -220,6 +221,7 @@ int suspend_devices_and_enter(suspend_state_t state) | ||
96 | goto Close; | ||
97 | } | ||
98 | suspend_console(); | ||
99 | + ftrace_stop(); | ||
100 | suspend_test_start(); | ||
101 | error = dpm_suspend_start(PMSG_SUSPEND); | ||
102 | if (error) { | ||
103 | @@ -239,6 +241,7 @@ int suspend_devices_and_enter(suspend_state_t state) | ||
104 | suspend_test_start(); | ||
105 | dpm_resume_end(PMSG_RESUME); | ||
106 | suspend_test_finish("resume devices"); | ||
107 | + ftrace_start(); | ||
108 | resume_console(); | ||
109 | Close: | ||
110 | if (suspend_ops->end) | ||
111 | -- | ||
112 | 1.7.7.6 | ||
113 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0031-x86-microcode-microcode_core.c-simple_strtoul-cleanu.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0031-x86-microcode-microcode_core.c-simple_strtoul-cleanu.patch new file mode 100644 index 00000000..abdc7b17 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0031-x86-microcode-microcode_core.c-simple_strtoul-cleanu.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From a0ac7c345c81631057085b53d0b5de53efb8d241 Mon Sep 17 00:00:00 2001 | ||
2 | From: Shuah Khan <shuahkhan@gmail.com> | ||
3 | Date: Sun, 6 May 2012 11:11:04 -0600 | ||
4 | Subject: [PATCH 31/73] x86, microcode: microcode_core.c simple_strtoul | ||
5 | cleanup | ||
6 | |||
7 | commit e826abd523913f63eb03b59746ffb16153c53dc4 upstream. | ||
8 | |||
9 | Change reload_for_cpu() in kernel/microcode_core.c to call kstrtoul() | ||
10 | instead of calling obsoleted simple_strtoul(). | ||
11 | |||
12 | Signed-off-by: Shuah Khan <shuahkhan@gmail.com> | ||
13 | Reviewed-by: Borislav Petkov <bp@alien8.de> | ||
14 | Link: http://lkml.kernel.org/r/1336324264.2897.9.camel@lorien2 | ||
15 | Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> | ||
16 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
17 | --- | ||
18 | arch/x86/kernel/microcode_core.c | 9 ++++----- | ||
19 | 1 files changed, 4 insertions(+), 5 deletions(-) | ||
20 | |||
21 | diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c | ||
22 | index 563a09d..19c7af1 100644 | ||
23 | --- a/arch/x86/kernel/microcode_core.c | ||
24 | +++ b/arch/x86/kernel/microcode_core.c | ||
25 | @@ -298,12 +298,11 @@ static ssize_t reload_store(struct sys_device *dev, | ||
26 | { | ||
27 | unsigned long val; | ||
28 | int cpu = dev->id; | ||
29 | - int ret = 0; | ||
30 | - char *end; | ||
31 | + ssize_t ret = 0; | ||
32 | |||
33 | - val = simple_strtoul(buf, &end, 0); | ||
34 | - if (end == buf) | ||
35 | - return -EINVAL; | ||
36 | + ret = kstrtoul(buf, 0, &val); | ||
37 | + if (ret) | ||
38 | + return ret; | ||
39 | |||
40 | if (val == 1) { | ||
41 | get_online_cpus(); | ||
42 | -- | ||
43 | 1.7.7.6 | ||
44 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0032-x86-microcode-Sanitize-per-cpu-microcode-reloading-i.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0032-x86-microcode-Sanitize-per-cpu-microcode-reloading-i.patch new file mode 100644 index 00000000..824c0394 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0032-x86-microcode-Sanitize-per-cpu-microcode-reloading-i.patch | |||
@@ -0,0 +1,92 @@ | |||
1 | From 6a7d02f3957e572d5e35fc71df90a3a7311e383d Mon Sep 17 00:00:00 2001 | ||
2 | From: Borislav Petkov <borislav.petkov@amd.com> | ||
3 | Date: Thu, 21 Jun 2012 14:07:16 +0200 | ||
4 | Subject: [PATCH 32/73] x86, microcode: Sanitize per-cpu microcode reloading | ||
5 | interface | ||
6 | |||
7 | commit c9fc3f778a6a215ace14ee556067c73982b6d40f upstream. | ||
8 | |||
9 | Microcode reloading in a per-core manner is a very bad idea for both | ||
10 | major x86 vendors. And the thing is, we have such interface with which | ||
11 | we can end up with different microcode versions applied on different | ||
12 | cores of an otherwise homogeneous wrt (family,model,stepping) system. | ||
13 | |||
14 | So turn off the possibility of doing that per core and allow it only | ||
15 | system-wide. | ||
16 | |||
17 | This is a minimal fix which we'd like to see in stable too thus the | ||
18 | more-or-less arbitrary decision to allow system-wide reloading only on | ||
19 | the BSP: | ||
20 | |||
21 | $ echo 1 > /sys/devices/system/cpu/cpu0/microcode/reload | ||
22 | ... | ||
23 | |||
24 | and disable the interface on the other cores: | ||
25 | |||
26 | $ echo 1 > /sys/devices/system/cpu/cpu23/microcode/reload | ||
27 | -bash: echo: write error: Invalid argument | ||
28 | |||
29 | Also, allowing the reload only from one CPU (the BSP in | ||
30 | that case) doesn't allow the reload procedure to degenerate | ||
31 | into an O(n^2) deal when triggering reloads from all | ||
32 | /sys/devices/system/cpu/cpuX/microcode/reload sysfs nodes | ||
33 | simultaneously. | ||
34 | |||
35 | A more generic fix will follow. | ||
36 | |||
37 | Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br> | ||
38 | Cc: Peter Zijlstra <peterz@infradead.org> | ||
39 | Signed-off-by: Borislav Petkov <borislav.petkov@amd.com> | ||
40 | Link: http://lkml.kernel.org/r/1340280437-7718-2-git-send-email-bp@amd64.org | ||
41 | Signed-off-by: H. Peter Anvin <hpa@zytor.com> | ||
42 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
43 | --- | ||
44 | arch/x86/kernel/microcode_core.c | 26 +++++++++++++++++++------- | ||
45 | 1 files changed, 19 insertions(+), 7 deletions(-) | ||
46 | |||
47 | diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c | ||
48 | index 19c7af1..29c95d7 100644 | ||
49 | --- a/arch/x86/kernel/microcode_core.c | ||
50 | +++ b/arch/x86/kernel/microcode_core.c | ||
51 | @@ -297,19 +297,31 @@ static ssize_t reload_store(struct sys_device *dev, | ||
52 | const char *buf, size_t size) | ||
53 | { | ||
54 | unsigned long val; | ||
55 | - int cpu = dev->id; | ||
56 | - ssize_t ret = 0; | ||
57 | + int cpu; | ||
58 | + ssize_t ret = 0, tmp_ret; | ||
59 | + | ||
60 | + /* allow reload only from the BSP */ | ||
61 | + if (boot_cpu_data.cpu_index != dev->id) | ||
62 | + return -EINVAL; | ||
63 | |||
64 | ret = kstrtoul(buf, 0, &val); | ||
65 | if (ret) | ||
66 | return ret; | ||
67 | |||
68 | - if (val == 1) { | ||
69 | - get_online_cpus(); | ||
70 | - if (cpu_online(cpu)) | ||
71 | - ret = reload_for_cpu(cpu); | ||
72 | - put_online_cpus(); | ||
73 | + if (val != 1) | ||
74 | + return size; | ||
75 | + | ||
76 | + get_online_cpus(); | ||
77 | + for_each_online_cpu(cpu) { | ||
78 | + tmp_ret = reload_for_cpu(cpu); | ||
79 | + if (tmp_ret != 0) | ||
80 | + pr_warn("Error reloading microcode on CPU %d\n", cpu); | ||
81 | + | ||
82 | + /* save retval of the first encountered reload error */ | ||
83 | + if (!ret) | ||
84 | + ret = tmp_ret; | ||
85 | } | ||
86 | + put_online_cpus(); | ||
87 | |||
88 | if (!ret) | ||
89 | ret = size; | ||
90 | -- | ||
91 | 1.7.7.6 | ||
92 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0033-usbdevfs-Correct-amount-of-data-copied-to-user-in-pr.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0033-usbdevfs-Correct-amount-of-data-copied-to-user-in-pr.patch new file mode 100644 index 00000000..044c7d0f --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0033-usbdevfs-Correct-amount-of-data-copied-to-user-in-pr.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From ab66ac59913202f29a32377f4e8bcfd730a8f31d Mon Sep 17 00:00:00 2001 | ||
2 | From: Hans de Goede <hdegoede@redhat.com> | ||
3 | Date: Wed, 4 Jul 2012 09:18:01 +0200 | ||
4 | Subject: [PATCH 33/73] usbdevfs: Correct amount of data copied to user in | ||
5 | processcompl_compat | ||
6 | |||
7 | commit 2102e06a5f2e414694921f23591f072a5ba7db9f upstream. | ||
8 | |||
9 | iso data buffers may have holes in them if some packets were short, so for | ||
10 | iso urbs we should always copy the entire buffer, just like the regular | ||
11 | processcompl does. | ||
12 | |||
13 | Signed-off-by: Hans de Goede <hdegoede@redhat.com> | ||
14 | Acked-by: Alan Stern <stern@rowland.harvard.edu> | ||
15 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
16 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
17 | --- | ||
18 | drivers/usb/core/devio.c | 10 +++++++--- | ||
19 | 1 files changed, 7 insertions(+), 3 deletions(-) | ||
20 | |||
21 | diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c | ||
22 | index f6ff837..a9df218 100644 | ||
23 | --- a/drivers/usb/core/devio.c | ||
24 | +++ b/drivers/usb/core/devio.c | ||
25 | @@ -1555,10 +1555,14 @@ static int processcompl_compat(struct async *as, void __user * __user *arg) | ||
26 | void __user *addr = as->userurb; | ||
27 | unsigned int i; | ||
28 | |||
29 | - if (as->userbuffer && urb->actual_length) | ||
30 | - if (copy_to_user(as->userbuffer, urb->transfer_buffer, | ||
31 | - urb->actual_length)) | ||
32 | + if (as->userbuffer && urb->actual_length) { | ||
33 | + if (urb->number_of_packets > 0) /* Isochronous */ | ||
34 | + i = urb->transfer_buffer_length; | ||
35 | + else /* Non-Isoc */ | ||
36 | + i = urb->actual_length; | ||
37 | + if (copy_to_user(as->userbuffer, urb->transfer_buffer, i)) | ||
38 | return -EFAULT; | ||
39 | + } | ||
40 | if (put_user(as->status, &userurb->status)) | ||
41 | return -EFAULT; | ||
42 | if (put_user(urb->actual_length, &userurb->actual_length)) | ||
43 | -- | ||
44 | 1.7.7.6 | ||
45 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0034-ext4-fix-overhead-calculation-used-by-ext4_statfs.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0034-ext4-fix-overhead-calculation-used-by-ext4_statfs.patch new file mode 100644 index 00000000..3fc3812f --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0034-ext4-fix-overhead-calculation-used-by-ext4_statfs.patch | |||
@@ -0,0 +1,294 @@ | |||
1 | From 838475547b3c83537e291b997da546b518f591b3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Theodore Ts'o <tytso@mit.edu> | ||
3 | Date: Mon, 9 Jul 2012 16:27:05 -0400 | ||
4 | Subject: [PATCH 34/73] ext4: fix overhead calculation used by ext4_statfs() | ||
5 | |||
6 | commit 952fc18ef9ec707ebdc16c0786ec360295e5ff15 upstream. | ||
7 | |||
8 | Commit f975d6bcc7a introduced bug which caused ext4_statfs() to | ||
9 | miscalculate the number of file system overhead blocks. This causes | ||
10 | the f_blocks field in the statfs structure to be larger than it should | ||
11 | be. This would in turn cause the "df" output to show the number of | ||
12 | data blocks in the file system and the number of data blocks used to | ||
13 | be larger than they should be. | ||
14 | |||
15 | Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> | ||
16 | [bwh: Backported to 3.2: adjust context] | ||
17 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
18 | --- | ||
19 | fs/ext4/bitmap.c | 4 - | ||
20 | fs/ext4/ext4.h | 4 +- | ||
21 | fs/ext4/resize.c | 5 ++ | ||
22 | fs/ext4/super.c | 174 ++++++++++++++++++++++++++++++++++++++---------------- | ||
23 | 4 files changed, 131 insertions(+), 56 deletions(-) | ||
24 | |||
25 | diff --git a/fs/ext4/bitmap.c b/fs/ext4/bitmap.c | ||
26 | index 012faaa..bbde5d5 100644 | ||
27 | --- a/fs/ext4/bitmap.c | ||
28 | +++ b/fs/ext4/bitmap.c | ||
29 | @@ -11,8 +11,6 @@ | ||
30 | #include <linux/jbd2.h> | ||
31 | #include "ext4.h" | ||
32 | |||
33 | -#ifdef EXT4FS_DEBUG | ||
34 | - | ||
35 | static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0}; | ||
36 | |||
37 | unsigned int ext4_count_free(char *bitmap, unsigned int numchars) | ||
38 | @@ -25,5 +23,3 @@ unsigned int ext4_count_free(char *bitmap, unsigned int numchars) | ||
39 | return sum; | ||
40 | } | ||
41 | |||
42 | -#endif /* EXT4FS_DEBUG */ | ||
43 | - | ||
44 | diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h | ||
45 | index 873897c..8cb184c 100644 | ||
46 | --- a/fs/ext4/ext4.h | ||
47 | +++ b/fs/ext4/ext4.h | ||
48 | @@ -1123,8 +1123,7 @@ struct ext4_sb_info { | ||
49 | unsigned long s_desc_per_block; /* Number of group descriptors per block */ | ||
50 | ext4_group_t s_groups_count; /* Number of groups in the fs */ | ||
51 | ext4_group_t s_blockfile_groups;/* Groups acceptable for non-extent files */ | ||
52 | - unsigned long s_overhead_last; /* Last calculated overhead */ | ||
53 | - unsigned long s_blocks_last; /* Last seen block count */ | ||
54 | + unsigned long s_overhead; /* # of fs overhead clusters */ | ||
55 | unsigned int s_cluster_ratio; /* Number of blocks per cluster */ | ||
56 | unsigned int s_cluster_bits; /* log2 of s_cluster_ratio */ | ||
57 | loff_t s_bitmap_maxbytes; /* max bytes for bitmap files */ | ||
58 | @@ -1925,6 +1924,7 @@ extern int ext4_group_extend(struct super_block *sb, | ||
59 | ext4_fsblk_t n_blocks_count); | ||
60 | |||
61 | /* super.c */ | ||
62 | +extern int ext4_calculate_overhead(struct super_block *sb); | ||
63 | extern void *ext4_kvmalloc(size_t size, gfp_t flags); | ||
64 | extern void *ext4_kvzalloc(size_t size, gfp_t flags); | ||
65 | extern void ext4_kvfree(void *ptr); | ||
66 | diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c | ||
67 | index 996780a..4eac337 100644 | ||
68 | --- a/fs/ext4/resize.c | ||
69 | +++ b/fs/ext4/resize.c | ||
70 | @@ -952,6 +952,11 @@ int ext4_group_add(struct super_block *sb, struct ext4_new_group_data *input) | ||
71 | &sbi->s_flex_groups[flex_group].free_inodes); | ||
72 | } | ||
73 | |||
74 | + /* | ||
75 | + * Update the fs overhead information | ||
76 | + */ | ||
77 | + ext4_calculate_overhead(sb); | ||
78 | + | ||
79 | ext4_handle_dirty_super(handle, sb); | ||
80 | |||
81 | exit_journal: | ||
82 | diff --git a/fs/ext4/super.c b/fs/ext4/super.c | ||
83 | index a93486e..a071348 100644 | ||
84 | --- a/fs/ext4/super.c | ||
85 | +++ b/fs/ext4/super.c | ||
86 | @@ -3083,6 +3083,114 @@ static void ext4_destroy_lazyinit_thread(void) | ||
87 | kthread_stop(ext4_lazyinit_task); | ||
88 | } | ||
89 | |||
90 | +/* | ||
91 | + * Note: calculating the overhead so we can be compatible with | ||
92 | + * historical BSD practice is quite difficult in the face of | ||
93 | + * clusters/bigalloc. This is because multiple metadata blocks from | ||
94 | + * different block group can end up in the same allocation cluster. | ||
95 | + * Calculating the exact overhead in the face of clustered allocation | ||
96 | + * requires either O(all block bitmaps) in memory or O(number of block | ||
97 | + * groups**2) in time. We will still calculate the superblock for | ||
98 | + * older file systems --- and if we come across with a bigalloc file | ||
99 | + * system with zero in s_overhead_clusters the estimate will be close to | ||
100 | + * correct especially for very large cluster sizes --- but for newer | ||
101 | + * file systems, it's better to calculate this figure once at mkfs | ||
102 | + * time, and store it in the superblock. If the superblock value is | ||
103 | + * present (even for non-bigalloc file systems), we will use it. | ||
104 | + */ | ||
105 | +static int count_overhead(struct super_block *sb, ext4_group_t grp, | ||
106 | + char *buf) | ||
107 | +{ | ||
108 | + struct ext4_sb_info *sbi = EXT4_SB(sb); | ||
109 | + struct ext4_group_desc *gdp; | ||
110 | + ext4_fsblk_t first_block, last_block, b; | ||
111 | + ext4_group_t i, ngroups = ext4_get_groups_count(sb); | ||
112 | + int s, j, count = 0; | ||
113 | + | ||
114 | + first_block = le32_to_cpu(sbi->s_es->s_first_data_block) + | ||
115 | + (grp * EXT4_BLOCKS_PER_GROUP(sb)); | ||
116 | + last_block = first_block + EXT4_BLOCKS_PER_GROUP(sb) - 1; | ||
117 | + for (i = 0; i < ngroups; i++) { | ||
118 | + gdp = ext4_get_group_desc(sb, i, NULL); | ||
119 | + b = ext4_block_bitmap(sb, gdp); | ||
120 | + if (b >= first_block && b <= last_block) { | ||
121 | + ext4_set_bit(EXT4_B2C(sbi, b - first_block), buf); | ||
122 | + count++; | ||
123 | + } | ||
124 | + b = ext4_inode_bitmap(sb, gdp); | ||
125 | + if (b >= first_block && b <= last_block) { | ||
126 | + ext4_set_bit(EXT4_B2C(sbi, b - first_block), buf); | ||
127 | + count++; | ||
128 | + } | ||
129 | + b = ext4_inode_table(sb, gdp); | ||
130 | + if (b >= first_block && b + sbi->s_itb_per_group <= last_block) | ||
131 | + for (j = 0; j < sbi->s_itb_per_group; j++, b++) { | ||
132 | + int c = EXT4_B2C(sbi, b - first_block); | ||
133 | + ext4_set_bit(c, buf); | ||
134 | + count++; | ||
135 | + } | ||
136 | + if (i != grp) | ||
137 | + continue; | ||
138 | + s = 0; | ||
139 | + if (ext4_bg_has_super(sb, grp)) { | ||
140 | + ext4_set_bit(s++, buf); | ||
141 | + count++; | ||
142 | + } | ||
143 | + for (j = ext4_bg_num_gdb(sb, grp); j > 0; j--) { | ||
144 | + ext4_set_bit(EXT4_B2C(sbi, s++), buf); | ||
145 | + count++; | ||
146 | + } | ||
147 | + } | ||
148 | + if (!count) | ||
149 | + return 0; | ||
150 | + return EXT4_CLUSTERS_PER_GROUP(sb) - | ||
151 | + ext4_count_free(buf, EXT4_CLUSTERS_PER_GROUP(sb) / 8); | ||
152 | +} | ||
153 | + | ||
154 | +/* | ||
155 | + * Compute the overhead and stash it in sbi->s_overhead | ||
156 | + */ | ||
157 | +int ext4_calculate_overhead(struct super_block *sb) | ||
158 | +{ | ||
159 | + struct ext4_sb_info *sbi = EXT4_SB(sb); | ||
160 | + struct ext4_super_block *es = sbi->s_es; | ||
161 | + ext4_group_t i, ngroups = ext4_get_groups_count(sb); | ||
162 | + ext4_fsblk_t overhead = 0; | ||
163 | + char *buf = (char *) get_zeroed_page(GFP_KERNEL); | ||
164 | + | ||
165 | + memset(buf, 0, PAGE_SIZE); | ||
166 | + if (!buf) | ||
167 | + return -ENOMEM; | ||
168 | + | ||
169 | + /* | ||
170 | + * Compute the overhead (FS structures). This is constant | ||
171 | + * for a given filesystem unless the number of block groups | ||
172 | + * changes so we cache the previous value until it does. | ||
173 | + */ | ||
174 | + | ||
175 | + /* | ||
176 | + * All of the blocks before first_data_block are overhead | ||
177 | + */ | ||
178 | + overhead = EXT4_B2C(sbi, le32_to_cpu(es->s_first_data_block)); | ||
179 | + | ||
180 | + /* | ||
181 | + * Add the overhead found in each block group | ||
182 | + */ | ||
183 | + for (i = 0; i < ngroups; i++) { | ||
184 | + int blks; | ||
185 | + | ||
186 | + blks = count_overhead(sb, i, buf); | ||
187 | + overhead += blks; | ||
188 | + if (blks) | ||
189 | + memset(buf, 0, PAGE_SIZE); | ||
190 | + cond_resched(); | ||
191 | + } | ||
192 | + sbi->s_overhead = overhead; | ||
193 | + smp_wmb(); | ||
194 | + free_page((unsigned long) buf); | ||
195 | + return 0; | ||
196 | +} | ||
197 | + | ||
198 | static int ext4_fill_super(struct super_block *sb, void *data, int silent) | ||
199 | { | ||
200 | char *orig_data = kstrdup(data, GFP_KERNEL); | ||
201 | @@ -3695,6 +3803,18 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | ||
202 | |||
203 | no_journal: | ||
204 | /* | ||
205 | + * Get the # of file system overhead blocks from the | ||
206 | + * superblock if present. | ||
207 | + */ | ||
208 | + if (es->s_overhead_clusters) | ||
209 | + sbi->s_overhead = le32_to_cpu(es->s_overhead_clusters); | ||
210 | + else { | ||
211 | + ret = ext4_calculate_overhead(sb); | ||
212 | + if (ret) | ||
213 | + goto failed_mount_wq; | ||
214 | + } | ||
215 | + | ||
216 | + /* | ||
217 | * The maximum number of concurrent works can be high and | ||
218 | * concurrency isn't really necessary. Limit it to 1. | ||
219 | */ | ||
220 | @@ -4568,67 +4688,21 @@ restore_opts: | ||
221 | return err; | ||
222 | } | ||
223 | |||
224 | -/* | ||
225 | - * Note: calculating the overhead so we can be compatible with | ||
226 | - * historical BSD practice is quite difficult in the face of | ||
227 | - * clusters/bigalloc. This is because multiple metadata blocks from | ||
228 | - * different block group can end up in the same allocation cluster. | ||
229 | - * Calculating the exact overhead in the face of clustered allocation | ||
230 | - * requires either O(all block bitmaps) in memory or O(number of block | ||
231 | - * groups**2) in time. We will still calculate the superblock for | ||
232 | - * older file systems --- and if we come across with a bigalloc file | ||
233 | - * system with zero in s_overhead_clusters the estimate will be close to | ||
234 | - * correct especially for very large cluster sizes --- but for newer | ||
235 | - * file systems, it's better to calculate this figure once at mkfs | ||
236 | - * time, and store it in the superblock. If the superblock value is | ||
237 | - * present (even for non-bigalloc file systems), we will use it. | ||
238 | - */ | ||
239 | static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf) | ||
240 | { | ||
241 | struct super_block *sb = dentry->d_sb; | ||
242 | struct ext4_sb_info *sbi = EXT4_SB(sb); | ||
243 | struct ext4_super_block *es = sbi->s_es; | ||
244 | - struct ext4_group_desc *gdp; | ||
245 | + ext4_fsblk_t overhead = 0; | ||
246 | u64 fsid; | ||
247 | s64 bfree; | ||
248 | |||
249 | - if (test_opt(sb, MINIX_DF)) { | ||
250 | - sbi->s_overhead_last = 0; | ||
251 | - } else if (es->s_overhead_clusters) { | ||
252 | - sbi->s_overhead_last = le32_to_cpu(es->s_overhead_clusters); | ||
253 | - } else if (sbi->s_blocks_last != ext4_blocks_count(es)) { | ||
254 | - ext4_group_t i, ngroups = ext4_get_groups_count(sb); | ||
255 | - ext4_fsblk_t overhead = 0; | ||
256 | - | ||
257 | - /* | ||
258 | - * Compute the overhead (FS structures). This is constant | ||
259 | - * for a given filesystem unless the number of block groups | ||
260 | - * changes so we cache the previous value until it does. | ||
261 | - */ | ||
262 | - | ||
263 | - /* | ||
264 | - * All of the blocks before first_data_block are | ||
265 | - * overhead | ||
266 | - */ | ||
267 | - overhead = EXT4_B2C(sbi, le32_to_cpu(es->s_first_data_block)); | ||
268 | - | ||
269 | - /* | ||
270 | - * Add the overhead found in each block group | ||
271 | - */ | ||
272 | - for (i = 0; i < ngroups; i++) { | ||
273 | - gdp = ext4_get_group_desc(sb, i, NULL); | ||
274 | - overhead += ext4_num_overhead_clusters(sb, i, gdp); | ||
275 | - cond_resched(); | ||
276 | - } | ||
277 | - sbi->s_overhead_last = overhead; | ||
278 | - smp_wmb(); | ||
279 | - sbi->s_blocks_last = ext4_blocks_count(es); | ||
280 | - } | ||
281 | + if (!test_opt(sb, MINIX_DF)) | ||
282 | + overhead = sbi->s_overhead; | ||
283 | |||
284 | buf->f_type = EXT4_SUPER_MAGIC; | ||
285 | buf->f_bsize = sb->s_blocksize; | ||
286 | - buf->f_blocks = (ext4_blocks_count(es) - | ||
287 | - EXT4_C2B(sbi, sbi->s_overhead_last)); | ||
288 | + buf->f_blocks = ext4_blocks_count(es) - EXT4_C2B(sbi, sbi->s_overhead); | ||
289 | bfree = percpu_counter_sum_positive(&sbi->s_freeclusters_counter) - | ||
290 | percpu_counter_sum_positive(&sbi->s_dirtyclusters_counter); | ||
291 | /* prevent underflow in case that few free space is available */ | ||
292 | -- | ||
293 | 1.7.7.6 | ||
294 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0035-udf-Improve-table-length-check-to-avoid-possible-ove.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0035-udf-Improve-table-length-check-to-avoid-possible-ove.patch new file mode 100644 index 00000000..2548a59d --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0035-udf-Improve-table-length-check-to-avoid-possible-ove.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From 27f12e5bea3378be70c81b258660fcaa44496cb4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jan Kara <jack@suse.cz> | ||
3 | Date: Tue, 10 Jul 2012 17:58:04 +0200 | ||
4 | Subject: [PATCH 35/73] udf: Improve table length check to avoid possible | ||
5 | overflow | ||
6 | |||
7 | commit 57b9655d01ef057a523e810d29c37ac09b80eead upstream. | ||
8 | |||
9 | When a partition table length is corrupted to be close to 1 << 32, the | ||
10 | check for its length may overflow on 32-bit systems and we will think | ||
11 | the length is valid. Later on the kernel can crash trying to read beyond | ||
12 | end of buffer. Fix the check to avoid possible overflow. | ||
13 | |||
14 | Reported-by: Ben Hutchings <ben@decadent.org.uk> | ||
15 | Signed-off-by: Jan Kara <jack@suse.cz> | ||
16 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
17 | --- | ||
18 | fs/udf/super.c | 2 +- | ||
19 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
20 | |||
21 | diff --git a/fs/udf/super.c b/fs/udf/super.c | ||
22 | index 270e135..516b7f0 100644 | ||
23 | --- a/fs/udf/super.c | ||
24 | +++ b/fs/udf/super.c | ||
25 | @@ -1285,7 +1285,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, | ||
26 | BUG_ON(ident != TAG_IDENT_LVD); | ||
27 | lvd = (struct logicalVolDesc *)bh->b_data; | ||
28 | table_len = le32_to_cpu(lvd->mapTableLength); | ||
29 | - if (sizeof(*lvd) + table_len > sb->s_blocksize) { | ||
30 | + if (table_len > sb->s_blocksize - sizeof(*lvd)) { | ||
31 | udf_err(sb, "error loading logical volume descriptor: " | ||
32 | "Partition table too long (%u > %lu)\n", table_len, | ||
33 | sb->s_blocksize - sizeof(*lvd)); | ||
34 | -- | ||
35 | 1.7.7.6 | ||
36 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0036-powerpc-Add-memory-attribute-for-mfmsr.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0036-powerpc-Add-memory-attribute-for-mfmsr.patch new file mode 100644 index 00000000..f6315644 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0036-powerpc-Add-memory-attribute-for-mfmsr.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 3fed281f20c3b2cdfe1a1f087973b0c0e3b4cd05 Mon Sep 17 00:00:00 2001 | ||
2 | From: Tiejun Chen <tiejun.chen@windriver.com> | ||
3 | Date: Wed, 11 Jul 2012 14:22:46 +1000 | ||
4 | Subject: [PATCH 36/73] powerpc: Add "memory" attribute for mfmsr() | ||
5 | |||
6 | commit b416c9a10baae6a177b4f9ee858b8d309542fbef upstream. | ||
7 | |||
8 | Add "memory" attribute in inline assembly language as a compiler | ||
9 | barrier to make sure 4.6.x GCC don't reorder mfmsr(). | ||
10 | |||
11 | Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com> | ||
12 | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> | ||
13 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
14 | --- | ||
15 | arch/powerpc/include/asm/reg.h | 3 ++- | ||
16 | 1 files changed, 2 insertions(+), 1 deletions(-) | ||
17 | |||
18 | diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h | ||
19 | index 559da19..578e5a0 100644 | ||
20 | --- a/arch/powerpc/include/asm/reg.h | ||
21 | +++ b/arch/powerpc/include/asm/reg.h | ||
22 | @@ -1016,7 +1016,8 @@ | ||
23 | /* Macros for setting and retrieving special purpose registers */ | ||
24 | #ifndef __ASSEMBLY__ | ||
25 | #define mfmsr() ({unsigned long rval; \ | ||
26 | - asm volatile("mfmsr %0" : "=r" (rval)); rval;}) | ||
27 | + asm volatile("mfmsr %0" : "=r" (rval) : \ | ||
28 | + : "memory"); rval;}) | ||
29 | #ifdef CONFIG_PPC_BOOK3S_64 | ||
30 | #define __mtmsrd(v, l) asm volatile("mtmsrd %0," __stringify(l) \ | ||
31 | : : "r" (v) : "memory") | ||
32 | -- | ||
33 | 1.7.7.6 | ||
34 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0037-mwifiex-correction-in-mcs-index-check.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0037-mwifiex-correction-in-mcs-index-check.patch new file mode 100644 index 00000000..5934302b --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0037-mwifiex-correction-in-mcs-index-check.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From 10c6ca210b55595833c5b18def07f077947fa88d Mon Sep 17 00:00:00 2001 | ||
2 | From: Amitkumar Karwar <akarwar@marvell.com> | ||
3 | Date: Wed, 11 Jul 2012 18:12:57 -0700 | ||
4 | Subject: [PATCH 37/73] mwifiex: correction in mcs index check | ||
5 | |||
6 | commit fe020120cb863ba918c6d603345342a880272c4d upstream. | ||
7 | |||
8 | mwifiex driver supports 2x2 chips as well. Hence valid mcs values | ||
9 | are 0 to 15. The check for mcs index is corrected in this patch. | ||
10 | |||
11 | For example: if 40MHz is enabled and mcs index is 11, "iw link" | ||
12 | command would show "tx bitrate: 108.0 MBit/s" without this patch. | ||
13 | Now it shows "tx bitrate: 108.0 MBit/s MCS 11 40Mhz" with the patch. | ||
14 | |||
15 | Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> | ||
16 | Signed-off-by: Bing Zhao <bzhao@marvell.com> | ||
17 | Signed-off-by: John W. Linville <linville@tuxdriver.com> | ||
18 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
19 | --- | ||
20 | drivers/net/wireless/mwifiex/cfg80211.c | 4 ++-- | ||
21 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
22 | |||
23 | diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c | ||
24 | index 01dcb1a..727c129 100644 | ||
25 | --- a/drivers/net/wireless/mwifiex/cfg80211.c | ||
26 | +++ b/drivers/net/wireless/mwifiex/cfg80211.c | ||
27 | @@ -545,9 +545,9 @@ mwifiex_dump_station_info(struct mwifiex_private *priv, | ||
28 | |||
29 | /* | ||
30 | * Bit 0 in tx_htinfo indicates that current Tx rate is 11n rate. Valid | ||
31 | - * MCS index values for us are 0 to 7. | ||
32 | + * MCS index values for us are 0 to 15. | ||
33 | */ | ||
34 | - if ((priv->tx_htinfo & BIT(0)) && (priv->tx_rate < 8)) { | ||
35 | + if ((priv->tx_htinfo & BIT(0)) && (priv->tx_rate < 16)) { | ||
36 | sinfo->txrate.mcs = priv->tx_rate; | ||
37 | sinfo->txrate.flags |= RATE_INFO_FLAGS_MCS; | ||
38 | /* 40MHz rate */ | ||
39 | -- | ||
40 | 1.7.7.6 | ||
41 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0038-USB-option-Ignore-ZTE-Vodafone-K3570-71-net-interfac.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0038-USB-option-Ignore-ZTE-Vodafone-K3570-71-net-interfac.patch new file mode 100644 index 00000000..34b5fe5e --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0038-USB-option-Ignore-ZTE-Vodafone-K3570-71-net-interfac.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From 06c8b933f7ff30224a62e134cf8e5f19ee9f4975 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Andrew Bird (Sphere Systems)" <ajb@spheresystems.co.uk> | ||
3 | Date: Sun, 25 Mar 2012 00:10:28 +0000 | ||
4 | Subject: [PATCH 38/73] USB: option: Ignore ZTE (Vodafone) K3570/71 net | ||
5 | interfaces | ||
6 | |||
7 | commit f264ddea0109bf7ce8aab920d64a637e830ace5b upstream. | ||
8 | |||
9 | These interfaces need to be handled by QMI/WWAN driver | ||
10 | |||
11 | Signed-off-by: Andrew Bird <ajb@spheresystems.co.uk> | ||
12 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
13 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
14 | --- | ||
15 | drivers/usb/serial/option.c | 6 ++++-- | ||
16 | 1 files changed, 4 insertions(+), 2 deletions(-) | ||
17 | |||
18 | diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c | ||
19 | index 5971c95..6d97d2f 100644 | ||
20 | --- a/drivers/usb/serial/option.c | ||
21 | +++ b/drivers/usb/serial/option.c | ||
22 | @@ -932,8 +932,10 @@ static const struct usb_device_id option_ids[] = { | ||
23 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) }, | ||
24 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0167, 0xff, 0xff, 0xff), | ||
25 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | ||
26 | - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff) }, | ||
27 | - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff) }, | ||
28 | + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff), | ||
29 | + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | ||
30 | + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff), | ||
31 | + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | ||
32 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) }, | ||
33 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1057, 0xff, 0xff, 0xff) }, | ||
34 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1058, 0xff, 0xff, 0xff) }, | ||
35 | -- | ||
36 | 1.7.7.6 | ||
37 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0039-USB-option-add-ZTE-MF821D.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0039-USB-option-add-ZTE-MF821D.patch new file mode 100644 index 00000000..a9a075d0 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0039-USB-option-add-ZTE-MF821D.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From da7998e23b2a112f2134db067ed2b1d5593113fb Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no> | ||
3 | Date: Thu, 12 Jul 2012 12:37:32 +0200 | ||
4 | Subject: [PATCH 39/73] USB: option: add ZTE MF821D | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | commit 09110529780890804b22e997ae6b4fe3f0b3b158 upstream. | ||
10 | |||
11 | Sold by O2 (telefonica germany) under the name "LTE4G" | ||
12 | |||
13 | Tested-by: Thomas Schäfer <tschaefer@t-online.de> | ||
14 | Signed-off-by: Bjørn Mork <bjorn@mork.no> | ||
15 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
16 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
17 | --- | ||
18 | drivers/usb/serial/option.c | 2 ++ | ||
19 | 1 files changed, 2 insertions(+), 0 deletions(-) | ||
20 | |||
21 | diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c | ||
22 | index 6d97d2f..d89aac1 100644 | ||
23 | --- a/drivers/usb/serial/option.c | ||
24 | +++ b/drivers/usb/serial/option.c | ||
25 | @@ -932,6 +932,8 @@ static const struct usb_device_id option_ids[] = { | ||
26 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) }, | ||
27 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0167, 0xff, 0xff, 0xff), | ||
28 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | ||
29 | + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0326, 0xff, 0xff, 0xff), | ||
30 | + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | ||
31 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff), | ||
32 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | ||
33 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff), | ||
34 | -- | ||
35 | 1.7.7.6 | ||
36 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0040-target-Add-generation-of-LOGICAL-BLOCK-ADDRESS-OUT-O.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0040-target-Add-generation-of-LOGICAL-BLOCK-ADDRESS-OUT-O.patch new file mode 100644 index 00000000..9d170842 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0040-target-Add-generation-of-LOGICAL-BLOCK-ADDRESS-OUT-O.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | From 5d43c09da407f76f1dae2ec3ca08cb62051dea6f Mon Sep 17 00:00:00 2001 | ||
2 | From: Roland Dreier <roland@purestorage.com> | ||
3 | Date: Mon, 16 Jul 2012 15:34:21 -0700 | ||
4 | Subject: [PATCH 40/73] target: Add generation of LOGICAL BLOCK ADDRESS OUT OF | ||
5 | RANGE | ||
6 | |||
7 | commit e2397c704429025bc6b331a970f699e52f34283e upstream. | ||
8 | |||
9 | Many SCSI commands are defined to return a CHECK CONDITION / ILLEGAL | ||
10 | REQUEST with ASC set to LOGICAL BLOCK ADDRESS OUT OF RANGE if the | ||
11 | initiator sends a command that accesses a too-big LBA. Add an enum | ||
12 | value and case entries so that target code can return this status. | ||
13 | |||
14 | Signed-off-by: Roland Dreier <roland@purestorage.com> | ||
15 | Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> | ||
16 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
17 | --- | ||
18 | drivers/target/target_core_transport.c | 10 ++++++++++ | ||
19 | include/target/target_core_base.h | 1 + | ||
20 | 2 files changed, 11 insertions(+), 0 deletions(-) | ||
21 | |||
22 | diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c | ||
23 | index 5660916..94c03d2 100644 | ||
24 | --- a/drivers/target/target_core_transport.c | ||
25 | +++ b/drivers/target/target_core_transport.c | ||
26 | @@ -1820,6 +1820,7 @@ static void transport_generic_request_failure(struct se_cmd *cmd) | ||
27 | case TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE: | ||
28 | case TCM_UNKNOWN_MODE_PAGE: | ||
29 | case TCM_WRITE_PROTECTED: | ||
30 | + case TCM_ADDRESS_OUT_OF_RANGE: | ||
31 | case TCM_CHECK_CONDITION_ABORT_CMD: | ||
32 | case TCM_CHECK_CONDITION_UNIT_ATTENTION: | ||
33 | case TCM_CHECK_CONDITION_NOT_READY: | ||
34 | @@ -4496,6 +4497,15 @@ int transport_send_check_condition_and_sense( | ||
35 | /* WRITE PROTECTED */ | ||
36 | buffer[offset+SPC_ASC_KEY_OFFSET] = 0x27; | ||
37 | break; | ||
38 | + case TCM_ADDRESS_OUT_OF_RANGE: | ||
39 | + /* CURRENT ERROR */ | ||
40 | + buffer[offset] = 0x70; | ||
41 | + buffer[offset+SPC_ADD_SENSE_LEN_OFFSET] = 10; | ||
42 | + /* ILLEGAL REQUEST */ | ||
43 | + buffer[offset+SPC_SENSE_KEY_OFFSET] = ILLEGAL_REQUEST; | ||
44 | + /* LOGICAL BLOCK ADDRESS OUT OF RANGE */ | ||
45 | + buffer[offset+SPC_ASC_KEY_OFFSET] = 0x21; | ||
46 | + break; | ||
47 | case TCM_CHECK_CONDITION_UNIT_ATTENTION: | ||
48 | /* CURRENT ERROR */ | ||
49 | buffer[offset] = 0x70; | ||
50 | diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h | ||
51 | index 94bbec3..6ee550e 100644 | ||
52 | --- a/include/target/target_core_base.h | ||
53 | +++ b/include/target/target_core_base.h | ||
54 | @@ -157,6 +157,7 @@ enum tcm_sense_reason_table { | ||
55 | TCM_CHECK_CONDITION_UNIT_ATTENTION = 0x0e, | ||
56 | TCM_CHECK_CONDITION_NOT_READY = 0x0f, | ||
57 | TCM_RESERVATION_CONFLICT = 0x10, | ||
58 | + TCM_ADDRESS_OUT_OF_RANGE = 0x11, | ||
59 | }; | ||
60 | |||
61 | struct se_obj { | ||
62 | -- | ||
63 | 1.7.7.6 | ||
64 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0041-target-Add-range-checking-to-UNMAP-emulation.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0041-target-Add-range-checking-to-UNMAP-emulation.patch new file mode 100644 index 00000000..32404671 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0041-target-Add-range-checking-to-UNMAP-emulation.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From 43b1ce67a53720ba82fbe5dbf0a323ae761368bb Mon Sep 17 00:00:00 2001 | ||
2 | From: Roland Dreier <roland@purestorage.com> | ||
3 | Date: Mon, 16 Jul 2012 15:34:22 -0700 | ||
4 | Subject: [PATCH 41/73] target: Add range checking to UNMAP emulation | ||
5 | |||
6 | commit 2594e29865c291db162313187612cd9f14538f33 upstream. | ||
7 | |||
8 | When processing an UNMAP command, we need to make sure that the number | ||
9 | of blocks we're asked to UNMAP does not exceed our reported maximum | ||
10 | number of blocks per UNMAP, and that the range of blocks we're | ||
11 | unmapping doesn't go past the end of the device. | ||
12 | |||
13 | Signed-off-by: Roland Dreier <roland@purestorage.com> | ||
14 | Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> | ||
15 | [bwh: Backported to 3.2: adjust filename, context] | ||
16 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
17 | --- | ||
18 | drivers/target/target_core_cdb.c | 12 ++++++++++++ | ||
19 | 1 files changed, 12 insertions(+), 0 deletions(-) | ||
20 | |||
21 | diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c | ||
22 | index 93b9406..45a3ed4 100644 | ||
23 | --- a/drivers/target/target_core_cdb.c | ||
24 | +++ b/drivers/target/target_core_cdb.c | ||
25 | @@ -1145,6 +1145,18 @@ int target_emulate_unmap(struct se_task *task) | ||
26 | pr_debug("UNMAP: Using lba: %llu and range: %u\n", | ||
27 | (unsigned long long)lba, range); | ||
28 | |||
29 | + if (range > dev->se_sub_dev->se_dev_attrib.max_unmap_lba_count) { | ||
30 | + cmd->scsi_sense_reason = TCM_INVALID_PARAMETER_LIST; | ||
31 | + ret = -EINVAL; | ||
32 | + goto err; | ||
33 | + } | ||
34 | + | ||
35 | + if (lba + range > dev->transport->get_blocks(dev) + 1) { | ||
36 | + cmd->scsi_sense_reason = TCM_ADDRESS_OUT_OF_RANGE; | ||
37 | + ret = -EINVAL; | ||
38 | + goto err; | ||
39 | + } | ||
40 | + | ||
41 | ret = dev->transport->do_discard(dev, lba, range); | ||
42 | if (ret < 0) { | ||
43 | pr_err("blkdev_issue_discard() failed: %d\n", | ||
44 | -- | ||
45 | 1.7.7.6 | ||
46 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0042-target-Fix-reading-of-data-length-fields-for-UNMAP-c.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0042-target-Fix-reading-of-data-length-fields-for-UNMAP-c.patch new file mode 100644 index 00000000..0102742c --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0042-target-Fix-reading-of-data-length-fields-for-UNMAP-c.patch | |||
@@ -0,0 +1,51 @@ | |||
1 | From b31df389ada54f5b2725826cd8d9a13ace960168 Mon Sep 17 00:00:00 2001 | ||
2 | From: Roland Dreier <roland@purestorage.com> | ||
3 | Date: Mon, 16 Jul 2012 15:34:23 -0700 | ||
4 | Subject: [PATCH 42/73] target: Fix reading of data length fields for UNMAP | ||
5 | commands | ||
6 | |||
7 | commit 1a5fa4576ec8a462313c7516b31d7453481ddbe8 upstream. | ||
8 | |||
9 | The UNMAP DATA LENGTH and UNMAP BLOCK DESCRIPTOR DATA LENGTH fields | ||
10 | are in the unmap descriptor (the payload transferred to our data out | ||
11 | buffer), not in the CDB itself. Read them from the correct place in | ||
12 | target_emulated_unmap. | ||
13 | |||
14 | Signed-off-by: Roland Dreier <roland@purestorage.com> | ||
15 | Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> | ||
16 | [bwh: Backported to 3.2: adjust filename, context] | ||
17 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
18 | --- | ||
19 | drivers/target/target_core_cdb.c | 6 +++--- | ||
20 | 1 files changed, 3 insertions(+), 3 deletions(-) | ||
21 | |||
22 | diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c | ||
23 | index 45a3ed4..b1f5cf0 100644 | ||
24 | --- a/drivers/target/target_core_cdb.c | ||
25 | +++ b/drivers/target/target_core_cdb.c | ||
26 | @@ -1114,7 +1114,6 @@ int target_emulate_unmap(struct se_task *task) | ||
27 | struct se_cmd *cmd = task->task_se_cmd; | ||
28 | struct se_device *dev = cmd->se_dev; | ||
29 | unsigned char *buf, *ptr = NULL; | ||
30 | - unsigned char *cdb = &cmd->t_task_cdb[0]; | ||
31 | sector_t lba; | ||
32 | unsigned int size = cmd->data_length, range; | ||
33 | int ret = 0, offset; | ||
34 | @@ -1130,11 +1129,12 @@ int target_emulate_unmap(struct se_task *task) | ||
35 | /* First UNMAP block descriptor starts at 8 byte offset */ | ||
36 | offset = 8; | ||
37 | size -= 8; | ||
38 | - dl = get_unaligned_be16(&cdb[0]); | ||
39 | - bd_dl = get_unaligned_be16(&cdb[2]); | ||
40 | |||
41 | buf = transport_kmap_data_sg(cmd); | ||
42 | |||
43 | + dl = get_unaligned_be16(&buf[0]); | ||
44 | + bd_dl = get_unaligned_be16(&buf[2]); | ||
45 | + | ||
46 | ptr = &buf[offset]; | ||
47 | pr_debug("UNMAP: Sub: %s Using dl: %hu bd_dl: %hu size: %hu" | ||
48 | " ptr: %p\n", dev->transport->name, dl, bd_dl, size, ptr); | ||
49 | -- | ||
50 | 1.7.7.6 | ||
51 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0043-target-Fix-possible-integer-underflow-in-UNMAP-emula.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0043-target-Fix-possible-integer-underflow-in-UNMAP-emula.patch new file mode 100644 index 00000000..345d149a --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0043-target-Fix-possible-integer-underflow-in-UNMAP-emula.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | From 8d14ccd4bd5dab58984030c13a71953d396e792d Mon Sep 17 00:00:00 2001 | ||
2 | From: Roland Dreier <roland@purestorage.com> | ||
3 | Date: Mon, 16 Jul 2012 15:34:24 -0700 | ||
4 | Subject: [PATCH 43/73] target: Fix possible integer underflow in UNMAP | ||
5 | emulation | ||
6 | |||
7 | commit b7fc7f3777582dea85156a821d78a522a0c083aa upstream. | ||
8 | |||
9 | It's possible for an initiator to send us an UNMAP command with a | ||
10 | descriptor that is less than 8 bytes; in that case it's really bad for | ||
11 | us to set an unsigned int to that value, subtract 8 from it, and then | ||
12 | use that as a limit for our loop (since the value will wrap around to | ||
13 | a huge positive value). | ||
14 | |||
15 | Fix this by making size be signed and only looping if size >= 16 (ie | ||
16 | if we have at least a full descriptor available). | ||
17 | |||
18 | Also remove offset as an obfuscated name for the constant 8. | ||
19 | |||
20 | Signed-off-by: Roland Dreier <roland@purestorage.com> | ||
21 | Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> | ||
22 | [bwh: Backported to 3.2: adjust filename, context] | ||
23 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
24 | --- | ||
25 | drivers/target/target_core_cdb.c | 20 ++++++++++---------- | ||
26 | 1 files changed, 10 insertions(+), 10 deletions(-) | ||
27 | |||
28 | diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c | ||
29 | index b1f5cf0..00f0f7d 100644 | ||
30 | --- a/drivers/target/target_core_cdb.c | ||
31 | +++ b/drivers/target/target_core_cdb.c | ||
32 | @@ -1115,9 +1115,10 @@ int target_emulate_unmap(struct se_task *task) | ||
33 | struct se_device *dev = cmd->se_dev; | ||
34 | unsigned char *buf, *ptr = NULL; | ||
35 | sector_t lba; | ||
36 | - unsigned int size = cmd->data_length, range; | ||
37 | - int ret = 0, offset; | ||
38 | - unsigned short dl, bd_dl; | ||
39 | + int size = cmd->data_length; | ||
40 | + u32 range; | ||
41 | + int ret = 0; | ||
42 | + int dl, bd_dl; | ||
43 | |||
44 | if (!dev->transport->do_discard) { | ||
45 | pr_err("UNMAP emulation not supported for: %s\n", | ||
46 | @@ -1126,20 +1127,19 @@ int target_emulate_unmap(struct se_task *task) | ||
47 | return -ENOSYS; | ||
48 | } | ||
49 | |||
50 | - /* First UNMAP block descriptor starts at 8 byte offset */ | ||
51 | - offset = 8; | ||
52 | - size -= 8; | ||
53 | - | ||
54 | buf = transport_kmap_data_sg(cmd); | ||
55 | |||
56 | dl = get_unaligned_be16(&buf[0]); | ||
57 | bd_dl = get_unaligned_be16(&buf[2]); | ||
58 | |||
59 | - ptr = &buf[offset]; | ||
60 | - pr_debug("UNMAP: Sub: %s Using dl: %hu bd_dl: %hu size: %hu" | ||
61 | + size = min(size - 8, bd_dl); | ||
62 | + | ||
63 | + /* First UNMAP block descriptor starts at 8 byte offset */ | ||
64 | + ptr = &buf[8]; | ||
65 | + pr_debug("UNMAP: Sub: %s Using dl: %u bd_dl: %u size: %u" | ||
66 | " ptr: %p\n", dev->transport->name, dl, bd_dl, size, ptr); | ||
67 | |||
68 | - while (size) { | ||
69 | + while (size >= 16) { | ||
70 | lba = get_unaligned_be64(&ptr[0]); | ||
71 | range = get_unaligned_be32(&ptr[8]); | ||
72 | pr_debug("UNMAP: Using lba: %llu and range: %u\n", | ||
73 | -- | ||
74 | 1.7.7.6 | ||
75 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0044-target-Check-number-of-unmap-descriptors-against-our.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0044-target-Check-number-of-unmap-descriptors-against-our.patch new file mode 100644 index 00000000..64f87f3f --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0044-target-Check-number-of-unmap-descriptors-against-our.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 9e2f53ebf9ec64a0999669060222a8cbfae313b2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Roland Dreier <roland@purestorage.com> | ||
3 | Date: Mon, 16 Jul 2012 15:34:25 -0700 | ||
4 | Subject: [PATCH 44/73] target: Check number of unmap descriptors against our | ||
5 | limit | ||
6 | |||
7 | commit 7409a6657aebf8be74c21d0eded80709b27275cb upstream. | ||
8 | |||
9 | Fail UNMAP commands that have more than our reported limit on unmap | ||
10 | descriptors. | ||
11 | |||
12 | Signed-off-by: Roland Dreier <roland@purestorage.com> | ||
13 | Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> | ||
14 | [bwh: Backported to 3.2: adjust filename] | ||
15 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
16 | --- | ||
17 | drivers/target/target_core_cdb.c | 5 +++++ | ||
18 | 1 files changed, 5 insertions(+), 0 deletions(-) | ||
19 | |||
20 | diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c | ||
21 | index 00f0f7d..717a8d4 100644 | ||
22 | --- a/drivers/target/target_core_cdb.c | ||
23 | +++ b/drivers/target/target_core_cdb.c | ||
24 | @@ -1133,6 +1133,11 @@ int target_emulate_unmap(struct se_task *task) | ||
25 | bd_dl = get_unaligned_be16(&buf[2]); | ||
26 | |||
27 | size = min(size - 8, bd_dl); | ||
28 | + if (size / 16 > dev->se_sub_dev->se_dev_attrib.max_unmap_block_desc_count) { | ||
29 | + cmd->scsi_sense_reason = TCM_INVALID_PARAMETER_LIST; | ||
30 | + ret = -EINVAL; | ||
31 | + goto err; | ||
32 | + } | ||
33 | |||
34 | /* First UNMAP block descriptor starts at 8 byte offset */ | ||
35 | ptr = &buf[8]; | ||
36 | -- | ||
37 | 1.7.7.6 | ||
38 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0045-s390-idle-fix-sequence-handling-vs-cpu-hotplug.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0045-s390-idle-fix-sequence-handling-vs-cpu-hotplug.patch new file mode 100644 index 00000000..445cbc5e --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0045-s390-idle-fix-sequence-handling-vs-cpu-hotplug.patch | |||
@@ -0,0 +1,80 @@ | |||
1 | From 9385ba7e09e3360516f2b3c78c7d8f233dd1119f Mon Sep 17 00:00:00 2001 | ||
2 | From: Heiko Carstens <heiko.carstens@de.ibm.com> | ||
3 | Date: Fri, 13 Jul 2012 15:45:33 +0200 | ||
4 | Subject: [PATCH 45/73] s390/idle: fix sequence handling vs cpu hotplug | ||
5 | |||
6 | commit 0008204ffe85d23382d6fd0f971f3f0fbe70bae2 upstream. | ||
7 | |||
8 | The s390 idle accounting code uses a sequence counter which gets used | ||
9 | when the per cpu idle statistics get updated and read. | ||
10 | |||
11 | One assumption on read access is that only when the sequence counter is | ||
12 | even and did not change while reading all values the result is valid. | ||
13 | On cpu hotplug however the per cpu data structure gets initialized via | ||
14 | a cpu hotplug notifier on CPU_ONLINE. | ||
15 | CPU_ONLINE however is too late, since the onlined cpu is already running | ||
16 | and might access the per cpu data. Worst case is that the data structure | ||
17 | gets initialized while an idle thread is updating its idle statistics. | ||
18 | This will result in an uneven sequence counter after an update. | ||
19 | |||
20 | As a result user space tools like top, which access /proc/stat in order | ||
21 | to get idle stats, will busy loop waiting for the sequence counter to | ||
22 | become even again, which will never happen until the queried cpu will | ||
23 | update its idle statistics again. And even then the sequence counter | ||
24 | will only have an even value for a couple of cpu cycles. | ||
25 | |||
26 | Fix this by moving the initialization of the per cpu idle statistics | ||
27 | to cpu_init(). I prefer that solution in favor of changing the | ||
28 | notifier to CPU_UP_PREPARE, which would be a different solution to | ||
29 | the problem. | ||
30 | |||
31 | Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> | ||
32 | Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> | ||
33 | [bwh: Backported to 3.2: adjust context] | ||
34 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
35 | --- | ||
36 | arch/s390/kernel/processor.c | 2 ++ | ||
37 | arch/s390/kernel/smp.c | 3 --- | ||
38 | 2 files changed, 2 insertions(+), 3 deletions(-) | ||
39 | |||
40 | diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c | ||
41 | index 6e0073e..07c7bf4 100644 | ||
42 | --- a/arch/s390/kernel/processor.c | ||
43 | +++ b/arch/s390/kernel/processor.c | ||
44 | @@ -26,12 +26,14 @@ static DEFINE_PER_CPU(struct cpuid, cpu_id); | ||
45 | void __cpuinit cpu_init(void) | ||
46 | { | ||
47 | struct cpuid *id = &per_cpu(cpu_id, smp_processor_id()); | ||
48 | + struct s390_idle_data *idle = &__get_cpu_var(s390_idle); | ||
49 | |||
50 | get_cpu_id(id); | ||
51 | atomic_inc(&init_mm.mm_count); | ||
52 | current->active_mm = &init_mm; | ||
53 | BUG_ON(current->mm); | ||
54 | enter_lazy_tlb(&init_mm, current); | ||
55 | + memset(idle, 0, sizeof(*idle)); | ||
56 | } | ||
57 | |||
58 | /* | ||
59 | diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c | ||
60 | index 3ea8728..1df64a8 100644 | ||
61 | --- a/arch/s390/kernel/smp.c | ||
62 | +++ b/arch/s390/kernel/smp.c | ||
63 | @@ -1020,14 +1020,11 @@ static int __cpuinit smp_cpu_notify(struct notifier_block *self, | ||
64 | unsigned int cpu = (unsigned int)(long)hcpu; | ||
65 | struct cpu *c = &per_cpu(cpu_devices, cpu); | ||
66 | struct sys_device *s = &c->sysdev; | ||
67 | - struct s390_idle_data *idle; | ||
68 | int err = 0; | ||
69 | |||
70 | switch (action) { | ||
71 | case CPU_ONLINE: | ||
72 | case CPU_ONLINE_FROZEN: | ||
73 | - idle = &per_cpu(s390_idle, cpu); | ||
74 | - memset(idle, 0, sizeof(struct s390_idle_data)); | ||
75 | err = sysfs_create_group(&s->kobj, &cpu_online_attr_group); | ||
76 | break; | ||
77 | case CPU_DEAD: | ||
78 | -- | ||
79 | 1.7.7.6 | ||
80 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0046-rtlwifi-rtl8192de-Fix-phy-based-version-calculation.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0046-rtlwifi-rtl8192de-Fix-phy-based-version-calculation.patch new file mode 100644 index 00000000..e52f4d78 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0046-rtlwifi-rtl8192de-Fix-phy-based-version-calculation.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From fccb712c5ec20bb379e0c57e6a8b286e117ee2db Mon Sep 17 00:00:00 2001 | ||
2 | From: Forest Bond <forest.bond@rapidrollout.com> | ||
3 | Date: Fri, 13 Jul 2012 12:26:06 -0400 | ||
4 | Subject: [PATCH 46/73] rtlwifi: rtl8192de: Fix phy-based version calculation | ||
5 | |||
6 | commit f1b00f4dab29b57bdf1bc03ef12020b280fd2a72 upstream. | ||
7 | |||
8 | Commit d83579e2a50ac68389e6b4c58b845c702cf37516 incorporated some | ||
9 | changes from the vendor driver that made it newly important that the | ||
10 | calculated hardware version correctly include the CHIP_92D bit, as all | ||
11 | of the IS_92D_* macros were changed to depend on it. However, this bit | ||
12 | was being unset for dual-mac, dual-phy devices. The vendor driver | ||
13 | behavior was modified to not do this, but unfortunately this change was | ||
14 | not picked up along with the others. This caused scanning in the 2.4GHz | ||
15 | band to be broken, and possibly other bugs as well. | ||
16 | |||
17 | This patch brings the version calculation logic in parity with the | ||
18 | vendor driver in this regard, and in doing so fixes the regression. | ||
19 | However, the version calculation code in general continues to be largely | ||
20 | incoherent and messy, and needs to be cleaned up. | ||
21 | |||
22 | Signed-off-by: Forest Bond <forest.bond@rapidrollout.com> | ||
23 | Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> | ||
24 | Signed-off-by: John W. Linville <linville@tuxdriver.com> | ||
25 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
26 | --- | ||
27 | drivers/net/wireless/rtlwifi/rtl8192de/phy.c | 6 +++--- | ||
28 | 1 files changed, 3 insertions(+), 3 deletions(-) | ||
29 | |||
30 | diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/rtlwifi/rtl8192de/phy.c | ||
31 | index 2cf4c5f..de9faa9 100644 | ||
32 | --- a/drivers/net/wireless/rtlwifi/rtl8192de/phy.c | ||
33 | +++ b/drivers/net/wireless/rtlwifi/rtl8192de/phy.c | ||
34 | @@ -3462,21 +3462,21 @@ void rtl92d_phy_config_macphymode_info(struct ieee80211_hw *hw) | ||
35 | switch (rtlhal->macphymode) { | ||
36 | case DUALMAC_SINGLEPHY: | ||
37 | rtlphy->rf_type = RF_2T2R; | ||
38 | - rtlhal->version |= CHIP_92D_SINGLEPHY; | ||
39 | + rtlhal->version |= RF_TYPE_2T2R; | ||
40 | rtlhal->bandset = BAND_ON_BOTH; | ||
41 | rtlhal->current_bandtype = BAND_ON_2_4G; | ||
42 | break; | ||
43 | |||
44 | case SINGLEMAC_SINGLEPHY: | ||
45 | rtlphy->rf_type = RF_2T2R; | ||
46 | - rtlhal->version |= CHIP_92D_SINGLEPHY; | ||
47 | + rtlhal->version |= RF_TYPE_2T2R; | ||
48 | rtlhal->bandset = BAND_ON_BOTH; | ||
49 | rtlhal->current_bandtype = BAND_ON_2_4G; | ||
50 | break; | ||
51 | |||
52 | case DUALMAC_DUALPHY: | ||
53 | rtlphy->rf_type = RF_1T1R; | ||
54 | - rtlhal->version &= (~CHIP_92D_SINGLEPHY); | ||
55 | + rtlhal->version &= RF_TYPE_1T1R; | ||
56 | /* Now we let MAC0 run on 5G band. */ | ||
57 | if (rtlhal->interfaceindex == 0) { | ||
58 | rtlhal->bandset = BAND_ON_5G; | ||
59 | -- | ||
60 | 1.7.7.6 | ||
61 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0047-workqueue-perform-cpu-down-operations-from-low-prior.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0047-workqueue-perform-cpu-down-operations-from-low-prior.patch new file mode 100644 index 00000000..772eafb5 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0047-workqueue-perform-cpu-down-operations-from-low-prior.patch | |||
@@ -0,0 +1,120 @@ | |||
1 | From 47ba7731c120a3ed09336d18b85493bd85d926f2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Tejun Heo <tj@kernel.org> | ||
3 | Date: Tue, 17 Jul 2012 12:39:26 -0700 | ||
4 | Subject: [PATCH 47/73] workqueue: perform cpu down operations from low | ||
5 | priority cpu_notifier() | ||
6 | |||
7 | commit 6575820221f7a4dd6eadecf7bf83cdd154335eda upstream. | ||
8 | |||
9 | Currently, all workqueue cpu hotplug operations run off | ||
10 | CPU_PRI_WORKQUEUE which is higher than normal notifiers. This is to | ||
11 | ensure that workqueue is up and running while bringing up a CPU before | ||
12 | other notifiers try to use workqueue on the CPU. | ||
13 | |||
14 | Per-cpu workqueues are supposed to remain working and bound to the CPU | ||
15 | for normal CPU_DOWN_PREPARE notifiers. This holds mostly true even | ||
16 | with workqueue offlining running with higher priority because | ||
17 | workqueue CPU_DOWN_PREPARE only creates a bound trustee thread which | ||
18 | runs the per-cpu workqueue without concurrency management without | ||
19 | explicitly detaching the existing workers. | ||
20 | |||
21 | However, if the trustee needs to create new workers, it creates | ||
22 | unbound workers which may wander off to other CPUs while | ||
23 | CPU_DOWN_PREPARE notifiers are in progress. Furthermore, if the CPU | ||
24 | down is cancelled, the per-CPU workqueue may end up with workers which | ||
25 | aren't bound to the CPU. | ||
26 | |||
27 | While reliably reproducible with a convoluted artificial test-case | ||
28 | involving scheduling and flushing CPU burning work items from CPU down | ||
29 | notifiers, this isn't very likely to happen in the wild, and, even | ||
30 | when it happens, the effects are likely to be hidden by the following | ||
31 | successful CPU down. | ||
32 | |||
33 | Fix it by using different priorities for up and down notifiers - high | ||
34 | priority for up operations and low priority for down operations. | ||
35 | |||
36 | Workqueue cpu hotplug operations will soon go through further cleanup. | ||
37 | |||
38 | Signed-off-by: Tejun Heo <tj@kernel.org> | ||
39 | Acked-by: "Rafael J. Wysocki" <rjw@sisk.pl> | ||
40 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
41 | --- | ||
42 | include/linux/cpu.h | 5 +++-- | ||
43 | kernel/workqueue.c | 38 +++++++++++++++++++++++++++++++++++++- | ||
44 | 2 files changed, 40 insertions(+), 3 deletions(-) | ||
45 | |||
46 | diff --git a/include/linux/cpu.h b/include/linux/cpu.h | ||
47 | index 6cb60fd..c692acc 100644 | ||
48 | --- a/include/linux/cpu.h | ||
49 | +++ b/include/linux/cpu.h | ||
50 | @@ -66,8 +66,9 @@ enum { | ||
51 | /* migration should happen before other stuff but after perf */ | ||
52 | CPU_PRI_PERF = 20, | ||
53 | CPU_PRI_MIGRATION = 10, | ||
54 | - /* prepare workqueues for other notifiers */ | ||
55 | - CPU_PRI_WORKQUEUE = 5, | ||
56 | + /* bring up workqueues before normal notifiers and down after */ | ||
57 | + CPU_PRI_WORKQUEUE_UP = 5, | ||
58 | + CPU_PRI_WORKQUEUE_DOWN = -5, | ||
59 | }; | ||
60 | |||
61 | #define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */ | ||
62 | diff --git a/kernel/workqueue.c b/kernel/workqueue.c | ||
63 | index 7947e16..a650bee 100644 | ||
64 | --- a/kernel/workqueue.c | ||
65 | +++ b/kernel/workqueue.c | ||
66 | @@ -3586,6 +3586,41 @@ static int __devinit workqueue_cpu_callback(struct notifier_block *nfb, | ||
67 | return notifier_from_errno(0); | ||
68 | } | ||
69 | |||
70 | +/* | ||
71 | + * Workqueues should be brought up before normal priority CPU notifiers. | ||
72 | + * This will be registered high priority CPU notifier. | ||
73 | + */ | ||
74 | +static int __devinit workqueue_cpu_up_callback(struct notifier_block *nfb, | ||
75 | + unsigned long action, | ||
76 | + void *hcpu) | ||
77 | +{ | ||
78 | + switch (action & ~CPU_TASKS_FROZEN) { | ||
79 | + case CPU_UP_PREPARE: | ||
80 | + case CPU_UP_CANCELED: | ||
81 | + case CPU_DOWN_FAILED: | ||
82 | + case CPU_ONLINE: | ||
83 | + return workqueue_cpu_callback(nfb, action, hcpu); | ||
84 | + } | ||
85 | + return NOTIFY_OK; | ||
86 | +} | ||
87 | + | ||
88 | +/* | ||
89 | + * Workqueues should be brought down after normal priority CPU notifiers. | ||
90 | + * This will be registered as low priority CPU notifier. | ||
91 | + */ | ||
92 | +static int __devinit workqueue_cpu_down_callback(struct notifier_block *nfb, | ||
93 | + unsigned long action, | ||
94 | + void *hcpu) | ||
95 | +{ | ||
96 | + switch (action & ~CPU_TASKS_FROZEN) { | ||
97 | + case CPU_DOWN_PREPARE: | ||
98 | + case CPU_DYING: | ||
99 | + case CPU_POST_DEAD: | ||
100 | + return workqueue_cpu_callback(nfb, action, hcpu); | ||
101 | + } | ||
102 | + return NOTIFY_OK; | ||
103 | +} | ||
104 | + | ||
105 | #ifdef CONFIG_SMP | ||
106 | |||
107 | struct work_for_cpu { | ||
108 | @@ -3779,7 +3814,8 @@ static int __init init_workqueues(void) | ||
109 | unsigned int cpu; | ||
110 | int i; | ||
111 | |||
112 | - cpu_notifier(workqueue_cpu_callback, CPU_PRI_WORKQUEUE); | ||
113 | + cpu_notifier(workqueue_cpu_up_callback, CPU_PRI_WORKQUEUE_UP); | ||
114 | + cpu_notifier(workqueue_cpu_down_callback, CPU_PRI_WORKQUEUE_DOWN); | ||
115 | |||
116 | /* initialize gcwqs */ | ||
117 | for_each_gcwq_cpu(cpu) { | ||
118 | -- | ||
119 | 1.7.7.6 | ||
120 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0048-ALSA-hda-Add-support-for-Realtek-ALC282.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0048-ALSA-hda-Add-support-for-Realtek-ALC282.patch new file mode 100644 index 00000000..cabf58f3 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0048-ALSA-hda-Add-support-for-Realtek-ALC282.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 1438a7338f8ea623f9cfc21c6201ad48273caf12 Mon Sep 17 00:00:00 2001 | ||
2 | From: David Henningsson <david.henningsson@canonical.com> | ||
3 | Date: Wed, 18 Jul 2012 07:38:46 +0200 | ||
4 | Subject: [PATCH 48/73] ALSA: hda - Add support for Realtek ALC282 | ||
5 | |||
6 | commit 4e01ec636e64707d202a1ca21a47bbc6d53085b7 upstream. | ||
7 | |||
8 | This codec has a separate dmic path (separate dmic only ADC), | ||
9 | and thus it looks mostly like ALC275. | ||
10 | |||
11 | BugLink: https://bugs.launchpad.net/bugs/1025377 | ||
12 | Tested-by: Ray Chen <ray.chen@canonical.com> | ||
13 | Signed-off-by: David Henningsson <david.henningsson@canonical.com> | ||
14 | Signed-off-by: Takashi Iwai <tiwai@suse.de> | ||
15 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
16 | --- | ||
17 | sound/pci/hda/patch_realtek.c | 1 + | ||
18 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
19 | |||
20 | diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c | ||
21 | index 5f096a5..191fd78 100644 | ||
22 | --- a/sound/pci/hda/patch_realtek.c | ||
23 | +++ b/sound/pci/hda/patch_realtek.c | ||
24 | @@ -5989,6 +5989,7 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = { | ||
25 | { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 }, | ||
26 | { .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 }, | ||
27 | { .id = 0x10ec0280, .name = "ALC280", .patch = patch_alc269 }, | ||
28 | + { .id = 0x10ec0282, .name = "ALC282", .patch = patch_alc269 }, | ||
29 | { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", | ||
30 | .patch = patch_alc861 }, | ||
31 | { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd }, | ||
32 | -- | ||
33 | 1.7.7.6 | ||
34 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0049-iommu-amd-Fix-hotplug-with-iommu-pt.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0049-iommu-amd-Fix-hotplug-with-iommu-pt.patch new file mode 100644 index 00000000..879ea879 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0049-iommu-amd-Fix-hotplug-with-iommu-pt.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From 05f62dd05ef7d48fc3f9a778a5413ebcc8dc681f Mon Sep 17 00:00:00 2001 | ||
2 | From: Joerg Roedel <joerg.roedel@amd.com> | ||
3 | Date: Thu, 19 Jul 2012 13:42:54 +0200 | ||
4 | Subject: [PATCH 49/73] iommu/amd: Fix hotplug with iommu=pt | ||
5 | |||
6 | commit 2c9195e990297068d0f1f1bd8e2f1d09538009da upstream. | ||
7 | |||
8 | This did not work because devices are not put into the | ||
9 | pt_domain. Fix this. | ||
10 | |||
11 | Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> | ||
12 | [bwh: Backported to 3.2: do not use iommu_dev_data::passthrough] | ||
13 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
14 | --- | ||
15 | drivers/iommu/amd_iommu.c | 10 ++++++---- | ||
16 | 1 files changed, 6 insertions(+), 4 deletions(-) | ||
17 | |||
18 | diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c | ||
19 | index a1b8caa..0f074e0 100644 | ||
20 | --- a/drivers/iommu/amd_iommu.c | ||
21 | +++ b/drivers/iommu/amd_iommu.c | ||
22 | @@ -1865,6 +1865,11 @@ static int device_change_notifier(struct notifier_block *nb, | ||
23 | |||
24 | iommu_init_device(dev); | ||
25 | |||
26 | + if (iommu_pass_through) { | ||
27 | + attach_device(dev, pt_domain); | ||
28 | + break; | ||
29 | + } | ||
30 | + | ||
31 | domain = domain_for_device(dev); | ||
32 | |||
33 | /* allocate a protection domain if a device is added */ | ||
34 | @@ -1880,10 +1885,7 @@ static int device_change_notifier(struct notifier_block *nb, | ||
35 | list_add_tail(&dma_domain->list, &iommu_pd_list); | ||
36 | spin_unlock_irqrestore(&iommu_pd_list_lock, flags); | ||
37 | |||
38 | - if (!iommu_pass_through) | ||
39 | - dev->archdata.dma_ops = &amd_iommu_dma_ops; | ||
40 | - else | ||
41 | - dev->archdata.dma_ops = &nommu_dma_ops; | ||
42 | + dev->archdata.dma_ops = &amd_iommu_dma_ops; | ||
43 | |||
44 | break; | ||
45 | case BUS_NOTIFY_DEL_DEVICE: | ||
46 | -- | ||
47 | 1.7.7.6 | ||
48 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0050-drm-radeon-Try-harder-to-avoid-HW-cursor-ending-on-a.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0050-drm-radeon-Try-harder-to-avoid-HW-cursor-ending-on-a.patch new file mode 100644 index 00000000..7b500ec1 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0050-drm-radeon-Try-harder-to-avoid-HW-cursor-ending-on-a.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From c5666fb07de9499337e69ebde032d9cbcad7e418 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com> | ||
3 | Date: Tue, 17 Jul 2012 19:02:09 +0200 | ||
4 | Subject: [PATCH 50/73] drm/radeon: Try harder to avoid HW cursor ending on a | ||
5 | multiple of 128 columns. | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | commit f60ec4c7df043df81e62891ac45383d012afe0da upstream. | ||
11 | |||
12 | This could previously fail if either of the enabled displays was using a | ||
13 | horizontal resolution that is a multiple of 128, and only the leftmost column | ||
14 | of the cursor was (supposed to be) visible at the right edge of that display. | ||
15 | |||
16 | The solution is to move the cursor one pixel to the left in that case. | ||
17 | |||
18 | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33183 | ||
19 | |||
20 | Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> | ||
21 | Reviewed-by: Alex Deucher <alexander.deucher@amd.com> | ||
22 | Signed-off-by: Dave Airlie <airlied@redhat.com> | ||
23 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
24 | --- | ||
25 | drivers/gpu/drm/radeon/radeon_cursor.c | 8 +++++++- | ||
26 | 1 files changed, 7 insertions(+), 1 deletions(-) | ||
27 | |||
28 | diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c | ||
29 | index 986d608..2132109 100644 | ||
30 | --- a/drivers/gpu/drm/radeon/radeon_cursor.c | ||
31 | +++ b/drivers/gpu/drm/radeon/radeon_cursor.c | ||
32 | @@ -257,8 +257,14 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc, | ||
33 | if (!(cursor_end & 0x7f)) | ||
34 | w--; | ||
35 | } | ||
36 | - if (w <= 0) | ||
37 | + if (w <= 0) { | ||
38 | w = 1; | ||
39 | + cursor_end = x - xorigin + w; | ||
40 | + if (!(cursor_end & 0x7f)) { | ||
41 | + x--; | ||
42 | + WARN_ON_ONCE(x < 0); | ||
43 | + } | ||
44 | + } | ||
45 | } | ||
46 | } | ||
47 | |||
48 | -- | ||
49 | 1.7.7.6 | ||
50 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0051-ALSA-hda-Turn-on-PIN_OUT-from-hdmi-playback-prepare.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0051-ALSA-hda-Turn-on-PIN_OUT-from-hdmi-playback-prepare.patch new file mode 100644 index 00000000..fce75146 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0051-ALSA-hda-Turn-on-PIN_OUT-from-hdmi-playback-prepare.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | From d9c222f79d4fa6da0c113afe452968a2f0d226f4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Dylan Reid <dgreid@chromium.org> | ||
3 | Date: Thu, 19 Jul 2012 17:52:58 -0700 | ||
4 | Subject: [PATCH 51/73] ALSA: hda - Turn on PIN_OUT from hdmi playback | ||
5 | prepare. | ||
6 | |||
7 | commit 9e76e6d031482194a5b24d8e9ab88063fbd6b4b5 upstream. | ||
8 | |||
9 | Turn on the pin widget's PIN_OUT bit from playback prepare. The pin is | ||
10 | enabled in open, but is disabled in hdmi_init_pin which is called during | ||
11 | system resume. This causes a system suspend/resume during playback to | ||
12 | mute HDMI/DP. Enabling the pin in prepare instead of open allows calling | ||
13 | snd_pcm_prepare after a system resume to restore audio. | ||
14 | |||
15 | Signed-off-by: Dylan Reid <dgreid@chromium.org> | ||
16 | Signed-off-by: Takashi Iwai <tiwai@suse.de> | ||
17 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
18 | --- | ||
19 | sound/pci/hda/patch_hdmi.c | 12 ++++++------ | ||
20 | 1 files changed, 6 insertions(+), 6 deletions(-) | ||
21 | |||
22 | diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c | ||
23 | index c505fd5..c119f33 100644 | ||
24 | --- a/sound/pci/hda/patch_hdmi.c | ||
25 | +++ b/sound/pci/hda/patch_hdmi.c | ||
26 | @@ -868,7 +868,6 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, | ||
27 | struct hdmi_spec_per_pin *per_pin; | ||
28 | struct hdmi_eld *eld; | ||
29 | struct hdmi_spec_per_cvt *per_cvt = NULL; | ||
30 | - int pinctl; | ||
31 | |||
32 | /* Validate hinfo */ | ||
33 | pin_idx = hinfo_to_pin_index(spec, hinfo); | ||
34 | @@ -904,11 +903,6 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, | ||
35 | snd_hda_codec_write(codec, per_pin->pin_nid, 0, | ||
36 | AC_VERB_SET_CONNECT_SEL, | ||
37 | mux_idx); | ||
38 | - pinctl = snd_hda_codec_read(codec, per_pin->pin_nid, 0, | ||
39 | - AC_VERB_GET_PIN_WIDGET_CONTROL, 0); | ||
40 | - snd_hda_codec_write(codec, per_pin->pin_nid, 0, | ||
41 | - AC_VERB_SET_PIN_WIDGET_CONTROL, | ||
42 | - pinctl | PIN_OUT); | ||
43 | snd_hda_spdif_ctls_assign(codec, pin_idx, per_cvt->cvt_nid); | ||
44 | |||
45 | /* Initially set the converter's capabilities */ | ||
46 | @@ -1147,11 +1141,17 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo, | ||
47 | struct hdmi_spec *spec = codec->spec; | ||
48 | int pin_idx = hinfo_to_pin_index(spec, hinfo); | ||
49 | hda_nid_t pin_nid = spec->pins[pin_idx].pin_nid; | ||
50 | + int pinctl; | ||
51 | |||
52 | hdmi_set_channel_count(codec, cvt_nid, substream->runtime->channels); | ||
53 | |||
54 | hdmi_setup_audio_infoframe(codec, pin_idx, substream); | ||
55 | |||
56 | + pinctl = snd_hda_codec_read(codec, pin_nid, 0, | ||
57 | + AC_VERB_GET_PIN_WIDGET_CONTROL, 0); | ||
58 | + snd_hda_codec_write(codec, pin_nid, 0, | ||
59 | + AC_VERB_SET_PIN_WIDGET_CONTROL, pinctl | PIN_OUT); | ||
60 | + | ||
61 | return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format); | ||
62 | } | ||
63 | |||
64 | -- | ||
65 | 1.7.7.6 | ||
66 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0052-block-add-blk_queue_dead.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0052-block-add-blk_queue_dead.patch new file mode 100644 index 00000000..d9de19d2 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0052-block-add-blk_queue_dead.patch | |||
@@ -0,0 +1,140 @@ | |||
1 | From 964e5928138f09dc58d9d507ce51a6adccfdb7e0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Tejun Heo <tj@kernel.org> | ||
3 | Date: Wed, 14 Dec 2011 00:33:37 +0100 | ||
4 | Subject: [PATCH 52/73] block: add blk_queue_dead() | ||
5 | |||
6 | commit 34f6055c80285e4efb3f602a9119db75239744dc upstream. | ||
7 | |||
8 | There are a number of QUEUE_FLAG_DEAD tests. Add blk_queue_dead() | ||
9 | macro and use it. | ||
10 | |||
11 | This patch doesn't introduce any functional difference. | ||
12 | |||
13 | Signed-off-by: Tejun Heo <tj@kernel.org> | ||
14 | Signed-off-by: Jens Axboe <axboe@kernel.dk> | ||
15 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
16 | --- | ||
17 | block/blk-core.c | 6 +++--- | ||
18 | block/blk-exec.c | 2 +- | ||
19 | block/blk-sysfs.c | 4 ++-- | ||
20 | block/blk-throttle.c | 4 ++-- | ||
21 | block/blk.h | 2 +- | ||
22 | include/linux/blkdev.h | 1 + | ||
23 | 6 files changed, 10 insertions(+), 9 deletions(-) | ||
24 | |||
25 | diff --git a/block/blk-core.c b/block/blk-core.c | ||
26 | index 15de223..49d9e91 100644 | ||
27 | --- a/block/blk-core.c | ||
28 | +++ b/block/blk-core.c | ||
29 | @@ -607,7 +607,7 @@ EXPORT_SYMBOL(blk_init_allocated_queue); | ||
30 | |||
31 | int blk_get_queue(struct request_queue *q) | ||
32 | { | ||
33 | - if (likely(!test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) { | ||
34 | + if (likely(!blk_queue_dead(q))) { | ||
35 | kobject_get(&q->kobj); | ||
36 | return 0; | ||
37 | } | ||
38 | @@ -754,7 +754,7 @@ static struct request *get_request(struct request_queue *q, int rw_flags, | ||
39 | const bool is_sync = rw_is_sync(rw_flags) != 0; | ||
40 | int may_queue; | ||
41 | |||
42 | - if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) | ||
43 | + if (unlikely(blk_queue_dead(q))) | ||
44 | return NULL; | ||
45 | |||
46 | may_queue = elv_may_queue(q, rw_flags); | ||
47 | @@ -874,7 +874,7 @@ static struct request *get_request_wait(struct request_queue *q, int rw_flags, | ||
48 | struct io_context *ioc; | ||
49 | struct request_list *rl = &q->rq; | ||
50 | |||
51 | - if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) | ||
52 | + if (unlikely(blk_queue_dead(q))) | ||
53 | return NULL; | ||
54 | |||
55 | prepare_to_wait_exclusive(&rl->wait[is_sync], &wait, | ||
56 | diff --git a/block/blk-exec.c b/block/blk-exec.c | ||
57 | index a1ebceb..6053285 100644 | ||
58 | --- a/block/blk-exec.c | ||
59 | +++ b/block/blk-exec.c | ||
60 | @@ -50,7 +50,7 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk, | ||
61 | { | ||
62 | int where = at_head ? ELEVATOR_INSERT_FRONT : ELEVATOR_INSERT_BACK; | ||
63 | |||
64 | - if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) { | ||
65 | + if (unlikely(blk_queue_dead(q))) { | ||
66 | rq->errors = -ENXIO; | ||
67 | if (rq->end_io) | ||
68 | rq->end_io(rq, rq->errors); | ||
69 | diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c | ||
70 | index e7f9f65..f0b2ca8 100644 | ||
71 | --- a/block/blk-sysfs.c | ||
72 | +++ b/block/blk-sysfs.c | ||
73 | @@ -425,7 +425,7 @@ queue_attr_show(struct kobject *kobj, struct attribute *attr, char *page) | ||
74 | if (!entry->show) | ||
75 | return -EIO; | ||
76 | mutex_lock(&q->sysfs_lock); | ||
77 | - if (test_bit(QUEUE_FLAG_DEAD, &q->queue_flags)) { | ||
78 | + if (blk_queue_dead(q)) { | ||
79 | mutex_unlock(&q->sysfs_lock); | ||
80 | return -ENOENT; | ||
81 | } | ||
82 | @@ -447,7 +447,7 @@ queue_attr_store(struct kobject *kobj, struct attribute *attr, | ||
83 | |||
84 | q = container_of(kobj, struct request_queue, kobj); | ||
85 | mutex_lock(&q->sysfs_lock); | ||
86 | - if (test_bit(QUEUE_FLAG_DEAD, &q->queue_flags)) { | ||
87 | + if (blk_queue_dead(q)) { | ||
88 | mutex_unlock(&q->sysfs_lock); | ||
89 | return -ENOENT; | ||
90 | } | ||
91 | diff --git a/block/blk-throttle.c b/block/blk-throttle.c | ||
92 | index 4553245..5eed6a7 100644 | ||
93 | --- a/block/blk-throttle.c | ||
94 | +++ b/block/blk-throttle.c | ||
95 | @@ -310,7 +310,7 @@ static struct throtl_grp * throtl_get_tg(struct throtl_data *td) | ||
96 | struct request_queue *q = td->queue; | ||
97 | |||
98 | /* no throttling for dead queue */ | ||
99 | - if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) | ||
100 | + if (unlikely(blk_queue_dead(q))) | ||
101 | return NULL; | ||
102 | |||
103 | rcu_read_lock(); | ||
104 | @@ -335,7 +335,7 @@ static struct throtl_grp * throtl_get_tg(struct throtl_data *td) | ||
105 | spin_lock_irq(q->queue_lock); | ||
106 | |||
107 | /* Make sure @q is still alive */ | ||
108 | - if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) { | ||
109 | + if (unlikely(blk_queue_dead(q))) { | ||
110 | kfree(tg); | ||
111 | return NULL; | ||
112 | } | ||
113 | diff --git a/block/blk.h b/block/blk.h | ||
114 | index 3f6551b..e38691d 100644 | ||
115 | --- a/block/blk.h | ||
116 | +++ b/block/blk.h | ||
117 | @@ -85,7 +85,7 @@ static inline struct request *__elv_next_request(struct request_queue *q) | ||
118 | q->flush_queue_delayed = 1; | ||
119 | return NULL; | ||
120 | } | ||
121 | - if (test_bit(QUEUE_FLAG_DEAD, &q->queue_flags) || | ||
122 | + if (unlikely(blk_queue_dead(q)) || | ||
123 | !q->elevator->ops->elevator_dispatch_fn(q, 0)) | ||
124 | return NULL; | ||
125 | } | ||
126 | diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h | ||
127 | index 0ed1eb0..ff039f0 100644 | ||
128 | --- a/include/linux/blkdev.h | ||
129 | +++ b/include/linux/blkdev.h | ||
130 | @@ -481,6 +481,7 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q) | ||
131 | |||
132 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) | ||
133 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | ||
134 | +#define blk_queue_dead(q) test_bit(QUEUE_FLAG_DEAD, &(q)->queue_flags) | ||
135 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) | ||
136 | #define blk_queue_noxmerges(q) \ | ||
137 | test_bit(QUEUE_FLAG_NOXMERGES, &(q)->queue_flags) | ||
138 | -- | ||
139 | 1.7.7.6 | ||
140 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0053-Fix-device-removal-NULL-pointer-dereference.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0053-Fix-device-removal-NULL-pointer-dereference.patch new file mode 100644 index 00000000..6cf674e8 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0053-Fix-device-removal-NULL-pointer-dereference.patch | |||
@@ -0,0 +1,163 @@ | |||
1 | From 494efb27e48c4689686b72d1490e9f44fcbd08e8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bart Van Assche <bvanassche@acm.org> | ||
3 | Date: Fri, 29 Jun 2012 15:33:22 +0000 | ||
4 | Subject: [PATCH 53/73] Fix device removal NULL pointer dereference | ||
5 | |||
6 | commit 67bd94130015c507011af37858989b199c52e1de upstream. | ||
7 | |||
8 | Use blk_queue_dead() to test whether the queue is dead instead | ||
9 | of !sdev. Since scsi_prep_fn() may be invoked concurrently with | ||
10 | __scsi_remove_device(), keep the queuedata (sdev) pointer in | ||
11 | __scsi_remove_device(). This patch fixes a kernel oops that | ||
12 | can be triggered by USB device removal. See also | ||
13 | http://www.spinics.net/lists/linux-scsi/msg56254.html. | ||
14 | |||
15 | Other changes included in this patch: | ||
16 | - Swap the blk_cleanup_queue() and kfree() calls in | ||
17 | scsi_host_dev_release() to make that code easier to grasp. | ||
18 | - Remove the queue dead check from scsi_run_queue() since the | ||
19 | queue state can change anyway at any point in that function | ||
20 | where the queue lock is not held. | ||
21 | - Remove the queue dead check from the start of scsi_request_fn() | ||
22 | since it is redundant with the scsi_device_online() check. | ||
23 | |||
24 | Reported-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> | ||
25 | Signed-off-by: Bart Van Assche <bvanassche@acm.org> | ||
26 | Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> | ||
27 | Reviewed-by: Tejun Heo <tj@kernel.org> | ||
28 | Signed-off-by: James Bottomley <JBottomley@Parallels.com> | ||
29 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
30 | --- | ||
31 | drivers/scsi/hosts.c | 7 ++++--- | ||
32 | drivers/scsi/scsi_lib.c | 32 ++++---------------------------- | ||
33 | drivers/scsi/scsi_priv.h | 1 - | ||
34 | drivers/scsi/scsi_sysfs.c | 5 +---- | ||
35 | 4 files changed, 9 insertions(+), 36 deletions(-) | ||
36 | |||
37 | diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c | ||
38 | index 351dc0b..ee77a58 100644 | ||
39 | --- a/drivers/scsi/hosts.c | ||
40 | +++ b/drivers/scsi/hosts.c | ||
41 | @@ -287,6 +287,7 @@ static void scsi_host_dev_release(struct device *dev) | ||
42 | struct Scsi_Host *shost = dev_to_shost(dev); | ||
43 | struct device *parent = dev->parent; | ||
44 | struct request_queue *q; | ||
45 | + void *queuedata; | ||
46 | |||
47 | scsi_proc_hostdir_rm(shost->hostt); | ||
48 | |||
49 | @@ -296,9 +297,9 @@ static void scsi_host_dev_release(struct device *dev) | ||
50 | destroy_workqueue(shost->work_q); | ||
51 | q = shost->uspace_req_q; | ||
52 | if (q) { | ||
53 | - kfree(q->queuedata); | ||
54 | - q->queuedata = NULL; | ||
55 | - scsi_free_queue(q); | ||
56 | + queuedata = q->queuedata; | ||
57 | + blk_cleanup_queue(q); | ||
58 | + kfree(queuedata); | ||
59 | } | ||
60 | |||
61 | scsi_destroy_command_freelist(shost); | ||
62 | diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c | ||
63 | index f0ab58e..4f68ba6 100644 | ||
64 | --- a/drivers/scsi/scsi_lib.c | ||
65 | +++ b/drivers/scsi/scsi_lib.c | ||
66 | @@ -406,10 +406,6 @@ static void scsi_run_queue(struct request_queue *q) | ||
67 | LIST_HEAD(starved_list); | ||
68 | unsigned long flags; | ||
69 | |||
70 | - /* if the device is dead, sdev will be NULL, so no queue to run */ | ||
71 | - if (!sdev) | ||
72 | - return; | ||
73 | - | ||
74 | shost = sdev->host; | ||
75 | if (scsi_target(sdev)->single_lun) | ||
76 | scsi_single_lun_run(sdev); | ||
77 | @@ -1374,16 +1370,16 @@ static inline int scsi_host_queue_ready(struct request_queue *q, | ||
78 | * may be changed after request stacking drivers call the function, | ||
79 | * regardless of taking lock or not. | ||
80 | * | ||
81 | - * When scsi can't dispatch I/Os anymore and needs to kill I/Os | ||
82 | - * (e.g. !sdev), scsi needs to return 'not busy'. | ||
83 | - * Otherwise, request stacking drivers may hold requests forever. | ||
84 | + * When scsi can't dispatch I/Os anymore and needs to kill I/Os scsi | ||
85 | + * needs to return 'not busy'. Otherwise, request stacking drivers | ||
86 | + * may hold requests forever. | ||
87 | */ | ||
88 | static int scsi_lld_busy(struct request_queue *q) | ||
89 | { | ||
90 | struct scsi_device *sdev = q->queuedata; | ||
91 | struct Scsi_Host *shost; | ||
92 | |||
93 | - if (!sdev) | ||
94 | + if (blk_queue_dead(q)) | ||
95 | return 0; | ||
96 | |||
97 | shost = sdev->host; | ||
98 | @@ -1494,12 +1490,6 @@ static void scsi_request_fn(struct request_queue *q) | ||
99 | struct scsi_cmnd *cmd; | ||
100 | struct request *req; | ||
101 | |||
102 | - if (!sdev) { | ||
103 | - while ((req = blk_peek_request(q)) != NULL) | ||
104 | - scsi_kill_request(req, q); | ||
105 | - return; | ||
106 | - } | ||
107 | - | ||
108 | if(!get_device(&sdev->sdev_gendev)) | ||
109 | /* We must be tearing the block queue down already */ | ||
110 | return; | ||
111 | @@ -1701,20 +1691,6 @@ struct request_queue *scsi_alloc_queue(struct scsi_device *sdev) | ||
112 | return q; | ||
113 | } | ||
114 | |||
115 | -void scsi_free_queue(struct request_queue *q) | ||
116 | -{ | ||
117 | - unsigned long flags; | ||
118 | - | ||
119 | - WARN_ON(q->queuedata); | ||
120 | - | ||
121 | - /* cause scsi_request_fn() to kill all non-finished requests */ | ||
122 | - spin_lock_irqsave(q->queue_lock, flags); | ||
123 | - q->request_fn(q); | ||
124 | - spin_unlock_irqrestore(q->queue_lock, flags); | ||
125 | - | ||
126 | - blk_cleanup_queue(q); | ||
127 | -} | ||
128 | - | ||
129 | /* | ||
130 | * Function: scsi_block_requests() | ||
131 | * | ||
132 | diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h | ||
133 | index 5b475d0..d58adca 100644 | ||
134 | --- a/drivers/scsi/scsi_priv.h | ||
135 | +++ b/drivers/scsi/scsi_priv.h | ||
136 | @@ -85,7 +85,6 @@ extern void scsi_next_command(struct scsi_cmnd *cmd); | ||
137 | extern void scsi_io_completion(struct scsi_cmnd *, unsigned int); | ||
138 | extern void scsi_run_host_queues(struct Scsi_Host *shost); | ||
139 | extern struct request_queue *scsi_alloc_queue(struct scsi_device *sdev); | ||
140 | -extern void scsi_free_queue(struct request_queue *q); | ||
141 | extern int scsi_init_queue(void); | ||
142 | extern void scsi_exit_queue(void); | ||
143 | struct request_queue; | ||
144 | diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c | ||
145 | index 04c2a27..42c35ff 100644 | ||
146 | --- a/drivers/scsi/scsi_sysfs.c | ||
147 | +++ b/drivers/scsi/scsi_sysfs.c | ||
148 | @@ -971,11 +971,8 @@ void __scsi_remove_device(struct scsi_device *sdev) | ||
149 | sdev->host->hostt->slave_destroy(sdev); | ||
150 | transport_destroy_device(dev); | ||
151 | |||
152 | - /* cause the request function to reject all I/O requests */ | ||
153 | - sdev->request_queue->queuedata = NULL; | ||
154 | - | ||
155 | /* Freeing the queue signals to block that we're done */ | ||
156 | - scsi_free_queue(sdev->request_queue); | ||
157 | + blk_cleanup_queue(sdev->request_queue); | ||
158 | put_device(dev); | ||
159 | } | ||
160 | |||
161 | -- | ||
162 | 1.7.7.6 | ||
163 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0054-Avoid-dangling-pointer-in-scsi_requeue_command.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0054-Avoid-dangling-pointer-in-scsi_requeue_command.patch new file mode 100644 index 00000000..98e6b5b9 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0054-Avoid-dangling-pointer-in-scsi_requeue_command.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | From c24bb6a70695fb930fc0b976db55fad4334cd992 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bart Van Assche <bvanassche@acm.org> | ||
3 | Date: Fri, 29 Jun 2012 15:34:26 +0000 | ||
4 | Subject: [PATCH 54/73] Avoid dangling pointer in scsi_requeue_command() | ||
5 | |||
6 | commit 940f5d47e2f2e1fa00443921a0abf4822335b54d upstream. | ||
7 | |||
8 | When we call scsi_unprep_request() the command associated with the request | ||
9 | gets destroyed and therefore drops its reference on the device. If this was | ||
10 | the only reference, the device may get released and we end up with a NULL | ||
11 | pointer deref when we call blk_requeue_request. | ||
12 | |||
13 | Reported-by: Mike Christie <michaelc@cs.wisc.edu> | ||
14 | Signed-off-by: Bart Van Assche <bvanassche@acm.org> | ||
15 | Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> | ||
16 | Reviewed-by: Tejun Heo <tj@kernel.org> | ||
17 | [jejb: enhance commend and add commit log for stable] | ||
18 | Signed-off-by: James Bottomley <JBottomley@Parallels.com> | ||
19 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
20 | --- | ||
21 | drivers/scsi/scsi_lib.c | 11 +++++++++++ | ||
22 | 1 files changed, 11 insertions(+), 0 deletions(-) | ||
23 | |||
24 | diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c | ||
25 | index 4f68ba6..6c4b620 100644 | ||
26 | --- a/drivers/scsi/scsi_lib.c | ||
27 | +++ b/drivers/scsi/scsi_lib.c | ||
28 | @@ -479,15 +479,26 @@ void scsi_requeue_run_queue(struct work_struct *work) | ||
29 | */ | ||
30 | static void scsi_requeue_command(struct request_queue *q, struct scsi_cmnd *cmd) | ||
31 | { | ||
32 | + struct scsi_device *sdev = cmd->device; | ||
33 | struct request *req = cmd->request; | ||
34 | unsigned long flags; | ||
35 | |||
36 | + /* | ||
37 | + * We need to hold a reference on the device to avoid the queue being | ||
38 | + * killed after the unlock and before scsi_run_queue is invoked which | ||
39 | + * may happen because scsi_unprep_request() puts the command which | ||
40 | + * releases its reference on the device. | ||
41 | + */ | ||
42 | + get_device(&sdev->sdev_gendev); | ||
43 | + | ||
44 | spin_lock_irqsave(q->queue_lock, flags); | ||
45 | scsi_unprep_request(req); | ||
46 | blk_requeue_request(q, req); | ||
47 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
48 | |||
49 | scsi_run_queue(q); | ||
50 | + | ||
51 | + put_device(&sdev->sdev_gendev); | ||
52 | } | ||
53 | |||
54 | void scsi_next_command(struct scsi_cmnd *cmd) | ||
55 | -- | ||
56 | 1.7.7.6 | ||
57 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0055-fix-hot-unplug-vs-async-scan-race.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0055-fix-hot-unplug-vs-async-scan-race.patch new file mode 100644 index 00000000..9d7c97a9 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0055-fix-hot-unplug-vs-async-scan-race.patch | |||
@@ -0,0 +1,122 @@ | |||
1 | From 04ed7d216271c757e1f14ff369f5aa1908f04189 Mon Sep 17 00:00:00 2001 | ||
2 | From: Dan Williams <dan.j.williams@intel.com> | ||
3 | Date: Thu, 21 Jun 2012 23:47:28 -0700 | ||
4 | Subject: [PATCH 55/73] fix hot unplug vs async scan race | ||
5 | |||
6 | commit 3b661a92e869ebe2358de8f4b3230ad84f7fce51 upstream. | ||
7 | |||
8 | The following crash results from cases where the end_device has been | ||
9 | removed before scsi_sysfs_add_sdev has had a chance to run. | ||
10 | |||
11 | BUG: unable to handle kernel NULL pointer dereference at 0000000000000098 | ||
12 | IP: [<ffffffff8115e100>] sysfs_create_dir+0x32/0xb6 | ||
13 | ... | ||
14 | Call Trace: | ||
15 | [<ffffffff8125e4a8>] kobject_add_internal+0x120/0x1e3 | ||
16 | [<ffffffff81075149>] ? trace_hardirqs_on+0xd/0xf | ||
17 | [<ffffffff8125e641>] kobject_add_varg+0x41/0x50 | ||
18 | [<ffffffff8125e70b>] kobject_add+0x64/0x66 | ||
19 | [<ffffffff8131122b>] device_add+0x12d/0x63a | ||
20 | [<ffffffff814b65ea>] ? _raw_spin_unlock_irqrestore+0x47/0x56 | ||
21 | [<ffffffff8107de15>] ? module_refcount+0x89/0xa0 | ||
22 | [<ffffffff8132f348>] scsi_sysfs_add_sdev+0x4e/0x28a | ||
23 | [<ffffffff8132dcbb>] do_scan_async+0x9c/0x145 | ||
24 | |||
25 | ...teach scsi_sysfs_add_devices() to check for deleted devices() before | ||
26 | trying to add them, and teach scsi_remove_target() how to remove targets | ||
27 | that have not been added via device_add(). | ||
28 | |||
29 | Reported-by: Dariusz Majchrzak <dariusz.majchrzak@intel.com> | ||
30 | Signed-off-by: Dan Williams <dan.j.williams@intel.com> | ||
31 | Signed-off-by: James Bottomley <JBottomley@Parallels.com> | ||
32 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
33 | --- | ||
34 | drivers/scsi/scsi_scan.c | 3 +++ | ||
35 | drivers/scsi/scsi_sysfs.c | 41 ++++++++++++++++++++++++++--------------- | ||
36 | 2 files changed, 29 insertions(+), 15 deletions(-) | ||
37 | |||
38 | diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c | ||
39 | index 6e7ea4a..a48b59c 100644 | ||
40 | --- a/drivers/scsi/scsi_scan.c | ||
41 | +++ b/drivers/scsi/scsi_scan.c | ||
42 | @@ -1710,6 +1710,9 @@ static void scsi_sysfs_add_devices(struct Scsi_Host *shost) | ||
43 | { | ||
44 | struct scsi_device *sdev; | ||
45 | shost_for_each_device(sdev, shost) { | ||
46 | + /* target removed before the device could be added */ | ||
47 | + if (sdev->sdev_state == SDEV_DEL) | ||
48 | + continue; | ||
49 | if (!scsi_host_scan_allowed(shost) || | ||
50 | scsi_sysfs_add_sdev(sdev) != 0) | ||
51 | __scsi_remove_device(sdev); | ||
52 | diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c | ||
53 | index 42c35ff..bb7c482 100644 | ||
54 | --- a/drivers/scsi/scsi_sysfs.c | ||
55 | +++ b/drivers/scsi/scsi_sysfs.c | ||
56 | @@ -997,7 +997,6 @@ static void __scsi_remove_target(struct scsi_target *starget) | ||
57 | struct scsi_device *sdev; | ||
58 | |||
59 | spin_lock_irqsave(shost->host_lock, flags); | ||
60 | - starget->reap_ref++; | ||
61 | restart: | ||
62 | list_for_each_entry(sdev, &shost->__devices, siblings) { | ||
63 | if (sdev->channel != starget->channel || | ||
64 | @@ -1011,14 +1010,6 @@ static void __scsi_remove_target(struct scsi_target *starget) | ||
65 | goto restart; | ||
66 | } | ||
67 | spin_unlock_irqrestore(shost->host_lock, flags); | ||
68 | - scsi_target_reap(starget); | ||
69 | -} | ||
70 | - | ||
71 | -static int __remove_child (struct device * dev, void * data) | ||
72 | -{ | ||
73 | - if (scsi_is_target_device(dev)) | ||
74 | - __scsi_remove_target(to_scsi_target(dev)); | ||
75 | - return 0; | ||
76 | } | ||
77 | |||
78 | /** | ||
79 | @@ -1031,14 +1022,34 @@ static int __remove_child (struct device * dev, void * data) | ||
80 | */ | ||
81 | void scsi_remove_target(struct device *dev) | ||
82 | { | ||
83 | - if (scsi_is_target_device(dev)) { | ||
84 | - __scsi_remove_target(to_scsi_target(dev)); | ||
85 | - return; | ||
86 | + struct Scsi_Host *shost = dev_to_shost(dev->parent); | ||
87 | + struct scsi_target *starget, *found; | ||
88 | + unsigned long flags; | ||
89 | + | ||
90 | + restart: | ||
91 | + found = NULL; | ||
92 | + spin_lock_irqsave(shost->host_lock, flags); | ||
93 | + list_for_each_entry(starget, &shost->__targets, siblings) { | ||
94 | + if (starget->state == STARGET_DEL) | ||
95 | + continue; | ||
96 | + if (starget->dev.parent == dev || &starget->dev == dev) { | ||
97 | + found = starget; | ||
98 | + found->reap_ref++; | ||
99 | + break; | ||
100 | + } | ||
101 | } | ||
102 | + spin_unlock_irqrestore(shost->host_lock, flags); | ||
103 | |||
104 | - get_device(dev); | ||
105 | - device_for_each_child(dev, NULL, __remove_child); | ||
106 | - put_device(dev); | ||
107 | + if (found) { | ||
108 | + __scsi_remove_target(found); | ||
109 | + scsi_target_reap(found); | ||
110 | + /* in the case where @dev has multiple starget children, | ||
111 | + * continue removing. | ||
112 | + * | ||
113 | + * FIXME: does such a case exist? | ||
114 | + */ | ||
115 | + goto restart; | ||
116 | + } | ||
117 | } | ||
118 | EXPORT_SYMBOL(scsi_remove_target); | ||
119 | |||
120 | -- | ||
121 | 1.7.7.6 | ||
122 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0056-fix-eh-wakeup-scsi_schedule_eh-vs-scsi_restart_opera.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0056-fix-eh-wakeup-scsi_schedule_eh-vs-scsi_restart_opera.patch new file mode 100644 index 00000000..a2028644 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0056-fix-eh-wakeup-scsi_schedule_eh-vs-scsi_restart_opera.patch | |||
@@ -0,0 +1,62 @@ | |||
1 | From 3936af31e073e2eb55d8d2eee05ec10999f0dacc Mon Sep 17 00:00:00 2001 | ||
2 | From: Dan Williams <dan.j.williams@intel.com> | ||
3 | Date: Thu, 21 Jun 2012 23:25:32 -0700 | ||
4 | Subject: [PATCH 56/73] fix eh wakeup (scsi_schedule_eh vs | ||
5 | scsi_restart_operations) | ||
6 | |||
7 | commit 57fc2e335fd3c2f898ee73570dc81426c28dc7b4 upstream. | ||
8 | |||
9 | Rapid ata hotplug on a libsas controller results in cases where libsas | ||
10 | is waiting indefinitely on eh to perform an ata probe. | ||
11 | |||
12 | A race exists between scsi_schedule_eh() and scsi_restart_operations() | ||
13 | in the case when scsi_restart_operations() issues i/o to other devices | ||
14 | in the sas domain. When this happens the host state transitions from | ||
15 | SHOST_RECOVERY (set by scsi_schedule_eh) back to SHOST_RUNNING and | ||
16 | ->host_busy is non-zero so we put the eh thread to sleep even though | ||
17 | ->host_eh_scheduled is active. | ||
18 | |||
19 | Before putting the error handler to sleep we need to check if the | ||
20 | host_state needs to return to SHOST_RECOVERY for another trip through | ||
21 | eh. Since i/o that is released by scsi_restart_operations has been | ||
22 | blocked for at least one eh cycle, this implementation allows those | ||
23 | i/o's to run before another eh cycle starts to discourage hung task | ||
24 | timeouts. | ||
25 | |||
26 | Reported-by: Tom Jackson <thomas.p.jackson@intel.com> | ||
27 | Tested-by: Tom Jackson <thomas.p.jackson@intel.com> | ||
28 | Signed-off-by: Dan Williams <dan.j.williams@intel.com> | ||
29 | Signed-off-by: James Bottomley <JBottomley@Parallels.com> | ||
30 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
31 | --- | ||
32 | drivers/scsi/scsi_error.c | 14 ++++++++++++++ | ||
33 | 1 files changed, 14 insertions(+), 0 deletions(-) | ||
34 | |||
35 | diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c | ||
36 | index dc6131e..456b131 100644 | ||
37 | --- a/drivers/scsi/scsi_error.c | ||
38 | +++ b/drivers/scsi/scsi_error.c | ||
39 | @@ -1673,6 +1673,20 @@ static void scsi_restart_operations(struct Scsi_Host *shost) | ||
40 | * requests are started. | ||
41 | */ | ||
42 | scsi_run_host_queues(shost); | ||
43 | + | ||
44 | + /* | ||
45 | + * if eh is active and host_eh_scheduled is pending we need to re-run | ||
46 | + * recovery. we do this check after scsi_run_host_queues() to allow | ||
47 | + * everything pent up since the last eh run a chance to make forward | ||
48 | + * progress before we sync again. Either we'll immediately re-run | ||
49 | + * recovery or scsi_device_unbusy() will wake us again when these | ||
50 | + * pending commands complete. | ||
51 | + */ | ||
52 | + spin_lock_irqsave(shost->host_lock, flags); | ||
53 | + if (shost->host_eh_scheduled) | ||
54 | + if (scsi_host_set_state(shost, SHOST_RECOVERY)) | ||
55 | + WARN_ON(scsi_host_set_state(shost, SHOST_CANCEL_RECOVERY)); | ||
56 | + spin_unlock_irqrestore(shost->host_lock, flags); | ||
57 | } | ||
58 | |||
59 | /** | ||
60 | -- | ||
61 | 1.7.7.6 | ||
62 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0057-libsas-continue-revalidation.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0057-libsas-continue-revalidation.patch new file mode 100644 index 00000000..2a242099 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0057-libsas-continue-revalidation.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From 07925ac535d9c4f774b0ba817fece3557670013f Mon Sep 17 00:00:00 2001 | ||
2 | From: Dan Williams <dan.j.williams@intel.com> | ||
3 | Date: Thu, 21 Jun 2012 23:36:15 -0700 | ||
4 | Subject: [PATCH 57/73] libsas: continue revalidation | ||
5 | |||
6 | commit 26f2f199ff150d8876b2641c41e60d1c92d2fb81 upstream. | ||
7 | |||
8 | Continue running revalidation until no more broadcast devices are | ||
9 | discovered. Fixes cases where re-discovery completes too early in a | ||
10 | domain with multiple expanders with pending re-discovery events. | ||
11 | Servicing BCNs can get backed up behind error recovery. | ||
12 | |||
13 | Signed-off-by: Dan Williams <dan.j.williams@intel.com> | ||
14 | Signed-off-by: James Bottomley <JBottomley@Parallels.com> | ||
15 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
16 | --- | ||
17 | drivers/scsi/libsas/sas_expander.c | 8 ++++---- | ||
18 | 1 files changed, 4 insertions(+), 4 deletions(-) | ||
19 | |||
20 | diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c | ||
21 | index e48ba4b..6330110 100644 | ||
22 | --- a/drivers/scsi/libsas/sas_expander.c | ||
23 | +++ b/drivers/scsi/libsas/sas_expander.c | ||
24 | @@ -1983,9 +1983,7 @@ int sas_ex_revalidate_domain(struct domain_device *port_dev) | ||
25 | struct domain_device *dev = NULL; | ||
26 | |||
27 | res = sas_find_bcast_dev(port_dev, &dev); | ||
28 | - if (res) | ||
29 | - goto out; | ||
30 | - if (dev) { | ||
31 | + while (res == 0 && dev) { | ||
32 | struct expander_device *ex = &dev->ex_dev; | ||
33 | int i = 0, phy_id; | ||
34 | |||
35 | @@ -1997,8 +1995,10 @@ int sas_ex_revalidate_domain(struct domain_device *port_dev) | ||
36 | res = sas_rediscover(dev, phy_id); | ||
37 | i = phy_id + 1; | ||
38 | } while (i < ex->num_phys); | ||
39 | + | ||
40 | + dev = NULL; | ||
41 | + res = sas_find_bcast_dev(port_dev, &dev); | ||
42 | } | ||
43 | -out: | ||
44 | return res; | ||
45 | } | ||
46 | |||
47 | -- | ||
48 | 1.7.7.6 | ||
49 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0058-libsas-fix-sas_discover_devices-return-code-handling.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0058-libsas-fix-sas_discover_devices-return-code-handling.patch new file mode 100644 index 00000000..4542c151 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0058-libsas-fix-sas_discover_devices-return-code-handling.patch | |||
@@ -0,0 +1,128 @@ | |||
1 | From 61141b84f7a92caf6a6670396f9b2dec5345bc0e Mon Sep 17 00:00:00 2001 | ||
2 | From: Dan Williams <dan.j.williams@intel.com> | ||
3 | Date: Thu, 21 Jun 2012 23:36:20 -0700 | ||
4 | Subject: [PATCH 58/73] libsas: fix sas_discover_devices return code handling | ||
5 | |||
6 | commit b17caa174a7e1fd2e17b26e210d4ee91c4c28b37 upstream. | ||
7 | |||
8 | commit 198439e4 [SCSI] libsas: do not set res = 0 in sas_ex_discover_dev() | ||
9 | commit 19252de6 [SCSI] libsas: fix wide port hotplug issues | ||
10 | |||
11 | The above commits seem to have confused the return value of | ||
12 | sas_ex_discover_dev which is non-zero on failure and | ||
13 | sas_ex_join_wide_port which just indicates short circuiting discovery on | ||
14 | already established ports. The result is random discovery failures | ||
15 | depending on configuration. | ||
16 | |||
17 | Calls to sas_ex_join_wide_port are the source of the trouble as its | ||
18 | return value is errantly assigned to 'res'. Convert it to bool and stop | ||
19 | returning its result up the stack. | ||
20 | |||
21 | Tested-by: Dan Melnic <dan.melnic@amd.com> | ||
22 | Reported-by: Dan Melnic <dan.melnic@amd.com> | ||
23 | Signed-off-by: Dan Williams <dan.j.williams@intel.com> | ||
24 | Reviewed-by: Jack Wang <jack_wang@usish.com> | ||
25 | Signed-off-by: James Bottomley <JBottomley@Parallels.com> | ||
26 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
27 | --- | ||
28 | drivers/scsi/libsas/sas_expander.c | 39 +++++++++++------------------------ | ||
29 | 1 files changed, 12 insertions(+), 27 deletions(-) | ||
30 | |||
31 | diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c | ||
32 | index 6330110..dbe3568 100644 | ||
33 | --- a/drivers/scsi/libsas/sas_expander.c | ||
34 | +++ b/drivers/scsi/libsas/sas_expander.c | ||
35 | @@ -774,7 +774,7 @@ static struct domain_device *sas_ex_discover_end_dev( | ||
36 | } | ||
37 | |||
38 | /* See if this phy is part of a wide port */ | ||
39 | -static int sas_ex_join_wide_port(struct domain_device *parent, int phy_id) | ||
40 | +static bool sas_ex_join_wide_port(struct domain_device *parent, int phy_id) | ||
41 | { | ||
42 | struct ex_phy *phy = &parent->ex_dev.ex_phy[phy_id]; | ||
43 | int i; | ||
44 | @@ -790,11 +790,11 @@ static int sas_ex_join_wide_port(struct domain_device *parent, int phy_id) | ||
45 | sas_port_add_phy(ephy->port, phy->phy); | ||
46 | phy->port = ephy->port; | ||
47 | phy->phy_state = PHY_DEVICE_DISCOVERED; | ||
48 | - return 0; | ||
49 | + return true; | ||
50 | } | ||
51 | } | ||
52 | |||
53 | - return -ENODEV; | ||
54 | + return false; | ||
55 | } | ||
56 | |||
57 | static struct domain_device *sas_ex_discover_expander( | ||
58 | @@ -932,8 +932,7 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id) | ||
59 | return res; | ||
60 | } | ||
61 | |||
62 | - res = sas_ex_join_wide_port(dev, phy_id); | ||
63 | - if (!res) { | ||
64 | + if (sas_ex_join_wide_port(dev, phy_id)) { | ||
65 | SAS_DPRINTK("Attaching ex phy%d to wide port %016llx\n", | ||
66 | phy_id, SAS_ADDR(ex_phy->attached_sas_addr)); | ||
67 | return res; | ||
68 | @@ -978,8 +977,7 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id) | ||
69 | if (SAS_ADDR(ex->ex_phy[i].attached_sas_addr) == | ||
70 | SAS_ADDR(child->sas_addr)) { | ||
71 | ex->ex_phy[i].phy_state= PHY_DEVICE_DISCOVERED; | ||
72 | - res = sas_ex_join_wide_port(dev, i); | ||
73 | - if (!res) | ||
74 | + if (sas_ex_join_wide_port(dev, i)) | ||
75 | SAS_DPRINTK("Attaching ex phy%d to wide port %016llx\n", | ||
76 | i, SAS_ADDR(ex->ex_phy[i].attached_sas_addr)); | ||
77 | |||
78 | @@ -1849,32 +1847,20 @@ static int sas_discover_new(struct domain_device *dev, int phy_id) | ||
79 | { | ||
80 | struct ex_phy *ex_phy = &dev->ex_dev.ex_phy[phy_id]; | ||
81 | struct domain_device *child; | ||
82 | - bool found = false; | ||
83 | - int res, i; | ||
84 | + int res; | ||
85 | |||
86 | SAS_DPRINTK("ex %016llx phy%d new device attached\n", | ||
87 | SAS_ADDR(dev->sas_addr), phy_id); | ||
88 | res = sas_ex_phy_discover(dev, phy_id); | ||
89 | if (res) | ||
90 | - goto out; | ||
91 | - /* to support the wide port inserted */ | ||
92 | - for (i = 0; i < dev->ex_dev.num_phys; i++) { | ||
93 | - struct ex_phy *ex_phy_temp = &dev->ex_dev.ex_phy[i]; | ||
94 | - if (i == phy_id) | ||
95 | - continue; | ||
96 | - if (SAS_ADDR(ex_phy_temp->attached_sas_addr) == | ||
97 | - SAS_ADDR(ex_phy->attached_sas_addr)) { | ||
98 | - found = true; | ||
99 | - break; | ||
100 | - } | ||
101 | - } | ||
102 | - if (found) { | ||
103 | - sas_ex_join_wide_port(dev, phy_id); | ||
104 | + return res; | ||
105 | + | ||
106 | + if (sas_ex_join_wide_port(dev, phy_id)) | ||
107 | return 0; | ||
108 | - } | ||
109 | + | ||
110 | res = sas_ex_discover_devices(dev, phy_id); | ||
111 | - if (!res) | ||
112 | - goto out; | ||
113 | + if (res) | ||
114 | + return res; | ||
115 | list_for_each_entry(child, &dev->ex_dev.children, siblings) { | ||
116 | if (SAS_ADDR(child->sas_addr) == | ||
117 | SAS_ADDR(ex_phy->attached_sas_addr)) { | ||
118 | @@ -1884,7 +1870,6 @@ static int sas_discover_new(struct domain_device *dev, int phy_id) | ||
119 | break; | ||
120 | } | ||
121 | } | ||
122 | -out: | ||
123 | return res; | ||
124 | } | ||
125 | |||
126 | -- | ||
127 | 1.7.7.6 | ||
128 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0059-iscsi-target-Drop-bogus-struct-file-usage-for-iSCSI-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0059-iscsi-target-Drop-bogus-struct-file-usage-for-iSCSI-.patch new file mode 100644 index 00000000..cfe9c565 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0059-iscsi-target-Drop-bogus-struct-file-usage-for-iSCSI-.patch | |||
@@ -0,0 +1,230 @@ | |||
1 | From ea954b6e038224e5946f09b1a359d19e672cde3a Mon Sep 17 00:00:00 2001 | ||
2 | From: Al Viro <viro@ZenIV.linux.org.uk> | ||
3 | Date: Sat, 21 Jul 2012 08:55:18 +0100 | ||
4 | Subject: [PATCH 59/73] iscsi-target: Drop bogus struct file usage for | ||
5 | iSCSI/SCTP | ||
6 | |||
7 | commit bf6932f44a7b3fa7e2246a8b18a44670e5eab6c2 upstream. | ||
8 | |||
9 | From Al Viro: | ||
10 | |||
11 | BTW, speaking of struct file treatment related to sockets - | ||
12 | there's this piece of code in iscsi: | ||
13 | /* | ||
14 | * The SCTP stack needs struct socket->file. | ||
15 | */ | ||
16 | if ((np->np_network_transport == ISCSI_SCTP_TCP) || | ||
17 | (np->np_network_transport == ISCSI_SCTP_UDP)) { | ||
18 | if (!new_sock->file) { | ||
19 | new_sock->file = kzalloc( | ||
20 | sizeof(struct file), GFP_KERNEL); | ||
21 | |||
22 | For one thing, as far as I can see it'not true - sctp does *not* depend on | ||
23 | socket->file being non-NULL; it does, in one place, check socket->file->f_flags | ||
24 | for O_NONBLOCK, but there it treats NULL socket->file as "flag not set". | ||
25 | Which is the case here anyway - the fake struct file created in | ||
26 | __iscsi_target_login_thread() (and in iscsi_target_setup_login_socket(), with | ||
27 | the same excuse) do *not* get that flag set. | ||
28 | |||
29 | Moreover, it's a bloody serious violation of a bunch of asserts in VFS; | ||
30 | all struct file instances should come from filp_cachep, via get_empty_filp() | ||
31 | (or alloc_file(), which is a wrapper for it). FWIW, I'm very tempted to | ||
32 | do this and be done with the entire mess: | ||
33 | |||
34 | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> | ||
35 | Cc: Andy Grover <agrover@redhat.com> | ||
36 | Cc: Hannes Reinecke <hare@suse.de> | ||
37 | Cc: Christoph Hellwig <hch@lst.de> | ||
38 | Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> | ||
39 | [bwh: Backported to 3.2: adjust context] | ||
40 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
41 | --- | ||
42 | drivers/target/iscsi/iscsi_target.c | 22 +--------- | ||
43 | drivers/target/iscsi/iscsi_target_core.h | 2 - | ||
44 | drivers/target/iscsi/iscsi_target_login.c | 60 +--------------------------- | ||
45 | 3 files changed, 6 insertions(+), 78 deletions(-) | ||
46 | |||
47 | diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c | ||
48 | index 0842cc7..2ff1255 100644 | ||
49 | --- a/drivers/target/iscsi/iscsi_target.c | ||
50 | +++ b/drivers/target/iscsi/iscsi_target.c | ||
51 | @@ -427,19 +427,8 @@ int iscsit_reset_np_thread( | ||
52 | |||
53 | int iscsit_del_np_comm(struct iscsi_np *np) | ||
54 | { | ||
55 | - if (!np->np_socket) | ||
56 | - return 0; | ||
57 | - | ||
58 | - /* | ||
59 | - * Some network transports allocate their own struct sock->file, | ||
60 | - * see if we need to free any additional allocated resources. | ||
61 | - */ | ||
62 | - if (np->np_flags & NPF_SCTP_STRUCT_FILE) { | ||
63 | - kfree(np->np_socket->file); | ||
64 | - np->np_socket->file = NULL; | ||
65 | - } | ||
66 | - | ||
67 | - sock_release(np->np_socket); | ||
68 | + if (np->np_socket) | ||
69 | + sock_release(np->np_socket); | ||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | @@ -4105,13 +4094,8 @@ int iscsit_close_connection( | ||
74 | kfree(conn->conn_ops); | ||
75 | conn->conn_ops = NULL; | ||
76 | |||
77 | - if (conn->sock) { | ||
78 | - if (conn->conn_flags & CONNFLAG_SCTP_STRUCT_FILE) { | ||
79 | - kfree(conn->sock->file); | ||
80 | - conn->sock->file = NULL; | ||
81 | - } | ||
82 | + if (conn->sock) | ||
83 | sock_release(conn->sock); | ||
84 | - } | ||
85 | conn->thread_set = NULL; | ||
86 | |||
87 | pr_debug("Moving to TARG_CONN_STATE_FREE.\n"); | ||
88 | diff --git a/drivers/target/iscsi/iscsi_target_core.h b/drivers/target/iscsi/iscsi_target_core.h | ||
89 | index 7da2d6a..0f68197 100644 | ||
90 | --- a/drivers/target/iscsi/iscsi_target_core.h | ||
91 | +++ b/drivers/target/iscsi/iscsi_target_core.h | ||
92 | @@ -224,7 +224,6 @@ enum iscsi_timer_flags_table { | ||
93 | /* Used for struct iscsi_np->np_flags */ | ||
94 | enum np_flags_table { | ||
95 | NPF_IP_NETWORK = 0x00, | ||
96 | - NPF_SCTP_STRUCT_FILE = 0x01 /* Bugfix */ | ||
97 | }; | ||
98 | |||
99 | /* Used for struct iscsi_np->np_thread_state */ | ||
100 | @@ -511,7 +510,6 @@ struct iscsi_conn { | ||
101 | u16 local_port; | ||
102 | int net_size; | ||
103 | u32 auth_id; | ||
104 | -#define CONNFLAG_SCTP_STRUCT_FILE 0x01 | ||
105 | u32 conn_flags; | ||
106 | /* Used for iscsi_tx_login_rsp() */ | ||
107 | u32 login_itt; | ||
108 | diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c | ||
109 | index bd2adec..2ec5339 100644 | ||
110 | --- a/drivers/target/iscsi/iscsi_target_login.c | ||
111 | +++ b/drivers/target/iscsi/iscsi_target_login.c | ||
112 | @@ -793,22 +793,6 @@ int iscsi_target_setup_login_socket( | ||
113 | } | ||
114 | np->np_socket = sock; | ||
115 | /* | ||
116 | - * The SCTP stack needs struct socket->file. | ||
117 | - */ | ||
118 | - if ((np->np_network_transport == ISCSI_SCTP_TCP) || | ||
119 | - (np->np_network_transport == ISCSI_SCTP_UDP)) { | ||
120 | - if (!sock->file) { | ||
121 | - sock->file = kzalloc(sizeof(struct file), GFP_KERNEL); | ||
122 | - if (!sock->file) { | ||
123 | - pr_err("Unable to allocate struct" | ||
124 | - " file for SCTP\n"); | ||
125 | - ret = -ENOMEM; | ||
126 | - goto fail; | ||
127 | - } | ||
128 | - np->np_flags |= NPF_SCTP_STRUCT_FILE; | ||
129 | - } | ||
130 | - } | ||
131 | - /* | ||
132 | * Setup the np->np_sockaddr from the passed sockaddr setup | ||
133 | * in iscsi_target_configfs.c code.. | ||
134 | */ | ||
135 | @@ -857,21 +841,15 @@ int iscsi_target_setup_login_socket( | ||
136 | |||
137 | fail: | ||
138 | np->np_socket = NULL; | ||
139 | - if (sock) { | ||
140 | - if (np->np_flags & NPF_SCTP_STRUCT_FILE) { | ||
141 | - kfree(sock->file); | ||
142 | - sock->file = NULL; | ||
143 | - } | ||
144 | - | ||
145 | + if (sock) | ||
146 | sock_release(sock); | ||
147 | - } | ||
148 | return ret; | ||
149 | } | ||
150 | |||
151 | static int __iscsi_target_login_thread(struct iscsi_np *np) | ||
152 | { | ||
153 | u8 buffer[ISCSI_HDR_LEN], iscsi_opcode, zero_tsih = 0; | ||
154 | - int err, ret = 0, ip_proto, sock_type, set_sctp_conn_flag, stop; | ||
155 | + int err, ret = 0, ip_proto, sock_type, stop; | ||
156 | struct iscsi_conn *conn = NULL; | ||
157 | struct iscsi_login *login; | ||
158 | struct iscsi_portal_group *tpg = NULL; | ||
159 | @@ -882,7 +860,6 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) | ||
160 | struct sockaddr_in6 sock_in6; | ||
161 | |||
162 | flush_signals(current); | ||
163 | - set_sctp_conn_flag = 0; | ||
164 | sock = np->np_socket; | ||
165 | ip_proto = np->np_ip_proto; | ||
166 | sock_type = np->np_sock_type; | ||
167 | @@ -907,35 +884,12 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) | ||
168 | spin_unlock_bh(&np->np_thread_lock); | ||
169 | goto out; | ||
170 | } | ||
171 | - /* | ||
172 | - * The SCTP stack needs struct socket->file. | ||
173 | - */ | ||
174 | - if ((np->np_network_transport == ISCSI_SCTP_TCP) || | ||
175 | - (np->np_network_transport == ISCSI_SCTP_UDP)) { | ||
176 | - if (!new_sock->file) { | ||
177 | - new_sock->file = kzalloc( | ||
178 | - sizeof(struct file), GFP_KERNEL); | ||
179 | - if (!new_sock->file) { | ||
180 | - pr_err("Unable to allocate struct" | ||
181 | - " file for SCTP\n"); | ||
182 | - sock_release(new_sock); | ||
183 | - /* Get another socket */ | ||
184 | - return 1; | ||
185 | - } | ||
186 | - set_sctp_conn_flag = 1; | ||
187 | - } | ||
188 | - } | ||
189 | - | ||
190 | iscsi_start_login_thread_timer(np); | ||
191 | |||
192 | conn = kzalloc(sizeof(struct iscsi_conn), GFP_KERNEL); | ||
193 | if (!conn) { | ||
194 | pr_err("Could not allocate memory for" | ||
195 | " new connection\n"); | ||
196 | - if (set_sctp_conn_flag) { | ||
197 | - kfree(new_sock->file); | ||
198 | - new_sock->file = NULL; | ||
199 | - } | ||
200 | sock_release(new_sock); | ||
201 | /* Get another socket */ | ||
202 | return 1; | ||
203 | @@ -945,9 +899,6 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) | ||
204 | conn->conn_state = TARG_CONN_STATE_FREE; | ||
205 | conn->sock = new_sock; | ||
206 | |||
207 | - if (set_sctp_conn_flag) | ||
208 | - conn->conn_flags |= CONNFLAG_SCTP_STRUCT_FILE; | ||
209 | - | ||
210 | pr_debug("Moving to TARG_CONN_STATE_XPT_UP.\n"); | ||
211 | conn->conn_state = TARG_CONN_STATE_XPT_UP; | ||
212 | |||
213 | @@ -1195,13 +1146,8 @@ old_sess_out: | ||
214 | iscsi_release_param_list(conn->param_list); | ||
215 | conn->param_list = NULL; | ||
216 | } | ||
217 | - if (conn->sock) { | ||
218 | - if (conn->conn_flags & CONNFLAG_SCTP_STRUCT_FILE) { | ||
219 | - kfree(conn->sock->file); | ||
220 | - conn->sock->file = NULL; | ||
221 | - } | ||
222 | + if (conn->sock) | ||
223 | sock_release(conn->sock); | ||
224 | - } | ||
225 | kfree(conn); | ||
226 | |||
227 | if (tpg) { | ||
228 | -- | ||
229 | 1.7.7.6 | ||
230 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0060-mmc-sdhci-pci-CaFe-has-broken-card-detection.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0060-mmc-sdhci-pci-CaFe-has-broken-card-detection.patch new file mode 100644 index 00000000..22812ab7 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0060-mmc-sdhci-pci-CaFe-has-broken-card-detection.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From eb0aa45b9b49d8daeef285f1c5bb0be392caaddf Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Drake <dsd@laptop.org> | ||
3 | Date: Tue, 3 Jul 2012 23:13:39 +0100 | ||
4 | Subject: [PATCH 60/73] mmc: sdhci-pci: CaFe has broken card detection | ||
5 | |||
6 | commit 55fc05b7414274f17795cd0e8a3b1546f3649d5e upstream. | ||
7 | |||
8 | At http://dev.laptop.org/ticket/11980 we have determined that the | ||
9 | Marvell CaFe SDHCI controller reports bad card presence during | ||
10 | resume. It reports that no card is present even when it is. | ||
11 | This is a regression -- resume worked back around 2.6.37. | ||
12 | |||
13 | Around 400ms after resuming, a "card inserted" interrupt is | ||
14 | generated, at which point it starts reporting presence. | ||
15 | |||
16 | Work around this hardware oddity by setting the | ||
17 | SDHCI_QUIRK_BROKEN_CARD_DETECTION flag. | ||
18 | Thanks to Chris Ball for helping with diagnosis. | ||
19 | |||
20 | Signed-off-by: Daniel Drake <dsd@laptop.org> | ||
21 | [stable@: please apply to 3.0+] | ||
22 | Signed-off-by: Chris Ball <cjb@laptop.org> | ||
23 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
24 | --- | ||
25 | drivers/mmc/host/sdhci-pci.c | 1 + | ||
26 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
27 | |||
28 | diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c | ||
29 | index 6878a94..83b51b5 100644 | ||
30 | --- a/drivers/mmc/host/sdhci-pci.c | ||
31 | +++ b/drivers/mmc/host/sdhci-pci.c | ||
32 | @@ -148,6 +148,7 @@ static const struct sdhci_pci_fixes sdhci_ene_714 = { | ||
33 | static const struct sdhci_pci_fixes sdhci_cafe = { | ||
34 | .quirks = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER | | ||
35 | SDHCI_QUIRK_NO_BUSY_IRQ | | ||
36 | + SDHCI_QUIRK_BROKEN_CARD_DETECTION | | ||
37 | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL, | ||
38 | }; | ||
39 | |||
40 | -- | ||
41 | 1.7.7.6 | ||
42 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0061-ext4-don-t-let-i_reserved_meta_blocks-go-negative.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0061-ext4-don-t-let-i_reserved_meta_blocks-go-negative.patch new file mode 100644 index 00000000..428571df --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0061-ext4-don-t-let-i_reserved_meta_blocks-go-negative.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | From a09474d4d4bba3e468ff96d826b90b5551f98111 Mon Sep 17 00:00:00 2001 | ||
2 | From: Brian Foster <bfoster@redhat.com> | ||
3 | Date: Sun, 22 Jul 2012 23:59:40 -0400 | ||
4 | Subject: [PATCH 61/73] ext4: don't let i_reserved_meta_blocks go negative | ||
5 | |||
6 | commit 97795d2a5b8d3c8dc4365d4bd3404191840453ba upstream. | ||
7 | |||
8 | If we hit a condition where we have allocated metadata blocks that | ||
9 | were not appropriately reserved, we risk underflow of | ||
10 | ei->i_reserved_meta_blocks. In turn, this can throw | ||
11 | sbi->s_dirtyclusters_counter significantly out of whack and undermine | ||
12 | the nondelalloc fallback logic in ext4_nonda_switch(). Warn if this | ||
13 | occurs and set i_allocated_meta_blocks to avoid this problem. | ||
14 | |||
15 | This condition is reproduced by xfstests 270 against ext2 with | ||
16 | delalloc enabled: | ||
17 | |||
18 | Mar 28 08:58:02 localhost kernel: [ 171.526344] EXT4-fs (loop1): delayed block allocation failed for inode 14 at logical offset 64486 with max blocks 64 with error -28 | ||
19 | Mar 28 08:58:02 localhost kernel: [ 171.526346] EXT4-fs (loop1): This should not happen!! Data will be lost | ||
20 | |||
21 | 270 ultimately fails with an inconsistent filesystem and requires an | ||
22 | fsck to repair. The cause of the error is an underflow in | ||
23 | ext4_da_update_reserve_space() due to an unreserved meta block | ||
24 | allocation. | ||
25 | |||
26 | Signed-off-by: Brian Foster <bfoster@redhat.com> | ||
27 | Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> | ||
28 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
29 | --- | ||
30 | fs/ext4/inode.c | 9 +++++++++ | ||
31 | 1 files changed, 9 insertions(+), 0 deletions(-) | ||
32 | |||
33 | diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c | ||
34 | index d0dc109..03373c3 100644 | ||
35 | --- a/fs/ext4/inode.c | ||
36 | +++ b/fs/ext4/inode.c | ||
37 | @@ -277,6 +277,15 @@ void ext4_da_update_reserve_space(struct inode *inode, | ||
38 | used = ei->i_reserved_data_blocks; | ||
39 | } | ||
40 | |||
41 | + if (unlikely(ei->i_allocated_meta_blocks > ei->i_reserved_meta_blocks)) { | ||
42 | + ext4_msg(inode->i_sb, KERN_NOTICE, "%s: ino %lu, allocated %d " | ||
43 | + "with only %d reserved metadata blocks\n", __func__, | ||
44 | + inode->i_ino, ei->i_allocated_meta_blocks, | ||
45 | + ei->i_reserved_meta_blocks); | ||
46 | + WARN_ON(1); | ||
47 | + ei->i_allocated_meta_blocks = ei->i_reserved_meta_blocks; | ||
48 | + } | ||
49 | + | ||
50 | /* Update per-inode reservations */ | ||
51 | ei->i_reserved_data_blocks -= used; | ||
52 | ei->i_reserved_meta_blocks -= ei->i_allocated_meta_blocks; | ||
53 | -- | ||
54 | 1.7.7.6 | ||
55 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0062-ext4-undo-ext4_calc_metadata_amount-if-we-fail-to-cl.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0062-ext4-undo-ext4_calc_metadata_amount-if-we-fail-to-cl.patch new file mode 100644 index 00000000..dac384ad --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0062-ext4-undo-ext4_calc_metadata_amount-if-we-fail-to-cl.patch | |||
@@ -0,0 +1,93 @@ | |||
1 | From f7aa52ca54cad12194d0c48a95c2d4ccdf487c6c Mon Sep 17 00:00:00 2001 | ||
2 | From: Theodore Ts'o <tytso@mit.edu> | ||
3 | Date: Mon, 23 Jul 2012 00:00:20 -0400 | ||
4 | Subject: [PATCH 62/73] ext4: undo ext4_calc_metadata_amount if we fail to | ||
5 | claim space | ||
6 | |||
7 | commit 03179fe92318e7934c180d96f12eff2cb36ef7b6 upstream. | ||
8 | |||
9 | The function ext4_calc_metadata_amount() has side effects, although | ||
10 | it's not obvious from its function name. So if we fail to claim | ||
11 | space, regardless of whether we retry to claim the space again, or | ||
12 | return an error, we need to undo these side effects. | ||
13 | |||
14 | Otherwise we can end up incorrectly calculating the number of metadata | ||
15 | blocks needed for the operation, which was responsible for an xfstests | ||
16 | failure for test #271 when using an ext2 file system with delalloc | ||
17 | enabled. | ||
18 | |||
19 | Reported-by: Brian Foster <bfoster@redhat.com> | ||
20 | Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> | ||
21 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
22 | --- | ||
23 | fs/ext4/inode.c | 32 +++++++++++++++++++++----------- | ||
24 | 1 files changed, 21 insertions(+), 11 deletions(-) | ||
25 | |||
26 | diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c | ||
27 | index 03373c3..b556994 100644 | ||
28 | --- a/fs/ext4/inode.c | ||
29 | +++ b/fs/ext4/inode.c | ||
30 | @@ -1111,6 +1111,17 @@ static int ext4_da_reserve_space(struct inode *inode, ext4_lblk_t lblock) | ||
31 | struct ext4_inode_info *ei = EXT4_I(inode); | ||
32 | unsigned int md_needed; | ||
33 | int ret; | ||
34 | + ext4_lblk_t save_last_lblock; | ||
35 | + int save_len; | ||
36 | + | ||
37 | + /* | ||
38 | + * We will charge metadata quota at writeout time; this saves | ||
39 | + * us from metadata over-estimation, though we may go over by | ||
40 | + * a small amount in the end. Here we just reserve for data. | ||
41 | + */ | ||
42 | + ret = dquot_reserve_block(inode, EXT4_C2B(sbi, 1)); | ||
43 | + if (ret) | ||
44 | + return ret; | ||
45 | |||
46 | /* | ||
47 | * recalculate the amount of metadata blocks to reserve | ||
48 | @@ -1119,32 +1130,31 @@ static int ext4_da_reserve_space(struct inode *inode, ext4_lblk_t lblock) | ||
49 | */ | ||
50 | repeat: | ||
51 | spin_lock(&ei->i_block_reservation_lock); | ||
52 | + /* | ||
53 | + * ext4_calc_metadata_amount() has side effects, which we have | ||
54 | + * to be prepared undo if we fail to claim space. | ||
55 | + */ | ||
56 | + save_len = ei->i_da_metadata_calc_len; | ||
57 | + save_last_lblock = ei->i_da_metadata_calc_last_lblock; | ||
58 | md_needed = EXT4_NUM_B2C(sbi, | ||
59 | ext4_calc_metadata_amount(inode, lblock)); | ||
60 | trace_ext4_da_reserve_space(inode, md_needed); | ||
61 | - spin_unlock(&ei->i_block_reservation_lock); | ||
62 | |||
63 | /* | ||
64 | - * We will charge metadata quota at writeout time; this saves | ||
65 | - * us from metadata over-estimation, though we may go over by | ||
66 | - * a small amount in the end. Here we just reserve for data. | ||
67 | - */ | ||
68 | - ret = dquot_reserve_block(inode, EXT4_C2B(sbi, 1)); | ||
69 | - if (ret) | ||
70 | - return ret; | ||
71 | - /* | ||
72 | * We do still charge estimated metadata to the sb though; | ||
73 | * we cannot afford to run out of free blocks. | ||
74 | */ | ||
75 | if (ext4_claim_free_clusters(sbi, md_needed + 1, 0)) { | ||
76 | - dquot_release_reservation_block(inode, EXT4_C2B(sbi, 1)); | ||
77 | + ei->i_da_metadata_calc_len = save_len; | ||
78 | + ei->i_da_metadata_calc_last_lblock = save_last_lblock; | ||
79 | + spin_unlock(&ei->i_block_reservation_lock); | ||
80 | if (ext4_should_retry_alloc(inode->i_sb, &retries)) { | ||
81 | yield(); | ||
82 | goto repeat; | ||
83 | } | ||
84 | + dquot_release_reservation_block(inode, EXT4_C2B(sbi, 1)); | ||
85 | return -ENOSPC; | ||
86 | } | ||
87 | - spin_lock(&ei->i_block_reservation_lock); | ||
88 | ei->i_reserved_data_blocks++; | ||
89 | ei->i_reserved_meta_blocks += md_needed; | ||
90 | spin_unlock(&ei->i_block_reservation_lock); | ||
91 | -- | ||
92 | 1.7.7.6 | ||
93 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0063-ASoC-dapm-Fix-_PRE-and-_POST-events-for-DAPM-perform.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0063-ASoC-dapm-Fix-_PRE-and-_POST-events-for-DAPM-perform.patch new file mode 100644 index 00000000..a1fc4639 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0063-ASoC-dapm-Fix-_PRE-and-_POST-events-for-DAPM-perform.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From 8fbf76d6e7e81a95a44e627e0c6dbeef231700f2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
3 | Date: Fri, 20 Jul 2012 17:29:34 +0100 | ||
4 | Subject: [PATCH 63/73] ASoC: dapm: Fix _PRE and _POST events for DAPM | ||
5 | performance improvements | ||
6 | |||
7 | commit 0ff97ebf0804d2e519d578fcb4db03f104d2ca8c upstream. | ||
8 | |||
9 | Ever since the DAPM performance improvements we've been marking all widgets | ||
10 | as not dirty after each DAPM run. Since _PRE and _POST events aren't part | ||
11 | of the DAPM graph this has rendered them non-functional, they will never be | ||
12 | marked dirty again and thus will never be run again. | ||
13 | |||
14 | Fix this by skipping them when marking widgets as not dirty. | ||
15 | |||
16 | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
17 | Acked-by: Liam Girdwood <lrg@ti.com> | ||
18 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
19 | --- | ||
20 | sound/soc/soc-dapm.c | 10 +++++++++- | ||
21 | 1 files changed, 9 insertions(+), 1 deletions(-) | ||
22 | |||
23 | diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c | ||
24 | index 90e93bf..0dc441c 100644 | ||
25 | --- a/sound/soc/soc-dapm.c | ||
26 | +++ b/sound/soc/soc-dapm.c | ||
27 | @@ -1381,7 +1381,15 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) | ||
28 | } | ||
29 | |||
30 | list_for_each_entry(w, &card->widgets, list) { | ||
31 | - list_del_init(&w->dirty); | ||
32 | + switch (w->id) { | ||
33 | + case snd_soc_dapm_pre: | ||
34 | + case snd_soc_dapm_post: | ||
35 | + /* These widgets always need to be powered */ | ||
36 | + break; | ||
37 | + default: | ||
38 | + list_del_init(&w->dirty); | ||
39 | + break; | ||
40 | + } | ||
41 | |||
42 | if (w->power) { | ||
43 | d = w->dapm; | ||
44 | -- | ||
45 | 1.7.7.6 | ||
46 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0064-locks-fix-checking-of-fcntl_setlease-argument.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0064-locks-fix-checking-of-fcntl_setlease-argument.patch new file mode 100644 index 00000000..7296221e --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0064-locks-fix-checking-of-fcntl_setlease-argument.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | From fb13198419fd31d8cbe249d285abd4f69d2c4f6d Mon Sep 17 00:00:00 2001 | ||
2 | From: "J. Bruce Fields" <bfields@fieldses.org> | ||
3 | Date: Mon, 23 Jul 2012 15:17:17 -0400 | ||
4 | Subject: [PATCH 64/73] locks: fix checking of fcntl_setlease argument | ||
5 | |||
6 | commit 0ec4f431eb56d633da3a55da67d5c4b88886ccc7 upstream. | ||
7 | |||
8 | The only checks of the long argument passed to fcntl(fd,F_SETLEASE,.) | ||
9 | are done after converting the long to an int. Thus some illegal values | ||
10 | may be let through and cause problems in later code. | ||
11 | |||
12 | [ They actually *don't* cause problems in mainline, as of Dave Jones's | ||
13 | commit 8d657eb3b438 "Remove easily user-triggerable BUG from | ||
14 | generic_setlease", but we should fix this anyway. And this patch will | ||
15 | be necessary to fix real bugs on earlier kernels. ] | ||
16 | |||
17 | Signed-off-by: J. Bruce Fields <bfields@redhat.com> | ||
18 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
19 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
20 | --- | ||
21 | fs/locks.c | 6 +++--- | ||
22 | 1 files changed, 3 insertions(+), 3 deletions(-) | ||
23 | |||
24 | diff --git a/fs/locks.c b/fs/locks.c | ||
25 | index 6a64f15..fcc50ab 100644 | ||
26 | --- a/fs/locks.c | ||
27 | +++ b/fs/locks.c | ||
28 | @@ -308,7 +308,7 @@ static int flock_make_lock(struct file *filp, struct file_lock **lock, | ||
29 | return 0; | ||
30 | } | ||
31 | |||
32 | -static int assign_type(struct file_lock *fl, int type) | ||
33 | +static int assign_type(struct file_lock *fl, long type) | ||
34 | { | ||
35 | switch (type) { | ||
36 | case F_RDLCK: | ||
37 | @@ -445,7 +445,7 @@ static const struct lock_manager_operations lease_manager_ops = { | ||
38 | /* | ||
39 | * Initialize a lease, use the default lock manager operations | ||
40 | */ | ||
41 | -static int lease_init(struct file *filp, int type, struct file_lock *fl) | ||
42 | +static int lease_init(struct file *filp, long type, struct file_lock *fl) | ||
43 | { | ||
44 | if (assign_type(fl, type) != 0) | ||
45 | return -EINVAL; | ||
46 | @@ -463,7 +463,7 @@ static int lease_init(struct file *filp, int type, struct file_lock *fl) | ||
47 | } | ||
48 | |||
49 | /* Allocate a file_lock initialised to this type of lease */ | ||
50 | -static struct file_lock *lease_alloc(struct file *filp, int type) | ||
51 | +static struct file_lock *lease_alloc(struct file *filp, long type) | ||
52 | { | ||
53 | struct file_lock *fl = locks_alloc_lock(); | ||
54 | int error = -ENOMEM; | ||
55 | -- | ||
56 | 1.7.7.6 | ||
57 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0065-ACPI-AC-prevent-OOPS-on-some-boxes-due-to-missing-ch.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0065-ACPI-AC-prevent-OOPS-on-some-boxes-due-to-missing-ch.patch new file mode 100644 index 00000000..5fa53fb5 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0065-ACPI-AC-prevent-OOPS-on-some-boxes-due-to-missing-ch.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From 847ccb9086b1b76d8db67f37e36e909727c010cb Mon Sep 17 00:00:00 2001 | ||
2 | From: Lan Tianyu <tianyu.lan@intel.com> | ||
3 | Date: Fri, 20 Jul 2012 13:29:16 +0800 | ||
4 | Subject: [PATCH 65/73] ACPI/AC: prevent OOPS on some boxes due to missing | ||
5 | check power_supply_register() return value check | ||
6 | |||
7 | commit f197ac13f6eeb351b31250b9ab7d0da17434ea36 upstream. | ||
8 | |||
9 | In the ac.c, power_supply_register()'s return value is not checked. | ||
10 | |||
11 | As a result, the driver's add() ops may return success | ||
12 | even though the device failed to initialize. | ||
13 | |||
14 | For example, some BIOS may describe two ACADs in the same DSDT. | ||
15 | The second ACAD device will fail to register, | ||
16 | but ACPI driver's add() ops returns sucessfully. | ||
17 | The ACPI device will receive ACPI notification and cause OOPS. | ||
18 | |||
19 | https://bugzilla.redhat.com/show_bug.cgi?id=772730 | ||
20 | |||
21 | Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> | ||
22 | Signed-off-by: Len Brown <len.brown@intel.com> | ||
23 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
24 | --- | ||
25 | drivers/acpi/ac.c | 4 +++- | ||
26 | 1 files changed, 3 insertions(+), 1 deletions(-) | ||
27 | |||
28 | diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c | ||
29 | index 6512b20..d1fcbc0 100644 | ||
30 | --- a/drivers/acpi/ac.c | ||
31 | +++ b/drivers/acpi/ac.c | ||
32 | @@ -292,7 +292,9 @@ static int acpi_ac_add(struct acpi_device *device) | ||
33 | ac->charger.properties = ac_props; | ||
34 | ac->charger.num_properties = ARRAY_SIZE(ac_props); | ||
35 | ac->charger.get_property = get_ac_property; | ||
36 | - power_supply_register(&ac->device->dev, &ac->charger); | ||
37 | + result = power_supply_register(&ac->device->dev, &ac->charger); | ||
38 | + if (result) | ||
39 | + goto end; | ||
40 | |||
41 | printk(KERN_INFO PREFIX "%s [%s] (%s)\n", | ||
42 | acpi_device_name(device), acpi_device_bid(device), | ||
43 | -- | ||
44 | 1.7.7.6 | ||
45 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0066-drm-radeon-fix-bo-creation-retry-path.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0066-drm-radeon-fix-bo-creation-retry-path.patch new file mode 100644 index 00000000..065e87be --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0066-drm-radeon-fix-bo-creation-retry-path.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 9fc722e4c6da369ecad425d55a4fe50c6dbd21d9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jerome Glisse <jglisse@redhat.com> | ||
3 | Date: Thu, 12 Jul 2012 18:23:05 -0400 | ||
4 | Subject: [PATCH 66/73] drm/radeon: fix bo creation retry path | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | commit d1c7871ddb1f588b8eb35affd9ee1a3d5e11cd0c upstream. | ||
10 | |||
11 | Retry label was at wrong place in function leading to memory | ||
12 | leak. | ||
13 | |||
14 | Signed-off-by: Jerome Glisse <jglisse@redhat.com> | ||
15 | Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> | ||
16 | Reviewed-by: Christian König <christian.koenig@amd.com> | ||
17 | Signed-off-by: Dave Airlie <airlied@redhat.com> | ||
18 | [bwh: Backported to 3.2: adjust context] | ||
19 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
20 | --- | ||
21 | drivers/gpu/drm/radeon/radeon_object.c | 3 ++- | ||
22 | 1 files changed, 2 insertions(+), 1 deletions(-) | ||
23 | |||
24 | diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c | ||
25 | index f3ae607..39497c7 100644 | ||
26 | --- a/drivers/gpu/drm/radeon/radeon_object.c | ||
27 | +++ b/drivers/gpu/drm/radeon/radeon_object.c | ||
28 | @@ -117,7 +117,6 @@ int radeon_bo_create(struct radeon_device *rdev, | ||
29 | return -ENOMEM; | ||
30 | } | ||
31 | |||
32 | -retry: | ||
33 | bo = kzalloc(sizeof(struct radeon_bo), GFP_KERNEL); | ||
34 | if (bo == NULL) | ||
35 | return -ENOMEM; | ||
36 | @@ -130,6 +129,8 @@ retry: | ||
37 | bo->gem_base.driver_private = NULL; | ||
38 | bo->surface_reg = -1; | ||
39 | INIT_LIST_HEAD(&bo->list); | ||
40 | + | ||
41 | +retry: | ||
42 | radeon_ttm_placement_from_domain(bo, domain); | ||
43 | /* Kernel allocation are uninterruptible */ | ||
44 | mutex_lock(&rdev->vram_mutex); | ||
45 | -- | ||
46 | 1.7.7.6 | ||
47 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0067-drm-radeon-fix-non-revealent-error-message.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0067-drm-radeon-fix-non-revealent-error-message.patch new file mode 100644 index 00000000..85e0cad3 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0067-drm-radeon-fix-non-revealent-error-message.patch | |||
@@ -0,0 +1,70 @@ | |||
1 | From 0521c32992bd885e150c17f413200d82fa83911c Mon Sep 17 00:00:00 2001 | ||
2 | From: Jerome Glisse <jglisse@redhat.com> | ||
3 | Date: Tue, 17 Jul 2012 17:17:16 -0400 | ||
4 | Subject: [PATCH 67/73] drm/radeon: fix non revealent error message | ||
5 | |||
6 | commit 8d1c702aa0b2c4b22b0742b72a1149d91690674b upstream. | ||
7 | |||
8 | We want to print link status query failed only if it's | ||
9 | an unexepected fail. If we query to see if we need | ||
10 | link training it might be because there is nothing | ||
11 | connected and thus link status query have the right | ||
12 | to fail in that case. | ||
13 | |||
14 | To avoid printing failure when it's expected, move the | ||
15 | failure message to proper place. | ||
16 | |||
17 | Signed-off-by: Jerome Glisse <jglisse@redhat.com> | ||
18 | Signed-off-by: Dave Airlie <airlied@redhat.com> | ||
19 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
20 | --- | ||
21 | drivers/gpu/drm/radeon/atombios_dp.c | 10 +++++++--- | ||
22 | 1 files changed, 7 insertions(+), 3 deletions(-) | ||
23 | |||
24 | diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c | ||
25 | index 552b436..3254d51 100644 | ||
26 | --- a/drivers/gpu/drm/radeon/atombios_dp.c | ||
27 | +++ b/drivers/gpu/drm/radeon/atombios_dp.c | ||
28 | @@ -22,6 +22,7 @@ | ||
29 | * | ||
30 | * Authors: Dave Airlie | ||
31 | * Alex Deucher | ||
32 | + * Jerome Glisse | ||
33 | */ | ||
34 | #include "drmP.h" | ||
35 | #include "radeon_drm.h" | ||
36 | @@ -634,7 +635,6 @@ static bool radeon_dp_get_link_status(struct radeon_connector *radeon_connector, | ||
37 | ret = radeon_dp_aux_native_read(radeon_connector, DP_LANE0_1_STATUS, | ||
38 | link_status, DP_LINK_STATUS_SIZE, 100); | ||
39 | if (ret <= 0) { | ||
40 | - DRM_ERROR("displayport link status failed\n"); | ||
41 | return false; | ||
42 | } | ||
43 | |||
44 | @@ -812,8 +812,10 @@ static int radeon_dp_link_train_cr(struct radeon_dp_link_train_info *dp_info) | ||
45 | else | ||
46 | mdelay(dp_info->rd_interval * 4); | ||
47 | |||
48 | - if (!radeon_dp_get_link_status(dp_info->radeon_connector, dp_info->link_status)) | ||
49 | + if (!radeon_dp_get_link_status(dp_info->radeon_connector, dp_info->link_status)) { | ||
50 | + DRM_ERROR("displayport link status failed\n"); | ||
51 | break; | ||
52 | + } | ||
53 | |||
54 | if (dp_clock_recovery_ok(dp_info->link_status, dp_info->dp_lane_count)) { | ||
55 | clock_recovery = true; | ||
56 | @@ -875,8 +877,10 @@ static int radeon_dp_link_train_ce(struct radeon_dp_link_train_info *dp_info) | ||
57 | else | ||
58 | mdelay(dp_info->rd_interval * 4); | ||
59 | |||
60 | - if (!radeon_dp_get_link_status(dp_info->radeon_connector, dp_info->link_status)) | ||
61 | + if (!radeon_dp_get_link_status(dp_info->radeon_connector, dp_info->link_status)) { | ||
62 | + DRM_ERROR("displayport link status failed\n"); | ||
63 | break; | ||
64 | + } | ||
65 | |||
66 | if (dp_channel_eq_ok(dp_info->link_status, dp_info->dp_lane_count)) { | ||
67 | channel_eq = true; | ||
68 | -- | ||
69 | 1.7.7.6 | ||
70 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0068-drm-radeon-fix-hotplug-of-DP-to-DVI-HDMI-passive-ada.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0068-drm-radeon-fix-hotplug-of-DP-to-DVI-HDMI-passive-ada.patch new file mode 100644 index 00000000..0872ed35 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0068-drm-radeon-fix-hotplug-of-DP-to-DVI-HDMI-passive-ada.patch | |||
@@ -0,0 +1,69 @@ | |||
1 | From 0de546b55811738998d83bb6e677306d65e90861 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jerome Glisse <jglisse@redhat.com> | ||
3 | Date: Thu, 19 Jul 2012 17:15:56 -0400 | ||
4 | Subject: [PATCH 68/73] drm/radeon: fix hotplug of DP to DVI|HDMI passive | ||
5 | adapters (v2) | ||
6 | |||
7 | commit 266dcba541a1ef7e5d82d9e67c67fde2910636e8 upstream. | ||
8 | |||
9 | No need to retrain the link for passive adapters. | ||
10 | |||
11 | v2: agd5f | ||
12 | - no passive DP to VGA adapters, update comments | ||
13 | - assign radeon_connector_atom_dig after we are sure | ||
14 | we have a digital connector as analog connectors | ||
15 | have different private data. | ||
16 | - get new sink type before checking for retrain. No | ||
17 | need to check if it's no longer a DP connection. | ||
18 | |||
19 | Signed-off-by: Jerome Glisse <jglisse@redhat.com> | ||
20 | Signed-off-by: Alex Deucher <alexander.deucher@amd.com> | ||
21 | Signed-off-by: Dave Airlie <airlied@redhat.com> | ||
22 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
23 | --- | ||
24 | drivers/gpu/drm/radeon/radeon_connectors.c | 29 ++++++++++++++++++++------- | ||
25 | 1 files changed, 21 insertions(+), 8 deletions(-) | ||
26 | |||
27 | diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c | ||
28 | index 4a4493f..fb8db7a 100644 | ||
29 | --- a/drivers/gpu/drm/radeon/radeon_connectors.c | ||
30 | +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | ||
31 | @@ -64,14 +64,27 @@ void radeon_connector_hotplug(struct drm_connector *connector) | ||
32 | |||
33 | /* just deal with DP (not eDP) here. */ | ||
34 | if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) { | ||
35 | - int saved_dpms = connector->dpms; | ||
36 | - | ||
37 | - /* Only turn off the display it it's physically disconnected */ | ||
38 | - if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) | ||
39 | - drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); | ||
40 | - else if (radeon_dp_needs_link_train(radeon_connector)) | ||
41 | - drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); | ||
42 | - connector->dpms = saved_dpms; | ||
43 | + struct radeon_connector_atom_dig *dig_connector = | ||
44 | + radeon_connector->con_priv; | ||
45 | + | ||
46 | + /* if existing sink type was not DP no need to retrain */ | ||
47 | + if (dig_connector->dp_sink_type != CONNECTOR_OBJECT_ID_DISPLAYPORT) | ||
48 | + return; | ||
49 | + | ||
50 | + /* first get sink type as it may be reset after (un)plug */ | ||
51 | + dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector); | ||
52 | + /* don't do anything if sink is not display port, i.e., | ||
53 | + * passive dp->(dvi|hdmi) adaptor | ||
54 | + */ | ||
55 | + if (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { | ||
56 | + int saved_dpms = connector->dpms; | ||
57 | + /* Only turn off the display if it's physically disconnected */ | ||
58 | + if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) | ||
59 | + drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); | ||
60 | + else if (radeon_dp_needs_link_train(radeon_connector)) | ||
61 | + drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); | ||
62 | + connector->dpms = saved_dpms; | ||
63 | + } | ||
64 | } | ||
65 | } | ||
66 | |||
67 | -- | ||
68 | 1.7.7.6 | ||
69 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0069-drm-radeon-on-hotplug-force-link-training-to-happen-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0069-drm-radeon-on-hotplug-force-link-training-to-happen-.patch new file mode 100644 index 00000000..67959f97 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0069-drm-radeon-on-hotplug-force-link-training-to-happen-.patch | |||
@@ -0,0 +1,51 @@ | |||
1 | From 66ce98f9164b89ce8566d303265e209829f41c9f Mon Sep 17 00:00:00 2001 | ||
2 | From: Jerome Glisse <jglisse@redhat.com> | ||
3 | Date: Thu, 19 Jul 2012 17:25:55 -0400 | ||
4 | Subject: [PATCH 69/73] drm/radeon: on hotplug force link training to happen | ||
5 | (v2) | ||
6 | |||
7 | commit ca2ccde5e2f24a792caa4cca919fc5c6f65d1887 upstream. | ||
8 | |||
9 | To have DP behave like VGA/DVI we need to retrain the link | ||
10 | on hotplug. For this to happen we need to force link | ||
11 | training to happen by setting connector dpms to off | ||
12 | before asking it turning it on again. | ||
13 | |||
14 | v2: agd5f | ||
15 | - drop the dp_get_link_status() change in atombios_dp.c | ||
16 | for now. We still need the dpms OFF change. | ||
17 | |||
18 | Signed-off-by: Jerome Glisse <jglisse@redhat.com> | ||
19 | Signed-off-by: Alex Deucher <alexander.deucher@amd.com> | ||
20 | Signed-off-by: Dave Airlie <airlied@redhat.com> | ||
21 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
22 | --- | ||
23 | drivers/gpu/drm/radeon/radeon_connectors.c | 10 ++++++++-- | ||
24 | 1 files changed, 8 insertions(+), 2 deletions(-) | ||
25 | |||
26 | diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c | ||
27 | index fb8db7a..87d494d 100644 | ||
28 | --- a/drivers/gpu/drm/radeon/radeon_connectors.c | ||
29 | +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | ||
30 | @@ -79,10 +79,16 @@ void radeon_connector_hotplug(struct drm_connector *connector) | ||
31 | if (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { | ||
32 | int saved_dpms = connector->dpms; | ||
33 | /* Only turn off the display if it's physically disconnected */ | ||
34 | - if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) | ||
35 | + if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) { | ||
36 | drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); | ||
37 | - else if (radeon_dp_needs_link_train(radeon_connector)) | ||
38 | + } else if (radeon_dp_needs_link_train(radeon_connector)) { | ||
39 | + /* set it to OFF so that drm_helper_connector_dpms() | ||
40 | + * won't return immediately since the current state | ||
41 | + * is ON at this point. | ||
42 | + */ | ||
43 | + connector->dpms = DRM_MODE_DPMS_OFF; | ||
44 | drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); | ||
45 | + } | ||
46 | connector->dpms = saved_dpms; | ||
47 | } | ||
48 | } | ||
49 | -- | ||
50 | 1.7.7.6 | ||
51 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0070-Btrfs-call-the-ordered-free-operation-without-any-lo.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0070-Btrfs-call-the-ordered-free-operation-without-any-lo.patch new file mode 100644 index 00000000..871e6c0d --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0070-Btrfs-call-the-ordered-free-operation-without-any-lo.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From f9254351de93ec535792d9a66b462d835875a6d3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Chris Mason <chris.mason@fusionio.com> | ||
3 | Date: Wed, 25 Jul 2012 15:57:13 -0400 | ||
4 | Subject: [PATCH 70/73] Btrfs: call the ordered free operation without any | ||
5 | locks held | ||
6 | |||
7 | commit e9fbcb42201c862fd6ab45c48ead4f47bb2dea9d upstream. | ||
8 | |||
9 | Each ordered operation has a free callback, and this was called with the | ||
10 | worker spinlock held. Josef made the free callback also call iput, | ||
11 | which we can't do with the spinlock. | ||
12 | |||
13 | This drops the spinlock for the free operation and grabs it again before | ||
14 | moving through the rest of the list. We'll circle back around to this | ||
15 | and find a cleaner way that doesn't bounce the lock around so much. | ||
16 | |||
17 | Signed-off-by: Chris Mason <chris.mason@fusionio.com> | ||
18 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
19 | --- | ||
20 | fs/btrfs/async-thread.c | 9 ++++++++- | ||
21 | 1 files changed, 8 insertions(+), 1 deletions(-) | ||
22 | |||
23 | diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c | ||
24 | index 0b39458..03321e5 100644 | ||
25 | --- a/fs/btrfs/async-thread.c | ||
26 | +++ b/fs/btrfs/async-thread.c | ||
27 | @@ -206,10 +206,17 @@ static noinline int run_ordered_completions(struct btrfs_workers *workers, | ||
28 | |||
29 | work->ordered_func(work); | ||
30 | |||
31 | - /* now take the lock again and call the freeing code */ | ||
32 | + /* now take the lock again and drop our item from the list */ | ||
33 | spin_lock(&workers->order_lock); | ||
34 | list_del(&work->order_list); | ||
35 | + spin_unlock(&workers->order_lock); | ||
36 | + | ||
37 | + /* | ||
38 | + * we don't want to call the ordered free functions | ||
39 | + * with the lock held though | ||
40 | + */ | ||
41 | work->ordered_free(work); | ||
42 | + spin_lock(&workers->order_lock); | ||
43 | } | ||
44 | |||
45 | spin_unlock(&workers->order_lock); | ||
46 | -- | ||
47 | 1.7.7.6 | ||
48 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0071-nouveau-Fix-alignment-requirements-on-src-and-dst-ad.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0071-nouveau-Fix-alignment-requirements-on-src-and-dst-ad.patch new file mode 100644 index 00000000..96bdd5da --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0071-nouveau-Fix-alignment-requirements-on-src-and-dst-ad.patch | |||
@@ -0,0 +1,748 @@ | |||
1 | From ea77473ebf8397a7462fd28ad93e01a50084b146 Mon Sep 17 00:00:00 2001 | ||
2 | From: Maarten Lankhorst <maarten.lankhorst@canonical.com> | ||
3 | Date: Mon, 4 Jun 2012 12:00:31 +0200 | ||
4 | Subject: [PATCH 71/73] nouveau: Fix alignment requirements on src and dst | ||
5 | addresses | ||
6 | |||
7 | commit ce806a30470bcd846d148bf39d46de3ad7748228 upstream. | ||
8 | |||
9 | Linear copy works by adding the offset to the buffer address, | ||
10 | which may end up not being 16-byte aligned. | ||
11 | |||
12 | Some tests I've written for prime_pcopy show that the engine | ||
13 | allows this correctly, so the restriction on lowest 4 bits of | ||
14 | address can be lifted safely. | ||
15 | |||
16 | The comments added were by envyas, I think because I used | ||
17 | a newer version. | ||
18 | |||
19 | Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> | ||
20 | [bwh: Backported to 3.2: no # prefixes in nva3_copy.fuc] | ||
21 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
22 | --- | ||
23 | drivers/gpu/drm/nouveau/nva3_copy.fuc | 4 +- | ||
24 | drivers/gpu/drm/nouveau/nva3_copy.fuc.h | 94 +++++++++++++++++++++++++++++- | ||
25 | drivers/gpu/drm/nouveau/nvc0_copy.fuc.h | 87 +++++++++++++++++++++++++++- | ||
26 | 3 files changed, 175 insertions(+), 10 deletions(-) | ||
27 | |||
28 | diff --git a/drivers/gpu/drm/nouveau/nva3_copy.fuc b/drivers/gpu/drm/nouveau/nva3_copy.fuc | ||
29 | index eaf35f8..d894731 100644 | ||
30 | --- a/drivers/gpu/drm/nouveau/nva3_copy.fuc | ||
31 | +++ b/drivers/gpu/drm/nouveau/nva3_copy.fuc | ||
32 | @@ -118,9 +118,9 @@ dispatch_dma: | ||
33 | // mthd 0x030c-0x0340, various stuff | ||
34 | .b16 0xc3 14 | ||
35 | .b32 ctx_src_address_high ~0x000000ff | ||
36 | -.b32 ctx_src_address_low ~0xfffffff0 | ||
37 | +.b32 ctx_src_address_low ~0xffffffff | ||
38 | .b32 ctx_dst_address_high ~0x000000ff | ||
39 | -.b32 ctx_dst_address_low ~0xfffffff0 | ||
40 | +.b32 ctx_dst_address_low ~0xffffffff | ||
41 | .b32 ctx_src_pitch ~0x0007ffff | ||
42 | .b32 ctx_dst_pitch ~0x0007ffff | ||
43 | .b32 ctx_xcnt ~0x0000ffff | ||
44 | diff --git a/drivers/gpu/drm/nouveau/nva3_copy.fuc.h b/drivers/gpu/drm/nouveau/nva3_copy.fuc.h | ||
45 | index 2731de2..e2a0e88 100644 | ||
46 | --- a/drivers/gpu/drm/nouveau/nva3_copy.fuc.h | ||
47 | +++ b/drivers/gpu/drm/nouveau/nva3_copy.fuc.h | ||
48 | @@ -1,37 +1,72 @@ | ||
49 | -uint32_t nva3_pcopy_data[] = { | ||
50 | +u32 nva3_pcopy_data[] = { | ||
51 | +/* 0x0000: ctx_object */ | ||
52 | 0x00000000, | ||
53 | +/* 0x0004: ctx_dma */ | ||
54 | +/* 0x0004: ctx_dma_query */ | ||
55 | 0x00000000, | ||
56 | +/* 0x0008: ctx_dma_src */ | ||
57 | 0x00000000, | ||
58 | +/* 0x000c: ctx_dma_dst */ | ||
59 | 0x00000000, | ||
60 | +/* 0x0010: ctx_query_address_high */ | ||
61 | 0x00000000, | ||
62 | +/* 0x0014: ctx_query_address_low */ | ||
63 | 0x00000000, | ||
64 | +/* 0x0018: ctx_query_counter */ | ||
65 | 0x00000000, | ||
66 | +/* 0x001c: ctx_src_address_high */ | ||
67 | 0x00000000, | ||
68 | +/* 0x0020: ctx_src_address_low */ | ||
69 | 0x00000000, | ||
70 | +/* 0x0024: ctx_src_pitch */ | ||
71 | 0x00000000, | ||
72 | +/* 0x0028: ctx_src_tile_mode */ | ||
73 | 0x00000000, | ||
74 | +/* 0x002c: ctx_src_xsize */ | ||
75 | 0x00000000, | ||
76 | +/* 0x0030: ctx_src_ysize */ | ||
77 | 0x00000000, | ||
78 | +/* 0x0034: ctx_src_zsize */ | ||
79 | 0x00000000, | ||
80 | +/* 0x0038: ctx_src_zoff */ | ||
81 | 0x00000000, | ||
82 | +/* 0x003c: ctx_src_xoff */ | ||
83 | 0x00000000, | ||
84 | +/* 0x0040: ctx_src_yoff */ | ||
85 | 0x00000000, | ||
86 | +/* 0x0044: ctx_src_cpp */ | ||
87 | 0x00000000, | ||
88 | +/* 0x0048: ctx_dst_address_high */ | ||
89 | 0x00000000, | ||
90 | +/* 0x004c: ctx_dst_address_low */ | ||
91 | 0x00000000, | ||
92 | +/* 0x0050: ctx_dst_pitch */ | ||
93 | 0x00000000, | ||
94 | +/* 0x0054: ctx_dst_tile_mode */ | ||
95 | 0x00000000, | ||
96 | +/* 0x0058: ctx_dst_xsize */ | ||
97 | 0x00000000, | ||
98 | +/* 0x005c: ctx_dst_ysize */ | ||
99 | 0x00000000, | ||
100 | +/* 0x0060: ctx_dst_zsize */ | ||
101 | 0x00000000, | ||
102 | +/* 0x0064: ctx_dst_zoff */ | ||
103 | 0x00000000, | ||
104 | +/* 0x0068: ctx_dst_xoff */ | ||
105 | 0x00000000, | ||
106 | +/* 0x006c: ctx_dst_yoff */ | ||
107 | 0x00000000, | ||
108 | +/* 0x0070: ctx_dst_cpp */ | ||
109 | 0x00000000, | ||
110 | +/* 0x0074: ctx_format */ | ||
111 | 0x00000000, | ||
112 | +/* 0x0078: ctx_swz_const0 */ | ||
113 | 0x00000000, | ||
114 | +/* 0x007c: ctx_swz_const1 */ | ||
115 | 0x00000000, | ||
116 | +/* 0x0080: ctx_xcnt */ | ||
117 | 0x00000000, | ||
118 | +/* 0x0084: ctx_ycnt */ | ||
119 | 0x00000000, | ||
120 | 0x00000000, | ||
121 | 0x00000000, | ||
122 | @@ -63,6 +98,7 @@ uint32_t nva3_pcopy_data[] = { | ||
123 | 0x00000000, | ||
124 | 0x00000000, | ||
125 | 0x00000000, | ||
126 | +/* 0x0100: dispatch_table */ | ||
127 | 0x00010000, | ||
128 | 0x00000000, | ||
129 | 0x00000000, | ||
130 | @@ -73,6 +109,7 @@ uint32_t nva3_pcopy_data[] = { | ||
131 | 0x00010162, | ||
132 | 0x00000000, | ||
133 | 0x00030060, | ||
134 | +/* 0x0128: dispatch_dma */ | ||
135 | 0x00010170, | ||
136 | 0x00000000, | ||
137 | 0x00010170, | ||
138 | @@ -118,11 +155,11 @@ uint32_t nva3_pcopy_data[] = { | ||
139 | 0x0000001c, | ||
140 | 0xffffff00, | ||
141 | 0x00000020, | ||
142 | - 0x0000000f, | ||
143 | + 0x00000000, | ||
144 | 0x00000048, | ||
145 | 0xffffff00, | ||
146 | 0x0000004c, | ||
147 | - 0x0000000f, | ||
148 | + 0x00000000, | ||
149 | 0x00000024, | ||
150 | 0xfff80000, | ||
151 | 0x00000050, | ||
152 | @@ -146,7 +183,8 @@ uint32_t nva3_pcopy_data[] = { | ||
153 | 0x00000800, | ||
154 | }; | ||
155 | |||
156 | -uint32_t nva3_pcopy_code[] = { | ||
157 | +u32 nva3_pcopy_code[] = { | ||
158 | +/* 0x0000: main */ | ||
159 | 0x04fe04bd, | ||
160 | 0x3517f000, | ||
161 | 0xf10010fe, | ||
162 | @@ -158,23 +196,31 @@ uint32_t nva3_pcopy_code[] = { | ||
163 | 0x17f11031, | ||
164 | 0x27f01200, | ||
165 | 0x0012d003, | ||
166 | +/* 0x002f: spin */ | ||
167 | 0xf40031f4, | ||
168 | 0x0ef40028, | ||
169 | +/* 0x0035: ih */ | ||
170 | 0x8001cffd, | ||
171 | 0xf40812c4, | ||
172 | 0x21f4060b, | ||
173 | +/* 0x0041: ih_no_chsw */ | ||
174 | 0x0412c472, | ||
175 | 0xf4060bf4, | ||
176 | +/* 0x004a: ih_no_cmd */ | ||
177 | 0x11c4c321, | ||
178 | 0x4001d00c, | ||
179 | +/* 0x0052: swctx */ | ||
180 | 0x47f101f8, | ||
181 | 0x4bfe7700, | ||
182 | 0x0007fe00, | ||
183 | 0xf00204b9, | ||
184 | 0x01f40643, | ||
185 | 0x0604fa09, | ||
186 | +/* 0x006b: swctx_load */ | ||
187 | 0xfa060ef4, | ||
188 | +/* 0x006e: swctx_done */ | ||
189 | 0x03f80504, | ||
190 | +/* 0x0072: chsw */ | ||
191 | 0x27f100f8, | ||
192 | 0x23cf1400, | ||
193 | 0x1e3fc800, | ||
194 | @@ -183,18 +229,22 @@ uint32_t nva3_pcopy_code[] = { | ||
195 | 0x1e3af052, | ||
196 | 0xf00023d0, | ||
197 | 0x24d00147, | ||
198 | +/* 0x0093: chsw_no_unload */ | ||
199 | 0xcf00f880, | ||
200 | 0x3dc84023, | ||
201 | 0x220bf41e, | ||
202 | 0xf40131f4, | ||
203 | 0x57f05221, | ||
204 | 0x0367f004, | ||
205 | +/* 0x00a8: chsw_load_ctx_dma */ | ||
206 | 0xa07856bc, | ||
207 | 0xb6018068, | ||
208 | 0x87d00884, | ||
209 | 0x0162b600, | ||
210 | +/* 0x00bb: chsw_finish_load */ | ||
211 | 0xf0f018f4, | ||
212 | 0x23d00237, | ||
213 | +/* 0x00c3: dispatch */ | ||
214 | 0xf100f880, | ||
215 | 0xcf190037, | ||
216 | 0x33cf4032, | ||
217 | @@ -202,6 +252,7 @@ uint32_t nva3_pcopy_code[] = { | ||
218 | 0x1024b607, | ||
219 | 0x010057f1, | ||
220 | 0x74bd64bd, | ||
221 | +/* 0x00dc: dispatch_loop */ | ||
222 | 0x58005658, | ||
223 | 0x50b60157, | ||
224 | 0x0446b804, | ||
225 | @@ -211,6 +262,7 @@ uint32_t nva3_pcopy_code[] = { | ||
226 | 0xb60276bb, | ||
227 | 0x57bb0374, | ||
228 | 0xdf0ef400, | ||
229 | +/* 0x0100: dispatch_valid_mthd */ | ||
230 | 0xb60246bb, | ||
231 | 0x45bb0344, | ||
232 | 0x01459800, | ||
233 | @@ -220,31 +272,41 @@ uint32_t nva3_pcopy_code[] = { | ||
234 | 0xb0014658, | ||
235 | 0x1bf40064, | ||
236 | 0x00538009, | ||
237 | +/* 0x0127: dispatch_cmd */ | ||
238 | 0xf4300ef4, | ||
239 | 0x55f90132, | ||
240 | 0xf40c01f4, | ||
241 | +/* 0x0132: dispatch_invalid_bitfield */ | ||
242 | 0x25f0250e, | ||
243 | +/* 0x0135: dispatch_illegal_mthd */ | ||
244 | 0x0125f002, | ||
245 | +/* 0x0138: dispatch_error */ | ||
246 | 0x100047f1, | ||
247 | 0xd00042d0, | ||
248 | 0x27f04043, | ||
249 | 0x0002d040, | ||
250 | +/* 0x0148: hostirq_wait */ | ||
251 | 0xf08002cf, | ||
252 | 0x24b04024, | ||
253 | 0xf71bf400, | ||
254 | +/* 0x0154: dispatch_done */ | ||
255 | 0x1d0027f1, | ||
256 | 0xd00137f0, | ||
257 | 0x00f80023, | ||
258 | +/* 0x0160: cmd_nop */ | ||
259 | +/* 0x0162: cmd_pm_trigger */ | ||
260 | 0x27f100f8, | ||
261 | 0x34bd2200, | ||
262 | 0xd00233f0, | ||
263 | 0x00f80023, | ||
264 | +/* 0x0170: cmd_dma */ | ||
265 | 0x012842b7, | ||
266 | 0xf00145b6, | ||
267 | 0x43801e39, | ||
268 | 0x0040b701, | ||
269 | 0x0644b606, | ||
270 | 0xf80043d0, | ||
271 | +/* 0x0189: cmd_exec_set_format */ | ||
272 | 0xf030f400, | ||
273 | 0xb00001b0, | ||
274 | 0x01b00101, | ||
275 | @@ -256,20 +318,26 @@ uint32_t nva3_pcopy_code[] = { | ||
276 | 0x70b63847, | ||
277 | 0x0232f401, | ||
278 | 0x94bd84bd, | ||
279 | +/* 0x01b4: ncomp_loop */ | ||
280 | 0xb60f4ac4, | ||
281 | 0xb4bd0445, | ||
282 | +/* 0x01bc: bpc_loop */ | ||
283 | 0xf404a430, | ||
284 | 0xa5ff0f18, | ||
285 | 0x00cbbbc0, | ||
286 | 0xf40231f4, | ||
287 | +/* 0x01ce: cmp_c0 */ | ||
288 | 0x1bf4220e, | ||
289 | 0x10c7f00c, | ||
290 | 0xf400cbbb, | ||
291 | +/* 0x01da: cmp_c1 */ | ||
292 | 0xa430160e, | ||
293 | 0x0c18f406, | ||
294 | 0xbb14c7f0, | ||
295 | 0x0ef400cb, | ||
296 | +/* 0x01e9: cmp_zero */ | ||
297 | 0x80c7f107, | ||
298 | +/* 0x01ed: bpc_next */ | ||
299 | 0x01c83800, | ||
300 | 0xb60180b6, | ||
301 | 0xb5b801b0, | ||
302 | @@ -280,6 +348,7 @@ uint32_t nva3_pcopy_code[] = { | ||
303 | 0x98110680, | ||
304 | 0x68fd2008, | ||
305 | 0x0502f400, | ||
306 | +/* 0x0216: dst_xcnt */ | ||
307 | 0x75fd64bd, | ||
308 | 0x1c078000, | ||
309 | 0xf10078fd, | ||
310 | @@ -304,6 +373,7 @@ uint32_t nva3_pcopy_code[] = { | ||
311 | 0x980056d0, | ||
312 | 0x56d01f06, | ||
313 | 0x1030f440, | ||
314 | +/* 0x0276: cmd_exec_set_surface_tiled */ | ||
315 | 0x579800f8, | ||
316 | 0x6879c70a, | ||
317 | 0xb66478c7, | ||
318 | @@ -311,9 +381,11 @@ uint32_t nva3_pcopy_code[] = { | ||
319 | 0x0e76b060, | ||
320 | 0xf0091bf4, | ||
321 | 0x0ef40477, | ||
322 | +/* 0x0291: xtile64 */ | ||
323 | 0x027cf00f, | ||
324 | 0xfd1170b6, | ||
325 | 0x77f00947, | ||
326 | +/* 0x029d: xtileok */ | ||
327 | 0x0f5a9806, | ||
328 | 0xfd115b98, | ||
329 | 0xb7f000ab, | ||
330 | @@ -371,6 +443,7 @@ uint32_t nva3_pcopy_code[] = { | ||
331 | 0x67d00600, | ||
332 | 0x0060b700, | ||
333 | 0x0068d004, | ||
334 | +/* 0x0382: cmd_exec_set_surface_linear */ | ||
335 | 0x6cf000f8, | ||
336 | 0x0260b702, | ||
337 | 0x0864b602, | ||
338 | @@ -381,13 +454,16 @@ uint32_t nva3_pcopy_code[] = { | ||
339 | 0xb70067d0, | ||
340 | 0x98040060, | ||
341 | 0x67d00957, | ||
342 | +/* 0x03ab: cmd_exec_wait */ | ||
343 | 0xf900f800, | ||
344 | 0xf110f900, | ||
345 | 0xb6080007, | ||
346 | +/* 0x03b6: loop */ | ||
347 | 0x01cf0604, | ||
348 | 0x0114f000, | ||
349 | 0xfcfa1bf4, | ||
350 | 0xf800fc10, | ||
351 | +/* 0x03c5: cmd_exec_query */ | ||
352 | 0x0d34c800, | ||
353 | 0xf5701bf4, | ||
354 | 0xf103ab21, | ||
355 | @@ -417,6 +493,7 @@ uint32_t nva3_pcopy_code[] = { | ||
356 | 0x47f10153, | ||
357 | 0x44b60800, | ||
358 | 0x0045d006, | ||
359 | +/* 0x0438: query_counter */ | ||
360 | 0x03ab21f5, | ||
361 | 0x080c47f1, | ||
362 | 0x980644b6, | ||
363 | @@ -439,11 +516,13 @@ uint32_t nva3_pcopy_code[] = { | ||
364 | 0x47f10153, | ||
365 | 0x44b60800, | ||
366 | 0x0045d006, | ||
367 | +/* 0x0492: cmd_exec */ | ||
368 | 0x21f500f8, | ||
369 | 0x3fc803ab, | ||
370 | 0x0e0bf400, | ||
371 | 0x018921f5, | ||
372 | 0x020047f1, | ||
373 | +/* 0x04a7: cmd_exec_no_format */ | ||
374 | 0xf11e0ef4, | ||
375 | 0xb6081067, | ||
376 | 0x77f00664, | ||
377 | @@ -451,19 +530,24 @@ uint32_t nva3_pcopy_code[] = { | ||
378 | 0x981c0780, | ||
379 | 0x67d02007, | ||
380 | 0x4067d000, | ||
381 | +/* 0x04c2: cmd_exec_init_src_surface */ | ||
382 | 0x32f444bd, | ||
383 | 0xc854bd02, | ||
384 | 0x0bf4043f, | ||
385 | 0x8221f50a, | ||
386 | 0x0a0ef403, | ||
387 | +/* 0x04d4: src_tiled */ | ||
388 | 0x027621f5, | ||
389 | +/* 0x04db: cmd_exec_init_dst_surface */ | ||
390 | 0xf40749f0, | ||
391 | 0x57f00231, | ||
392 | 0x083fc82c, | ||
393 | 0xf50a0bf4, | ||
394 | 0xf4038221, | ||
395 | +/* 0x04ee: dst_tiled */ | ||
396 | 0x21f50a0e, | ||
397 | 0x49f00276, | ||
398 | +/* 0x04f5: cmd_exec_kick */ | ||
399 | 0x0057f108, | ||
400 | 0x0654b608, | ||
401 | 0xd0210698, | ||
402 | @@ -473,6 +557,8 @@ uint32_t nva3_pcopy_code[] = { | ||
403 | 0xc80054d0, | ||
404 | 0x0bf40c3f, | ||
405 | 0xc521f507, | ||
406 | +/* 0x0519: cmd_exec_done */ | ||
407 | +/* 0x051b: cmd_wrcache_flush */ | ||
408 | 0xf100f803, | ||
409 | 0xbd220027, | ||
410 | 0x0133f034, | ||
411 | diff --git a/drivers/gpu/drm/nouveau/nvc0_copy.fuc.h b/drivers/gpu/drm/nouveau/nvc0_copy.fuc.h | ||
412 | index 4199038..9e87036 100644 | ||
413 | --- a/drivers/gpu/drm/nouveau/nvc0_copy.fuc.h | ||
414 | +++ b/drivers/gpu/drm/nouveau/nvc0_copy.fuc.h | ||
415 | @@ -1,34 +1,65 @@ | ||
416 | -uint32_t nvc0_pcopy_data[] = { | ||
417 | +u32 nvc0_pcopy_data[] = { | ||
418 | +/* 0x0000: ctx_object */ | ||
419 | 0x00000000, | ||
420 | +/* 0x0004: ctx_query_address_high */ | ||
421 | 0x00000000, | ||
422 | +/* 0x0008: ctx_query_address_low */ | ||
423 | 0x00000000, | ||
424 | +/* 0x000c: ctx_query_counter */ | ||
425 | 0x00000000, | ||
426 | +/* 0x0010: ctx_src_address_high */ | ||
427 | 0x00000000, | ||
428 | +/* 0x0014: ctx_src_address_low */ | ||
429 | 0x00000000, | ||
430 | +/* 0x0018: ctx_src_pitch */ | ||
431 | 0x00000000, | ||
432 | +/* 0x001c: ctx_src_tile_mode */ | ||
433 | 0x00000000, | ||
434 | +/* 0x0020: ctx_src_xsize */ | ||
435 | 0x00000000, | ||
436 | +/* 0x0024: ctx_src_ysize */ | ||
437 | 0x00000000, | ||
438 | +/* 0x0028: ctx_src_zsize */ | ||
439 | 0x00000000, | ||
440 | +/* 0x002c: ctx_src_zoff */ | ||
441 | 0x00000000, | ||
442 | +/* 0x0030: ctx_src_xoff */ | ||
443 | 0x00000000, | ||
444 | +/* 0x0034: ctx_src_yoff */ | ||
445 | 0x00000000, | ||
446 | +/* 0x0038: ctx_src_cpp */ | ||
447 | 0x00000000, | ||
448 | +/* 0x003c: ctx_dst_address_high */ | ||
449 | 0x00000000, | ||
450 | +/* 0x0040: ctx_dst_address_low */ | ||
451 | 0x00000000, | ||
452 | +/* 0x0044: ctx_dst_pitch */ | ||
453 | 0x00000000, | ||
454 | +/* 0x0048: ctx_dst_tile_mode */ | ||
455 | 0x00000000, | ||
456 | +/* 0x004c: ctx_dst_xsize */ | ||
457 | 0x00000000, | ||
458 | +/* 0x0050: ctx_dst_ysize */ | ||
459 | 0x00000000, | ||
460 | +/* 0x0054: ctx_dst_zsize */ | ||
461 | 0x00000000, | ||
462 | +/* 0x0058: ctx_dst_zoff */ | ||
463 | 0x00000000, | ||
464 | +/* 0x005c: ctx_dst_xoff */ | ||
465 | 0x00000000, | ||
466 | +/* 0x0060: ctx_dst_yoff */ | ||
467 | 0x00000000, | ||
468 | +/* 0x0064: ctx_dst_cpp */ | ||
469 | 0x00000000, | ||
470 | +/* 0x0068: ctx_format */ | ||
471 | 0x00000000, | ||
472 | +/* 0x006c: ctx_swz_const0 */ | ||
473 | 0x00000000, | ||
474 | +/* 0x0070: ctx_swz_const1 */ | ||
475 | 0x00000000, | ||
476 | +/* 0x0074: ctx_xcnt */ | ||
477 | 0x00000000, | ||
478 | +/* 0x0078: ctx_ycnt */ | ||
479 | 0x00000000, | ||
480 | 0x00000000, | ||
481 | 0x00000000, | ||
482 | @@ -63,6 +94,7 @@ uint32_t nvc0_pcopy_data[] = { | ||
483 | 0x00000000, | ||
484 | 0x00000000, | ||
485 | 0x00000000, | ||
486 | +/* 0x0100: dispatch_table */ | ||
487 | 0x00010000, | ||
488 | 0x00000000, | ||
489 | 0x00000000, | ||
490 | @@ -111,11 +143,11 @@ uint32_t nvc0_pcopy_data[] = { | ||
491 | 0x00000010, | ||
492 | 0xffffff00, | ||
493 | 0x00000014, | ||
494 | - 0x0000000f, | ||
495 | + 0x00000000, | ||
496 | 0x0000003c, | ||
497 | 0xffffff00, | ||
498 | 0x00000040, | ||
499 | - 0x0000000f, | ||
500 | + 0x00000000, | ||
501 | 0x00000018, | ||
502 | 0xfff80000, | ||
503 | 0x00000044, | ||
504 | @@ -139,7 +171,8 @@ uint32_t nvc0_pcopy_data[] = { | ||
505 | 0x00000800, | ||
506 | }; | ||
507 | |||
508 | -uint32_t nvc0_pcopy_code[] = { | ||
509 | +u32 nvc0_pcopy_code[] = { | ||
510 | +/* 0x0000: main */ | ||
511 | 0x04fe04bd, | ||
512 | 0x3517f000, | ||
513 | 0xf10010fe, | ||
514 | @@ -151,15 +184,20 @@ uint32_t nvc0_pcopy_code[] = { | ||
515 | 0x17f11031, | ||
516 | 0x27f01200, | ||
517 | 0x0012d003, | ||
518 | +/* 0x002f: spin */ | ||
519 | 0xf40031f4, | ||
520 | 0x0ef40028, | ||
521 | +/* 0x0035: ih */ | ||
522 | 0x8001cffd, | ||
523 | 0xf40812c4, | ||
524 | 0x21f4060b, | ||
525 | +/* 0x0041: ih_no_chsw */ | ||
526 | 0x0412c4ca, | ||
527 | 0xf5070bf4, | ||
528 | +/* 0x004b: ih_no_cmd */ | ||
529 | 0xc4010221, | ||
530 | 0x01d00c11, | ||
531 | +/* 0x0053: swctx */ | ||
532 | 0xf101f840, | ||
533 | 0xfe770047, | ||
534 | 0x47f1004b, | ||
535 | @@ -188,8 +226,11 @@ uint32_t nvc0_pcopy_code[] = { | ||
536 | 0xf00204b9, | ||
537 | 0x01f40643, | ||
538 | 0x0604fa09, | ||
539 | +/* 0x00c3: swctx_load */ | ||
540 | 0xfa060ef4, | ||
541 | +/* 0x00c6: swctx_done */ | ||
542 | 0x03f80504, | ||
543 | +/* 0x00ca: chsw */ | ||
544 | 0x27f100f8, | ||
545 | 0x23cf1400, | ||
546 | 0x1e3fc800, | ||
547 | @@ -198,18 +239,22 @@ uint32_t nvc0_pcopy_code[] = { | ||
548 | 0x1e3af053, | ||
549 | 0xf00023d0, | ||
550 | 0x24d00147, | ||
551 | +/* 0x00eb: chsw_no_unload */ | ||
552 | 0xcf00f880, | ||
553 | 0x3dc84023, | ||
554 | 0x090bf41e, | ||
555 | 0xf40131f4, | ||
556 | +/* 0x00fa: chsw_finish_load */ | ||
557 | 0x37f05321, | ||
558 | 0x8023d002, | ||
559 | +/* 0x0102: dispatch */ | ||
560 | 0x37f100f8, | ||
561 | 0x32cf1900, | ||
562 | 0x0033cf40, | ||
563 | 0x07ff24e4, | ||
564 | 0xf11024b6, | ||
565 | 0xbd010057, | ||
566 | +/* 0x011b: dispatch_loop */ | ||
567 | 0x5874bd64, | ||
568 | 0x57580056, | ||
569 | 0x0450b601, | ||
570 | @@ -219,6 +264,7 @@ uint32_t nvc0_pcopy_code[] = { | ||
571 | 0xbb0f08f4, | ||
572 | 0x74b60276, | ||
573 | 0x0057bb03, | ||
574 | +/* 0x013f: dispatch_valid_mthd */ | ||
575 | 0xbbdf0ef4, | ||
576 | 0x44b60246, | ||
577 | 0x0045bb03, | ||
578 | @@ -229,24 +275,33 @@ uint32_t nvc0_pcopy_code[] = { | ||
579 | 0x64b00146, | ||
580 | 0x091bf400, | ||
581 | 0xf4005380, | ||
582 | +/* 0x0166: dispatch_cmd */ | ||
583 | 0x32f4300e, | ||
584 | 0xf455f901, | ||
585 | 0x0ef40c01, | ||
586 | +/* 0x0171: dispatch_invalid_bitfield */ | ||
587 | 0x0225f025, | ||
588 | +/* 0x0174: dispatch_illegal_mthd */ | ||
589 | +/* 0x0177: dispatch_error */ | ||
590 | 0xf10125f0, | ||
591 | 0xd0100047, | ||
592 | 0x43d00042, | ||
593 | 0x4027f040, | ||
594 | +/* 0x0187: hostirq_wait */ | ||
595 | 0xcf0002d0, | ||
596 | 0x24f08002, | ||
597 | 0x0024b040, | ||
598 | +/* 0x0193: dispatch_done */ | ||
599 | 0xf1f71bf4, | ||
600 | 0xf01d0027, | ||
601 | 0x23d00137, | ||
602 | +/* 0x019f: cmd_nop */ | ||
603 | 0xf800f800, | ||
604 | +/* 0x01a1: cmd_pm_trigger */ | ||
605 | 0x0027f100, | ||
606 | 0xf034bd22, | ||
607 | 0x23d00233, | ||
608 | +/* 0x01af: cmd_exec_set_format */ | ||
609 | 0xf400f800, | ||
610 | 0x01b0f030, | ||
611 | 0x0101b000, | ||
612 | @@ -258,20 +313,26 @@ uint32_t nvc0_pcopy_code[] = { | ||
613 | 0x3847c701, | ||
614 | 0xf40170b6, | ||
615 | 0x84bd0232, | ||
616 | +/* 0x01da: ncomp_loop */ | ||
617 | 0x4ac494bd, | ||
618 | 0x0445b60f, | ||
619 | +/* 0x01e2: bpc_loop */ | ||
620 | 0xa430b4bd, | ||
621 | 0x0f18f404, | ||
622 | 0xbbc0a5ff, | ||
623 | 0x31f400cb, | ||
624 | 0x220ef402, | ||
625 | +/* 0x01f4: cmp_c0 */ | ||
626 | 0xf00c1bf4, | ||
627 | 0xcbbb10c7, | ||
628 | 0x160ef400, | ||
629 | +/* 0x0200: cmp_c1 */ | ||
630 | 0xf406a430, | ||
631 | 0xc7f00c18, | ||
632 | 0x00cbbb14, | ||
633 | +/* 0x020f: cmp_zero */ | ||
634 | 0xf1070ef4, | ||
635 | +/* 0x0213: bpc_next */ | ||
636 | 0x380080c7, | ||
637 | 0x80b601c8, | ||
638 | 0x01b0b601, | ||
639 | @@ -283,6 +344,7 @@ uint32_t nvc0_pcopy_code[] = { | ||
640 | 0x1d08980e, | ||
641 | 0xf40068fd, | ||
642 | 0x64bd0502, | ||
643 | +/* 0x023c: dst_xcnt */ | ||
644 | 0x800075fd, | ||
645 | 0x78fd1907, | ||
646 | 0x1057f100, | ||
647 | @@ -307,15 +369,18 @@ uint32_t nvc0_pcopy_code[] = { | ||
648 | 0x1c069800, | ||
649 | 0xf44056d0, | ||
650 | 0x00f81030, | ||
651 | +/* 0x029c: cmd_exec_set_surface_tiled */ | ||
652 | 0xc7075798, | ||
653 | 0x78c76879, | ||
654 | 0x0380b664, | ||
655 | 0xb06077c7, | ||
656 | 0x1bf40e76, | ||
657 | 0x0477f009, | ||
658 | +/* 0x02b7: xtile64 */ | ||
659 | 0xf00f0ef4, | ||
660 | 0x70b6027c, | ||
661 | 0x0947fd11, | ||
662 | +/* 0x02c3: xtileok */ | ||
663 | 0x980677f0, | ||
664 | 0x5b980c5a, | ||
665 | 0x00abfd0e, | ||
666 | @@ -374,6 +439,7 @@ uint32_t nvc0_pcopy_code[] = { | ||
667 | 0xb70067d0, | ||
668 | 0xd0040060, | ||
669 | 0x00f80068, | ||
670 | +/* 0x03a8: cmd_exec_set_surface_linear */ | ||
671 | 0xb7026cf0, | ||
672 | 0xb6020260, | ||
673 | 0x57980864, | ||
674 | @@ -384,12 +450,15 @@ uint32_t nvc0_pcopy_code[] = { | ||
675 | 0x0060b700, | ||
676 | 0x06579804, | ||
677 | 0xf80067d0, | ||
678 | +/* 0x03d1: cmd_exec_wait */ | ||
679 | 0xf900f900, | ||
680 | 0x0007f110, | ||
681 | 0x0604b608, | ||
682 | +/* 0x03dc: loop */ | ||
683 | 0xf00001cf, | ||
684 | 0x1bf40114, | ||
685 | 0xfc10fcfa, | ||
686 | +/* 0x03eb: cmd_exec_query */ | ||
687 | 0xc800f800, | ||
688 | 0x1bf40d34, | ||
689 | 0xd121f570, | ||
690 | @@ -419,6 +488,7 @@ uint32_t nvc0_pcopy_code[] = { | ||
691 | 0x0153f026, | ||
692 | 0x080047f1, | ||
693 | 0xd00644b6, | ||
694 | +/* 0x045e: query_counter */ | ||
695 | 0x21f50045, | ||
696 | 0x47f103d1, | ||
697 | 0x44b6080c, | ||
698 | @@ -442,11 +512,13 @@ uint32_t nvc0_pcopy_code[] = { | ||
699 | 0x080047f1, | ||
700 | 0xd00644b6, | ||
701 | 0x00f80045, | ||
702 | +/* 0x04b8: cmd_exec */ | ||
703 | 0x03d121f5, | ||
704 | 0xf4003fc8, | ||
705 | 0x21f50e0b, | ||
706 | 0x47f101af, | ||
707 | 0x0ef40200, | ||
708 | +/* 0x04cd: cmd_exec_no_format */ | ||
709 | 0x1067f11e, | ||
710 | 0x0664b608, | ||
711 | 0x800177f0, | ||
712 | @@ -454,18 +526,23 @@ uint32_t nvc0_pcopy_code[] = { | ||
713 | 0x1d079819, | ||
714 | 0xd00067d0, | ||
715 | 0x44bd4067, | ||
716 | +/* 0x04e8: cmd_exec_init_src_surface */ | ||
717 | 0xbd0232f4, | ||
718 | 0x043fc854, | ||
719 | 0xf50a0bf4, | ||
720 | 0xf403a821, | ||
721 | +/* 0x04fa: src_tiled */ | ||
722 | 0x21f50a0e, | ||
723 | 0x49f0029c, | ||
724 | +/* 0x0501: cmd_exec_init_dst_surface */ | ||
725 | 0x0231f407, | ||
726 | 0xc82c57f0, | ||
727 | 0x0bf4083f, | ||
728 | 0xa821f50a, | ||
729 | 0x0a0ef403, | ||
730 | +/* 0x0514: dst_tiled */ | ||
731 | 0x029c21f5, | ||
732 | +/* 0x051b: cmd_exec_kick */ | ||
733 | 0xf10849f0, | ||
734 | 0xb6080057, | ||
735 | 0x06980654, | ||
736 | @@ -475,7 +552,9 @@ uint32_t nvc0_pcopy_code[] = { | ||
737 | 0x54d00546, | ||
738 | 0x0c3fc800, | ||
739 | 0xf5070bf4, | ||
740 | +/* 0x053f: cmd_exec_done */ | ||
741 | 0xf803eb21, | ||
742 | +/* 0x0541: cmd_wrcache_flush */ | ||
743 | 0x0027f100, | ||
744 | 0xf034bd22, | ||
745 | 0x23d00133, | ||
746 | -- | ||
747 | 1.7.7.6 | ||
748 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0072-mm-fix-wrong-argument-of-migrate_huge_pages-in-soft_.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0072-mm-fix-wrong-argument-of-migrate_huge_pages-in-soft_.patch new file mode 100644 index 00000000..6d93ddaa --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0072-mm-fix-wrong-argument-of-migrate_huge_pages-in-soft_.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | From 10d09034790926ded3c2ee655d72c48219d61122 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joonsoo Kim <js1304@gmail.com> | ||
3 | Date: Mon, 30 Jul 2012 14:39:04 -0700 | ||
4 | Subject: [PATCH 72/73] mm: fix wrong argument of migrate_huge_pages() in | ||
5 | soft_offline_huge_page() | ||
6 | |||
7 | commit dc32f63453f56d07a1073a697dcd843dd3098c09 upstream. | ||
8 | |||
9 | Commit a6bc32b89922 ("mm: compaction: introduce sync-light migration for | ||
10 | use by compaction") changed the declaration of migrate_pages() and | ||
11 | migrate_huge_pages(). | ||
12 | |||
13 | But it missed changing the argument of migrate_huge_pages() in | ||
14 | soft_offline_huge_page(). In this case, we should call | ||
15 | migrate_huge_pages() with MIGRATE_SYNC. | ||
16 | |||
17 | Additionally, there is a mismatch between type the of argument and the | ||
18 | function declaration for migrate_pages(). | ||
19 | |||
20 | Signed-off-by: Joonsoo Kim <js1304@gmail.com> | ||
21 | Cc: Christoph Lameter <cl@linux.com> | ||
22 | Cc: Mel Gorman <mgorman@suse.de> | ||
23 | Acked-by: David Rientjes <rientjes@google.com> | ||
24 | Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> | ||
25 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
26 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
27 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
28 | --- | ||
29 | mm/memory-failure.c | 6 +++--- | ||
30 | 1 files changed, 3 insertions(+), 3 deletions(-) | ||
31 | |||
32 | diff --git a/mm/memory-failure.c b/mm/memory-failure.c | ||
33 | index 56080ea..5bd5bb1 100644 | ||
34 | --- a/mm/memory-failure.c | ||
35 | +++ b/mm/memory-failure.c | ||
36 | @@ -1427,8 +1427,8 @@ static int soft_offline_huge_page(struct page *page, int flags) | ||
37 | /* Keep page count to indicate a given hugepage is isolated. */ | ||
38 | |||
39 | list_add(&hpage->lru, &pagelist); | ||
40 | - ret = migrate_huge_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL, 0, | ||
41 | - true); | ||
42 | + ret = migrate_huge_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL, false, | ||
43 | + MIGRATE_SYNC); | ||
44 | if (ret) { | ||
45 | struct page *page1, *page2; | ||
46 | list_for_each_entry_safe(page1, page2, &pagelist, lru) | ||
47 | @@ -1557,7 +1557,7 @@ int soft_offline_page(struct page *page, int flags) | ||
48 | page_is_file_cache(page)); | ||
49 | list_add(&page->lru, &pagelist); | ||
50 | ret = migrate_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL, | ||
51 | - 0, MIGRATE_SYNC); | ||
52 | + false, MIGRATE_SYNC); | ||
53 | if (ret) { | ||
54 | putback_lru_pages(&pagelist); | ||
55 | pr_info("soft offline: %#lx: migration failed %d, type %lx\n", | ||
56 | -- | ||
57 | 1.7.7.6 | ||
58 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0073-Linux-3.2.25.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0073-Linux-3.2.25.patch new file mode 100644 index 00000000..cb9db480 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0073-Linux-3.2.25.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | From d5f196e5b0f7d3770840af22c9fbd4b8355fd792 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ben Hutchings <ben@decadent.org.uk> | ||
3 | Date: Thu, 2 Aug 2012 14:38:04 +0100 | ||
4 | Subject: [PATCH 73/73] Linux 3.2.25 | ||
5 | |||
6 | --- | ||
7 | Makefile | 2 +- | ||
8 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
9 | |||
10 | diff --git a/Makefile b/Makefile | ||
11 | index 80bb4fd..e13e4e7 100644 | ||
12 | --- a/Makefile | ||
13 | +++ b/Makefile | ||
14 | @@ -1,6 +1,6 @@ | ||
15 | VERSION = 3 | ||
16 | PATCHLEVEL = 2 | ||
17 | -SUBLEVEL = 24 | ||
18 | +SUBLEVEL = 25 | ||
19 | EXTRAVERSION = | ||
20 | NAME = Saber-toothed Squirrel | ||
21 | |||
22 | -- | ||
23 | 1.7.7.6 | ||
24 | |||
diff --git a/recipes-kernel/linux/linux-ti33x-psp_3.2.bb b/recipes-kernel/linux/linux-ti33x-psp_3.2.bb index 4c870bc9..77b16801 100644 --- a/recipes-kernel/linux/linux-ti33x-psp_3.2.bb +++ b/recipes-kernel/linux/linux-ti33x-psp_3.2.bb | |||
@@ -11,11 +11,11 @@ S = "${WORKDIR}/git" | |||
11 | MULTI_CONFIG_BASE_SUFFIX = "" | 11 | MULTI_CONFIG_BASE_SUFFIX = "" |
12 | 12 | ||
13 | # the PATCHES_OVER_PSP updates it to 3.2.x, so adjust PV to match | 13 | # the PATCHES_OVER_PSP updates it to 3.2.x, so adjust PV to match |
14 | PV = "${@base_contains('DISTRO_FEATURES', 'tipspkernel', "3.2", "3.2.23", d)}" | 14 | PV = "${@base_contains('DISTRO_FEATURES', 'tipspkernel', "3.2", "3.2.25", d)}" |
15 | 15 | ||
16 | BRANCH = "v3.2-staging" | 16 | BRANCH = "v3.2-staging" |
17 | SRCREV = "720e07b4c1f687b61b147b31c698cb6816d72f01" | 17 | SRCREV = "720e07b4c1f687b61b147b31c698cb6816d72f01" |
18 | MACHINE_KERNEL_PR_append = "i+gitr${SRCREV}" | 18 | MACHINE_KERNEL_PR_append = "a+gitr${SRCREV}" |
19 | 19 | ||
20 | COMPATIBLE_MACHINE = "(ti33x)" | 20 | COMPATIBLE_MACHINE = "(ti33x)" |
21 | 21 | ||
@@ -1540,6 +1540,188 @@ PATCHES_OVER_PSP = " \ | |||
1540 | file://3.2.23/0047-tcm_fc-Resolve-suspicious-RCU-usage-warnings.patch \ | 1540 | file://3.2.23/0047-tcm_fc-Resolve-suspicious-RCU-usage-warnings.patch \ |
1541 | file://3.2.23/0048-vfs-make-O_PATH-file-descriptors-usable-for-fchdir.patch \ | 1541 | file://3.2.23/0048-vfs-make-O_PATH-file-descriptors-usable-for-fchdir.patch \ |
1542 | file://3.2.23/0049-Linux-3.2.23.patch \ | 1542 | file://3.2.23/0049-Linux-3.2.23.patch \ |
1543 | file://3.2.24/0001-samsung-laptop-make-the-dmi-check-less-strict.patch \ | ||
1544 | file://3.2.24/0002-raid5-delayed-stripe-fix.patch \ | ||
1545 | file://3.2.24/0003-tcp-drop-SYN-FIN-messages.patch \ | ||
1546 | file://3.2.24/0004-tg3-Apply-short-DMA-frag-workaround-to-5906.patch \ | ||
1547 | file://3.2.24/0005-rtl8187-brightness_set-can-not-sleep.patch \ | ||
1548 | file://3.2.24/0006-net-wireless-ipw2x00-add-supported-cipher-suites-to-.patch \ | ||
1549 | file://3.2.24/0007-drm-i915-do-not-enable-RC6p-on-Sandy-Bridge.patch \ | ||
1550 | file://3.2.24/0008-drm-i915-fix-operator-precedence-when-enabling-RC6p.patch \ | ||
1551 | file://3.2.24/0009-kbuild-do-not-check-for-ancient-modutils-tools.patch \ | ||
1552 | file://3.2.24/0010-brcmsmac-INTERMEDIATE-but-not-AMPDU-only-when-tracin.patch \ | ||
1553 | file://3.2.24/0011-NFSv4-Rate-limit-the-state-manager-for-lock-reclaim-.patch \ | ||
1554 | file://3.2.24/0012-ext4-Report-max_batch_time-option-correctly.patch \ | ||
1555 | file://3.2.24/0013-hugepages-fix-use-after-free-bug-in-quota-handling.patch \ | ||
1556 | file://3.2.24/0014-NFSv4-Reduce-the-footprint-of-the-idmapper.patch \ | ||
1557 | file://3.2.24/0015-NFSv4-Further-reduce-the-footprint-of-the-idmapper.patch \ | ||
1558 | file://3.2.24/0016-macvtap-zerocopy-fix-offset-calculation-when-buildin.patch \ | ||
1559 | file://3.2.24/0017-macvtap-zerocopy-fix-truesize-underestimation.patch \ | ||
1560 | file://3.2.24/0018-macvtap-zerocopy-put-page-when-fail-to-get-all-reque.patch \ | ||
1561 | file://3.2.24/0019-macvtap-zerocopy-set-SKBTX_DEV_ZEROCOPY-only-when-sk.patch \ | ||
1562 | file://3.2.24/0020-macvtap-zerocopy-validate-vectors-before-building-sk.patch \ | ||
1563 | file://3.2.24/0021-KVM-Fix-buffer-overflow-in-kvm_set_irq.patch \ | ||
1564 | file://3.2.24/0022-scsi-Silence-unnecessary-warnings-about-ioctl-to-par.patch \ | ||
1565 | file://3.2.24/0023-epoll-clear-the-tfile_check_list-on-ELOOP.patch \ | ||
1566 | file://3.2.24/0024-iommu-amd-Fix-missing-iommu_shutdown-initialization-.patch \ | ||
1567 | file://3.2.24/0025-iommu-amd-Initialize-dma_ops-for-hotplug-and-sriov-d.patch \ | ||
1568 | file://3.2.24/0026-usb-Add-support-for-root-hub-port-status-CAS.patch \ | ||
1569 | file://3.2.24/0027-gpiolib-wm8994-Pay-attention-to-the-value-set-when-e.patch \ | ||
1570 | file://3.2.24/0028-sched-nohz-Rewrite-and-fix-load-avg-computation-agai.patch \ | ||
1571 | file://3.2.24/0029-USB-option-add-ZTE-MF60.patch \ | ||
1572 | file://3.2.24/0030-USB-option-Add-MEDIATEK-product-ids.patch \ | ||
1573 | file://3.2.24/0031-USB-cdc-wdm-fix-lockup-on-error-in-wdm_read.patch \ | ||
1574 | file://3.2.24/0032-mtd-nandsim-don-t-open-code-a-do_div-helper.patch \ | ||
1575 | file://3.2.24/0033-dvb-core-Release-semaphore-on-error-path-dvb_registe.patch \ | ||
1576 | file://3.2.24/0034-hwspinlock-core-use-global-ID-to-register-hwspinlock.patch \ | ||
1577 | file://3.2.24/0035-libsas-fix-taskfile-corruption-in-sas_ata_qc_fill_rt.patch \ | ||
1578 | file://3.2.24/0036-md-raid1-fix-use-after-free-bug-in-RAID1-data-check-.patch \ | ||
1579 | file://3.2.24/0037-PCI-EHCI-fix-crash-during-suspend-on-ASUS-computers.patch \ | ||
1580 | file://3.2.24/0038-memory-hotplug-fix-invalid-memory-access-caused-by-s.patch \ | ||
1581 | file://3.2.24/0039-ocfs2-fix-NULL-pointer-dereference-in-__ocfs2_change.patch \ | ||
1582 | file://3.2.24/0040-mm-thp-abort-compaction-if-migration-page-cannot-be-.patch \ | ||
1583 | file://3.2.24/0041-drivers-rtc-rtc-mxc.c-fix-irq-enabled-interrupts-war.patch \ | ||
1584 | file://3.2.24/0042-fs-ramfs-file-nommu-add-SetPageUptodate.patch \ | ||
1585 | file://3.2.24/0043-cpufreq-ACPI-Fix-not-loading-acpi-cpufreq-driver-reg.patch \ | ||
1586 | file://3.2.24/0044-hwmon-it87-Preserve-configuration-register-bits-on-i.patch \ | ||
1587 | file://3.2.24/0045-ARM-SAMSUNG-fix-race-in-s3c_adc_start-for-ADC.patch \ | ||
1588 | file://3.2.24/0046-block-fix-infinite-loop-in-__getblk_slow.patch \ | ||
1589 | file://3.2.24/0047-Remove-easily-user-triggerable-BUG-from-generic_setl.patch \ | ||
1590 | file://3.2.24/0048-NFC-Export-nfc.h-to-userland.patch \ | ||
1591 | file://3.2.24/0049-PM-Hibernate-Hibernate-thaw-fixes-improvements.patch \ | ||
1592 | file://3.2.24/0050-cfg80211-check-iface-combinations-only-when-iface-is.patch \ | ||
1593 | file://3.2.24/0051-intel_ips-blacklist-HP-ProBook-laptops.patch \ | ||
1594 | file://3.2.24/0052-atl1c-fix-issue-of-transmit-queue-0-timed-out.patch \ | ||
1595 | file://3.2.24/0053-rt2x00usb-fix-indexes-ordering-on-RX-queue-kick.patch \ | ||
1596 | file://3.2.24/0054-iwlegacy-always-monitor-for-stuck-queues.patch \ | ||
1597 | file://3.2.24/0055-iwlegacy-don-t-mess-up-the-SCD-when-removing-a-key.patch \ | ||
1598 | file://3.2.24/0056-e1000e-Correct-link-check-logic-for-82571-serdes.patch \ | ||
1599 | file://3.2.24/0057-tcm_fc-Fix-crash-seen-with-aborts-and-large-reads.patch \ | ||
1600 | file://3.2.24/0058-fifo-Do-not-restart-open-if-it-already-found-a-partn.patch \ | ||
1601 | file://3.2.24/0059-target-Clean-up-returning-errors-in-PR-handling-code.patch \ | ||
1602 | file://3.2.24/0060-target-Fix-range-calculation-in-WRITE-SAME-emulation.patch \ | ||
1603 | file://3.2.24/0061-cifs-on-CONFIG_HIGHMEM-machines-limit-the-rsize-wsiz.patch \ | ||
1604 | file://3.2.24/0062-cifs-always-update-the-inode-cache-with-the-results-.patch \ | ||
1605 | file://3.2.24/0063-mm-fix-lost-kswapd-wakeup-in-kswapd_stop.patch \ | ||
1606 | file://3.2.24/0064-md-avoid-crash-when-stopping-md-array-races-with-clo.patch \ | ||
1607 | file://3.2.24/0065-md-raid1-close-some-possible-races-on-write-errors-d.patch \ | ||
1608 | file://3.2.24/0066-MIPS-Properly-align-the-.data.init_task-section.patch \ | ||
1609 | file://3.2.24/0067-UBIFS-fix-a-bug-in-empty-space-fix-up.patch \ | ||
1610 | file://3.2.24/0068-ore-Fix-NFS-crash-by-supporting-any-unaligned-RAID-I.patch \ | ||
1611 | file://3.2.24/0069-ore-Remove-support-of-partial-IO-request-NFS-crash.patch \ | ||
1612 | file://3.2.24/0070-pnfs-obj-don-t-leak-objio_state-if-ore_write-read-fa.patch \ | ||
1613 | file://3.2.24/0071-pnfs-obj-Fix-__r4w_get_page-when-offset-is-beyond-i_.patch \ | ||
1614 | file://3.2.24/0072-dm-raid1-fix-crash-with-mirror-recovery-and-discard.patch \ | ||
1615 | file://3.2.24/0073-dm-raid1-set-discard_zeroes_data_unsupported.patch \ | ||
1616 | file://3.2.24/0074-ntp-Fix-leap-second-hrtimer-livelock.patch \ | ||
1617 | file://3.2.24/0075-ntp-Correct-TAI-offset-during-leap-second.patch \ | ||
1618 | file://3.2.24/0076-timekeeping-Fix-CLOCK_MONOTONIC-inconsistency-during.patch \ | ||
1619 | file://3.2.24/0077-time-Move-common-updates-to-a-function.patch \ | ||
1620 | file://3.2.24/0078-hrtimer-Provide-clock_was_set_delayed.patch \ | ||
1621 | file://3.2.24/0079-timekeeping-Fix-leapsecond-triggered-load-spike-issu.patch \ | ||
1622 | file://3.2.24/0080-timekeeping-Maintain-ktime_t-based-offsets-for-hrtim.patch \ | ||
1623 | file://3.2.24/0081-hrtimers-Move-lock-held-region-in-hrtimer_interrupt.patch \ | ||
1624 | file://3.2.24/0082-timekeeping-Provide-hrtimer-update-function.patch \ | ||
1625 | file://3.2.24/0083-hrtimer-Update-hrtimer-base-offsets-each-hrtimer_int.patch \ | ||
1626 | file://3.2.24/0084-timekeeping-Add-missing-update-call-in-timekeeping_r.patch \ | ||
1627 | file://3.2.24/0085-powerpc-Fix-wrong-divisor-in-usecs_to_cputime.patch \ | ||
1628 | file://3.2.24/0086-vhost-don-t-forget-to-schedule.patch \ | ||
1629 | file://3.2.24/0087-r8169-call-netif_napi_del-at-errpaths-and-at-driver-.patch \ | ||
1630 | file://3.2.24/0088-bnx2x-fix-checksum-validation.patch \ | ||
1631 | file://3.2.24/0089-bnx2x-fix-panic-when-TX-ring-is-full.patch \ | ||
1632 | file://3.2.24/0090-net-remove-skb_orphan_try.patch \ | ||
1633 | file://3.2.24/0091-ACPI-Make-acpi_skip_timer_override-cover-all-source_.patch \ | ||
1634 | file://3.2.24/0092-ACPI-Remove-one-board-specific-WARN-when-ignoring-ti.patch \ | ||
1635 | file://3.2.24/0093-ACPI-Add-a-quirk-for-AMILO-PRO-V2030-to-ignore-the-t.patch \ | ||
1636 | file://3.2.24/0094-ACPI-x86-fix-Dell-M6600-ACPI-reboot-regression-via-D.patch \ | ||
1637 | file://3.2.24/0095-ACPI-sysfs.c-strlen-fix.patch \ | ||
1638 | file://3.2.24/0096-eCryptfs-Gracefully-refuse-miscdev-file-ops-on-inher.patch \ | ||
1639 | file://3.2.24/0097-eCryptfs-Fix-lockdep-warning-in-miscdev-operations.patch \ | ||
1640 | file://3.2.24/0098-eCryptfs-Properly-check-for-O_RDONLY-flag-before-doi.patch \ | ||
1641 | file://3.2.24/0099-ACPI-PM-Make-acpi_pm_device_sleep_state-follow-the-s.patch \ | ||
1642 | file://3.2.24/0100-ipheth-add-support-for-iPad.patch \ | ||
1643 | file://3.2.24/0101-stmmac-Fix-for-nfs-hang-on-multiple-reboot.patch \ | ||
1644 | file://3.2.24/0102-bonding-debugfs-and-network-namespaces-are-incompati.patch \ | ||
1645 | file://3.2.24/0103-bonding-Manage-proc-net-bonding-entries-from-the-net.patch \ | ||
1646 | file://3.2.24/0104-Input-bcm5974-Add-support-for-2012-MacBook-Pro-Retin.patch \ | ||
1647 | file://3.2.24/0105-Input-xpad-handle-all-variations-of-Mad-Catz-Beat-Pa.patch \ | ||
1648 | file://3.2.24/0106-Input-xpad-add-signature-for-Razer-Onza-Tournament-E.patch \ | ||
1649 | file://3.2.24/0107-Input-xpad-add-Andamiro-Pump-It-Up-pad.patch \ | ||
1650 | file://3.2.24/0108-HID-add-support-for-2012-MacBook-Pro-Retina.patch \ | ||
1651 | file://3.2.24/0109-Linux-3.2.24.patch \ | ||
1652 | file://3.2.25/0001-mm-reduce-the-amount-of-work-done-when-updating-min_.patch \ | ||
1653 | file://3.2.25/0002-mm-compaction-allow-compaction-to-isolate-dirty-page.patch \ | ||
1654 | file://3.2.25/0003-mm-compaction-determine-if-dirty-pages-can-be-migrat.patch \ | ||
1655 | file://3.2.25/0004-mm-page-allocator-do-not-call-direct-reclaim-for-THP.patch \ | ||
1656 | file://3.2.25/0005-mm-compaction-make-isolate_lru_page-filter-aware-aga.patch \ | ||
1657 | file://3.2.25/0006-mm-compaction-introduce-sync-light-migration-for-use.patch \ | ||
1658 | file://3.2.25/0007-mm-vmscan-when-reclaiming-for-compaction-ensure-ther.patch \ | ||
1659 | file://3.2.25/0008-mm-vmscan-do-not-OOM-if-aborting-reclaim-to-start-co.patch \ | ||
1660 | file://3.2.25/0009-mm-vmscan-check-if-reclaim-should-really-abort-even-.patch \ | ||
1661 | file://3.2.25/0010-vmscan-promote-shared-file-mapped-pages.patch \ | ||
1662 | file://3.2.25/0011-vmscan-activate-executable-pages-after-first-usage.patch \ | ||
1663 | file://3.2.25/0012-mm-vmscan.c-consider-swap-space-when-deciding-whethe.patch \ | ||
1664 | file://3.2.25/0013-mm-test-PageSwapBacked-in-lumpy-reclaim.patch \ | ||
1665 | file://3.2.25/0014-mm-vmscan-convert-global-reclaim-to-per-memcg-LRU-li.patch \ | ||
1666 | file://3.2.25/0015-cpuset-mm-reduce-large-amounts-of-memory-barrier-rel.patch \ | ||
1667 | file://3.2.25/0016-mm-hugetlb-fix-warning-in-alloc_huge_page-dequeue_hu.patch \ | ||
1668 | file://3.2.25/0017-Fix-NULL-dereferences-in-scsi_cmd_to_driver.patch \ | ||
1669 | file://3.2.25/0018-sched-nohz-Fix-rq-cpu_load-calculations.patch \ | ||
1670 | file://3.2.25/0019-sched-nohz-Fix-rq-cpu_load-calculations-some-more.patch \ | ||
1671 | file://3.2.25/0020-powerpc-ftrace-Fix-assembly-trampoline-register-usag.patch \ | ||
1672 | file://3.2.25/0021-cx25821-Remove-bad-strcpy-to-read-only-char.patch \ | ||
1673 | file://3.2.25/0022-x86-Fix-boot-on-Twinhead-H12Y.patch \ | ||
1674 | file://3.2.25/0023-r8169-RxConfig-hack-for-the-8168evl.patch \ | ||
1675 | file://3.2.25/0024-cifs-when-CONFIG_HIGHMEM-is-set-serialize-the-read-w.patch \ | ||
1676 | file://3.2.25/0025-wireless-rt2x00-rt2800usb-add-more-devices-ids.patch \ | ||
1677 | file://3.2.25/0026-wireless-rt2x00-rt2800usb-more-devices-were-identifi.patch \ | ||
1678 | file://3.2.25/0027-rt2800usb-2001-3c17-is-an-RT3370-device.patch \ | ||
1679 | file://3.2.25/0028-usb-gadget-Fix-g_ether-interface-link-status.patch \ | ||
1680 | file://3.2.25/0029-ext4-pass-a-char-to-ext4_count_free-instead-of-a-buf.patch \ | ||
1681 | file://3.2.25/0030-ftrace-Disable-function-tracing-during-suspend-resum.patch \ | ||
1682 | file://3.2.25/0031-x86-microcode-microcode_core.c-simple_strtoul-cleanu.patch \ | ||
1683 | file://3.2.25/0032-x86-microcode-Sanitize-per-cpu-microcode-reloading-i.patch \ | ||
1684 | file://3.2.25/0033-usbdevfs-Correct-amount-of-data-copied-to-user-in-pr.patch \ | ||
1685 | file://3.2.25/0034-ext4-fix-overhead-calculation-used-by-ext4_statfs.patch \ | ||
1686 | file://3.2.25/0035-udf-Improve-table-length-check-to-avoid-possible-ove.patch \ | ||
1687 | file://3.2.25/0036-powerpc-Add-memory-attribute-for-mfmsr.patch \ | ||
1688 | file://3.2.25/0037-mwifiex-correction-in-mcs-index-check.patch \ | ||
1689 | file://3.2.25/0038-USB-option-Ignore-ZTE-Vodafone-K3570-71-net-interfac.patch \ | ||
1690 | file://3.2.25/0039-USB-option-add-ZTE-MF821D.patch \ | ||
1691 | file://3.2.25/0040-target-Add-generation-of-LOGICAL-BLOCK-ADDRESS-OUT-O.patch \ | ||
1692 | file://3.2.25/0041-target-Add-range-checking-to-UNMAP-emulation.patch \ | ||
1693 | file://3.2.25/0042-target-Fix-reading-of-data-length-fields-for-UNMAP-c.patch \ | ||
1694 | file://3.2.25/0043-target-Fix-possible-integer-underflow-in-UNMAP-emula.patch \ | ||
1695 | file://3.2.25/0044-target-Check-number-of-unmap-descriptors-against-our.patch \ | ||
1696 | file://3.2.25/0045-s390-idle-fix-sequence-handling-vs-cpu-hotplug.patch \ | ||
1697 | file://3.2.25/0046-rtlwifi-rtl8192de-Fix-phy-based-version-calculation.patch \ | ||
1698 | file://3.2.25/0047-workqueue-perform-cpu-down-operations-from-low-prior.patch \ | ||
1699 | file://3.2.25/0048-ALSA-hda-Add-support-for-Realtek-ALC282.patch \ | ||
1700 | file://3.2.25/0049-iommu-amd-Fix-hotplug-with-iommu-pt.patch \ | ||
1701 | file://3.2.25/0050-drm-radeon-Try-harder-to-avoid-HW-cursor-ending-on-a.patch \ | ||
1702 | file://3.2.25/0051-ALSA-hda-Turn-on-PIN_OUT-from-hdmi-playback-prepare.patch \ | ||
1703 | file://3.2.25/0052-block-add-blk_queue_dead.patch \ | ||
1704 | file://3.2.25/0053-Fix-device-removal-NULL-pointer-dereference.patch \ | ||
1705 | file://3.2.25/0054-Avoid-dangling-pointer-in-scsi_requeue_command.patch \ | ||
1706 | file://3.2.25/0055-fix-hot-unplug-vs-async-scan-race.patch \ | ||
1707 | file://3.2.25/0056-fix-eh-wakeup-scsi_schedule_eh-vs-scsi_restart_opera.patch \ | ||
1708 | file://3.2.25/0057-libsas-continue-revalidation.patch \ | ||
1709 | file://3.2.25/0058-libsas-fix-sas_discover_devices-return-code-handling.patch \ | ||
1710 | file://3.2.25/0059-iscsi-target-Drop-bogus-struct-file-usage-for-iSCSI-.patch \ | ||
1711 | file://3.2.25/0060-mmc-sdhci-pci-CaFe-has-broken-card-detection.patch \ | ||
1712 | file://3.2.25/0061-ext4-don-t-let-i_reserved_meta_blocks-go-negative.patch \ | ||
1713 | file://3.2.25/0062-ext4-undo-ext4_calc_metadata_amount-if-we-fail-to-cl.patch \ | ||
1714 | file://3.2.25/0063-ASoC-dapm-Fix-_PRE-and-_POST-events-for-DAPM-perform.patch \ | ||
1715 | file://3.2.25/0064-locks-fix-checking-of-fcntl_setlease-argument.patch \ | ||
1716 | file://3.2.25/0065-ACPI-AC-prevent-OOPS-on-some-boxes-due-to-missing-ch.patch \ | ||
1717 | file://3.2.25/0066-drm-radeon-fix-bo-creation-retry-path.patch \ | ||
1718 | file://3.2.25/0067-drm-radeon-fix-non-revealent-error-message.patch \ | ||
1719 | file://3.2.25/0068-drm-radeon-fix-hotplug-of-DP-to-DVI-HDMI-passive-ada.patch \ | ||
1720 | file://3.2.25/0069-drm-radeon-on-hotplug-force-link-training-to-happen-.patch \ | ||
1721 | file://3.2.25/0070-Btrfs-call-the-ordered-free-operation-without-any-lo.patch \ | ||
1722 | file://3.2.25/0071-nouveau-Fix-alignment-requirements-on-src-and-dst-ad.patch \ | ||
1723 | file://3.2.25/0072-mm-fix-wrong-argument-of-migrate_huge_pages-in-soft_.patch \ | ||
1724 | file://3.2.25/0073-Linux-3.2.25.patch \ | ||
1543 | file://led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch \ | 1725 | file://led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch \ |
1544 | file://libertas/0001-USB-convert-drivers-net-to-use-module_usb_driver.patch \ | 1726 | file://libertas/0001-USB-convert-drivers-net-to-use-module_usb_driver.patch \ |
1545 | file://libertas/0002-net-fix-assignment-of-0-1-to-bool-variables.patch \ | 1727 | file://libertas/0002-net-fix-assignment-of-0-1-to-bool-variables.patch \ |