diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/arm/Kconfig linux-libre-5.4.12-gnu/arch/arm/Kconfig
--- linux-libre-5.4.11-gnu/arch/arm/Kconfig	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/arm/Kconfig	2020-01-14 14:08:40.000000000 -0500
@@ -73,6 +73,7 @@ config ARM
 	select HAVE_ARM_SMCCC if CPU_V7
 	select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32
 	select HAVE_CONTEXT_TRACKING
+	select HAVE_COPY_THREAD_TLS
 	select HAVE_C_RECORDMCOUNT
 	select HAVE_DEBUG_KMEMLEAK
 	select HAVE_DMA_CONTIGUOUS if MMU
diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/arm/kernel/process.c linux-libre-5.4.12-gnu/arch/arm/kernel/process.c
--- linux-libre-5.4.11-gnu/arch/arm/kernel/process.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/arm/kernel/process.c	2020-01-14 14:08:40.000000000 -0500
@@ -224,8 +224,8 @@ void release_thread(struct task_struct *
 asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
 
 int
-copy_thread(unsigned long clone_flags, unsigned long stack_start,
-	    unsigned long stk_sz, struct task_struct *p)
+copy_thread_tls(unsigned long clone_flags, unsigned long stack_start,
+	    unsigned long stk_sz, struct task_struct *p, unsigned long tls)
 {
 	struct thread_info *thread = task_thread_info(p);
 	struct pt_regs *childregs = task_pt_regs(p);
@@ -259,7 +259,7 @@ copy_thread(unsigned long clone_flags, u
 	clear_ptrace_hw_breakpoint(p);
 
 	if (clone_flags & CLONE_SETTLS)
-		thread->tp_value[0] = childregs->ARM_r3;
+		thread->tp_value[0] = tls;
 	thread->tp_value[1] = get_tpuser();
 
 	thread_notify(THREAD_NOTIFY_COPY, thread);
diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/arm64/include/asm/unistd.h linux-libre-5.4.12-gnu/arch/arm64/include/asm/unistd.h
--- linux-libre-5.4.11-gnu/arch/arm64/include/asm/unistd.h	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/arm64/include/asm/unistd.h	2020-01-14 14:08:40.000000000 -0500
@@ -42,7 +42,6 @@
 #endif
 
 #define __ARCH_WANT_SYS_CLONE
-#define __ARCH_WANT_SYS_CLONE3
 
 #ifndef __COMPAT_SYSCALL_NR
 #include <uapi/asm/unistd.h>
diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/arm64/include/uapi/asm/unistd.h linux-libre-5.4.12-gnu/arch/arm64/include/uapi/asm/unistd.h
--- linux-libre-5.4.11-gnu/arch/arm64/include/uapi/asm/unistd.h	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/arm64/include/uapi/asm/unistd.h	2020-01-14 14:08:40.000000000 -0500
@@ -19,5 +19,6 @@
 #define __ARCH_WANT_NEW_STAT
 #define __ARCH_WANT_SET_GET_RLIMIT
 #define __ARCH_WANT_TIME32_SYSCALLS
+#define __ARCH_WANT_SYS_CLONE3
 
 #include <asm-generic/unistd.h>
diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/arm64/Kconfig linux-libre-5.4.12-gnu/arch/arm64/Kconfig
--- linux-libre-5.4.11-gnu/arch/arm64/Kconfig	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/arm64/Kconfig	2020-01-14 14:08:40.000000000 -0500
@@ -139,6 +139,7 @@ config ARM64
 	select HAVE_CMPXCHG_DOUBLE
 	select HAVE_CMPXCHG_LOCAL
 	select HAVE_CONTEXT_TRACKING
+	select HAVE_COPY_THREAD_TLS
 	select HAVE_DEBUG_BUGVERBOSE
 	select HAVE_DEBUG_KMEMLEAK
 	select HAVE_DMA_CONTIGUOUS
diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/arm64/kernel/process.c linux-libre-5.4.12-gnu/arch/arm64/kernel/process.c
--- linux-libre-5.4.11-gnu/arch/arm64/kernel/process.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/arm64/kernel/process.c	2020-01-14 14:08:40.000000000 -0500
@@ -360,8 +360,8 @@ int arch_dup_task_struct(struct task_str
 
 asmlinkage void ret_from_fork(void) asm("ret_from_fork");
 
-int copy_thread(unsigned long clone_flags, unsigned long stack_start,
-		unsigned long stk_sz, struct task_struct *p)
+int copy_thread_tls(unsigned long clone_flags, unsigned long stack_start,
+		unsigned long stk_sz, struct task_struct *p, unsigned long tls)
 {
 	struct pt_regs *childregs = task_pt_regs(p);
 
@@ -394,11 +394,11 @@ int copy_thread(unsigned long clone_flag
 		}
 
 		/*
-		 * If a TLS pointer was passed to clone (4th argument), use it
-		 * for the new thread.
+		 * If a TLS pointer was passed to clone, use it for the new
+		 * thread.
 		 */
 		if (clone_flags & CLONE_SETTLS)
-			p->thread.uw.tp_value = childregs->regs[3];
+			p->thread.uw.tp_value = tls;
 	} else {
 		memset(childregs, 0, sizeof(struct pt_regs));
 		childregs->pstate = PSR_MODE_EL1h;
diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/parisc/Kconfig linux-libre-5.4.12-gnu/arch/parisc/Kconfig
--- linux-libre-5.4.11-gnu/arch/parisc/Kconfig	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/parisc/Kconfig	2020-01-14 14:08:40.000000000 -0500
@@ -62,6 +62,7 @@ config PARISC
 	select HAVE_FTRACE_MCOUNT_RECORD if HAVE_DYNAMIC_FTRACE
 	select HAVE_KPROBES_ON_FTRACE
 	select HAVE_DYNAMIC_FTRACE_WITH_REGS
+	select HAVE_COPY_THREAD_TLS
 
 	help
 	  The PA-RISC microprocessor is designed by Hewlett-Packard and used
diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/parisc/kernel/process.c linux-libre-5.4.12-gnu/arch/parisc/kernel/process.c
--- linux-libre-5.4.11-gnu/arch/parisc/kernel/process.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/parisc/kernel/process.c	2020-01-14 14:08:40.000000000 -0500
@@ -208,8 +208,8 @@ arch_initcall(parisc_idle_init);
  * Copy architecture-specific thread state
  */
 int
-copy_thread(unsigned long clone_flags, unsigned long usp,
-	    unsigned long kthread_arg, struct task_struct *p)
+copy_thread_tls(unsigned long clone_flags, unsigned long usp,
+	    unsigned long kthread_arg, struct task_struct *p, unsigned long tls)
 {
 	struct pt_regs *cregs = &(p->thread.regs);
 	void *stack = task_stack_page(p);
@@ -254,9 +254,9 @@ copy_thread(unsigned long clone_flags, u
 		cregs->ksp = (unsigned long)stack + THREAD_SZ_ALGN + FRAME_SIZE;
 		cregs->kpc = (unsigned long) &child_return;
 
-		/* Setup thread TLS area from the 4th parameter in clone */
+		/* Setup thread TLS area */
 		if (clone_flags & CLONE_SETTLS)
-			cregs->cr27 = cregs->gr[23];
+			cregs->cr27 = tls;
 	}
 
 	return 0;
diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/riscv/Kconfig linux-libre-5.4.12-gnu/arch/riscv/Kconfig
--- linux-libre-5.4.11-gnu/arch/riscv/Kconfig	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/riscv/Kconfig	2020-01-14 14:08:40.000000000 -0500
@@ -61,6 +61,7 @@ config RISCV
 	select SPARSEMEM_STATIC if 32BIT
 	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
 	select HAVE_ARCH_MMAP_RND_BITS
+	select HAVE_COPY_THREAD_TLS
 
 config ARCH_MMAP_RND_BITS_MIN
 	default 18 if 64BIT
diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/riscv/kernel/process.c linux-libre-5.4.12-gnu/arch/riscv/kernel/process.c
--- linux-libre-5.4.11-gnu/arch/riscv/kernel/process.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/riscv/kernel/process.c	2020-01-14 14:08:40.000000000 -0500
@@ -99,8 +99,8 @@ int arch_dup_task_struct(struct task_str
 	return 0;
 }
 
-int copy_thread(unsigned long clone_flags, unsigned long usp,
-	unsigned long arg, struct task_struct *p)
+int copy_thread_tls(unsigned long clone_flags, unsigned long usp,
+	unsigned long arg, struct task_struct *p, unsigned long tls)
 {
 	struct pt_regs *childregs = task_pt_regs(p);
 
@@ -120,7 +120,7 @@ int copy_thread(unsigned long clone_flag
 		if (usp) /* User fork */
 			childregs->sp = usp;
 		if (clone_flags & CLONE_SETTLS)
-			childregs->tp = childregs->a5;
+			childregs->tp = tls;
 		childregs->a0 = 0; /* Return value of fork() */
 		p->thread.ra = (unsigned long)ret_from_fork;
 	}
diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/um/include/asm/ptrace-generic.h linux-libre-5.4.12-gnu/arch/um/include/asm/ptrace-generic.h
--- linux-libre-5.4.11-gnu/arch/um/include/asm/ptrace-generic.h	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/um/include/asm/ptrace-generic.h	2020-01-14 14:08:40.000000000 -0500
@@ -36,7 +36,7 @@ extern long subarch_ptrace(struct task_s
 extern unsigned long getreg(struct task_struct *child, int regno);
 extern int putreg(struct task_struct *child, int regno, unsigned long value);
 
-extern int arch_copy_tls(struct task_struct *new);
+extern int arch_set_tls(struct task_struct *new, unsigned long tls);
 extern void clear_flushed_tls(struct task_struct *task);
 extern int syscall_trace_enter(struct pt_regs *regs);
 extern void syscall_trace_leave(struct pt_regs *regs);
diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/um/Kconfig linux-libre-5.4.12-gnu/arch/um/Kconfig
--- linux-libre-5.4.11-gnu/arch/um/Kconfig	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/um/Kconfig	2020-01-14 14:08:40.000000000 -0500
@@ -14,6 +14,7 @@ config UML
 	select HAVE_FUTEX_CMPXCHG if FUTEX
 	select HAVE_DEBUG_KMEMLEAK
 	select HAVE_DEBUG_BUGVERBOSE
+	select HAVE_COPY_THREAD_TLS
 	select GENERIC_IRQ_SHOW
 	select GENERIC_CPU_DEVICES
 	select GENERIC_CLOCKEVENTS
diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/um/kernel/process.c linux-libre-5.4.12-gnu/arch/um/kernel/process.c
--- linux-libre-5.4.11-gnu/arch/um/kernel/process.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/um/kernel/process.c	2020-01-14 14:08:40.000000000 -0500
@@ -153,8 +153,8 @@ void fork_handler(void)
 	userspace(&current->thread.regs.regs, current_thread_info()->aux_fp_regs);
 }
 
-int copy_thread(unsigned long clone_flags, unsigned long sp,
-		unsigned long arg, struct task_struct * p)
+int copy_thread_tls(unsigned long clone_flags, unsigned long sp,
+		unsigned long arg, struct task_struct * p, unsigned long tls)
 {
 	void (*handler)(void);
 	int kthread = current->flags & PF_KTHREAD;
@@ -188,7 +188,7 @@ int copy_thread(unsigned long clone_flag
 		 * Set a new TLS for the child thread?
 		 */
 		if (clone_flags & CLONE_SETTLS)
-			ret = arch_copy_tls(p);
+			ret = arch_set_tls(p, tls);
 	}
 
 	return ret;
diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/x86/um/tls_32.c linux-libre-5.4.12-gnu/arch/x86/um/tls_32.c
--- linux-libre-5.4.11-gnu/arch/x86/um/tls_32.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/x86/um/tls_32.c	2020-01-14 14:08:40.000000000 -0500
@@ -215,14 +215,12 @@ static int set_tls_entry(struct task_str
 	return 0;
 }
 
-int arch_copy_tls(struct task_struct *new)
+int arch_set_tls(struct task_struct *new, unsigned long tls)
 {
 	struct user_desc info;
 	int idx, ret = -EFAULT;
 
-	if (copy_from_user(&info,
-			   (void __user *) UPT_SI(&new->thread.regs.regs),
-			   sizeof(info)))
+	if (copy_from_user(&info, (void __user *) tls, sizeof(info)))
 		goto out;
 
 	ret = -EINVAL;
diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/x86/um/tls_64.c linux-libre-5.4.12-gnu/arch/x86/um/tls_64.c
--- linux-libre-5.4.11-gnu/arch/x86/um/tls_64.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/x86/um/tls_64.c	2020-01-14 14:08:40.000000000 -0500
@@ -6,14 +6,13 @@ void clear_flushed_tls(struct task_struc
 {
 }
 
-int arch_copy_tls(struct task_struct *t)
+int arch_set_tls(struct task_struct *t, unsigned long tls)
 {
 	/*
 	 * If CLONE_SETTLS is set, we need to save the thread id
-	 * (which is argument 5, child_tid, of clone) so it can be set
-	 * during context switches.
+	 * so it can be set during context switches.
 	 */
-	t->thread.arch.fs = t->thread.regs.regs.gp[R8 / sizeof(long)];
+	t->thread.arch.fs = tls;
 
 	return 0;
 }
diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/xtensa/Kconfig linux-libre-5.4.12-gnu/arch/xtensa/Kconfig
--- linux-libre-5.4.11-gnu/arch/xtensa/Kconfig	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/xtensa/Kconfig	2020-01-14 14:08:40.000000000 -0500
@@ -22,6 +22,7 @@ config XTENSA
 	select HAVE_ARCH_JUMP_LABEL
 	select HAVE_ARCH_KASAN if MMU
 	select HAVE_ARCH_TRACEHOOK
+	select HAVE_COPY_THREAD_TLS
 	select HAVE_DEBUG_KMEMLEAK
 	select HAVE_DMA_CONTIGUOUS
 	select HAVE_EXIT_THREAD
diff -druNp --no-dereference linux-libre-5.4.11-gnu/arch/xtensa/kernel/process.c linux-libre-5.4.12-gnu/arch/xtensa/kernel/process.c
--- linux-libre-5.4.11-gnu/arch/xtensa/kernel/process.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/arch/xtensa/kernel/process.c	2020-01-14 14:08:40.000000000 -0500
@@ -202,8 +202,9 @@ int arch_dup_task_struct(struct task_str
  * involved.  Much simpler to just not copy those live frames across.
  */
 
-int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn,
-		unsigned long thread_fn_arg, struct task_struct *p)
+int copy_thread_tls(unsigned long clone_flags, unsigned long usp_thread_fn,
+		unsigned long thread_fn_arg, struct task_struct *p,
+		unsigned long tls)
 {
 	struct pt_regs *childregs = task_pt_regs(p);
 
@@ -264,9 +265,8 @@ int copy_thread(unsigned long clone_flag
 			       &regs->areg[XCHAL_NUM_AREGS - len/4], len);
 		}
 
-		/* The thread pointer is passed in the '4th argument' (= a5) */
 		if (clone_flags & CLONE_SETTLS)
-			childregs->threadptr = childregs->areg[5];
+			childregs->threadptr = tls;
 	} else {
 		p->thread.ra = MAKE_RA_FOR_CALL(
 				(unsigned long)ret_from_kernel_thread, 1);
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/char/tpm/tpm-dev-common.c linux-libre-5.4.12-gnu/drivers/char/tpm/tpm-dev-common.c
--- linux-libre-5.4.11-gnu/drivers/char/tpm/tpm-dev-common.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/char/tpm/tpm-dev-common.c	2020-01-14 14:08:40.000000000 -0500
@@ -130,7 +130,7 @@ ssize_t tpm_common_read(struct file *fil
 		priv->response_read = true;
 
 		ret_size = min_t(ssize_t, size, priv->response_length);
-		if (!ret_size) {
+		if (ret_size <= 0) {
 			priv->response_length = 0;
 			goto out;
 		}
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/char/tpm/tpm-dev.h linux-libre-5.4.12-gnu/drivers/char/tpm/tpm-dev.h
--- linux-libre-5.4.11-gnu/drivers/char/tpm/tpm-dev.h	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/char/tpm/tpm-dev.h	2020-01-14 14:08:40.000000000 -0500
@@ -14,7 +14,7 @@ struct file_priv {
 	struct work_struct timeout_work;
 	struct work_struct async_work;
 	wait_queue_head_t async_wait;
-	size_t response_length;
+	ssize_t response_length;
 	bool response_read;
 	bool command_enqueued;
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/char/tpm/tpm_tis_core.c linux-libre-5.4.12-gnu/drivers/char/tpm/tpm_tis_core.c
--- linux-libre-5.4.11-gnu/drivers/char/tpm/tpm_tis_core.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/char/tpm/tpm_tis_core.c	2020-01-14 14:08:40.000000000 -0500
@@ -899,13 +899,13 @@ int tpm_tis_core_init(struct device *dev
 
 	if (wait_startup(chip, 0) != 0) {
 		rc = -ENODEV;
-		goto err_start;
+		goto out_err;
 	}
 
 	/* Take control of the TPM's interrupt hardware and shut it off */
 	rc = tpm_tis_read32(priv, TPM_INT_ENABLE(priv->locality), &intmask);
 	if (rc < 0)
-		goto err_start;
+		goto out_err;
 
 	intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT |
 		   TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT;
@@ -914,21 +914,21 @@ int tpm_tis_core_init(struct device *dev
 
 	rc = tpm_chip_start(chip);
 	if (rc)
-		goto err_start;
-
+		goto out_err;
 	rc = tpm2_probe(chip);
+	tpm_chip_stop(chip);
 	if (rc)
-		goto err_probe;
+		goto out_err;
 
 	rc = tpm_tis_read32(priv, TPM_DID_VID(0), &vendor);
 	if (rc < 0)
-		goto err_probe;
+		goto out_err;
 
 	priv->manufacturer_id = vendor;
 
 	rc = tpm_tis_read8(priv, TPM_RID(0), &rid);
 	if (rc < 0)
-		goto err_probe;
+		goto out_err;
 
 	dev_info(dev, "%s TPM (device-id 0x%X, rev-id %d)\n",
 		 (chip->flags & TPM_CHIP_FLAG_TPM2) ? "2.0" : "1.2",
@@ -937,13 +937,13 @@ int tpm_tis_core_init(struct device *dev
 	probe = probe_itpm(chip);
 	if (probe < 0) {
 		rc = -ENODEV;
-		goto err_probe;
+		goto out_err;
 	}
 
 	/* Figure out the capabilities */
 	rc = tpm_tis_read32(priv, TPM_INTF_CAPS(priv->locality), &intfcaps);
 	if (rc < 0)
-		goto err_probe;
+		goto out_err;
 
 	dev_dbg(dev, "TPM interface capabilities (0x%x):\n",
 		intfcaps);
@@ -977,10 +977,9 @@ int tpm_tis_core_init(struct device *dev
 		if (tpm_get_timeouts(chip)) {
 			dev_err(dev, "Could not get TPM timeouts and durations\n");
 			rc = -ENODEV;
-			goto err_probe;
+			goto out_err;
 		}
 
-		chip->flags |= TPM_CHIP_FLAG_IRQ;
 		if (irq) {
 			tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
 						 irq);
@@ -992,18 +991,15 @@ int tpm_tis_core_init(struct device *dev
 		}
 	}
 
-	tpm_chip_stop(chip);
-
 	rc = tpm_chip_register(chip);
 	if (rc)
-		goto err_start;
-
-	return 0;
+		goto out_err;
 
-err_probe:
-	tpm_chip_stop(chip);
+	if (chip->ops->clk_enable != NULL)
+		chip->ops->clk_enable(chip, false);
 
-err_start:
+	return 0;
+out_err:
 	if ((chip->ops != NULL) && (chip->ops->clk_enable != NULL))
 		chip->ops->clk_enable(chip, false);
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/gpio/gpiolib-acpi.c linux-libre-5.4.12-gnu/drivers/gpio/gpiolib-acpi.c
--- linux-libre-5.4.11-gnu/drivers/gpio/gpiolib-acpi.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/gpio/gpiolib-acpi.c	2020-01-14 14:08:40.000000000 -0500
@@ -21,11 +21,19 @@
 #include "gpiolib.h"
 #include "gpiolib-acpi.h"
 
+#define QUIRK_NO_EDGE_EVENTS_ON_BOOT		0x01l
+#define QUIRK_NO_WAKEUP				0x02l
+
 static int run_edge_events_on_boot = -1;
 module_param(run_edge_events_on_boot, int, 0444);
 MODULE_PARM_DESC(run_edge_events_on_boot,
 		 "Run edge _AEI event-handlers at boot: 0=no, 1=yes, -1=auto");
 
+static int honor_wakeup = -1;
+module_param(honor_wakeup, int, 0444);
+MODULE_PARM_DESC(honor_wakeup,
+		 "Honor the ACPI wake-capable flag: 0=no, 1=yes, -1=auto");
+
 /**
  * struct acpi_gpio_event - ACPI GPIO event handler data
  *
@@ -274,7 +282,7 @@ static acpi_status acpi_gpiochip_alloc_e
 	event->handle = evt_handle;
 	event->handler = handler;
 	event->irq = irq;
-	event->irq_is_wake = agpio->wake_capable == ACPI_WAKE_CAPABLE;
+	event->irq_is_wake = honor_wakeup && agpio->wake_capable == ACPI_WAKE_CAPABLE;
 	event->pin = pin;
 	event->desc = desc;
 
@@ -1302,7 +1310,7 @@ static int acpi_gpio_handle_deferred_req
 /* We must use _sync so that this runs after the first deferred_probe run */
 late_initcall_sync(acpi_gpio_handle_deferred_request_irqs);
 
-static const struct dmi_system_id run_edge_events_on_boot_blacklist[] = {
+static const struct dmi_system_id gpiolib_acpi_quirks[] = {
 	{
 		/*
 		 * The Minix Neo Z83-4 has a micro-USB-B id-pin handler for
@@ -1312,7 +1320,8 @@ static const struct dmi_system_id run_ed
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "MINIX"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"),
-		}
+		},
+		.driver_data = (void *)QUIRK_NO_EDGE_EVENTS_ON_BOOT,
 	},
 	{
 		/*
@@ -1324,20 +1333,52 @@ static const struct dmi_system_id run_ed
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Wortmann_AG"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "TERRA_PAD_1061"),
-		}
+		},
+		.driver_data = (void *)QUIRK_NO_EDGE_EVENTS_ON_BOOT,
+	},
+	{
+		/*
+		 * Various HP X2 10 Cherry Trail models use an external
+		 * embedded-controller connected via I2C + an ACPI GPIO
+		 * event handler. The embedded controller generates various
+		 * spurious wakeup events when suspended. So disable wakeup
+		 * for its handler (it uses the only ACPI GPIO event handler).
+		 * This breaks wakeup when opening the lid, the user needs
+		 * to press the power-button to wakeup the system. The
+		 * alternative is suspend simply not working, which is worse.
+		 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "HP x2 Detachable 10-p0XX"),
+		},
+		.driver_data = (void *)QUIRK_NO_WAKEUP,
 	},
 	{} /* Terminating entry */
 };
 
 static int acpi_gpio_setup_params(void)
 {
+	const struct dmi_system_id *id;
+	long quirks = 0;
+
+	id = dmi_first_match(gpiolib_acpi_quirks);
+	if (id)
+		quirks = (long)id->driver_data;
+
 	if (run_edge_events_on_boot < 0) {
-		if (dmi_check_system(run_edge_events_on_boot_blacklist))
+		if (quirks & QUIRK_NO_EDGE_EVENTS_ON_BOOT)
 			run_edge_events_on_boot = 0;
 		else
 			run_edge_events_on_boot = 1;
 	}
 
+	if (honor_wakeup < 0) {
+		if (quirks & QUIRK_NO_WAKEUP)
+			honor_wakeup = 0;
+		else
+			honor_wakeup = 1;
+	}
+
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c linux-libre-5.4.12-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
--- linux-libre-5.4.11-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c	2020-01-14 14:08:40.000000000 -0500
@@ -145,7 +145,7 @@ int amdgpu_async_gfx_ring = 1;
 int amdgpu_mcbp = 0;
 int amdgpu_discovery = -1;
 int amdgpu_mes = 0;
-int amdgpu_noretry = 1;
+int amdgpu_noretry;
 
 struct amdgpu_mgpu_info mgpu_info = {
 	.mutex = __MUTEX_INITIALIZER(mgpu_info.mutex),
@@ -613,7 +613,7 @@ MODULE_PARM_DESC(mes,
 module_param_named(mes, amdgpu_mes, int, 0444);
 
 MODULE_PARM_DESC(noretry,
-	"Disable retry faults (0 = retry enabled, 1 = retry disabled (default))");
+	"Disable retry faults (0 = retry enabled (default), 1 = retry disabled)");
 module_param_named(noretry, amdgpu_noretry, int, 0644);
 
 #ifdef CONFIG_HSA_AMD
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/gpu/drm/drm_dp_mst_topology.c linux-libre-5.4.12-gnu/drivers/gpu/drm/drm_dp_mst_topology.c
--- linux-libre-5.4.11-gnu/drivers/gpu/drm/drm_dp_mst_topology.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/gpu/drm/drm_dp_mst_topology.c	2020-01-14 14:08:40.000000000 -0500
@@ -339,7 +339,7 @@ static void drm_dp_encode_sideband_req(s
 			memcpy(&buf[idx], req->u.i2c_read.transactions[i].bytes, req->u.i2c_read.transactions[i].num_bytes);
 			idx += req->u.i2c_read.transactions[i].num_bytes;
 
-			buf[idx] = (req->u.i2c_read.transactions[i].no_stop_bit & 0x1) << 5;
+			buf[idx] = (req->u.i2c_read.transactions[i].no_stop_bit & 0x1) << 4;
 			buf[idx] |= (req->u.i2c_read.transactions[i].i2c_transaction_delay & 0xf);
 			idx++;
 		}
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/gpu/drm/drm_fb_helper.c linux-libre-5.4.12-gnu/drivers/gpu/drm/drm_fb_helper.c
--- linux-libre-5.4.11-gnu/drivers/gpu/drm/drm_fb_helper.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/gpu/drm/drm_fb_helper.c	2020-01-14 14:08:40.000000000 -0500
@@ -1320,7 +1320,7 @@ int drm_fb_helper_check_var(struct fb_va
 	 * Changes struct fb_var_screeninfo are currently not pushed back
 	 * to KMS, hence fail if different settings are requested.
 	 */
-	if (var->bits_per_pixel != fb->format->cpp[0] * 8 ||
+	if (var->bits_per_pixel > fb->format->cpp[0] * 8 ||
 	    var->xres > fb->width || var->yres > fb->height ||
 	    var->xres_virtual > fb->width || var->yres_virtual > fb->height) {
 		DRM_DEBUG("fb requested width/height/bpp can't fit in current fb "
@@ -1346,6 +1346,11 @@ int drm_fb_helper_check_var(struct fb_va
 	}
 
 	/*
+	 * Likewise, bits_per_pixel should be rounded up to a supported value.
+	 */
+	var->bits_per_pixel = fb->format->cpp[0] * 8;
+
+	/*
 	 * drm fbdev emulation doesn't support changing the pixel format at all,
 	 * so reject all pixel format changing requests.
 	 */
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/gpu/drm/i915/gt/intel_lrc.c linux-libre-5.4.12-gnu/drivers/gpu/drm/i915/gt/intel_lrc.c
--- linux-libre-5.4.11-gnu/drivers/gpu/drm/i915/gt/intel_lrc.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/gpu/drm/i915/gt/intel_lrc.c	2020-01-14 14:08:40.000000000 -0500
@@ -2132,6 +2132,14 @@ static u32 *gen9_init_indirectctx_bb(str
 	/* WaFlushCoherentL3CacheLinesAtContextSwitch:skl,bxt,glk */
 	batch = gen8_emit_flush_coherentl3_wa(engine, batch);
 
+	/* WaClearSlmSpaceAtContextSwitch:skl,bxt,kbl,glk,cfl */
+	batch = gen8_emit_pipe_control(batch,
+				       PIPE_CONTROL_FLUSH_L3 |
+				       PIPE_CONTROL_GLOBAL_GTT_IVB |
+				       PIPE_CONTROL_CS_STALL |
+				       PIPE_CONTROL_QW_WRITE,
+				       slm_offset(engine));
+
 	batch = emit_lri(batch, lri, ARRAY_SIZE(lri));
 
 	/* WaMediaPoolStateCmdInWABB:bxt,glk */
@@ -3716,9 +3724,11 @@ intel_execlists_create_virtual(struct i9
 	ve->base.i915 = ctx->i915;
 	ve->base.gt = siblings[0]->gt;
 	ve->base.id = -1;
+
 	ve->base.class = OTHER_CLASS;
 	ve->base.uabi_class = I915_ENGINE_CLASS_INVALID;
 	ve->base.instance = I915_ENGINE_CLASS_INVALID_VIRTUAL;
+	ve->base.uabi_instance = I915_ENGINE_CLASS_INVALID_VIRTUAL;
 
 	/*
 	 * The decision on whether to submit a request using semaphores
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/gpu/drm/i915/i915_reg.h linux-libre-5.4.12-gnu/drivers/gpu/drm/i915/i915_reg.h
--- linux-libre-5.4.11-gnu/drivers/gpu/drm/i915/i915_reg.h	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/gpu/drm/i915/i915_reg.h	2020-01-14 14:08:40.000000000 -0500
@@ -4049,7 +4049,13 @@ enum {
 #define  GWUNIT_CLKGATE_DIS		(1 << 16)
 
 #define UNSLICE_UNIT_LEVEL_CLKGATE	_MMIO(0x9434)
-#define  VFUNIT_CLKGATE_DIS		(1 << 20)
+#define   VFUNIT_CLKGATE_DIS		REG_BIT(20)
+#define   HSUNIT_CLKGATE_DIS		REG_BIT(8)
+#define   VSUNIT_CLKGATE_DIS		REG_BIT(3)
+
+#define UNSLICE_UNIT_LEVEL_CLKGATE2	_MMIO(0x94e4)
+#define   VSUNIT_CLKGATE_DIS_TGL	REG_BIT(19)
+#define   PSDUNIT_CLKGATE_DIS		REG_BIT(5)
 
 #define INF_UNIT_LEVEL_CLKGATE		_MMIO(0x9560)
 #define   CGPSF_CLKGATE_DIS		(1 << 3)
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/gpu/drm/i915/intel_pm.c linux-libre-5.4.12-gnu/drivers/gpu/drm/i915/intel_pm.c
--- linux-libre-5.4.11-gnu/drivers/gpu/drm/i915/intel_pm.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/gpu/drm/i915/intel_pm.c	2020-01-14 14:08:40.000000000 -0500
@@ -9194,6 +9194,17 @@ static void icl_init_clock_gating(struct
 	/* WaEnable32PlaneMode:icl */
 	I915_WRITE(GEN9_CSFE_CHICKEN1_RCS,
 		   _MASKED_BIT_ENABLE(GEN11_ENABLE_32_PLANE_MODE));
+
+	/*
+	 * Wa_1408615072:icl,ehl  (vsunit)
+	 * Wa_1407596294:icl,ehl  (hsunit)
+	 */
+	intel_uncore_rmw(&dev_priv->uncore, UNSLICE_UNIT_LEVEL_CLKGATE,
+			 0, VSUNIT_CLKGATE_DIS | HSUNIT_CLKGATE_DIS);
+
+	/* Wa_1407352427:icl,ehl */
+	intel_uncore_rmw(&dev_priv->uncore, UNSLICE_UNIT_LEVEL_CLKGATE2,
+			 0, PSDUNIT_CLKGATE_DIS);
 }
 
 static void cnp_init_clock_gating(struct drm_i915_private *dev_priv)
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/gpu/drm/sun4i/sun4i_tcon.c linux-libre-5.4.12-gnu/drivers/gpu/drm/sun4i/sun4i_tcon.c
--- linux-libre-5.4.11-gnu/drivers/gpu/drm/sun4i/sun4i_tcon.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/gpu/drm/sun4i/sun4i_tcon.c	2020-01-14 14:08:40.000000000 -0500
@@ -488,7 +488,7 @@ static void sun4i_tcon0_mode_set_rgb(str
 
 	WARN_ON(!tcon->quirks->has_channel_0);
 
-	tcon->dclk_min_div = 1;
+	tcon->dclk_min_div = tcon->quirks->dclk_min_div;
 	tcon->dclk_max_div = 127;
 	sun4i_tcon0_mode_set_common(tcon, mode);
 
@@ -1425,12 +1425,14 @@ static int sun8i_r40_tcon_tv_set_mux(str
 static const struct sun4i_tcon_quirks sun4i_a10_quirks = {
 	.has_channel_0		= true,
 	.has_channel_1		= true,
+	.dclk_min_div		= 4,
 	.set_mux		= sun4i_a10_tcon_set_mux,
 };
 
 static const struct sun4i_tcon_quirks sun5i_a13_quirks = {
 	.has_channel_0		= true,
 	.has_channel_1		= true,
+	.dclk_min_div		= 4,
 	.set_mux		= sun5i_a13_tcon_set_mux,
 };
 
@@ -1439,6 +1441,7 @@ static const struct sun4i_tcon_quirks su
 	.has_channel_1		= true,
 	.has_lvds_alt		= true,
 	.needs_de_be_mux	= true,
+	.dclk_min_div		= 1,
 	.set_mux		= sun6i_tcon_set_mux,
 };
 
@@ -1446,11 +1449,13 @@ static const struct sun4i_tcon_quirks su
 	.has_channel_0		= true,
 	.has_channel_1		= true,
 	.needs_de_be_mux	= true,
+	.dclk_min_div		= 1,
 };
 
 static const struct sun4i_tcon_quirks sun7i_a20_quirks = {
 	.has_channel_0		= true,
 	.has_channel_1		= true,
+	.dclk_min_div		= 4,
 	/* Same display pipeline structure as A10 */
 	.set_mux		= sun4i_a10_tcon_set_mux,
 };
@@ -1458,11 +1463,13 @@ static const struct sun4i_tcon_quirks su
 static const struct sun4i_tcon_quirks sun8i_a33_quirks = {
 	.has_channel_0		= true,
 	.has_lvds_alt		= true,
+	.dclk_min_div		= 1,
 };
 
 static const struct sun4i_tcon_quirks sun8i_a83t_lcd_quirks = {
 	.supports_lvds		= true,
 	.has_channel_0		= true,
+	.dclk_min_div		= 1,
 };
 
 static const struct sun4i_tcon_quirks sun8i_a83t_tv_quirks = {
@@ -1476,11 +1483,13 @@ static const struct sun4i_tcon_quirks su
 
 static const struct sun4i_tcon_quirks sun8i_v3s_quirks = {
 	.has_channel_0		= true,
+	.dclk_min_div		= 1,
 };
 
 static const struct sun4i_tcon_quirks sun9i_a80_tcon_lcd_quirks = {
-	.has_channel_0	= true,
-	.needs_edp_reset = true,
+	.has_channel_0		= true,
+	.needs_edp_reset	= true,
+	.dclk_min_div		= 1,
 };
 
 static const struct sun4i_tcon_quirks sun9i_a80_tcon_tv_quirks = {
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/gpu/drm/sun4i/sun4i_tcon.h linux-libre-5.4.12-gnu/drivers/gpu/drm/sun4i/sun4i_tcon.h
--- linux-libre-5.4.11-gnu/drivers/gpu/drm/sun4i/sun4i_tcon.h	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/gpu/drm/sun4i/sun4i_tcon.h	2020-01-14 14:08:40.000000000 -0500
@@ -224,6 +224,7 @@ struct sun4i_tcon_quirks {
 	bool	needs_de_be_mux; /* sun6i needs mux to select backend */
 	bool    needs_edp_reset; /* a80 edp reset needed for tcon0 access */
 	bool	supports_lvds;   /* Does the TCON support an LVDS output? */
+	u8	dclk_min_div;	/* minimum divider for TCON0 DCLK */
 
 	/* callback to handle tcon muxing options */
 	int	(*set_mux)(struct sun4i_tcon *, const struct drm_encoder *);
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/hid/hid-core.c linux-libre-5.4.12-gnu/drivers/hid/hid-core.c
--- linux-libre-5.4.11-gnu/drivers/hid/hid-core.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/hid/hid-core.c	2020-01-14 14:08:40.000000000 -0500
@@ -288,6 +288,12 @@ static int hid_add_field(struct hid_pars
 	offset = report->size;
 	report->size += parser->global.report_size * parser->global.report_count;
 
+	/* Total size check: Allow for possible report index byte */
+	if (report->size > (HID_MAX_BUFFER_SIZE - 1) << 3) {
+		hid_err(parser->device, "report is too long\n");
+		return -1;
+	}
+
 	if (!parser->local.usage_index) /* Ignore padding fields */
 		return 0;
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/hid/hid-input.c linux-libre-5.4.12-gnu/drivers/hid/hid-input.c
--- linux-libre-5.4.11-gnu/drivers/hid/hid-input.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/hid/hid-input.c	2020-01-14 14:08:40.000000000 -0500
@@ -1132,9 +1132,15 @@ static void hidinput_configure_usage(str
 	}
 
 mapped:
-	if (device->driver->input_mapped && device->driver->input_mapped(device,
-				hidinput, field, usage, &bit, &max) < 0)
-		goto ignore;
+	if (device->driver->input_mapped &&
+	    device->driver->input_mapped(device, hidinput, field, usage,
+					 &bit, &max) < 0) {
+		/*
+		 * The driver indicated that no further generic handling
+		 * of the usage is desired.
+		 */
+		return;
+	}
 
 	set_bit(usage->type, input->evbit);
 
@@ -1215,9 +1221,11 @@ mapped:
 		set_bit(MSC_SCAN, input->mscbit);
 	}
 
-ignore:
 	return;
 
+ignore:
+	usage->type = 0;
+	usage->code = 0;
 }
 
 static void hidinput_handle_scroll(struct hid_usage *usage,
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/hid/hidraw.c linux-libre-5.4.12-gnu/drivers/hid/hidraw.c
--- linux-libre-5.4.11-gnu/drivers/hid/hidraw.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/hid/hidraw.c	2020-01-14 14:08:40.000000000 -0500
@@ -252,10 +252,10 @@ static __poll_t hidraw_poll(struct file
 
 	poll_wait(file, &list->hidraw->wait, wait);
 	if (list->head != list->tail)
-		return EPOLLIN | EPOLLRDNORM | EPOLLOUT;
+		return EPOLLIN | EPOLLRDNORM;
 	if (!list->hidraw->exist)
 		return EPOLLERR | EPOLLHUP;
-	return 0;
+	return EPOLLOUT | EPOLLWRNORM;
 }
 
 static int hidraw_open(struct inode *inode, struct file *file)
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/hid/uhid.c linux-libre-5.4.12-gnu/drivers/hid/uhid.c
--- linux-libre-5.4.11-gnu/drivers/hid/uhid.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/hid/uhid.c	2020-01-14 14:08:40.000000000 -0500
@@ -772,7 +772,7 @@ static __poll_t uhid_char_poll(struct fi
 	if (uhid->head != uhid->tail)
 		return EPOLLIN | EPOLLRDNORM;
 
-	return 0;
+	return EPOLLOUT | EPOLLWRNORM;
 }
 
 static const struct file_operations uhid_fops = {
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/hid/usbhid/hiddev.c linux-libre-5.4.12-gnu/drivers/hid/usbhid/hiddev.c
--- linux-libre-5.4.11-gnu/drivers/hid/usbhid/hiddev.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/hid/usbhid/hiddev.c	2020-01-14 14:08:40.000000000 -0500
@@ -241,12 +241,51 @@ static int hiddev_release(struct inode *
 	return 0;
 }
 
+static int __hiddev_open(struct hiddev *hiddev, struct file *file)
+{
+	struct hiddev_list *list;
+	int error;
+
+	lockdep_assert_held(&hiddev->existancelock);
+
+	list = vzalloc(sizeof(*list));
+	if (!list)
+		return -ENOMEM;
+
+	mutex_init(&list->thread_lock);
+	list->hiddev = hiddev;
+
+	if (!hiddev->open++) {
+		error = hid_hw_power(hiddev->hid, PM_HINT_FULLON);
+		if (error < 0)
+			goto err_drop_count;
+
+		error = hid_hw_open(hiddev->hid);
+		if (error < 0)
+			goto err_normal_power;
+	}
+
+	spin_lock_irq(&hiddev->list_lock);
+	list_add_tail(&list->node, &hiddev->list);
+	spin_unlock_irq(&hiddev->list_lock);
+
+	file->private_data = list;
+
+	return 0;
+
+err_normal_power:
+	hid_hw_power(hiddev->hid, PM_HINT_NORMAL);
+err_drop_count:
+	hiddev->open--;
+	vfree(list);
+	return error;
+}
+
 /*
  * open file op
  */
 static int hiddev_open(struct inode *inode, struct file *file)
 {
-	struct hiddev_list *list;
 	struct usb_interface *intf;
 	struct hid_device *hid;
 	struct hiddev *hiddev;
@@ -255,66 +294,14 @@ static int hiddev_open(struct inode *ino
 	intf = usbhid_find_interface(iminor(inode));
 	if (!intf)
 		return -ENODEV;
+
 	hid = usb_get_intfdata(intf);
 	hiddev = hid->hiddev;
 
-	if (!(list = vzalloc(sizeof(struct hiddev_list))))
-		return -ENOMEM;
-	mutex_init(&list->thread_lock);
-	list->hiddev = hiddev;
-	file->private_data = list;
-
-	/*
-	 * no need for locking because the USB major number
-	 * is shared which usbcore guards against disconnect
-	 */
-	if (list->hiddev->exist) {
-		if (!list->hiddev->open++) {
-			res = hid_hw_open(hiddev->hid);
-			if (res < 0)
-				goto bail;
-		}
-	} else {
-		res = -ENODEV;
-		goto bail;
-	}
-
-	spin_lock_irq(&list->hiddev->list_lock);
-	list_add_tail(&list->node, &hiddev->list);
-	spin_unlock_irq(&list->hiddev->list_lock);
-
 	mutex_lock(&hiddev->existancelock);
-	/*
-	 * recheck exist with existance lock held to
-	 * avoid opening a disconnected device
-	 */
-	if (!list->hiddev->exist) {
-		res = -ENODEV;
-		goto bail_unlock;
-	}
-	if (!list->hiddev->open++)
-		if (list->hiddev->exist) {
-			struct hid_device *hid = hiddev->hid;
-			res = hid_hw_power(hid, PM_HINT_FULLON);
-			if (res < 0)
-				goto bail_unlock;
-			res = hid_hw_open(hid);
-			if (res < 0)
-				goto bail_normal_power;
-		}
-	mutex_unlock(&hiddev->existancelock);
-	return 0;
-bail_normal_power:
-	hid_hw_power(hid, PM_HINT_NORMAL);
-bail_unlock:
+	res = hiddev->exist ? __hiddev_open(hiddev, file) : -ENODEV;
 	mutex_unlock(&hiddev->existancelock);
 
-	spin_lock_irq(&list->hiddev->list_lock);
-	list_del(&list->node);
-	spin_unlock_irq(&list->hiddev->list_lock);
-bail:
-	file->private_data = NULL;
-	vfree(list);
 	return res;
 }
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/i2c/i2c-core-base.c linux-libre-5.4.12-gnu/drivers/i2c/i2c-core-base.c
--- linux-libre-5.4.11-gnu/drivers/i2c/i2c-core-base.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/i2c/i2c-core-base.c	2020-01-14 14:08:40.000000000 -0500
@@ -186,10 +186,11 @@ int i2c_generic_scl_recovery(struct i2c_
 	 * If we can set SDA, we will always create a STOP to ensure additional
 	 * pulses will do no harm. This is achieved by letting SDA follow SCL
 	 * half a cycle later. Check the 'incomplete_write_byte' fault injector
-	 * for details.
+	 * for details. Note that we must honour tsu:sto, 4us, but lets use 5us
+	 * here for simplicity.
 	 */
 	bri->set_scl(adap, scl);
-	ndelay(RECOVERY_NDELAY / 2);
+	ndelay(RECOVERY_NDELAY);
 	if (bri->set_sda)
 		bri->set_sda(adap, scl);
 	ndelay(RECOVERY_NDELAY / 2);
@@ -211,7 +212,13 @@ int i2c_generic_scl_recovery(struct i2c_
 		scl = !scl;
 		bri->set_scl(adap, scl);
 		/* Creating STOP again, see above */
-		ndelay(RECOVERY_NDELAY / 2);
+		if (scl)  {
+			/* Honour minimum tsu:sto */
+			ndelay(RECOVERY_NDELAY);
+		} else {
+			/* Honour minimum tf and thd:dat */
+			ndelay(RECOVERY_NDELAY / 2);
+		}
 		if (bri->set_sda)
 			bri->set_sda(adap, scl);
 		ndelay(RECOVERY_NDELAY / 2);
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/infiniband/hw/hfi1/tid_rdma.c linux-libre-5.4.12-gnu/drivers/infiniband/hw/hfi1/tid_rdma.c
--- linux-libre-5.4.11-gnu/drivers/infiniband/hw/hfi1/tid_rdma.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/infiniband/hw/hfi1/tid_rdma.c	2020-01-14 14:08:40.000000000 -0500
@@ -4633,6 +4633,15 @@ void hfi1_rc_rcv_tid_rdma_ack(struct hfi
 			 */
 			fpsn = full_flow_psn(flow, flow->flow_state.spsn);
 			req->r_ack_psn = psn;
+			/*
+			 * If resync_psn points to the last flow PSN for a
+			 * segment and the new segment (likely from a new
+			 * request) starts with a new generation number, we
+			 * need to adjust resync_psn accordingly.
+			 */
+			if (flow->flow_state.generation !=
+			    (resync_psn >> HFI1_KDETH_BTH_SEQ_SHIFT))
+				resync_psn = mask_psn(fpsn - 1);
 			flow->resync_npkts +=
 				delta_psn(mask_psn(resync_psn + 1), fpsn);
 			/*
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/input/evdev.c linux-libre-5.4.12-gnu/drivers/input/evdev.c
--- linux-libre-5.4.11-gnu/drivers/input/evdev.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/input/evdev.c	2020-01-14 14:08:40.000000000 -0500
@@ -224,13 +224,13 @@ static void __pass_event(struct evdev_cl
 		 */
 		client->tail = (client->head - 2) & (client->bufsize - 1);
 
-		client->buffer[client->tail].input_event_sec =
-						event->input_event_sec;
-		client->buffer[client->tail].input_event_usec =
-						event->input_event_usec;
-		client->buffer[client->tail].type = EV_SYN;
-		client->buffer[client->tail].code = SYN_DROPPED;
-		client->buffer[client->tail].value = 0;
+		client->buffer[client->tail] = (struct input_event) {
+			.input_event_sec = event->input_event_sec,
+			.input_event_usec = event->input_event_usec,
+			.type = EV_SYN,
+			.code = SYN_DROPPED,
+			.value = 0,
+		};
 
 		client->packet_head = client->tail;
 	}
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/input/input.c linux-libre-5.4.12-gnu/drivers/input/input.c
--- linux-libre-5.4.11-gnu/drivers/input/input.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/input/input.c	2020-01-14 14:08:40.000000000 -0500
@@ -878,16 +878,18 @@ static int input_default_setkeycode(stru
 		}
 	}
 
-	__clear_bit(*old_keycode, dev->keybit);
-	__set_bit(ke->keycode, dev->keybit);
-
-	for (i = 0; i < dev->keycodemax; i++) {
-		if (input_fetch_keycode(dev, i) == *old_keycode) {
-			__set_bit(*old_keycode, dev->keybit);
-			break; /* Setting the bit twice is useless, so break */
+	if (*old_keycode <= KEY_MAX) {
+		__clear_bit(*old_keycode, dev->keybit);
+		for (i = 0; i < dev->keycodemax; i++) {
+			if (input_fetch_keycode(dev, i) == *old_keycode) {
+				__set_bit(*old_keycode, dev->keybit);
+				/* Setting the bit twice is useless, so break */
+				break;
+			}
 		}
 	}
 
+	__set_bit(ke->keycode, dev->keybit);
 	return 0;
 }
 
@@ -943,9 +945,13 @@ int input_set_keycode(struct input_dev *
 	 * Simulate keyup event if keycode is not present
 	 * in the keymap anymore
 	 */
-	if (test_bit(EV_KEY, dev->evbit) &&
-	    !is_event_supported(old_keycode, dev->keybit, KEY_MAX) &&
-	    __test_and_clear_bit(old_keycode, dev->key)) {
+	if (old_keycode > KEY_MAX) {
+		dev_warn(dev->dev.parent ?: &dev->dev,
+			 "%s: got too big old keycode %#x\n",
+			 __func__, old_keycode);
+	} else if (test_bit(EV_KEY, dev->evbit) &&
+		   !is_event_supported(old_keycode, dev->keybit, KEY_MAX) &&
+		   __test_and_clear_bit(old_keycode, dev->key)) {
 		struct input_value vals[] =  {
 			{ EV_KEY, old_keycode, 0 },
 			input_value_sync
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/input/misc/uinput.c linux-libre-5.4.12-gnu/drivers/input/misc/uinput.c
--- linux-libre-5.4.11-gnu/drivers/input/misc/uinput.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/input/misc/uinput.c	2020-01-14 14:08:40.000000000 -0500
@@ -74,12 +74,16 @@ static int uinput_dev_event(struct input
 	struct uinput_device	*udev = input_get_drvdata(dev);
 	struct timespec64	ts;
 
-	udev->buff[udev->head].type = type;
-	udev->buff[udev->head].code = code;
-	udev->buff[udev->head].value = value;
 	ktime_get_ts64(&ts);
-	udev->buff[udev->head].input_event_sec = ts.tv_sec;
-	udev->buff[udev->head].input_event_usec = ts.tv_nsec / NSEC_PER_USEC;
+
+	udev->buff[udev->head] = (struct input_event) {
+		.input_event_sec = ts.tv_sec,
+		.input_event_usec = ts.tv_nsec / NSEC_PER_USEC,
+		.type = type,
+		.code = code,
+		.value = value,
+	};
+
 	udev->head = (udev->head + 1) % UINPUT_BUFFER_SIZE;
 
 	wake_up_interruptible(&udev->waitq);
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/iommu/intel-iommu.c linux-libre-5.4.12-gnu/drivers/iommu/intel-iommu.c
--- linux-libre-5.4.11-gnu/drivers/iommu/intel-iommu.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/iommu/intel-iommu.c	2020-01-14 14:08:40.000000000 -0500
@@ -5786,6 +5786,13 @@ static void intel_iommu_apply_resv_regio
 	WARN_ON_ONCE(!reserve_iova(&dmar_domain->iovad, start, end));
 }
 
+static struct iommu_group *intel_iommu_device_group(struct device *dev)
+{
+	if (dev_is_pci(dev))
+		return pci_device_group(dev);
+	return generic_device_group(dev);
+}
+
 #ifdef CONFIG_INTEL_IOMMU_SVM
 struct intel_iommu *intel_svm_device_to_iommu(struct device *dev)
 {
@@ -5958,7 +5965,7 @@ const struct iommu_ops intel_iommu_ops =
 	.get_resv_regions	= intel_iommu_get_resv_regions,
 	.put_resv_regions	= intel_iommu_put_resv_regions,
 	.apply_resv_region	= intel_iommu_apply_resv_region,
-	.device_group		= pci_device_group,
+	.device_group		= intel_iommu_device_group,
 	.dev_has_feat		= intel_iommu_dev_has_feat,
 	.dev_feat_enabled	= intel_iommu_dev_feat_enabled,
 	.dev_enable_feat	= intel_iommu_dev_enable_feat,
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/net/can/m_can/tcan4x5x.c linux-libre-5.4.12-gnu/drivers/net/can/m_can/tcan4x5x.c
--- linux-libre-5.4.11-gnu/drivers/net/can/m_can/tcan4x5x.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/net/can/m_can/tcan4x5x.c	2020-01-14 14:08:40.000000000 -0500
@@ -445,6 +445,10 @@ static int tcan4x5x_can_probe(struct spi
 
 	tcan4x5x_power_enable(priv->power, 1);
 
+	ret = tcan4x5x_init(mcan_class);
+	if (ret)
+		goto out_power;
+
 	ret = m_can_class_register(mcan_class);
 	if (ret)
 		goto out_power;
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/net/can/mscan/mscan.c linux-libre-5.4.12-gnu/drivers/net/can/mscan/mscan.c
--- linux-libre-5.4.11-gnu/drivers/net/can/mscan/mscan.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/net/can/mscan/mscan.c	2020-01-14 14:08:40.000000000 -0500
@@ -381,13 +381,12 @@ static int mscan_rx_poll(struct napi_str
 	struct net_device *dev = napi->dev;
 	struct mscan_regs __iomem *regs = priv->reg_base;
 	struct net_device_stats *stats = &dev->stats;
-	int npackets = 0;
-	int ret = 1;
+	int work_done = 0;
 	struct sk_buff *skb;
 	struct can_frame *frame;
 	u8 canrflg;
 
-	while (npackets < quota) {
+	while (work_done < quota) {
 		canrflg = in_8(&regs->canrflg);
 		if (!(canrflg & (MSCAN_RXF | MSCAN_ERR_IF)))
 			break;
@@ -408,18 +407,18 @@ static int mscan_rx_poll(struct napi_str
 
 		stats->rx_packets++;
 		stats->rx_bytes += frame->can_dlc;
-		npackets++;
+		work_done++;
 		netif_receive_skb(skb);
 	}
 
-	if (!(in_8(&regs->canrflg) & (MSCAN_RXF | MSCAN_ERR_IF))) {
-		napi_complete(&priv->napi);
-		clear_bit(F_RX_PROGRESS, &priv->flags);
-		if (priv->can.state < CAN_STATE_BUS_OFF)
-			out_8(&regs->canrier, priv->shadow_canrier);
-		ret = 0;
+	if (work_done < quota) {
+		if (likely(napi_complete_done(&priv->napi, work_done))) {
+			clear_bit(F_RX_PROGRESS, &priv->flags);
+			if (priv->can.state < CAN_STATE_BUS_OFF)
+				out_8(&regs->canrier, priv->shadow_canrier);
+		}
 	}
-	return ret;
+	return work_done;
 }
 
 static irqreturn_t mscan_isr(int irq, void *dev_id)
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/net/can/usb/gs_usb.c linux-libre-5.4.12-gnu/drivers/net/can/usb/gs_usb.c
--- linux-libre-5.4.11-gnu/drivers/net/can/usb/gs_usb.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/net/can/usb/gs_usb.c	2020-01-14 14:08:40.000000000 -0500
@@ -918,7 +918,7 @@ static int gs_usb_probe(struct usb_inter
 			     GS_USB_BREQ_HOST_FORMAT,
 			     USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
 			     1,
-			     intf->altsetting[0].desc.bInterfaceNumber,
+			     intf->cur_altsetting->desc.bInterfaceNumber,
 			     hconf,
 			     sizeof(*hconf),
 			     1000);
@@ -941,7 +941,7 @@ static int gs_usb_probe(struct usb_inter
 			     GS_USB_BREQ_DEVICE_CONFIG,
 			     USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
 			     1,
-			     intf->altsetting[0].desc.bInterfaceNumber,
+			     intf->cur_altsetting->desc.bInterfaceNumber,
 			     dconf,
 			     sizeof(*dconf),
 			     1000);
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c linux-libre-5.4.12-gnu/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c
--- linux-libre-5.4.11-gnu/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c	2020-01-14 14:08:40.000000000 -0500
@@ -1590,7 +1590,7 @@ static int kvaser_usb_hydra_setup_endpoi
 	struct usb_endpoint_descriptor *ep;
 	int i;
 
-	iface_desc = &dev->intf->altsetting[0];
+	iface_desc = dev->intf->cur_altsetting;
 
 	for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
 		ep = &iface_desc->endpoint[i].desc;
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c linux-libre-5.4.12-gnu/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c
--- linux-libre-5.4.11-gnu/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c	2020-01-14 14:08:40.000000000 -0500
@@ -1310,7 +1310,7 @@ static int kvaser_usb_leaf_setup_endpoin
 	struct usb_endpoint_descriptor *endpoint;
 	int i;
 
-	iface_desc = &dev->intf->altsetting[0];
+	iface_desc = dev->intf->cur_altsetting;
 
 	for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
 		endpoint = &iface_desc->endpoint[i].desc;
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/net/wireless/ath/ath10k/usb.c linux-libre-5.4.12-gnu/drivers/net/wireless/ath/ath10k/usb.c
--- linux-libre-5.4.11-gnu/drivers/net/wireless/ath/ath10k/usb.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/net/wireless/ath/ath10k/usb.c	2020-01-14 14:08:40.000000000 -0500
@@ -443,6 +443,7 @@ static int ath10k_usb_hif_tx_sg(struct a
 			ath10k_dbg(ar, ATH10K_DBG_USB_BULK,
 				   "usb bulk transmit failed: %d\n", ret);
 			usb_unanchor_urb(urb);
+			usb_free_urb(urb);
 			ret = -EINVAL;
 			goto err_free_urb_to_pipe;
 		}
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/net/wireless/marvell/mwifiex/pcie.c linux-libre-5.4.12-gnu/drivers/net/wireless/marvell/mwifiex/pcie.c
--- linux-libre-5.4.11-gnu/drivers/net/wireless/marvell/mwifiex/pcie.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/net/wireless/marvell/mwifiex/pcie.c	2020-01-14 14:08:40.000000000 -0500
@@ -1032,8 +1032,10 @@ static int mwifiex_pcie_alloc_cmdrsp_buf
 	}
 	skb_put(skb, MWIFIEX_UPLD_SIZE);
 	if (mwifiex_map_pci_memory(adapter, skb, MWIFIEX_UPLD_SIZE,
-				   PCI_DMA_FROMDEVICE))
+				   PCI_DMA_FROMDEVICE)) {
+		kfree_skb(skb);
 		return -1;
+	}
 
 	card->cmdrsp_buf = skb;
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c linux-libre-5.4.12-gnu/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
--- linux-libre-5.4.11-gnu/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c	2020-01-14 14:08:40.000000000 -0500
@@ -229,6 +229,14 @@ static int mwifiex_process_country_ie(st
 			    "11D: skip setting domain info in FW\n");
 		return 0;
 	}
+
+	if (country_ie_len >
+	    (IEEE80211_COUNTRY_STRING_LEN + MWIFIEX_MAX_TRIPLET_802_11D)) {
+		mwifiex_dbg(priv->adapter, ERROR,
+			    "11D: country_ie_len overflow!, deauth AP\n");
+		return -EINVAL;
+	}
+
 	memcpy(priv->adapter->country_code, &country_ie[2], 2);
 
 	domain_info->country_code[0] = country_ie[2];
@@ -272,8 +280,9 @@ int mwifiex_bss_start(struct mwifiex_pri
 	priv->scan_block = false;
 
 	if (bss) {
-		if (adapter->region_code == 0x00)
-			mwifiex_process_country_ie(priv, bss);
+		if (adapter->region_code == 0x00 &&
+		    mwifiex_process_country_ie(priv, bss))
+			return -EINVAL;
 
 		/* Allocate and fill new bss descriptor */
 		bss_desc = kzalloc(sizeof(struct mwifiex_bssdescriptor),
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c linux-libre-5.4.12-gnu/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
--- linux-libre-5.4.11-gnu/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c	2020-01-12 08:45:03.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c	2020-01-14 16:00:24.000000000 -0500
@@ -5439,6 +5439,7 @@ static int rtl8xxxu_submit_int_urb(struc
 	ret = usb_submit_urb(urb, GFP_KERNEL);
 	if (ret) {
 		usb_unanchor_urb(urb);
+		usb_free_urb(urb);
 		goto error;
 	}
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/phy/motorola/phy-cpcap-usb.c linux-libre-5.4.12-gnu/drivers/phy/motorola/phy-cpcap-usb.c
--- linux-libre-5.4.11-gnu/drivers/phy/motorola/phy-cpcap-usb.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/phy/motorola/phy-cpcap-usb.c	2020-01-14 14:08:40.000000000 -0500
@@ -207,6 +207,19 @@ static int cpcap_phy_get_ints_state(stru
 static int cpcap_usb_set_uart_mode(struct cpcap_phy_ddata *ddata);
 static int cpcap_usb_set_usb_mode(struct cpcap_phy_ddata *ddata);
 
+static void cpcap_usb_try_musb_mailbox(struct cpcap_phy_ddata *ddata,
+				       enum musb_vbus_id_status status)
+{
+	int error;
+
+	error = musb_mailbox(status);
+	if (!error)
+		return;
+
+	dev_dbg(ddata->dev, "%s: musb_mailbox failed: %i\n",
+		__func__, error);
+}
+
 static void cpcap_usb_detect(struct work_struct *work)
 {
 	struct cpcap_phy_ddata *ddata;
@@ -226,9 +239,7 @@ static void cpcap_usb_detect(struct work
 		if (error)
 			goto out_err;
 
-		error = musb_mailbox(MUSB_ID_GROUND);
-		if (error)
-			goto out_err;
+		cpcap_usb_try_musb_mailbox(ddata, MUSB_ID_GROUND);
 
 		error = regmap_update_bits(ddata->reg, CPCAP_REG_USBC3,
 					   CPCAP_BIT_VBUSSTBY_EN |
@@ -257,9 +268,7 @@ static void cpcap_usb_detect(struct work
 			error = cpcap_usb_set_usb_mode(ddata);
 			if (error)
 				goto out_err;
-			error = musb_mailbox(MUSB_ID_GROUND);
-			if (error)
-				goto out_err;
+			cpcap_usb_try_musb_mailbox(ddata, MUSB_ID_GROUND);
 
 			return;
 		}
@@ -269,22 +278,18 @@ static void cpcap_usb_detect(struct work
 		error = cpcap_usb_set_usb_mode(ddata);
 		if (error)
 			goto out_err;
-		error = musb_mailbox(MUSB_VBUS_VALID);
-		if (error)
-			goto out_err;
+		cpcap_usb_try_musb_mailbox(ddata, MUSB_VBUS_VALID);
 
 		return;
 	}
 
+	cpcap_usb_try_musb_mailbox(ddata, MUSB_VBUS_OFF);
+
 	/* Default to debug UART mode */
 	error = cpcap_usb_set_uart_mode(ddata);
 	if (error)
 		goto out_err;
 
-	error = musb_mailbox(MUSB_VBUS_OFF);
-	if (error)
-		goto out_err;
-
 	dev_dbg(ddata->dev, "set UART mode\n");
 
 	return;
@@ -649,9 +654,7 @@ static int cpcap_usb_phy_remove(struct p
 	if (error)
 		dev_err(ddata->dev, "could not set UART mode\n");
 
-	error = musb_mailbox(MUSB_VBUS_OFF);
-	if (error)
-		dev_err(ddata->dev, "could not set mailbox\n");
+	cpcap_usb_try_musb_mailbox(ddata, MUSB_VBUS_OFF);
 
 	usb_remove_phy(&ddata->phy);
 	cancel_delayed_work_sync(&ddata->detect_work);
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/powercap/intel_rapl_common.c linux-libre-5.4.12-gnu/drivers/powercap/intel_rapl_common.c
--- linux-libre-5.4.11-gnu/drivers/powercap/intel_rapl_common.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/powercap/intel_rapl_common.c	2020-01-14 14:08:40.000000000 -0500
@@ -1293,6 +1293,9 @@ struct rapl_package *rapl_add_package(in
 	struct cpuinfo_x86 *c = &cpu_data(cpu);
 	int ret;
 
+	if (!rapl_defaults)
+		return ERR_PTR(-ENODEV);
+
 	rp = kzalloc(sizeof(struct rapl_package), GFP_KERNEL);
 	if (!rp)
 		return ERR_PTR(-ENOMEM);
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/rpmsg/rpmsg_char.c linux-libre-5.4.12-gnu/drivers/rpmsg/rpmsg_char.c
--- linux-libre-5.4.11-gnu/drivers/rpmsg/rpmsg_char.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/rpmsg/rpmsg_char.c	2020-01-14 14:08:40.000000000 -0500
@@ -227,8 +227,10 @@ static ssize_t rpmsg_eptdev_write_iter(s
 	if (!kbuf)
 		return -ENOMEM;
 
-	if (!copy_from_iter_full(kbuf, len, from))
-		return -EFAULT;
+	if (!copy_from_iter_full(kbuf, len, from)) {
+		ret = -EFAULT;
+		goto free_kbuf;
+	}
 
 	if (mutex_lock_interruptible(&eptdev->ept_lock)) {
 		ret = -ERESTARTSYS;
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/rtc/rtc-sun6i.c linux-libre-5.4.12-gnu/drivers/rtc/rtc-sun6i.c
--- linux-libre-5.4.11-gnu/drivers/rtc/rtc-sun6i.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/rtc/rtc-sun6i.c	2020-01-14 14:08:40.000000000 -0500
@@ -380,6 +380,22 @@ static void __init sun50i_h6_rtc_clk_ini
 CLK_OF_DECLARE_DRIVER(sun50i_h6_rtc_clk, "allwinner,sun50i-h6-rtc",
 		      sun50i_h6_rtc_clk_init);
 
+/*
+ * The R40 user manual is self-conflicting on whether the prescaler is
+ * fixed or configurable. The clock diagram shows it as fixed, but there
+ * is also a configurable divider in the RTC block.
+ */
+static const struct sun6i_rtc_clk_data sun8i_r40_rtc_data = {
+	.rc_osc_rate = 16000000,
+	.fixed_prescaler = 512,
+};
+static void __init sun8i_r40_rtc_clk_init(struct device_node *node)
+{
+	sun6i_rtc_clk_init(node, &sun8i_r40_rtc_data);
+}
+CLK_OF_DECLARE_DRIVER(sun8i_r40_rtc_clk, "allwinner,sun8i-r40-rtc",
+		      sun8i_r40_rtc_clk_init);
+
 static const struct sun6i_rtc_clk_data sun8i_v3_rtc_data = {
 	.rc_osc_rate = 32000,
 	.has_out_clk = 1,
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/scsi/bfa/bfad_attr.c linux-libre-5.4.12-gnu/drivers/scsi/bfa/bfad_attr.c
--- linux-libre-5.4.11-gnu/drivers/scsi/bfa/bfad_attr.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/scsi/bfa/bfad_attr.c	2020-01-14 14:08:40.000000000 -0500
@@ -275,8 +275,10 @@ bfad_im_get_stats(struct Scsi_Host *shos
 	rc = bfa_port_get_stats(BFA_FCPORT(&bfad->bfa),
 				fcstats, bfad_hcb_comp, &fcomp);
 	spin_unlock_irqrestore(&bfad->bfad_lock, flags);
-	if (rc != BFA_STATUS_OK)
+	if (rc != BFA_STATUS_OK) {
+		kfree(fcstats);
 		return NULL;
+	}
 
 	wait_for_completion(&fcomp.comp);
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/staging/comedi/drivers/adv_pci1710.c linux-libre-5.4.12-gnu/drivers/staging/comedi/drivers/adv_pci1710.c
--- linux-libre-5.4.11-gnu/drivers/staging/comedi/drivers/adv_pci1710.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/staging/comedi/drivers/adv_pci1710.c	2020-01-14 14:08:40.000000000 -0500
@@ -46,8 +46,8 @@
 #define PCI171X_RANGE_UNI	BIT(4)
 #define PCI171X_RANGE_GAIN(x)	(((x) & 0x7) << 0)
 #define PCI171X_MUX_REG		0x04	/* W:   A/D multiplexor control */
-#define PCI171X_MUX_CHANH(x)	(((x) & 0xf) << 8)
-#define PCI171X_MUX_CHANL(x)	(((x) & 0xf) << 0)
+#define PCI171X_MUX_CHANH(x)	(((x) & 0xff) << 8)
+#define PCI171X_MUX_CHANL(x)	(((x) & 0xff) << 0)
 #define PCI171X_MUX_CHAN(x)	(PCI171X_MUX_CHANH(x) | PCI171X_MUX_CHANL(x))
 #define PCI171X_STATUS_REG	0x06	/* R:   status register */
 #define PCI171X_STATUS_IRQ	BIT(11)	/* 1=IRQ occurred */
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c linux-libre-5.4.12-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c
--- linux-libre-5.4.11-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c	2020-01-14 14:08:40.000000000 -0500
@@ -37,6 +37,7 @@ static const struct usb_device_id rtw_us
 	{USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */
 	{USB_DEVICE(0x2001, 0x331B)}, /* D-Link DWA-121 rev B1 */
 	{USB_DEVICE(0x2357, 0x010c)}, /* TP-Link TL-WN722N v2 */
+	{USB_DEVICE(0x2357, 0x0111)}, /* TP-Link TL-WN727N v5.21 */
 	{USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */
 	{USB_DEVICE(USB_VENDER_ID_REALTEK, 0xffef)}, /* Rosewill RNX-N150NUB */
 	{}	/* Terminating entry */
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/staging/vt6656/baseband.c linux-libre-5.4.12-gnu/drivers/staging/vt6656/baseband.c
--- linux-libre-5.4.11-gnu/drivers/staging/vt6656/baseband.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/staging/vt6656/baseband.c	2020-01-14 14:08:40.000000000 -0500
@@ -449,8 +449,8 @@ int vnt_vt3184_init(struct vnt_private *
 
 	memcpy(array, addr, length);
 
-	ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0,
-			      MESSAGE_REQUEST_BBREG, length, array);
+	ret = vnt_control_out_blocks(priv, VNT_REG_BLOCK_SIZE,
+				     MESSAGE_REQUEST_BBREG, length, array);
 	if (ret)
 		goto end;
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/staging/vt6656/card.c linux-libre-5.4.12-gnu/drivers/staging/vt6656/card.c
--- linux-libre-5.4.11-gnu/drivers/staging/vt6656/card.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/staging/vt6656/card.c	2020-01-14 14:08:40.000000000 -0500
@@ -719,7 +719,7 @@ end:
  */
 int vnt_radio_power_on(struct vnt_private *priv)
 {
-	int ret = true;
+	int ret = 0;
 
 	vnt_exit_deep_sleep(priv);
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/staging/vt6656/device.h linux-libre-5.4.12-gnu/drivers/staging/vt6656/device.h
--- linux-libre-5.4.11-gnu/drivers/staging/vt6656/device.h	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/staging/vt6656/device.h	2020-01-14 14:08:40.000000000 -0500
@@ -259,6 +259,7 @@ struct vnt_private {
 	u8 mac_hw;
 	/* netdev */
 	struct usb_device *usb;
+	struct usb_interface *intf;
 
 	u64 tsf_time;
 	u8 rx_rate;
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/staging/vt6656/main_usb.c linux-libre-5.4.12-gnu/drivers/staging/vt6656/main_usb.c
--- linux-libre-5.4.11-gnu/drivers/staging/vt6656/main_usb.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/staging/vt6656/main_usb.c	2020-01-14 14:08:40.000000000 -0500
@@ -950,7 +950,7 @@ static const struct ieee80211_ops vnt_ma
 
 int vnt_init(struct vnt_private *priv)
 {
-	if (!(vnt_init_registers(priv)))
+	if (vnt_init_registers(priv))
 		return -EAGAIN;
 
 	SET_IEEE80211_PERM_ADDR(priv->hw, priv->permanent_net_addr);
@@ -993,6 +993,7 @@ vt6656_probe(struct usb_interface *intf,
 	priv = hw->priv;
 	priv->hw = hw;
 	priv->usb = udev;
+	priv->intf = intf;
 
 	vnt_set_options(priv);
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/staging/vt6656/usbpipe.c linux-libre-5.4.12-gnu/drivers/staging/vt6656/usbpipe.c
--- linux-libre-5.4.11-gnu/drivers/staging/vt6656/usbpipe.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/staging/vt6656/usbpipe.c	2020-01-14 14:08:40.000000000 -0500
@@ -59,7 +59,9 @@ int vnt_control_out(struct vnt_private *
 
 	kfree(usb_buffer);
 
-	if (ret >= 0 && ret < (int)length)
+	if (ret == (int)length)
+		ret = 0;
+	else
 		ret = -EIO;
 
 end_unlock:
@@ -74,6 +76,23 @@ int vnt_control_out_u8(struct vnt_privat
 			       reg_off, reg, sizeof(u8), &data);
 }
 
+int vnt_control_out_blocks(struct vnt_private *priv,
+			   u16 block, u8 reg, u16 length, u8 *data)
+{
+	int ret = 0, i;
+
+	for (i = 0; i < length; i += block) {
+		u16 len = min_t(int, length - i, block);
+
+		ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE,
+				      i, reg, len, data + i);
+		if (ret)
+			goto end;
+	}
+end:
+	return ret;
+}
+
 int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
 		   u16 index, u16 length, u8 *buffer)
 {
@@ -103,7 +122,9 @@ int vnt_control_in(struct vnt_private *p
 
 	kfree(usb_buffer);
 
-	if (ret >= 0 && ret < (int)length)
+	if (ret == (int)length)
+		ret = 0;
+	else
 		ret = -EIO;
 
 end_unlock:
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/staging/vt6656/usbpipe.h linux-libre-5.4.12-gnu/drivers/staging/vt6656/usbpipe.h
--- linux-libre-5.4.11-gnu/drivers/staging/vt6656/usbpipe.h	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/staging/vt6656/usbpipe.h	2020-01-14 14:08:40.000000000 -0500
@@ -18,6 +18,8 @@
 
 #include "device.h"
 
+#define VNT_REG_BLOCK_SIZE	64
+
 int vnt_control_out(struct vnt_private *priv, u8 request, u16 value,
 		    u16 index, u16 length, u8 *buffer);
 int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
@@ -26,6 +28,9 @@ int vnt_control_in(struct vnt_private *p
 int vnt_control_out_u8(struct vnt_private *priv, u8 reg, u8 ref_off, u8 data);
 int vnt_control_in_u8(struct vnt_private *priv, u8 reg, u8 reg_off, u8 *data);
 
+int vnt_control_out_blocks(struct vnt_private *priv,
+			   u16 block, u8 reg, u16 len, u8 *data);
+
 int vnt_start_interrupt_urb(struct vnt_private *priv);
 int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb);
 int vnt_tx_context(struct vnt_private *priv,
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/staging/vt6656/wcmd.c linux-libre-5.4.12-gnu/drivers/staging/vt6656/wcmd.c
--- linux-libre-5.4.11-gnu/drivers/staging/vt6656/wcmd.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/staging/vt6656/wcmd.c	2020-01-14 14:08:40.000000000 -0500
@@ -99,6 +99,7 @@ void vnt_run_command(struct work_struct
 		if (vnt_init(priv)) {
 			/* If fail all ends TODO retry */
 			dev_err(&priv->usb->dev, "failed to start\n");
+			usb_set_intfdata(priv->intf, NULL);
 			ieee80211_free_hw(priv->hw);
 			return;
 		}
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/tty/serdev/core.c linux-libre-5.4.12-gnu/drivers/tty/serdev/core.c
--- linux-libre-5.4.11-gnu/drivers/tty/serdev/core.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/tty/serdev/core.c	2020-01-14 14:08:40.000000000 -0500
@@ -582,6 +582,12 @@ static acpi_status acpi_serdev_register_
 	return AE_OK;
 }
 
+static const struct acpi_device_id serdev_acpi_devices_blacklist[] = {
+	{ "INT3511", 0 },
+	{ "INT3512", 0 },
+	{ },
+};
+
 static acpi_status acpi_serdev_add_device(acpi_handle handle, u32 level,
 				       void *data, void **return_value)
 {
@@ -591,6 +597,10 @@ static acpi_status acpi_serdev_add_devic
 	if (acpi_bus_get_device(handle, &adev))
 		return AE_OK;
 
+	/* Skip if black listed */
+	if (!acpi_match_device_ids(adev, serdev_acpi_devices_blacklist))
+		return AE_OK;
+
 	return acpi_serdev_register_device(ctrl, adev);
 }
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/tty/serial/serial_core.c linux-libre-5.4.12-gnu/drivers/tty/serial/serial_core.c
--- linux-libre-5.4.11-gnu/drivers/tty/serial/serial_core.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/tty/serial/serial_core.c	2020-01-14 14:08:40.000000000 -0500
@@ -2834,6 +2834,7 @@ int uart_add_one_port(struct uart_driver
 	if (uport->cons && uport->dev)
 		of_console_check(uport->dev->of_node, uport->cons->name, uport->line);
 
+	tty_port_link_device(port, drv->tty_driver, uport->line);
 	uart_configure_port(drv, state, uport);
 
 	port->console = uart_console(uport);
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/usb/cdns3/gadget.c linux-libre-5.4.12-gnu/drivers/usb/cdns3/gadget.c
--- linux-libre-5.4.11-gnu/drivers/usb/cdns3/gadget.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/usb/cdns3/gadget.c	2020-01-14 14:08:40.000000000 -0500
@@ -1375,13 +1375,10 @@ static void cdns3_check_usb_interrupt_pr
  */
 static irqreturn_t cdns3_device_irq_handler(int irq, void *data)
 {
-	struct cdns3_device *priv_dev;
-	struct cdns3 *cdns = data;
+	struct cdns3_device *priv_dev = data;
 	irqreturn_t ret = IRQ_NONE;
 	u32 reg;
 
-	priv_dev = cdns->gadget_dev;
-
 	/* check USB device interrupt */
 	reg = readl(&priv_dev->regs->usb_ists);
 	if (reg) {
@@ -1419,14 +1416,12 @@ static irqreturn_t cdns3_device_irq_hand
  */
 static irqreturn_t cdns3_device_thread_irq_handler(int irq, void *data)
 {
-	struct cdns3_device *priv_dev;
-	struct cdns3 *cdns = data;
+	struct cdns3_device *priv_dev = data;
 	irqreturn_t ret = IRQ_NONE;
 	unsigned long flags;
 	int bit;
 	u32 reg;
 
-	priv_dev = cdns->gadget_dev;
 	spin_lock_irqsave(&priv_dev->lock, flags);
 
 	reg = readl(&priv_dev->regs->usb_ists);
@@ -2539,7 +2534,7 @@ void cdns3_gadget_exit(struct cdns3 *cdn
 
 	priv_dev = cdns->gadget_dev;
 
-	devm_free_irq(cdns->dev, cdns->dev_irq, cdns);
+	devm_free_irq(cdns->dev, cdns->dev_irq, priv_dev);
 
 	pm_runtime_mark_last_busy(cdns->dev);
 	pm_runtime_put_autosuspend(cdns->dev);
@@ -2710,7 +2705,8 @@ static int __cdns3_gadget_init(struct cd
 	ret = devm_request_threaded_irq(cdns->dev, cdns->dev_irq,
 					cdns3_device_irq_handler,
 					cdns3_device_thread_irq_handler,
-					IRQF_SHARED, dev_name(cdns->dev), cdns);
+					IRQF_SHARED, dev_name(cdns->dev),
+					cdns->gadget_dev);
 
 	if (ret)
 		goto err0;
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/usb/chipidea/host.c linux-libre-5.4.12-gnu/drivers/usb/chipidea/host.c
--- linux-libre-5.4.11-gnu/drivers/usb/chipidea/host.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/usb/chipidea/host.c	2020-01-14 14:08:40.000000000 -0500
@@ -26,6 +26,7 @@ static int (*orig_bus_suspend)(struct us
 
 struct ehci_ci_priv {
 	struct regulator *reg_vbus;
+	bool enabled;
 };
 
 static int ehci_ci_portpower(struct usb_hcd *hcd, int portnum, bool enable)
@@ -37,7 +38,7 @@ static int ehci_ci_portpower(struct usb_
 	int ret = 0;
 	int port = HCS_N_PORTS(ehci->hcs_params);
 
-	if (priv->reg_vbus) {
+	if (priv->reg_vbus && enable != priv->enabled) {
 		if (port > 1) {
 			dev_warn(dev,
 				"Not support multi-port regulator control\n");
@@ -53,6 +54,7 @@ static int ehci_ci_portpower(struct usb_
 				enable ? "enable" : "disable", ret);
 			return ret;
 		}
+		priv->enabled = enable;
 	}
 
 	if (enable && (ci->platdata->phy_mode == USBPHY_INTERFACE_MODE_HSIC)) {
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/usb/core/config.c linux-libre-5.4.12-gnu/drivers/usb/core/config.c
--- linux-libre-5.4.11-gnu/drivers/usb/core/config.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/usb/core/config.c	2020-01-14 14:08:40.000000000 -0500
@@ -392,12 +392,16 @@ static int usb_parse_endpoint(struct dev
 			endpoint->desc.wMaxPacketSize = cpu_to_le16(8);
 	}
 
-	/* Validate the wMaxPacketSize field */
+	/*
+	 * Validate the wMaxPacketSize field.
+	 * Some devices have isochronous endpoints in altsetting 0;
+	 * the USB-2 spec requires such endpoints to have wMaxPacketSize = 0
+	 * (see the end of section 5.6.3), so don't warn about them.
+	 */
 	maxp = usb_endpoint_maxp(&endpoint->desc);
-	if (maxp == 0) {
-		dev_warn(ddev, "config %d interface %d altsetting %d endpoint 0x%X has wMaxPacketSize 0, skipping\n",
+	if (maxp == 0 && !(usb_endpoint_xfer_isoc(d) && asnum == 0)) {
+		dev_warn(ddev, "config %d interface %d altsetting %d endpoint 0x%X has invalid wMaxPacketSize 0\n",
 		    cfgno, inum, asnum, d->bEndpointAddress);
-		goto skip_to_next_endpoint_or_interface_descriptor;
 	}
 
 	/* Find the highest legal maxpacket size for this endpoint */
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/usb/host/ohci-da8xx.c linux-libre-5.4.12-gnu/drivers/usb/host/ohci-da8xx.c
--- linux-libre-5.4.11-gnu/drivers/usb/host/ohci-da8xx.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/usb/host/ohci-da8xx.c	2020-01-14 14:08:40.000000000 -0500
@@ -415,13 +415,17 @@ static int ohci_da8xx_probe(struct platf
 	}
 
 	da8xx_ohci->oc_gpio = devm_gpiod_get_optional(dev, "oc", GPIOD_IN);
-	if (IS_ERR(da8xx_ohci->oc_gpio))
+	if (IS_ERR(da8xx_ohci->oc_gpio)) {
+		error = PTR_ERR(da8xx_ohci->oc_gpio);
 		goto err;
+	}
 
 	if (da8xx_ohci->oc_gpio) {
 		oc_irq = gpiod_to_irq(da8xx_ohci->oc_gpio);
-		if (oc_irq < 0)
+		if (oc_irq < 0) {
+			error = oc_irq;
 			goto err;
+		}
 
 		error = devm_request_threaded_irq(dev, oc_irq, NULL,
 				ohci_da8xx_oc_thread, IRQF_TRIGGER_RISING |
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/usb/musb/musb_core.c linux-libre-5.4.12-gnu/drivers/usb/musb/musb_core.c
--- linux-libre-5.4.11-gnu/drivers/usb/musb/musb_core.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/usb/musb/musb_core.c	2020-01-14 14:08:40.000000000 -0500
@@ -1840,6 +1840,9 @@ ATTRIBUTE_GROUPS(musb);
 #define MUSB_QUIRK_B_INVALID_VBUS_91	(MUSB_DEVCTL_BDEVICE | \
 					 (2 << MUSB_DEVCTL_VBUS_SHIFT) | \
 					 MUSB_DEVCTL_SESSION)
+#define MUSB_QUIRK_B_DISCONNECT_99	(MUSB_DEVCTL_BDEVICE | \
+					 (3 << MUSB_DEVCTL_VBUS_SHIFT) | \
+					 MUSB_DEVCTL_SESSION)
 #define MUSB_QUIRK_A_DISCONNECT_19	((3 << MUSB_DEVCTL_VBUS_SHIFT) | \
 					 MUSB_DEVCTL_SESSION)
 
@@ -1862,6 +1865,11 @@ static void musb_pm_runtime_check_sessio
 	s = MUSB_DEVCTL_FSDEV | MUSB_DEVCTL_LSDEV |
 		MUSB_DEVCTL_HR;
 	switch (devctl & ~s) {
+	case MUSB_QUIRK_B_DISCONNECT_99:
+		musb_dbg(musb, "Poll devctl in case of suspend after disconnect\n");
+		schedule_delayed_work(&musb->irq_work,
+				      msecs_to_jiffies(1000));
+		break;
 	case MUSB_QUIRK_B_INVALID_VBUS_91:
 		if (musb->quirk_retries && !musb->flush_irq_work) {
 			musb_dbg(musb,
@@ -2310,6 +2318,9 @@ musb_init_controller(struct device *dev,
 	musb_disable_interrupts(musb);
 	musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
 
+	/* MUSB_POWER_SOFTCONN might be already set, JZ4740 does this. */
+	musb_writeb(musb->mregs, MUSB_POWER, 0);
+
 	/* Init IRQ workqueue before request_irq */
 	INIT_DELAYED_WORK(&musb->irq_work, musb_irq_work);
 	INIT_DELAYED_WORK(&musb->deassert_reset_work, musb_deassert_reset);
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/usb/musb/musbhsdma.c linux-libre-5.4.12-gnu/drivers/usb/musb/musbhsdma.c
--- linux-libre-5.4.11-gnu/drivers/usb/musb/musbhsdma.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/usb/musb/musbhsdma.c	2020-01-14 14:08:40.000000000 -0500
@@ -425,7 +425,7 @@ struct dma_controller *musbhs_dma_contro
 	controller->controller.channel_abort = dma_channel_abort;
 
 	if (request_irq(irq, dma_controller_irq, 0,
-			dev_name(musb->controller), &controller->controller)) {
+			dev_name(musb->controller), controller)) {
 		dev_err(dev, "request_irq %d failed!\n", irq);
 		musb_dma_controller_destroy(&controller->controller);
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/usb/serial/option.c linux-libre-5.4.12-gnu/drivers/usb/serial/option.c
--- linux-libre-5.4.11-gnu/drivers/usb/serial/option.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/usb/serial/option.c	2020-01-14 14:08:40.000000000 -0500
@@ -567,6 +567,9 @@ static void option_instat_callback(struc
 /* Interface must have two endpoints */
 #define NUMEP2		BIT(16)
 
+/* Device needs ZLP */
+#define ZLP		BIT(17)
+
 
 static const struct usb_device_id option_ids[] = {
 	{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
@@ -1198,6 +1201,8 @@ static const struct usb_device_id option
 	  .driver_info = NCTRL(0) | RSVD(1) },
 	{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1901, 0xff),	/* Telit LN940 (MBIM) */
 	  .driver_info = NCTRL(0) },
+	{ USB_DEVICE(TELIT_VENDOR_ID, 0x9010),				/* Telit SBL FN980 flashing device */
+	  .driver_info = NCTRL(0) | ZLP },
 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */
 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff),
 	  .driver_info = RSVD(1) },
@@ -2099,6 +2104,9 @@ static int option_attach(struct usb_seri
 	if (!(device_flags & NCTRL(iface_desc->bInterfaceNumber)))
 		data->use_send_setup = 1;
 
+	if (device_flags & ZLP)
+		data->use_zlp = 1;
+
 	spin_lock_init(&data->susp_lock);
 
 	usb_set_serial_data(serial, data);
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/usb/serial/usb_wwan.c linux-libre-5.4.12-gnu/drivers/usb/serial/usb_wwan.c
--- linux-libre-5.4.11-gnu/drivers/usb/serial/usb_wwan.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/usb/serial/usb_wwan.c	2020-01-14 14:08:40.000000000 -0500
@@ -461,6 +461,7 @@ static struct urb *usb_wwan_setup_urb(st
 				      void (*callback) (struct urb *))
 {
 	struct usb_serial *serial = port->serial;
+	struct usb_wwan_intf_private *intfdata = usb_get_serial_data(serial);
 	struct urb *urb;
 
 	urb = usb_alloc_urb(0, GFP_KERNEL);	/* No ISO */
@@ -471,6 +472,9 @@ static struct urb *usb_wwan_setup_urb(st
 			  usb_sndbulkpipe(serial->dev, endpoint) | dir,
 			  buf, len, callback, ctx);
 
+	if (intfdata->use_zlp && dir == USB_DIR_OUT)
+		urb->transfer_flags |= URB_ZERO_PACKET;
+
 	return urb;
 }
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/usb/serial/usb-wwan.h linux-libre-5.4.12-gnu/drivers/usb/serial/usb-wwan.h
--- linux-libre-5.4.11-gnu/drivers/usb/serial/usb-wwan.h	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/usb/serial/usb-wwan.h	2020-01-14 14:08:40.000000000 -0500
@@ -38,6 +38,7 @@ struct usb_wwan_intf_private {
 	spinlock_t susp_lock;
 	unsigned int suspended:1;
 	unsigned int use_send_setup:1;
+	unsigned int use_zlp:1;
 	int in_flight;
 	unsigned int open_ports;
 	void *private;
diff -druNp --no-dereference linux-libre-5.4.11-gnu/drivers/usb/typec/tcpm/tcpci.c linux-libre-5.4.12-gnu/drivers/usb/typec/tcpm/tcpci.c
--- linux-libre-5.4.11-gnu/drivers/usb/typec/tcpm/tcpci.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/drivers/usb/typec/tcpm/tcpci.c	2020-01-14 14:08:40.000000000 -0500
@@ -432,20 +432,30 @@ irqreturn_t tcpci_irq(struct tcpci *tcpc
 
 	if (status & TCPC_ALERT_RX_STATUS) {
 		struct pd_message msg;
-		unsigned int cnt;
+		unsigned int cnt, payload_cnt;
 		u16 header;
 
 		regmap_read(tcpci->regmap, TCPC_RX_BYTE_CNT, &cnt);
+		/*
+		 * 'cnt' corresponds to READABLE_BYTE_COUNT in section 4.4.14
+		 * of the TCPCI spec [Rev 2.0 Ver 1.0 October 2017] and is
+		 * defined in table 4-36 as one greater than the number of
+		 * bytes received. And that number includes the header. So:
+		 */
+		if (cnt > 3)
+			payload_cnt = cnt - (1 + sizeof(msg.header));
+		else
+			payload_cnt = 0;
 
 		tcpci_read16(tcpci, TCPC_RX_HDR, &header);
 		msg.header = cpu_to_le16(header);
 
-		if (WARN_ON(cnt > sizeof(msg.payload)))
-			cnt = sizeof(msg.payload);
+		if (WARN_ON(payload_cnt > sizeof(msg.payload)))
+			payload_cnt = sizeof(msg.payload);
 
-		if (cnt > 0)
+		if (payload_cnt > 0)
 			regmap_raw_read(tcpci->regmap, TCPC_RX_DATA,
-					&msg.payload, cnt);
+					&msg.payload, payload_cnt);
 
 		/* Read complete, clear RX status alert bit */
 		tcpci_write16(tcpci, TCPC_ALERT, TCPC_ALERT_RX_STATUS);
diff -druNp --no-dereference linux-libre-5.4.11-gnu/fs/char_dev.c linux-libre-5.4.12-gnu/fs/char_dev.c
--- linux-libre-5.4.11-gnu/fs/char_dev.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/fs/char_dev.c	2020-01-14 14:08:40.000000000 -0500
@@ -352,7 +352,7 @@ static struct kobject *cdev_get(struct c
 
 	if (owner && !try_module_get(owner))
 		return NULL;
-	kobj = kobject_get(&p->kobj);
+	kobj = kobject_get_unless_zero(&p->kobj);
 	if (!kobj)
 		module_put(owner);
 	return kobj;
diff -druNp --no-dereference linux-libre-5.4.11-gnu/fs/pstore/ram.c linux-libre-5.4.12-gnu/fs/pstore/ram.c
--- linux-libre-5.4.11-gnu/fs/pstore/ram.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/fs/pstore/ram.c	2020-01-14 14:08:40.000000000 -0500
@@ -583,12 +583,12 @@ static int ramoops_init_przs(const char
 		prz_ar[i] = persistent_ram_new(*paddr, zone_sz, sig,
 					       &cxt->ecc_info,
 					       cxt->memtype, flags, label);
+		kfree(label);
 		if (IS_ERR(prz_ar[i])) {
 			err = PTR_ERR(prz_ar[i]);
 			dev_err(dev, "failed to request %s mem region (0x%zx@0x%llx): %d\n",
 				name, record_size,
 				(unsigned long long)*paddr, err);
-			kfree(label);
 
 			while (i > 0) {
 				i--;
@@ -629,12 +629,12 @@ static int ramoops_init_prz(const char *
 	label = kasprintf(GFP_KERNEL, "ramoops:%s", name);
 	*prz = persistent_ram_new(*paddr, sz, sig, &cxt->ecc_info,
 				  cxt->memtype, PRZ_FLAG_ZAP_OLD, label);
+	kfree(label);
 	if (IS_ERR(*prz)) {
 		int err = PTR_ERR(*prz);
 
 		dev_err(dev, "failed to request %s mem region (0x%zx@0x%llx): %d\n",
 			name, sz, (unsigned long long)*paddr, err);
-		kfree(label);
 		return err;
 	}
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/fs/pstore/ram_core.c linux-libre-5.4.12-gnu/fs/pstore/ram_core.c
--- linux-libre-5.4.11-gnu/fs/pstore/ram_core.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/fs/pstore/ram_core.c	2020-01-14 14:08:40.000000000 -0500
@@ -574,7 +574,7 @@ struct persistent_ram_zone *persistent_r
 	/* Initialize general buffer state. */
 	raw_spin_lock_init(&prz->buffer_lock);
 	prz->flags = flags;
-	prz->label = label;
+	prz->label = kstrdup(label, GFP_KERNEL);
 
 	ret = persistent_ram_buffer_map(start, size, prz, memtype);
 	if (ret)
diff -druNp --no-dereference linux-libre-5.4.11-gnu/include/linux/can/dev.h linux-libre-5.4.12-gnu/include/linux/can/dev.h
--- linux-libre-5.4.11-gnu/include/linux/can/dev.h	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/include/linux/can/dev.h	2020-01-14 14:08:40.000000000 -0500
@@ -18,6 +18,7 @@
 #include <linux/can/error.h>
 #include <linux/can/led.h>
 #include <linux/can/netlink.h>
+#include <linux/can/skb.h>
 #include <linux/netdevice.h>
 
 /*
@@ -91,6 +92,36 @@ struct can_priv {
 #define get_can_dlc(i)		(min_t(__u8, (i), CAN_MAX_DLC))
 #define get_canfd_dlc(i)	(min_t(__u8, (i), CANFD_MAX_DLC))
 
+/* Check for outgoing skbs that have not been created by the CAN subsystem */
+static inline bool can_skb_headroom_valid(struct net_device *dev,
+					  struct sk_buff *skb)
+{
+	/* af_packet creates a headroom of HH_DATA_MOD bytes which is fine */
+	if (WARN_ON_ONCE(skb_headroom(skb) < sizeof(struct can_skb_priv)))
+		return false;
+
+	/* af_packet does not apply CAN skb specific settings */
+	if (skb->ip_summed == CHECKSUM_NONE) {
+		/* init headroom */
+		can_skb_prv(skb)->ifindex = dev->ifindex;
+		can_skb_prv(skb)->skbcnt = 0;
+
+		skb->ip_summed = CHECKSUM_UNNECESSARY;
+
+		/* preform proper loopback on capable devices */
+		if (dev->flags & IFF_ECHO)
+			skb->pkt_type = PACKET_LOOPBACK;
+		else
+			skb->pkt_type = PACKET_HOST;
+
+		skb_reset_mac_header(skb);
+		skb_reset_network_header(skb);
+		skb_reset_transport_header(skb);
+	}
+
+	return true;
+}
+
 /* Drop a given socketbuffer if it does not contain a valid CAN frame. */
 static inline bool can_dropped_invalid_skb(struct net_device *dev,
 					  struct sk_buff *skb)
@@ -108,6 +139,9 @@ static inline bool can_dropped_invalid_s
 	} else
 		goto inval_skb;
 
+	if (!can_skb_headroom_valid(dev, skb))
+		goto inval_skb;
+
 	return false;
 
 inval_skb:
diff -druNp --no-dereference linux-libre-5.4.11-gnu/include/trace/events/preemptirq.h linux-libre-5.4.12-gnu/include/trace/events/preemptirq.h
--- linux-libre-5.4.11-gnu/include/trace/events/preemptirq.h	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/include/trace/events/preemptirq.h	2020-01-14 14:08:40.000000000 -0500
@@ -18,13 +18,13 @@ DECLARE_EVENT_CLASS(preemptirq_template,
 	TP_ARGS(ip, parent_ip),
 
 	TP_STRUCT__entry(
-		__field(u32, caller_offs)
-		__field(u32, parent_offs)
+		__field(s32, caller_offs)
+		__field(s32, parent_offs)
 	),
 
 	TP_fast_assign(
-		__entry->caller_offs = (u32)(ip - (unsigned long)_stext);
-		__entry->parent_offs = (u32)(parent_ip - (unsigned long)_stext);
+		__entry->caller_offs = (s32)(ip - (unsigned long)_stext);
+		__entry->parent_offs = (s32)(parent_ip - (unsigned long)_stext);
 	),
 
 	TP_printk("caller=%pS parent=%pS",
diff -druNp --no-dereference linux-libre-5.4.11-gnu/include/uapi/linux/input.h linux-libre-5.4.12-gnu/include/uapi/linux/input.h
--- linux-libre-5.4.11-gnu/include/uapi/linux/input.h	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/include/uapi/linux/input.h	2020-01-14 14:08:40.000000000 -0500
@@ -34,6 +34,7 @@ struct input_event {
 	__kernel_ulong_t __sec;
 #if defined(__sparc__) && defined(__arch64__)
 	unsigned int __usec;
+	unsigned int __pad;
 #else
 	__kernel_ulong_t __usec;
 #endif
diff -druNp --no-dereference linux-libre-5.4.11-gnu/kernel/fork.c linux-libre-5.4.12-gnu/kernel/fork.c
--- linux-libre-5.4.11-gnu/kernel/fork.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/kernel/fork.c	2020-01-14 14:08:40.000000000 -0500
@@ -2513,6 +2513,16 @@ SYSCALL_DEFINE5(clone, unsigned long, cl
 #endif
 
 #ifdef __ARCH_WANT_SYS_CLONE3
+
+/*
+ * copy_thread implementations handle CLONE_SETTLS by reading the TLS value from
+ * the registers containing the syscall arguments for clone. This doesn't work
+ * with clone3 since the TLS value is passed in clone_args instead.
+ */
+#ifndef CONFIG_HAVE_COPY_THREAD_TLS
+#error clone3 requires copy_thread_tls support in arch
+#endif
+
 noinline static int copy_clone_args_from_user(struct kernel_clone_args *kargs,
 					      struct clone_args __user *uargs,
 					      size_t usize)
diff -druNp --no-dereference linux-libre-5.4.11-gnu/kernel/trace/trace_sched_wakeup.c linux-libre-5.4.12-gnu/kernel/trace/trace_sched_wakeup.c
--- linux-libre-5.4.11-gnu/kernel/trace/trace_sched_wakeup.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/kernel/trace/trace_sched_wakeup.c	2020-01-14 14:08:40.000000000 -0500
@@ -630,7 +630,7 @@ static void start_wakeup_tracer(struct t
 	if (ret) {
 		pr_info("wakeup trace: Couldn't activate tracepoint"
 			" probe to kernel_sched_migrate_task\n");
-		return;
+		goto fail_deprobe_sched_switch;
 	}
 
 	wakeup_reset(tr);
@@ -648,6 +648,8 @@ static void start_wakeup_tracer(struct t
 		printk(KERN_ERR "failed to start wakeup tracer\n");
 
 	return;
+fail_deprobe_sched_switch:
+	unregister_trace_sched_switch(probe_wakeup_sched_switch, NULL);
 fail_deprobe_wake_new:
 	unregister_trace_sched_wakeup_new(probe_wakeup, NULL);
 fail_deprobe:
diff -druNp --no-dereference linux-libre-5.4.11-gnu/kernel/trace/trace_stack.c linux-libre-5.4.12-gnu/kernel/trace/trace_stack.c
--- linux-libre-5.4.11-gnu/kernel/trace/trace_stack.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/kernel/trace/trace_stack.c	2020-01-14 14:08:40.000000000 -0500
@@ -283,6 +283,11 @@ static void check_stack(unsigned long ip
 	local_irq_restore(flags);
 }
 
+/* Some archs may not define MCOUNT_INSN_SIZE */
+#ifndef MCOUNT_INSN_SIZE
+# define MCOUNT_INSN_SIZE 0
+#endif
+
 static void
 stack_trace_call(unsigned long ip, unsigned long parent_ip,
 		 struct ftrace_ops *op, struct pt_regs *pt_regs)
diff -druNp --no-dereference linux-libre-5.4.11-gnu/Makefile linux-libre-5.4.12-gnu/Makefile
--- linux-libre-5.4.11-gnu/Makefile	2020-01-12 08:23:09.000000000 -0500
+++ linux-libre-5.4.12-gnu/Makefile	2020-01-14 15:37:28.000000000 -0500
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 VERSION = 5
 PATCHLEVEL = 4
-SUBLEVEL = 11
+SUBLEVEL = 12
 EXTRAVERSION = -gnu
 NAME = Kleptomaniac Octopus
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/net/ipv4/netfilter/arp_tables.c linux-libre-5.4.12-gnu/net/ipv4/netfilter/arp_tables.c
--- linux-libre-5.4.11-gnu/net/ipv4/netfilter/arp_tables.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/net/ipv4/netfilter/arp_tables.c	2020-01-14 14:08:40.000000000 -0500
@@ -384,10 +384,11 @@ next:		;
 	return 1;
 }
 
-static inline int check_target(struct arpt_entry *e, const char *name)
+static int check_target(struct arpt_entry *e, struct net *net, const char *name)
 {
 	struct xt_entry_target *t = arpt_get_target(e);
 	struct xt_tgchk_param par = {
+		.net       = net,
 		.table     = name,
 		.entryinfo = e,
 		.target    = t->u.kernel.target,
@@ -399,8 +400,9 @@ static inline int check_target(struct ar
 	return xt_check_target(&par, t->u.target_size - sizeof(*t), 0, false);
 }
 
-static inline int
-find_check_entry(struct arpt_entry *e, const char *name, unsigned int size,
+static int
+find_check_entry(struct arpt_entry *e, struct net *net, const char *name,
+		 unsigned int size,
 		 struct xt_percpu_counter_alloc_state *alloc_state)
 {
 	struct xt_entry_target *t;
@@ -419,7 +421,7 @@ find_check_entry(struct arpt_entry *e, c
 	}
 	t->u.kernel.target = target;
 
-	ret = check_target(e, name);
+	ret = check_target(e, net, name);
 	if (ret)
 		goto err;
 	return 0;
@@ -512,7 +514,9 @@ static inline void cleanup_entry(struct
 /* Checks and translates the user-supplied table segment (held in
  * newinfo).
  */
-static int translate_table(struct xt_table_info *newinfo, void *entry0,
+static int translate_table(struct net *net,
+			   struct xt_table_info *newinfo,
+			   void *entry0,
 			   const struct arpt_replace *repl)
 {
 	struct xt_percpu_counter_alloc_state alloc_state = { 0 };
@@ -569,7 +573,7 @@ static int translate_table(struct xt_tab
 	/* Finally, each sanity check must pass */
 	i = 0;
 	xt_entry_foreach(iter, entry0, newinfo->size) {
-		ret = find_check_entry(iter, repl->name, repl->size,
+		ret = find_check_entry(iter, net, repl->name, repl->size,
 				       &alloc_state);
 		if (ret != 0)
 			break;
@@ -974,7 +978,7 @@ static int do_replace(struct net *net, c
 		goto free_newinfo;
 	}
 
-	ret = translate_table(newinfo, loc_cpu_entry, &tmp);
+	ret = translate_table(net, newinfo, loc_cpu_entry, &tmp);
 	if (ret != 0)
 		goto free_newinfo;
 
@@ -1149,7 +1153,8 @@ compat_copy_entry_from_user(struct compa
 	}
 }
 
-static int translate_compat_table(struct xt_table_info **pinfo,
+static int translate_compat_table(struct net *net,
+				  struct xt_table_info **pinfo,
 				  void **pentry0,
 				  const struct compat_arpt_replace *compatr)
 {
@@ -1217,7 +1222,7 @@ static int translate_compat_table(struct
 	repl.num_counters = 0;
 	repl.counters = NULL;
 	repl.size = newinfo->size;
-	ret = translate_table(newinfo, entry1, &repl);
+	ret = translate_table(net, newinfo, entry1, &repl);
 	if (ret)
 		goto free_newinfo;
 
@@ -1270,7 +1275,7 @@ static int compat_do_replace(struct net
 		goto free_newinfo;
 	}
 
-	ret = translate_compat_table(&newinfo, &loc_cpu_entry, &tmp);
+	ret = translate_compat_table(net, &newinfo, &loc_cpu_entry, &tmp);
 	if (ret != 0)
 		goto free_newinfo;
 
@@ -1546,7 +1551,7 @@ int arpt_register_table(struct net *net,
 	loc_cpu_entry = newinfo->entries;
 	memcpy(loc_cpu_entry, repl->entries, repl->size);
 
-	ret = translate_table(newinfo, loc_cpu_entry, repl);
+	ret = translate_table(net, newinfo, loc_cpu_entry, repl);
 	if (ret != 0)
 		goto out_free;
 
diff -druNp --no-dereference linux-libre-5.4.11-gnu/net/netfilter/ipset/ip_set_core.c linux-libre-5.4.12-gnu/net/netfilter/ipset/ip_set_core.c
--- linux-libre-5.4.11-gnu/net/netfilter/ipset/ip_set_core.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/net/netfilter/ipset/ip_set_core.c	2020-01-14 14:08:40.000000000 -0500
@@ -1658,6 +1658,7 @@ static int ip_set_utest(struct net *net,
 	struct ip_set *set;
 	struct nlattr *tb[IPSET_ATTR_ADT_MAX + 1] = {};
 	int ret = 0;
+	u32 lineno;
 
 	if (unlikely(protocol_min_failed(attr) ||
 		     !attr[IPSET_ATTR_SETNAME] ||
@@ -1674,7 +1675,7 @@ static int ip_set_utest(struct net *net,
 		return -IPSET_ERR_PROTOCOL;
 
 	rcu_read_lock_bh();
-	ret = set->variant->uadt(set, tb, IPSET_TEST, NULL, 0, 0);
+	ret = set->variant->uadt(set, tb, IPSET_TEST, &lineno, 0, 0);
 	rcu_read_unlock_bh();
 	/* Userspace can't trigger element to be re-added */
 	if (ret == -EAGAIN)
diff -druNp --no-dereference linux-libre-5.4.11-gnu/net/netfilter/nf_conntrack_proto_dccp.c linux-libre-5.4.12-gnu/net/netfilter/nf_conntrack_proto_dccp.c
--- linux-libre-5.4.11-gnu/net/netfilter/nf_conntrack_proto_dccp.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/net/netfilter/nf_conntrack_proto_dccp.c	2020-01-14 14:08:40.000000000 -0500
@@ -677,6 +677,9 @@ static int dccp_timeout_nlattr_to_obj(st
 	unsigned int *timeouts = data;
 	int i;
 
+	if (!timeouts)
+		 timeouts = dn->dccp_timeout;
+
 	/* set default DCCP timeouts. */
 	for (i=0; i<CT_DCCP_MAX; i++)
 		timeouts[i] = dn->dccp_timeout[i];
diff -druNp --no-dereference linux-libre-5.4.11-gnu/net/netfilter/nf_conntrack_proto_sctp.c linux-libre-5.4.12-gnu/net/netfilter/nf_conntrack_proto_sctp.c
--- linux-libre-5.4.11-gnu/net/netfilter/nf_conntrack_proto_sctp.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/net/netfilter/nf_conntrack_proto_sctp.c	2020-01-14 14:08:40.000000000 -0500
@@ -594,6 +594,9 @@ static int sctp_timeout_nlattr_to_obj(st
 	struct nf_sctp_net *sn = nf_sctp_pernet(net);
 	int i;
 
+	if (!timeouts)
+		timeouts = sn->timeouts;
+
 	/* set default SCTP timeouts. */
 	for (i=0; i<SCTP_CONNTRACK_MAX; i++)
 		timeouts[i] = sn->timeouts[i];
diff -druNp --no-dereference linux-libre-5.4.11-gnu/sound/pci/hda/patch_realtek.c linux-libre-5.4.12-gnu/sound/pci/hda/patch_realtek.c
--- linux-libre-5.4.11-gnu/sound/pci/hda/patch_realtek.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/sound/pci/hda/patch_realtek.c	2020-01-14 14:08:40.000000000 -0500
@@ -412,6 +412,7 @@ static void alc_fill_eapd_coef(struct hd
 	case 0x10ec0672:
 		alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
 		break;
+	case 0x10ec0222:
 	case 0x10ec0623:
 		alc_update_coef_idx(codec, 0x19, 1<<13, 0);
 		break;
@@ -430,6 +431,7 @@ static void alc_fill_eapd_coef(struct hd
 		break;
 	case 0x10ec0899:
 	case 0x10ec0900:
+	case 0x10ec0b00:
 	case 0x10ec1168:
 	case 0x10ec1220:
 		alc_update_coef_idx(codec, 0x7, 1<<1, 0);
@@ -2526,6 +2528,7 @@ static int patch_alc882(struct hda_codec
 	case 0x10ec0882:
 	case 0x10ec0885:
 	case 0x10ec0900:
+	case 0x10ec0b00:
 	case 0x10ec1220:
 		break;
 	default:
@@ -7257,6 +7260,7 @@ static const struct snd_pci_quirk alc269
 	SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
 	SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
 	SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
+	SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Yoga 7th", ALC285_FIXUP_SPEAKER2_TO_DAC1),
 	SND_PCI_QUIRK(0x17aa, 0x2293, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_SPEAKER2_TO_DAC1),
 	SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
 	SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
@@ -9295,6 +9299,7 @@ static const struct hda_device_id snd_hd
 	HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
 	HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
 	HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
+	HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
 	HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
 	HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
 	{} /* terminator */
diff -druNp --no-dereference linux-libre-5.4.11-gnu/sound/usb/quirks.c linux-libre-5.4.12-gnu/sound/usb/quirks.c
--- linux-libre-5.4.11-gnu/sound/usb/quirks.c	2020-01-12 06:21:53.000000000 -0500
+++ linux-libre-5.4.12-gnu/sound/usb/quirks.c	2020-01-14 14:08:40.000000000 -0500
@@ -1397,6 +1397,7 @@ bool snd_usb_get_sample_rate_quirk(struc
 	case USB_ID(0x04D8, 0xFEEA): /* Benchmark DAC1 Pre */
 	case USB_ID(0x0556, 0x0014): /* Phoenix Audio TMX320VC */
 	case USB_ID(0x05A3, 0x9420): /* ELP HD USB Camera */
+	case USB_ID(0x05a7, 0x1020): /* Bose Companion 5 */
 	case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */
 	case USB_ID(0x1395, 0x740a): /* Sennheiser DECT */
 	case USB_ID(0x1901, 0x0191): /* GE B850V3 CP2114 audio interface */
