Merge remote-tracking branch 'stable/linux-4.4.y' into rpi-4.4.y

This commit is contained in:
popcornmix
2016-12-09 12:19:04 +00:00
18 changed files with 98 additions and 34 deletions

View File

@@ -1,6 +1,6 @@
VERSION = 4 VERSION = 4
PATCHLEVEL = 4 PATCHLEVEL = 4
SUBLEVEL = 36 SUBLEVEL = 37
EXTRAVERSION = EXTRAVERSION =
NAME = Blurry Fish Butt NAME = Blurry Fish Butt

View File

@@ -22,10 +22,11 @@
static inline void __delay(unsigned long loops) static inline void __delay(unsigned long loops)
{ {
__asm__ __volatile__( __asm__ __volatile__(
" lp 1f \n" " mov lp_count, %0 \n"
" nop \n" " lp 1f \n"
"1: \n" " nop \n"
: "+l"(loops)); "1: \n"
: : "r"(loops));
} }
extern void __bad_udelay(void); extern void __bad_udelay(void);

View File

@@ -77,7 +77,7 @@ struct arm64_cpu_capabilities {
const char *desc; const char *desc;
u16 capability; u16 capability;
bool (*matches)(const struct arm64_cpu_capabilities *); bool (*matches)(const struct arm64_cpu_capabilities *);
void (*enable)(void *); /* Called on all active CPUs */ int (*enable)(void *); /* Called on all active CPUs */
union { union {
struct { /* To be used for erratum handling only */ struct { /* To be used for erratum handling only */
u32 midr_model; u32 midr_model;

View File

@@ -186,6 +186,6 @@ static inline void spin_lock_prefetch(const void *x)
#endif #endif
void cpu_enable_pan(void *__unused); int cpu_enable_pan(void *__unused);
#endif /* __ASM_PROCESSOR_H */ #endif /* __ASM_PROCESSOR_H */

View File

@@ -19,7 +19,9 @@
#define pr_fmt(fmt) "CPU features: " fmt #define pr_fmt(fmt) "CPU features: " fmt
#include <linux/bsearch.h> #include <linux/bsearch.h>
#include <linux/cpumask.h>
#include <linux/sort.h> #include <linux/sort.h>
#include <linux/stop_machine.h>
#include <linux/types.h> #include <linux/types.h>
#include <asm/cpu.h> #include <asm/cpu.h>
#include <asm/cpufeature.h> #include <asm/cpufeature.h>
@@ -764,7 +766,13 @@ static void enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps)
for (i = 0; caps[i].desc; i++) for (i = 0; caps[i].desc; i++)
if (caps[i].enable && cpus_have_cap(caps[i].capability)) if (caps[i].enable && cpus_have_cap(caps[i].capability))
on_each_cpu(caps[i].enable, NULL, true); /*
* Use stop_machine() as it schedules the work allowing
* us to modify PSTATE, instead of on_each_cpu() which
* uses an IPI, giving us a PSTATE that disappears when
* we return.
*/
stop_machine(caps[i].enable, NULL, cpu_online_mask);
} }
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU

View File

@@ -1,7 +1,9 @@
#include <linux/ftrace.h> #include <linux/ftrace.h>
#include <linux/percpu.h> #include <linux/percpu.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <asm/alternative.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/cpufeature.h>
#include <asm/debug-monitors.h> #include <asm/debug-monitors.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/memory.h> #include <asm/memory.h>
@@ -110,6 +112,13 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
*/ */
set_my_cpu_offset(per_cpu_offset(smp_processor_id())); set_my_cpu_offset(per_cpu_offset(smp_processor_id()));
/*
* PSTATE was not saved over suspend/resume, re-enable any
* detected features that might not have been set correctly.
*/
asm(ALTERNATIVE("nop", SET_PSTATE_PAN(1), ARM64_HAS_PAN,
CONFIG_ARM64_PAN));
/* /*
* Restore HW breakpoint registers to sane values * Restore HW breakpoint registers to sane values
* before debug exceptions are possibly reenabled * before debug exceptions are possibly reenabled

View File

@@ -29,7 +29,9 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/perf_event.h> #include <linux/perf_event.h>
#include <linux/preempt.h>
#include <asm/bug.h>
#include <asm/cpufeature.h> #include <asm/cpufeature.h>
#include <asm/exception.h> #include <asm/exception.h>
#include <asm/debug-monitors.h> #include <asm/debug-monitors.h>
@@ -606,8 +608,16 @@ asmlinkage int __exception do_debug_exception(unsigned long addr,
} }
#ifdef CONFIG_ARM64_PAN #ifdef CONFIG_ARM64_PAN
void cpu_enable_pan(void *__unused) int cpu_enable_pan(void *__unused)
{ {
/*
* We modify PSTATE. This won't work from irq context as the PSTATE
* is discarded once we return from the exception.
*/
WARN_ON_ONCE(in_interrupt());
config_sctlr_el1(SCTLR_EL1_SPAN, 0); config_sctlr_el1(SCTLR_EL1_SPAN, 0);
asm(SET_PSTATE_PAN(1));
return 0;
} }
#endif /* CONFIG_ARM64_PAN */ #endif /* CONFIG_ARM64_PAN */

