--- /dev/null
+From 98d362becb6621bebdda7ed0eac7ad7ec6c37898 Mon Sep 17 00:00:00 2001
+From: Clemens Ladisch <clemens@ladisch.de>
+Date: Sun, 15 Nov 2015 22:37:44 +0100
+Subject: ALSA: usb-audio: add packet size quirk for the Medeli DD305
+
+From: Clemens Ladisch <clemens@ladisch.de>
+
+commit 98d362becb6621bebdda7ed0eac7ad7ec6c37898 upstream.
+
+Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/midi.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/usb/midi.c
++++ b/sound/usb/midi.c
+@@ -1326,6 +1326,7 @@ static int snd_usbmidi_out_endpoint_crea
+ * Various chips declare a packet size larger than 4 bytes, but
+ * do not actually work with larger packets:
+ */
++ case USB_ID(0x0a67, 0x5011): /* Medeli DD305 */
+ case USB_ID(0x0a92, 0x1020): /* ESI M4U */
+ case USB_ID(0x1430, 0x474b): /* RedOctane GH MIDI INTERFACE */
+ case USB_ID(0x15ca, 0x0101): /* Textech USB Midi Cable */
--- /dev/null
+From 1ca8b201309d842642f221db7f02f71c0af5be2d Mon Sep 17 00:00:00 2001
+From: Clemens Ladisch <clemens@ladisch.de>
+Date: Sun, 15 Nov 2015 22:38:29 +0100
+Subject: ALSA: usb-audio: prevent CH345 multiport output SysEx corruption
+
+From: Clemens Ladisch <clemens@ladisch.de>
+
+commit 1ca8b201309d842642f221db7f02f71c0af5be2d upstream.
+
+The CH345 USB MIDI chip has two output ports. However, they are
+multiplexed through one pin, and the number of ports cannot be reduced
+even for hardware that implements only one connector, so for those
+devices, data sent to either port ends up on the same hardware output.
+This becomes a problem when both ports are used at the same time, as
+longer MIDI commands (such as SysEx messages) are likely to be
+interrupted by messages from the other port, and thus to get lost.
+
+It would not be possible for the driver to detect how many ports the
+device actually has, except that in practice, _all_ devices built with
+the CH345 have only one port. So we can just ignore the device's
+descriptors, and hardcode one output port.
+
+Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/midi.c | 3 +++
+ sound/usb/quirks-table.h | 11 +++++++++++
+ sound/usb/quirks.c | 1 +
+ sound/usb/usbaudio.h | 1 +
+ 4 files changed, 16 insertions(+)
+
+--- a/sound/usb/midi.c
++++ b/sound/usb/midi.c
+@@ -2217,6 +2217,9 @@ int snd_usbmidi_create(struct snd_card *
+
+ err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
+ break;
++ case QUIRK_MIDI_CH345:
++ err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
++ break;
+ default:
+ snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type);
+ err = -ENXIO;
+--- a/sound/usb/quirks-table.h
++++ b/sound/usb/quirks-table.h
+@@ -3041,6 +3041,17 @@ YAMAHA_DEVICE(0x7010, "UB99"),
+ .idProduct = 0x1020,
+ },
+
++/* QinHeng devices */
++{
++ USB_DEVICE(0x1a86, 0x752d),
++ .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
++ .vendor_name = "QinHeng",
++ .product_name = "CH345",
++ .ifnum = 1,
++ .type = QUIRK_MIDI_CH345
++ }
++},
++
+ /* KeithMcMillen Stringport */
+ {
+ USB_DEVICE(0x1f38, 0x0001),
+--- a/sound/usb/quirks.c
++++ b/sound/usb/quirks.c
+@@ -313,6 +313,7 @@ int snd_usb_create_quirk(struct snd_usb_
+ [QUIRK_MIDI_CME] = create_any_midi_quirk,
+ [QUIRK_MIDI_AKAI] = create_any_midi_quirk,
+ [QUIRK_MIDI_FTDI] = create_any_midi_quirk,
++ [QUIRK_MIDI_CH345] = create_any_midi_quirk,
+ [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk,
+ [QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk,
+ [QUIRK_AUDIO_EDIROL_UAXX] = create_uaxx_quirk,
+--- a/sound/usb/usbaudio.h
++++ b/sound/usb/usbaudio.h
+@@ -83,6 +83,7 @@ enum quirk_type {
+ QUIRK_MIDI_AKAI,
+ QUIRK_MIDI_US122L,
+ QUIRK_MIDI_FTDI,
++ QUIRK_MIDI_CH345,
+ QUIRK_AUDIO_STANDARD_INTERFACE,
+ QUIRK_AUDIO_FIXED_ENDPOINT,
+ QUIRK_AUDIO_EDIROL_UAXX,
--- /dev/null
+From a91e627e3f0ed820b11d86cdc04df38f65f33a70 Mon Sep 17 00:00:00 2001
+From: Clemens Ladisch <clemens@ladisch.de>
+Date: Sun, 15 Nov 2015 22:39:08 +0100
+Subject: ALSA: usb-audio: work around CH345 input SysEx corruption
+
+From: Clemens Ladisch <clemens@ladisch.de>
+
+commit a91e627e3f0ed820b11d86cdc04df38f65f33a70 upstream.
+
+One of the many faults of the QinHeng CH345 USB MIDI interface chip is
+that it does not handle received SysEx messages correctly -- every second
+event packet has a wrong code index number, which is the one from the last
+seen message, instead of 4. For example, the two messages "FE F0 01 02 03
+04 05 06 07 08 09 0A 0B 0C 0D 0E F7" result in the following event
+packets:
+
+correct: CH345:
+0F FE 00 00 0F FE 00 00
+04 F0 01 02 04 F0 01 02
+04 03 04 05 0F 03 04 05
+04 06 07 08 04 06 07 08
+04 09 0A 0B 0F 09 0A 0B
+04 0C 0D 0E 04 0C 0D 0E
+05 F7 00 00 05 F7 00 00
+
+A class-compliant driver must interpret an event packet with CIN 15 as
+having a single data byte, so the other two bytes would be ignored. The
+message received by the host would then be missing two bytes out of six;
+in this example, "F0 01 02 03 06 07 08 09 0C 0D 0E F7".
+
+These corrupted SysEx event packages contain only data bytes, while the
+CH345 uses event packets with a correct CIN value only for messages with
+a status byte, so it is possible to distinguish between these two cases by
+checking for the presence of this status byte.
+
+(Other bugs in the CH345's input handling, such as the corruption resulting
+from running status, cannot be worked around.)
+
+Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/midi.c | 42 ++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 42 insertions(+)
+
+--- a/sound/usb/midi.c
++++ b/sound/usb/midi.c
+@@ -174,6 +174,8 @@ struct snd_usb_midi_in_endpoint {
+ u8 running_status_length;
+ } ports[0x10];
+ u8 seen_f5;
++ bool in_sysex;
++ u8 last_cin;
+ u8 error_resubmit;
+ int current_port;
+ };
+@@ -465,6 +467,39 @@ static void snd_usbmidi_maudio_broken_ru
+ }
+
+ /*
++ * QinHeng CH345 is buggy: every second packet inside a SysEx has not CIN 4
++ * but the previously seen CIN, but still with three data bytes.
++ */
++static void ch345_broken_sysex_input(struct snd_usb_midi_in_endpoint *ep,
++ uint8_t *buffer, int buffer_length)
++{
++ unsigned int i, cin, length;
++
++ for (i = 0; i + 3 < buffer_length; i += 4) {
++ if (buffer[i] == 0 && i > 0)
++ break;
++ cin = buffer[i] & 0x0f;
++ if (ep->in_sysex &&
++ cin == ep->last_cin &&
++ (buffer[i + 1 + (cin == 0x6)] & 0x80) == 0)
++ cin = 0x4;
++#if 0
++ if (buffer[i + 1] == 0x90) {
++ /*
++ * Either a corrupted running status or a real note-on
++ * message; impossible to detect reliably.
++ */
++ }
++#endif
++ length = snd_usbmidi_cin_length[cin];
++ snd_usbmidi_input_data(ep, 0, &buffer[i + 1], length);
++ ep->in_sysex = cin == 0x4;
++ if (!ep->in_sysex)
++ ep->last_cin = cin;
++ }
++}
++
++/*
+ * CME protocol: like the standard protocol, but SysEx commands are sent as a
+ * single USB packet preceded by a 0x0F byte.
+ */
+@@ -650,6 +685,12 @@ static struct usb_protocol_ops snd_usbmi
+ .output_packet = snd_usbmidi_output_standard_packet,
+ };
+
++static struct usb_protocol_ops snd_usbmidi_ch345_broken_sysex_ops = {
++ .input = ch345_broken_sysex_input,
++ .output = snd_usbmidi_standard_output,
++ .output_packet = snd_usbmidi_output_standard_packet,
++};
++
+ /*
+ * AKAI MPD16 protocol:
+ *
+@@ -2218,6 +2259,7 @@ int snd_usbmidi_create(struct snd_card *
+ err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
+ break;
+ case QUIRK_MIDI_CH345:
++ umidi->usb_protocol_ops = &snd_usbmidi_ch345_broken_sysex_ops;
+ err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
+ break;
+ default:
bluetooth-hidp-fix-device-disconnect-on-idle-timeout.patch
can-sja1000-clear-interrupts-on-start.patch
arm64-fix-compat-register-mappings.patch
+usblp-do-not-set-task_interruptible-before-lock.patch
+usb-musb-core-fix-order-of-arguments-to-ulpi-write.patch
+usb-serial-option-add-support-for-novatel-mifi-usb620l.patch
+usb-option-add-xs-stick-w100-2-from-4g-systems.patch
+alsa-usb-audio-add-packet-size-quirk-for-the-medeli-dd305.patch
+alsa-usb-audio-prevent-ch345-multiport-output-sysex-corruption.patch
+alsa-usb-audio-work-around-ch345-input-sysex-corruption.patch
--- /dev/null
+From 705e63d2b29c8bbf091119084544d353bda70393 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
+Date: Fri, 23 Oct 2015 09:53:50 +0200
+Subject: usb: musb: core: fix order of arguments to ulpi write
+ callback
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
+
+commit 705e63d2b29c8bbf091119084544d353bda70393 upstream.
+
+There is a bit of a mess in the order of arguments to the ulpi write
+callback. There is
+
+ int ulpi_write(struct ulpi *ulpi, u8 addr, u8 val)
+
+in drivers/usb/common/ulpi.c;
+
+ struct usb_phy_io_ops {
+ ...
+ int (*write)(struct usb_phy *x, u32 val, u32 reg);
+ }
+
+in include/linux/usb/phy.h.
+
+The callback registered by the musb driver has to comply to the latter,
+but up to now had "offset" first which effectively made the function
+broken for correct users. So flip the order and while at it also
+switch to the parameter names of struct usb_phy_io_ops's write.
+
+Fixes: ffb865b1e460 ("usb: musb: add ulpi access operations")
+Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Signed-off-by: Felipe Balbi <balbi@ti.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/musb/musb_core.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/usb/musb/musb_core.c
++++ b/drivers/usb/musb/musb_core.c
+@@ -133,7 +133,7 @@ static inline struct musb *dev_to_musb(s
+ /*-------------------------------------------------------------------------*/
+
+ #ifndef CONFIG_BLACKFIN
+-static int musb_ulpi_read(struct usb_phy *phy, u32 offset)
++static int musb_ulpi_read(struct usb_phy *phy, u32 reg)
+ {
+ void __iomem *addr = phy->io_priv;
+ int i = 0;
+@@ -152,7 +152,7 @@ static int musb_ulpi_read(struct usb_phy
+ * ULPICarKitControlDisableUTMI after clearing POWER_SUSPENDM.
+ */
+
+- musb_writeb(addr, MUSB_ULPI_REG_ADDR, (u8)offset);
++ musb_writeb(addr, MUSB_ULPI_REG_ADDR, (u8)reg);
+ musb_writeb(addr, MUSB_ULPI_REG_CONTROL,
+ MUSB_ULPI_REG_REQ | MUSB_ULPI_RDN_WR);
+
+@@ -177,7 +177,7 @@ out:
+ return ret;
+ }
+
+-static int musb_ulpi_write(struct usb_phy *phy, u32 offset, u32 data)
++static int musb_ulpi_write(struct usb_phy *phy, u32 val, u32 reg)
+ {
+ void __iomem *addr = phy->io_priv;
+ int i = 0;
+@@ -192,8 +192,8 @@ static int musb_ulpi_write(struct usb_ph
+ power &= ~MUSB_POWER_SUSPENDM;
+ musb_writeb(addr, MUSB_POWER, power);
+
+- musb_writeb(addr, MUSB_ULPI_REG_ADDR, (u8)offset);
+- musb_writeb(addr, MUSB_ULPI_REG_DATA, (u8)data);
++ musb_writeb(addr, MUSB_ULPI_REG_ADDR, (u8)reg);
++ musb_writeb(addr, MUSB_ULPI_REG_DATA, (u8)val);
+ musb_writeb(addr, MUSB_ULPI_REG_CONTROL, MUSB_ULPI_REG_REQ);
+
+ while (!(musb_readb(addr, MUSB_ULPI_REG_CONTROL)
--- /dev/null
+From 638148e20c7f8f6e95017fdc13bce8549a6925e0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no>
+Date: Wed, 18 Nov 2015 21:12:33 +0100
+Subject: USB: option: add XS Stick W100-2 from 4G Systems
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no>
+
+commit 638148e20c7f8f6e95017fdc13bce8549a6925e0 upstream.
+
+Thomas reports
+"
+4gsystems sells two total different LTE-surfsticks under the same name.
+..
+The newer version of XS Stick W100 is from "omega"
+..
+Under windows the driver switches to the same ID, and uses MI03\6 for
+network and MI01\6 for modem.
+..
+echo "1c9e 9b01" > /sys/bus/usb/drivers/qmi_wwan/new_id
+echo "1c9e 9b01" > /sys/bus/usb-serial/drivers/option1/new_id
+
+T: Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#= 4 Spd=480 MxCh= 0
+D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
+P: Vendor=1c9e ProdID=9b01 Rev=02.32
+S: Manufacturer=USB Modem
+S: Product=USB Modem
+S: SerialNumber=
+C: #Ifs= 5 Cfg#= 1 Atr=80 MxPwr=500mA
+I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
+I: If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
+I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
+I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
+I: If#= 4 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
+
+Now all important things are there:
+
+wwp0s29f7u2i3 (net), ttyUSB2 (at), cdc-wdm0 (qmi), ttyUSB1 (at)
+
+There is also ttyUSB0, but it is not usable, at least not for at.
+
+The device works well with qmi and ModemManager-NetworkManager.
+"
+
+Reported-by: Thomas Schäfer <tschaefer@t-online.de>
+Signed-off-by: Bjørn Mork <bjorn@mork.no>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/option.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/drivers/usb/serial/option.c
++++ b/drivers/usb/serial/option.c
+@@ -355,6 +355,7 @@ static void option_instat_callback(struc
+ /* This is the 4G XS Stick W14 a.k.a. Mobilcom Debitel Surf-Stick *
+ * It seems to contain a Qualcomm QSC6240/6290 chipset */
+ #define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603
++#define FOUR_G_SYSTEMS_PRODUCT_W100 0x9b01
+
+ /* iBall 3.5G connect wireless modem */
+ #define IBALL_3_5G_CONNECT 0x9605
+@@ -528,6 +529,11 @@ static const struct option_blacklist_inf
+ .sendsetup = BIT(0) | BIT(1),
+ };
+
++static const struct option_blacklist_info four_g_w100_blacklist = {
++ .sendsetup = BIT(1) | BIT(2),
++ .reserved = BIT(3),
++};
++
+ static const struct option_blacklist_info alcatel_x200_blacklist = {
+ .sendsetup = BIT(0) | BIT(1),
+ .reserved = BIT(4),
+@@ -1643,6 +1649,9 @@ static const struct usb_device_id option
+ { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14),
+ .driver_info = (kernel_ulong_t)&four_g_w14_blacklist
+ },
++ { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W100),
++ .driver_info = (kernel_ulong_t)&four_g_w100_blacklist
++ },
+ { USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, SPEEDUP_PRODUCT_SU9800, 0xff) },
+ { USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) },
+ { USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) },
--- /dev/null
+From e07af133c3e2716db25e3e1e1d9f10c2088e9c1a Mon Sep 17 00:00:00 2001
+From: Aleksander Morgado <aleksander@aleksander.es>
+Date: Wed, 11 Nov 2015 19:51:40 +0100
+Subject: USB: serial: option: add support for Novatel MiFi USB620L
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Aleksander Morgado <aleksander@aleksander.es>
+
+commit e07af133c3e2716db25e3e1e1d9f10c2088e9c1a upstream.
+
+Also known as Verizon U620L.
+
+The device is modeswitched from 1410:9020 to 1410:9022 by selecting the
+4th USB configuration:
+
+ $ sudo usb_modeswitch –v 0x1410 –p 0x9020 –u 4
+
+This configuration provides a ECM interface as well as TTYs ('Enterprise
+Mode' according to the U620 Linux integration guide).
+
+Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/option.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/usb/serial/option.c
++++ b/drivers/usb/serial/option.c
+@@ -162,6 +162,7 @@ static void option_instat_callback(struc
+ #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0x9001
+ #define NOVATELWIRELESS_PRODUCT_E362 0x9010
+ #define NOVATELWIRELESS_PRODUCT_E371 0x9011
++#define NOVATELWIRELESS_PRODUCT_U620L 0x9022
+ #define NOVATELWIRELESS_PRODUCT_G2 0xA010
+ #define NOVATELWIRELESS_PRODUCT_MC551 0xB001
+
+@@ -1060,6 +1061,7 @@ static const struct usb_device_id option
+ { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E362, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E371, 0xff, 0xff, 0xff) },
++ { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U620L, 0xff, 0x00, 0x00) },
+
+ { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) },
+ { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) },
--- /dev/null
+From 19cd80a214821f4b558560ebd76bfb2c38b4f3d8 Mon Sep 17 00:00:00 2001
+From: Jiri Slaby <jslaby@suse.cz>
+Date: Mon, 2 Nov 2015 10:27:00 +0100
+Subject: usblp: do not set TASK_INTERRUPTIBLE before lock
+
+From: Jiri Slaby <jslaby@suse.cz>
+
+commit 19cd80a214821f4b558560ebd76bfb2c38b4f3d8 upstream.
+
+It is not permitted to set task state before lock. usblp_wwait sets
+the state to TASK_INTERRUPTIBLE and calls mutex_lock_interruptible.
+Upon return from that function, the state will be TASK_RUNNING again.
+
+This is clearly a bug and a warning is generated with LOCKDEP too:
+WARNING: CPU: 1 PID: 5109 at kernel/sched/core.c:7404 __might_sleep+0x7d/0x90()
+do not call blocking ops when !TASK_RUNNING; state=1 set at [<ffffffffa0c588d0>] usblp_wwait+0xa0/0x310 [usblp]
+Modules linked in: ...
+CPU: 1 PID: 5109 Comm: captmon Tainted: G W 4.2.5-0.gef2823b-default #1
+Hardware name: LENOVO 23252SG/23252SG, BIOS G2ET33WW (1.13 ) 07/24/2012
+ ffffffff81a4edce ffff880236ec7ba8 ffffffff81716651 0000000000000000
+ ffff880236ec7bf8 ffff880236ec7be8 ffffffff8106e146 0000000000000282
+ ffffffff81a50119 000000000000028b 0000000000000000 ffff8802dab7c508
+Call Trace:
+...
+ [<ffffffff8106e1c6>] warn_slowpath_fmt+0x46/0x50
+ [<ffffffff8109a8bd>] __might_sleep+0x7d/0x90
+ [<ffffffff8171b20f>] mutex_lock_interruptible_nested+0x2f/0x4b0
+ [<ffffffffa0c588fc>] usblp_wwait+0xcc/0x310 [usblp]
+ [<ffffffffa0c58bb2>] usblp_write+0x72/0x350 [usblp]
+ [<ffffffff8121ed98>] __vfs_write+0x28/0xf0
+...
+
+Commit 7f477358e2384c54b190cc3b6ce28277050a041b (usblp: Implement the
+ENOSPC convention) moved the set prior locking. So move it back after
+the lock.
+
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Fixes: 7f477358e2 ("usblp: Implement the ENOSPC convention")
+Acked-By: Pete Zaitcev <zaitcev@yahoo.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/class/usblp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/usb/class/usblp.c
++++ b/drivers/usb/class/usblp.c
+@@ -870,11 +870,11 @@ static int usblp_wwait(struct usblp *usb
+
+ add_wait_queue(&usblp->wwait, &waita);
+ for (;;) {
+- set_current_state(TASK_INTERRUPTIBLE);
+ if (mutex_lock_interruptible(&usblp->mut)) {
+ rc = -EINTR;
+ break;
+ }
++ set_current_state(TASK_INTERRUPTIBLE);
+ rc = usblp_wtest(usblp, nonblock);
+ mutex_unlock(&usblp->mut);
+ if (rc <= 0)