Magellan Linux

Contents of /trunk/kernel26-alx/patches-3.10/0134-3.10.35-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2672 - (show annotations) (download)
Tue Jul 21 16:46:35 2015 UTC (8 years, 9 months ago) by niro
File size: 33566 byte(s)
-3.10.84-alx-r1
1 diff --git a/Makefile b/Makefile
2 index 571a1bf14868..06b31fce1ff5 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 3
7 PATCHLEVEL = 10
8 -SUBLEVEL = 34
9 +SUBLEVEL = 35
10 EXTRAVERSION =
11 NAME = TOSSUG Baby Fish
12
13 diff --git a/arch/arm/include/asm/outercache.h b/arch/arm/include/asm/outercache.h
14 index 12f71a190422..f94784f0e3a6 100644
15 --- a/arch/arm/include/asm/outercache.h
16 +++ b/arch/arm/include/asm/outercache.h
17 @@ -37,10 +37,10 @@ struct outer_cache_fns {
18 void (*resume)(void);
19 };
20
21 -#ifdef CONFIG_OUTER_CACHE
22 -
23 extern struct outer_cache_fns outer_cache;
24
25 +#ifdef CONFIG_OUTER_CACHE
26 +
27 static inline void outer_inv_range(phys_addr_t start, phys_addr_t end)
28 {
29 if (outer_cache.inv_range)
30 diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
31 index 5ed19e88874b..35d1029d7c9d 100644
32 --- a/arch/arm/mach-highbank/highbank.c
33 +++ b/arch/arm/mach-highbank/highbank.c
34 @@ -65,14 +65,12 @@ void highbank_set_cpu_jump(int cpu, void *jump_addr)
35 HB_JUMP_TABLE_PHYS(cpu) + 15);
36 }
37
38 -#ifdef CONFIG_CACHE_L2X0
39 static void highbank_l2x0_disable(void)
40 {
41 outer_flush_all();
42 /* Disable PL310 L2 Cache controller */
43 highbank_smc1(0x102, 0x0);
44 }
45 -#endif
46
47 static void __init highbank_init_irq(void)
48 {
49 @@ -81,12 +79,13 @@ static void __init highbank_init_irq(void)
50 if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9"))
51 highbank_scu_map_io();
52
53 -#ifdef CONFIG_CACHE_L2X0
54 /* Enable PL310 L2 Cache controller */
55 - highbank_smc1(0x102, 0x1);
56 - l2x0_of_init(0, ~0UL);
57 - outer_cache.disable = highbank_l2x0_disable;
58 -#endif
59 + if (IS_ENABLED(CONFIG_CACHE_L2X0) &&
60 + of_find_compatible_node(NULL, NULL, "arm,pl310-cache")) {
61 + highbank_smc1(0x102, 0x1);
62 + l2x0_of_init(0, ~0UL);
63 + outer_cache.disable = highbank_l2x0_disable;
64 + }
65 }
66
67 static void __init highbank_timer_init(void)
68 diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
69 index 004cc87b781c..711c649f80b7 100644
70 --- a/arch/x86/kvm/mmu.c
71 +++ b/arch/x86/kvm/mmu.c
72 @@ -2585,6 +2585,9 @@ static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write,
73 int emulate = 0;
74 gfn_t pseudo_gfn;
75
76 + if (!VALID_PAGE(vcpu->arch.mmu.root_hpa))
77 + return 0;
78 +
79 for_each_shadow_entry(vcpu, (u64)gfn << PAGE_SHIFT, iterator) {
80 if (iterator.level == level) {
81 mmu_set_spte(vcpu, iterator.sptep, ACC_ALL,
82 @@ -2748,6 +2751,9 @@ static bool fast_page_fault(struct kvm_vcpu *vcpu, gva_t gva, int level,
83 bool ret = false;
84 u64 spte = 0ull;
85
86 + if (!VALID_PAGE(vcpu->arch.mmu.root_hpa))
87 + return false;
88 +
89 if (!page_fault_can_be_fast(vcpu, error_code))
90 return false;
91
92 @@ -3139,6 +3145,9 @@ static u64 walk_shadow_page_get_mmio_spte(struct kvm_vcpu *vcpu, u64 addr)
93 struct kvm_shadow_walk_iterator iterator;
94 u64 spte = 0ull;
95
96 + if (!VALID_PAGE(vcpu->arch.mmu.root_hpa))
97 + return spte;
98 +
99 walk_shadow_page_lockless_begin(vcpu);
100 for_each_shadow_entry_lockless(vcpu, addr, iterator, spte)
101 if (!is_shadow_present_pte(spte))
102 @@ -4329,6 +4338,9 @@ int kvm_mmu_get_spte_hierarchy(struct kvm_vcpu *vcpu, u64 addr, u64 sptes[4])
103 u64 spte;
104 int nr_sptes = 0;
105
106 + if (!VALID_PAGE(vcpu->arch.mmu.root_hpa))
107 + return nr_sptes;
108 +
109 walk_shadow_page_lockless_begin(vcpu);
110 for_each_shadow_entry_lockless(vcpu, addr, iterator, spte) {
111 sptes[iterator.level-1] = spte;
112 diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
113 index da20860b457a..7e6090e13237 100644
114 --- a/arch/x86/kvm/paging_tmpl.h
115 +++ b/arch/x86/kvm/paging_tmpl.h
116 @@ -423,6 +423,9 @@ static int FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
117 if (FNAME(gpte_changed)(vcpu, gw, top_level))
118 goto out_gpte_changed;
119
120 + if (!VALID_PAGE(vcpu->arch.mmu.root_hpa))
121 + goto out_gpte_changed;
122 +
123 for (shadow_walk_init(&it, vcpu, addr);
124 shadow_walk_okay(&it) && it.level > gw->level;
125 shadow_walk_next(&it)) {
126 @@ -671,6 +674,11 @@ static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva)
127 */
128 mmu_topup_memory_caches(vcpu);
129
130 + if (!VALID_PAGE(vcpu->arch.mmu.root_hpa)) {
131 + WARN_ON(1);
132 + return;
133 + }
134 +
135 spin_lock(&vcpu->kvm->mmu_lock);
136 for_each_shadow_entry(vcpu, gva, iterator) {
137 level = iterator.level;
138 diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
139 index 5402c94ab768..7cdafb6dc705 100644
140 --- a/arch/x86/kvm/vmx.c
141 +++ b/arch/x86/kvm/vmx.c
142 @@ -7133,8 +7133,8 @@ static void vmx_free_vcpu(struct kvm_vcpu *vcpu)
143 struct vcpu_vmx *vmx = to_vmx(vcpu);
144
145 free_vpid(vmx);
146 - free_nested(vmx);
147 free_loaded_vmcs(vmx->loaded_vmcs);
148 + free_nested(vmx);
149 kfree(vmx->guest_msrs);
150 kvm_vcpu_uninit(vcpu);
151 kmem_cache_free(kvm_vcpu_cache, vmx);
152 diff --git a/arch/x86/net/bpf_jit.S b/arch/x86/net/bpf_jit.S
153 index 877b9a1b2152..01495755701b 100644
154 --- a/arch/x86/net/bpf_jit.S
155 +++ b/arch/x86/net/bpf_jit.S
156 @@ -140,7 +140,7 @@ bpf_slow_path_byte_msh:
157 push %r9; \
158 push SKBDATA; \
159 /* rsi already has offset */ \
160 - mov $SIZE,%ecx; /* size */ \
161 + mov $SIZE,%edx; /* size */ \
162 call bpf_internal_load_pointer_neg_helper; \
163 test %rax,%rax; \
164 pop SKBDATA; \
165 diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
166 index 1e8e42fb03a4..1fb1a7b5a754 100644
167 --- a/drivers/input/mouse/elantech.c
168 +++ b/drivers/input/mouse/elantech.c
169 @@ -486,6 +486,7 @@ static void elantech_input_sync_v4(struct psmouse *psmouse)
170 unsigned char *packet = psmouse->packet;
171
172 input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
173 + input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
174 input_mt_report_pointer_emulation(dev, true);
175 input_sync(dev);
176 }
177 @@ -954,6 +955,44 @@ static int elantech_get_resolution_v4(struct psmouse *psmouse,
178 }
179
180 /*
181 + * Advertise INPUT_PROP_BUTTONPAD for clickpads. The testing of bit 12 in
182 + * fw_version for this is based on the following fw_version & caps table:
183 + *
184 + * Laptop-model: fw_version: caps: buttons:
185 + * Acer S3 0x461f00 10, 13, 0e clickpad
186 + * Acer S7-392 0x581f01 50, 17, 0d clickpad
187 + * Acer V5-131 0x461f02 01, 16, 0c clickpad
188 + * Acer V5-551 0x461f00 ? clickpad
189 + * Asus K53SV 0x450f01 78, 15, 0c 2 hw buttons
190 + * Asus G46VW 0x460f02 00, 18, 0c 2 hw buttons
191 + * Asus G750JX 0x360f00 00, 16, 0c 2 hw buttons
192 + * Asus UX31 0x361f00 20, 15, 0e clickpad
193 + * Asus UX32VD 0x361f02 00, 15, 0e clickpad
194 + * Avatar AVIU-145A2 0x361f00 ? clickpad
195 + * Gigabyte U2442 0x450f01 58, 17, 0c 2 hw buttons
196 + * Lenovo L430 0x350f02 b9, 15, 0c 2 hw buttons (*)
197 + * Samsung NF210 0x150b00 78, 14, 0a 2 hw buttons
198 + * Samsung NP770Z5E 0x575f01 10, 15, 0f clickpad
199 + * Samsung NP700Z5B 0x361f06 21, 15, 0f clickpad
200 + * Samsung NP900X3E-A02 0x575f03 ? clickpad
201 + * Samsung NP-QX410 0x851b00 19, 14, 0c clickpad
202 + * Samsung RC512 0x450f00 08, 15, 0c 2 hw buttons
203 + * Samsung RF710 0x450f00 ? 2 hw buttons
204 + * System76 Pangolin 0x250f01 ? 2 hw buttons
205 + * (*) + 3 trackpoint buttons
206 + */
207 +static void elantech_set_buttonpad_prop(struct psmouse *psmouse)
208 +{
209 + struct input_dev *dev = psmouse->dev;
210 + struct elantech_data *etd = psmouse->private;
211 +
212 + if (etd->fw_version & 0x001000) {
213 + __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);
214 + __clear_bit(BTN_RIGHT, dev->keybit);
215 + }
216 +}
217 +
218 +/*
219 * Set the appropriate event bits for the input subsystem
220 */
221 static int elantech_set_input_params(struct psmouse *psmouse)
222 @@ -996,6 +1035,8 @@ static int elantech_set_input_params(struct psmouse *psmouse)
223 __set_bit(INPUT_PROP_SEMI_MT, dev->propbit);
224 /* fall through */
225 case 3:
226 + if (etd->hw_version == 3)
227 + elantech_set_buttonpad_prop(psmouse);
228 input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0);
229 input_set_abs_params(dev, ABS_Y, y_min, y_max, 0, 0);
230 if (etd->reports_pressure) {
231 @@ -1017,9 +1058,7 @@ static int elantech_set_input_params(struct psmouse *psmouse)
232 */
233 psmouse_warn(psmouse, "couldn't query resolution data.\n");
234 }
235 - /* v4 is clickpad, with only one button. */
236 - __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);
237 - __clear_bit(BTN_RIGHT, dev->keybit);
238 + elantech_set_buttonpad_prop(psmouse);
239 __set_bit(BTN_TOOL_QUADTAP, dev->keybit);
240 /* For X to recognize me as touchpad. */
241 input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0);
242 diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
243 index aaf23aeae2ea..3d838c0b495d 100644
244 --- a/drivers/input/tablet/wacom_sys.c
245 +++ b/drivers/input/tablet/wacom_sys.c
246 @@ -339,7 +339,7 @@ static int wacom_parse_hid(struct usb_interface *intf,
247 struct usb_device *dev = interface_to_usbdev(intf);
248 char limit = 0;
249 /* result has to be defined as int for some devices */
250 - int result = 0;
251 + int result = 0, touch_max = 0;
252 int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0;
253 unsigned char *report;
254
255 @@ -386,7 +386,8 @@ static int wacom_parse_hid(struct usb_interface *intf,
256 if (usage == WCM_DESKTOP) {
257 if (finger) {
258 features->device_type = BTN_TOOL_FINGER;
259 -
260 + /* touch device at least supports one touch point */
261 + touch_max = 1;
262 switch (features->type) {
263 case TABLETPC2FG:
264 features->pktlen = WACOM_PKGLEN_TPC2FG;
265 @@ -539,6 +540,8 @@ static int wacom_parse_hid(struct usb_interface *intf,
266 }
267
268 out:
269 + if (!features->touch_max && touch_max)
270 + features->touch_max = touch_max;
271 result = 0;
272 kfree(report);
273 return result;
274 diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c
275 index 13c9718a5ace..16e89f026bca 100644
276 --- a/drivers/media/pci/cx18/cx18-driver.c
277 +++ b/drivers/media/pci/cx18/cx18-driver.c
278 @@ -327,13 +327,16 @@ void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv)
279 struct i2c_client *c;
280 u8 eedata[256];
281
282 + memset(tv, 0, sizeof(*tv));
283 +
284 c = kzalloc(sizeof(*c), GFP_KERNEL);
285 + if (!c)
286 + return;
287
288 strlcpy(c->name, "cx18 tveeprom tmp", sizeof(c->name));
289 c->adapter = &cx->i2c_adap[0];
290 c->addr = 0xa0 >> 1;
291
292 - memset(tv, 0, sizeof(*tv));
293 if (tveeprom_read(c, eedata, sizeof(eedata)))
294 goto ret;
295
296 diff --git a/drivers/media/usb/dvb-usb/cxusb.c b/drivers/media/usb/dvb-usb/cxusb.c
297 index 20e345d9fe8f..a1c641e18362 100644
298 --- a/drivers/media/usb/dvb-usb/cxusb.c
299 +++ b/drivers/media/usb/dvb-usb/cxusb.c
300 @@ -149,6 +149,7 @@ static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
301 int num)
302 {
303 struct dvb_usb_device *d = i2c_get_adapdata(adap);
304 + int ret;
305 int i;
306
307 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
308 @@ -173,7 +174,8 @@ static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
309 if (1 + msg[i].len > sizeof(ibuf)) {
310 warn("i2c rd: len=%d is too big!\n",
311 msg[i].len);
312 - return -EOPNOTSUPP;
313 + ret = -EOPNOTSUPP;
314 + goto unlock;
315 }
316 obuf[0] = 0;
317 obuf[1] = msg[i].len;
318 @@ -193,12 +195,14 @@ static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
319 if (3 + msg[i].len > sizeof(obuf)) {
320 warn("i2c wr: len=%d is too big!\n",
321 msg[i].len);
322 - return -EOPNOTSUPP;
323 + ret = -EOPNOTSUPP;
324 + goto unlock;
325 }
326 if (1 + msg[i + 1].len > sizeof(ibuf)) {
327 warn("i2c rd: len=%d is too big!\n",
328 msg[i + 1].len);
329 - return -EOPNOTSUPP;
330 + ret = -EOPNOTSUPP;
331 + goto unlock;
332 }
333 obuf[0] = msg[i].len;
334 obuf[1] = msg[i+1].len;
335 @@ -223,7 +227,8 @@ static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
336 if (2 + msg[i].len > sizeof(obuf)) {
337 warn("i2c wr: len=%d is too big!\n",
338 msg[i].len);
339 - return -EOPNOTSUPP;
340 + ret = -EOPNOTSUPP;
341 + goto unlock;
342 }
343 obuf[0] = msg[i].addr;
344 obuf[1] = msg[i].len;
345 @@ -237,8 +242,14 @@ static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
346 }
347 }
348
349 + if (i == num)
350 + ret = num;
351 + else
352 + ret = -EREMOTEIO;
353 +
354 +unlock:
355 mutex_unlock(&d->i2c_mutex);
356 - return i == num ? num : -EREMOTEIO;
357 + return ret;
358 }
359
360 static u32 cxusb_i2c_func(struct i2c_adapter *adapter)
361 diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c
362 index 71b22f5a05ce..4170a45d17e0 100644
363 --- a/drivers/media/usb/dvb-usb/dw2102.c
364 +++ b/drivers/media/usb/dvb-usb/dw2102.c
365 @@ -301,6 +301,7 @@ static int dw2102_serit_i2c_transfer(struct i2c_adapter *adap,
366 static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num)
367 {
368 struct dvb_usb_device *d = i2c_get_adapdata(adap);
369 + int ret;
370
371 if (!d)
372 return -ENODEV;
373 @@ -316,7 +317,8 @@ static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg ms
374 if (2 + msg[1].len > sizeof(ibuf)) {
375 warn("i2c rd: len=%d is too big!\n",
376 msg[1].len);
377 - return -EOPNOTSUPP;
378 + ret = -EOPNOTSUPP;
379 + goto unlock;
380 }
381
382 obuf[0] = msg[0].addr << 1;
383 @@ -340,7 +342,8 @@ static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg ms
384 if (2 + msg[0].len > sizeof(obuf)) {
385 warn("i2c wr: len=%d is too big!\n",
386 msg[1].len);
387 - return -EOPNOTSUPP;
388 + ret = -EOPNOTSUPP;
389 + goto unlock;
390 }
391
392 obuf[0] = msg[0].addr << 1;
393 @@ -357,7 +360,8 @@ static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg ms
394 if (2 + msg[0].len > sizeof(obuf)) {
395 warn("i2c wr: len=%d is too big!\n",
396 msg[1].len);
397 - return -EOPNOTSUPP;
398 + ret = -EOPNOTSUPP;
399 + goto unlock;
400 }
401
402 obuf[0] = msg[0].addr << 1;
403 @@ -386,15 +390,17 @@ static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg ms
404
405 break;
406 }
407 + ret = num;
408
409 +unlock:
410 mutex_unlock(&d->i2c_mutex);
411 - return num;
412 + return ret;
413 }
414
415 static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num)
416 {
417 struct dvb_usb_device *d = i2c_get_adapdata(adap);
418 - int len, i, j;
419 + int len, i, j, ret;
420
421 if (!d)
422 return -ENODEV;
423 @@ -430,7 +436,8 @@ static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], i
424 if (2 + msg[j].len > sizeof(ibuf)) {
425 warn("i2c rd: len=%d is too big!\n",
426 msg[j].len);
427 - return -EOPNOTSUPP;
428 + ret = -EOPNOTSUPP;
429 + goto unlock;
430 }
431
432 dw210x_op_rw(d->udev, 0xc3,
433 @@ -466,7 +473,8 @@ static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], i
434 if (2 + msg[j].len > sizeof(obuf)) {
435 warn("i2c wr: len=%d is too big!\n",
436 msg[j].len);
437 - return -EOPNOTSUPP;
438 + ret = -EOPNOTSUPP;
439 + goto unlock;
440 }
441
442 obuf[0] = msg[j].addr << 1;
443 @@ -481,15 +489,18 @@ static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], i
444 }
445
446 }
447 + ret = num;
448
449 +unlock:
450 mutex_unlock(&d->i2c_mutex);
451 - return num;
452 + return ret;
453 }
454
455 static int dw3101_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
456 int num)
457 {
458 struct dvb_usb_device *d = i2c_get_adapdata(adap);
459 + int ret;
460 int i;
461
462 if (!d)
463 @@ -506,7 +517,8 @@ static int dw3101_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
464 if (2 + msg[1].len > sizeof(ibuf)) {
465 warn("i2c rd: len=%d is too big!\n",
466 msg[1].len);
467 - return -EOPNOTSUPP;
468 + ret = -EOPNOTSUPP;
469 + goto unlock;
470 }
471 obuf[0] = msg[0].addr << 1;
472 obuf[1] = msg[0].len;
473 @@ -530,7 +542,8 @@ static int dw3101_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
474 if (2 + msg[0].len > sizeof(obuf)) {
475 warn("i2c wr: len=%d is too big!\n",
476 msg[0].len);
477 - return -EOPNOTSUPP;
478 + ret = -EOPNOTSUPP;
479 + goto unlock;
480 }
481 obuf[0] = msg[0].addr << 1;
482 obuf[1] = msg[0].len;
483 @@ -556,9 +569,11 @@ static int dw3101_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
484 msg[i].flags == 0 ? ">>>" : "<<<");
485 debug_dump(msg[i].buf, msg[i].len, deb_xfer);
486 }
487 + ret = num;
488
489 +unlock:
490 mutex_unlock(&d->i2c_mutex);
491 - return num;
492 + return ret;
493 }
494
495 static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
496 @@ -566,7 +581,7 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
497 {
498 struct dvb_usb_device *d = i2c_get_adapdata(adap);
499 struct usb_device *udev;
500 - int len, i, j;
501 + int len, i, j, ret;
502
503 if (!d)
504 return -ENODEV;
505 @@ -618,7 +633,8 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
506 if (msg[j].len > sizeof(ibuf)) {
507 warn("i2c rd: len=%d is too big!\n",
508 msg[j].len);
509 - return -EOPNOTSUPP;
510 + ret = -EOPNOTSUPP;
511 + goto unlock;
512 }
513
514 dw210x_op_rw(d->udev, 0x91, 0, 0,
515 @@ -652,7 +668,8 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
516 if (2 + msg[j].len > sizeof(obuf)) {
517 warn("i2c wr: len=%d is too big!\n",
518 msg[j].len);
519 - return -EOPNOTSUPP;
520 + ret = -EOPNOTSUPP;
521 + goto unlock;
522 }
523
524 obuf[0] = msg[j + 1].len;
525 @@ -671,7 +688,8 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
526 if (2 + msg[j].len > sizeof(obuf)) {
527 warn("i2c wr: len=%d is too big!\n",
528 msg[j].len);
529 - return -EOPNOTSUPP;
530 + ret = -EOPNOTSUPP;
531 + goto unlock;
532 }
533 obuf[0] = msg[j].len + 1;
534 obuf[1] = (msg[j].addr << 1);
535 @@ -685,9 +703,11 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
536 }
537 }
538 }
539 + ret = num;
540
541 +unlock:
542 mutex_unlock(&d->i2c_mutex);
543 - return num;
544 + return ret;
545 }
546
547 static int su3000_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
548 diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
549 index d2bea3f07c73..69d3f59f8728 100644
550 --- a/drivers/net/ethernet/intel/e100.c
551 +++ b/drivers/net/ethernet/intel/e100.c
552 @@ -3039,7 +3039,7 @@ static void __e100_shutdown(struct pci_dev *pdev, bool *enable_wake)
553 *enable_wake = false;
554 }
555
556 - pci_disable_device(pdev);
557 + pci_clear_master(pdev);
558 }
559
560 static int __e100_power_off(struct pci_dev *pdev, bool wake)
561 diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
562 index f95de0d16216..1de59b0f8fa8 100644
563 --- a/drivers/net/wireless/p54/txrx.c
564 +++ b/drivers/net/wireless/p54/txrx.c
565 @@ -587,7 +587,7 @@ static void p54_rx_stats(struct p54_common *priv, struct sk_buff *skb)
566 chan = priv->curchan;
567 if (chan) {
568 struct survey_info *survey = &priv->survey[chan->hw_value];
569 - survey->noise = clamp_t(s8, priv->noise, -128, 127);
570 + survey->noise = clamp(priv->noise, -128, 127);
571 survey->channel_time = priv->survey_raw.active;
572 survey->channel_time_tx = priv->survey_raw.tx;
573 survey->channel_time_busy = priv->survey_raw.tx +
574 diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
575 index c59cc6ed7adb..a86d12326137 100644
576 --- a/drivers/regulator/core.c
577 +++ b/drivers/regulator/core.c
578 @@ -1712,8 +1712,6 @@ static int _regulator_do_disable(struct regulator_dev *rdev)
579
580 trace_regulator_disable_complete(rdev_get_name(rdev));
581
582 - _notifier_call_chain(rdev, REGULATOR_EVENT_DISABLE,
583 - NULL);
584 return 0;
585 }
586
587 @@ -1737,6 +1735,8 @@ static int _regulator_disable(struct regulator_dev *rdev)
588 rdev_err(rdev, "failed to disable\n");
589 return ret;
590 }
591 + _notifier_call_chain(rdev, REGULATOR_EVENT_DISABLE,
592 + NULL);
593 }
594
595 rdev->use_count = 0;
596 @@ -1789,20 +1789,16 @@ static int _regulator_force_disable(struct regulator_dev *rdev)
597 {
598 int ret = 0;
599
600 - /* force disable */
601 - if (rdev->desc->ops->disable) {
602 - /* ah well, who wants to live forever... */
603 - ret = rdev->desc->ops->disable(rdev);
604 - if (ret < 0) {
605 - rdev_err(rdev, "failed to force disable\n");
606 - return ret;
607 - }
608 - /* notify other consumers that power has been forced off */
609 - _notifier_call_chain(rdev, REGULATOR_EVENT_FORCE_DISABLE |
610 - REGULATOR_EVENT_DISABLE, NULL);
611 + ret = _regulator_do_disable(rdev);
612 + if (ret < 0) {
613 + rdev_err(rdev, "failed to force disable\n");
614 + return ret;
615 }
616
617 - return ret;
618 + _notifier_call_chain(rdev, REGULATOR_EVENT_FORCE_DISABLE |
619 + REGULATOR_EVENT_DISABLE, NULL);
620 +
621 + return 0;
622 }
623
624 /**
625 @@ -3788,8 +3784,6 @@ int regulator_suspend_finish(void)
626
627 mutex_lock(&regulator_list_mutex);
628 list_for_each_entry(rdev, &regulator_list, list) {
629 - struct regulator_ops *ops = rdev->desc->ops;
630 -
631 mutex_lock(&rdev->mutex);
632 if (rdev->use_count > 0 || rdev->constraints->always_on) {
633 error = _regulator_do_enable(rdev);
634 @@ -3798,12 +3792,10 @@ int regulator_suspend_finish(void)
635 } else {
636 if (!has_full_constraints)
637 goto unlock;
638 - if (!ops->disable)
639 - goto unlock;
640 if (!_regulator_is_enabled(rdev))
641 goto unlock;
642
643 - error = ops->disable(rdev);
644 + error = _regulator_do_disable(rdev);
645 if (error)
646 ret = error;
647 }
648 @@ -3993,7 +3985,7 @@ static int __init regulator_init_complete(void)
649 ops = rdev->desc->ops;
650 c = rdev->constraints;
651
652 - if (!ops->disable || (c && c->always_on))
653 + if (c && c->always_on)
654 continue;
655
656 mutex_lock(&rdev->mutex);
657 @@ -4014,7 +4006,7 @@ static int __init regulator_init_complete(void)
658 /* We log since this may kill the system if it
659 * goes wrong. */
660 rdev_info(rdev, "disabling\n");
661 - ret = ops->disable(rdev);
662 + ret = _regulator_do_disable(rdev);
663 if (ret != 0) {
664 rdev_err(rdev, "couldn't disable: %d\n", ret);
665 }
666 diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
667 index 159e3c6d92b9..3581416a24d8 100644
668 --- a/drivers/usb/host/xhci-pci.c
669 +++ b/drivers/usb/host/xhci-pci.c
670 @@ -113,6 +113,11 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
671 xhci_dbg(xhci, "QUIRK: Resetting on resume\n");
672 xhci->quirks |= XHCI_TRUST_TX_LENGTH;
673 }
674 + if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
675 + pdev->device == 0x0015 &&
676 + pdev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG &&
677 + pdev->subsystem_device == 0xc0cd)
678 + xhci->quirks |= XHCI_RESET_ON_RESUME;
679 if (pdev->vendor == PCI_VENDOR_ID_VIA)
680 xhci->quirks |= XHCI_RESET_ON_RESUME;
681 }
682 diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
683 index 8f47625a0661..4fb6a8938957 100644
684 --- a/include/linux/ceph/osd_client.h
685 +++ b/include/linux/ceph/osd_client.h
686 @@ -138,6 +138,7 @@ struct ceph_osd_request {
687 __le64 *r_request_pool;
688 void *r_request_pgid;
689 __le32 *r_request_attempts;
690 + bool r_paused;
691 struct ceph_eversion *r_request_reassert_version;
692
693 int r_result;
694 diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
695 index 120d57a1c3a5..b5e36017acd7 100644
696 --- a/include/linux/ftrace_event.h
697 +++ b/include/linux/ftrace_event.h
698 @@ -325,10 +325,6 @@ enum {
699 FILTER_TRACE_FN,
700 };
701
702 -#define EVENT_STORAGE_SIZE 128
703 -extern struct mutex event_storage_mutex;
704 -extern char event_storage[EVENT_STORAGE_SIZE];
705 -
706 extern int trace_event_raw_init(struct ftrace_event_call *call);
707 extern int trace_define_field(struct ftrace_event_call *call, const char *type,
708 const char *name, int offset, int size,
709 diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
710 index 66dba42128d7..dbb47418df81 100644
711 --- a/include/trace/ftrace.h
712 +++ b/include/trace/ftrace.h
713 @@ -299,15 +299,12 @@ static struct trace_event_functions ftrace_event_type_funcs_##call = { \
714 #undef __array
715 #define __array(type, item, len) \
716 do { \
717 - mutex_lock(&event_storage_mutex); \
718 + char *type_str = #type"["__stringify(len)"]"; \
719 BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \
720 - snprintf(event_storage, sizeof(event_storage), \
721 - "%s[%d]", #type, len); \
722 - ret = trace_define_field(event_call, event_storage, #item, \
723 + ret = trace_define_field(event_call, type_str, #item, \
724 offsetof(typeof(field), item), \
725 sizeof(field.item), \
726 is_signed_type(type), FILTER_OTHER); \
727 - mutex_unlock(&event_storage_mutex); \
728 if (ret) \
729 return ret; \
730 } while (0);
731 diff --git a/kernel/sched/auto_group.c b/kernel/sched/auto_group.c
732 index 64de5f8b0c9e..4a073539c58e 100644
733 --- a/kernel/sched/auto_group.c
734 +++ b/kernel/sched/auto_group.c
735 @@ -77,8 +77,6 @@ static inline struct autogroup *autogroup_create(void)
736 if (IS_ERR(tg))
737 goto out_free;
738
739 - sched_online_group(tg, &root_task_group);
740 -
741 kref_init(&ag->kref);
742 init_rwsem(&ag->lock);
743 ag->id = atomic_inc_return(&autogroup_seq_nr);
744 @@ -98,6 +96,7 @@ static inline struct autogroup *autogroup_create(void)
745 #endif
746 tg->autogroup = ag;
747
748 + sched_online_group(tg, &root_task_group);
749 return ag;
750
751 out_free:
752 diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
753 index 2f4b185bfc23..001b349af939 100644
754 --- a/kernel/trace/trace_events.c
755 +++ b/kernel/trace/trace_events.c
756 @@ -27,12 +27,6 @@
757
758 DEFINE_MUTEX(event_mutex);
759
760 -DEFINE_MUTEX(event_storage_mutex);
761 -EXPORT_SYMBOL_GPL(event_storage_mutex);
762 -
763 -char event_storage[EVENT_STORAGE_SIZE];
764 -EXPORT_SYMBOL_GPL(event_storage);
765 -
766 LIST_HEAD(ftrace_events);
767 static LIST_HEAD(ftrace_common_fields);
768
769 diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c
770 index d21a74670088..d7d0b50b1b70 100644
771 --- a/kernel/trace/trace_export.c
772 +++ b/kernel/trace/trace_export.c
773 @@ -95,15 +95,12 @@ static void __always_unused ____ftrace_check_##name(void) \
774 #undef __array
775 #define __array(type, item, len) \
776 do { \
777 + char *type_str = #type"["__stringify(len)"]"; \
778 BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \
779 - mutex_lock(&event_storage_mutex); \
780 - snprintf(event_storage, sizeof(event_storage), \
781 - "%s[%d]", #type, len); \
782 - ret = trace_define_field(event_call, event_storage, #item, \
783 + ret = trace_define_field(event_call, type_str, #item, \
784 offsetof(typeof(field), item), \
785 sizeof(field.item), \
786 is_signed_type(type), filter_type); \
787 - mutex_unlock(&event_storage_mutex); \
788 if (ret) \
789 return ret; \
790 } while (0);
791 diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
792 index bc0016e3e5ac..3663a305daf7 100644
793 --- a/net/ceph/osd_client.c
794 +++ b/net/ceph/osd_client.c
795 @@ -1225,6 +1225,22 @@ void ceph_osdc_set_request_linger(struct ceph_osd_client *osdc,
796 EXPORT_SYMBOL(ceph_osdc_set_request_linger);
797
798 /*
799 + * Returns whether a request should be blocked from being sent
800 + * based on the current osdmap and osd_client settings.
801 + *
802 + * Caller should hold map_sem for read.
803 + */
804 +static bool __req_should_be_paused(struct ceph_osd_client *osdc,
805 + struct ceph_osd_request *req)
806 +{
807 + bool pauserd = ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_PAUSERD);
808 + bool pausewr = ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_PAUSEWR) ||
809 + ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_FULL);
810 + return (req->r_flags & CEPH_OSD_FLAG_READ && pauserd) ||
811 + (req->r_flags & CEPH_OSD_FLAG_WRITE && pausewr);
812 +}
813 +
814 +/*
815 * Pick an osd (the first 'up' osd in the pg), allocate the osd struct
816 * (as needed), and set the request r_osd appropriately. If there is
817 * no up osd, set r_osd to NULL. Move the request to the appropriate list
818 @@ -1241,6 +1257,7 @@ static int __map_request(struct ceph_osd_client *osdc,
819 int acting[CEPH_PG_MAX_SIZE];
820 int o = -1, num = 0;
821 int err;
822 + bool was_paused;
823
824 dout("map_request %p tid %lld\n", req, req->r_tid);
825 err = ceph_calc_ceph_pg(&pgid, req->r_oid, osdc->osdmap,
826 @@ -1257,12 +1274,18 @@ static int __map_request(struct ceph_osd_client *osdc,
827 num = err;
828 }
829
830 + was_paused = req->r_paused;
831 + req->r_paused = __req_should_be_paused(osdc, req);
832 + if (was_paused && !req->r_paused)
833 + force_resend = 1;
834 +
835 if ((!force_resend &&
836 req->r_osd && req->r_osd->o_osd == o &&
837 req->r_sent >= req->r_osd->o_incarnation &&
838 req->r_num_pg_osds == num &&
839 memcmp(req->r_pg_osds, acting, sizeof(acting[0])*num) == 0) ||
840 - (req->r_osd == NULL && o == -1))
841 + (req->r_osd == NULL && o == -1) ||
842 + req->r_paused)
843 return 0; /* no change */
844
845 dout("map_request tid %llu pgid %lld.%x osd%d (was osd%d)\n",
846 @@ -1606,14 +1629,17 @@ static void reset_changed_osds(struct ceph_osd_client *osdc)
847 *
848 * Caller should hold map_sem for read.
849 */
850 -static void kick_requests(struct ceph_osd_client *osdc, int force_resend)
851 +static void kick_requests(struct ceph_osd_client *osdc, bool force_resend,
852 + bool force_resend_writes)
853 {
854 struct ceph_osd_request *req, *nreq;
855 struct rb_node *p;
856 int needmap = 0;
857 int err;
858 + bool force_resend_req;
859
860 - dout("kick_requests %s\n", force_resend ? " (force resend)" : "");
861 + dout("kick_requests %s %s\n", force_resend ? " (force resend)" : "",
862 + force_resend_writes ? " (force resend writes)" : "");
863 mutex_lock(&osdc->request_mutex);
864 for (p = rb_first(&osdc->requests); p; ) {
865 req = rb_entry(p, struct ceph_osd_request, r_node);
866 @@ -1638,7 +1664,10 @@ static void kick_requests(struct ceph_osd_client *osdc, int force_resend)
867 continue;
868 }
869
870 - err = __map_request(osdc, req, force_resend);
871 + force_resend_req = force_resend ||
872 + (force_resend_writes &&
873 + req->r_flags & CEPH_OSD_FLAG_WRITE);
874 + err = __map_request(osdc, req, force_resend_req);
875 if (err < 0)
876 continue; /* error */
877 if (req->r_osd == NULL) {
878 @@ -1658,7 +1687,8 @@ static void kick_requests(struct ceph_osd_client *osdc, int force_resend)
879 r_linger_item) {
880 dout("linger req=%p req->r_osd=%p\n", req, req->r_osd);
881
882 - err = __map_request(osdc, req, force_resend);
883 + err = __map_request(osdc, req,
884 + force_resend || force_resend_writes);
885 dout("__map_request returned %d\n", err);
886 if (err == 0)
887 continue; /* no change and no osd was specified */
888 @@ -1700,6 +1730,7 @@ void ceph_osdc_handle_map(struct ceph_osd_client *osdc, struct ceph_msg *msg)
889 struct ceph_osdmap *newmap = NULL, *oldmap;
890 int err;
891 struct ceph_fsid fsid;
892 + bool was_full;
893
894 dout("handle_map have %u\n", osdc->osdmap ? osdc->osdmap->epoch : 0);
895 p = msg->front.iov_base;
896 @@ -1713,6 +1744,8 @@ void ceph_osdc_handle_map(struct ceph_osd_client *osdc, struct ceph_msg *msg)
897
898 down_write(&osdc->map_sem);
899
900 + was_full = ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_FULL);
901 +
902 /* incremental maps */
903 ceph_decode_32_safe(&p, end, nr_maps, bad);
904 dout(" %d inc maps\n", nr_maps);
905 @@ -1737,7 +1770,10 @@ void ceph_osdc_handle_map(struct ceph_osd_client *osdc, struct ceph_msg *msg)
906 ceph_osdmap_destroy(osdc->osdmap);
907 osdc->osdmap = newmap;
908 }
909 - kick_requests(osdc, 0);
910 + was_full = was_full ||
911 + ceph_osdmap_flag(osdc->osdmap,
912 + CEPH_OSDMAP_FULL);
913 + kick_requests(osdc, 0, was_full);
914 } else {
915 dout("ignoring incremental map %u len %d\n",
916 epoch, maplen);
917 @@ -1780,7 +1816,10 @@ void ceph_osdc_handle_map(struct ceph_osd_client *osdc, struct ceph_msg *msg)
918 skipped_map = 1;
919 ceph_osdmap_destroy(oldmap);
920 }
921 - kick_requests(osdc, skipped_map);
922 + was_full = was_full ||
923 + ceph_osdmap_flag(osdc->osdmap,
924 + CEPH_OSDMAP_FULL);
925 + kick_requests(osdc, skipped_map, was_full);
926 }
927 p += maplen;
928 nr_maps--;
929 @@ -1797,7 +1836,9 @@ done:
930 * we find out when we are no longer full and stop returning
931 * ENOSPC.
932 */
933 - if (ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_FULL))
934 + if (ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_FULL) ||
935 + ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_PAUSERD) ||
936 + ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_PAUSEWR))
937 ceph_monc_request_next_osdmap(&osdc->client->monc);
938
939 mutex_lock(&osdc->request_mutex);
940 diff --git a/scripts/package/builddeb b/scripts/package/builddeb
941 index acb86507828a..3001ec5ae07d 100644
942 --- a/scripts/package/builddeb
943 +++ b/scripts/package/builddeb
944 @@ -62,7 +62,7 @@ create_package() {
945 fi
946
947 # Create the package
948 - dpkg-gencontrol -isp $forcearch -p$pname -P"$pdir"
949 + dpkg-gencontrol -isp $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir"
950 dpkg --build "$pdir" ..
951 }
952
953 @@ -252,15 +252,14 @@ mkdir -p "$destdir"
954 (cd $objtree; tar -c -f - -T "$objtree/debian/hdrobjfiles") | (cd $destdir; tar -xf -)
955 ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build"
956 rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"
957 -arch=$(dpkg --print-architecture)
958
959 cat <<EOF >> debian/control
960
961 Package: $kernel_headers_packagename
962 Provides: linux-headers, linux-headers-2.6
963 -Architecture: $arch
964 -Description: Linux kernel headers for $KERNELRELEASE on $arch
965 - This package provides kernel header files for $KERNELRELEASE on $arch
966 +Architecture: any
967 +Description: Linux kernel headers for $KERNELRELEASE on \${kernel:debarch}
968 + This package provides kernel header files for $KERNELRELEASE on \${kernel:debarch}
969 .
970 This is useful for people who need to build external modules
971 EOF
972 diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
973 index 19799931c51d..3fdf998ad057 100644
974 --- a/sound/core/compress_offload.c
975 +++ b/sound/core/compress_offload.c
976 @@ -133,7 +133,7 @@ static int snd_compr_open(struct inode *inode, struct file *f)
977 kfree(data);
978 }
979 snd_card_unref(compr->card);
980 - return 0;
981 + return ret;
982 }
983
984 static int snd_compr_free(struct inode *inode, struct file *f)
985 diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
986 index 819c90fe021f..4fdcc1cefc25 100644
987 --- a/sound/soc/codecs/max98090.c
988 +++ b/sound/soc/codecs/max98090.c
989 @@ -336,6 +336,7 @@ static bool max98090_readable_register(struct device *dev, unsigned int reg)
990 case M98090_REG_RECORD_TDM_SLOT:
991 case M98090_REG_SAMPLE_RATE:
992 case M98090_REG_DMIC34_BIQUAD_BASE ... M98090_REG_DMIC34_BIQUAD_BASE + 0x0E:
993 + case M98090_REG_REVISION_ID:
994 return true;
995 default:
996 return false;