View File

@@ -571,7 +571,7 @@ early_idt_handler_common:
movl %eax,%ds movl %eax,%ds
movl %eax,%es movl %eax,%es
cmpl $(__KERNEL_CS),32(%esp) cmpw $(__KERNEL_CS),32(%esp)
jne 10f jne 10f
leal 28(%esp),%eax # Pointer to %eip leal 28(%esp),%eax # Pointer to %eip

View File

@@ -1368,7 +1368,8 @@ static ssize_t hot_remove_store(struct class *class,
zram = idr_find(&zram_index_idr, dev_id); zram = idr_find(&zram_index_idr, dev_id);
if (zram) { if (zram) {
ret = zram_remove(zram); ret = zram_remove(zram);
idr_remove(&zram_index_idr, dev_id); if (!ret)
idr_remove(&zram_index_idr, dev_id);
} else { } else {
ret = -ENODEV; ret = -ENODEV;
} }

View File

@@ -2144,8 +2144,9 @@ done:
is_scanning_required = 1; is_scanning_required = 1;
} else { } else {
mwifiex_dbg(priv->adapter, MSG, mwifiex_dbg(priv->adapter, MSG,
"info: trying to associate to '%s' bssid %pM\n", "info: trying to associate to '%.*s' bssid %pM\n",
(char *)req_ssid.ssid, bss->bssid); req_ssid.ssid_len, (char *)req_ssid.ssid,
bss->bssid);
memcpy(&priv->cfg_bssid, bss->bssid, ETH_ALEN); memcpy(&priv->cfg_bssid, bss->bssid, ETH_ALEN);
break; break;
} }
@@ -2202,8 +2203,8 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
} }
mwifiex_dbg(adapter, INFO, mwifiex_dbg(adapter, INFO,
"info: Trying to associate to %s and bssid %pM\n", "info: Trying to associate to %.*s and bssid %pM\n",
(char *)sme->ssid, sme->bssid); (int)sme->ssid_len, (char *)sme->ssid, sme->bssid);
ret = mwifiex_cfg80211_assoc(priv, sme->ssid_len, sme->ssid, sme->bssid, ret = mwifiex_cfg80211_assoc(priv, sme->ssid_len, sme->ssid, sme->bssid,
priv->bss_mode, sme->channel, sme, 0); priv->bss_mode, sme->channel, sme, 0);
@@ -2333,8 +2334,8 @@ mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
} }
mwifiex_dbg(priv->adapter, MSG, mwifiex_dbg(priv->adapter, MSG,
"info: trying to join to %s and bssid %pM\n", "info: trying to join to %.*s and bssid %pM\n",
(char *)params->ssid, params->bssid); params->ssid_len, (char *)params->ssid, params->bssid);
mwifiex_set_ibss_params(priv, params); mwifiex_set_ibss_params(priv, params);

View File

