diff -druNp --no-dereference linux-libre-3.18.93-gnu/arch/um/drivers/mconsole.h linux-libre-3.18.94-gnu/arch/um/drivers/mconsole.h
--- linux-libre-3.18.93-gnu/arch/um/drivers/mconsole.h	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/arch/um/drivers/mconsole.h	2018-02-07 14:07:58.000000000 -0500
@@ -7,7 +7,7 @@
 #ifndef __MCONSOLE_H__
 #define __MCONSOLE_H__
 
-#ifndef __KERNEL__
+#ifdef __UM_HOST__
 #include <stdint.h>
 #define u32 uint32_t
 #endif
diff -druNp --no-dereference linux-libre-3.18.93-gnu/arch/um/include/shared/init.h linux-libre-3.18.94-gnu/arch/um/include/shared/init.h
--- linux-libre-3.18.93-gnu/arch/um/include/shared/init.h	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/arch/um/include/shared/init.h	2018-02-07 14:07:58.000000000 -0500
@@ -40,28 +40,8 @@
 typedef int (*initcall_t)(void);
 typedef void (*exitcall_t)(void);
 
-#ifndef __KERNEL__
-#ifndef __section
-# define __section(S) __attribute__ ((__section__(#S)))
-#endif
-
-#if __GNUC__ == 3
-
-#if __GNUC_MINOR__ >= 3
-# define __used			__attribute__((__used__))
-#else
-# define __used			__attribute__((__unused__))
-#endif
-
-#else
-#if __GNUC__ == 4
-# define __used			__attribute__((__used__))
-#endif
-#endif
-
-#else
 #include <linux/compiler.h>
-#endif
+
 /* These are for everybody (although not all archs will actually
    discard it in modules) */
 #define __init		__section(.init.text)
@@ -131,7 +111,7 @@ extern struct uml_param __uml_setup_star
 #define __uml_postsetup_call	__used __section(.uml.postsetup.init)
 #define __uml_exit_call		__used __section(.uml.exitcall.exit)
 
-#ifndef __KERNEL__
+#ifdef __UM_HOST__
 
 #define __define_initcall(level,fn) \
 	static initcall_t __initcall_##fn __used \
diff -druNp --no-dereference linux-libre-3.18.93-gnu/arch/um/include/shared/user.h linux-libre-3.18.94-gnu/arch/um/include/shared/user.h
--- linux-libre-3.18.93-gnu/arch/um/include/shared/user.h	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/arch/um/include/shared/user.h	2018-02-07 14:07:58.000000000 -0500
@@ -17,7 +17,7 @@
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 
 /* This is to get size_t */
-#ifdef __KERNEL__
+#ifndef __UM_HOST__
 #include <linux/types.h>
 #else
 #include <stddef.h>
diff -druNp --no-dereference linux-libre-3.18.93-gnu/arch/um/Makefile linux-libre-3.18.94-gnu/arch/um/Makefile
--- linux-libre-3.18.93-gnu/arch/um/Makefile	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/arch/um/Makefile	2018-02-07 14:07:58.000000000 -0500
@@ -68,9 +68,10 @@ KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -
 
 KBUILD_AFLAGS += $(ARCH_INCLUDE)
 
-USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
-	$(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \
-	$(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include
+USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \
+		$(ARCH_INCLUDE) $(MODE_INCLUDE) $(filter -I%,$(CFLAGS)) \
+		-D_FILE_OFFSET_BITS=64 -idirafter $(srctree)/include \
+		-idirafter $(obj)/include -D__KERNEL__ -D__UM_HOST__
 
 #This will adjust *FLAGS accordingly to the platform.
 include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
@@ -116,7 +117,7 @@ archheaders:
 archprepare: include/generated/user_constants.h
 
 LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
-LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib
+LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib $(call cc-option, -no-pie)
 
 CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \
 	$(call cc-option, -fno-stack-protector,) \
diff -druNp --no-dereference linux-libre-3.18.93-gnu/arch/x86/include/asm/kvm_host.h linux-libre-3.18.94-gnu/arch/x86/include/asm/kvm_host.h
--- linux-libre-3.18.93-gnu/arch/x86/include/asm/kvm_host.h	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/arch/x86/include/asm/kvm_host.h	2018-02-07 14:07:58.000000000 -0500
@@ -849,7 +849,8 @@ int x86_emulate_instruction(struct kvm_v
 static inline int emulate_instruction(struct kvm_vcpu *vcpu,
 			int emulation_type)
 {
-	return x86_emulate_instruction(vcpu, 0, emulation_type, NULL, 0);
+	return x86_emulate_instruction(vcpu, 0,
+			emulation_type | EMULTYPE_NO_REEXECUTE, NULL, 0);
 }
 
 void kvm_enable_efer_bits(u64);
diff -druNp --no-dereference linux-libre-3.18.93-gnu/arch/x86/kvm/emulate.c linux-libre-3.18.94-gnu/arch/x86/kvm/emulate.c
--- linux-libre-3.18.93-gnu/arch/x86/kvm/emulate.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/arch/x86/kvm/emulate.c	2018-02-07 14:07:58.000000000 -0500
@@ -4385,6 +4385,8 @@ int x86_decode_insn(struct x86_emulate_c
 	bool op_prefix = false;
 	bool has_seg_override = false;
 	struct opcode opcode;
+	u16 dummy;
+	struct desc_struct desc;
 
 	ctxt->memop.type = OP_NONE;
 	ctxt->memopp = NULL;
@@ -4403,6 +4405,11 @@ int x86_decode_insn(struct x86_emulate_c
 	switch (mode) {
 	case X86EMUL_MODE_REAL:
 	case X86EMUL_MODE_VM86:
+		def_op_bytes = def_ad_bytes = 2;
+		ctxt->ops->get_segment(ctxt, &dummy, &desc, NULL, VCPU_SREG_CS);
+		if (desc.d)
+			def_op_bytes = def_ad_bytes = 4;
+		break;
 	case X86EMUL_MODE_PROT16:
 		def_op_bytes = def_ad_bytes = 2;
 		break;
diff -druNp --no-dereference linux-libre-3.18.93-gnu/arch/x86/kvm/vmx.c linux-libre-3.18.94-gnu/arch/x86/kvm/vmx.c
--- linux-libre-3.18.93-gnu/arch/x86/kvm/vmx.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/arch/x86/kvm/vmx.c	2018-02-07 14:07:58.000000000 -0500
@@ -4569,7 +4569,7 @@ static void vmx_vcpu_reset(struct kvm_vc
 	vmcs_writel(GUEST_SYSENTER_ESP, 0);
 	vmcs_writel(GUEST_SYSENTER_EIP, 0);
 
-	vmcs_writel(GUEST_RFLAGS, 0x02);
+	kvm_set_rflags(vcpu, X86_EFLAGS_FIXED);
 	kvm_rip_write(vcpu, 0xfff0);
 
 	vmcs_writel(GUEST_GDTR_BASE, 0);
@@ -5707,7 +5707,7 @@ static int handle_invalid_guest_state(st
 		if (test_bit(KVM_REQ_EVENT, &vcpu->requests))
 			return 1;
 
-		err = emulate_instruction(vcpu, EMULTYPE_NO_REEXECUTE);
+		err = emulate_instruction(vcpu, 0);
 
 		if (err == EMULATE_USER_EXIT) {
 			++vcpu->stat.mmio_exits;
diff -druNp --no-dereference linux-libre-3.18.93-gnu/arch/x86/kvm/x86.c linux-libre-3.18.94-gnu/arch/x86/kvm/x86.c
--- linux-libre-3.18.93-gnu/arch/x86/kvm/x86.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/arch/x86/kvm/x86.c	2018-02-07 14:07:58.000000000 -0500
@@ -5109,7 +5109,7 @@ static int handle_emulation_failure(stru
 		vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
 		vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION;
 		vcpu->run->internal.ndata = 0;
-		r = EMULATE_FAIL;
+		r = EMULATE_USER_EXIT;
 	}
 	kvm_queue_exception(vcpu, UD_VECTOR);
 
diff -druNp --no-dereference linux-libre-3.18.93-gnu/arch/x86/um/shared/sysdep/tls.h linux-libre-3.18.94-gnu/arch/x86/um/shared/sysdep/tls.h
--- linux-libre-3.18.93-gnu/arch/x86/um/shared/sysdep/tls.h	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/arch/x86/um/shared/sysdep/tls.h	2018-02-07 14:07:58.000000000 -0500
@@ -1,7 +1,7 @@
 #ifndef _SYSDEP_TLS_H
 #define _SYSDEP_TLS_H
 
-# ifndef __KERNEL__
+#ifdef __UM_HOST__
 
 /* Change name to avoid conflicts with the original one from <asm/ldt.h>, which
  * may be named user_desc (but in 2.4 and in header matching its API was named
@@ -22,11 +22,11 @@ typedef struct um_dup_user_desc {
 #endif
 } user_desc_t;
 
-# else /* __KERNEL__ */
+#else /* __UM_HOST__ */
 
 typedef struct user_desc user_desc_t;
 
-# endif /* __KERNEL__ */
+#endif /* __UM_HOST__ */
 
 extern int os_set_thread_area(user_desc_t *info, int pid);
 extern int os_get_thread_area(user_desc_t *info, int pid);
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/block/loop.c linux-libre-3.18.94-gnu/drivers/block/loop.c
--- linux-libre-3.18.93-gnu/drivers/block/loop.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/block/loop.c	2018-02-07 14:07:58.000000000 -0500
@@ -1512,9 +1512,8 @@ out:
 	return err;
 }
 
-static void lo_release(struct gendisk *disk, fmode_t mode)
+static void __lo_release(struct loop_device *lo)
 {
-	struct loop_device *lo = disk->private_data;
 	int err;
 
 	mutex_lock(&lo->lo_ctl_mutex);
@@ -1542,6 +1541,13 @@ out:
 	mutex_unlock(&lo->lo_ctl_mutex);
 }
 
+static void lo_release(struct gendisk *disk, fmode_t mode)
+{
+	mutex_lock(&loop_index_mutex);
+	__lo_release(disk->private_data);
+	mutex_unlock(&loop_index_mutex);
+}
+
 static const struct block_device_operations lo_fops = {
 	.owner =	THIS_MODULE,
 	.open =		lo_open,
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/gpio/gpio-iop.c linux-libre-3.18.94-gnu/drivers/gpio/gpio-iop.c
--- linux-libre-3.18.93-gnu/drivers/gpio/gpio-iop.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/gpio/gpio-iop.c	2018-02-07 14:07:58.000000000 -0500
@@ -130,3 +130,7 @@ static int __init iop3xx_gpio_init(void)
 	return platform_driver_register(&iop3xx_gpio_driver);
 }
 arch_initcall(iop3xx_gpio_init);
+
+MODULE_DESCRIPTION("GPIO handling for Intel IOP3xx processors");
+MODULE_AUTHOR("Lennert Buytenhek <buytenh@wantstofly.org>");
+MODULE_LICENSE("GPL");
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/hwmon/pmbus/pmbus_core.c linux-libre-3.18.94-gnu/drivers/hwmon/pmbus/pmbus_core.c
--- linux-libre-3.18.93-gnu/drivers/hwmon/pmbus/pmbus_core.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/hwmon/pmbus/pmbus_core.c	2018-02-07 14:07:58.000000000 -0500
@@ -20,6 +20,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/math64.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/err.h>
@@ -443,8 +444,8 @@ static long pmbus_reg2data_linear(struct
 static long pmbus_reg2data_direct(struct pmbus_data *data,
 				  struct pmbus_sensor *sensor)
 {
-	long val = (s16) sensor->data;
-	long m, b, R;
+	s64 b, val = (s16)sensor->data;
+	s32 m, R;
 
 	m = data->info->m[sensor->class];
 	b = data->info->b[sensor->class];
@@ -472,11 +473,12 @@ static long pmbus_reg2data_direct(struct
 		R--;
 	}
 	while (R < 0) {
-		val = DIV_ROUND_CLOSEST(val, 10);
+		val = div_s64(val + 5LL, 10L);  /* round closest */
 		R++;
 	}
 
-	return (val - b) / m;
+	val = div_s64(val - b, m);
+	return clamp_val(val, LONG_MIN, LONG_MAX);
 }
 
 /*
@@ -588,7 +590,8 @@ static u16 pmbus_data2reg_linear(struct
 static u16 pmbus_data2reg_direct(struct pmbus_data *data,
 				 struct pmbus_sensor *sensor, long val)
 {
-	long m, b, R;
+	s64 b, val64 = val;
+	s32 m, R;
 
 	m = data->info->m[sensor->class];
 	b = data->info->b[sensor->class];
@@ -605,18 +608,18 @@ static u16 pmbus_data2reg_direct(struct
 		R -= 3;		/* Adjust R and b for data in milli-units */
 		b *= 1000;
 	}
-	val = val * m + b;
+	val64 = val64 * m + b;
 
 	while (R > 0) {
-		val *= 10;
+		val64 *= 10;
 		R--;
 	}
 	while (R < 0) {
-		val = DIV_ROUND_CLOSEST(val, 10);
+		val64 = div_s64(val64 + 5LL, 10L);  /* round closest */
 		R++;
 	}
 
-	return val;
+	return (u16)clamp_val(val64, S16_MIN, S16_MAX);
 }
 
 static u16 pmbus_data2reg_vid(struct pmbus_data *data,
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/input/input.c linux-libre-3.18.94-gnu/drivers/input/input.c
--- linux-libre-3.18.93-gnu/drivers/input/input.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/input/input.c	2018-02-07 14:07:58.000000000 -0500
@@ -668,6 +668,7 @@ EXPORT_SYMBOL(input_close_device);
  */
 static void input_dev_release_keys(struct input_dev *dev)
 {
+	bool need_sync = false;
 	int code;
 
 	if (is_event_supported(EV_KEY, dev->evbit, EV_MAX)) {
@@ -675,9 +676,11 @@ static void input_dev_release_keys(struc
 			if (is_event_supported(code, dev->keybit, KEY_MAX) &&
 			    __test_and_clear_bit(code, dev->key)) {
 				input_pass_event(dev, EV_KEY, code, 0);
+				need_sync = true;
 			}
 		}
-		input_pass_event(dev, EV_SYN, SYN_REPORT, 1);
+		if (need_sync)
+			input_pass_event(dev, EV_SYN, SYN_REPORT, 1);
 	}
 }
 
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/md/bcache/btree.c linux-libre-3.18.94-gnu/drivers/md/bcache/btree.c
--- linux-libre-3.18.93-gnu/drivers/md/bcache/btree.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/md/bcache/btree.c	2018-02-07 14:07:58.000000000 -0500
@@ -808,7 +808,10 @@ int bch_btree_cache_alloc(struct cache_s
 	c->shrink.scan_objects = bch_mca_scan;
 	c->shrink.seeks = 4;
 	c->shrink.batch = c->btree_pages * 2;
-	register_shrinker(&c->shrink);
+
+	if (register_shrinker(&c->shrink))
+		pr_warn("bcache: %s: could not register shrinker",
+				__func__);
 
 	return 0;
 }
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/media/usb/usbtv/usbtv-core.c linux-libre-3.18.94-gnu/drivers/media/usb/usbtv/usbtv-core.c
--- linux-libre-3.18.93-gnu/drivers/media/usb/usbtv/usbtv-core.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/media/usb/usbtv/usbtv-core.c	2018-02-07 14:07:58.000000000 -0500
@@ -127,6 +127,7 @@ static void usbtv_disconnect(struct usb_
 
 static struct usb_device_id usbtv_id_table[] = {
 	{ USB_DEVICE(0x1b71, 0x3002) },
+	{ USB_DEVICE(0x1f71, 0x3301) },
 	{}
 };
 MODULE_DEVICE_TABLE(usb, usbtv_id_table);
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/net/ethernet/intel/igb/igb_main.c linux-libre-3.18.94-gnu/drivers/net/ethernet/intel/igb/igb_main.c
--- linux-libre-3.18.93-gnu/drivers/net/ethernet/intel/igb/igb_main.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/net/ethernet/intel/igb/igb_main.c	2018-02-07 14:07:58.000000000 -0500
@@ -3172,7 +3172,7 @@ static int __igb_close(struct net_device
 
 static int igb_close(struct net_device *netdev)
 {
-	if (netif_device_present(netdev))
+	if (netif_device_present(netdev) || netdev->dismantle)
 		return __igb_close(netdev, false);
 	return 0;
 }
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/net/ethernet/xilinx/Kconfig linux-libre-3.18.94-gnu/drivers/net/ethernet/xilinx/Kconfig
--- linux-libre-3.18.93-gnu/drivers/net/ethernet/xilinx/Kconfig	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/net/ethernet/xilinx/Kconfig	2018-02-07 14:07:58.000000000 -0500
@@ -36,6 +36,7 @@ config XILINX_AXI_EMAC
 config XILINX_LL_TEMAC
 	tristate "Xilinx LL TEMAC (LocalLink Tri-mode Ethernet MAC) driver"
 	depends on (PPC || MICROBLAZE)
+	depends on !64BIT || BROKEN
 	select PHYLIB
 	---help---
 	  This driver supports the Xilinx 10/100/1000 LocalLink TEMAC
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/net/xen-netfront.c linux-libre-3.18.94-gnu/drivers/net/xen-netfront.c
--- linux-libre-3.18.93-gnu/drivers/net/xen-netfront.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/net/xen-netfront.c	2018-02-07 14:07:58.000000000 -0500
@@ -85,6 +85,8 @@ struct netfront_cb {
 /* IRQ name is queue name with "-tx" or "-rx" appended */
 #define IRQ_NAME_SIZE (QUEUE_NAME_SIZE + 3)
 
+static DECLARE_WAIT_QUEUE_HEAD(module_unload_q);
+
 struct netfront_stats {
 	u64			rx_packets;
 	u64			tx_packets;
@@ -2080,10 +2082,12 @@ static void netback_changed(struct xenbu
 		break;
 
 	case XenbusStateClosed:
+		wake_up_all(&module_unload_q);
 		if (dev->state == XenbusStateClosed)
 			break;
 		/* Missed the backend's CLOSING state -- fallthrough */
 	case XenbusStateClosing:
+		wake_up_all(&module_unload_q);
 		xenbus_frontend_closed(dev);
 		break;
 	}
@@ -2305,6 +2309,20 @@ static int xennet_remove(struct xenbus_d
 
 	dev_dbg(&dev->dev, "%s\n", dev->nodename);
 
+	if (xenbus_read_driver_state(dev->otherend) != XenbusStateClosed) {
+		xenbus_switch_state(dev, XenbusStateClosing);
+		wait_event(module_unload_q,
+			   xenbus_read_driver_state(dev->otherend) ==
+			   XenbusStateClosing);
+
+		xenbus_switch_state(dev, XenbusStateClosed);
+		wait_event(module_unload_q,
+			   xenbus_read_driver_state(dev->otherend) ==
+			   XenbusStateClosed ||
+			   xenbus_read_driver_state(dev->otherend) ==
+			   XenbusStateUnknown);
+	}
+
 	xennet_disconnect_backend(info);
 
 	xennet_sysfs_delif(info->netdev);
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/scsi/ufs/ufshcd.c linux-libre-3.18.94-gnu/drivers/scsi/ufs/ufshcd.c
--- linux-libre-3.18.93-gnu/drivers/scsi/ufs/ufshcd.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/scsi/ufs/ufshcd.c	2018-02-07 14:07:58.000000000 -0500
@@ -4287,12 +4287,15 @@ static int ufshcd_config_vreg(struct dev
 		struct ufs_vreg *vreg, bool on)
 {
 	int ret = 0;
-	struct regulator *reg = vreg->reg;
-	const char *name = vreg->name;
+	struct regulator *reg;
+	const char *name;
 	int min_uV, uA_load;
 
 	BUG_ON(!vreg);
 
+	reg = vreg->reg;
+	name = vreg->name;
+
 	if (regulator_count_voltages(reg) > 0) {
 		min_uV = on ? vreg->min_uV : 0;
 		ret = regulator_set_voltage(reg, min_uV, vreg->max_uV);
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/spi/spi-imx.c linux-libre-3.18.94-gnu/drivers/spi/spi-imx.c
--- linux-libre-3.18.93-gnu/drivers/spi/spi-imx.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/spi/spi-imx.c	2018-02-07 14:07:58.000000000 -0500
@@ -1220,12 +1220,23 @@ static int spi_imx_remove(struct platfor
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct spi_imx_data *spi_imx = spi_master_get_devdata(master);
+	int ret;
 
 	spi_bitbang_stop(&spi_imx->bitbang);
 
+	ret = clk_enable(spi_imx->clk_per);
+	if (ret)
+		return ret;
+
+	ret = clk_enable(spi_imx->clk_ipg);
+	if (ret) {
+		clk_disable(spi_imx->clk_per);
+		return ret;
+	}
+
 	writel(0, spi_imx->base + MXC_CSPICTRL);
-	clk_unprepare(spi_imx->clk_ipg);
-	clk_unprepare(spi_imx->clk_per);
+	clk_disable_unprepare(spi_imx->clk_ipg);
+	clk_disable_unprepare(spi_imx->clk_per);
 	spi_imx_sdma_exit(spi_imx);
 	spi_master_put(master);
 
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c linux-libre-3.18.94-gnu/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
--- linux-libre-3.18.93-gnu/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c	2018-02-07 14:07:58.000000000 -0500
@@ -1396,19 +1396,13 @@ static int rtw_wx_get_essid(struct net_d
 	if ((check_fwstate(pmlmepriv, _FW_LINKED)) ||
 	    (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) {
 		len = pcur_bss->Ssid.SsidLength;
-
-		wrqu->essid.length = len;
-
 		memcpy(extra, pcur_bss->Ssid.Ssid, len);
-
-		wrqu->essid.flags = 1;
 	} else {
-		ret = -1;
-		goto exit;
+		len = 0;
+		*extra = 0;
 	}
-
-exit:
-
+	wrqu->essid.length = len;
+	wrqu->essid.flags = 1;
 
 	return ret;
 }
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/usb/class/cdc-acm.c linux-libre-3.18.94-gnu/drivers/usb/class/cdc-acm.c
--- linux-libre-3.18.93-gnu/drivers/usb/class/cdc-acm.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/usb/class/cdc-acm.c	2018-02-07 14:07:58.000000000 -0500
@@ -381,7 +381,7 @@ static int acm_submit_read_urb(struct ac
 
 	res = usb_submit_urb(acm->read_urbs[index], mem_flags);
 	if (res) {
-		if (res != -EPERM) {
+		if (res != -EPERM && res != -ENODEV) {
 			dev_err(&acm->data->dev,
 					"%s - usb_submit_urb failed: %d\n",
 					__func__, res);
@@ -1712,6 +1712,9 @@ static const struct usb_device_id acm_id
 	{ USB_DEVICE(0x0ace, 0x1611), /* ZyDAS 56K USB MODEM - new version */
 	.driver_info = SINGLE_RX_URB, /* firmware bug */
 	},
+	{ USB_DEVICE(0x11ca, 0x0201), /* VeriFone Mx870 Gadget Serial */
+	.driver_info = SINGLE_RX_URB,
+	},
 	{ USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */
 	.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
 	},
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/usb/gadget/composite.c linux-libre-3.18.94-gnu/drivers/usb/gadget/composite.c
--- linux-libre-3.18.93-gnu/drivers/usb/gadget/composite.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/usb/gadget/composite.c	2018-02-07 14:07:58.000000000 -0500
@@ -103,7 +103,6 @@ int config_ep_by_speed(struct usb_gadget
 			struct usb_function *f,
 			struct usb_ep *_ep)
 {
-	struct usb_composite_dev	*cdev = get_gadget_data(g);
 	struct usb_endpoint_descriptor *chosen_desc = NULL;
 	struct usb_descriptor_header **speed_desc = NULL;
 
@@ -170,8 +169,12 @@ ep_found:
 			_ep->maxburst = comp_desc->bMaxBurst + 1;
 			break;
 		default:
-			if (comp_desc->bMaxBurst != 0)
+			if (comp_desc->bMaxBurst != 0) {
+				struct usb_composite_dev *cdev;
+
+				cdev = get_gadget_data(g);
 				ERROR(cdev, "ep0 bMaxBurst must be 0\n");
+			}
 			_ep->maxburst = 1;
 			break;
 		}
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/usb/gadget/function/f_fs.c linux-libre-3.18.94-gnu/drivers/usb/gadget/function/f_fs.c
--- linux-libre-3.18.93-gnu/drivers/usb/gadget/function/f_fs.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/usb/gadget/function/f_fs.c	2018-02-07 14:07:58.000000000 -0500
@@ -3438,7 +3438,8 @@ static void ffs_closed(struct ffs_data *
 	ci = opts->func_inst.group.cg_item.ci_parent->ci_parent;
 	ffs_dev_unlock();
 
-	unregister_gadget_item(ci);
+	if (test_bit(FFS_FL_BOUND, &ffs->flags))
+		unregister_gadget_item(ci);
 	return;
 done:
 	ffs_dev_unlock();
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/usb/serial/io_edgeport.c linux-libre-3.18.94-gnu/drivers/usb/serial/io_edgeport.c
--- linux-libre-3.18.93-gnu/drivers/usb/serial/io_edgeport.c	2018-01-31 10:47:22.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/usb/serial/io_edgeport.c	2018-02-07 21:57:10.000000000 -0500
@@ -2219,7 +2219,6 @@ static int write_cmd_usb(struct edgeport
 		/* something went wrong */
 		dev_err(dev, "%s - usb_submit_urb(write command) failed, status = %d\n",
 			__func__, status);
-		usb_kill_urb(urb);
 		usb_free_urb(urb);
 		atomic_dec(&CmdUrbs);
 		return status;
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/usb/serial/Kconfig linux-libre-3.18.94-gnu/drivers/usb/serial/Kconfig
--- linux-libre-3.18.93-gnu/drivers/usb/serial/Kconfig	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/usb/serial/Kconfig	2018-02-07 14:07:58.000000000 -0500
@@ -62,6 +62,7 @@ config USB_SERIAL_SIMPLE
 		- Fundamental Software dongle.
 		- HP4x calculators
 		- a number of Motorola phones
+		- Motorola Tetra devices
 		- Novatel Wireless GPS receivers
 		- Siemens USB/MPI adapter.
 		- ViVOtech ViVOpay USB device.
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/usb/serial/pl2303.c linux-libre-3.18.94-gnu/drivers/usb/serial/pl2303.c
--- linux-libre-3.18.93-gnu/drivers/usb/serial/pl2303.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/usb/serial/pl2303.c	2018-02-07 14:07:58.000000000 -0500
@@ -39,6 +39,7 @@ static const struct usb_device_id id_tab
 	{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ2) },
 	{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_DCU11) },
 	{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ3) },
+	{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_CHILITAG) },
 	{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_PHAROS) },
 	{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ALDIGA) },
 	{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) },
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/usb/serial/pl2303.h linux-libre-3.18.94-gnu/drivers/usb/serial/pl2303.h
--- linux-libre-3.18.93-gnu/drivers/usb/serial/pl2303.h	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/usb/serial/pl2303.h	2018-02-07 14:07:58.000000000 -0500
@@ -17,6 +17,7 @@
 #define PL2303_PRODUCT_ID_DCU11		0x1234
 #define PL2303_PRODUCT_ID_PHAROS	0xaaa0
 #define PL2303_PRODUCT_ID_RSAQ3		0xaaa2
+#define PL2303_PRODUCT_ID_CHILITAG	0xaaa8
 #define PL2303_PRODUCT_ID_ALDIGA	0x0611
 #define PL2303_PRODUCT_ID_MMX		0x0612
 #define PL2303_PRODUCT_ID_GPRS		0x0609
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/usb/serial/usb-serial-simple.c linux-libre-3.18.94-gnu/drivers/usb/serial/usb-serial-simple.c
--- linux-libre-3.18.93-gnu/drivers/usb/serial/usb-serial-simple.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/usb/serial/usb-serial-simple.c	2018-02-07 14:07:58.000000000 -0500
@@ -72,6 +72,11 @@ DEVICE(vivopay, VIVOPAY_IDS);
 	{ USB_DEVICE(0x22b8, 0x2c64) }	/* Motorola V950 phone */
 DEVICE(moto_modem, MOTO_IDS);
 
+/* Motorola Tetra driver */
+#define MOTOROLA_TETRA_IDS()			\
+	{ USB_DEVICE(0x0cad, 0x9011) }	/* Motorola Solutions TETRA PEI */
+DEVICE(motorola_tetra, MOTOROLA_TETRA_IDS);
+
 /* Novatel Wireless GPS driver */
 #define NOVATEL_IDS()			\
 	{ USB_DEVICE(0x09d7, 0x0100) }	/* NovAtel FlexPack GPS */
@@ -101,6 +106,7 @@ static struct usb_serial_driver * const
 	&flashloader_device,
 	&vivopay_device,
 	&moto_modem_device,
+	&motorola_tetra_device,
 	&novatel_gps_device,
 	&hp4x_device,
 	&suunto_device,
@@ -115,6 +121,7 @@ static const struct usb_device_id id_tab
 	FLASHLOADER_IDS(),
 	VIVOPAY_IDS(),
 	MOTO_IDS(),
+	MOTOROLA_TETRA_IDS(),
 	NOVATEL_IDS(),
 	HP4X_IDS(),
 	SUUNTO_IDS(),
diff -druNp --no-dereference linux-libre-3.18.93-gnu/drivers/usb/storage/uas.c linux-libre-3.18.94-gnu/drivers/usb/storage/uas.c
--- linux-libre-3.18.93-gnu/drivers/usb/storage/uas.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/drivers/usb/storage/uas.c	2018-02-07 14:07:58.000000000 -0500
@@ -1067,20 +1067,19 @@ static int uas_post_reset(struct usb_int
 		return 0;
 
 	err = uas_configure_endpoints(devinfo);
-	if (err) {
+	if (err && err != ENODEV)
 		shost_printk(KERN_ERR, shost,
 			     "%s: alloc streams error %d after reset",
 			     __func__, err);
-		return 1;
-	}
 
+	/* we must unblock the host in every case lest we deadlock */
 	spin_lock_irqsave(shost->host_lock, flags);
 	scsi_report_bus_reset(shost, 0);
 	spin_unlock_irqrestore(shost->host_lock, flags);
 
 	scsi_unblock_requests(shost);
 
-	return 0;
+	return err ? 1 : 0;
 }
 
 static int uas_suspend(struct usb_interface *intf, pm_message_t message)
diff -druNp --no-dereference linux-libre-3.18.93-gnu/fs/nfsd/nfs4state.c linux-libre-3.18.94-gnu/fs/nfsd/nfs4state.c
--- linux-libre-3.18.93-gnu/fs/nfsd/nfs4state.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/fs/nfsd/nfs4state.c	2018-02-07 14:07:58.000000000 -0500
@@ -62,12 +62,16 @@ static const stateid_t zero_stateid = {
 static const stateid_t currentstateid = {
 	.si_generation = 1,
 };
+static const stateid_t close_stateid = {
+	.si_generation = 0xffffffffU,
+};
 
 static u64 current_sessionid = 1;
 
 #define ZERO_STATEID(stateid) (!memcmp((stateid), &zero_stateid, sizeof(stateid_t)))
 #define ONE_STATEID(stateid)  (!memcmp((stateid), &one_stateid, sizeof(stateid_t)))
 #define CURRENT_STATEID(stateid) (!memcmp((stateid), &currentstateid, sizeof(stateid_t)))
+#define CLOSE_STATEID(stateid)  (!memcmp((stateid), &close_stateid, sizeof(stateid_t)))
 
 /* forward declarations */
 static bool check_for_locks(struct nfs4_file *fp, struct nfs4_lockowner *lowner);
@@ -4411,7 +4415,8 @@ static __be32 nfsd4_validate_stateid(str
 	struct nfs4_stid *s;
 	__be32 status = nfserr_bad_stateid;
 
-	if (ZERO_STATEID(stateid) || ONE_STATEID(stateid))
+	if (ZERO_STATEID(stateid) || ONE_STATEID(stateid) ||
+		CLOSE_STATEID(stateid))
 		return status;
 	/* Client debugging aid. */
 	if (!same_clid(&stateid->si_opaque.so_clid, &cl->cl_clientid)) {
@@ -4469,7 +4474,8 @@ nfsd4_lookup_stateid(struct nfsd4_compou
 	else if (typemask & NFS4_DELEG_STID)
 		typemask |= NFS4_REVOKED_DELEG_STID;
 
-	if (ZERO_STATEID(stateid) || ONE_STATEID(stateid))
+	if (ZERO_STATEID(stateid) || ONE_STATEID(stateid) ||
+		CLOSE_STATEID(stateid))
 		return nfserr_bad_stateid;
 	status = lookup_clientid(&stateid->si_opaque.so_clid, cstate, nn);
 	if (status == nfserr_stale_clientid) {
@@ -4901,6 +4907,11 @@ nfsd4_close(struct svc_rqst *rqstp, stru
 
 	nfsd4_close_open_stateid(stp);
 
+	/* See RFC5661 sectionm 18.2.4 */
+	if (stp->st_stid.sc_client->cl_minorversion)
+		memcpy(&close->cl_stateid, &close_stateid,
+				sizeof(close->cl_stateid));
+
 	/* put reference from nfs4_preprocess_seqid_op */
 	nfs4_put_stid(&stp->st_stid);
 out:
diff -druNp --no-dereference linux-libre-3.18.93-gnu/fs/quota/dquot.c linux-libre-3.18.94-gnu/fs/quota/dquot.c
--- linux-libre-3.18.93-gnu/fs/quota/dquot.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/fs/quota/dquot.c	2018-02-07 14:07:58.000000000 -0500
@@ -2730,7 +2730,8 @@ static int __init dquot_init(void)
 	printk("Dquot-cache hash table entries: %ld (order %ld, %ld bytes)\n",
 			nr_hash, order, (PAGE_SIZE << order));
 
-	register_shrinker(&dqcache_shrinker);
+	if (register_shrinker(&dqcache_shrinker))
+		panic("Cannot register dquot shrinker");
 
 	return 0;
 }
diff -druNp --no-dereference linux-libre-3.18.93-gnu/Makefile linux-libre-3.18.94-gnu/Makefile
--- linux-libre-3.18.93-gnu/Makefile	2018-01-31 10:16:23.000000000 -0500
+++ linux-libre-3.18.94-gnu/Makefile	2018-02-07 21:34:04.000000000 -0500
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 18
-SUBLEVEL = 93
+SUBLEVEL = 94
 EXTRAVERSION =-gnu
 NAME = Diseased Newt
 
diff -druNp --no-dereference linux-libre-3.18.93-gnu/net/mac80211/mesh_hwmp.c linux-libre-3.18.94-gnu/net/mac80211/mesh_hwmp.c
--- linux-libre-3.18.93-gnu/net/mac80211/mesh_hwmp.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/net/mac80211/mesh_hwmp.c	2018-02-07 14:07:58.000000000 -0500
@@ -763,7 +763,7 @@ static void hwmp_rann_frame_process(stru
 	struct mesh_path *mpath;
 	u8 ttl, flags, hopcount;
 	const u8 *orig_addr;
-	u32 orig_sn, metric, metric_txsta, interval;
+	u32 orig_sn, new_metric, orig_metric, last_hop_metric, interval;
 	bool root_is_gate;
 
 	ttl = rann->rann_ttl;
@@ -774,7 +774,7 @@ static void hwmp_rann_frame_process(stru
 	interval = le32_to_cpu(rann->rann_interval);
 	hopcount = rann->rann_hopcount;
 	hopcount++;
-	metric = le32_to_cpu(rann->rann_metric);
+	orig_metric = le32_to_cpu(rann->rann_metric);
 
 	/*  Ignore our own RANNs */
 	if (ether_addr_equal(orig_addr, sdata->vif.addr))
@@ -791,7 +791,10 @@ static void hwmp_rann_frame_process(stru
 		return;
 	}
 
-	metric_txsta = airtime_link_metric_get(local, sta);
+	last_hop_metric = airtime_link_metric_get(local, sta);
+	new_metric = orig_metric + last_hop_metric;
+	if (new_metric < orig_metric)
+		new_metric = MAX_METRIC;
 
 	mpath = mesh_path_lookup(sdata, orig_addr);
 	if (!mpath) {
@@ -804,7 +807,7 @@ static void hwmp_rann_frame_process(stru
 	}
 
 	if (!(SN_LT(mpath->sn, orig_sn)) &&
-	    !(mpath->sn == orig_sn && metric < mpath->rann_metric)) {
+	    !(mpath->sn == orig_sn && new_metric < mpath->rann_metric)) {
 		rcu_read_unlock();
 		return;
 	}
@@ -822,7 +825,7 @@ static void hwmp_rann_frame_process(stru
 	}
 
 	mpath->sn = orig_sn;
-	mpath->rann_metric = metric + metric_txsta;
+	mpath->rann_metric = new_metric;
 	mpath->is_root = true;
 	/* Recording RANNs sender address to send individually
 	 * addressed PREQs destined for root mesh STA */
@@ -842,7 +845,7 @@ static void hwmp_rann_frame_process(stru
 		mesh_path_sel_frame_tx(MPATH_RANN, flags, orig_addr,
 				       orig_sn, 0, NULL, 0, broadcast_addr,
 				       hopcount, ttl, interval,
-				       metric + metric_txsta, 0, sdata);
+				       new_metric, 0, sdata);
 	}
 
 	rcu_read_unlock();
diff -druNp --no-dereference linux-libre-3.18.93-gnu/security/selinux/hooks.c linux-libre-3.18.94-gnu/security/selinux/hooks.c
--- linux-libre-3.18.93-gnu/security/selinux/hooks.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/security/selinux/hooks.c	2018-02-07 14:07:58.000000000 -0500
@@ -3969,6 +3969,8 @@ static int sock_has_perm(struct task_str
 	struct lsm_network_audit net = {0,};
 	u32 tsid = task_sid(task);
 
+	if (!sksec)
+		return -EFAULT;
 	if (sksec->sid == SECINITSID_KERNEL)
 		return 0;
 
diff -druNp --no-dereference linux-libre-3.18.93-gnu/sound/core/seq/seq_clientmgr.c linux-libre-3.18.94-gnu/sound/core/seq/seq_clientmgr.c
--- linux-libre-3.18.93-gnu/sound/core/seq/seq_clientmgr.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/sound/core/seq/seq_clientmgr.c	2018-02-07 14:07:58.000000000 -0500
@@ -236,6 +236,7 @@ static struct snd_seq_client *seq_create
 	rwlock_init(&client->ports_lock);
 	mutex_init(&client->ports_mutex);
 	INIT_LIST_HEAD(&client->ports_list_head);
+	mutex_init(&client->ioctl_mutex);
 
 	/* find free slot in the client table */
 	spin_lock_irqsave(&clients_lock, flags);
@@ -2200,6 +2201,7 @@ static int snd_seq_do_ioctl(struct snd_s
 			    void __user *arg)
 {
 	struct seq_ioctl_table *p;
+	int ret;
 
 	switch (cmd) {
 	case SNDRV_SEQ_IOCTL_PVERSION:
@@ -2213,8 +2215,12 @@ static int snd_seq_do_ioctl(struct snd_s
 	if (! arg)
 		return -EFAULT;
 	for (p = ioctl_tables; p->cmd; p++) {
-		if (p->cmd == cmd)
-			return p->func(client, arg);
+		if (p->cmd == cmd) {
+			mutex_lock(&client->ioctl_mutex);
+			ret = p->func(client, arg);
+			mutex_unlock(&client->ioctl_mutex);
+			return ret;
+		}
 	}
 	pr_debug("ALSA: seq unknown ioctl() 0x%x (type='%c', number=0x%02x)\n",
 		   cmd, _IOC_TYPE(cmd), _IOC_NR(cmd));
diff -druNp --no-dereference linux-libre-3.18.93-gnu/sound/core/seq/seq_clientmgr.h linux-libre-3.18.94-gnu/sound/core/seq/seq_clientmgr.h
--- linux-libre-3.18.93-gnu/sound/core/seq/seq_clientmgr.h	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/sound/core/seq/seq_clientmgr.h	2018-02-07 14:07:58.000000000 -0500
@@ -59,6 +59,7 @@ struct snd_seq_client {
 	struct list_head ports_list_head;
 	rwlock_t ports_lock;
 	struct mutex ports_mutex;
+	struct mutex ioctl_mutex;
 	int convert32;		/* convert 32->64bit */
 
 	/* output pool */
diff -druNp --no-dereference linux-libre-3.18.93-gnu/sound/soc/codecs/pcm512x-spi.c linux-libre-3.18.94-gnu/sound/soc/codecs/pcm512x-spi.c
--- linux-libre-3.18.93-gnu/sound/soc/codecs/pcm512x-spi.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/sound/soc/codecs/pcm512x-spi.c	2018-02-07 14:07:58.000000000 -0500
@@ -67,3 +67,7 @@ static struct spi_driver pcm512x_spi_dri
 };
 
 module_spi_driver(pcm512x_spi_driver);
+
+MODULE_DESCRIPTION("ASoC PCM512x codec driver - SPI");
+MODULE_AUTHOR("Mark Brown <broonie@kernel.org>");
+MODULE_LICENSE("GPL v2");
diff -druNp --no-dereference linux-libre-3.18.93-gnu/tools/usb/usbip/src/usbip_bind.c linux-libre-3.18.94-gnu/tools/usb/usbip/src/usbip_bind.c
--- linux-libre-3.18.93-gnu/tools/usb/usbip/src/usbip_bind.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/tools/usb/usbip/src/usbip_bind.c	2018-02-07 14:07:58.000000000 -0500
@@ -144,6 +144,7 @@ static int bind_device(char *busid)
 	int rc;
 	struct udev *udev;
 	struct udev_device *dev;
+	const char *devpath;
 
 	/* Check whether the device with this bus ID exists. */
 	udev = udev_new();
@@ -152,8 +153,16 @@ static int bind_device(char *busid)
 		err("device with the specified bus ID does not exist");
 		return -1;
 	}
+	devpath = udev_device_get_devpath(dev);
 	udev_unref(udev);
 
+	/* If the device is already attached to vhci_hcd - bail out */
+	if (strstr(devpath, USBIP_VHCI_DRV_NAME)) {
+		err("bind loop detected: device: %s is attached to %s\n",
+		    devpath, USBIP_VHCI_DRV_NAME);
+		return -1;
+	}
+
 	rc = unbind_other(busid);
 	if (rc == UNBIND_ST_FAILED) {
 		err("could not unbind driver from device on busid %s", busid);
diff -druNp --no-dereference linux-libre-3.18.93-gnu/tools/usb/usbip/src/usbip_list.c linux-libre-3.18.94-gnu/tools/usb/usbip/src/usbip_list.c
--- linux-libre-3.18.93-gnu/tools/usb/usbip/src/usbip_list.c	2018-01-31 08:46:16.000000000 -0500
+++ linux-libre-3.18.94-gnu/tools/usb/usbip/src/usbip_list.c	2018-02-07 14:07:58.000000000 -0500
@@ -180,6 +180,7 @@ static int list_devices(bool parsable)
 	const char *busid;
 	char product_name[128];
 	int ret = -1;
+	const char *devpath;
 
 	/* Create libudev context. */
 	udev = udev_new();
@@ -202,6 +203,14 @@ static int list_devices(bool parsable)
 		path = udev_list_entry_get_name(dev_list_entry);
 		dev = udev_device_new_from_syspath(udev, path);
 
+		/* Ignore devices attached to vhci_hcd */
+		devpath = udev_device_get_devpath(dev);
+		if (strstr(devpath, USBIP_VHCI_DRV_NAME)) {
+			dbg("Skip the device %s already attached to %s\n",
+			    devpath, USBIP_VHCI_DRV_NAME);
+			continue;
+		}
+
 		/* Get device information. */
 		idVendor = udev_device_get_sysattr_value(dev, "idVendor");
 		idProduct = udev_device_get_sysattr_value(dev, "idProduct");
