Skip to content

Commit a5ebb39

Browse files
committed
Merge remote-tracking branch 'stable/linux-4.4.y' into rpi-4.4.y
2 parents a05f2dd + e5f84c1 commit a5ebb39

File tree

18 files changed

+98
-34
lines changed

18 files changed

+98
-34
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 4
3-
SUBLEVEL = 36
3+
SUBLEVEL = 37
44
EXTRAVERSION =
55
NAME = Blurry Fish Butt
66

arch/arc/include/asm/delay.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222
static inline void __delay(unsigned long loops)
2323
{
2424
__asm__ __volatile__(
25-
" lp 1f \n"
26-
" nop \n"
27-
"1: \n"
28-
: "+l"(loops));
25+
" mov lp_count, %0 \n"
26+
" lp 1f \n"
27+
" nop \n"
28+
"1: \n"
29+
: : "r"(loops));
2930
}
3031

3132
extern void __bad_udelay(void);

arch/arm64/include/asm/cpufeature.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct arm64_cpu_capabilities {
7777
const char *desc;
7878
u16 capability;
7979
bool (*matches)(const struct arm64_cpu_capabilities *);
80-
void (*enable)(void *); /* Called on all active CPUs */
80+
int (*enable)(void *); /* Called on all active CPUs */
8181
union {
8282
struct { /* To be used for erratum handling only */
8383
u32 midr_model;

arch/arm64/include/asm/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,6 @@ static inline void spin_lock_prefetch(const void *x)
186186

187187
#endif
188188

189-
void cpu_enable_pan(void *__unused);
189+
int cpu_enable_pan(void *__unused);
190190

191191
#endif /* __ASM_PROCESSOR_H */

arch/arm64/kernel/cpufeature.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
#define pr_fmt(fmt) "CPU features: " fmt
2020

2121
#include <linux/bsearch.h>
22+
#include <linux/cpumask.h>
2223
#include <linux/sort.h>
24+
#include <linux/stop_machine.h>
2325
#include <linux/types.h>
2426
#include <asm/cpu.h>
2527
#include <asm/cpufeature.h>
@@ -764,7 +766,13 @@ static void enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps)
764766

765767
for (i = 0; caps[i].desc; i++)
766768
if (caps[i].enable && cpus_have_cap(caps[i].capability))
767-
on_each_cpu(caps[i].enable, NULL, true);
769+
/*
770+
* Use stop_machine() as it schedules the work allowing
771+
* us to modify PSTATE, instead of on_each_cpu() which
772+
* uses an IPI, giving us a PSTATE that disappears when
773+
* we return.
774+
*/
775+
stop_machine(caps[i].enable, NULL, cpu_online_mask);
768776
}
769777

770778
#ifdef CONFIG_HOTPLUG_CPU

arch/arm64/kernel/suspend.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#include <linux/ftrace.h>
22
#include <linux/percpu.h>
33
#include <linux/slab.h>
4+
#include <asm/alternative.h>
45
#include <asm/cacheflush.h>
6+
#include <asm/cpufeature.h>
57
#include <asm/debug-monitors.h>
68
#include <asm/pgtable.h>
79
#include <asm/memory.h>
@@ -110,6 +112,13 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
110112
*/
111113
set_my_cpu_offset(per_cpu_offset(smp_processor_id()));
112114

115+
/*
116+
* PSTATE was not saved over suspend/resume, re-enable any
117+
* detected features that might not have been set correctly.
118+
*/
119+
asm(ALTERNATIVE("nop", SET_PSTATE_PAN(1), ARM64_HAS_PAN,
120+
CONFIG_ARM64_PAN));
121+
113122
/*
114123
* Restore HW breakpoint registers to sane values
115124
* before debug exceptions are possibly reenabled

arch/arm64/mm/fault.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
#include <linux/sched.h>
3030
#include <linux/highmem.h>
3131
#include <linux/perf_event.h>
32+
#include <linux/preempt.h>
3233

34+
#include <asm/bug.h>
3335
#include <asm/cpufeature.h>
3436
#include <asm/exception.h>
3537
#include <asm/debug-monitors.h>
@@ -606,8 +608,16 @@ asmlinkage int __exception do_debug_exception(unsigned long addr,
606608
}
607609

608610
#ifdef CONFIG_ARM64_PAN
609-
void cpu_enable_pan(void *__unused)
611+
int cpu_enable_pan(void *__unused)
610612
{
613+
/*
614+
* We modify PSTATE. This won't work from irq context as the PSTATE
615+
* is discarded once we return from the exception.
616+
*/
617+
WARN_ON_ONCE(in_interrupt());
618+
611619
config_sctlr_el1(SCTLR_EL1_SPAN, 0);
620+
asm(SET_PSTATE_PAN(1));
621+
return 0;
612622
}
613623
#endif /* CONFIG_ARM64_PAN */

arch/x86/kernel/head_32.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ early_idt_handler_common:
571571
movl %eax,%ds
572572
movl %eax,%es
573573

574-
cmpl $(__KERNEL_CS),32(%esp)
574+
cmpw $(__KERNEL_CS),32(%esp)
575575
jne 10f
576576

577577
leal 28(%esp),%eax # Pointer to %eip

drivers/block/zram/zram_drv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,8 @@ static ssize_t hot_remove_store(struct class *class,
13681368
zram = idr_find(&zram_index_idr, dev_id);
13691369
if (zram) {
13701370
ret = zram_remove(zram);
1371-
idr_remove(&zram_index_idr, dev_id);
1371+
if (!ret)
1372+
idr_remove(&zram_index_idr, dev_id);
13721373
} else {
13731374
ret = -ENODEV;
13741375
}

drivers/net/wireless/mwifiex/cfg80211.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,8 +2144,9 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len,
21442144
is_scanning_required = 1;
21452145
} else {
21462146
mwifiex_dbg(priv->adapter, MSG,
2147-
"info: trying to associate to '%s' bssid %pM\n",
2148-
(char *)req_ssid.ssid, bss->bssid);
2147+
"info: trying to associate to '%.*s' bssid %pM\n",
2148+
req_ssid.ssid_len, (char *)req_ssid.ssid,
2149+
bss->bssid);
21492150
memcpy(&priv->cfg_bssid, bss->bssid, ETH_ALEN);
21502151
break;
21512152
}
@@ -2202,8 +2203,8 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
22022203
}
22032204

22042205
mwifiex_dbg(adapter, INFO,
2205-
"info: Trying to associate to %s and bssid %pM\n",
2206-
(char *)sme->ssid, sme->bssid);
2206+
"info: Trying to associate to %.*s and bssid %pM\n",
2207+
(int)sme->ssid_len, (char *)sme->ssid, sme->bssid);
22072208

22082209
ret = mwifiex_cfg80211_assoc(priv, sme->ssid_len, sme->ssid, sme->bssid,
22092210
priv->bss_mode, sme->channel, sme, 0);
@@ -2333,8 +2334,8 @@ mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
23332334
}
23342335

23352336
mwifiex_dbg(priv->adapter, MSG,
2336-
"info: trying to join to %s and bssid %pM\n",
2337-
(char *)params->ssid, params->bssid);
2337+
"info: trying to join to %.*s and bssid %pM\n",
2338+
params->ssid_len, (char *)params->ssid, params->bssid);
23382339

23392340
mwifiex_set_ibss_params(priv, params);
23402341

0 commit comments

Comments
 (0)