@@ -283,20 +283,6 @@ out:
return 0; return 0;
} }
static struct pci_dev *pcie_find_root_port(struct pci_dev *dev)
{
while (1) {
if (!pci_is_pcie(dev))
break;
if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)
return dev;
if (!dev->bus->self)
break;
dev = dev->bus->self;
}
return NULL;
}
static int find_aer_device_iter(struct device *device, void *data) static int find_aer_device_iter(struct device *device, void *data)
{ {
struct pcie_device **result = data; struct pcie_device **result = data;

View File

@@ -1415,6 +1415,21 @@ static void program_hpp_type1(struct pci_dev *dev, struct hpp_type1 *hpp)
dev_warn(&dev->dev, "PCI-X settings not supported\n"); dev_warn(&dev->dev, "PCI-X settings not supported\n");
} }
static bool pcie_root_rcb_set(struct pci_dev *dev)
{
struct pci_dev *rp = pcie_find_root_port(dev);
u16 lnkctl;
if (!rp)
return false;
pcie_capability_read_word(rp, PCI_EXP_LNKCTL, &lnkctl);
if (lnkctl & PCI_EXP_LNKCTL_RCB)
return true;
return false;
}
static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp) static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
{ {
int pos; int pos;
@@ -1444,9 +1459,20 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
~hpp->pci_exp_devctl_and, hpp->pci_exp_devctl_or); ~hpp->pci_exp_devctl_and, hpp->pci_exp_devctl_or);
/* Initialize Link Control Register */ /* Initialize Link Control Register */
if (pcie_cap_has_lnkctl(dev)) if (pcie_cap_has_lnkctl(dev)) {
/*
* If the Root Port supports Read Completion Boundary of
* 128, set RCB to 128. Otherwise, clear it.
*/
hpp->pci_exp_lnkctl_and |= PCI_EXP_LNKCTL_RCB;
hpp->pci_exp_lnkctl_or &= ~PCI_EXP_LNKCTL_RCB;
if (pcie_root_rcb_set(dev))
hpp->pci_exp_lnkctl_or |= PCI_EXP_LNKCTL_RCB;
pcie_capability_clear_and_set_word(dev, PCI_EXP_LNKCTL, pcie_capability_clear_and_set_word(dev, PCI_EXP_LNKCTL,
~hpp->pci_exp_lnkctl_and, hpp->pci_exp_lnkctl_or); ~hpp->pci_exp_lnkctl_and, hpp->pci_exp_lnkctl_or);
}
/* Find Advanced Error Reporting Enhanced Capability */ /* Find Advanced Error Reporting Enhanced Capability */
pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);

View File

@@ -366,6 +366,8 @@ void pwmchip_sysfs_unexport_children(struct pwm_chip *chip)
if (test_bit(PWMF_EXPORTED, &pwm->flags)) if (test_bit(PWMF_EXPORTED, &pwm->flags))
pwm_unexport_child(parent, pwm); pwm_unexport_child(parent, pwm);
} }
put_device(parent);
} }
static int __init pwm_sysfs_init(void) static int __init pwm_sysfs_init(void)

View File

@@ -251,7 +251,9 @@
#endif #endif
#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
#if GCC_VERSION >= 50000 #if GCC_VERSION >= 70000
#define KASAN_ABI_VERSION 5
#elif GCC_VERSION >= 50000
#define KASAN_ABI_VERSION 4 #define KASAN_ABI_VERSION 4
#elif GCC_VERSION >= 40902 #elif GCC_VERSION >= 40902
#define KASAN_ABI_VERSION 3 #define KASAN_ABI_VERSION 3

View File

@@ -1802,6 +1802,20 @@ static inline int pci_pcie_type(const struct pci_dev *dev)
return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4; return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4;
} }
static inline struct pci_dev *pcie_find_root_port(struct pci_dev *dev)
{
while (1) {
if (!pci_is_pcie(dev))
break;
if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)
return dev;
if (!dev->bus->self)
break;
dev = dev->bus->self;
}
return NULL;
}
void pci_request_acs(void); void pci_request_acs(void);
bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags); bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags);
bool pci_acs_path_enabled(struct pci_dev *start, bool pci_acs_path_enabled(struct pci_dev *start,

View File

@@ -2275,6 +2275,7 @@ static int rcu_nocb_kthread(void *arg)
cl++; cl++;
c++; c++;
local_bh_enable(); local_bh_enable();
cond_resched_rcu_qs();
list = next; list = next;
} }
trace_rcu_batch_end(rdp->rsp->name, c, !!list, 0, 0, 1); trace_rcu_batch_end(rdp->rsp->name, c, !!list, 0, 0, 1);

View File

@@ -52,6 +52,9 @@ struct kasan_global {
#if KASAN_ABI_VERSION >= 4 #if KASAN_ABI_VERSION >= 4
struct kasan_source_location *location; struct kasan_source_location *location;
#endif #endif
#if KASAN_ABI_VERSION >= 5
char *odr_indicator;
#endif
}; };
static inline const void *kasan_shadow_to_mem(const void *shadow_addr) static inline const void *kasan_shadow_to_mem(const void *shadow_addr)

View File

@@ -1886,8 +1886,8 @@ void snd_pcm_period_elapsed(struct snd_pcm_substream *substream)
snd_timer_interrupt(substream->timer, 1); snd_timer_interrupt(substream->timer, 1);
#endif #endif
_end: _end:
snd_pcm_stream_unlock_irqrestore(substream, flags);
kill_fasync(&runtime->fasync, SIGIO, POLL_IN); kill_fasync(&runtime->fasync, SIGIO, POLL_IN);
snd_pcm_stream_unlock_irqrestore(substream, flags);
} }
EXPORT_SYMBOL(snd_pcm_period_elapsed); EXPORT_SYMBOL(snd_pcm_period_elapsed);