Skip to content

Commit

Permalink
Merge tag 'v5.4.60' into 5.4.x+fslc
Browse files Browse the repository at this point in the history
This is the 5.4.60 stable release

Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
  • Loading branch information
zandrey committed Aug 23, 2020
2 parents 62ac342 + 77fcb48 commit d694e02
Show file tree
Hide file tree
Showing 152 changed files with 1,103 additions and 629 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ controller state. The mux controller state is described in

Example:
mux: mux-controller {
compatible = "mux-gpio";
compatible = "gpio-mux";
#mux-control-cells = <0>;

mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 4
SUBLEVEL = 59
SUBLEVEL = 60
EXTRAVERSION =
NAME = Kleptomaniac Octopus

Expand Down
6 changes: 6 additions & 0 deletions arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
model = "Globalscale Marvell ESPRESSOBin Board";
compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710";

aliases {
ethernet0 = &eth0;
serial0 = &uart0;
serial1 = &uart1;
};

chosen {
stdout-path = "serial0:115200n8";
};
Expand Down
13 changes: 8 additions & 5 deletions arch/arm64/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ armv8pmu_events_sysfs_show(struct device *dev,

pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr);

return sprintf(page, "event=0x%03llx\n", pmu_attr->id);
return sprintf(page, "event=0x%04llx\n", pmu_attr->id);
}

#define ARMV8_EVENT_ATTR(name, config) \
Expand Down Expand Up @@ -303,10 +303,13 @@ armv8pmu_event_attr_is_visible(struct kobject *kobj,
test_bit(pmu_attr->id, cpu_pmu->pmceid_bitmap))
return attr->mode;

pmu_attr->id -= ARMV8_PMUV3_EXT_COMMON_EVENT_BASE;
if (pmu_attr->id < ARMV8_PMUV3_MAX_COMMON_EVENTS &&
test_bit(pmu_attr->id, cpu_pmu->pmceid_ext_bitmap))
return attr->mode;
if (pmu_attr->id >= ARMV8_PMUV3_EXT_COMMON_EVENT_BASE) {
u64 id = pmu_attr->id - ARMV8_PMUV3_EXT_COMMON_EVENT_BASE;

if (id < ARMV8_PMUV3_MAX_COMMON_EVENTS &&
test_bit(id, cpu_pmu->pmceid_ext_bitmap))
return attr->mode;
}

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/boot/dts/ingenic/qi_lb60.dts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"Speaker", "OUTL",
"Speaker", "OUTR",
"INL", "LOUT",
"INL", "ROUT";
"INR", "ROUT";

