/[linux-patches]/genpatches-2.6/trunk/3.8/1000_linux-3.7.1.patch
Gentoo

Contents of /genpatches-2.6/trunk/3.8/1000_linux-3.7.1.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2256 - (show annotations) (download)
Sat Dec 22 19:47:33 2012 UTC (20 months, 3 weeks ago) by mpagano
File size: 35440 byte(s)
Creating 3.8 branch from 3.7
1 diff --git a/Makefile b/Makefile
2 index 540f7b2..fbf84a4 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 3
7 PATCHLEVEL = 7
8 -SUBLEVEL = 0
9 +SUBLEVEL = 1
10 EXTRAVERSION =
11 NAME = Terrified Chipmunk
12
13 diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
14 index 1460a5d..e28670f 100644
15 --- a/arch/x86/kernel/hpet.c
16 +++ b/arch/x86/kernel/hpet.c
17 @@ -434,7 +434,7 @@ void hpet_msi_unmask(struct irq_data *data)
18
19 /* unmask it */
20 cfg = hpet_readl(HPET_Tn_CFG(hdev->num));
21 - cfg |= HPET_TN_FSB;
22 + cfg |= HPET_TN_ENABLE | HPET_TN_FSB;
23 hpet_writel(cfg, HPET_Tn_CFG(hdev->num));
24 }
25
26 @@ -445,7 +445,7 @@ void hpet_msi_mask(struct irq_data *data)
27
28 /* mask it */
29 cfg = hpet_readl(HPET_Tn_CFG(hdev->num));
30 - cfg &= ~HPET_TN_FSB;
31 + cfg &= ~(HPET_TN_ENABLE | HPET_TN_FSB);
32 hpet_writel(cfg, HPET_Tn_CFG(hdev->num));
33 }
34
35 diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
36 index 45e3e17..7efaeaa 100644
37 --- a/drivers/acpi/battery.c
38 +++ b/drivers/acpi/battery.c
39 @@ -34,6 +34,7 @@
40 #include <linux/dmi.h>
41 #include <linux/slab.h>
42 #include <linux/suspend.h>
43 +#include <asm/unaligned.h>
44
45 #ifdef CONFIG_ACPI_PROCFS_POWER
46 #include <linux/proc_fs.h>
47 @@ -95,6 +96,18 @@ enum {
48 ACPI_BATTERY_ALARM_PRESENT,
49 ACPI_BATTERY_XINFO_PRESENT,
50 ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY,
51 + /* On Lenovo Thinkpad models from 2010 and 2011, the power unit
52 + switches between mWh and mAh depending on whether the system
53 + is running on battery or not. When mAh is the unit, most
54 + reported values are incorrect and need to be adjusted by
55 + 10000/design_voltage. Verified on x201, t410, t410s, and x220.
56 + Pre-2010 and 2012 models appear to always report in mWh and
57 + are thus unaffected (tested with t42, t61, t500, x200, x300,
58 + and x230). Also, in mid-2012 Lenovo issued a BIOS update for
59 + the 2011 models that fixes the issue (tested on x220 with a
60 + post-1.29 BIOS), but as of Nov. 2012, no such update is
61 + available for the 2010 models. */
62 + ACPI_BATTERY_QUIRK_THINKPAD_MAH,
63 };
64
65 struct acpi_battery {
66 @@ -438,6 +451,21 @@ static int acpi_battery_get_info(struct acpi_battery *battery)
67 kfree(buffer.pointer);
68 if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags))
69 battery->full_charge_capacity = battery->design_capacity;
70 + if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH, &battery->flags) &&
71 + battery->power_unit && battery->design_voltage) {
72 + battery->design_capacity = battery->design_capacity *
73 + 10000 / battery->design_voltage;
74 + battery->full_charge_capacity = battery->full_charge_capacity *
75 + 10000 / battery->design_voltage;
76 + battery->design_capacity_warning =
77 + battery->design_capacity_warning *
78 + 10000 / battery->design_voltage;
79 + /* Curiously, design_capacity_low, unlike the rest of them,
80 + is correct. */
81 + /* capacity_granularity_* equal 1 on the systems tested, so
82 + it's impossible to tell if they would need an adjustment
83 + or not if their values were higher. */
84 + }
85 return result;
86 }
87
88 @@ -486,6 +514,11 @@ static int acpi_battery_get_state(struct acpi_battery *battery)
89 && battery->capacity_now >= 0 && battery->capacity_now <= 100)
90 battery->capacity_now = (battery->capacity_now *
91 battery->full_charge_capacity) / 100;
92 + if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH, &battery->flags) &&
93 + battery->power_unit && battery->design_voltage) {
94 + battery->capacity_now = battery->capacity_now *
95 + 10000 / battery->design_voltage;
96 + }
97 return result;
98 }
99
100 @@ -595,6 +628,24 @@ static void sysfs_remove_battery(struct acpi_battery *battery)
101 mutex_unlock(&battery->sysfs_lock);
102 }
103
104 +static void find_battery(const struct dmi_header *dm, void *private)
105 +{
106 + struct acpi_battery *battery = (struct acpi_battery *)private;
107 + /* Note: the hardcoded offsets below have been extracted from
108 + the source code of dmidecode. */
109 + if (dm->type == DMI_ENTRY_PORTABLE_BATTERY && dm->length >= 8) {
110 + const u8 *dmi_data = (const u8 *)(dm + 1);
111 + int dmi_capacity = get_unaligned((const u16 *)(dmi_data + 6));
112 + if (dm->length >= 18)
113 + dmi_capacity *= dmi_data[17];
114 + if (battery->design_capacity * battery->design_voltage / 1000
115 + != dmi_capacity &&
116 + battery->design_capacity * 10 == dmi_capacity)
117 + set_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH,
118 + &battery->flags);
119 + }
120 +}
121 +
122 /*
123 * According to the ACPI spec, some kinds of primary batteries can
124 * report percentage battery remaining capacity directly to OS.
125 @@ -620,6 +671,32 @@ static void acpi_battery_quirks(struct acpi_battery *battery)
126 battery->capacity_now = (battery->capacity_now *
127 battery->full_charge_capacity) / 100;
128 }
129 +
130 + if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH, &battery->flags))
131 + return ;
132 +
133 + if (battery->power_unit && dmi_name_in_vendors("LENOVO")) {
134 + const char *s;
135 + s = dmi_get_system_info(DMI_PRODUCT_VERSION);
136 + if (s && !strnicmp(s, "ThinkPad", 8)) {
137 + dmi_walk(find_battery, battery);
138 + if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH,
139 + &battery->flags) &&
140 + battery->design_voltage) {
141 + battery->design_capacity =
142 + battery->design_capacity *
143 + 10000 / battery->design_voltage;
144 + battery->full_charge_capacity =
145 + battery->full_charge_capacity *
146 + 10000 / battery->design_voltage;
147 + battery->design_capacity_warning =
148 + battery->design_capacity_warning *
149 + 10000 / battery->design_voltage;
150 + battery->capacity_now = battery->capacity_now *
151 + 10000 / battery->design_voltage;
152 + }
153 + }
154 + }
155 }
156
157 static int acpi_battery_update(struct acpi_battery *battery)
158 diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
159 index fdcdbb6..847ed55 100644
160 --- a/drivers/acpi/sleep.c
161 +++ b/drivers/acpi/sleep.c
162 @@ -519,6 +519,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
163 },
164 {
165 .callback = init_nvs_nosave,
166 + .ident = "Sony Vaio VPCEB1S1E",
167 + .matches = {
168 + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
169 + DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1S1E"),
170 + },
171 + },
172 + {
173 + .callback = init_nvs_nosave,
174 .ident = "Sony Vaio VGN-FW520F",
175 .matches = {
176 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
177 diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
178 index 0230cb6..ac9a69c 100644
179 --- a/drivers/acpi/video.c
180 +++ b/drivers/acpi/video.c
181 @@ -389,6 +389,12 @@ static int __init video_set_bqc_offset(const struct dmi_system_id *d)
182 return 0;
183 }
184
185 +static int video_ignore_initial_backlight(const struct dmi_system_id *d)
186 +{
187 + use_bios_initial_backlight = 0;
188 + return 0;
189 +}
190 +
191 static struct dmi_system_id video_dmi_table[] __initdata = {
192 /*
193 * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121
194 @@ -433,6 +439,14 @@ static struct dmi_system_id video_dmi_table[] __initdata = {
195 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720"),
196 },
197 },
198 + {
199 + .callback = video_ignore_initial_backlight,
200 + .ident = "HP Folio 13-2000",
201 + .matches = {
202 + DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
203 + DMI_MATCH(DMI_PRODUCT_NAME, "HP Folio 13 - 2000 Notebook PC"),
204 + },
205 + },
206 {}
207 };
208
209 diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
210 index b728880..4ac2593 100644
211 --- a/drivers/acpi/video_detect.c
212 +++ b/drivers/acpi/video_detect.c
213 @@ -156,6 +156,14 @@ static struct dmi_system_id video_detect_dmi_table[] = {
214 DMI_MATCH(DMI_BOARD_NAME, "X360"),
215 },
216 },
217 + {
218 + .callback = video_detect_force_vendor,
219 + .ident = "Asus UL30VT",
220 + .matches = {
221 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
222 + DMI_MATCH(DMI_PRODUCT_NAME, "UL30VT"),
223 + },
224 + },
225 { },
226 };
227
228 diff --git a/drivers/clk/ux500/u8500_clk.c b/drivers/clk/ux500/u8500_clk.c
229 index e2c17d1..6939009 100644
230 --- a/drivers/clk/ux500/u8500_clk.c
231 +++ b/drivers/clk/ux500/u8500_clk.c
232 @@ -323,7 +323,7 @@ void u8500_clk_init(void)
233 clk_register_clkdev(clk, NULL, "gpioblock1");
234
235 clk = clk_reg_prcc_pclk("p2_pclk12", "per2clk", U8500_CLKRST2_BASE,
236 - BIT(11), 0);
237 + BIT(12), 0);
238
239 clk = clk_reg_prcc_pclk("p3_pclk0", "per3clk", U8500_CLKRST3_BASE,
240 BIT(0), 0);
241 diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c
242 index 4f41104..34ab2a8 100644
243 --- a/drivers/hwmon/fam15h_power.c
244 +++ b/drivers/hwmon/fam15h_power.c
245 @@ -31,6 +31,9 @@ MODULE_DESCRIPTION("AMD Family 15h CPU processor power monitor");
246 MODULE_AUTHOR("Andreas Herrmann <herrmann.der.user@googlemail.com>");
247 MODULE_LICENSE("GPL");
248
249 +/* Family 16h Northbridge's function 4 PCI ID */
250 +#define PCI_DEVICE_ID_AMD_16H_NB_F4 0x1534
251 +
252 /* D18F3 */
253 #define REG_NORTHBRIDGE_CAP 0xe8
254
255 @@ -248,6 +251,7 @@ static void __devexit fam15h_power_remove(struct pci_dev *pdev)
256
257 static DEFINE_PCI_DEVICE_TABLE(fam15h_power_id_table) = {
258 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) },
259 + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) },
260 {}
261 };
262 MODULE_DEVICE_TABLE(pci, fam15h_power_id_table);
263 diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
264 index 26b5d4b..ec8e914 100644
265 --- a/drivers/pnp/pnpacpi/core.c
266 +++ b/drivers/pnp/pnpacpi/core.c
267 @@ -95,6 +95,9 @@ static int pnpacpi_set_resources(struct pnp_dev *dev)
268 return -ENODEV;
269 }
270
271 + if (WARN_ON_ONCE(acpi_dev != dev->data))
272 + dev->data = acpi_dev;
273 +
274 ret = pnpacpi_build_resource_template(dev, &buffer);
275 if (ret)
276 return ret;
277 diff --git a/drivers/staging/bcm/InterfaceInit.c b/drivers/staging/bcm/InterfaceInit.c
278 index b05f5f7..f10ab70 100644
279 --- a/drivers/staging/bcm/InterfaceInit.c
280 +++ b/drivers/staging/bcm/InterfaceInit.c
281 @@ -4,11 +4,12 @@ static struct usb_device_id InterfaceUsbtable[] = {
282 { USB_DEVICE(BCM_USB_VENDOR_ID_T3, BCM_USB_PRODUCT_ID_T3) },
283 { USB_DEVICE(BCM_USB_VENDOR_ID_T3, BCM_USB_PRODUCT_ID_T3B) },
284 { USB_DEVICE(BCM_USB_VENDOR_ID_T3, BCM_USB_PRODUCT_ID_T3L) },
285 - { USB_DEVICE(BCM_USB_VENDOR_ID_T3, BCM_USB_PRODUCT_ID_SM250) },
286 + { USB_DEVICE(BCM_USB_VENDOR_ID_T3, BCM_USB_PRODUCT_ID_SYM) },
287 { USB_DEVICE(BCM_USB_VENDOR_ID_ZTE, BCM_USB_PRODUCT_ID_226) },
288 { USB_DEVICE(BCM_USB_VENDOR_ID_FOXCONN, BCM_USB_PRODUCT_ID_1901) },
289 { USB_DEVICE(BCM_USB_VENDOR_ID_ZTE, BCM_USB_PRODUCT_ID_ZTE_TU25) },
290 { USB_DEVICE(BCM_USB_VENDOR_ID_ZTE, BCM_USB_PRODUCT_ID_ZTE_226) },
291 + { USB_DEVICE(BCM_USB_VENDOR_ID_ZTE, BCM_USB_PRODUCT_ID_ZTE_326) },
292 { }
293 };
294 MODULE_DEVICE_TABLE(usb, InterfaceUsbtable);
295 diff --git a/drivers/staging/bcm/InterfaceInit.h b/drivers/staging/bcm/InterfaceInit.h
296 index 866924e..241bf97 100644
297 --- a/drivers/staging/bcm/InterfaceInit.h
298 +++ b/drivers/staging/bcm/InterfaceInit.h
299 @@ -8,11 +8,11 @@
300 #define BCM_USB_PRODUCT_ID_T3 0x0300
301 #define BCM_USB_PRODUCT_ID_T3B 0x0210
302 #define BCM_USB_PRODUCT_ID_T3L 0x0220
303 -#define BCM_USB_PRODUCT_ID_SM250 0xbccd
304 #define BCM_USB_PRODUCT_ID_SYM 0x15E
305 #define BCM_USB_PRODUCT_ID_1901 0xe017
306 #define BCM_USB_PRODUCT_ID_226 0x0132 /* not sure if this is valid */
307 #define BCM_USB_PRODUCT_ID_ZTE_226 0x172
308 +#define BCM_USB_PRODUCT_ID_ZTE_326 0x173 /* ZTE AX326 */
309 #define BCM_USB_PRODUCT_ID_ZTE_TU25 0x0007
310
311 #define BCM_USB_MINOR_BASE 192
312 diff --git a/drivers/staging/telephony/ixj.c b/drivers/staging/telephony/ixj.c
313 index 1cfa0b0..cf6aa83 100644
314 --- a/drivers/staging/telephony/ixj.c
315 +++ b/drivers/staging/telephony/ixj.c
316 @@ -3190,12 +3190,12 @@ static void ixj_write_cid(IXJ *j)
317
318 ixj_fsk_alloc(j);
319
320 - strcpy(sdmf1, j->cid_send.month);
321 - strcat(sdmf1, j->cid_send.day);
322 - strcat(sdmf1, j->cid_send.hour);
323 - strcat(sdmf1, j->cid_send.min);
324 - strcpy(sdmf2, j->cid_send.number);
325 - strcpy(sdmf3, j->cid_send.name);
326 + strlcpy(sdmf1, j->cid_send.month, sizeof(sdmf1));
327 + strlcat(sdmf1, j->cid_send.day, sizeof(sdmf1));
328 + strlcat(sdmf1, j->cid_send.hour, sizeof(sdmf1));
329 + strlcat(sdmf1, j->cid_send.min, sizeof(sdmf1));
330 + strlcpy(sdmf2, j->cid_send.number, sizeof(sdmf2));
331 + strlcpy(sdmf3, j->cid_send.name, sizeof(sdmf3));
332
333 len1 = strlen(sdmf1);
334 len2 = strlen(sdmf2);
335 @@ -3340,12 +3340,12 @@ static void ixj_write_cidcw(IXJ *j)
336 ixj_pre_cid(j);
337 }
338 j->flags.cidcw_ack = 0;
339 - strcpy(sdmf1, j->cid_send.month);
340 - strcat(sdmf1, j->cid_send.day);
341 - strcat(sdmf1, j->cid_send.hour);
342 - strcat(sdmf1, j->cid_send.min);
343 - strcpy(sdmf2, j->cid_send.number);
344 - strcpy(sdmf3, j->cid_send.name);
345 + strlcpy(sdmf1, j->cid_send.month, sizeof(sdmf1));
346 + strlcat(sdmf1, j->cid_send.day, sizeof(sdmf1));
347 + strlcat(sdmf1, j->cid_send.hour, sizeof(sdmf1));
348 + strlcat(sdmf1, j->cid_send.min, sizeof(sdmf1));
349 + strlcpy(sdmf2, j->cid_send.number, sizeof(sdmf2));
350 + strlcpy(sdmf3, j->cid_send.name, sizeof(sdmf3));
351
352 len1 = strlen(sdmf1);
353 len2 = strlen(sdmf2);
354 diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
355 index 6e49ec6..8d809a8 100644
356 --- a/drivers/usb/class/cdc-acm.c
357 +++ b/drivers/usb/class/cdc-acm.c
358 @@ -787,6 +787,10 @@ static int get_serial_info(struct acm *acm, struct serial_struct __user *info)
359 tmp.flags = ASYNC_LOW_LATENCY;
360 tmp.xmit_fifo_size = acm->writesize;
361 tmp.baud_base = le32_to_cpu(acm->line.dwDTERate);
362 + tmp.close_delay = acm->port.close_delay / 10;
363 + tmp.closing_wait = acm->port.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
364 + ASYNC_CLOSING_WAIT_NONE :
365 + acm->port.closing_wait / 10;
366
367 if (copy_to_user(info, &tmp, sizeof(tmp)))
368 return -EFAULT;
369 @@ -794,6 +798,37 @@ static int get_serial_info(struct acm *acm, struct serial_struct __user *info)
370 return 0;
371 }
372
373 +static int set_serial_info(struct acm *acm,
374 + struct serial_struct __user *newinfo)
375 +{
376 + struct serial_struct new_serial;
377 + unsigned int closing_wait, close_delay;
378 + int retval = 0;
379 +
380 + if (copy_from_user(&new_serial, newinfo, sizeof(new_serial)))
381 + return -EFAULT;
382 +
383 + close_delay = new_serial.close_delay * 10;
384 + closing_wait = new_serial.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
385 + ASYNC_CLOSING_WAIT_NONE : new_serial.closing_wait * 10;
386 +
387 + mutex_lock(&acm->port.mutex);
388 +
389 + if (!capable(CAP_SYS_ADMIN)) {
390 + if ((close_delay != acm->port.close_delay) ||
391 + (closing_wait != acm->port.closing_wait))
392 + retval = -EPERM;
393 + else
394 + retval = -EOPNOTSUPP;
395 + } else {
396 + acm->port.close_delay = close_delay;
397 + acm->port.closing_wait = closing_wait;
398 + }
399 +
400 + mutex_unlock(&acm->port.mutex);
401 + return retval;
402 +}
403 +
404 static int acm_tty_ioctl(struct tty_struct *tty,
405 unsigned int cmd, unsigned long arg)
406 {
407 @@ -804,6 +839,9 @@ static int acm_tty_ioctl(struct tty_struct *tty,
408 case TIOCGSERIAL: /* gets serial port data */
409 rv = get_serial_info(acm, (struct serial_struct __user *) arg);
410 break;
411 + case TIOCSSERIAL:
412 + rv = set_serial_info(acm, (struct serial_struct __user *) arg);
413 + break;
414 }
415
416 return rv;
417 diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
418 index 4b66374..3d98902 100644
419 --- a/drivers/usb/host/ehci-q.c
420 +++ b/drivers/usb/host/ehci-q.c
421 @@ -264,15 +264,9 @@ ehci_urb_done(struct ehci_hcd *ehci, struct urb *urb, int status)
422 __releases(ehci->lock)
423 __acquires(ehci->lock)
424 {
425 - if (likely (urb->hcpriv != NULL)) {
426 - struct ehci_qh *qh = (struct ehci_qh *) urb->hcpriv;
427 -
428 - /* S-mask in a QH means it's an interrupt urb */
429 - if ((qh->hw->hw_info2 & cpu_to_hc32(ehci, QH_SMASK)) != 0) {
430 -
431 - /* ... update hc-wide periodic stats (for usbfs) */
432 - ehci_to_hcd(ehci)->self.bandwidth_int_reqs--;
433 - }
434 + if (usb_pipetype(urb->pipe) == PIPE_INTERRUPT) {
435 + /* ... update hc-wide periodic stats */
436 + ehci_to_hcd(ehci)->self.bandwidth_int_reqs--;
437 }
438
439 if (unlikely(urb->unlinked)) {
440 diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
441 index 7cf3da7..528a540 100644
442 --- a/drivers/usb/host/ehci-sched.c
443 +++ b/drivers/usb/host/ehci-sched.c
444 @@ -1646,7 +1646,7 @@ static void itd_link_urb(
445
446 /* don't need that schedule data any more */
447 iso_sched_free (stream, iso_sched);
448 - urb->hcpriv = NULL;
449 + urb->hcpriv = stream;
450
451 ++ehci->isoc_count;
452 enable_periodic(ehci);
453 @@ -2045,7 +2045,7 @@ static void sitd_link_urb(
454
455 /* don't need that schedule data any more */
456 iso_sched_free (stream, sched);
457 - urb->hcpriv = NULL;
458 + urb->hcpriv = stream;
459
460 ++ehci->isoc_count;
461 enable_periodic(ehci);
462 diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c
463 index c5a1ea9..9d00d47 100644
464 --- a/drivers/usb/host/ohci-q.c
465 +++ b/drivers/usb/host/ohci-q.c
466 @@ -1128,6 +1128,25 @@ dl_done_list (struct ohci_hcd *ohci)
467
468 while (td) {
469 struct td *td_next = td->next_dl_td;
470 + struct ed *ed = td->ed;
471 +
472 + /*
473 + * Some OHCI controllers (NVIDIA for sure, maybe others)
474 + * occasionally forget to add TDs to the done queue. Since
475 + * TDs for a given endpoint are always processed in order,
476 + * if we find a TD on the donelist then all of its
477 + * predecessors must be finished as well.
478 + */
479 + for (;;) {
480 + struct td *td2;
481 +
482 + td2 = list_first_entry(&ed->td_list, struct td,
483 + td_list);
484 + if (td2 == td)
485 + break;
486 + takeback_td(ohci, td2);
487 + }
488 +
489 takeback_td(ohci, td);
490 td = td_next;
491 }
492 diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
493 index 8345d7c..dcb72f7 100644
494 --- a/drivers/usb/host/xhci-pci.c
495 +++ b/drivers/usb/host/xhci-pci.c
496 @@ -29,6 +29,7 @@
497 /* Device for a quirk */
498 #define PCI_VENDOR_ID_FRESCO_LOGIC 0x1b73
499 #define PCI_DEVICE_ID_FRESCO_LOGIC_PDK 0x1000
500 +#define PCI_DEVICE_ID_FRESCO_LOGIC_FL1400 0x1400
501
502 #define PCI_VENDOR_ID_ETRON 0x1b6f
503 #define PCI_DEVICE_ID_ASROCK_P67 0x7023
504 @@ -58,8 +59,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
505
506 /* Look for vendor-specific quirks */
507 if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC &&
508 - pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK) {
509 - if (pdev->revision == 0x0) {
510 + (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK ||
511 + pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1400)) {
512 + if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK &&
513 + pdev->revision == 0x0) {
514 xhci->quirks |= XHCI_RESET_EP_QUIRK;
515 xhci_dbg(xhci, "QUIRK: Fresco Logic xHC needs configure"
516 " endpoint cmd after reset endpoint\n");
517 diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig
518 index a8f0523..fecde69 100644
519 --- a/drivers/usb/misc/Kconfig
520 +++ b/drivers/usb/misc/Kconfig
521 @@ -246,6 +246,7 @@ config USB_YUREX
522
523 config USB_EZUSB_FX2
524 tristate "Functions for loading firmware on EZUSB chips"
525 + depends on USB
526 help
527 Say Y here if you need EZUSB device support.
528 (Cypress FX/FX2/FX2LP microcontrollers)
529 diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
530 index eb033fc..402e597 100644
531 --- a/drivers/usb/serial/cp210x.c
532 +++ b/drivers/usb/serial/cp210x.c
533 @@ -118,6 +118,7 @@ static const struct usb_device_id id_table[] = {
534 { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */
535 { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */
536 { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */
537 + { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
538 { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
539 { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
540 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
541 diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
542 index be84587..2641d36 100644
543 --- a/drivers/usb/serial/ftdi_sio.c
544 +++ b/drivers/usb/serial/ftdi_sio.c
545 @@ -192,6 +192,7 @@ static struct usb_device_id id_table_combined [] = {
546 { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_THROTTLE_PID) },
547 { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GATEWAY_PID) },
548 { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) },
549 + { USB_DEVICE(NEWPORT_VID, NEWPORT_AGILIS_PID) },
550 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
551 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
552 { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) },
553 @@ -1781,7 +1782,7 @@ static int ftdi_8u2232c_probe(struct usb_serial *serial)
554 struct usb_device *udev = serial->dev;
555
556 if ((udev->manufacturer && !strcmp(udev->manufacturer, "CALAO Systems")) ||
557 - (udev->product && !strcmp(udev->product, "BeagleBone/XDS100")))
558 + (udev->product && !strcmp(udev->product, "BeagleBone/XDS100V2")))
559 return ftdi_jtag_probe(serial);
560
561 return 0;
562 diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
563 index 57c12ef..049b6e7 100644
564 --- a/drivers/usb/serial/ftdi_sio_ids.h
565 +++ b/drivers/usb/serial/ftdi_sio_ids.h
566 @@ -752,6 +752,12 @@
567 #define TTI_VID 0x103E /* Vendor Id */
568 #define TTI_QL355P_PID 0x03E8 /* TTi QL355P power supply */
569
570 +/*
571 + * Newport Cooperation (www.newport.com)
572 + */
573 +#define NEWPORT_VID 0x104D
574 +#define NEWPORT_AGILIS_PID 0x3000
575 +
576 /* Interbiometrics USB I/O Board */
577 /* Developed for Interbiometrics by Rudolf Gugler */
578 #define INTERBIOMETRICS_VID 0x1209
579 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
580 index edc64bb..da36dc7 100644
581 --- a/drivers/usb/serial/option.c
582 +++ b/drivers/usb/serial/option.c
583 @@ -81,6 +81,7 @@ static void option_instat_callback(struct urb *urb);
584 #define OPTION_PRODUCT_GTM380_MODEM 0x7201
585
586 #define HUAWEI_VENDOR_ID 0x12D1
587 +#define HUAWEI_PRODUCT_E173 0x140C
588 #define HUAWEI_PRODUCT_K4505 0x1464
589 #define HUAWEI_PRODUCT_K3765 0x1465
590 #define HUAWEI_PRODUCT_K4605 0x14C6
591 @@ -553,6 +554,8 @@ static const struct usb_device_id option_ids[] = {
592 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLX) },
593 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GKE) },
594 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLE) },
595 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173, 0xff, 0xff, 0xff),
596 + .driver_info = (kernel_ulong_t) &net_intf1_blacklist },
597 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff),
598 .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist },
599 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff),
600 @@ -884,6 +887,10 @@ static const struct usb_device_id option_ids[] = {
601 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0126, 0xff, 0xff, 0xff),
602 .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
603 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0128, 0xff, 0xff, 0xff) },
604 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0135, 0xff, 0xff, 0xff) },
605 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0136, 0xff, 0xff, 0xff) },
606 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0137, 0xff, 0xff, 0xff) },
607 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0139, 0xff, 0xff, 0xff) },
608 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0142, 0xff, 0xff, 0xff) },
609 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0143, 0xff, 0xff, 0xff) },
610 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0144, 0xff, 0xff, 0xff) },
611 @@ -904,20 +911,34 @@ static const struct usb_device_id option_ids[] = {
612 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) },
613 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0167, 0xff, 0xff, 0xff),
614 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
615 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0189, 0xff, 0xff, 0xff) },
616 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0191, 0xff, 0xff, 0xff), /* ZTE EuFi890 */
617 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
618 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0196, 0xff, 0xff, 0xff) },
619 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0197, 0xff, 0xff, 0xff) },
620 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0199, 0xff, 0xff, 0xff), /* ZTE MF820S */
621 .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
622 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0200, 0xff, 0xff, 0xff) },
623 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0201, 0xff, 0xff, 0xff) },
624 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0254, 0xff, 0xff, 0xff) },
625 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0257, 0xff, 0xff, 0xff), /* ZTE MF821 */
626 .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
627 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0265, 0xff, 0xff, 0xff) },
628 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff) },
629 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0317, 0xff, 0xff, 0xff) },
630 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0326, 0xff, 0xff, 0xff),
631 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
632 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0330, 0xff, 0xff, 0xff) },
633 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0395, 0xff, 0xff, 0xff) },
634 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0414, 0xff, 0xff, 0xff) },
635 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0417, 0xff, 0xff, 0xff) },
636 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff),
637 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
638 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff),
639 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
640 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff),
641 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
642 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1018, 0xff, 0xff, 0xff) },
643 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1021, 0xff, 0xff, 0xff),
644 .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
645 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1057, 0xff, 0xff, 0xff) },
646 @@ -1097,6 +1118,10 @@ static const struct usb_device_id option_ids[] = {
647 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) },
648 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) },
649 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) },
650 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1301, 0xff, 0xff, 0xff) },
651 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1302, 0xff, 0xff, 0xff) },
652 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1303, 0xff, 0xff, 0xff) },
653 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1333, 0xff, 0xff, 0xff) },
654 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1401, 0xff, 0xff, 0xff),
655 .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
656 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1402, 0xff, 0xff, 0xff),
657 diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig
658 index 0ae7bb6..eab04a6 100644
659 --- a/drivers/usb/storage/Kconfig
660 +++ b/drivers/usb/storage/Kconfig
661 @@ -203,7 +203,7 @@ config USB_STORAGE_ENE_UB6250
662
663 config USB_UAS
664 tristate "USB Attached SCSI"
665 - depends on USB && SCSI
666 + depends on USB && SCSI && BROKEN
667 help
668 The USB Attached SCSI protocol is supported by some USB
669 storage devices. It permits higher performance by supporting
670 diff --git a/kernel/rcutree.c b/kernel/rcutree.c
671 index 74df86b..2682295 100644
672 --- a/kernel/rcutree.c
673 +++ b/kernel/rcutree.c
674 @@ -212,13 +212,13 @@ DEFINE_PER_CPU(struct rcu_dynticks, rcu_dynticks) = {
675 #endif
676 };
677
678 -static int blimit = 10; /* Maximum callbacks per rcu_do_batch. */
679 -static int qhimark = 10000; /* If this many pending, ignore blimit. */
680 -static int qlowmark = 100; /* Once only this many pending, use blimit. */
681 +static long blimit = 10; /* Maximum callbacks per rcu_do_batch. */
682 +static long qhimark = 10000; /* If this many pending, ignore blimit. */
683 +static long qlowmark = 100; /* Once only this many pending, use blimit. */
684
685 -module_param(blimit, int, 0444);
686 -module_param(qhimark, int, 0444);
687 -module_param(qlowmark, int, 0444);
688 +module_param(blimit, long, 0444);
689 +module_param(qhimark, long, 0444);
690 +module_param(qlowmark, long, 0444);
691
692 int rcu_cpu_stall_suppress __read_mostly; /* 1 = suppress stall warnings. */
693 int rcu_cpu_stall_timeout __read_mostly = CONFIG_RCU_CPU_STALL_TIMEOUT;
694 @@ -1769,7 +1769,8 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
695 {
696 unsigned long flags;
697 struct rcu_head *next, *list, **tail;
698 - int bl, count, count_lazy, i;
699 + long bl, count, count_lazy;
700 + int i;
701
702 /* If no callbacks are ready, just return.*/
703 if (!cpu_has_callbacks_ready_to_invoke(rdp)) {
704 diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
705 index 9dcf15d..51b7159 100644
706 --- a/kernel/trace/ftrace.c
707 +++ b/kernel/trace/ftrace.c
708 @@ -2437,7 +2437,7 @@ static void reset_iter_read(struct ftrace_iterator *iter)
709 {
710 iter->pos = 0;
711 iter->func_pos = 0;
712 - iter->flags &= ~(FTRACE_ITER_PRINTALL & FTRACE_ITER_HASH);
713 + iter->flags &= ~(FTRACE_ITER_PRINTALL | FTRACE_ITER_HASH);
714 }
715
716 static void *t_start(struct seq_file *m, loff_t *pos)
717 diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
718 index b979426..4cb5e51 100644
719 --- a/kernel/trace/ring_buffer.c
720 +++ b/kernel/trace/ring_buffer.c
721 @@ -1396,6 +1396,8 @@ rb_insert_pages(struct ring_buffer_per_cpu *cpu_buffer)
722 struct list_head *head_page_with_bit;
723
724 head_page = &rb_set_head_page(cpu_buffer)->list;
725 + if (!head_page)
726 + break;
727 prev_page = head_page->prev;
728
729 first_page = pages->next;
730 @@ -2934,7 +2936,7 @@ unsigned long ring_buffer_oldest_event_ts(struct ring_buffer *buffer, int cpu)
731 unsigned long flags;
732 struct ring_buffer_per_cpu *cpu_buffer;
733 struct buffer_page *bpage;
734 - unsigned long ret;
735 + unsigned long ret = 0;
736
737 if (!cpumask_test_cpu(cpu, buffer->cpumask))
738 return 0;
739 @@ -2949,7 +2951,8 @@ unsigned long ring_buffer_oldest_event_ts(struct ring_buffer *buffer, int cpu)
740 bpage = cpu_buffer->reader_page;
741 else
742 bpage = rb_set_head_page(cpu_buffer);
743 - ret = bpage->page->time_stamp;
744 + if (bpage)
745 + ret = bpage->page->time_stamp;
746 raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);
747
748 return ret;
749 @@ -3260,6 +3263,8 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer)
750 * Splice the empty reader page into the list around the head.
751 */
752 reader = rb_set_head_page(cpu_buffer);
753 + if (!reader)
754 + goto out;
755 cpu_buffer->reader_page->list.next = rb_list_head(reader->list.next);
756 cpu_buffer->reader_page->list.prev = reader->list.prev;
757
758 @@ -3778,12 +3783,17 @@ void
759 ring_buffer_read_finish(struct ring_buffer_iter *iter)
760 {
761 struct ring_buffer_per_cpu *cpu_buffer = iter->cpu_buffer;
762 + unsigned long flags;
763
764 /*
765 * Ring buffer is disabled from recording, here's a good place
766 - * to check the integrity of the ring buffer.
767 + * to check the integrity of the ring buffer.
768 + * Must prevent readers from trying to read, as the check
769 + * clears the HEAD page and readers require it.
770 */
771 + raw_spin_lock_irqsave(&cpu_buffer->reader_lock, flags);
772 rb_check_pages(cpu_buffer);
773 + raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);
774
775 atomic_dec(&cpu_buffer->record_disabled);
776 atomic_dec(&cpu_buffer->buffer->resize_disabled);
777 diff --git a/mm/dmapool.c b/mm/dmapool.c
778 index c5ab33b..da1b0f0 100644
779 --- a/mm/dmapool.c
780 +++ b/mm/dmapool.c
781 @@ -50,7 +50,6 @@ struct dma_pool { /* the pool */
782 size_t allocation;
783 size_t boundary;
784 char name[32];
785 - wait_queue_head_t waitq;
786 struct list_head pools;
787 };
788
789 @@ -62,8 +61,6 @@ struct dma_page { /* cacheable header for 'allocation' bytes */
790 unsigned int offset;
791 };
792
793 -#define POOL_TIMEOUT_JIFFIES ((100 /* msec */ * HZ) / 1000)
794 -
795 static DEFINE_MUTEX(pools_lock);
796
797 static ssize_t
798 @@ -172,7 +169,6 @@ struct dma_pool *dma_pool_create(const char *name, struct device *dev,
799 retval->size = size;
800 retval->boundary = boundary;
801 retval->allocation = allocation;
802 - init_waitqueue_head(&retval->waitq);
803
804 if (dev) {
805 int ret;
806 @@ -227,7 +223,6 @@ static struct dma_page *pool_alloc_page(struct dma_pool *pool, gfp_t mem_flags)
807 memset(page->vaddr, POOL_POISON_FREED, pool->allocation);
808 #endif
809 pool_initialise_page(pool, page);
810 - list_add(&page->page_list, &pool->page_list);
811 page->in_use = 0;
812 page->offset = 0;
813 } else {
814 @@ -315,30 +310,21 @@ void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
815 might_sleep_if(mem_flags & __GFP_WAIT);
816
817 spin_lock_irqsave(&pool->lock, flags);
818 - restart:
819 list_for_each_entry(page, &pool->page_list, page_list) {
820 if (page->offset < pool->allocation)
821 goto ready;
822 }
823 - page = pool_alloc_page(pool, GFP_ATOMIC);
824 - if (!page) {
825 - if (mem_flags & __GFP_WAIT) {
826 - DECLARE_WAITQUEUE(wait, current);
827
828 - __set_current_state(TASK_UNINTERRUPTIBLE);
829 - __add_wait_queue(&pool->waitq, &wait);
830 - spin_unlock_irqrestore(&pool->lock, flags);
831 + /* pool_alloc_page() might sleep, so temporarily drop &pool->lock */
832 + spin_unlock_irqrestore(&pool->lock, flags);
833
834 - schedule_timeout(POOL_TIMEOUT_JIFFIES);
835 + page = pool_alloc_page(pool, mem_flags);
836 + if (!page)
837 + return NULL;
838
839 - spin_lock_irqsave(&pool->lock, flags);
840 - __remove_wait_queue(&pool->waitq, &wait);
841 - goto restart;
842 - }
843 - retval = NULL;
844 - goto done;
845 - }
846 + spin_lock_irqsave(&pool->lock, flags);
847
848 + list_add(&page->page_list, &pool->page_list);
849 ready:
850 page->in_use++;
851 offset = page->offset;
852 @@ -348,7 +334,6 @@ void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
853 #ifdef DMAPOOL_DEBUG
854 memset(retval, POOL_POISON_ALLOCATED, pool->size);
855 #endif
856 - done:
857 spin_unlock_irqrestore(&pool->lock, flags);
858 return retval;
859 }
860 @@ -435,8 +420,6 @@ void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma)
861 page->in_use--;
862 *(int *)vaddr = page->offset;
863 page->offset = offset;
864 - if (waitqueue_active(&pool->waitq))
865 - wake_up_locked(&pool->waitq);
866 /*
867 * Resist a temptation to do
868 * if (!is_page_busy(page)) pool_free_page(pool, page);
869 diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c
870 index 5acd6e8..20b0e9e 100644
871 --- a/tools/perf/builtin-test.c
872 +++ b/tools/perf/builtin-test.c
873 @@ -604,19 +604,13 @@ out_free_threads:
874 #undef nsyscalls
875 }
876
877 -static int sched__get_first_possible_cpu(pid_t pid, cpu_set_t **maskp,
878 - size_t *sizep)
879 +static int sched__get_first_possible_cpu(pid_t pid, cpu_set_t *maskp)
880 {
881 - cpu_set_t *mask;
882 - size_t size;
883 int i, cpu = -1, nrcpus = 1024;
884 realloc:
885 - mask = CPU_ALLOC(nrcpus);
886 - size = CPU_ALLOC_SIZE(nrcpus);
887 - CPU_ZERO_S(size, mask);
888 + CPU_ZERO(maskp);
889
890 - if (sched_getaffinity(pid, size, mask) == -1) {
891 - CPU_FREE(mask);
892 + if (sched_getaffinity(pid, sizeof(*maskp), maskp) == -1) {
893 if (errno == EINVAL && nrcpus < (1024 << 8)) {
894 nrcpus = nrcpus << 2;
895 goto realloc;
896 @@ -626,19 +620,14 @@ realloc:
897 }
898
899 for (i = 0; i < nrcpus; i++) {
900 - if (CPU_ISSET_S(i, size, mask)) {
901 - if (cpu == -1) {
902 + if (CPU_ISSET(i, maskp)) {
903 + if (cpu == -1)
904 cpu = i;
905 - *maskp = mask;
906 - *sizep = size;
907 - } else
908 - CPU_CLR_S(i, size, mask);
909 + else
910 + CPU_CLR(i, maskp);
911 }
912 }
913
914 - if (cpu == -1)
915 - CPU_FREE(mask);
916 -
917 return cpu;
918 }
919
920 @@ -653,8 +642,8 @@ static int test__PERF_RECORD(void)
921 .freq = 10,
922 .mmap_pages = 256,
923 };
924 - cpu_set_t *cpu_mask = NULL;
925 - size_t cpu_mask_size = 0;
926 + cpu_set_t cpu_mask;
927 + size_t cpu_mask_size = sizeof(cpu_mask);
928 struct perf_evlist *evlist = perf_evlist__new(NULL, NULL);
929 struct perf_evsel *evsel;
930 struct perf_sample sample;
931 @@ -718,8 +707,7 @@ static int test__PERF_RECORD(void)
932 evsel->attr.sample_type |= PERF_SAMPLE_TIME;
933 perf_evlist__config_attrs(evlist, &opts);
934
935 - err = sched__get_first_possible_cpu(evlist->workload.pid, &cpu_mask,
936 - &cpu_mask_size);
937 + err = sched__get_first_possible_cpu(evlist->workload.pid, &cpu_mask);
938 if (err < 0) {
939 pr_debug("sched__get_first_possible_cpu: %s\n", strerror(errno));
940 goto out_delete_evlist;
941 @@ -730,9 +718,9 @@ static int test__PERF_RECORD(void)
942 /*
943 * So that we can check perf_sample.cpu on all the samples.
944 */
945 - if (sched_setaffinity(evlist->workload.pid, cpu_mask_size, cpu_mask) < 0) {
946 + if (sched_setaffinity(evlist->workload.pid, cpu_mask_size, &cpu_mask) < 0) {
947 pr_debug("sched_setaffinity: %s\n", strerror(errno));
948 - goto out_free_cpu_mask;
949 + goto out_delete_evlist;
950 }
951
952 /*
953 @@ -916,8 +904,6 @@ found_exit:
954 }
955 out_err:
956 perf_evlist__munmap(evlist);
957 -out_free_cpu_mask:
958 - CPU_FREE(cpu_mask);
959 out_delete_evlist:
960 perf_evlist__delete(evlist);
961 out:

  ViewVC Help
Powered by ViewVC 1.1.20