diff -druNp --no-dereference linux-libre-4.9.165-gnu/arch/arm64/kernel/traps.c linux-libre-4.9.166-gnu/arch/arm64/kernel/traps.c
--- linux-libre-4.9.165-gnu/arch/arm64/kernel/traps.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/arch/arm64/kernel/traps.c	2019-03-27 01:13:05.000000000 -0400
@@ -266,10 +266,12 @@ void die(const char *str, struct pt_regs
 {
 	struct thread_info *thread = current_thread_info();
 	int ret;
+	unsigned long flags;
+
+	raw_spin_lock_irqsave(&die_lock, flags);
 
 	oops_enter();
 
-	raw_spin_lock_irq(&die_lock);
 	console_verbose();
 	bust_spinlocks(1);
 	ret = __die(str, err, thread, regs);
@@ -279,13 +281,15 @@ void die(const char *str, struct pt_regs
 
 	bust_spinlocks(0);
 	add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
-	raw_spin_unlock_irq(&die_lock);
 	oops_exit();
 
 	if (in_interrupt())
 		panic("Fatal exception in interrupt");
 	if (panic_on_oops)
 		panic("Fatal exception");
+
+	raw_spin_unlock_irqrestore(&die_lock, flags);
+
 	if (ret != NOTIFY_STOP)
 		do_exit(SIGSEGV);
 }
diff -druNp --no-dereference linux-libre-4.9.165-gnu/arch/mips/include/asm/jump_label.h linux-libre-4.9.166-gnu/arch/mips/include/asm/jump_label.h
--- linux-libre-4.9.165-gnu/arch/mips/include/asm/jump_label.h	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/arch/mips/include/asm/jump_label.h	2019-03-27 01:13:05.000000000 -0400
@@ -21,15 +21,15 @@
 #endif
 
 #ifdef CONFIG_CPU_MICROMIPS
-#define NOP_INSN "nop32"
+#define B_INSN "b32"
 #else
-#define NOP_INSN "nop"
+#define B_INSN "b"
 #endif
 
 static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
 {
-	asm_volatile_goto("1:\t" NOP_INSN "\n\t"
-		"nop\n\t"
+	asm_volatile_goto("1:\t" B_INSN " 2f\n\t"
+		"2:\tnop\n\t"
 		".pushsection __jump_table,  \"aw\"\n\t"
 		WORD_INSN " 1b, %l[l_yes], %0\n\t"
 		".popsection\n\t"
diff -druNp --no-dereference linux-libre-4.9.165-gnu/arch/mips/kernel/vmlinux.lds.S linux-libre-4.9.166-gnu/arch/mips/kernel/vmlinux.lds.S
--- linux-libre-4.9.165-gnu/arch/mips/kernel/vmlinux.lds.S	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/arch/mips/kernel/vmlinux.lds.S	2019-03-27 01:13:05.000000000 -0400
@@ -138,6 +138,13 @@ SECTIONS
 	PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
 #endif
 
+#ifdef CONFIG_MIPS_ELF_APPENDED_DTB
+	.appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) {
+		*(.appended_dtb)
+		KEEP(*(.appended_dtb))
+	}
+#endif
+
 #ifdef CONFIG_RELOCATABLE
 	. = ALIGN(4);
 
@@ -162,11 +169,6 @@ SECTIONS
 	__appended_dtb = .;
 	/* leave space for appended DTB */
 	. += 0x100000;
-#elif defined(CONFIG_MIPS_ELF_APPENDED_DTB)
-	.appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) {
-		*(.appended_dtb)
-		KEEP(*(.appended_dtb))
-	}
 #endif
 	/*
 	 * Align to 64K in attempt to eliminate holes before the
diff -druNp --no-dereference linux-libre-4.9.165-gnu/arch/mips/loongson64/lemote-2f/irq.c linux-libre-4.9.166-gnu/arch/mips/loongson64/lemote-2f/irq.c
--- linux-libre-4.9.165-gnu/arch/mips/loongson64/lemote-2f/irq.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/arch/mips/loongson64/lemote-2f/irq.c	2019-03-27 01:13:05.000000000 -0400
@@ -102,7 +102,7 @@ static struct irqaction ip6_irqaction =
 static struct irqaction cascade_irqaction = {
 	.handler = no_action,
 	.name = "cascade",
-	.flags = IRQF_NO_THREAD,
+	.flags = IRQF_NO_THREAD | IRQF_NO_SUSPEND,
 };
 
 void __init mach_init_irq(void)
diff -druNp --no-dereference linux-libre-4.9.165-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c linux-libre-4.9.166-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
--- linux-libre-4.9.165-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c	2019-03-27 01:13:05.000000000 -0400
@@ -531,11 +531,9 @@ static int vmw_fb_set_par(struct fb_info
 		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 		DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC)
 	};
-	struct drm_display_mode *old_mode;
 	struct drm_display_mode *mode;
 	int ret;
 
-	old_mode = par->set_mode;
 	mode = drm_mode_duplicate(vmw_priv->dev, &new_mode);
 	if (!mode) {
 		DRM_ERROR("Could not create new fb mode.\n");
@@ -546,11 +544,7 @@ static int vmw_fb_set_par(struct fb_info
 	mode->vdisplay = var->yres;
 	vmw_guess_mode_timing(mode);
 
-	if (old_mode && drm_mode_equal(old_mode, mode)) {
-		drm_mode_destroy(vmw_priv->dev, mode);
-		mode = old_mode;
-		old_mode = NULL;
-	} else if (!vmw_kms_validate_mode_vram(vmw_priv,
+	if (!vmw_kms_validate_mode_vram(vmw_priv,
 					mode->hdisplay *
 					DIV_ROUND_UP(var->bits_per_pixel, 8),
 					mode->vdisplay)) {
@@ -613,8 +607,8 @@ static int vmw_fb_set_par(struct fb_info
 	schedule_delayed_work(&par->local_work, 0);
 
 out_unlock:
-	if (old_mode)
-		drm_mode_destroy(vmw_priv->dev, old_mode);
+	if (par->set_mode)
+		drm_mode_destroy(vmw_priv->dev, par->set_mode);
 	par->set_mode = mode;
 
 	drm_modeset_unlock_all(vmw_priv->dev);
diff -druNp --no-dereference linux-libre-4.9.165-gnu/drivers/iommu/amd_iommu.c linux-libre-4.9.166-gnu/drivers/iommu/amd_iommu.c
--- linux-libre-4.9.165-gnu/drivers/iommu/amd_iommu.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/drivers/iommu/amd_iommu.c	2019-03-27 01:13:05.000000000 -0400
@@ -2599,7 +2599,12 @@ static int map_sg(struct device *dev, st
 
 	/* Everything is mapped - write the right values into s->dma_address */
 	for_each_sg(sglist, s, nelems, i) {
-		s->dma_address += address + s->offset;
+		/*
+		 * Add in the remaining piece of the scatter-gather offset that
+		 * was masked out when we were determining the physical address
+		 * via (sg_phys(s) & PAGE_MASK) earlier.
+		 */
+		s->dma_address += address + (s->offset & ~PAGE_MASK);
 		s->dma_length   = s->length;
 	}
 
diff -druNp --no-dereference linux-libre-4.9.165-gnu/drivers/media/usb/uvc/uvc_ctrl.c linux-libre-4.9.166-gnu/drivers/media/usb/uvc/uvc_ctrl.c
--- linux-libre-4.9.165-gnu/drivers/media/usb/uvc/uvc_ctrl.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/drivers/media/usb/uvc/uvc_ctrl.c	2019-03-27 01:13:05.000000000 -0400
@@ -1203,7 +1203,7 @@ static void uvc_ctrl_fill_event(struct u
 
 	__uvc_query_v4l2_ctrl(chain, ctrl, mapping, &v4l2_ctrl);
 
-	memset(ev->reserved, 0, sizeof(ev->reserved));
+	memset(ev, 0, sizeof(*ev));
 	ev->type = V4L2_EVENT_CTRL;
 	ev->id = v4l2_ctrl.id;
 	ev->u.ctrl.value = value;
diff -druNp --no-dereference linux-libre-4.9.165-gnu/drivers/media/v4l2-core/v4l2-ctrls.c linux-libre-4.9.166-gnu/drivers/media/v4l2-core/v4l2-ctrls.c
--- linux-libre-4.9.165-gnu/drivers/media/v4l2-core/v4l2-ctrls.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/drivers/media/v4l2-core/v4l2-ctrls.c	2019-03-27 01:13:05.000000000 -0400
@@ -1231,7 +1231,7 @@ static u32 user_flags(const struct v4l2_
 
 static void fill_event(struct v4l2_event *ev, struct v4l2_ctrl *ctrl, u32 changes)
 {
-	memset(ev->reserved, 0, sizeof(ev->reserved));
+	memset(ev, 0, sizeof(*ev));
 	ev->type = V4L2_EVENT_CTRL;
 	ev->id = ctrl->id;
 	ev->u.ctrl.changes = changes;
diff -druNp --no-dereference linux-libre-4.9.165-gnu/drivers/mmc/host/pxamci.c linux-libre-4.9.166-gnu/drivers/mmc/host/pxamci.c
--- linux-libre-4.9.165-gnu/drivers/mmc/host/pxamci.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/drivers/mmc/host/pxamci.c	2019-03-27 01:13:05.000000000 -0400
@@ -181,7 +181,7 @@ static void pxamci_dma_irq(void *param);
 static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
 {
 	struct dma_async_tx_descriptor *tx;
-	enum dma_data_direction direction;
+	enum dma_transfer_direction direction;
 	struct dma_slave_config	config;
 	struct dma_chan *chan;
 	unsigned int nob = data->blocks;
diff -druNp --no-dereference linux-libre-4.9.165-gnu/drivers/net/wireless/ath/ath10k/wmi.c linux-libre-4.9.166-gnu/drivers/net/wireless/ath/ath10k/wmi.c
--- linux-libre-4.9.165-gnu/drivers/net/wireless/ath/ath10k/wmi.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/drivers/net/wireless/ath/ath10k/wmi.c	2019-03-27 01:13:05.000000000 -0400
@@ -4277,7 +4277,7 @@ static void ath10k_tpc_config_disp_table
 							    rate_code[i],
 							    type);
 			snprintf(buff, sizeof(buff), "%8d ", tpc[j]);
-			strncat(tpc_value, buff, strlen(buff));
+			strlcat(tpc_value, buff, sizeof(tpc_value));
 		}
 		tpc_stats->tpc_table[type].pream_idx[i] = pream_idx;
 		tpc_stats->tpc_table[type].rate_code[i] = rate_code[i];
diff -druNp --no-dereference linux-libre-4.9.165-gnu/drivers/power/supply/charger-manager.c linux-libre-4.9.166-gnu/drivers/power/supply/charger-manager.c
--- linux-libre-4.9.165-gnu/drivers/power/supply/charger-manager.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/drivers/power/supply/charger-manager.c	2019-03-27 01:13:05.000000000 -0400
@@ -1212,7 +1212,6 @@ static int charger_extcon_init(struct ch
 	if (ret < 0) {
 		pr_info("Cannot register extcon_dev for %s(cable: %s)\n",
 			cable->extcon_name, cable->name);
-		ret = -EINVAL;
 	}
 
 	return ret;
@@ -1634,7 +1633,7 @@ static int charger_manager_probe(struct
 
 	if (IS_ERR(desc)) {
 		dev_err(&pdev->dev, "No platform data (desc) found\n");
-		return -ENODEV;
+		return PTR_ERR(desc);
 	}
 
 	cm = devm_kzalloc(&pdev->dev,
diff -druNp --no-dereference linux-libre-4.9.165-gnu/drivers/rtc/rtc-lib.c linux-libre-4.9.166-gnu/drivers/rtc/rtc-lib.c
--- linux-libre-4.9.165-gnu/drivers/rtc/rtc-lib.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/drivers/rtc/rtc-lib.c	2019-03-27 01:13:05.000000000 -0400
@@ -52,13 +52,11 @@ EXPORT_SYMBOL(rtc_year_days);
  */
 void rtc_time64_to_tm(time64_t time, struct rtc_time *tm)
 {
-	unsigned int month, year;
-	unsigned long secs;
+	unsigned int month, year, secs;
 	int days;
 
 	/* time must be positive */
-	days = div_s64(time, 86400);
-	secs = time - (unsigned int) days * 86400;
+	days = div_s64_rem(time, 86400, &secs);
 
 	/* day of the week, 1970-01-01 was a Thursday */
 	tm->tm_wday = (days + 4) % 7;
diff -druNp --no-dereference linux-libre-4.9.165-gnu/drivers/scsi/ufs/ufshcd.c linux-libre-4.9.166-gnu/drivers/scsi/ufs/ufshcd.c
--- linux-libre-4.9.165-gnu/drivers/scsi/ufs/ufshcd.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/drivers/scsi/ufs/ufshcd.c	2019-03-27 01:13:05.000000000 -0400
@@ -1348,10 +1348,11 @@ static int ufshcd_comp_devman_upiu(struc
 	u32 upiu_flags;
 	int ret = 0;
 
-	if (hba->ufs_version == UFSHCI_VERSION_20)
-		lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
-	else
+	if ((hba->ufs_version == UFSHCI_VERSION_10) ||
+	    (hba->ufs_version == UFSHCI_VERSION_11))
 		lrbp->command_type = UTP_CMD_TYPE_DEV_MANAGE;
+	else
+		lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
 
 	ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, DMA_NONE);
 	if (hba->dev_cmd.type == DEV_CMD_TYPE_QUERY)
@@ -1375,10 +1376,11 @@ static int ufshcd_comp_scsi_upiu(struct
 	u32 upiu_flags;
 	int ret = 0;
 
-	if (hba->ufs_version == UFSHCI_VERSION_20)
-		lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
-	else
+	if ((hba->ufs_version == UFSHCI_VERSION_10) ||
+	    (hba->ufs_version == UFSHCI_VERSION_11))
 		lrbp->command_type = UTP_CMD_TYPE_SCSI;
+	else
+		lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
 
 	if (likely(lrbp->cmd)) {
 		ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags,
diff -druNp --no-dereference linux-libre-4.9.165-gnu/drivers/tty/serial/sprd_serial.c linux-libre-4.9.166-gnu/drivers/tty/serial/sprd_serial.c
--- linux-libre-4.9.165-gnu/drivers/tty/serial/sprd_serial.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/drivers/tty/serial/sprd_serial.c	2019-03-27 01:13:05.000000000 -0400
@@ -36,7 +36,7 @@
 #define SPRD_FIFO_SIZE		128
 #define SPRD_DEF_RATE		26000000
 #define SPRD_BAUD_IO_LIMIT	3000000
-#define SPRD_TIMEOUT		256
+#define SPRD_TIMEOUT		256000
 
 /* the offset of serial registers and BITs for them */
 /* data registers */
@@ -63,6 +63,7 @@
 
 /* interrupt clear register */
 #define SPRD_ICLR		0x0014
+#define SPRD_ICLR_TIMEOUT	BIT(13)
 
 /* line control register */
 #define SPRD_LCR		0x0018
@@ -298,7 +299,8 @@ static irqreturn_t sprd_handle_irq(int i
 		return IRQ_NONE;
 	}
 
-	serial_out(port, SPRD_ICLR, ~0);
+	if (ims & SPRD_IMSR_TIMEOUT)
+		serial_out(port, SPRD_ICLR, SPRD_ICLR_TIMEOUT);
 
 	if (ims & (SPRD_IMSR_RX_FIFO_FULL |
 		SPRD_IMSR_BREAK_DETECT | SPRD_IMSR_TIMEOUT))
diff -druNp --no-dereference linux-libre-4.9.165-gnu/drivers/usb/core/config.c linux-libre-4.9.166-gnu/drivers/usb/core/config.c
--- linux-libre-4.9.165-gnu/drivers/usb/core/config.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/drivers/usb/core/config.c	2019-03-27 01:13:05.000000000 -0400
@@ -763,18 +763,21 @@ void usb_destroy_configuration(struct us
 		return;
 
 	if (dev->rawdescriptors) {
-		for (i = 0; i < dev->descriptor.bNumConfigurations; i++)
+		for (i = 0; i < dev->descriptor.bNumConfigurations &&
+				i < USB_MAXCONFIG; i++)
 			kfree(dev->rawdescriptors[i]);
 
 		kfree(dev->rawdescriptors);
 		dev->rawdescriptors = NULL;
 	}
 
-	for (c = 0; c < dev->descriptor.bNumConfigurations; c++) {
+	for (c = 0; c < dev->descriptor.bNumConfigurations &&
+			c < USB_MAXCONFIG; c++) {
 		struct usb_host_config *cf = &dev->config[c];
 
 		kfree(cf->string);
-		for (i = 0; i < cf->desc.bNumInterfaces; i++) {
+		for (i = 0; i < cf->desc.bNumInterfaces &&
+				i < USB_MAXINTERFACES; i++) {
 			if (cf->intf_cache[i])
 				kref_put(&cf->intf_cache[i]->ref,
 					  usb_release_interface_cache);
diff -druNp --no-dereference linux-libre-4.9.165-gnu/drivers/video/backlight/pwm_bl.c linux-libre-4.9.166-gnu/drivers/video/backlight/pwm_bl.c
--- linux-libre-4.9.165-gnu/drivers/video/backlight/pwm_bl.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/drivers/video/backlight/pwm_bl.c	2019-03-27 01:13:05.000000000 -0400
@@ -54,10 +54,11 @@ static void pwm_backlight_power_on(struc
 	if (err < 0)
 		dev_err(pb->dev, "failed to enable power supply\n");
 
+	pwm_enable(pb->pwm);
+
 	if (pb->enable_gpio)
 		gpiod_set_value_cansleep(pb->enable_gpio, 1);
 
-	pwm_enable(pb->pwm);
 	pb->enabled = true;
 }
 
@@ -66,12 +67,12 @@ static void pwm_backlight_power_off(stru
 	if (!pb->enabled)
 		return;
 
-	pwm_config(pb->pwm, 0, pb->period);
-	pwm_disable(pb->pwm);
-
 	if (pb->enable_gpio)
 		gpiod_set_value_cansleep(pb->enable_gpio, 0);
 
+	pwm_config(pb->pwm, 0, pb->period);
+	pwm_disable(pb->pwm);
+
 	regulator_disable(pb->power_supply);
 	pb->enabled = false;
 }
diff -druNp --no-dereference linux-libre-4.9.165-gnu/fs/dcache.c linux-libre-4.9.166-gnu/fs/dcache.c
--- linux-libre-4.9.165-gnu/fs/dcache.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/fs/dcache.c	2019-03-27 01:13:05.000000000 -0400
@@ -1522,7 +1522,7 @@ static void check_and_drop(void *_data)
 {
 	struct detach_data *data = _data;
 
-	if (!data->mountpoint && !data->select.found)
+	if (!data->mountpoint && list_empty(&data->select.dispose))
 		__d_drop(data->select.start);
 }
 
@@ -1564,17 +1564,15 @@ void d_invalidate(struct dentry *dentry)
 
 		d_walk(dentry, &data, detach_and_collect, check_and_drop);
 
-		if (data.select.found)
+		if (!list_empty(&data.select.dispose))
 			shrink_dentry_list(&data.select.dispose);
+		else if (!data.mountpoint)
+			return;
 
 		if (data.mountpoint) {
 			detach_mounts(data.mountpoint);
 			dput(data.mountpoint);
 		}
-
-		if (!data.mountpoint && !data.select.found)
-			break;
-
 		cond_resched();
 	}
 }
diff -druNp --no-dereference linux-libre-4.9.165-gnu/fs/ext4/ext4_jbd2.h linux-libre-4.9.166-gnu/fs/ext4/ext4_jbd2.h
--- linux-libre-4.9.165-gnu/fs/ext4/ext4_jbd2.h	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/fs/ext4/ext4_jbd2.h	2019-03-27 01:13:05.000000000 -0400
@@ -391,7 +391,7 @@ static inline void ext4_update_inode_fsy
 {
 	struct ext4_inode_info *ei = EXT4_I(inode);
 
-	if (ext4_handle_valid(handle)) {
+	if (ext4_handle_valid(handle) && !is_handle_aborted(handle)) {
 		ei->i_sync_tid = handle->h_transaction->t_tid;
 		if (datasync)
 			ei->i_datasync_tid = handle->h_transaction->t_tid;
diff -druNp --no-dereference linux-libre-4.9.165-gnu/fs/ext4/file.c linux-libre-4.9.166-gnu/fs/ext4/file.c
--- linux-libre-4.9.165-gnu/fs/ext4/file.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/fs/ext4/file.c	2019-03-27 01:13:05.000000000 -0400
@@ -79,7 +79,7 @@ ext4_unaligned_aio(struct inode *inode,
 	struct super_block *sb = inode->i_sb;
 	int blockmask = sb->s_blocksize - 1;
 
-	if (pos >= i_size_read(inode))
+	if (pos >= ALIGN(i_size_read(inode), sb->s_blocksize))
 		return 0;
 
 	if ((pos | iov_iter_alignment(from)) & blockmask)
diff -druNp --no-dereference linux-libre-4.9.165-gnu/fs/ext4/indirect.c linux-libre-4.9.166-gnu/fs/ext4/indirect.c
--- linux-libre-4.9.165-gnu/fs/ext4/indirect.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/fs/ext4/indirect.c	2019-03-27 01:13:05.000000000 -0400
@@ -1385,10 +1385,14 @@ end_range:
 					   partial->p + 1,
 					   partial2->p,
 					   (chain+n-1) - partial);
-			BUFFER_TRACE(partial->bh, "call brelse");
-			brelse(partial->bh);
-			BUFFER_TRACE(partial2->bh, "call brelse");
-			brelse(partial2->bh);
+			while (partial > chain) {
+				BUFFER_TRACE(partial->bh, "call brelse");
+				brelse(partial->bh);
+			}
+			while (partial2 > chain2) {
+				BUFFER_TRACE(partial2->bh, "call brelse");
+				brelse(partial2->bh);
+			}
 			return 0;
 		}
 
diff -druNp --no-dereference linux-libre-4.9.165-gnu/fs/udf/truncate.c linux-libre-4.9.166-gnu/fs/udf/truncate.c
--- linux-libre-4.9.165-gnu/fs/udf/truncate.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/fs/udf/truncate.c	2019-03-27 01:13:05.000000000 -0400
@@ -260,6 +260,9 @@ void udf_truncate_extents(struct inode *
 			epos.block = eloc;
 			epos.bh = udf_tread(sb,
 					udf_get_lb_pblock(sb, &eloc, 0));
+			/* Error reading indirect block? */
+			if (!epos.bh)
+				return;
 			if (elen)
 				indirect_ext_len =
 					(elen + sb->s_blocksize - 1) >>
diff -druNp --no-dereference linux-libre-4.9.165-gnu/include/linux/ceph/libceph.h linux-libre-4.9.166-gnu/include/linux/ceph/libceph.h
--- linux-libre-4.9.165-gnu/include/linux/ceph/libceph.h	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/include/linux/ceph/libceph.h	2019-03-27 01:13:05.000000000 -0400
@@ -276,6 +276,8 @@ extern void ceph_destroy_client(struct c
 extern int __ceph_open_session(struct ceph_client *client,
 			       unsigned long started);
 extern int ceph_open_session(struct ceph_client *client);
+int ceph_wait_for_latest_osdmap(struct ceph_client *client,
+				unsigned long timeout);
 
 /* pagevec.c */
 extern void ceph_release_page_vector(struct page **pages, int num_pages);
diff -druNp --no-dereference linux-libre-4.9.165-gnu/include/net/inet_connection_sock.h linux-libre-4.9.166-gnu/include/net/inet_connection_sock.h
--- linux-libre-4.9.165-gnu/include/net/inet_connection_sock.h	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/include/net/inet_connection_sock.h	2019-03-27 01:13:05.000000000 -0400
@@ -289,11 +289,6 @@ static inline int inet_csk_reqsk_queue_l
 	return reqsk_queue_len(&inet_csk(sk)->icsk_accept_queue);
 }
 
-static inline int inet_csk_reqsk_queue_young(const struct sock *sk)
-{
-	return reqsk_queue_len_young(&inet_csk(sk)->icsk_accept_queue);
-}
-
 static inline int inet_csk_reqsk_queue_is_full(const struct sock *sk)
 {
 	return inet_csk_reqsk_queue_len(sk) >= sk->sk_max_ack_backlog;
diff -druNp --no-dereference linux-libre-4.9.165-gnu/kernel/futex.c linux-libre-4.9.166-gnu/kernel/futex.c
--- linux-libre-4.9.165-gnu/kernel/futex.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/kernel/futex.c	2019-03-27 01:13:05.000000000 -0400
@@ -3110,6 +3110,10 @@ int handle_futex_death(u32 __user *uaddr
 {
 	u32 uval, uninitialized_var(nval), mval;
 
+	/* Futex address must be 32bit aligned */
+	if ((((unsigned long)uaddr) % sizeof(*uaddr)) != 0)
+		return -1;
+
 retry:
 	if (get_user(uval, uaddr))
 		return -1;
diff -druNp --no-dereference linux-libre-4.9.165-gnu/kernel/locking/lockdep.c linux-libre-4.9.166-gnu/kernel/locking/lockdep.c
--- linux-libre-4.9.165-gnu/kernel/locking/lockdep.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/kernel/locking/lockdep.c	2019-03-27 01:13:05.000000000 -0400
@@ -3446,6 +3446,9 @@ __lock_set_class(struct lockdep_map *loc
 	unsigned int depth;
 	int i;
 
+	if (unlikely(!debug_locks))
+		return 0;
+
 	depth = curr->lockdep_depth;
 	/*
 	 * This function is about (re)setting the class of a held lock,
diff -druNp --no-dereference linux-libre-4.9.165-gnu/lib/int_sqrt.c linux-libre-4.9.166-gnu/lib/int_sqrt.c
--- linux-libre-4.9.165-gnu/lib/int_sqrt.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/lib/int_sqrt.c	2019-03-27 01:13:05.000000000 -0400
@@ -22,6 +22,9 @@ unsigned long int_sqrt(unsigned long x)
 		return x;
 
 	m = 1UL << (BITS_PER_LONG - 2);
+	while (m > x)
+		m >>= 2;
+
 	while (m != 0) {
 		b = y + m;
 		y >>= 1;
diff -druNp --no-dereference linux-libre-4.9.165-gnu/Makefile linux-libre-4.9.166-gnu/Makefile
--- linux-libre-4.9.165-gnu/Makefile	2019-03-24 11:20:55.000000000 -0400
+++ linux-libre-4.9.166-gnu/Makefile	2019-03-27 23:27:09.000000000 -0400
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 9
-SUBLEVEL = 165
+SUBLEVEL = 166
 EXTRAVERSION = -gnu
 NAME = Roaring Lionus
 
diff -druNp --no-dereference linux-libre-4.9.165-gnu/net/bluetooth/hci_sock.c linux-libre-4.9.166-gnu/net/bluetooth/hci_sock.c
--- linux-libre-4.9.165-gnu/net/bluetooth/hci_sock.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/net/bluetooth/hci_sock.c	2019-03-27 01:13:05.000000000 -0400
@@ -826,8 +826,6 @@ static int hci_sock_release(struct socke
 	if (!sk)
 		return 0;
 
-	hdev = hci_pi(sk)->hdev;
-
 	switch (hci_pi(sk)->channel) {
 	case HCI_CHANNEL_MONITOR:
 		atomic_dec(&monitor_promisc);
@@ -849,6 +847,7 @@ static int hci_sock_release(struct socke
 
 	bt_sock_unlink(&hci_sk_list, sk);
 
+	hdev = hci_pi(sk)->hdev;
 	if (hdev) {
 		if (hci_pi(sk)->channel == HCI_CHANNEL_USER) {
 			/* When releasing an user channel exclusive access,
diff -druNp --no-dereference linux-libre-4.9.165-gnu/net/ceph/ceph_common.c linux-libre-4.9.166-gnu/net/ceph/ceph_common.c
--- linux-libre-4.9.165-gnu/net/ceph/ceph_common.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/net/ceph/ceph_common.c	2019-03-27 01:13:05.000000000 -0400
@@ -699,7 +699,6 @@ int __ceph_open_session(struct ceph_clie
 }
 EXPORT_SYMBOL(__ceph_open_session);
 
-
 int ceph_open_session(struct ceph_client *client)
 {
 	int ret;
@@ -715,6 +714,23 @@ int ceph_open_session(struct ceph_client
 }
 EXPORT_SYMBOL(ceph_open_session);
 
+int ceph_wait_for_latest_osdmap(struct ceph_client *client,
+				unsigned long timeout)
+{
+	u64 newest_epoch;
+	int ret;
+
+	ret = ceph_monc_get_version(&client->monc, "osdmap", &newest_epoch);
+	if (ret)
+		return ret;
+
+	if (client->osdc.osdmap->epoch >= newest_epoch)
+		return 0;
+
+	ceph_osdc_maybe_request_map(&client->osdc);
+	return ceph_monc_wait_osdmap(&client->monc, newest_epoch, timeout);
+}
+EXPORT_SYMBOL(ceph_wait_for_latest_osdmap);
 
 static int __init init_ceph_lib(void)
 {
diff -druNp --no-dereference linux-libre-4.9.165-gnu/net/ceph/mon_client.c linux-libre-4.9.166-gnu/net/ceph/mon_client.c
--- linux-libre-4.9.165-gnu/net/ceph/mon_client.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/net/ceph/mon_client.c	2019-03-27 01:13:05.000000000 -0400
@@ -914,6 +914,15 @@ int ceph_monc_blacklist_add(struct ceph_
 	mutex_unlock(&monc->mutex);
 
 	ret = wait_generic_request(req);
+	if (!ret)
+		/*
+		 * Make sure we have the osdmap that includes the blacklist
+		 * entry.  This is needed to ensure that the OSDs pick up the
+		 * new blacklist before processing any future requests from
+		 * this client.
+		 */
+		ret = ceph_wait_for_latest_osdmap(monc->client, 0);
+
 out:
 	put_generic_request(req);
 	return ret;
diff -druNp --no-dereference linux-libre-4.9.165-gnu/net/dccp/ipv4.c linux-libre-4.9.166-gnu/net/dccp/ipv4.c
--- linux-libre-4.9.165-gnu/net/dccp/ipv4.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/net/dccp/ipv4.c	2019-03-27 01:13:05.000000000 -0400
@@ -596,13 +596,7 @@ int dccp_v4_conn_request(struct sock *sk
 	if (inet_csk_reqsk_queue_is_full(sk))
 		goto drop;
 
-	/*
-	 * Accept backlog is full. If we have already queued enough
-	 * of warm entries in syn queue, drop request. It is better than
-	 * clogging syn queue with openreqs with exponentially increasing
-	 * timeout.
-	 */
-	if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
+	if (sk_acceptq_is_full(sk))
 		goto drop;
 
 	req = inet_reqsk_alloc(&dccp_request_sock_ops, sk, true);
diff -druNp --no-dereference linux-libre-4.9.165-gnu/net/dccp/ipv6.c linux-libre-4.9.166-gnu/net/dccp/ipv6.c
--- linux-libre-4.9.165-gnu/net/dccp/ipv6.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/net/dccp/ipv6.c	2019-03-27 01:13:05.000000000 -0400
@@ -328,7 +328,7 @@ static int dccp_v6_conn_request(struct s
 	if (inet_csk_reqsk_queue_is_full(sk))
 		goto drop;
 
-	if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
+	if (sk_acceptq_is_full(sk))
 		goto drop;
 
 	req = inet_reqsk_alloc(&dccp6_request_sock_ops, sk, true);
diff -druNp --no-dereference linux-libre-4.9.165-gnu/net/ipv4/tcp_input.c linux-libre-4.9.166-gnu/net/ipv4/tcp_input.c
--- linux-libre-4.9.165-gnu/net/ipv4/tcp_input.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/net/ipv4/tcp_input.c	2019-03-27 01:13:05.000000000 -0400
@@ -6374,13 +6374,7 @@ int tcp_conn_request(struct request_sock
 			goto drop;
 	}
 
-
-	/* Accept backlog is full. If we have already queued enough
-	 * of warm entries in syn queue, drop request. It is better than
-	 * clogging syn queue with openreqs with exponentially increasing
-	 * timeout.
-	 */
-	if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) {
+	if (sk_acceptq_is_full(sk)) {
 		NET_INC_STATS(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
 		goto drop;
 	}
diff -druNp --no-dereference linux-libre-4.9.165-gnu/sound/pci/hda/hda_codec.c linux-libre-4.9.166-gnu/sound/pci/hda/hda_codec.c
--- linux-libre-4.9.165-gnu/sound/pci/hda/hda_codec.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/sound/pci/hda/hda_codec.c	2019-03-27 01:13:05.000000000 -0400
@@ -3004,6 +3004,7 @@ static void hda_call_codec_resume(struct
 		hda_jackpoll_work(&codec->jackpoll_work.work);
 	else
 		snd_hda_jack_report_sync(codec);
+	codec->core.dev.power.power_state = PMSG_ON;
 	atomic_dec(&codec->core.in_pm);
 }
 
@@ -3036,10 +3037,62 @@ static int hda_codec_runtime_resume(stru
 }
 #endif /* CONFIG_PM */
 
+#ifdef CONFIG_PM_SLEEP
+static int hda_codec_force_resume(struct device *dev)
+{
+	int ret;
+
+	/* The get/put pair below enforces the runtime resume even if the
+	 * device hasn't been used at suspend time.  This trick is needed to
+	 * update the jack state change during the sleep.
+	 */
+	pm_runtime_get_noresume(dev);
+	ret = pm_runtime_force_resume(dev);
+	pm_runtime_put(dev);
+	return ret;
+}
+
+static int hda_codec_pm_suspend(struct device *dev)
+{
+	dev->power.power_state = PMSG_SUSPEND;
+	return pm_runtime_force_suspend(dev);
+}
+
+static int hda_codec_pm_resume(struct device *dev)
+{
+	dev->power.power_state = PMSG_RESUME;
+	return hda_codec_force_resume(dev);
+}
+
+static int hda_codec_pm_freeze(struct device *dev)
+{
+	dev->power.power_state = PMSG_FREEZE;
+	return pm_runtime_force_suspend(dev);
+}
+
+static int hda_codec_pm_thaw(struct device *dev)
+{
+	dev->power.power_state = PMSG_THAW;
+	return hda_codec_force_resume(dev);
+}
+
+static int hda_codec_pm_restore(struct device *dev)
+{
+	dev->power.power_state = PMSG_RESTORE;
+	return hda_codec_force_resume(dev);
+}
+#endif /* CONFIG_PM_SLEEP */
+
 /* referred in hda_bind.c */
 const struct dev_pm_ops hda_codec_driver_pm = {
-	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				pm_runtime_force_resume)
+#ifdef CONFIG_PM_SLEEP
+	.suspend = hda_codec_pm_suspend,
+	.resume = hda_codec_pm_resume,
+	.freeze = hda_codec_pm_freeze,
+	.thaw = hda_codec_pm_thaw,
+	.poweroff = hda_codec_pm_suspend,
+	.restore = hda_codec_pm_restore,
+#endif /* CONFIG_PM_SLEEP */
 	SET_RUNTIME_PM_OPS(hda_codec_runtime_suspend, hda_codec_runtime_resume,
 			   NULL)
 };
diff -druNp --no-dereference linux-libre-4.9.165-gnu/tools/objtool/check.c linux-libre-4.9.166-gnu/tools/objtool/check.c
--- linux-libre-4.9.165-gnu/tools/objtool/check.c	2019-03-23 08:19:54.000000000 -0400
+++ linux-libre-4.9.166-gnu/tools/objtool/check.c	2019-03-27 01:13:05.000000000 -0400
@@ -2132,9 +2132,10 @@ static void cleanup(struct objtool_file
 	elf_close(file->elf);
 }
 
+static struct objtool_file file;
+
 int check(const char *_objname, bool orc)
 {
-	struct objtool_file file;
 	int ret, warnings = 0;
 
 	objname = _objname;
