1 |
Author: psomas |
2 |
Date: 2011-08-29 22:26:54 +0000 (Mon, 29 Aug 2011) |
3 |
New Revision: 1969 |
4 |
|
5 |
Added: |
6 |
genpatches-2.6/trunk/2.6.32/1045_linux-2.6.32.46.patch |
7 |
Modified: |
8 |
genpatches-2.6/trunk/2.6.32/0000_README |
9 |
Log: |
10 |
Linux patch 2.6.32.46 |
11 |
|
12 |
Modified: genpatches-2.6/trunk/2.6.32/0000_README |
13 |
=================================================================== |
14 |
--- genpatches-2.6/trunk/2.6.32/0000_README 2011-08-29 15:03:18 UTC (rev 1968) |
15 |
+++ genpatches-2.6/trunk/2.6.32/0000_README 2011-08-29 22:26:54 UTC (rev 1969) |
16 |
@@ -219,6 +219,10 @@ |
17 |
From: http://www.kernel.org |
18 |
Desc: Linux 2.6.32.45 |
19 |
|
20 |
+Patch: 1045_2.6.32.46.patch |
21 |
+From: http://www.kernel.org |
22 |
+Desc: Linux 2.6.32.46 |
23 |
+ |
24 |
Patch: 2900_disable-wunused-but-set-var-gcc-4-6-0.patch |
25 |
From: https://bugs.gentoo.org/show_bug.cgi?id=366579 |
26 |
Desc: Disable -Wunused-but-set-variable for gcc 4.6.0. Thanks to Stratos Psomadakis |
27 |
|
28 |
Added: genpatches-2.6/trunk/2.6.32/1045_linux-2.6.32.46.patch |
29 |
=================================================================== |
30 |
--- genpatches-2.6/trunk/2.6.32/1045_linux-2.6.32.46.patch (rev 0) |
31 |
+++ genpatches-2.6/trunk/2.6.32/1045_linux-2.6.32.46.patch 2011-08-29 22:26:54 UTC (rev 1969) |
32 |
@@ -0,0 +1,555 @@ |
33 |
+diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c |
34 |
+index c7ee9c9..95b0712 100644 |
35 |
+--- a/arch/x86/kernel/apic/x2apic_uv_x.c |
36 |
++++ b/arch/x86/kernel/apic/x2apic_uv_x.c |
37 |
+@@ -117,7 +117,6 @@ static int __cpuinit uv_wakeup_secondary(int phys_apicid, unsigned long start_ri |
38 |
+ ((start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) | |
39 |
+ APIC_DM_INIT; |
40 |
+ uv_write_global_mmr64(pnode, UVH_IPI_INT, val); |
41 |
+- mdelay(10); |
42 |
+ |
43 |
+ val = (1UL << UVH_IPI_INT_SEND_SHFT) | |
44 |
+ (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) | |
45 |
+diff --git a/arch/x86/vdso/vdso32/sysenter.S b/arch/x86/vdso/vdso32/sysenter.S |
46 |
+index e2800af..e354bce 100644 |
47 |
+--- a/arch/x86/vdso/vdso32/sysenter.S |
48 |
++++ b/arch/x86/vdso/vdso32/sysenter.S |
49 |
+@@ -43,7 +43,7 @@ __kernel_vsyscall: |
50 |
+ .space 7,0x90 |
51 |
+ |
52 |
+ /* 14: System call restart point is here! (SYSENTER_RETURN-2) */ |
53 |
+- jmp .Lenter_kernel |
54 |
++ int $0x80 |
55 |
+ /* 16: System call normal return point is here! */ |
56 |
+ VDSO32_SYSENTER_RETURN: /* Symbol used by sysenter.c via vdso32-syms.h */ |
57 |
+ pop %ebp |
58 |
+diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c |
59 |
+index 87c0625..0ed436e 100644 |
60 |
+--- a/drivers/gpu/drm/ttm/ttm_bo.c |
61 |
++++ b/drivers/gpu/drm/ttm/ttm_bo.c |
62 |
+@@ -281,8 +281,10 @@ static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc) |
63 |
+ |
64 |
+ ret = ttm_tt_set_user(bo->ttm, current, |
65 |
+ bo->buffer_start, bo->num_pages); |
66 |
+- if (unlikely(ret != 0)) |
67 |
++ if (unlikely(ret != 0)) { |
68 |
+ ttm_tt_destroy(bo->ttm); |
69 |
++ bo->ttm = NULL; |
70 |
++ } |
71 |
+ break; |
72 |
+ default: |
73 |
+ printk(KERN_ERR TTM_PFX "Illegal buffer object type\n"); |
74 |
+diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c |
75 |
+index 405d3fb..a818105 100644 |
76 |
+--- a/drivers/hwmon/ibmaem.c |
77 |
++++ b/drivers/hwmon/ibmaem.c |
78 |
+@@ -429,13 +429,15 @@ static int aem_read_sensor(struct aem_data *data, u8 elt, u8 reg, |
79 |
+ aem_send_message(ipmi); |
80 |
+ |
81 |
+ res = wait_for_completion_timeout(&ipmi->read_complete, IPMI_TIMEOUT); |
82 |
+- if (!res) |
83 |
+- return -ETIMEDOUT; |
84 |
++ if (!res) { |
85 |
++ res = -ETIMEDOUT; |
86 |
++ goto out; |
87 |
++ } |
88 |
+ |
89 |
+ if (ipmi->rx_result || ipmi->rx_msg_len != rs_size || |
90 |
+ memcmp(&rs_resp->id, &system_x_id, sizeof(system_x_id))) { |
91 |
+- kfree(rs_resp); |
92 |
+- return -ENOENT; |
93 |
++ res = -ENOENT; |
94 |
++ goto out; |
95 |
+ } |
96 |
+ |
97 |
+ switch (size) { |
98 |
+@@ -460,8 +462,11 @@ static int aem_read_sensor(struct aem_data *data, u8 elt, u8 reg, |
99 |
+ break; |
100 |
+ } |
101 |
+ } |
102 |
++ res = 0; |
103 |
+ |
104 |
+- return 0; |
105 |
++out: |
106 |
++ kfree(rs_resp); |
107 |
++ return res; |
108 |
+ } |
109 |
+ |
110 |
+ /* Update AEM energy registers */ |
111 |
+diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c |
112 |
+index 33352ff..d617f2d 100644 |
113 |
+--- a/drivers/net/igb/e1000_82575.c |
114 |
++++ b/drivers/net/igb/e1000_82575.c |
115 |
+@@ -941,6 +941,7 @@ static s32 igb_setup_copper_link_82575(struct e1000_hw *hw) |
116 |
+ ctrl |= E1000_CTRL_SLU; |
117 |
+ ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); |
118 |
+ wr32(E1000_CTRL, ctrl); |
119 |
++ wrfl(); |
120 |
+ |
121 |
+ ret_val = igb_setup_serdes_link_82575(hw); |
122 |
+ if (ret_val) |
123 |
+diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c |
124 |
+index d9461c9..ae1ffbc 100644 |
125 |
+--- a/drivers/usb/class/usbtmc.c |
126 |
++++ b/drivers/usb/class/usbtmc.c |
127 |
+@@ -267,7 +267,7 @@ usbtmc_abort_bulk_in_status: |
128 |
+ dev_err(dev, "usb_bulk_msg returned %d\n", rv); |
129 |
+ goto exit; |
130 |
+ } |
131 |
+- } while ((actual = max_size) && |
132 |
++ } while ((actual == max_size) && |
133 |
+ (n < USBTMC_MAX_READS_TO_CLEAR_BULK_IN)); |
134 |
+ |
135 |
+ if (actual == max_size) { |
136 |
+diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c |
137 |
+index bcf7a88..eae8b18 100644 |
138 |
+--- a/drivers/usb/host/pci-quirks.c |
139 |
++++ b/drivers/usb/host/pci-quirks.c |
140 |
+@@ -444,7 +444,7 @@ static void __devinit quirk_usb_handoff_xhci(struct pci_dev *pdev) |
141 |
+ |
142 |
+ /* If the BIOS owns the HC, signal that the OS wants it, and wait */ |
143 |
+ if (val & XHCI_HC_BIOS_OWNED) { |
144 |
+- writel(val & XHCI_HC_OS_OWNED, base + ext_cap_offset); |
145 |
++ writel(val | XHCI_HC_OS_OWNED, base + ext_cap_offset); |
146 |
+ |
147 |
+ /* Wait for 5 seconds with 10 microsecond polling interval */ |
148 |
+ timeout = handshake(base + ext_cap_offset, XHCI_HC_BIOS_OWNED, |
149 |
+diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c |
150 |
+index 8ab4ab2..d469673 100644 |
151 |
+--- a/drivers/usb/serial/qcserial.c |
152 |
++++ b/drivers/usb/serial/qcserial.c |
153 |
+@@ -43,6 +43,7 @@ static struct usb_device_id id_table[] = { |
154 |
+ {USB_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */ |
155 |
+ {USB_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */ |
156 |
+ {USB_DEVICE(0x05c6, 0x9008)}, /* Generic Gobi QDL device */ |
157 |
++ {USB_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */ |
158 |
+ {USB_DEVICE(0x05c6, 0x9201)}, /* Generic Gobi QDL device */ |
159 |
+ {USB_DEVICE(0x05c6, 0x9221)}, /* Generic Gobi QDL device */ |
160 |
+ {USB_DEVICE(0x05c6, 0x9231)}, /* Generic Gobi QDL device */ |
161 |
+diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h |
162 |
+index 6ca33f2..4453f12 100644 |
163 |
+--- a/drivers/usb/storage/unusual_devs.h |
164 |
++++ b/drivers/usb/storage/unusual_devs.h |
165 |
+@@ -1977,6 +1977,16 @@ UNUSUAL_DEV( 0x4146, 0xba01, 0x0100, 0x0100, |
166 |
+ "Micro Mini 1GB", |
167 |
+ US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_NOT_LOCKABLE ), |
168 |
+ |
169 |
++/* |
170 |
++ * Nick Bowler <nbowler@××××××××××××.com> |
171 |
++ * SCSI stack spams (otherwise harmless) error messages. |
172 |
++ */ |
173 |
++UNUSUAL_DEV( 0xc251, 0x4003, 0x0100, 0x0100, |
174 |
++ "Keil Software, Inc.", |
175 |
++ "V2M MotherBoard", |
176 |
++ US_SC_DEVICE, US_PR_DEVICE, NULL, |
177 |
++ US_FL_NOT_LOCKABLE), |
178 |
++ |
179 |
+ /* Reported by Andrew Simmons <andrew.simmons@×××××.com> */ |
180 |
+ UNUSUAL_DEV( 0xed06, 0x4500, 0x0001, 0x0001, |
181 |
+ "DataStor", |
182 |
+diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c |
183 |
+index 34ddda8..9158c07 100644 |
184 |
+--- a/fs/befs/linuxvfs.c |
185 |
++++ b/fs/befs/linuxvfs.c |
186 |
+@@ -469,17 +469,22 @@ befs_follow_link(struct dentry *dentry, struct nameidata *nd) |
187 |
+ befs_data_stream *data = &befs_ino->i_data.ds; |
188 |
+ befs_off_t len = data->size; |
189 |
+ |
190 |
+- befs_debug(sb, "Follow long symlink"); |
191 |
+- |
192 |
+- link = kmalloc(len, GFP_NOFS); |
193 |
+- if (!link) { |
194 |
+- link = ERR_PTR(-ENOMEM); |
195 |
+- } else if (befs_read_lsymlink(sb, data, link, len) != len) { |
196 |
+- kfree(link); |
197 |
+- befs_error(sb, "Failed to read entire long symlink"); |
198 |
++ if (len == 0) { |
199 |
++ befs_error(sb, "Long symlink with illegal length"); |
200 |
+ link = ERR_PTR(-EIO); |
201 |
+ } else { |
202 |
+- link[len - 1] = '\0'; |
203 |
++ befs_debug(sb, "Follow long symlink"); |
204 |
++ |
205 |
++ link = kmalloc(len, GFP_NOFS); |
206 |
++ if (!link) { |
207 |
++ link = ERR_PTR(-ENOMEM); |
208 |
++ } else if (befs_read_lsymlink(sb, data, link, len) != len) { |
209 |
++ kfree(link); |
210 |
++ befs_error(sb, "Failed to read entire long symlink"); |
211 |
++ link = ERR_PTR(-EIO); |
212 |
++ } else { |
213 |
++ link[len - 1] = '\0'; |
214 |
++ } |
215 |
+ } |
216 |
+ } else { |
217 |
+ link = befs_ino->i_data.symlink; |
218 |
+diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c |
219 |
+index 650546f..1facb39 100644 |
220 |
+--- a/fs/fuse/dev.c |
221 |
++++ b/fs/fuse/dev.c |
222 |
+@@ -899,6 +899,10 @@ static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size, |
223 |
+ if (outarg.namelen > FUSE_NAME_MAX) |
224 |
+ goto err; |
225 |
+ |
226 |
++ err = -EINVAL; |
227 |
++ if (size != sizeof(outarg) + outarg.namelen + 1) |
228 |
++ goto err; |
229 |
++ |
230 |
+ name.name = buf; |
231 |
+ name.len = outarg.namelen; |
232 |
+ err = fuse_copy_one(cs, buf, outarg.namelen + 1); |
233 |
+diff --git a/fs/partitions/efi.c b/fs/partitions/efi.c |
234 |
+index 2aac776..6ab70f4 100644 |
235 |
+--- a/fs/partitions/efi.c |
236 |
++++ b/fs/partitions/efi.c |
237 |
+@@ -311,6 +311,15 @@ is_gpt_valid(struct block_device *bdev, u64 lba, |
238 |
+ goto fail; |
239 |
+ } |
240 |
+ |
241 |
++ /* Check the GUID Partition Table header size */ |
242 |
++ if (le32_to_cpu((*gpt)->header_size) > |
243 |
++ bdev_logical_block_size(bdev)) { |
244 |
++ pr_debug("GUID Partition Table Header size is wrong: %u > %u\n", |
245 |
++ le32_to_cpu((*gpt)->header_size), |
246 |
++ bdev_logical_block_size(bdev)); |
247 |
++ goto fail; |
248 |
++ } |
249 |
++ |
250 |
+ /* Check the GUID Partition Table CRC */ |
251 |
+ origcrc = le32_to_cpu((*gpt)->header_crc32); |
252 |
+ (*gpt)->header_crc32 = 0; |
253 |
+diff --git a/kernel/futex.c b/kernel/futex.c |
254 |
+index 09dbee2..fb98c9f 100644 |
255 |
+--- a/kernel/futex.c |
256 |
++++ b/kernel/futex.c |
257 |
+@@ -203,6 +203,8 @@ static void drop_futex_key_refs(union futex_key *key) |
258 |
+ * @uaddr: virtual address of the futex |
259 |
+ * @fshared: 0 for a PROCESS_PRIVATE futex, 1 for PROCESS_SHARED |
260 |
+ * @key: address where result is stored. |
261 |
++ * @rw: mapping needs to be read/write (values: VERIFY_READ, |
262 |
++ * VERIFY_WRITE) |
263 |
+ * |
264 |
+ * Returns a negative error code or 0 |
265 |
+ * The key words are stored in *key on success. |
266 |
+@@ -214,12 +216,12 @@ static void drop_futex_key_refs(union futex_key *key) |
267 |
+ * lock_page() might sleep, the caller should not hold a spinlock. |
268 |
+ */ |
269 |
+ static int |
270 |
+-get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key) |
271 |
++get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw) |
272 |
+ { |
273 |
+ unsigned long address = (unsigned long)uaddr; |
274 |
+ struct mm_struct *mm = current->mm; |
275 |
+ struct page *page; |
276 |
+- int err; |
277 |
++ int err, ro = 0; |
278 |
+ |
279 |
+ /* |
280 |
+ * The futex address must be "naturally" aligned. |
281 |
+@@ -247,14 +249,31 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key) |
282 |
+ |
283 |
+ again: |
284 |
+ err = get_user_pages_fast(address, 1, 1, &page); |
285 |
++ /* |
286 |
++ * If write access is not required (eg. FUTEX_WAIT), try |
287 |
++ * and get read-only access. |
288 |
++ */ |
289 |
++ if (err == -EFAULT && rw == VERIFY_READ) { |
290 |
++ err = get_user_pages_fast(address, 1, 0, &page); |
291 |
++ ro = 1; |
292 |
++ } |
293 |
+ if (err < 0) |
294 |
+ return err; |
295 |
++ else |
296 |
++ err = 0; |
297 |
+ |
298 |
+ page = compound_head(page); |
299 |
+ lock_page(page); |
300 |
+ if (!page->mapping) { |
301 |
+ unlock_page(page); |
302 |
+ put_page(page); |
303 |
++ /* |
304 |
++ * ZERO_PAGE pages don't have a mapping. Avoid a busy loop |
305 |
++ * trying to find one. RW mapping would have COW'd (and thus |
306 |
++ * have a mapping) so this page is RO and won't ever change. |
307 |
++ */ |
308 |
++ if ((page == ZERO_PAGE(address))) |
309 |
++ return -EFAULT; |
310 |
+ goto again; |
311 |
+ } |
312 |
+ |
313 |
+@@ -266,6 +285,15 @@ again: |
314 |
+ * the object not the particular process. |
315 |
+ */ |
316 |
+ if (PageAnon(page)) { |
317 |
++ /* |
318 |
++ * A RO anonymous page will never change and thus doesn't make |
319 |
++ * sense for futex operations. |
320 |
++ */ |
321 |
++ if (ro) { |
322 |
++ err = -EFAULT; |
323 |
++ goto out; |
324 |
++ } |
325 |
++ |
326 |
+ key->both.offset |= FUT_OFF_MMSHARED; /* ref taken on mm */ |
327 |
+ key->private.mm = mm; |
328 |
+ key->private.address = address; |
329 |
+@@ -277,9 +305,10 @@ again: |
330 |
+ |
331 |
+ get_futex_key_refs(key); |
332 |
+ |
333 |
++out: |
334 |
+ unlock_page(page); |
335 |
+ put_page(page); |
336 |
+- return 0; |
337 |
++ return err; |
338 |
+ } |
339 |
+ |
340 |
+ static inline |
341 |
+@@ -880,7 +909,7 @@ static int futex_wake(u32 __user *uaddr, int fshared, int nr_wake, u32 bitset) |
342 |
+ if (!bitset) |
343 |
+ return -EINVAL; |
344 |
+ |
345 |
+- ret = get_futex_key(uaddr, fshared, &key); |
346 |
++ ret = get_futex_key(uaddr, fshared, &key, VERIFY_READ); |
347 |
+ if (unlikely(ret != 0)) |
348 |
+ goto out; |
349 |
+ |
350 |
+@@ -926,10 +955,10 @@ futex_wake_op(u32 __user *uaddr1, int fshared, u32 __user *uaddr2, |
351 |
+ int ret, op_ret; |
352 |
+ |
353 |
+ retry: |
354 |
+- ret = get_futex_key(uaddr1, fshared, &key1); |
355 |
++ ret = get_futex_key(uaddr1, fshared, &key1, VERIFY_READ); |
356 |
+ if (unlikely(ret != 0)) |
357 |
+ goto out; |
358 |
+- ret = get_futex_key(uaddr2, fshared, &key2); |
359 |
++ ret = get_futex_key(uaddr2, fshared, &key2, VERIFY_WRITE); |
360 |
+ if (unlikely(ret != 0)) |
361 |
+ goto out_put_key1; |
362 |
+ |
363 |
+@@ -1188,10 +1217,11 @@ retry: |
364 |
+ pi_state = NULL; |
365 |
+ } |
366 |
+ |
367 |
+- ret = get_futex_key(uaddr1, fshared, &key1); |
368 |
++ ret = get_futex_key(uaddr1, fshared, &key1, VERIFY_READ); |
369 |
+ if (unlikely(ret != 0)) |
370 |
+ goto out; |
371 |
+- ret = get_futex_key(uaddr2, fshared, &key2); |
372 |
++ ret = get_futex_key(uaddr2, fshared, &key2, |
373 |
++ requeue_pi ? VERIFY_WRITE : VERIFY_READ); |
374 |
+ if (unlikely(ret != 0)) |
375 |
+ goto out_put_key1; |
376 |
+ |
377 |
+@@ -1746,7 +1776,7 @@ static int futex_wait_setup(u32 __user *uaddr, u32 val, int fshared, |
378 |
+ */ |
379 |
+ retry: |
380 |
+ q->key = FUTEX_KEY_INIT; |
381 |
+- ret = get_futex_key(uaddr, fshared, &q->key); |
382 |
++ ret = get_futex_key(uaddr, fshared, &q->key, VERIFY_READ); |
383 |
+ if (unlikely(ret != 0)) |
384 |
+ return ret; |
385 |
+ |
386 |
+@@ -1912,7 +1942,7 @@ static int futex_lock_pi(u32 __user *uaddr, int fshared, |
387 |
+ q.requeue_pi_key = NULL; |
388 |
+ retry: |
389 |
+ q.key = FUTEX_KEY_INIT; |
390 |
+- ret = get_futex_key(uaddr, fshared, &q.key); |
391 |
++ ret = get_futex_key(uaddr, fshared, &q.key, VERIFY_WRITE); |
392 |
+ if (unlikely(ret != 0)) |
393 |
+ goto out; |
394 |
+ |
395 |
+@@ -2031,7 +2061,7 @@ retry: |
396 |
+ if ((uval & FUTEX_TID_MASK) != task_pid_vnr(current)) |
397 |
+ return -EPERM; |
398 |
+ |
399 |
+- ret = get_futex_key(uaddr, fshared, &key); |
400 |
++ ret = get_futex_key(uaddr, fshared, &key, VERIFY_WRITE); |
401 |
+ if (unlikely(ret != 0)) |
402 |
+ goto out; |
403 |
+ |
404 |
+@@ -2223,7 +2253,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, int fshared, |
405 |
+ rt_waiter.task = NULL; |
406 |
+ |
407 |
+ key2 = FUTEX_KEY_INIT; |
408 |
+- ret = get_futex_key(uaddr2, fshared, &key2); |
409 |
++ ret = get_futex_key(uaddr2, fshared, &key2, VERIFY_WRITE); |
410 |
+ if (unlikely(ret != 0)) |
411 |
+ goto out; |
412 |
+ |
413 |
+diff --git a/mm/vmalloc.c b/mm/vmalloc.c |
414 |
+index 680dcbb..7221e9e 100644 |
415 |
+--- a/mm/vmalloc.c |
416 |
++++ b/mm/vmalloc.c |
417 |
+@@ -671,9 +671,10 @@ static void free_unmap_vmap_area_addr(unsigned long addr) |
418 |
+ #define VMAP_BBMAP_BITS_MIN (VMAP_MAX_ALLOC*2) |
419 |
+ #define VMAP_MIN(x, y) ((x) < (y) ? (x) : (y)) /* can't use min() */ |
420 |
+ #define VMAP_MAX(x, y) ((x) > (y) ? (x) : (y)) /* can't use max() */ |
421 |
+-#define VMAP_BBMAP_BITS VMAP_MIN(VMAP_BBMAP_BITS_MAX, \ |
422 |
+- VMAP_MAX(VMAP_BBMAP_BITS_MIN, \ |
423 |
+- VMALLOC_PAGES / NR_CPUS / 16)) |
424 |
++#define VMAP_BBMAP_BITS \ |
425 |
++ VMAP_MIN(VMAP_BBMAP_BITS_MAX, \ |
426 |
++ VMAP_MAX(VMAP_BBMAP_BITS_MIN, \ |
427 |
++ VMALLOC_PAGES / roundup_pow_of_two(NR_CPUS) / 16)) |
428 |
+ |
429 |
+ #define VMAP_BLOCK_SIZE (VMAP_BBMAP_BITS * PAGE_SIZE) |
430 |
+ |
431 |
+diff --git a/net/atm/br2684.c b/net/atm/br2684.c |
432 |
+index c9230c3..be1c1d2 100644 |
433 |
+--- a/net/atm/br2684.c |
434 |
++++ b/net/atm/br2684.c |
435 |
+@@ -208,8 +208,6 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct net_device *dev, |
436 |
+ if (brdev->payload == p_bridged) { |
437 |
+ skb_push(skb, 2); |
438 |
+ memset(skb->data, 0, 2); |
439 |
+- } else { /* p_routed */ |
440 |
+- skb_pull(skb, ETH_HLEN); |
441 |
+ } |
442 |
+ } |
443 |
+ skb_debug(skb); |
444 |
+diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c |
445 |
+index e7efcef..eeb2e23 100644 |
446 |
+--- a/sound/pci/ac97/ac97_patch.c |
447 |
++++ b/sound/pci/ac97/ac97_patch.c |
448 |
+@@ -1915,6 +1915,7 @@ static unsigned int ad1981_jacks_whitelist[] = { |
449 |
+ 0x103c0944, /* HP nc6220 */ |
450 |
+ 0x103c0934, /* HP nc8220 */ |
451 |
+ 0x103c006d, /* HP nx9105 */ |
452 |
++ 0x103c300d, /* HP Compaq dc5100 SFF(PT003AW) */ |
453 |
+ 0x17340088, /* FSC Scenic-W */ |
454 |
+ 0 /* end */ |
455 |
+ }; |
456 |
+diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c |
457 |
+index 007b4bf..e89017a 100644 |
458 |
+--- a/sound/usb/caiaq/audio.c |
459 |
++++ b/sound/usb/caiaq/audio.c |
460 |
+@@ -138,8 +138,12 @@ static void stream_stop(struct snd_usb_caiaqdev *dev) |
461 |
+ |
462 |
+ for (i = 0; i < N_URBS; i++) { |
463 |
+ usb_kill_urb(dev->data_urbs_in[i]); |
464 |
+- usb_kill_urb(dev->data_urbs_out[i]); |
465 |
++ |
466 |
++ if (test_bit(i, &dev->outurb_active_mask)) |
467 |
++ usb_kill_urb(dev->data_urbs_out[i]); |
468 |
+ } |
469 |
++ |
470 |
++ dev->outurb_active_mask = 0; |
471 |
+ } |
472 |
+ |
473 |
+ static int snd_usb_caiaq_substream_open(struct snd_pcm_substream *substream) |
474 |
+@@ -466,8 +470,9 @@ static void read_completed(struct urb *urb) |
475 |
+ { |
476 |
+ struct snd_usb_caiaq_cb_info *info = urb->context; |
477 |
+ struct snd_usb_caiaqdev *dev; |
478 |
+- struct urb *out; |
479 |
+- int frame, len, send_it = 0, outframe = 0; |
480 |
++ struct urb *out = NULL; |
481 |
++ int i, frame, len, send_it = 0, outframe = 0; |
482 |
++ size_t offset = 0; |
483 |
+ |
484 |
+ if (urb->status || !info) |
485 |
+ return; |
486 |
+@@ -477,7 +482,17 @@ static void read_completed(struct urb *urb) |
487 |
+ if (!dev->streaming) |
488 |
+ return; |
489 |
+ |
490 |
+- out = dev->data_urbs_out[info->index]; |
491 |
++ /* find an unused output urb that is unused */ |
492 |
++ for (i = 0; i < N_URBS; i++) |
493 |
++ if (test_and_set_bit(i, &dev->outurb_active_mask) == 0) { |
494 |
++ out = dev->data_urbs_out[i]; |
495 |
++ break; |
496 |
++ } |
497 |
++ |
498 |
++ if (!out) { |
499 |
++ log("Unable to find an output urb to use\n"); |
500 |
++ goto requeue; |
501 |
++ } |
502 |
+ |
503 |
+ /* read the recently received packet and send back one which has |
504 |
+ * the same layout */ |
505 |
+@@ -488,7 +503,8 @@ static void read_completed(struct urb *urb) |
506 |
+ len = urb->iso_frame_desc[outframe].actual_length; |
507 |
+ out->iso_frame_desc[outframe].length = len; |
508 |
+ out->iso_frame_desc[outframe].actual_length = 0; |
509 |
+- out->iso_frame_desc[outframe].offset = BYTES_PER_FRAME * frame; |
510 |
++ out->iso_frame_desc[outframe].offset = offset; |
511 |
++ offset += len; |
512 |
+ |
513 |
+ if (len > 0) { |
514 |
+ spin_lock(&dev->spinlock); |
515 |
+@@ -504,11 +520,15 @@ static void read_completed(struct urb *urb) |
516 |
+ } |
517 |
+ |
518 |
+ if (send_it) { |
519 |
+- out->number_of_packets = FRAMES_PER_URB; |
520 |
++ out->number_of_packets = outframe; |
521 |
+ out->transfer_flags = URB_ISO_ASAP; |
522 |
+ usb_submit_urb(out, GFP_ATOMIC); |
523 |
++ } else { |
524 |
++ struct snd_usb_caiaq_cb_info *oinfo = out->context; |
525 |
++ clear_bit(oinfo->index, &dev->outurb_active_mask); |
526 |
+ } |
527 |
+ |
528 |
++requeue: |
529 |
+ /* re-submit inbound urb */ |
530 |
+ for (frame = 0; frame < FRAMES_PER_URB; frame++) { |
531 |
+ urb->iso_frame_desc[frame].offset = BYTES_PER_FRAME * frame; |
532 |
+@@ -530,6 +550,8 @@ static void write_completed(struct urb *urb) |
533 |
+ dev->output_running = 1; |
534 |
+ wake_up(&dev->prepare_wait_queue); |
535 |
+ } |
536 |
++ |
537 |
++ clear_bit(info->index, &dev->outurb_active_mask); |
538 |
+ } |
539 |
+ |
540 |
+ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *dev, int dir, int *ret) |
541 |
+@@ -680,6 +702,9 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev) |
542 |
+ if (!dev->data_cb_info) |
543 |
+ return -ENOMEM; |
544 |
+ |
545 |
++ dev->outurb_active_mask = 0; |
546 |
++ BUILD_BUG_ON(N_URBS > (sizeof(dev->outurb_active_mask) * 8)); |
547 |
++ |
548 |
+ for (i = 0; i < N_URBS; i++) { |
549 |
+ dev->data_cb_info[i].dev = dev; |
550 |
+ dev->data_cb_info[i].index = i; |
551 |
+diff --git a/sound/usb/caiaq/device.h b/sound/usb/caiaq/device.h |
552 |
+index 44e3edf..94c0c36 100644 |
553 |
+--- a/sound/usb/caiaq/device.h |
554 |
++++ b/sound/usb/caiaq/device.h |
555 |
+@@ -92,6 +92,7 @@ struct snd_usb_caiaqdev { |
556 |
+ int input_panic, output_panic, warned; |
557 |
+ char *audio_in_buf, *audio_out_buf; |
558 |
+ unsigned int samplerates, bpp; |
559 |
++ unsigned long outurb_active_mask; |
560 |
+ |
561 |
+ struct snd_pcm_substream *sub_playback[MAX_STREAMS]; |
562 |
+ struct snd_pcm_substream *sub_capture[MAX_STREAMS]; |
563 |
+diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c |
564 |
+index 8784649..1720d01 100644 |
565 |
+--- a/tools/perf/util/config.c |
566 |
++++ b/tools/perf/util/config.c |
567 |
+@@ -416,7 +416,6 @@ int perf_config_global(void) |
568 |
+ int perf_config(config_fn_t fn, void *data) |
569 |
+ { |
570 |
+ int ret = 0, found = 0; |
571 |
+- char *repo_config = NULL; |
572 |
+ const char *home = NULL; |
573 |
+ |
574 |
+ /* Setting $PERF_CONFIG makes perf read _only_ the given config file. */ |
575 |
+@@ -438,12 +437,6 @@ int perf_config(config_fn_t fn, void *data) |
576 |
+ free(user_config); |
577 |
+ } |
578 |
+ |
579 |
+- repo_config = perf_pathdup("config"); |
580 |
+- if (!access(repo_config, R_OK)) { |
581 |
+- ret += perf_config_from_file(fn, repo_config, data); |
582 |
+- found += 1; |
583 |
+- } |
584 |
+- free(repo_config); |
585 |
+ if (found == 0) |
586 |
+ return -1; |
587 |
+ return ret; |