Contents of /trunk/kernel-alx/patches-4.4/0136-4.4.37-all-fixes.patch
Parent Directory | Revision Log
Revision 2872 -
(show annotations)
(download)
Mon Mar 27 13:49:14 2017 UTC (7 years, 6 months ago) by niro
File size: 11721 byte(s)
Mon Mar 27 13:49:14 2017 UTC (7 years, 6 months ago) by niro
File size: 11721 byte(s)
linux-4.4.37
1 | diff --git a/Makefile b/Makefile |
2 | index 705eb9e38fce..b57ec79b4941 100644 |
3 | --- a/Makefile |
4 | +++ b/Makefile |
5 | @@ -1,6 +1,6 @@ |
6 | VERSION = 4 |
7 | PATCHLEVEL = 4 |
8 | -SUBLEVEL = 36 |
9 | +SUBLEVEL = 37 |
10 | EXTRAVERSION = |
11 | NAME = Blurry Fish Butt |
12 | |
13 | diff --git a/arch/arc/include/asm/delay.h b/arch/arc/include/asm/delay.h |
14 | index 08e7e2a16ac1..a36e8601114d 100644 |
15 | --- a/arch/arc/include/asm/delay.h |
16 | +++ b/arch/arc/include/asm/delay.h |
17 | @@ -22,10 +22,11 @@ |
18 | static inline void __delay(unsigned long loops) |
19 | { |
20 | __asm__ __volatile__( |
21 | - " lp 1f \n" |
22 | - " nop \n" |
23 | - "1: \n" |
24 | - : "+l"(loops)); |
25 | + " mov lp_count, %0 \n" |
26 | + " lp 1f \n" |
27 | + " nop \n" |
28 | + "1: \n" |
29 | + : : "r"(loops)); |
30 | } |
31 | |
32 | extern void __bad_udelay(void); |
33 | diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h |
34 | index 8136afc9df0d..8884b5d5f48c 100644 |
35 | --- a/arch/arm64/include/asm/cpufeature.h |
36 | +++ b/arch/arm64/include/asm/cpufeature.h |
37 | @@ -77,7 +77,7 @@ struct arm64_cpu_capabilities { |
38 | const char *desc; |
39 | u16 capability; |
40 | bool (*matches)(const struct arm64_cpu_capabilities *); |
41 | - void (*enable)(void *); /* Called on all active CPUs */ |
42 | + int (*enable)(void *); /* Called on all active CPUs */ |
43 | union { |
44 | struct { /* To be used for erratum handling only */ |
45 | u32 midr_model; |
46 | diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h |
47 | index 4acb7ca94fcd..d08559528927 100644 |
48 | --- a/arch/arm64/include/asm/processor.h |
49 | +++ b/arch/arm64/include/asm/processor.h |
50 | @@ -186,6 +186,6 @@ static inline void spin_lock_prefetch(const void *x) |
51 | |
52 | #endif |
53 | |
54 | -void cpu_enable_pan(void *__unused); |
55 | +int cpu_enable_pan(void *__unused); |
56 | |
57 | #endif /* __ASM_PROCESSOR_H */ |
58 | diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c |
59 | index 0669c63281ea..2735bf814592 100644 |
60 | --- a/arch/arm64/kernel/cpufeature.c |
61 | +++ b/arch/arm64/kernel/cpufeature.c |
62 | @@ -19,7 +19,9 @@ |
63 | #define pr_fmt(fmt) "CPU features: " fmt |
64 | |
65 | #include <linux/bsearch.h> |
66 | +#include <linux/cpumask.h> |
67 | #include <linux/sort.h> |
68 | +#include <linux/stop_machine.h> |
69 | #include <linux/types.h> |
70 | #include <asm/cpu.h> |
71 | #include <asm/cpufeature.h> |
72 | @@ -764,7 +766,13 @@ static void enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps) |
73 | |
74 | for (i = 0; caps[i].desc; i++) |
75 | if (caps[i].enable && cpus_have_cap(caps[i].capability)) |
76 | - on_each_cpu(caps[i].enable, NULL, true); |
77 | + /* |
78 | + * Use stop_machine() as it schedules the work allowing |
79 | + * us to modify PSTATE, instead of on_each_cpu() which |
80 | + * uses an IPI, giving us a PSTATE that disappears when |
81 | + * we return. |
82 | + */ |
83 | + stop_machine(caps[i].enable, NULL, cpu_online_mask); |
84 | } |
85 | |
86 | #ifdef CONFIG_HOTPLUG_CPU |
87 | diff --git a/arch/arm64/kernel/suspend.c b/arch/arm64/kernel/suspend.c |
88 | index 1095aa483a1c..00c1372bf57b 100644 |
89 | --- a/arch/arm64/kernel/suspend.c |
90 | +++ b/arch/arm64/kernel/suspend.c |
91 | @@ -1,7 +1,9 @@ |
92 | #include <linux/ftrace.h> |
93 | #include <linux/percpu.h> |
94 | #include <linux/slab.h> |
95 | +#include <asm/alternative.h> |
96 | #include <asm/cacheflush.h> |
97 | +#include <asm/cpufeature.h> |
98 | #include <asm/debug-monitors.h> |
99 | #include <asm/pgtable.h> |
100 | #include <asm/memory.h> |
101 | @@ -111,6 +113,13 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long)) |
102 | set_my_cpu_offset(per_cpu_offset(smp_processor_id())); |
103 | |
104 | /* |
105 | + * PSTATE was not saved over suspend/resume, re-enable any |
106 | + * detected features that might not have been set correctly. |
107 | + */ |
108 | + asm(ALTERNATIVE("nop", SET_PSTATE_PAN(1), ARM64_HAS_PAN, |
109 | + CONFIG_ARM64_PAN)); |
110 | + |
111 | + /* |
112 | * Restore HW breakpoint registers to sane values |
113 | * before debug exceptions are possibly reenabled |
114 | * through local_dbg_restore. |
115 | diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c |
116 | index 4c1a118c1d09..247bae758e1e 100644 |
117 | --- a/arch/arm64/mm/fault.c |
118 | +++ b/arch/arm64/mm/fault.c |
119 | @@ -29,7 +29,9 @@ |
120 | #include <linux/sched.h> |
121 | #include <linux/highmem.h> |
122 | #include <linux/perf_event.h> |
123 | +#include <linux/preempt.h> |
124 | |
125 | +#include <asm/bug.h> |
126 | #include <asm/cpufeature.h> |
127 | #include <asm/exception.h> |
128 | #include <asm/debug-monitors.h> |
129 | @@ -606,8 +608,16 @@ asmlinkage int __exception do_debug_exception(unsigned long addr, |
130 | } |
131 | |
132 | #ifdef CONFIG_ARM64_PAN |
133 | -void cpu_enable_pan(void *__unused) |
134 | +int cpu_enable_pan(void *__unused) |
135 | { |
136 | + /* |
137 | + * We modify PSTATE. This won't work from irq context as the PSTATE |
138 | + * is discarded once we return from the exception. |
139 | + */ |
140 | + WARN_ON_ONCE(in_interrupt()); |
141 | + |
142 | config_sctlr_el1(SCTLR_EL1_SPAN, 0); |
143 | + asm(SET_PSTATE_PAN(1)); |
144 | + return 0; |
145 | } |
146 | #endif /* CONFIG_ARM64_PAN */ |
147 | diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S |
148 | index 6bc9ae24b6d2..8f1a3f443f7d 100644 |
149 | --- a/arch/x86/kernel/head_32.S |
150 | +++ b/arch/x86/kernel/head_32.S |
151 | @@ -571,7 +571,7 @@ early_idt_handler_common: |
152 | movl %eax,%ds |
153 | movl %eax,%es |
154 | |
155 | - cmpl $(__KERNEL_CS),32(%esp) |
156 | + cmpw $(__KERNEL_CS),32(%esp) |
157 | jne 10f |
158 | |
159 | leal 28(%esp),%eax # Pointer to %eip |
160 | diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c |
161 | index 370c2f76016d..1770c455dfdd 100644 |
162 | --- a/drivers/block/zram/zram_drv.c |
163 | +++ b/drivers/block/zram/zram_drv.c |
164 | @@ -1368,7 +1368,8 @@ static ssize_t hot_remove_store(struct class *class, |
165 | zram = idr_find(&zram_index_idr, dev_id); |
166 | if (zram) { |
167 | ret = zram_remove(zram); |
168 | - idr_remove(&zram_index_idr, dev_id); |
169 | + if (!ret) |
170 | + idr_remove(&zram_index_idr, dev_id); |
171 | } else { |
172 | ret = -ENODEV; |
173 | } |
174 | diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c |
175 | index 4073116e6e9f..c3331d6201c3 100644 |
176 | --- a/drivers/net/wireless/mwifiex/cfg80211.c |
177 | +++ b/drivers/net/wireless/mwifiex/cfg80211.c |
178 | @@ -2144,8 +2144,9 @@ done: |
179 | is_scanning_required = 1; |
180 | } else { |
181 | mwifiex_dbg(priv->adapter, MSG, |
182 | - "info: trying to associate to '%s' bssid %pM\n", |
183 | - (char *)req_ssid.ssid, bss->bssid); |
184 | + "info: trying to associate to '%.*s' bssid %pM\n", |
185 | + req_ssid.ssid_len, (char *)req_ssid.ssid, |
186 | + bss->bssid); |
187 | memcpy(&priv->cfg_bssid, bss->bssid, ETH_ALEN); |
188 | break; |
189 | } |
190 | @@ -2202,8 +2203,8 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, |
191 | } |
192 | |
193 | mwifiex_dbg(adapter, INFO, |
194 | - "info: Trying to associate to %s and bssid %pM\n", |
195 | - (char *)sme->ssid, sme->bssid); |
196 | + "info: Trying to associate to %.*s and bssid %pM\n", |
197 | + (int)sme->ssid_len, (char *)sme->ssid, sme->bssid); |
198 | |
199 | ret = mwifiex_cfg80211_assoc(priv, sme->ssid_len, sme->ssid, sme->bssid, |
200 | priv->bss_mode, sme->channel, sme, 0); |
201 | @@ -2333,8 +2334,8 @@ mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev, |
202 | } |
203 | |
204 | mwifiex_dbg(priv->adapter, MSG, |
205 | - "info: trying to join to %s and bssid %pM\n", |
206 | - (char *)params->ssid, params->bssid); |
207 | + "info: trying to join to %.*s and bssid %pM\n", |
208 | + params->ssid_len, (char *)params->ssid, params->bssid); |
209 | |
210 | mwifiex_set_ibss_params(priv, params); |
211 | |
212 | diff --git a/drivers/pci/pcie/aer/aer_inject.c b/drivers/pci/pcie/aer/aer_inject.c |
213 | index 182224acedbe..58f1419a68ae 100644 |
214 | --- a/drivers/pci/pcie/aer/aer_inject.c |
215 | +++ b/drivers/pci/pcie/aer/aer_inject.c |
216 | @@ -283,20 +283,6 @@ out: |
217 | return 0; |
218 | } |
219 | |
220 | -static struct pci_dev *pcie_find_root_port(struct pci_dev *dev) |
221 | -{ |
222 | - while (1) { |
223 | - if (!pci_is_pcie(dev)) |
224 | - break; |
225 | - if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT) |
226 | - return dev; |
227 | - if (!dev->bus->self) |
228 | - break; |
229 | - dev = dev->bus->self; |
230 | - } |
231 | - return NULL; |
232 | -} |
233 | - |
234 | static int find_aer_device_iter(struct device *device, void *data) |
235 | { |
236 | struct pcie_device **result = data; |
237 | diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c |
238 | index 9757cf9037a2..b5843c255263 100644 |
239 | --- a/drivers/pci/probe.c |
240 | +++ b/drivers/pci/probe.c |
241 | @@ -1415,6 +1415,21 @@ static void program_hpp_type1(struct pci_dev *dev, struct hpp_type1 *hpp) |
242 | dev_warn(&dev->dev, "PCI-X settings not supported\n"); |
243 | } |
244 | |
245 | +static bool pcie_root_rcb_set(struct pci_dev *dev) |
246 | +{ |
247 | + struct pci_dev *rp = pcie_find_root_port(dev); |
248 | + u16 lnkctl; |
249 | + |
250 | + if (!rp) |
251 | + return false; |
252 | + |
253 | + pcie_capability_read_word(rp, PCI_EXP_LNKCTL, &lnkctl); |
254 | + if (lnkctl & PCI_EXP_LNKCTL_RCB) |
255 | + return true; |
256 | + |
257 | + return false; |
258 | +} |
259 | + |
260 | static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp) |
261 | { |
262 | int pos; |
263 | @@ -1444,9 +1459,20 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp) |
264 | ~hpp->pci_exp_devctl_and, hpp->pci_exp_devctl_or); |
265 | |
266 | /* Initialize Link Control Register */ |
267 | - if (pcie_cap_has_lnkctl(dev)) |
268 | + if (pcie_cap_has_lnkctl(dev)) { |
269 | + |
270 | + /* |
271 | + * If the Root Port supports Read Completion Boundary of |
272 | + * 128, set RCB to 128. Otherwise, clear it. |
273 | + */ |
274 | + hpp->pci_exp_lnkctl_and |= PCI_EXP_LNKCTL_RCB; |
275 | + hpp->pci_exp_lnkctl_or &= ~PCI_EXP_LNKCTL_RCB; |
276 | + if (pcie_root_rcb_set(dev)) |
277 | + hpp->pci_exp_lnkctl_or |= PCI_EXP_LNKCTL_RCB; |
278 | + |
279 | pcie_capability_clear_and_set_word(dev, PCI_EXP_LNKCTL, |
280 | ~hpp->pci_exp_lnkctl_and, hpp->pci_exp_lnkctl_or); |
281 | + } |
282 | |
283 | /* Find Advanced Error Reporting Enhanced Capability */ |
284 | pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); |
285 | diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c |
286 | index c20163b92991..375008e2be20 100644 |
287 | --- a/drivers/pwm/sysfs.c |
288 | +++ b/drivers/pwm/sysfs.c |
289 | @@ -366,6 +366,8 @@ void pwmchip_sysfs_unexport_children(struct pwm_chip *chip) |
290 | if (test_bit(PWMF_EXPORTED, &pwm->flags)) |
291 | pwm_unexport_child(parent, pwm); |
292 | } |
293 | + |
294 | + put_device(parent); |
295 | } |
296 | |
297 | static int __init pwm_sysfs_init(void) |
298 | diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h |
299 | index eeae401a2412..287e698c28de 100644 |
300 | --- a/include/linux/compiler-gcc.h |
301 | +++ b/include/linux/compiler-gcc.h |
302 | @@ -251,7 +251,9 @@ |
303 | #endif |
304 | #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ |
305 | |
306 | -#if GCC_VERSION >= 50000 |
307 | +#if GCC_VERSION >= 70000 |
308 | +#define KASAN_ABI_VERSION 5 |
309 | +#elif GCC_VERSION >= 50000 |
310 | #define KASAN_ABI_VERSION 4 |
311 | #elif GCC_VERSION >= 40902 |
312 | #define KASAN_ABI_VERSION 3 |
313 | diff --git a/include/linux/pci.h b/include/linux/pci.h |
314 | index e89c7ee7e803..5f37614f2451 100644 |
315 | --- a/include/linux/pci.h |
316 | +++ b/include/linux/pci.h |
317 | @@ -1802,6 +1802,20 @@ static inline int pci_pcie_type(const struct pci_dev *dev) |
318 | return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4; |
319 | } |
320 | |
321 | +static inline struct pci_dev *pcie_find_root_port(struct pci_dev *dev) |
322 | +{ |
323 | + while (1) { |
324 | + if (!pci_is_pcie(dev)) |
325 | + break; |
326 | + if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT) |
327 | + return dev; |
328 | + if (!dev->bus->self) |
329 | + break; |
330 | + dev = dev->bus->self; |
331 | + } |
332 | + return NULL; |
333 | +} |
334 | + |
335 | void pci_request_acs(void); |
336 | bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags); |
337 | bool pci_acs_path_enabled(struct pci_dev *start, |
338 | diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h |
339 | index 630c19772630..32cbe72bf545 100644 |
340 | --- a/kernel/rcu/tree_plugin.h |
341 | +++ b/kernel/rcu/tree_plugin.h |
342 | @@ -2275,6 +2275,7 @@ static int rcu_nocb_kthread(void *arg) |
343 | cl++; |
344 | c++; |
345 | local_bh_enable(); |
346 | + cond_resched_rcu_qs(); |
347 | list = next; |
348 | } |
349 | trace_rcu_batch_end(rdp->rsp->name, c, !!list, 0, 0, 1); |
350 | diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h |
351 | index 4f6c62e5c21e..37ff0ab6a8ff 100644 |
352 | --- a/mm/kasan/kasan.h |
353 | +++ b/mm/kasan/kasan.h |
354 | @@ -52,6 +52,9 @@ struct kasan_global { |
355 | #if KASAN_ABI_VERSION >= 4 |
356 | struct kasan_source_location *location; |
357 | #endif |
358 | +#if KASAN_ABI_VERSION >= 5 |
359 | + char *odr_indicator; |
360 | +#endif |
361 | }; |
362 | |
363 | static inline const void *kasan_shadow_to_mem(const void *shadow_addr) |
364 | diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c |
365 | index 3a9b66c6e09c..0aca39762ed0 100644 |
366 | --- a/sound/core/pcm_lib.c |
367 | +++ b/sound/core/pcm_lib.c |
368 | @@ -1886,8 +1886,8 @@ void snd_pcm_period_elapsed(struct snd_pcm_substream *substream) |
369 | snd_timer_interrupt(substream->timer, 1); |
370 | #endif |
371 | _end: |
372 | - snd_pcm_stream_unlock_irqrestore(substream, flags); |
373 | kill_fasync(&runtime->fasync, SIGIO, POLL_IN); |
374 | + snd_pcm_stream_unlock_irqrestore(substream, flags); |
375 | } |
376 | |
377 | EXPORT_SYMBOL(snd_pcm_period_elapsed); |