simple-audio-card,aux-devs = <&amp>;

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static int __init topology_init(void)
for_each_present_cpu(i) {
struct cpu *c = &per_cpu(cpu_devices, i);

c->hotpluggable = 1;
c->hotpluggable = !!i;
ret = register_cpu(c, i);
if (ret)
printk(KERN_WARNING "topology_init: register_cpu %d "
Expand Down
18 changes: 16 additions & 2 deletions arch/openrisc/kernel/stacktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/export.h>
#include <linux/sched.h>
#include <linux/sched/debug.h>
#include <linux/sched/task_stack.h>
#include <linux/stacktrace.h>

#include <asm/processor.h>
Expand Down Expand Up @@ -68,12 +69,25 @@ void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
{
unsigned long *sp = NULL;

if (!try_get_task_stack(tsk))
return;

if (tsk == current)
sp = (unsigned long *) &sp;
else
sp = (unsigned long *) KSTK_ESP(tsk);
else {
unsigned long ksp;

/* Locate stack from kernel context */
ksp = task_thread_info(tsk)->ksp;
ksp += STACK_FRAME_OVERHEAD; /* redzone */
ksp += sizeof(struct pt_regs);

sp = (unsigned long *) ksp;
}

unwind_stack(trace, sp, save_stack_address_nosched);

put_task_stack(tsk);
}
EXPORT_SYMBOL_GPL(save_stack_trace_tsk);

Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/include/asm/percpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

#ifdef CONFIG_SMP

#include <asm/paca.h>

#define __my_cpu_offset local_paca->data_offset

#endif /* CONFIG_SMP */
#endif /* __powerpc64__ */

#include <asm-generic/percpu.h>

#include <asm/paca.h>

#endif /* _ASM_POWERPC_PERCPU_H_ */
7 changes: 5 additions & 2 deletions arch/powerpc/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,17 @@ static bool bad_kernel_fault(struct pt_regs *regs, unsigned long error_code,
return false;
}

// This comes from 64-bit struct rt_sigframe + __SIGNAL_FRAMESIZE
#define SIGFRAME_MAX_SIZE (4096 + 128)

static bool bad_stack_expansion(struct pt_regs *regs, unsigned long address,
struct vm_area_struct *vma, unsigned int flags,
bool *must_retry)
{
/*
* N.B. The POWER/Open ABI allows programs to access up to
* 288 bytes below the stack pointer.
* The kernel signal delivery code writes up to about 1.5kB
* The kernel signal delivery code writes a bit over 4KB
* below the stack pointer (r1) before decrementing it.
* The exec code can write slightly over 640kB to the stack
* before setting the user r1. Thus we allow the stack to
Expand All @@ -273,7 +276,7 @@ static bool bad_stack_expansion(struct pt_regs *regs, unsigned long address,
* between the last mapped region and the stack will
* expand the stack rather than segfaulting.
*/
if (address + 2048 >= uregs->gpr[1])
if (address + SIGFRAME_MAX_SIZE >= uregs->gpr[1])
return false;

if ((flags & FAULT_FLAG_WRITE) && (flags & FAULT_FLAG_USER) &&
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/mm/ptdump/hashpagetable.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ static int pseries_find(unsigned long ea, int psize, bool primary, u64 *v, u64 *
for (i = 0; i < HPTES_PER_GROUP; i += 4, hpte_group += 4) {
lpar_rc = plpar_pte_read_4(0, hpte_group, (void *)ptes);

if (lpar_rc != H_SUCCESS)
if (lpar_rc)
continue;
for (j = 0; j < 4; j++) {
if (HPTE_V_COMPARE(ptes[j].v, want_v) &&
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/pseries/hotplug-memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static bool rtas_hp_event;
unsigned long pseries_memory_block_size(void)
{
struct device_node *np;
unsigned int memblock_size = MIN_MEMORY_BLOCK_SIZE;
u64 memblock_size = MIN_MEMORY_BLOCK_SIZE;
struct resource r;

np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
Expand Down
3 changes: 3 additions & 0 deletions arch/sh/boards/mach-landisk/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ device_initcall(landisk_devices_setup);

static void __init landisk_setup(char **cmdline_p)
{
/* I/O port identity mapping */
__set_io_port_base(0);

/* LED ON */
__raw_writeb(__raw_readb(PA_LED) | 0x03, PA_LED);

Expand Down
2 changes: 1 addition & 1 deletion arch/x86/events/rapl.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ static const struct attribute_group *rapl_attr_update[] = {
&rapl_events_pkg_group,
&rapl_events_ram_group,
&rapl_events_gpu_group,
&rapl_events_gpu_group,
&rapl_events_psys_group,
NULL,
};

Expand Down
4 changes: 4 additions & 0 deletions arch/x86/kernel/apic/vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,10 @@ static int x86_vector_alloc_irqs(struct irq_domain *domain, unsigned int virq,
irqd->chip_data = apicd;
irqd->hwirq = virq + i;
irqd_set_single_target(irqd);

/* Don't invoke affinity setter on deactivated interrupts */
irqd_set_affinity_on_activate(irqd);

/*
* Legacy vectors are already assigned when the IOAPIC
* takes them over. They stay on the same vector. This is
Expand Down
9 changes: 7 additions & 2 deletions arch/x86/kernel/tsc_msr.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,15 @@ static const struct freq_desc freq_desc_ann = {
.mask = 0x0f,
};

/* 24 MHz crystal? : 24 * 13 / 4 = 78 MHz */
/*
* 24 MHz crystal? : 24 * 13 / 4 = 78 MHz
* Frequency step for Lightning Mountain SoC is fixed to 78 MHz,
* so all the frequency entries are 78000.
*/
static const struct freq_desc freq_desc_lgm = {
.use_msr_plat = true,
.freqs = { 78000, 78000, 78000, 78000, 78000, 78000, 78000, 78000 },
.freqs = { 78000, 78000, 78000, 78000, 78000, 78000, 78000, 78000,
78000, 78000, 78000, 78000, 78000, 78000, 78000, 78000 },
.mask = 0x0f,
};

Expand Down
4 changes: 4 additions & 0 deletions arch/xtensa/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ struct thread_info {
mm_segment_t addr_limit; /* thread address space */

unsigned long cpenable;
#if XCHAL_HAVE_EXCLUSIVE
/* result of the most recent exclusive store */
unsigned long atomctl8;
#endif

/* Allocate storage for extra user states and coprocessor states. */
#if XTENSA_HAVE_COPROCESSORS
Expand Down
3 changes: 3 additions & 0 deletions arch/xtensa/kernel/asm-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ int main(void)
DEFINE(THREAD_RA, offsetof (struct task_struct, thread.ra));
DEFINE(THREAD_SP, offsetof (struct task_struct, thread.sp));
DEFINE(THREAD_CPENABLE, offsetof (struct thread_info, cpenable));
#if XCHAL_HAVE_EXCLUSIVE
DEFINE(THREAD_ATOMCTL8, offsetof (struct thread_info, atomctl8));
#endif
#if XTENSA_HAVE_COPROCESSORS
DEFINE(THREAD_XTREGS_CP0, offsetof(struct thread_info, xtregs_cp.cp0));
DEFINE(THREAD_XTREGS_CP1, offsetof(struct thread_info, xtregs_cp.cp1));
Expand Down
11 changes: 11 additions & 0 deletions arch/xtensa/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,11 @@ common_exception:
s32i a2, a1, PT_LCOUNT
#endif

#if XCHAL_HAVE_EXCLUSIVE
/* Clear exclusive access monitor set by interrupted code */
clrex
#endif

/* It is now save to restore the EXC_TABLE_FIXUP variable. */

rsr a2, exccause
Expand Down Expand Up @@ -2024,6 +2029,12 @@ ENTRY(_switch_to)
s32i a3, a4, THREAD_CPENABLE
#endif

#if XCHAL_HAVE_EXCLUSIVE
l32i a3, a5, THREAD_ATOMCTL8
getex a3
s32i a3, a4, THREAD_ATOMCTL8
#endif

/* Flush register file. */

spill_registers_kernel
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ static struct pmu xtensa_pmu = {
.read = xtensa_pmu_read,
};

static int xtensa_pmu_setup(int cpu)
static int xtensa_pmu_setup(unsigned int cpu)
{
unsigned i;

Expand Down
11 changes: 8 additions & 3 deletions crypto/af_alg.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ void af_alg_pull_tsgl(struct sock *sk, size_t used, struct scatterlist *dst,

if (!ctx->used)
ctx->merge = 0;
ctx->init = ctx->more;
}
EXPORT_SYMBOL_GPL(af_alg_pull_tsgl);

Expand Down Expand Up @@ -734,9 +735,10 @@ EXPORT_SYMBOL_GPL(af_alg_wmem_wakeup);
*
* @sk socket of connection to user space
* @flags If MSG_DONTWAIT is set, then only report if function would sleep
* @min Set to minimum request size if partial requests are allowed.
* @return 0 when writable memory is available, < 0 upon error
*/
int af_alg_wait_for_data(struct sock *sk, unsigned flags)
int af_alg_wait_for_data(struct sock *sk, unsigned flags, unsigned min)
{
DEFINE_WAIT_FUNC(wait, woken_wake_function);
struct alg_sock *ask = alg_sk(sk);
Expand All @@ -754,7 +756,9 @@ int af_alg_wait_for_data(struct sock *sk, unsigned flags)
if (signal_pending(current))
break;
timeout = MAX_SCHEDULE_TIMEOUT;
if (sk_wait_event(sk, &timeout, (ctx->used || !ctx->more),
if (sk_wait_event(sk, &timeout,
ctx->init && (!ctx->more ||
(min && ctx->used >= min)),
&wait)) {
err = 0;
break;
Expand Down Expand Up @@ -843,10 +847,11 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,
}

lock_sock(sk);
if (!ctx->more && ctx->used) {
if (ctx->init && (init || !ctx->more)) {
err = -EINVAL;
goto unlock;
}
ctx->init = true;

if (init) {
ctx->enc = enc;
Expand Down
10 changes: 2 additions & 8 deletions crypto/algif_aead.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ static int _aead_recvmsg(struct socket *sock, struct msghdr *msg,
size_t usedpages = 0; /* [in] RX bufs to be used from user */
size_t processed = 0; /* [in] TX bufs to be consumed */

if (!ctx->used) {
err = af_alg_wait_for_data(sk, flags);
if (!ctx->init || ctx->more) {
err = af_alg_wait_for_data(sk, flags, 0);
if (err)
return err;
}
Expand Down Expand Up @@ -558,12 +558,6 @@ static int aead_accept_parent_nokey(void *private, struct sock *sk)

INIT_LIST_HEAD(&ctx->tsgl_list);
ctx->len = len;
ctx->used = 0;
atomic_set(&ctx->rcvused, 0);
ctx->more = 0;
ctx->merge = 0;
ctx->enc = 0;
ctx->aead_assoclen = 0;
crypto_init_wait(&ctx->wait);

ask->private = ctx;
Expand Down
11 changes: 3 additions & 8 deletions crypto/algif_skcipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ static int _skcipher_recvmsg(struct socket *sock, struct msghdr *msg,
int err = 0;
size_t len = 0;

if (!ctx->used) {
err = af_alg_wait_for_data(sk, flags);
if (!ctx->init || (ctx->more && ctx->used < bs)) {
err = af_alg_wait_for_data(sk, flags, bs);
if (err)
return err;
}
Expand Down Expand Up @@ -333,23 +333,18 @@ static int skcipher_accept_parent_nokey(void *private, struct sock *sk)
ctx = sock_kmalloc(sk, len, GFP_KERNEL);
if (!ctx)
return -ENOMEM;
memset(ctx, 0, len);

ctx->iv = sock_kmalloc(sk, crypto_skcipher_ivsize(tfm),
GFP_KERNEL);
if (!ctx->iv) {
sock_kfree_s(sk, ctx, len);
return -ENOMEM;
}

memset(ctx->iv, 0, crypto_skcipher_ivsize(tfm));

INIT_LIST_HEAD(&ctx->tsgl_list);
ctx->len = len;
ctx->used = 0;
atomic_set(&ctx->rcvused, 0);
ctx->more = 0;
ctx->merge = 0;
ctx->enc = 0;
crypto_init_wait(&ctx->wait);

ask->private = ctx;
Expand Down
4 changes: 3 additions & 1 deletion drivers/base/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,9 @@ static int __device_attach(struct device *dev, bool allow_async)
int ret = 0;

device_lock(dev);
if (dev->driver) {
if (dev->p->dead) {
goto out_unlock;
} else if (dev->driver) {
if (device_is_bound(dev)) {
ret = 1;
goto out_unlock;
Expand Down
Loading

0 comments on commit d694e02

Please sign in to comment.