/[linux-patches]/genpatches-2.6/tags/3.0-30/1016_linux-3.0.17.patch
Gentoo

Contents of /genpatches-2.6/tags/3.0-30/1016_linux-3.0.17.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2206 - (show annotations) (download)
Mon Sep 17 18:58:14 2012 UTC (2 years, 8 months ago) by mpagano
File size: 47553 byte(s)
3.0-30 release
1 diff --git a/Documentation/HOWTO b/Documentation/HOWTO
2 index 81bc1a9..f7ade3b 100644
3 --- a/Documentation/HOWTO
4 +++ b/Documentation/HOWTO
5 @@ -275,8 +275,8 @@ versions.
6 If no 2.6.x.y kernel is available, then the highest numbered 2.6.x
7 kernel is the current stable kernel.
8
9 -2.6.x.y are maintained by the "stable" team <stable@kernel.org>, and are
10 -released as needs dictate. The normal release period is approximately
11 +2.6.x.y are maintained by the "stable" team <stable@vger.kernel.org>, and
12 +are released as needs dictate. The normal release period is approximately
13 two weeks, but it can be longer if there are no pressing problems. A
14 security-related problem, instead, can cause a release to happen almost
15 instantly.
16 diff --git a/Documentation/development-process/5.Posting b/Documentation/development-process/5.Posting
17 index 903a254..8a48c9b 100644
18 --- a/Documentation/development-process/5.Posting
19 +++ b/Documentation/development-process/5.Posting
20 @@ -271,10 +271,10 @@ copies should go to:
21 the linux-kernel list.
22
23 - If you are fixing a bug, think about whether the fix should go into the
24 - next stable update. If so, stable@kernel.org should get a copy of the
25 - patch. Also add a "Cc: stable@kernel.org" to the tags within the patch
26 - itself; that will cause the stable team to get a notification when your
27 - fix goes into the mainline.
28 + next stable update. If so, stable@vger.kernel.org should get a copy of
29 + the patch. Also add a "Cc: stable@vger.kernel.org" to the tags within
30 + the patch itself; that will cause the stable team to get a notification
31 + when your fix goes into the mainline.
32
33 When selecting recipients for a patch, it is good to have an idea of who
34 you think will eventually accept the patch and get it merged. While it
35 diff --git a/Documentation/usb/usbmon.txt b/Documentation/usb/usbmon.txt
36 index a4efa04..5335fa8 100644
37 --- a/Documentation/usb/usbmon.txt
38 +++ b/Documentation/usb/usbmon.txt
39 @@ -47,10 +47,11 @@ This allows to filter away annoying devices that talk continuously.
40
41 2. Find which bus connects to the desired device
42
43 -Run "cat /proc/bus/usb/devices", and find the T-line which corresponds to
44 -the device. Usually you do it by looking for the vendor string. If you have
45 -many similar devices, unplug one and compare two /proc/bus/usb/devices outputs.
46 -The T-line will have a bus number. Example:
47 +Run "cat /sys/kernel/debug/usb/devices", and find the T-line which corresponds
48 +to the device. Usually you do it by looking for the vendor string. If you have
49 +many similar devices, unplug one and compare the two
50 +/sys/kernel/debug/usb/devices outputs. The T-line will have a bus number.
51 +Example:
52
53 T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
54 D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
55 @@ -58,7 +59,10 @@ P: Vendor=0557 ProdID=2004 Rev= 1.00
56 S: Manufacturer=ATEN
57 S: Product=UC100KM V2.00
58
59 -Bus=03 means it's bus 3.
60 +"Bus=03" means it's bus 3. Alternatively, you can look at the output from
61 +"lsusb" and get the bus number from the appropriate line. Example:
62 +
63 +Bus 003 Device 002: ID 0557:2004 ATEN UC100KM V2.00
64
65 3. Start 'cat'
66
67 diff --git a/MAINTAINERS b/MAINTAINERS
68 index 34e2418..de85391 100644
69 --- a/MAINTAINERS
70 +++ b/MAINTAINERS
71 @@ -6039,7 +6039,7 @@ F: arch/alpha/kernel/srm_env.c
72
73 STABLE BRANCH
74 M: Greg Kroah-Hartman <greg@kroah.com>
75 -L: stable@kernel.org
76 +L: stable@vger.kernel.org
77 S: Maintained
78
79 STAGING SUBSYSTEM
80 diff --git a/Makefile b/Makefile
81 index 7f0d8e2..295fbda 100644
82 --- a/Makefile
83 +++ b/Makefile
84 @@ -1,6 +1,6 @@
85 VERSION = 3
86 PATCHLEVEL = 0
87 -SUBLEVEL = 16
88 +SUBLEVEL = 17
89 EXTRAVERSION =
90 NAME = Sneaky Weasel
91
92 diff --git a/arch/powerpc/include/asm/time.h b/arch/powerpc/include/asm/time.h
93 index fe6f7c2..bc3c745 100644
94 --- a/arch/powerpc/include/asm/time.h
95 +++ b/arch/powerpc/include/asm/time.h
96 @@ -219,5 +219,7 @@ DECLARE_PER_CPU(struct cpu_usage, cpu_usage_array);
97 extern void secondary_cpu_time_init(void);
98 extern void iSeries_time_init_early(void);
99
100 +extern void decrementer_check_overflow(void);
101 +
102 #endif /* __KERNEL__ */
103 #endif /* __POWERPC_TIME_H */
104 diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
105 index 5b428e3..ca2987d 100644
106 --- a/arch/powerpc/kernel/irq.c
107 +++ b/arch/powerpc/kernel/irq.c
108 @@ -170,16 +170,13 @@ notrace void arch_local_irq_restore(unsigned long en)
109 */
110 local_paca->hard_enabled = en;
111
112 -#ifndef CONFIG_BOOKE
113 - /* On server, re-trigger the decrementer if it went negative since
114 - * some processors only trigger on edge transitions of the sign bit.
115 - *
116 - * BookE has a level sensitive decrementer (latches in TSR) so we
117 - * don't need that
118 + /*
119 + * Trigger the decrementer if we have a pending event. Some processors
120 + * only trigger on edge transitions of the sign bit. We might also
121 + * have disabled interrupts long enough that the decrementer wrapped
122 + * to positive.
123 */
124 - if ((int)mfspr(SPRN_DEC) < 0)
125 - mtspr(SPRN_DEC, 1);
126 -#endif /* CONFIG_BOOKE */
127 + decrementer_check_overflow();
128
129 /*
130 * Force the delivery of pending soft-disabled interrupts on PS3.
131 diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
132 index 03b29a6..2de304a 100644
133 --- a/arch/powerpc/kernel/time.c
134 +++ b/arch/powerpc/kernel/time.c
135 @@ -889,6 +889,15 @@ static void __init clocksource_init(void)
136 clock->name, clock->mult, clock->shift);
137 }
138
139 +void decrementer_check_overflow(void)
140 +{
141 + u64 now = get_tb_or_rtc();
142 + struct decrementer_clock *decrementer = &__get_cpu_var(decrementers);
143 +
144 + if (now >= decrementer->next_tb)
145 + set_dec(1);
146 +}
147 +
148 static int decrementer_set_next_event(unsigned long evt,
149 struct clock_event_device *dev)
150 {
151 diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c
152 index f106662..c9311cf 100644
153 --- a/arch/powerpc/platforms/pseries/hvCall_inst.c
154 +++ b/arch/powerpc/platforms/pseries/hvCall_inst.c
155 @@ -109,7 +109,7 @@ static void probe_hcall_entry(void *ignored, unsigned long opcode, unsigned long
156 if (opcode > MAX_HCALL_OPCODE)
157 return;
158
159 - h = &get_cpu_var(hcall_stats)[opcode / 4];
160 + h = &__get_cpu_var(hcall_stats)[opcode / 4];
161 h->tb_start = mftb();
162 h->purr_start = mfspr(SPRN_PURR);
163 }
164 @@ -126,8 +126,6 @@ static void probe_hcall_exit(void *ignored, unsigned long opcode, unsigned long
165 h->num_calls++;
166 h->tb_total += mftb() - h->tb_start;
167 h->purr_total += mfspr(SPRN_PURR) - h->purr_start;
168 -
169 - put_cpu_var(hcall_stats);
170 }
171
172 static int __init hcall_inst_init(void)
173 diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
174 index ed96b37..81e30d9 100644
175 --- a/arch/powerpc/platforms/pseries/lpar.c
176 +++ b/arch/powerpc/platforms/pseries/lpar.c
177 @@ -745,6 +745,7 @@ void __trace_hcall_entry(unsigned long opcode, unsigned long *args)
178 goto out;
179
180 (*depth)++;
181 + preempt_disable();
182 trace_hcall_entry(opcode, args);
183 (*depth)--;
184
185 @@ -767,6 +768,7 @@ void __trace_hcall_exit(long opcode, unsigned long retval,
186
187 (*depth)++;
188 trace_hcall_exit(opcode, retval, retbuf);
189 + preempt_enable();
190 (*depth)--;
191
192 out:
193 diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
194 index 06ed6b4..3719c94 100644
195 --- a/drivers/base/firmware_class.c
196 +++ b/drivers/base/firmware_class.c
197 @@ -226,13 +226,13 @@ static ssize_t firmware_loading_store(struct device *dev,
198 int loading = simple_strtol(buf, NULL, 10);
199 int i;
200
201 + mutex_lock(&fw_lock);
202 +
203 + if (!fw_priv->fw)
204 + goto out;
205 +
206 switch (loading) {
207 case 1:
208 - mutex_lock(&fw_lock);
209 - if (!fw_priv->fw) {
210 - mutex_unlock(&fw_lock);
211 - break;
212 - }
213 firmware_free_data(fw_priv->fw);
214 memset(fw_priv->fw, 0, sizeof(struct firmware));
215 /* If the pages are not owned by 'struct firmware' */
216 @@ -243,7 +243,6 @@ static ssize_t firmware_loading_store(struct device *dev,
217 fw_priv->page_array_size = 0;
218 fw_priv->nr_pages = 0;
219 set_bit(FW_STATUS_LOADING, &fw_priv->status);
220 - mutex_unlock(&fw_lock);
221 break;
222 case 0:
223 if (test_bit(FW_STATUS_LOADING, &fw_priv->status)) {
224 @@ -274,7 +273,8 @@ static ssize_t firmware_loading_store(struct device *dev,
225 fw_load_abort(fw_priv);
226 break;
227 }
228 -
229 +out:
230 + mutex_unlock(&fw_lock);
231 return count;
232 }
233
234 diff --git a/drivers/infiniband/hw/qib/qib_iba6120.c b/drivers/infiniband/hw/qib/qib_iba6120.c
235 index d8ca0a0..65df26c 100644
236 --- a/drivers/infiniband/hw/qib/qib_iba6120.c
237 +++ b/drivers/infiniband/hw/qib/qib_iba6120.c
238 @@ -2076,9 +2076,11 @@ static void qib_6120_config_ctxts(struct qib_devdata *dd)
239 static void qib_update_6120_usrhead(struct qib_ctxtdata *rcd, u64 hd,
240 u32 updegr, u32 egrhd, u32 npkts)
241 {
242 - qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
243 if (updegr)
244 qib_write_ureg(rcd->dd, ur_rcvegrindexhead, egrhd, rcd->ctxt);
245 + mmiowb();
246 + qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
247 + mmiowb();
248 }
249
250 static u32 qib_6120_hdrqempty(struct qib_ctxtdata *rcd)
251 diff --git a/drivers/infiniband/hw/qib/qib_iba7220.c b/drivers/infiniband/hw/qib/qib_iba7220.c
252 index c765a2e..759bb63 100644
253 --- a/drivers/infiniband/hw/qib/qib_iba7220.c
254 +++ b/drivers/infiniband/hw/qib/qib_iba7220.c
255 @@ -2704,9 +2704,11 @@ static int qib_7220_set_loopback(struct qib_pportdata *ppd, const char *what)
256 static void qib_update_7220_usrhead(struct qib_ctxtdata *rcd, u64 hd,
257 u32 updegr, u32 egrhd, u32 npkts)
258 {
259 - qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
260 if (updegr)
261 qib_write_ureg(rcd->dd, ur_rcvegrindexhead, egrhd, rcd->ctxt);
262 + mmiowb();
263 + qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
264 + mmiowb();
265 }
266
267 static u32 qib_7220_hdrqempty(struct qib_ctxtdata *rcd)
268 diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c
269 index 8ec5237..49e4a58 100644
270 --- a/drivers/infiniband/hw/qib/qib_iba7322.c
271 +++ b/drivers/infiniband/hw/qib/qib_iba7322.c
272 @@ -4060,10 +4060,12 @@ static void qib_update_7322_usrhead(struct qib_ctxtdata *rcd, u64 hd,
273 */
274 if (hd >> IBA7322_HDRHEAD_PKTINT_SHIFT)
275 adjust_rcv_timeout(rcd, npkts);
276 - qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
277 - qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
278 if (updegr)
279 qib_write_ureg(rcd->dd, ur_rcvegrindexhead, egrhd, rcd->ctxt);
280 + mmiowb();
281 + qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
282 + qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
283 + mmiowb();
284 }
285
286 static u32 qib_7322_hdrqempty(struct qib_ctxtdata *rcd)
287 diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
288 index 2065cb4..0b65c5f 100644
289 --- a/drivers/net/bonding/bond_main.c
290 +++ b/drivers/net/bonding/bond_main.c
291 @@ -1905,7 +1905,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
292 "but new slave device does not support netpoll.\n",
293 bond_dev->name);
294 res = -EBUSY;
295 - goto err_close;
296 + goto err_detach;
297 }
298 }
299 #endif
300 @@ -1914,7 +1914,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
301
302 res = bond_create_slave_symlinks(bond_dev, slave_dev);
303 if (res)
304 - goto err_close;
305 + goto err_detach;
306
307 res = netdev_rx_handler_register(slave_dev, bond_handle_frame,
308 new_slave);
309 @@ -1935,6 +1935,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
310 err_dest_symlinks:
311 bond_destroy_slave_symlinks(bond_dev, slave_dev);
312
313 +err_detach:
314 + write_lock_bh(&bond->lock);
315 + bond_detach_slave(bond, new_slave);
316 + write_unlock_bh(&bond->lock);
317 +
318 err_close:
319 dev_close(slave_dev);
320
321 diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
322 index c5c4b4d..7105577 100644
323 --- a/drivers/net/usb/asix.c
324 +++ b/drivers/net/usb/asix.c
325 @@ -371,7 +371,7 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
326
327 skb_pull(skb, (size + 1) & 0xfffe);
328
329 - if (skb->len == 0)
330 + if (skb->len < sizeof(header))
331 break;
332
333 head = (u8 *) skb->data;
334 @@ -1560,6 +1560,10 @@ static const struct usb_device_id products [] = {
335 // ASIX 88772a
336 USB_DEVICE(0x0db0, 0xa877),
337 .driver_info = (unsigned long) &ax88772_info,
338 +}, {
339 + // Asus USB Ethernet Adapter
340 + USB_DEVICE (0x0b95, 0x7e2b),
341 + .driver_info = (unsigned long) &ax88772_info,
342 },
343 { }, // END
344 };
345 diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
346 index 6e7fe94..d4e9eac 100644
347 --- a/drivers/net/wireless/rt2x00/rt2800usb.c
348 +++ b/drivers/net/wireless/rt2x00/rt2800usb.c
349 @@ -878,6 +878,7 @@ static struct usb_device_id rt2800usb_device_table[] = {
350 { USB_DEVICE(0x13b1, 0x0031) },
351 { USB_DEVICE(0x1737, 0x0070) },
352 { USB_DEVICE(0x1737, 0x0071) },
353 + { USB_DEVICE(0x1737, 0x0077) },
354 /* Logitec */
355 { USB_DEVICE(0x0789, 0x0162) },
356 { USB_DEVICE(0x0789, 0x0163) },
357 @@ -1069,7 +1070,6 @@ static struct usb_device_id rt2800usb_device_table[] = {
358 { USB_DEVICE(0x1740, 0x0605) },
359 { USB_DEVICE(0x1740, 0x0615) },
360 /* Linksys */
361 - { USB_DEVICE(0x1737, 0x0077) },
362 { USB_DEVICE(0x1737, 0x0078) },
363 /* Logitec */
364 { USB_DEVICE(0x0789, 0x0168) },
365 diff --git a/drivers/net/wireless/wl12xx/boot.c b/drivers/net/wireless/wl12xx/boot.c
366 index b07f8b7..e0e1688 100644
367 --- a/drivers/net/wireless/wl12xx/boot.c
368 +++ b/drivers/net/wireless/wl12xx/boot.c
369 @@ -328,6 +328,9 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl)
370 nvs_ptr += 3;
371
372 for (i = 0; i < burst_len; i++) {
373 + if (nvs_ptr + 3 >= (u8 *) wl->nvs + nvs_len)
374 + goto out_badnvs;
375 +
376 val = (nvs_ptr[0] | (nvs_ptr[1] << 8)
377 | (nvs_ptr[2] << 16) | (nvs_ptr[3] << 24));
378
379 @@ -339,6 +342,9 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl)
380 nvs_ptr += 4;
381 dest_addr += 4;
382 }
383 +
384 + if (nvs_ptr >= (u8 *) wl->nvs + nvs_len)
385 + goto out_badnvs;
386 }
387
388 /*
389 @@ -350,6 +356,10 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl)
390 */
391 nvs_ptr = (u8 *)wl->nvs +
392 ALIGN(nvs_ptr - (u8 *)wl->nvs + 7, 4);
393 +
394 + if (nvs_ptr >= (u8 *) wl->nvs + nvs_len)
395 + goto out_badnvs;
396 +
397 nvs_len -= nvs_ptr - (u8 *)wl->nvs;
398
399 /* Now we must set the partition correctly */
400 @@ -365,6 +375,10 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl)
401
402 kfree(nvs_aligned);
403 return 0;
404 +
405 +out_badnvs:
406 + wl1271_error("nvs data is malformed");
407 + return -EILSEQ;
408 }
409
410 static void wl1271_boot_enable_interrupts(struct wl1271 *wl)
411 diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
412 index 42935ac..b8ec8cd 100644
413 --- a/drivers/net/wireless/wl12xx/cmd.c
414 +++ b/drivers/net/wireless/wl12xx/cmd.c
415 @@ -121,6 +121,11 @@ int wl1271_cmd_general_parms(struct wl1271 *wl)
416 if (!wl->nvs)
417 return -ENODEV;
418
419 + if (gp->tx_bip_fem_manufacturer >= WL1271_INI_FEM_MODULE_COUNT) {
420 + wl1271_warning("FEM index from INI out of bounds");
421 + return -EINVAL;
422 + }
423 +
424 gen_parms = kzalloc(sizeof(*gen_parms), GFP_KERNEL);
425 if (!gen_parms)
426 return -ENOMEM;
427 @@ -144,6 +149,12 @@ int wl1271_cmd_general_parms(struct wl1271 *wl)
428 gp->tx_bip_fem_manufacturer =
429 gen_parms->general_params.tx_bip_fem_manufacturer;
430
431 + if (gp->tx_bip_fem_manufacturer >= WL1271_INI_FEM_MODULE_COUNT) {
432 + wl1271_warning("FEM index from FW out of bounds");
433 + ret = -EINVAL;
434 + goto out;
435 + }
436 +
437 wl1271_debug(DEBUG_CMD, "FEM autodetect: %s, manufacturer: %d\n",
438 answer ? "auto" : "manual", gp->tx_bip_fem_manufacturer);
439
440 @@ -163,6 +174,11 @@ int wl128x_cmd_general_parms(struct wl1271 *wl)
441 if (!wl->nvs)
442 return -ENODEV;
443
444 + if (gp->tx_bip_fem_manufacturer >= WL1271_INI_FEM_MODULE_COUNT) {
445 + wl1271_warning("FEM index from ini out of bounds");
446 + return -EINVAL;
447 + }
448 +
449 gen_parms = kzalloc(sizeof(*gen_parms), GFP_KERNEL);
450 if (!gen_parms)
451 return -ENOMEM;
452 @@ -187,6 +203,12 @@ int wl128x_cmd_general_parms(struct wl1271 *wl)
453 gp->tx_bip_fem_manufacturer =
454 gen_parms->general_params.tx_bip_fem_manufacturer;
455
456 + if (gp->tx_bip_fem_manufacturer >= WL1271_INI_FEM_MODULE_COUNT) {
457 + wl1271_warning("FEM index from FW out of bounds");
458 + ret = -EINVAL;
459 + goto out;
460 + }
461 +
462 wl1271_debug(DEBUG_CMD, "FEM autodetect: %s, manufacturer: %d\n",
463 answer ? "auto" : "manual", gp->tx_bip_fem_manufacturer);
464
465 diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
466 index f88e52a..c79857e 100644
467 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
468 +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
469 @@ -7211,6 +7211,7 @@ _scsih_remove(struct pci_dev *pdev)
470 }
471
472 sas_remove_host(shost);
473 + mpt2sas_base_detach(ioc);
474 list_del(&ioc->list);
475 scsi_remove_host(shost);
476 scsi_host_put(shost);
477 diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
478 index af9b781..b989495 100644
479 --- a/drivers/tty/serial/atmel_serial.c
480 +++ b/drivers/tty/serial/atmel_serial.c
481 @@ -199,8 +199,9 @@ void atmel_config_rs485(struct uart_port *port, struct serial_rs485 *rs485conf)
482 {
483 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
484 unsigned int mode;
485 + unsigned long flags;
486
487 - spin_lock(&port->lock);
488 + spin_lock_irqsave(&port->lock, flags);
489
490 /* Disable interrupts */
491 UART_PUT_IDR(port, atmel_port->tx_done_mask);
492 @@ -231,7 +232,7 @@ void atmel_config_rs485(struct uart_port *port, struct serial_rs485 *rs485conf)
493 /* Enable interrupts */
494 UART_PUT_IER(port, atmel_port->tx_done_mask);
495
496 - spin_unlock(&port->lock);
497 + spin_unlock_irqrestore(&port->lock, flags);
498
499 }
500
501 diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
502 index 8faa23c..158f631 100644
503 --- a/drivers/usb/class/cdc-acm.c
504 +++ b/drivers/usb/class/cdc-acm.c
505 @@ -554,10 +554,18 @@ static void acm_port_down(struct acm *acm)
506
507 static void acm_tty_hangup(struct tty_struct *tty)
508 {
509 - struct acm *acm = tty->driver_data;
510 - tty_port_hangup(&acm->port);
511 + struct acm *acm;
512 +
513 mutex_lock(&open_mutex);
514 + acm = tty->driver_data;
515 +
516 + if (!acm)
517 + goto out;
518 +
519 + tty_port_hangup(&acm->port);
520 acm_port_down(acm);
521 +
522 +out:
523 mutex_unlock(&open_mutex);
524 }
525
526 @@ -1183,6 +1191,8 @@ made_compressed_probe:
527 i = device_create_file(&intf->dev, &dev_attr_wCountryCodes);
528 if (i < 0) {
529 kfree(acm->country_codes);
530 + acm->country_codes = NULL;
531 + acm->country_code_size = 0;
532 goto skip_countries;
533 }
534
535 @@ -1191,6 +1201,8 @@ made_compressed_probe:
536 if (i < 0) {
537 device_remove_file(&intf->dev, &dev_attr_wCountryCodes);
538 kfree(acm->country_codes);
539 + acm->country_codes = NULL;
540 + acm->country_code_size = 0;
541 goto skip_countries;
542 }
543 }
544 diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
545 index 39ea00b..691d212 100644
546 --- a/drivers/usb/core/hcd.c
547 +++ b/drivers/usb/core/hcd.c
548 @@ -1387,11 +1387,10 @@ int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb,
549 ret = -EAGAIN;
550 else
551 urb->transfer_flags |= URB_DMA_MAP_SG;
552 - if (n != urb->num_sgs) {
553 - urb->num_sgs = n;
554 + urb->num_mapped_sgs = n;
555 + if (n != urb->num_sgs)
556 urb->transfer_flags |=
557 URB_DMA_SG_COMBINED;
558 - }
559 } else if (urb->sg) {
560 struct scatterlist *sg = urb->sg;
561 urb->transfer_dma = dma_map_page(
562 diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
563 index ecf12e1..4c65eb6 100644
564 --- a/drivers/usb/core/quirks.c
565 +++ b/drivers/usb/core/quirks.c
566 @@ -117,9 +117,12 @@ static const struct usb_device_id usb_quirk_list[] = {
567 { USB_DEVICE(0x06a3, 0x0006), .driver_info =
568 USB_QUIRK_CONFIG_INTF_STRINGS },
569
570 - /* Guillemot Webcam Hercules Dualpix Exchange*/
571 + /* Guillemot Webcam Hercules Dualpix Exchange (2nd ID) */
572 { USB_DEVICE(0x06f8, 0x0804), .driver_info = USB_QUIRK_RESET_RESUME },
573
574 + /* Guillemot Webcam Hercules Dualpix Exchange*/
575 + { USB_DEVICE(0x06f8, 0x3005), .driver_info = USB_QUIRK_RESET_RESUME },
576 +
577 /* M-Systems Flash Disk Pioneers */
578 { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
579
580 diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
581 index 0917e3a..2499b3b 100644
582 --- a/drivers/usb/host/ehci-q.c
583 +++ b/drivers/usb/host/ehci-q.c
584 @@ -649,7 +649,7 @@ qh_urb_transaction (
585 /*
586 * data transfer stage: buffer setup
587 */
588 - i = urb->num_sgs;
589 + i = urb->num_mapped_sgs;
590 if (len > 0 && i > 0) {
591 sg = urb->sg;
592 buf = sg_dma_address(sg);
593 diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
594 index f9cf3f0..23107e2 100644
595 --- a/drivers/usb/host/ohci-hcd.c
596 +++ b/drivers/usb/host/ohci-hcd.c
597 @@ -389,17 +389,14 @@ ohci_shutdown (struct usb_hcd *hcd)
598 struct ohci_hcd *ohci;
599
600 ohci = hcd_to_ohci (hcd);
601 - ohci_writel (ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);
602 - ohci->hc_control = ohci_readl(ohci, &ohci->regs->control);
603 + ohci_writel(ohci, (u32) ~0, &ohci->regs->intrdisable);
604
605 - /* If the SHUTDOWN quirk is set, don't put the controller in RESET */
606 - ohci->hc_control &= (ohci->flags & OHCI_QUIRK_SHUTDOWN ?
607 - OHCI_CTRL_RWC | OHCI_CTRL_HCFS :
608 - OHCI_CTRL_RWC);
609 - ohci_writel(ohci, ohci->hc_control, &ohci->regs->control);
610 + /* Software reset, after which the controller goes into SUSPEND */
611 + ohci_writel(ohci, OHCI_HCR, &ohci->regs->cmdstatus);
612 + ohci_readl(ohci, &ohci->regs->cmdstatus); /* flush the writes */
613 + udelay(10);
614
615 - /* flush the writes */
616 - (void) ohci_readl (ohci, &ohci->regs->control);
617 + ohci_writel(ohci, ohci->fminterval, &ohci->regs->fminterval);
618 }
619
620 static int check_ed(struct ohci_hcd *ohci, struct ed *ed)
621 diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
622 index ad8166c..bc01b06 100644
623 --- a/drivers/usb/host/ohci-pci.c
624 +++ b/drivers/usb/host/ohci-pci.c
625 @@ -175,28 +175,6 @@ static int ohci_quirk_amd700(struct usb_hcd *hcd)
626 return 0;
627 }
628
629 -/* nVidia controllers continue to drive Reset signalling on the bus
630 - * even after system shutdown, wasting power. This flag tells the
631 - * shutdown routine to leave the controller OPERATIONAL instead of RESET.
632 - */
633 -static int ohci_quirk_nvidia_shutdown(struct usb_hcd *hcd)
634 -{
635 - struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
636 - struct ohci_hcd *ohci = hcd_to_ohci(hcd);
637 -
638 - /* Evidently nVidia fixed their later hardware; this is a guess at
639 - * the changeover point.
640 - */
641 -#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_USB 0x026d
642 -
643 - if (pdev->device < PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_USB) {
644 - ohci->flags |= OHCI_QUIRK_SHUTDOWN;
645 - ohci_dbg(ohci, "enabled nVidia shutdown quirk\n");
646 - }
647 -
648 - return 0;
649 -}
650 -
651 static void sb800_prefetch(struct ohci_hcd *ohci, int on)
652 {
653 struct pci_dev *pdev;
654 @@ -260,10 +238,6 @@ static const struct pci_device_id ohci_pci_quirks[] = {
655 PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4399),
656 .driver_data = (unsigned long)ohci_quirk_amd700,
657 },
658 - {
659 - PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID),
660 - .driver_data = (unsigned long) ohci_quirk_nvidia_shutdown,
661 - },
662
663 /* FIXME for some of the early AMD 760 southbridges, OHCI
664 * won't work at all. blacklist them.
665 diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
666 index 35e5fd6..0795b93 100644
667 --- a/drivers/usb/host/ohci.h
668 +++ b/drivers/usb/host/ohci.h
669 @@ -403,7 +403,6 @@ struct ohci_hcd {
670 #define OHCI_QUIRK_HUB_POWER 0x100 /* distrust firmware power/oc setup */
671 #define OHCI_QUIRK_AMD_PLL 0x200 /* AMD PLL quirk*/
672 #define OHCI_QUIRK_AMD_PREFETCH 0x400 /* pre-fetch for ISO transfer */
673 -#define OHCI_QUIRK_SHUTDOWN 0x800 /* nVidia power bug */
674 // there are also chip quirks/bugs in init logic
675
676 struct work_struct nec_work; /* Worker for NEC quirk */
677 diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
678 index a495d48..23e04fb 100644
679 --- a/drivers/usb/host/pci-quirks.c
680 +++ b/drivers/usb/host/pci-quirks.c
681 @@ -36,6 +36,7 @@
682 #define OHCI_INTRENABLE 0x10
683 #define OHCI_INTRDISABLE 0x14
684 #define OHCI_FMINTERVAL 0x34
685 +#define OHCI_HCFS (3 << 6) /* hc functional state */
686 #define OHCI_HCR (1 << 0) /* host controller reset */
687 #define OHCI_OCR (1 << 3) /* ownership change request */
688 #define OHCI_CTRL_RWC (1 << 9) /* remote wakeup connected */
689 @@ -465,6 +466,8 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
690 {
691 void __iomem *base;
692 u32 control;
693 + u32 fminterval;
694 + int cnt;
695
696 if (!mmio_resource_enabled(pdev, 0))
697 return;
698 @@ -497,41 +500,32 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
699 }
700 #endif
701
702 - /* reset controller, preserving RWC (and possibly IR) */
703 - writel(control & OHCI_CTRL_MASK, base + OHCI_CONTROL);
704 - readl(base + OHCI_CONTROL);
705 + /* disable interrupts */
706 + writel((u32) ~0, base + OHCI_INTRDISABLE);
707
708 - /* Some NVIDIA controllers stop working if kept in RESET for too long */
709 - if (pdev->vendor == PCI_VENDOR_ID_NVIDIA) {
710 - u32 fminterval;
711 - int cnt;
712 + /* Reset the USB bus, if the controller isn't already in RESET */
713 + if (control & OHCI_HCFS) {
714 + /* Go into RESET, preserving RWC (and possibly IR) */
715 + writel(control & OHCI_CTRL_MASK, base + OHCI_CONTROL);
716 + readl(base + OHCI_CONTROL);
717
718 - /* drive reset for at least 50 ms (7.1.7.5) */
719 + /* drive bus reset for at least 50 ms (7.1.7.5) */
720 msleep(50);
721 + }
722
723 - /* software reset of the controller, preserving HcFmInterval */
724 - fminterval = readl(base + OHCI_FMINTERVAL);
725 - writel(OHCI_HCR, base + OHCI_CMDSTATUS);
726 + /* software reset of the controller, preserving HcFmInterval */
727 + fminterval = readl(base + OHCI_FMINTERVAL);
728 + writel(OHCI_HCR, base + OHCI_CMDSTATUS);
729
730 - /* reset requires max 10 us delay */
731 - for (cnt = 30; cnt > 0; --cnt) { /* ... allow extra time */
732 - if ((readl(base + OHCI_CMDSTATUS) & OHCI_HCR) == 0)
733 - break;
734 - udelay(1);
735 - }
736 - writel(fminterval, base + OHCI_FMINTERVAL);
737 -
738 - /* Now we're in the SUSPEND state with all devices reset
739 - * and wakeups and interrupts disabled
740 - */
741 + /* reset requires max 10 us delay */
742 + for (cnt = 30; cnt > 0; --cnt) { /* ... allow extra time */
743 + if ((readl(base + OHCI_CMDSTATUS) & OHCI_HCR) == 0)
744 + break;
745 + udelay(1);
746 }
747 + writel(fminterval, base + OHCI_FMINTERVAL);
748
749 - /*
750 - * disable interrupts
751 - */
752 - writel(~(u32)0, base + OHCI_INTRDISABLE);
753 - writel(~(u32)0, base + OHCI_INTRSTATUS);
754 -
755 + /* Now the controller is safely in SUSPEND and nothing can wake it up */
756 iounmap(base);
757 }
758
759 diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c
760 index 84ed28b..8253991 100644
761 --- a/drivers/usb/host/uhci-q.c
762 +++ b/drivers/usb/host/uhci-q.c
763 @@ -943,7 +943,7 @@ static int uhci_submit_common(struct uhci_hcd *uhci, struct urb *urb,
764 if (usb_pipein(urb->pipe))
765 status |= TD_CTRL_SPD;
766
767 - i = urb->num_sgs;
768 + i = urb->num_mapped_sgs;
769 if (len > 0 && i > 0) {
770 sg = urb->sg;
771 data = sg_dma_address(sg);
772 diff --git a/drivers/usb/host/whci/qset.c b/drivers/usb/host/whci/qset.c
773 index a403b53..76083ae 100644
774 --- a/drivers/usb/host/whci/qset.c
775 +++ b/drivers/usb/host/whci/qset.c
776 @@ -443,7 +443,7 @@ static int qset_add_urb_sg(struct whc *whc, struct whc_qset *qset, struct urb *u
777
778 remaining = urb->transfer_buffer_length;
779
780 - for_each_sg(urb->sg, sg, urb->num_sgs, i) {
781 + for_each_sg(urb->sg, sg, urb->num_mapped_sgs, i) {
782 dma_addr_t dma_addr;
783 size_t dma_remaining;
784 dma_addr_t sp, ep;
785 @@ -561,7 +561,7 @@ static int qset_add_urb_sg_linearize(struct whc *whc, struct whc_qset *qset,
786
787 remaining = urb->transfer_buffer_length;
788
789 - for_each_sg(urb->sg, sg, urb->num_sgs, i) {
790 + for_each_sg(urb->sg, sg, urb->num_mapped_sgs, i) {
791 size_t len;
792 size_t sg_remaining;
793 void *orig;
794 diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
795 index b4b0691..c0c5d6c 100644
796 --- a/drivers/usb/host/xhci-ring.c
797 +++ b/drivers/usb/host/xhci-ring.c
798 @@ -2570,7 +2570,7 @@ static unsigned int count_sg_trbs_needed(struct xhci_hcd *xhci, struct urb *urb)
799 struct scatterlist *sg;
800
801 sg = NULL;
802 - num_sgs = urb->num_sgs;
803 + num_sgs = urb->num_mapped_sgs;
804 temp = urb->transfer_buffer_length;
805
806 xhci_dbg(xhci, "count sg list trbs: \n");
807 @@ -2754,7 +2754,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
808 return -EINVAL;
809
810 num_trbs = count_sg_trbs_needed(xhci, urb);
811 - num_sgs = urb->num_sgs;
812 + num_sgs = urb->num_mapped_sgs;
813 total_packet_count = roundup(urb->transfer_buffer_length,
814 le16_to_cpu(urb->ep->desc.wMaxPacketSize));
815
816 diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
817 index 221f14e..107438e 100644
818 --- a/drivers/usb/host/xhci.c
819 +++ b/drivers/usb/host/xhci.c
820 @@ -1568,6 +1568,7 @@ static int xhci_configure_endpoint_result(struct xhci_hcd *xhci,
821 /* FIXME: can we allocate more resources for the HC? */
822 break;
823 case COMP_BW_ERR:
824 + case COMP_2ND_BW_ERR:
825 dev_warn(&udev->dev, "Not enough bandwidth "
826 "for new device state.\n");
827 ret = -ENOSPC;
828 @@ -2183,8 +2184,7 @@ static int xhci_calculate_streams_and_bitmask(struct xhci_hcd *xhci,
829 if (ret < 0)
830 return ret;
831
832 - max_streams = USB_SS_MAX_STREAMS(
833 - eps[i]->ss_ep_comp.bmAttributes);
834 + max_streams = usb_ss_max_streams(&eps[i]->ss_ep_comp);
835 if (max_streams < (*num_streams - 1)) {
836 xhci_dbg(xhci, "Ep 0x%x only supports %u stream IDs.\n",
837 eps[i]->desc.bEndpointAddress,
838 diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
839 index 49ce76c..3e7c3a6 100644
840 --- a/drivers/usb/host/xhci.h
841 +++ b/drivers/usb/host/xhci.h
842 @@ -900,7 +900,6 @@ struct xhci_transfer_event {
843 /* Invalid Stream ID Error */
844 #define COMP_STRID_ERR 34
845 /* Secondary Bandwidth Error - may be returned by a Configure Endpoint cmd */
846 -/* FIXME - check for this */
847 #define COMP_2ND_BW_ERR 35
848 /* Split Transaction Error */
849 #define COMP_SPLIT_ERR 36
850 diff --git a/drivers/usb/misc/isight_firmware.c b/drivers/usb/misc/isight_firmware.c
851 index fe1d443..8f725f6 100644
852 --- a/drivers/usb/misc/isight_firmware.c
853 +++ b/drivers/usb/misc/isight_firmware.c
854 @@ -55,8 +55,9 @@ static int isight_firmware_load(struct usb_interface *intf,
855
856 ptr = firmware->data;
857
858 + buf[0] = 0x01;
859 if (usb_control_msg
860 - (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, "\1", 1,
861 + (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, buf, 1,
862 300) != 1) {
863 printk(KERN_ERR
864 "Failed to initialise isight firmware loader\n");
865 @@ -100,8 +101,9 @@ static int isight_firmware_load(struct usb_interface *intf,
866 }
867 }
868
869 + buf[0] = 0x00;
870 if (usb_control_msg
871 - (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, "\0", 1,
872 + (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, buf, 1,
873 300) != 1) {
874 printk(KERN_ERR "isight firmware loading completion failed\n");
875 ret = -ENODEV;
876 diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
877 index dce7182..a0232a7 100644
878 --- a/drivers/usb/musb/musb_core.c
879 +++ b/drivers/usb/musb/musb_core.c
880 @@ -2078,8 +2078,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
881 if (status < 0)
882 goto fail3;
883
884 - pm_runtime_put(musb->controller);
885 -
886 status = musb_init_debugfs(musb);
887 if (status < 0)
888 goto fail4;
889 diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
890 index fd67cc5..a1a324b 100644
891 --- a/drivers/usb/serial/cp210x.c
892 +++ b/drivers/usb/serial/cp210x.c
893 @@ -92,6 +92,7 @@ static const struct usb_device_id id_table[] = {
894 { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */
895 { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */
896 { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */
897 + { USB_DEVICE(0x10C4, 0x81A9) }, /* Multiplex RC Interface */
898 { USB_DEVICE(0x10C4, 0x81AC) }, /* MSD Dash Hawk */
899 { USB_DEVICE(0x10C4, 0x81AD) }, /* INSYS USB Modem */
900 { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */
901 diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
902 index 60f38d5..0a8c1e6 100644
903 --- a/drivers/usb/serial/omninet.c
904 +++ b/drivers/usb/serial/omninet.c
905 @@ -315,7 +315,7 @@ static int omninet_write_room(struct tty_struct *tty)
906 int room = 0; /* Default: no room */
907
908 /* FIXME: no consistent locking for write_urb_busy */
909 - if (wport->write_urb_busy)
910 + if (!wport->write_urb_busy)
911 room = wport->bulk_out_size - OMNINET_HEADERLEN;
912
913 dbg("%s - returns %d", __func__, room);
914 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
915 index d2becb9..c96b6b6 100644
916 --- a/drivers/usb/serial/option.c
917 +++ b/drivers/usb/serial/option.c
918 @@ -472,6 +472,14 @@ static void option_instat_callback(struct urb *urb);
919 #define YUGA_PRODUCT_CLU528 0x260D
920 #define YUGA_PRODUCT_CLU526 0x260F
921
922 +/* Viettel products */
923 +#define VIETTEL_VENDOR_ID 0x2262
924 +#define VIETTEL_PRODUCT_VT1000 0x0002
925 +
926 +/* ZD Incorporated */
927 +#define ZD_VENDOR_ID 0x0685
928 +#define ZD_PRODUCT_7000 0x7000
929 +
930 /* some devices interfaces need special handling due to a number of reasons */
931 enum option_blacklist_reason {
932 OPTION_BLACKLIST_NONE = 0,
933 @@ -1173,6 +1181,8 @@ static const struct usb_device_id option_ids[] = {
934 { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU516) },
935 { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU528) },
936 { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU526) },
937 + { USB_DEVICE_AND_INTERFACE_INFO(VIETTEL_VENDOR_ID, VIETTEL_PRODUCT_VT1000, 0xff, 0xff, 0xff) },
938 + { USB_DEVICE_AND_INTERFACE_INFO(ZD_VENDOR_ID, ZD_PRODUCT_7000, 0xff, 0xff, 0xff) },
939 { } /* Terminating entry */
940 };
941 MODULE_DEVICE_TABLE(usb, option_ids);
942 diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
943 index c325e69..9e069ef 100644
944 --- a/drivers/usb/storage/usb.c
945 +++ b/drivers/usb/storage/usb.c
946 @@ -1073,6 +1073,7 @@ static struct usb_driver usb_storage_driver = {
947 .id_table = usb_storage_usb_ids,
948 .supports_autosuspend = 1,
949 .soft_unbind = 1,
950 + .no_dynamic_id = 1,
951 };
952
953 static int __init usb_stor_init(void)
954 diff --git a/drivers/video/offb.c b/drivers/video/offb.c
955 index cb163a5..3251a02 100644
956 --- a/drivers/video/offb.c
957 +++ b/drivers/video/offb.c
958 @@ -100,36 +100,32 @@ static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
959 u_int transp, struct fb_info *info)
960 {
961 struct offb_par *par = (struct offb_par *) info->par;
962 - int i, depth;
963 - u32 *pal = info->pseudo_palette;
964 -
965 - depth = info->var.bits_per_pixel;
966 - if (depth == 16)
967 - depth = (info->var.green.length == 5) ? 15 : 16;
968 -
969 - if (regno > 255 ||
970 - (depth == 16 && regno > 63) ||
971 - (depth == 15 && regno > 31))
972 - return 1;
973 -
974 - if (regno < 16) {
975 - switch (depth) {
976 - case 15:
977 - pal[regno] = (regno << 10) | (regno << 5) | regno;
978 - break;
979 - case 16:
980 - pal[regno] = (regno << 11) | (regno << 5) | regno;
981 - break;
982 - case 24:
983 - pal[regno] = (regno << 16) | (regno << 8) | regno;
984 - break;
985 - case 32:
986 - i = (regno << 8) | regno;
987 - pal[regno] = (i << 16) | i;
988 - break;
989 +
990 + if (info->fix.visual == FB_VISUAL_TRUECOLOR) {
991 + u32 *pal = info->pseudo_palette;
992 + u32 cr = red >> (16 - info->var.red.length);
993 + u32 cg = green >> (16 - info->var.green.length);
994 + u32 cb = blue >> (16 - info->var.blue.length);
995 + u32 value;
996 +
997 + if (regno >= 16)
998 + return -EINVAL;
999 +
1000 + value = (cr << info->var.red.offset) |
1001 + (cg << info->var.green.offset) |
1002 + (cb << info->var.blue.offset);
1003 + if (info->var.transp.length > 0) {
1004 + u32 mask = (1 << info->var.transp.length) - 1;
1005 + mask <<= info->var.transp.offset;
1006 + value |= mask;
1007 }
1008 + pal[regno] = value;
1009 + return 0;
1010 }
1011
1012 + if (regno > 255)
1013 + return -EINVAL;
1014 +
1015 red >>= 8;
1016 green >>= 8;
1017 blue >>= 8;
1018 @@ -381,7 +377,7 @@ static void __init offb_init_fb(const char *name, const char *full_name,
1019 int pitch, unsigned long address,
1020 int foreign_endian, struct device_node *dp)
1021 {
1022 - unsigned long res_size = pitch * height * (depth + 7) / 8;
1023 + unsigned long res_size = pitch * height;
1024 struct offb_par *par = &default_par;
1025 unsigned long res_start = address;
1026 struct fb_fix_screeninfo *fix;
1027 diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
1028 index 3451d23..db9ba1a 100644
1029 --- a/fs/ext3/inode.c
1030 +++ b/fs/ext3/inode.c
1031 @@ -1568,7 +1568,13 @@ static int ext3_ordered_writepage(struct page *page,
1032 int err;
1033
1034 J_ASSERT(PageLocked(page));
1035 - WARN_ON_ONCE(IS_RDONLY(inode));
1036 + /*
1037 + * We don't want to warn for emergency remount. The condition is
1038 + * ordered to avoid dereferencing inode->i_sb in non-error case to
1039 + * avoid slow-downs.
1040 + */
1041 + WARN_ON_ONCE(IS_RDONLY(inode) &&
1042 + !(EXT3_SB(inode->i_sb)->s_mount_state & EXT3_ERROR_FS));
1043
1044 /*
1045 * We give up here if we're reentered, because it might be for a
1046 @@ -1642,7 +1648,13 @@ static int ext3_writeback_writepage(struct page *page,
1047 int err;
1048
1049 J_ASSERT(PageLocked(page));
1050 - WARN_ON_ONCE(IS_RDONLY(inode));
1051 + /*
1052 + * We don't want to warn for emergency remount. The condition is
1053 + * ordered to avoid dereferencing inode->i_sb in non-error case to
1054 + * avoid slow-downs.
1055 + */
1056 + WARN_ON_ONCE(IS_RDONLY(inode) &&
1057 + !(EXT3_SB(inode->i_sb)->s_mount_state & EXT3_ERROR_FS));
1058
1059 if (ext3_journal_current_handle())
1060 goto out_fail;
1061 @@ -1684,7 +1696,13 @@ static int ext3_journalled_writepage(struct page *page,
1062 int err;
1063
1064 J_ASSERT(PageLocked(page));
1065 - WARN_ON_ONCE(IS_RDONLY(inode));
1066 + /*
1067 + * We don't want to warn for emergency remount. The condition is
1068 + * ordered to avoid dereferencing inode->i_sb in non-error case to
1069 + * avoid slow-downs.
1070 + */
1071 + WARN_ON_ONCE(IS_RDONLY(inode) &&
1072 + !(EXT3_SB(inode->i_sb)->s_mount_state & EXT3_ERROR_FS));
1073
1074 if (ext3_journal_current_handle())
1075 goto no_write;
1076 diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
1077 index aa91089..f19dfbf 100644
1078 --- a/fs/reiserfs/super.c
1079 +++ b/fs/reiserfs/super.c
1080 @@ -453,16 +453,20 @@ int remove_save_link(struct inode *inode, int truncate)
1081 static void reiserfs_kill_sb(struct super_block *s)
1082 {
1083 if (REISERFS_SB(s)) {
1084 - if (REISERFS_SB(s)->xattr_root) {
1085 - d_invalidate(REISERFS_SB(s)->xattr_root);
1086 - dput(REISERFS_SB(s)->xattr_root);
1087 - REISERFS_SB(s)->xattr_root = NULL;
1088 - }
1089 - if (REISERFS_SB(s)->priv_root) {
1090 - d_invalidate(REISERFS_SB(s)->priv_root);
1091 - dput(REISERFS_SB(s)->priv_root);
1092 - REISERFS_SB(s)->priv_root = NULL;
1093 - }
1094 + /*
1095 + * Force any pending inode evictions to occur now. Any
1096 + * inodes to be removed that have extended attributes
1097 + * associated with them need to clean them up before
1098 + * we can release the extended attribute root dentries.
1099 + * shrink_dcache_for_umount will BUG if we don't release
1100 + * those before it's called so ->put_super is too late.
1101 + */
1102 + shrink_dcache_sb(s);
1103 +
1104 + dput(REISERFS_SB(s)->xattr_root);
1105 + REISERFS_SB(s)->xattr_root = NULL;
1106 + dput(REISERFS_SB(s)->priv_root);
1107 + REISERFS_SB(s)->priv_root = NULL;
1108 }
1109
1110 kill_block_super(s);
1111 @@ -1164,7 +1168,8 @@ static void handle_quota_files(struct super_block *s, char **qf_names,
1112 kfree(REISERFS_SB(s)->s_qf_names[i]);
1113 REISERFS_SB(s)->s_qf_names[i] = qf_names[i];
1114 }
1115 - REISERFS_SB(s)->s_jquota_fmt = *qfmt;
1116 + if (*qfmt)
1117 + REISERFS_SB(s)->s_jquota_fmt = *qfmt;
1118 }
1119 #endif
1120
1121 diff --git a/fs/udf/file.c b/fs/udf/file.c
1122 index 2a346bb..0c0c9d3 100644
1123 --- a/fs/udf/file.c
1124 +++ b/fs/udf/file.c
1125 @@ -125,7 +125,6 @@ static ssize_t udf_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
1126 err = udf_expand_file_adinicb(inode);
1127 if (err) {
1128 udf_debug("udf_expand_adinicb: err=%d\n", err);
1129 - up_write(&iinfo->i_data_sem);
1130 return err;
1131 }
1132 } else {
1133 @@ -133,9 +132,10 @@ static ssize_t udf_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
1134 iinfo->i_lenAlloc = pos + count;
1135 else
1136 iinfo->i_lenAlloc = inode->i_size;
1137 + up_write(&iinfo->i_data_sem);
1138 }
1139 - }
1140 - up_write(&iinfo->i_data_sem);
1141 + } else
1142 + up_write(&iinfo->i_data_sem);
1143
1144 retval = generic_file_aio_write(iocb, iov, nr_segs, ppos);
1145 if (retval > 0)
1146 diff --git a/fs/udf/inode.c b/fs/udf/inode.c
1147 index 1d1358e..262050f 100644
1148 --- a/fs/udf/inode.c
1149 +++ b/fs/udf/inode.c
1150 @@ -145,6 +145,12 @@ const struct address_space_operations udf_aops = {
1151 .bmap = udf_bmap,
1152 };
1153
1154 +/*
1155 + * Expand file stored in ICB to a normal one-block-file
1156 + *
1157 + * This function requires i_data_sem for writing and releases it.
1158 + * This function requires i_mutex held
1159 + */
1160 int udf_expand_file_adinicb(struct inode *inode)
1161 {
1162 struct page *page;
1163 @@ -163,9 +169,15 @@ int udf_expand_file_adinicb(struct inode *inode)
1164 iinfo->i_alloc_type = ICBTAG_FLAG_AD_LONG;
1165 /* from now on we have normal address_space methods */
1166 inode->i_data.a_ops = &udf_aops;
1167 + up_write(&iinfo->i_data_sem);
1168 mark_inode_dirty(inode);
1169 return 0;
1170 }
1171 + /*
1172 + * Release i_data_sem so that we can lock a page - page lock ranks
1173 + * above i_data_sem. i_mutex still protects us against file changes.
1174 + */
1175 + up_write(&iinfo->i_data_sem);
1176
1177 page = find_or_create_page(inode->i_mapping, 0, GFP_NOFS);
1178 if (!page)
1179 @@ -181,6 +193,7 @@ int udf_expand_file_adinicb(struct inode *inode)
1180 SetPageUptodate(page);
1181 kunmap(page);
1182 }
1183 + down_write(&iinfo->i_data_sem);
1184 memset(iinfo->i_ext.i_data + iinfo->i_lenEAttr, 0x00,
1185 iinfo->i_lenAlloc);
1186 iinfo->i_lenAlloc = 0;
1187 @@ -190,17 +203,20 @@ int udf_expand_file_adinicb(struct inode *inode)
1188 iinfo->i_alloc_type = ICBTAG_FLAG_AD_LONG;
1189 /* from now on we have normal address_space methods */
1190 inode->i_data.a_ops = &udf_aops;
1191 + up_write(&iinfo->i_data_sem);
1192 err = inode->i_data.a_ops->writepage(page, &udf_wbc);
1193 if (err) {
1194 /* Restore everything back so that we don't lose data... */
1195 lock_page(page);
1196 kaddr = kmap(page);
1197 + down_write(&iinfo->i_data_sem);
1198 memcpy(iinfo->i_ext.i_data + iinfo->i_lenEAttr, kaddr,
1199 inode->i_size);
1200 kunmap(page);
1201 unlock_page(page);
1202 iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB;
1203 inode->i_data.a_ops = &udf_adinicb_aops;
1204 + up_write(&iinfo->i_data_sem);
1205 }
1206 page_cache_release(page);
1207 mark_inode_dirty(inode);
1208 @@ -1105,10 +1121,9 @@ int udf_setsize(struct inode *inode, loff_t newsize)
1209 if (bsize <
1210 (udf_file_entry_alloc_offset(inode) + newsize)) {
1211 err = udf_expand_file_adinicb(inode);
1212 - if (err) {
1213 - up_write(&iinfo->i_data_sem);
1214 + if (err)
1215 return err;
1216 - }
1217 + down_write(&iinfo->i_data_sem);
1218 } else
1219 iinfo->i_lenAlloc = newsize;
1220 }
1221 diff --git a/fs/xfs/linux-2.6/xfs_acl.c b/fs/xfs/linux-2.6/xfs_acl.c
1222 index 4b9fb91..f86e034 100644
1223 --- a/fs/xfs/linux-2.6/xfs_acl.c
1224 +++ b/fs/xfs/linux-2.6/xfs_acl.c
1225 @@ -39,7 +39,7 @@ xfs_acl_from_disk(struct xfs_acl *aclp)
1226 struct posix_acl_entry *acl_e;
1227 struct posix_acl *acl;
1228 struct xfs_acl_entry *ace;
1229 - int count, i;
1230 + unsigned int count, i;
1231
1232 count = be32_to_cpu(aclp->acl_cnt);
1233 if (count > XFS_ACL_MAX_ENTRIES)
1234 diff --git a/include/linux/usb.h b/include/linux/usb.h
1235 index 73c7df4..b08e04c 100644
1236 --- a/include/linux/usb.h
1237 +++ b/include/linux/usb.h
1238 @@ -1202,6 +1202,7 @@ struct urb {
1239 void *transfer_buffer; /* (in) associated data buffer */
1240 dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */
1241 struct scatterlist *sg; /* (in) scatter gather buffer list */
1242 + int num_mapped_sgs; /* (internal) mapped sg entries */
1243 int num_sgs; /* (in) number of entries in the sg list */
1244 u32 transfer_buffer_length; /* (in) data buffer length */
1245 u32 actual_length; /* (return) actual transfer length */
1246 diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
1247 index 0fd3fbd..cf65b5c 100644
1248 --- a/include/linux/usb/ch9.h
1249 +++ b/include/linux/usb/ch9.h
1250 @@ -583,8 +583,26 @@ struct usb_ss_ep_comp_descriptor {
1251 } __attribute__ ((packed));
1252
1253 #define USB_DT_SS_EP_COMP_SIZE 6
1254 +
1255 /* Bits 4:0 of bmAttributes if this is a bulk endpoint */
1256 -#define USB_SS_MAX_STREAMS(p) (1 << ((p) & 0x1f))
1257 +static inline int
1258 +usb_ss_max_streams(const struct usb_ss_ep_comp_descriptor *comp)
1259 +{
1260 + int max_streams;
1261 +
1262 + if (!comp)
1263 + return 0;
1264 +
1265 + max_streams = comp->bmAttributes & 0x1f;
1266 +
1267 + if (!max_streams)
1268 + return 0;
1269 +
1270 + max_streams = 1 << max_streams;
1271 +
1272 + return max_streams;
1273 +}
1274 +
1275 /* Bits 1:0 of bmAttributes if this is an isoc endpoint */
1276 #define USB_SS_MULT(p) (1 + ((p) & 0x3))
1277
1278 diff --git a/kernel/cgroup.c b/kernel/cgroup.c
1279 index 575a5e7..2efce77 100644
1280 --- a/kernel/cgroup.c
1281 +++ b/kernel/cgroup.c
1282 @@ -1173,10 +1173,10 @@ static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts)
1283
1284 /*
1285 * If the 'all' option was specified select all the subsystems,
1286 - * otherwise 'all, 'none' and a subsystem name options were not
1287 - * specified, let's default to 'all'
1288 + * otherwise if 'none', 'name=' and a subsystem name options
1289 + * were not specified, let's default to 'all'
1290 */
1291 - if (all_ss || (!all_ss && !one_ss && !opts->none)) {
1292 + if (all_ss || (!one_ss && !opts->none && !opts->name)) {
1293 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
1294 struct cgroup_subsys *ss = subsys[i];
1295 if (ss == NULL)
1296 diff --git a/kernel/cpu.c b/kernel/cpu.c
1297 index 12b7458..aa39dd7 100644
1298 --- a/kernel/cpu.c
1299 +++ b/kernel/cpu.c
1300 @@ -15,6 +15,7 @@
1301 #include <linux/stop_machine.h>
1302 #include <linux/mutex.h>
1303 #include <linux/gfp.h>
1304 +#include <linux/suspend.h>
1305
1306 #ifdef CONFIG_SMP
1307 /* Serializes the updates to cpu_online_mask, cpu_present_mask */
1308 @@ -476,6 +477,79 @@ static int alloc_frozen_cpus(void)
1309 return 0;
1310 }
1311 core_initcall(alloc_frozen_cpus);
1312 +
1313 +/*
1314 + * Prevent regular CPU hotplug from racing with the freezer, by disabling CPU
1315 + * hotplug when tasks are about to be frozen. Also, don't allow the freezer
1316 + * to continue until any currently running CPU hotplug operation gets
1317 + * completed.
1318 + * To modify the 'cpu_hotplug_disabled' flag, we need to acquire the
1319 + * 'cpu_add_remove_lock'. And this same lock is also taken by the regular
1320 + * CPU hotplug path and released only after it is complete. Thus, we
1321 + * (and hence the freezer) will block here until any currently running CPU
1322 + * hotplug operation gets completed.
1323 + */
1324 +void cpu_hotplug_disable_before_freeze(void)
1325 +{
1326 + cpu_maps_update_begin();
1327 + cpu_hotplug_disabled = 1;
1328 + cpu_maps_update_done();
1329 +}
1330 +
1331 +
1332 +/*
1333 + * When tasks have been thawed, re-enable regular CPU hotplug (which had been
1334 + * disabled while beginning to freeze tasks).
1335 + */
1336 +void cpu_hotplug_enable_after_thaw(void)
1337 +{
1338 + cpu_maps_update_begin();
1339 + cpu_hotplug_disabled = 0;
1340 + cpu_maps_update_done();
1341 +}
1342 +
1343 +/*
1344 + * When callbacks for CPU hotplug notifications are being executed, we must
1345 + * ensure that the state of the system with respect to the tasks being frozen
1346 + * or not, as reported by the notification, remains unchanged *throughout the
1347 + * duration* of the execution of the callbacks.
1348 + * Hence we need to prevent the freezer from racing with regular CPU hotplug.
1349 + *
1350 + * This synchronization is implemented by mutually excluding regular CPU
1351 + * hotplug and Suspend/Hibernate call paths by hooking onto the Suspend/
1352 + * Hibernate notifications.
1353 + */
1354 +static int
1355 +cpu_hotplug_pm_callback(struct notifier_block *nb,
1356 + unsigned long action, void *ptr)
1357 +{
1358 + switch (action) {
1359 +
1360 + case PM_SUSPEND_PREPARE:
1361 + case PM_HIBERNATION_PREPARE:
1362 + cpu_hotplug_disable_before_freeze();
1363 + break;
1364 +
1365 + case PM_POST_SUSPEND:
1366 + case PM_POST_HIBERNATION:
1367 + cpu_hotplug_enable_after_thaw();
1368 + break;
1369 +
1370 + default:
1371 + return NOTIFY_DONE;
1372 + }
1373 +
1374 + return NOTIFY_OK;
1375 +}
1376 +
1377 +
1378 +int cpu_hotplug_pm_sync_init(void)
1379 +{
1380 + pm_notifier(cpu_hotplug_pm_callback, 0);
1381 + return 0;
1382 +}
1383 +core_initcall(cpu_hotplug_pm_sync_init);
1384 +
1385 #endif /* CONFIG_PM_SLEEP_SMP */
1386
1387 /**
1388 diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
1389 index d577199..e0d42db 100644
1390 --- a/net/ipv4/igmp.c
1391 +++ b/net/ipv4/igmp.c
1392 @@ -875,6 +875,8 @@ static void igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb,
1393 * to be intended in a v3 query.
1394 */
1395 max_delay = IGMPV3_MRC(ih3->code)*(HZ/IGMP_TIMER_SCALE);
1396 + if (!max_delay)
1397 + max_delay = 1; /* can't mod w/ 0 */
1398 } else { /* v3 */
1399 if (!pskb_may_pull(skb, sizeof(struct igmpv3_query)))
1400 return;
1401 diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
1402 index 6c164dc..bf54c48 100644
1403 --- a/tools/perf/util/trace-event-parse.c
1404 +++ b/tools/perf/util/trace-event-parse.c
1405 @@ -1582,6 +1582,8 @@ process_symbols(struct event *event, struct print_arg *arg, char **tok)
1406 field = malloc_or_die(sizeof(*field));
1407
1408 type = process_arg(event, field, &token);
1409 + while (type == EVENT_OP)
1410 + type = process_op(event, field, &token);
1411 if (test_type_token(type, token, EVENT_DELIM, ","))
1412 goto out_free;
1413

  ViewVC Help
Powered by ViewVC 1.1.20