Magellan Linux

Contents of /trunk/kernel-magellan/patches-4.1/0100-4.1.1-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2626 - (show annotations) (download)
Mon Jul 20 08:14:03 2015 UTC (8 years, 9 months ago) by niro
File size: 13952 byte(s)
-linux-4.1.1
1 diff --git a/Makefile b/Makefile
2 index f5c8983aeeb7..1caf4ad3eb8a 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,8 +1,8 @@
6 VERSION = 4
7 PATCHLEVEL = 1
8 -SUBLEVEL = 0
9 +SUBLEVEL = 1
10 EXTRAVERSION =
11 -NAME = Hurr durr I'ma sheep
12 +NAME = Series 4800
13
14 # *DOCUMENTATION*
15 # To see a list of typical targets execute "make help"
16 diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
17 index 4f7001f28936..aa4e3a74e541 100644
18 --- a/arch/x86/kernel/cpu/perf_event.c
19 +++ b/arch/x86/kernel/cpu/perf_event.c
20 @@ -270,11 +270,7 @@ msr_fail:
21
22 static void hw_perf_event_destroy(struct perf_event *event)
23 {
24 - if (atomic_dec_and_mutex_lock(&active_events, &pmc_reserve_mutex)) {
25 - release_pmc_hardware();
26 - release_ds_buffers();
27 - mutex_unlock(&pmc_reserve_mutex);
28 - }
29 + x86_release_hardware();
30 }
31
32 void hw_perf_lbr_event_destroy(struct perf_event *event)
33 @@ -324,6 +320,35 @@ set_ext_hw_attr(struct hw_perf_event *hwc, struct perf_event *event)
34 return x86_pmu_extra_regs(val, event);
35 }
36
37 +int x86_reserve_hardware(void)
38 +{
39 + int err = 0;
40 +
41 + if (!atomic_inc_not_zero(&active_events)) {
42 + mutex_lock(&pmc_reserve_mutex);
43 + if (atomic_read(&active_events) == 0) {
44 + if (!reserve_pmc_hardware())
45 + err = -EBUSY;
46 + else
47 + reserve_ds_buffers();
48 + }
49 + if (!err)
50 + atomic_inc(&active_events);
51 + mutex_unlock(&pmc_reserve_mutex);
52 + }
53 +
54 + return err;
55 +}
56 +
57 +void x86_release_hardware(void)
58 +{
59 + if (atomic_dec_and_mutex_lock(&active_events, &pmc_reserve_mutex)) {
60 + release_pmc_hardware();
61 + release_ds_buffers();
62 + mutex_unlock(&pmc_reserve_mutex);
63 + }
64 +}
65 +
66 /*
67 * Check if we can create event of a certain type (that no conflicting events
68 * are present).
69 @@ -336,9 +361,10 @@ int x86_add_exclusive(unsigned int what)
70 return 0;
71
72 mutex_lock(&pmc_reserve_mutex);
73 - for (i = 0; i < ARRAY_SIZE(x86_pmu.lbr_exclusive); i++)
74 + for (i = 0; i < ARRAY_SIZE(x86_pmu.lbr_exclusive); i++) {
75 if (i != what && atomic_read(&x86_pmu.lbr_exclusive[i]))
76 goto out;
77 + }
78
79 atomic_inc(&x86_pmu.lbr_exclusive[what]);
80 ret = 0;
81 @@ -527,19 +553,7 @@ static int __x86_pmu_event_init(struct perf_event *event)
82 if (!x86_pmu_initialized())
83 return -ENODEV;
84
85 - err = 0;
86 - if (!atomic_inc_not_zero(&active_events)) {
87 - mutex_lock(&pmc_reserve_mutex);
88 - if (atomic_read(&active_events) == 0) {
89 - if (!reserve_pmc_hardware())
90 - err = -EBUSY;
91 - else
92 - reserve_ds_buffers();
93 - }
94 - if (!err)
95 - atomic_inc(&active_events);
96 - mutex_unlock(&pmc_reserve_mutex);
97 - }
98 + err = x86_reserve_hardware();
99 if (err)
100 return err;
101
102 diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h
103 index ef78516850fb..f068695eaca0 100644
104 --- a/arch/x86/kernel/cpu/perf_event.h
105 +++ b/arch/x86/kernel/cpu/perf_event.h
106 @@ -703,6 +703,10 @@ int x86_add_exclusive(unsigned int what);
107
108 void x86_del_exclusive(unsigned int what);
109
110 +int x86_reserve_hardware(void);
111 +
112 +void x86_release_hardware(void);
113 +
114 void hw_perf_lbr_event_destroy(struct perf_event *event);
115
116 int x86_setup_perfctr(struct perf_event *event);
117 diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
118 index a1e35c9f06b9..2813ea0f142e 100644
119 --- a/arch/x86/kernel/cpu/perf_event_intel.c
120 +++ b/arch/x86/kernel/cpu/perf_event_intel.c
121 @@ -3253,6 +3253,8 @@ __init int intel_pmu_init(void)
122
123 case 61: /* 14nm Broadwell Core-M */
124 case 86: /* 14nm Broadwell Xeon D */
125 + case 71: /* 14nm Broadwell + GT3e (Intel Iris Pro graphics) */
126 + case 79: /* 14nm Broadwell Server */
127 x86_pmu.late_ack = true;
128 memcpy(hw_cache_event_ids, hsw_hw_cache_event_ids, sizeof(hw_cache_event_ids));
129 memcpy(hw_cache_extra_regs, hsw_hw_cache_extra_regs, sizeof(hw_cache_extra_regs));
130 @@ -3322,13 +3324,13 @@ __init int intel_pmu_init(void)
131 * counter, so do not extend mask to generic counters
132 */
133 for_each_event_constraint(c, x86_pmu.event_constraints) {
134 - if (c->cmask != FIXED_EVENT_FLAGS
135 - || c->idxmsk64 == INTEL_PMC_MSK_FIXED_REF_CYCLES) {
136 - continue;
137 + if (c->cmask == FIXED_EVENT_FLAGS
138 + && c->idxmsk64 != INTEL_PMC_MSK_FIXED_REF_CYCLES) {
139 + c->idxmsk64 |= (1ULL << x86_pmu.num_counters) - 1;
140 }
141 -
142 - c->idxmsk64 |= (1ULL << x86_pmu.num_counters) - 1;
143 - c->weight += x86_pmu.num_counters;
144 + c->idxmsk64 &=
145 + ~(~0UL << (INTEL_PMC_IDX_FIXED + x86_pmu.num_counters_fixed));
146 + c->weight = hweight64(c->idxmsk64);
147 }
148 }
149
150 diff --git a/arch/x86/kernel/cpu/perf_event_intel_bts.c b/arch/x86/kernel/cpu/perf_event_intel_bts.c
151 index ac1f0c55f379..7795f3f8b1d5 100644
152 --- a/arch/x86/kernel/cpu/perf_event_intel_bts.c
153 +++ b/arch/x86/kernel/cpu/perf_event_intel_bts.c
154 @@ -483,17 +483,26 @@ static int bts_event_add(struct perf_event *event, int mode)
155
156 static void bts_event_destroy(struct perf_event *event)
157 {
158 + x86_release_hardware();
159 x86_del_exclusive(x86_lbr_exclusive_bts);
160 }
161
162 static int bts_event_init(struct perf_event *event)
163 {
164 + int ret;
165 +
166 if (event->attr.type != bts_pmu.type)
167 return -ENOENT;
168
169 if (x86_add_exclusive(x86_lbr_exclusive_bts))
170 return -EBUSY;
171
172 + ret = x86_reserve_hardware();
173 + if (ret) {
174 + x86_del_exclusive(x86_lbr_exclusive_bts);
175 + return ret;
176 + }
177 +
178 event->destroy = bts_event_destroy;
179
180 return 0;
181 diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
182 index 53eeb226657c..7e429c99c728 100644
183 --- a/arch/x86/kernel/head_32.S
184 +++ b/arch/x86/kernel/head_32.S
185 @@ -62,9 +62,16 @@
186 #define PAGE_TABLE_SIZE(pages) ((pages) / PTRS_PER_PGD)
187 #endif
188
189 -/* Number of possible pages in the lowmem region */
190 -LOWMEM_PAGES = (((1<<32) - __PAGE_OFFSET) >> PAGE_SHIFT)
191 -
192 +/*
193 + * Number of possible pages in the lowmem region.
194 + *
195 + * We shift 2 by 31 instead of 1 by 32 to the left in order to avoid a
196 + * gas warning about overflowing shift count when gas has been compiled
197 + * with only a host target support using a 32-bit type for internal
198 + * representation.
199 + */
200 +LOWMEM_PAGES = (((2<<31) - __PAGE_OFFSET) >> PAGE_SHIFT)
201 +
202 /* Enough space to fit pagetables for the low memory linear map */
203 MAPPING_BEYOND_END = PAGE_TABLE_SIZE(LOWMEM_PAGES) << PAGE_SHIFT
204
205 diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
206 index 8c81af6dbe06..e527a3e13939 100644
207 --- a/drivers/bluetooth/ath3k.c
208 +++ b/drivers/bluetooth/ath3k.c
209 @@ -80,6 +80,7 @@ static const struct usb_device_id ath3k_table[] = {
210 { USB_DEVICE(0x0489, 0xe057) },
211 { USB_DEVICE(0x0489, 0xe056) },
212 { USB_DEVICE(0x0489, 0xe05f) },
213 + { USB_DEVICE(0x0489, 0xe076) },
214 { USB_DEVICE(0x0489, 0xe078) },
215 { USB_DEVICE(0x04c5, 0x1330) },
216 { USB_DEVICE(0x04CA, 0x3004) },
217 @@ -88,6 +89,7 @@ static const struct usb_device_id ath3k_table[] = {
218 { USB_DEVICE(0x04CA, 0x3007) },
219 { USB_DEVICE(0x04CA, 0x3008) },
220 { USB_DEVICE(0x04CA, 0x300b) },
221 + { USB_DEVICE(0x04CA, 0x300d) },
222 { USB_DEVICE(0x04CA, 0x300f) },
223 { USB_DEVICE(0x04CA, 0x3010) },
224 { USB_DEVICE(0x0930, 0x0219) },
225 @@ -113,6 +115,7 @@ static const struct usb_device_id ath3k_table[] = {
226 { USB_DEVICE(0x13d3, 0x3408) },
227 { USB_DEVICE(0x13d3, 0x3423) },
228 { USB_DEVICE(0x13d3, 0x3432) },
229 + { USB_DEVICE(0x13d3, 0x3474) },
230
231 /* Atheros AR5BBU12 with sflash firmware */
232 { USB_DEVICE(0x0489, 0xE02C) },
233 @@ -137,6 +140,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
234 { USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
235 { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
236 { USB_DEVICE(0x0489, 0xe05f), .driver_info = BTUSB_ATH3012 },
237 + { USB_DEVICE(0x0489, 0xe076), .driver_info = BTUSB_ATH3012 },
238 { USB_DEVICE(0x0489, 0xe078), .driver_info = BTUSB_ATH3012 },
239 { USB_DEVICE(0x04c5, 0x1330), .driver_info = BTUSB_ATH3012 },
240 { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
241 @@ -145,6 +149,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
242 { USB_DEVICE(0x04ca, 0x3007), .driver_info = BTUSB_ATH3012 },
243 { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
244 { USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 },
245 + { USB_DEVICE(0x04ca, 0x300d), .driver_info = BTUSB_ATH3012 },
246 { USB_DEVICE(0x04ca, 0x300f), .driver_info = BTUSB_ATH3012 },
247 { USB_DEVICE(0x04ca, 0x3010), .driver_info = BTUSB_ATH3012 },
248 { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
249 @@ -170,6 +175,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
250 { USB_DEVICE(0x13d3, 0x3408), .driver_info = BTUSB_ATH3012 },
251 { USB_DEVICE(0x13d3, 0x3423), .driver_info = BTUSB_ATH3012 },
252 { USB_DEVICE(0x13d3, 0x3432), .driver_info = BTUSB_ATH3012 },
253 + { USB_DEVICE(0x13d3, 0x3474), .driver_info = BTUSB_ATH3012 },
254
255 /* Atheros AR5BBU22 with sflash firmware */
256 { USB_DEVICE(0x0489, 0xE036), .driver_info = BTUSB_ATH3012 },
257 diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
258 index 3c10d4dfe9a7..420cc9f3eb76 100644
259 --- a/drivers/bluetooth/btusb.c
260 +++ b/drivers/bluetooth/btusb.c
261 @@ -178,6 +178,7 @@ static const struct usb_device_id blacklist_table[] = {
262 { USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
263 { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
264 { USB_DEVICE(0x0489, 0xe05f), .driver_info = BTUSB_ATH3012 },
265 + { USB_DEVICE(0x0489, 0xe076), .driver_info = BTUSB_ATH3012 },
266 { USB_DEVICE(0x0489, 0xe078), .driver_info = BTUSB_ATH3012 },
267 { USB_DEVICE(0x04c5, 0x1330), .driver_info = BTUSB_ATH3012 },
268 { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
269 @@ -186,6 +187,7 @@ static const struct usb_device_id blacklist_table[] = {
270 { USB_DEVICE(0x04ca, 0x3007), .driver_info = BTUSB_ATH3012 },
271 { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
272 { USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 },
273 + { USB_DEVICE(0x04ca, 0x300d), .driver_info = BTUSB_ATH3012 },
274 { USB_DEVICE(0x04ca, 0x300f), .driver_info = BTUSB_ATH3012 },
275 { USB_DEVICE(0x04ca, 0x3010), .driver_info = BTUSB_ATH3012 },
276 { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
277 @@ -211,6 +213,7 @@ static const struct usb_device_id blacklist_table[] = {
278 { USB_DEVICE(0x13d3, 0x3408), .driver_info = BTUSB_ATH3012 },
279 { USB_DEVICE(0x13d3, 0x3423), .driver_info = BTUSB_ATH3012 },
280 { USB_DEVICE(0x13d3, 0x3432), .driver_info = BTUSB_ATH3012 },
281 + { USB_DEVICE(0x13d3, 0x3474), .driver_info = BTUSB_ATH3012 },
282
283 /* Atheros AR5BBU12 with sflash firmware */
284 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
285 diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
286 index b2f9521fe551..4cdac7801c8b 100644
287 --- a/drivers/net/wireless/b43/main.c
288 +++ b/drivers/net/wireless/b43/main.c
289 @@ -5365,6 +5365,10 @@ static void b43_supported_bands(struct b43_wldev *dev, bool *have_2ghz_phy,
290 *have_5ghz_phy = true;
291 return;
292 case 0x4321: /* BCM4306 */
293 + /* There are 14e4:4321 PCI devs with 2.4 GHz BCM4321 (N-PHY) */
294 + if (dev->phy.type != B43_PHYTYPE_G)
295 + break;
296 + /* fall through */
297 case 0x4313: /* BCM4311 */
298 case 0x431a: /* BCM4318 */
299 case 0x432a: /* BCM4321 */
300 diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
301 index 5c8f58114677..a086e1d69bc7 100644
302 --- a/drivers/usb/class/cdc-acm.c
303 +++ b/drivers/usb/class/cdc-acm.c
304 @@ -1477,6 +1477,11 @@ skip_countries:
305 goto alloc_fail8;
306 }
307
308 + if (quirks & CLEAR_HALT_CONDITIONS) {
309 + usb_clear_halt(usb_dev, usb_rcvbulkpipe(usb_dev, epread->bEndpointAddress));
310 + usb_clear_halt(usb_dev, usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress));
311 + }
312 +
313 return 0;
314 alloc_fail8:
315 if (acm->country_codes) {
316 @@ -1756,6 +1761,10 @@ static const struct usb_device_id acm_ids[] = {
317 .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */
318 },
319
320 + { USB_DEVICE(0x2912, 0x0001), /* ATOL FPrint */
321 + .driver_info = CLEAR_HALT_CONDITIONS,
322 + },
323 +
324 /* Nokia S60 phones expose two ACM channels. The first is
325 * a modem and is picked up by the standard AT-command
326 * information below. The second is 'vendor-specific' but
327 diff --git a/drivers/usb/class/cdc-acm.h b/drivers/usb/class/cdc-acm.h
328 index ffeb3c83941f..b3b6c9db6fe5 100644
329 --- a/drivers/usb/class/cdc-acm.h
330 +++ b/drivers/usb/class/cdc-acm.h
331 @@ -133,3 +133,4 @@ struct acm {
332 #define NO_DATA_INTERFACE BIT(4)
333 #define IGNORE_DEVICE BIT(5)
334 #define QUIRK_CONTROL_LINE_STATE BIT(6)
335 +#define CLEAR_HALT_CONDITIONS BIT(7)
336 diff --git a/kernel/events/core.c b/kernel/events/core.c
337 index eddf1ed4155e..0ceb386777ae 100644
338 --- a/kernel/events/core.c
339 +++ b/kernel/events/core.c
340 @@ -4331,20 +4331,20 @@ static void ring_buffer_attach(struct perf_event *event,
341 WARN_ON_ONCE(event->rcu_pending);
342
343 old_rb = event->rb;
344 - event->rcu_batches = get_state_synchronize_rcu();
345 - event->rcu_pending = 1;
346 -
347 spin_lock_irqsave(&old_rb->event_lock, flags);
348 list_del_rcu(&event->rb_entry);
349 spin_unlock_irqrestore(&old_rb->event_lock, flags);
350 - }
351
352 - if (event->rcu_pending && rb) {
353 - cond_synchronize_rcu(event->rcu_batches);
354 - event->rcu_pending = 0;
355 + event->rcu_batches = get_state_synchronize_rcu();
356 + event->rcu_pending = 1;
357 }
358
359 if (rb) {
360 + if (event->rcu_pending) {
361 + cond_synchronize_rcu(event->rcu_batches);
362 + event->rcu_pending = 0;
363 + }
364 +
365 spin_lock_irqsave(&rb->event_lock, flags);
366 list_add_rcu(&event->rb_entry, &rb->event_list);
367 spin_unlock_irqrestore(&rb->event_lock, flags);
368 diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
369 index 10df57237a66..98cfc388ea33 100644
370 --- a/tools/build/Makefile.build
371 +++ b/tools/build/Makefile.build
372 @@ -94,12 +94,12 @@ obj-y := $(patsubst %/, %/$(obj)-in.o, $(obj-y))
373 subdir-obj-y := $(filter %/$(obj)-in.o, $(obj-y))
374
375 # '$(OUTPUT)/dir' prefix to all objects
376 -prefix := $(subst ./,,$(OUTPUT)$(dir)/)
377 -obj-y := $(addprefix $(prefix),$(obj-y))
378 -subdir-obj-y := $(addprefix $(prefix),$(subdir-obj-y))
379 +objprefix := $(subst ./,,$(OUTPUT)$(dir)/)
380 +obj-y := $(addprefix $(objprefix),$(obj-y))
381 +subdir-obj-y := $(addprefix $(objprefix),$(subdir-obj-y))
382
383 # Final '$(obj)-in.o' object
384 -in-target := $(prefix)$(obj)-in.o
385 +in-target := $(objprefix)$(obj)-in.o
386
387 PHONY += $(subdir-y)
388