From: Greg Kroah-Hartman Date: Mon, 7 Dec 2015 08:51:23 +0000 (-0800) Subject: 4.2-stable patches X-Git-Tag: v3.10.94~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=010ba15e53ef15f94c6bd98470be2b5dfd67f508;p=thirdparty%2Fkernel%2Fstable-queue.git 4.2-stable patches added patches: alsa-usb-add-native-dsd-support-for-aune-x1s.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 staging-lustre-use-jiffies-for-lp_last_query-times.patch tty-audit-fix-audit-source.patch tty-fix-tty_send_xchar-lock-order-inversion.patch ttyfdc-fix-build-problems-due-to-use-of-module_-init-exit.patch usb-chipidea-imx-refine-clock-operations-to-adapt-for-all-platforms.patch usb-ehci-orion-fix-probe-for-generic_phy.patch usb-musb-core-fix-order-of-arguments-to-ulpi-write.patch usb-option-add-xs-stick-w100-2-from-4g-systems.patch usb-qcserial-add-support-for-quectel-ec20-mini-pcie-module.patch usb-qcserial-fix-support-for-hp-lt4112-lte-hspa-gobi-4g-modem.patch usb-serial-option-add-support-for-novatel-mifi-usb620l.patch usb-ti_usb_3410_5052-add-honeywell-hgi80-id.patch usblp-do-not-set-task_interruptible-before-lock.patch xhci-workaround-to-get-intel-xhci-reset-working-more-reliably.patch --- diff --git a/queue-4.2/alsa-usb-add-native-dsd-support-for-aune-x1s.patch b/queue-4.2/alsa-usb-add-native-dsd-support-for-aune-x1s.patch new file mode 100644 index 00000000000..749e6a34392 --- /dev/null +++ b/queue-4.2/alsa-usb-add-native-dsd-support-for-aune-x1s.patch @@ -0,0 +1,29 @@ +From 16771c7c704769c5f3d70c024630b6e5b3eafa67 Mon Sep 17 00:00:00 2001 +From: Jurgen Kramer +Date: Mon, 9 Nov 2015 12:13:55 +0100 +Subject: ALSA: usb: Add native DSD support for Aune X1S + +From: Jurgen Kramer + +commit 16771c7c704769c5f3d70c024630b6e5b3eafa67 upstream. + +This patch adds native DSD support for the Aune X1S 32BIT/384 DSD DAC + +Signed-off-by: Jurgen Kramer +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/quirks.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -1271,6 +1271,7 @@ u64 snd_usb_interface_dsd_format_quirks( + case USB_ID(0x20b1, 0x000a): /* Gustard DAC-X20U */ + case USB_ID(0x20b1, 0x2009): /* DIYINHK DSD DXD 384kHz USB to I2S/DSD */ + case USB_ID(0x20b1, 0x2023): /* JLsounds I2SoverUSB */ ++ case USB_ID(0x20b1, 0x3023): /* Aune X1S 32BIT/384 DSD DAC */ + if (fp->altsetting == 3) + return SNDRV_PCM_FMTBIT_DSD_U32_BE; + break; diff --git a/queue-4.2/alsa-usb-audio-add-packet-size-quirk-for-the-medeli-dd305.patch b/queue-4.2/alsa-usb-audio-add-packet-size-quirk-for-the-medeli-dd305.patch new file mode 100644 index 00000000000..ea6502404f4 --- /dev/null +++ b/queue-4.2/alsa-usb-audio-add-packet-size-quirk-for-the-medeli-dd305.patch @@ -0,0 +1,27 @@ +From 98d362becb6621bebdda7ed0eac7ad7ec6c37898 Mon Sep 17 00:00:00 2001 +From: Clemens Ladisch +Date: Sun, 15 Nov 2015 22:37:44 +0100 +Subject: ALSA: usb-audio: add packet size quirk for the Medeli DD305 + +From: Clemens Ladisch + +commit 98d362becb6621bebdda7ed0eac7ad7ec6c37898 upstream. + +Signed-off-by: Clemens Ladisch +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/midi.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/usb/midi.c ++++ b/sound/usb/midi.c +@@ -1341,6 +1341,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 */ diff --git a/queue-4.2/alsa-usb-audio-prevent-ch345-multiport-output-sysex-corruption.patch b/queue-4.2/alsa-usb-audio-prevent-ch345-multiport-output-sysex-corruption.patch new file mode 100644 index 00000000000..cee192d6b3b --- /dev/null +++ b/queue-4.2/alsa-usb-audio-prevent-ch345-multiport-output-sysex-corruption.patch @@ -0,0 +1,85 @@ +From 1ca8b201309d842642f221db7f02f71c0af5be2d Mon Sep 17 00:00:00 2001 +From: Clemens Ladisch +Date: Sun, 15 Nov 2015 22:38:29 +0100 +Subject: ALSA: usb-audio: prevent CH345 multiport output SysEx corruption + +From: Clemens Ladisch + +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 +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -2376,6 +2376,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: + dev_err(&umidi->dev->dev, "invalid quirk type %d\n", + quirk->type); +--- a/sound/usb/quirks-table.h ++++ b/sound/usb/quirks-table.h +@@ -2820,6 +2820,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 +@@ -535,6 +535,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 +@@ -94,6 +94,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, diff --git a/queue-4.2/alsa-usb-audio-work-around-ch345-input-sysex-corruption.patch b/queue-4.2/alsa-usb-audio-work-around-ch345-input-sysex-corruption.patch new file mode 100644 index 00000000000..66870a9eb83 --- /dev/null +++ b/queue-4.2/alsa-usb-audio-work-around-ch345-input-sysex-corruption.patch @@ -0,0 +1,118 @@ +From a91e627e3f0ed820b11d86cdc04df38f65f33a70 Mon Sep 17 00:00:00 2001 +From: Clemens Ladisch +Date: Sun, 15 Nov 2015 22:39:08 +0100 +Subject: ALSA: usb-audio: work around CH345 input SysEx corruption + +From: Clemens Ladisch + +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 +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + 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; + }; +@@ -468,6 +470,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. + */ +@@ -660,6 +695,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: + * +@@ -2377,6 +2418,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: diff --git a/queue-4.2/series b/queue-4.2/series index f46f6c5610c..109cc453301 100644 --- a/queue-4.2/series +++ b/queue-4.2/series @@ -102,3 +102,21 @@ usb-dwc3-support-synopsys-usb-3.1-ip.patch usb-dwc3-pci-add-platform-data-for-synopsys-haps.patch usb-dwc3-add-dis_enblslpm_quirk.patch usb-dwc3-pci-set-enblslpm-quirk-for-synopsys-platforms.patch +usb-chipidea-imx-refine-clock-operations-to-adapt-for-all-platforms.patch +alsa-usb-add-native-dsd-support-for-aune-x1s.patch +usb-ehci-orion-fix-probe-for-generic_phy.patch +usblp-do-not-set-task_interruptible-before-lock.patch +usb-qcserial-add-support-for-quectel-ec20-mini-pcie-module.patch +usb-qcserial-fix-support-for-hp-lt4112-lte-hspa-gobi-4g-modem.patch +usb-musb-core-fix-order-of-arguments-to-ulpi-write.patch +usb-ti_usb_3410_5052-add-honeywell-hgi80-id.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 +ttyfdc-fix-build-problems-due-to-use-of-module_-init-exit.patch +tty-audit-fix-audit-source.patch +tty-fix-tty_send_xchar-lock-order-inversion.patch +xhci-workaround-to-get-intel-xhci-reset-working-more-reliably.patch +staging-lustre-use-jiffies-for-lp_last_query-times.patch diff --git a/queue-4.2/staging-lustre-use-jiffies-for-lp_last_query-times.patch b/queue-4.2/staging-lustre-use-jiffies-for-lp_last_query-times.patch new file mode 100644 index 00000000000..af108bb1452 --- /dev/null +++ b/queue-4.2/staging-lustre-use-jiffies-for-lp_last_query-times.patch @@ -0,0 +1,38 @@ +From 9f088dba3cc267ea11ec0da318cd0175575b5f9b Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Sun, 27 Sep 2015 16:45:01 -0400 +Subject: staging/lustre: use jiffies for lp_last_query times + +From: Arnd Bergmann + +commit 9f088dba3cc267ea11ec0da318cd0175575b5f9b upstream. + +The recently introduced lnet_peer_set_alive() function uses +get_seconds() to read the current time into a shared variable, +but all other uses of that variable compare it to jiffies values. + +This changes the current use to jiffies as well for consistency. + +Signed-off-by: Arnd Bergmann +Fixes: af3fa7c71bf ("staging/lustre/lnet: peer aliveness status and NI status") +Cc: Liang Zhen +Cc: James Simmons +Cc: Isaac Huang +Signed-off-by: Oleg Drokin +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h ++++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +@@ -680,7 +680,7 @@ void lnet_debug_peer(lnet_nid_t nid); + static inline void + lnet_peer_set_alive(lnet_peer_t *lp) + { +- lp->lp_last_alive = lp->lp_last_query = get_seconds(); ++ lp->lp_last_alive = lp->lp_last_query = jiffies; + if (!lp->lp_alive) + lnet_notify_locked(lp, 0, 1, lp->lp_last_alive); + } diff --git a/queue-4.2/tty-audit-fix-audit-source.patch b/queue-4.2/tty-audit-fix-audit-source.patch new file mode 100644 index 00000000000..c11b40fdfc8 --- /dev/null +++ b/queue-4.2/tty-audit-fix-audit-source.patch @@ -0,0 +1,72 @@ +From 6b2a3d628aa752f0ab825fc6d4d07b09e274d1c1 Mon Sep 17 00:00:00 2001 +From: Peter Hurley +Date: Sun, 8 Nov 2015 08:52:31 -0500 +Subject: tty: audit: Fix audit source +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Peter Hurley + +commit 6b2a3d628aa752f0ab825fc6d4d07b09e274d1c1 upstream. + +The data to audit/record is in the 'from' buffer (ie., the input +read buffer). + +Fixes: 72586c6061ab ("n_tty: Fix auditing support for cannonical mode") +Cc: Miloslav Trmač +Signed-off-by: Peter Hurley +Acked-by: Laura Abbott +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/n_tty.c | 2 +- + drivers/tty/tty_audit.c | 2 +- + include/linux/tty.h | 6 +++--- + 3 files changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/tty/n_tty.c ++++ b/drivers/tty/n_tty.c +@@ -169,7 +169,7 @@ static inline int tty_copy_to_user(struc + { + struct n_tty_data *ldata = tty->disc_data; + +- tty_audit_add_data(tty, to, n, ldata->icanon); ++ tty_audit_add_data(tty, from, n, ldata->icanon); + return copy_to_user(to, from, n); + } + +--- a/drivers/tty/tty_audit.c ++++ b/drivers/tty/tty_audit.c +@@ -265,7 +265,7 @@ static struct tty_audit_buf *tty_audit_b + * + * Audit @data of @size from @tty, if necessary. + */ +-void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, ++void tty_audit_add_data(struct tty_struct *tty, const void *data, + size_t size, unsigned icanon) + { + struct tty_audit_buf *buf; +--- a/include/linux/tty.h ++++ b/include/linux/tty.h +@@ -605,7 +605,7 @@ extern void n_tty_inherit_ops(struct tty + + /* tty_audit.c */ + #ifdef CONFIG_AUDIT +-extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, ++extern void tty_audit_add_data(struct tty_struct *tty, const void *data, + size_t size, unsigned icanon); + extern void tty_audit_exit(void); + extern void tty_audit_fork(struct signal_struct *sig); +@@ -613,8 +613,8 @@ extern void tty_audit_tiocsti(struct tty + extern void tty_audit_push(struct tty_struct *tty); + extern int tty_audit_push_current(void); + #else +-static inline void tty_audit_add_data(struct tty_struct *tty, +- unsigned char *data, size_t size, unsigned icanon) ++static inline void tty_audit_add_data(struct tty_struct *tty, const void *data, ++ size_t size, unsigned icanon) + { + } + static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch) diff --git a/queue-4.2/tty-fix-tty_send_xchar-lock-order-inversion.patch b/queue-4.2/tty-fix-tty_send_xchar-lock-order-inversion.patch new file mode 100644 index 00000000000..69c5de42d76 --- /dev/null +++ b/queue-4.2/tty-fix-tty_send_xchar-lock-order-inversion.patch @@ -0,0 +1,66 @@ +From ee0c1a65cf95230d5eb3d9de94fd2ead9a428c67 Mon Sep 17 00:00:00 2001 +From: Peter Hurley +Date: Wed, 11 Nov 2015 08:03:54 -0500 +Subject: tty: Fix tty_send_xchar() lock order inversion + +From: Peter Hurley + +commit ee0c1a65cf95230d5eb3d9de94fd2ead9a428c67 upstream. + +The correct lock order is atomic_write_lock => termios_rwsem, as +established by tty_write() => n_tty_write(). + +Fixes: c274f6ef1c666 ("tty: Hold termios_rwsem for tcflow(TCIxxx)") +Reported-and-Tested-by: Dmitry Vyukov +Signed-off-by: Peter Hurley +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/tty_io.c | 4 ++++ + drivers/tty/tty_ioctl.c | 4 ---- + 2 files changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/tty/tty_io.c ++++ b/drivers/tty/tty_io.c +@@ -1279,18 +1279,22 @@ int tty_send_xchar(struct tty_struct *tt + int was_stopped = tty->stopped; + + if (tty->ops->send_xchar) { ++ down_read(&tty->termios_rwsem); + tty->ops->send_xchar(tty, ch); ++ up_read(&tty->termios_rwsem); + return 0; + } + + if (tty_write_lock(tty, 0) < 0) + return -ERESTARTSYS; + ++ down_read(&tty->termios_rwsem); + if (was_stopped) + start_tty(tty); + tty->ops->write(tty, &ch, 1); + if (was_stopped) + stop_tty(tty); ++ up_read(&tty->termios_rwsem); + tty_write_unlock(tty); + return 0; + } +--- a/drivers/tty/tty_ioctl.c ++++ b/drivers/tty/tty_ioctl.c +@@ -1142,16 +1142,12 @@ int n_tty_ioctl_helper(struct tty_struct + spin_unlock_irq(&tty->flow_lock); + break; + case TCIOFF: +- down_read(&tty->termios_rwsem); + if (STOP_CHAR(tty) != __DISABLED_CHAR) + retval = tty_send_xchar(tty, STOP_CHAR(tty)); +- up_read(&tty->termios_rwsem); + break; + case TCION: +- down_read(&tty->termios_rwsem); + if (START_CHAR(tty) != __DISABLED_CHAR) + retval = tty_send_xchar(tty, START_CHAR(tty)); +- up_read(&tty->termios_rwsem); + break; + default: + return -EINVAL; diff --git a/queue-4.2/ttyfdc-fix-build-problems-due-to-use-of-module_-init-exit.patch b/queue-4.2/ttyfdc-fix-build-problems-due-to-use-of-module_-init-exit.patch new file mode 100644 index 00000000000..85c151bb084 --- /dev/null +++ b/queue-4.2/ttyfdc-fix-build-problems-due-to-use-of-module_-init-exit.patch @@ -0,0 +1,98 @@ +From 3e8137a185240fa6da0ff91cd9c604716371903b Mon Sep 17 00:00:00 2001 +From: James Hogan +Date: Tue, 6 Oct 2015 15:12:06 +0100 +Subject: ttyFDC: Fix build problems due to use of module_{init,exit} +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: James Hogan + +commit 3e8137a185240fa6da0ff91cd9c604716371903b upstream. + +Commit 0fd972a7d91d (module: relocate module_init from init.h to +module.h) broke the build of ttyFDC driver due to that driver's (mis)use +of module_mips_cdmm_driver() without first including module.h, for +example: + +In file included from ./arch/mips/include/asm/cdmm.h +11 :0, + from drivers/tty/mips_ejtag_fdc.c +34 : +include/linux/device.h +1295 :1: warning: data definition has no type or storage class +./arch/mips/include/asm/cdmm.h +84 :2: note: in expansion of macro ‘module_driver’ +drivers/tty/mips_ejtag_fdc.c +1157 :1: note: in expansion of macro ‘module_mips_cdmm_driver’ +include/linux/device.h +1295 :1: error: type defaults to ‘int’ in declaration of ‘module_init’ [-Werror=implicit-int] +./arch/mips/include/asm/cdmm.h +84 :2: note: in expansion of macro ‘module_driver’ +drivers/tty/mips_ejtag_fdc.c +1157 :1: note: in expansion of macro ‘module_mips_cdmm_driver’ +drivers/tty/mips_ejtag_fdc.c +1157 :1: warning: parameter names (without types) in function declaration + +Instead of just adding the module.h include, switch to using the new +builtin_mips_cdmm_driver() helper macro and drop the remove callback, +since it isn't needed. If module support is added later, the code can +always be resurrected. + +Signed-off-by: James Hogan +Cc: Greg Kroah-Hartman +Cc: Jiri Slaby +Cc: Paul Gortmaker +Cc: linux-mips@linux-mips.org +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/mips_ejtag_fdc.c | 35 +---------------------------------- + 1 file changed, 1 insertion(+), 34 deletions(-) + +--- a/drivers/tty/mips_ejtag_fdc.c ++++ b/drivers/tty/mips_ejtag_fdc.c +@@ -1045,38 +1045,6 @@ err_destroy_ports: + return ret; + } + +-static int mips_ejtag_fdc_tty_remove(struct mips_cdmm_device *dev) +-{ +- struct mips_ejtag_fdc_tty *priv = mips_cdmm_get_drvdata(dev); +- struct mips_ejtag_fdc_tty_port *dport; +- int nport; +- unsigned int cfg; +- +- if (priv->irq >= 0) { +- raw_spin_lock_irq(&priv->lock); +- cfg = mips_ejtag_fdc_read(priv, REG_FDCFG); +- /* Disable interrupts */ +- cfg &= ~(REG_FDCFG_TXINTTHRES | REG_FDCFG_RXINTTHRES); +- cfg |= REG_FDCFG_TXINTTHRES_DISABLED; +- cfg |= REG_FDCFG_RXINTTHRES_DISABLED; +- mips_ejtag_fdc_write(priv, REG_FDCFG, cfg); +- raw_spin_unlock_irq(&priv->lock); +- } else { +- priv->removing = true; +- del_timer_sync(&priv->poll_timer); +- } +- kthread_stop(priv->thread); +- if (dev->cpu == 0) +- mips_ejtag_fdc_con.tty_drv = NULL; +- tty_unregister_driver(priv->driver); +- for (nport = 0; nport < NUM_TTY_CHANNELS; nport++) { +- dport = &priv->ports[nport]; +- tty_port_destroy(&dport->port); +- } +- put_tty_driver(priv->driver); +- return 0; +-} +- + static int mips_ejtag_fdc_tty_cpu_down(struct mips_cdmm_device *dev) + { + struct mips_ejtag_fdc_tty *priv = mips_cdmm_get_drvdata(dev); +@@ -1149,12 +1117,11 @@ static struct mips_cdmm_driver mips_ejta + .name = "mips_ejtag_fdc", + }, + .probe = mips_ejtag_fdc_tty_probe, +- .remove = mips_ejtag_fdc_tty_remove, + .cpu_down = mips_ejtag_fdc_tty_cpu_down, + .cpu_up = mips_ejtag_fdc_tty_cpu_up, + .id_table = mips_ejtag_fdc_tty_ids, + }; +-module_mips_cdmm_driver(mips_ejtag_fdc_tty_driver); ++builtin_mips_cdmm_driver(mips_ejtag_fdc_tty_driver); + + static int __init mips_ejtag_fdc_init_console(void) + { diff --git a/queue-4.2/usb-chipidea-imx-refine-clock-operations-to-adapt-for-all-platforms.patch b/queue-4.2/usb-chipidea-imx-refine-clock-operations-to-adapt-for-all-platforms.patch new file mode 100644 index 00000000000..f2f590c8d06 --- /dev/null +++ b/queue-4.2/usb-chipidea-imx-refine-clock-operations-to-adapt-for-all-platforms.patch @@ -0,0 +1,223 @@ +From ae3e57ae26cdcc85728bb566f999bcb9a7cc6954 Mon Sep 17 00:00:00 2001 +From: Peter Chen +Date: Wed, 16 Sep 2015 09:40:51 +0800 +Subject: usb: chipidea: imx: refine clock operations to adapt for all platforms + +From: Peter Chen + +commit ae3e57ae26cdcc85728bb566f999bcb9a7cc6954 upstream. + +Some i.mx platforms need three clocks to let controller work, but +others only need one, refine clock operation to adapt for all +platforms, it fixes a regression found at i.mx27. + +Signed-off-by: Peter Chen +Tested-by: Fabio Estevam +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/chipidea/ci_hdrc_imx.c | 131 +++++++++++++++++++++++++++++++------ + 1 file changed, 113 insertions(+), 18 deletions(-) + +--- a/drivers/usb/chipidea/ci_hdrc_imx.c ++++ b/drivers/usb/chipidea/ci_hdrc_imx.c +@@ -68,6 +68,12 @@ struct ci_hdrc_imx_data { + struct imx_usbmisc_data *usbmisc_data; + bool supports_runtime_pm; + bool in_lpm; ++ /* SoC before i.mx6 (except imx23/imx28) needs three clks */ ++ bool need_three_clks; ++ struct clk *clk_ipg; ++ struct clk *clk_ahb; ++ struct clk *clk_per; ++ /* --------------------------------- */ + }; + + /* Common functions shared by usbmisc drivers */ +@@ -119,6 +125,102 @@ static struct imx_usbmisc_data *usbmisc_ + } + + /* End of common functions shared by usbmisc drivers*/ ++static int imx_get_clks(struct device *dev) ++{ ++ struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); ++ int ret = 0; ++ ++ data->clk_ipg = devm_clk_get(dev, "ipg"); ++ if (IS_ERR(data->clk_ipg)) { ++ /* If the platform only needs one clocks */ ++ data->clk = devm_clk_get(dev, NULL); ++ if (IS_ERR(data->clk)) { ++ ret = PTR_ERR(data->clk); ++ dev_err(dev, ++ "Failed to get clks, err=%ld,%ld\n", ++ PTR_ERR(data->clk), PTR_ERR(data->clk_ipg)); ++ return ret; ++ } ++ return ret; ++ } ++ ++ data->clk_ahb = devm_clk_get(dev, "ahb"); ++ if (IS_ERR(data->clk_ahb)) { ++ ret = PTR_ERR(data->clk_ahb); ++ dev_err(dev, ++ "Failed to get ahb clock, err=%d\n", ret); ++ return ret; ++ } ++ ++ data->clk_per = devm_clk_get(dev, "per"); ++ if (IS_ERR(data->clk_per)) { ++ ret = PTR_ERR(data->clk_per); ++ dev_err(dev, ++ "Failed to get per clock, err=%d\n", ret); ++ return ret; ++ } ++ ++ data->need_three_clks = true; ++ return ret; ++} ++ ++static int imx_prepare_enable_clks(struct device *dev) ++{ ++ struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); ++ int ret = 0; ++ ++ if (data->need_three_clks) { ++ ret = clk_prepare_enable(data->clk_ipg); ++ if (ret) { ++ dev_err(dev, ++ "Failed to prepare/enable ipg clk, err=%d\n", ++ ret); ++ return ret; ++ } ++ ++ ret = clk_prepare_enable(data->clk_ahb); ++ if (ret) { ++ dev_err(dev, ++ "Failed to prepare/enable ahb clk, err=%d\n", ++ ret); ++ clk_disable_unprepare(data->clk_ipg); ++ return ret; ++ } ++ ++ ret = clk_prepare_enable(data->clk_per); ++ if (ret) { ++ dev_err(dev, ++ "Failed to prepare/enable per clk, err=%d\n", ++ ret); ++ clk_disable_unprepare(data->clk_ahb); ++ clk_disable_unprepare(data->clk_ipg); ++ return ret; ++ } ++ } else { ++ ret = clk_prepare_enable(data->clk); ++ if (ret) { ++ dev_err(dev, ++ "Failed to prepare/enable clk, err=%d\n", ++ ret); ++ return ret; ++ } ++ } ++ ++ return ret; ++} ++ ++static void imx_disable_unprepare_clks(struct device *dev) ++{ ++ struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); ++ ++ if (data->need_three_clks) { ++ clk_disable_unprepare(data->clk_per); ++ clk_disable_unprepare(data->clk_ahb); ++ clk_disable_unprepare(data->clk_ipg); ++ } else { ++ clk_disable_unprepare(data->clk); ++ } ++} + + static int ci_hdrc_imx_probe(struct platform_device *pdev) + { +@@ -137,23 +239,18 @@ static int ci_hdrc_imx_probe(struct plat + if (!data) + return -ENOMEM; + ++ platform_set_drvdata(pdev, data); + data->usbmisc_data = usbmisc_get_init_data(&pdev->dev); + if (IS_ERR(data->usbmisc_data)) + return PTR_ERR(data->usbmisc_data); + +- data->clk = devm_clk_get(&pdev->dev, NULL); +- if (IS_ERR(data->clk)) { +- dev_err(&pdev->dev, +- "Failed to get clock, err=%ld\n", PTR_ERR(data->clk)); +- return PTR_ERR(data->clk); +- } ++ ret = imx_get_clks(&pdev->dev); ++ if (ret) ++ return ret; + +- ret = clk_prepare_enable(data->clk); +- if (ret) { +- dev_err(&pdev->dev, +- "Failed to prepare or enable clock, err=%d\n", ret); ++ ret = imx_prepare_enable_clks(&pdev->dev); ++ if (ret) + return ret; +- } + + data->phy = devm_usb_get_phy_by_phandle(&pdev->dev, "fsl,usbphy", 0); + if (IS_ERR(data->phy)) { +@@ -196,8 +293,6 @@ static int ci_hdrc_imx_probe(struct plat + goto disable_device; + } + +- platform_set_drvdata(pdev, data); +- + if (data->supports_runtime_pm) { + pm_runtime_set_active(&pdev->dev); + pm_runtime_enable(&pdev->dev); +@@ -210,7 +305,7 @@ static int ci_hdrc_imx_probe(struct plat + disable_device: + ci_hdrc_remove_device(data->ci_pdev); + err_clk: +- clk_disable_unprepare(data->clk); ++ imx_disable_unprepare_clks(&pdev->dev); + return ret; + } + +@@ -224,7 +319,7 @@ static int ci_hdrc_imx_remove(struct pla + pm_runtime_put_noidle(&pdev->dev); + } + ci_hdrc_remove_device(data->ci_pdev); +- clk_disable_unprepare(data->clk); ++ imx_disable_unprepare_clks(&pdev->dev); + + return 0; + } +@@ -236,7 +331,7 @@ static int imx_controller_suspend(struct + + dev_dbg(dev, "at %s\n", __func__); + +- clk_disable_unprepare(data->clk); ++ imx_disable_unprepare_clks(dev); + data->in_lpm = true; + + return 0; +@@ -254,7 +349,7 @@ static int imx_controller_resume(struct + return 0; + } + +- ret = clk_prepare_enable(data->clk); ++ ret = imx_prepare_enable_clks(dev); + if (ret) + return ret; + +@@ -269,7 +364,7 @@ static int imx_controller_resume(struct + return 0; + + clk_disable: +- clk_disable_unprepare(data->clk); ++ imx_disable_unprepare_clks(dev); + return ret; + } + diff --git a/queue-4.2/usb-ehci-orion-fix-probe-for-generic_phy.patch b/queue-4.2/usb-ehci-orion-fix-probe-for-generic_phy.patch new file mode 100644 index 00000000000..d026088d271 --- /dev/null +++ b/queue-4.2/usb-ehci-orion-fix-probe-for-generic_phy.patch @@ -0,0 +1,43 @@ +From db1319e166c5e872c4be54eac4e47454133708cf Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 23 Aug 2015 15:01:08 +0200 +Subject: usb: ehci-orion: fix probe for !GENERIC_PHY + +From: Jonas Gorski + +commit db1319e166c5e872c4be54eac4e47454133708cf upstream. + +Commit d445913ce0ab7f ("usb: ehci-orion: add optional PHY support") +added support for optional phys, but devm_phy_optional_get returns +-ENOSYS if GENERIC_PHY is not enabled. + +This causes probe failures, even when there are no phys specified: + +[ 1.443365] orion-ehci f1058000.usb: init f1058000.usb fail, -38 +[ 1.449403] orion-ehci: probe of f1058000.usb failed with error -38 + +Similar to dwc3, treat -ENOSYS as no phy. + +Fixes: d445913ce0ab7f ("usb: ehci-orion: add optional PHY support") + +Signed-off-by: Jonas Gorski +Acked-by: Alan Stern +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/ehci-orion.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/usb/host/ehci-orion.c ++++ b/drivers/usb/host/ehci-orion.c +@@ -224,7 +224,8 @@ static int ehci_orion_drv_probe(struct p + priv->phy = devm_phy_optional_get(&pdev->dev, "usb"); + if (IS_ERR(priv->phy)) { + err = PTR_ERR(priv->phy); +- goto err_phy_get; ++ if (err != -ENOSYS) ++ goto err_phy_get; + } else { + err = phy_init(priv->phy); + if (err) diff --git a/queue-4.2/usb-musb-core-fix-order-of-arguments-to-ulpi-write.patch b/queue-4.2/usb-musb-core-fix-order-of-arguments-to-ulpi-write.patch new file mode 100644 index 00000000000..98b79467914 --- /dev/null +++ b/queue-4.2/usb-musb-core-fix-order-of-arguments-to-ulpi-write.patch @@ -0,0 +1,81 @@ +From 705e63d2b29c8bbf091119084544d353bda70393 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= +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?= + +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 +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -132,7 +132,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; +@@ -151,7 +151,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); + +@@ -176,7 +176,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; +@@ -191,8 +191,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) diff --git a/queue-4.2/usb-option-add-xs-stick-w100-2-from-4g-systems.patch b/queue-4.2/usb-option-add-xs-stick-w100-2-from-4g-systems.patch new file mode 100644 index 00000000000..85314ac2a4b --- /dev/null +++ b/queue-4.2/usb-option-add-xs-stick-w100-2-from-4g-systems.patch @@ -0,0 +1,86 @@ +From 638148e20c7f8f6e95017fdc13bce8549a6925e0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +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?= + +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 +Signed-off-by: Bjørn Mork +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/option.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -358,6 +358,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 +@@ -523,6 +524,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), +@@ -1655,6 +1661,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) }, diff --git a/queue-4.2/usb-qcserial-add-support-for-quectel-ec20-mini-pcie-module.patch b/queue-4.2/usb-qcserial-add-support-for-quectel-ec20-mini-pcie-module.patch new file mode 100644 index 00000000000..e012da3dc82 --- /dev/null +++ b/queue-4.2/usb-qcserial-add-support-for-quectel-ec20-mini-pcie-module.patch @@ -0,0 +1,122 @@ +From 9d5b5ed796d7afd7e8d2ac4b4fb77c6a49463f4b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20=C5=A0tetiar?= +Date: Tue, 3 Nov 2015 11:25:28 +0100 +Subject: USB: qcserial: Add support for Quectel EC20 Mini PCIe module +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: =?UTF-8?q?Petr=20=C5=A0tetiar?= + +commit 9d5b5ed796d7afd7e8d2ac4b4fb77c6a49463f4b upstream. + +It seems like this device has same vendor and product IDs as G2K +devices, but it has different number of interfaces(4 vs 5) and also +different interface layout which makes it currently unusable: + + usbcore: registered new interface driver qcserial + usbserial: USB Serial support registered for Qualcomm USB modem + usb 2-1.2: unknown number of interfaces: 5 + +lsusb output: + + Bus 002 Device 003: ID 05c6:9215 Qualcomm, Inc. Acer Gobi 2000 Wireless + Device Descriptor: + bLength 18 + bDescriptorType 1 + bcdUSB 2.00 + bDeviceClass 0 (Defined at Interface level) + bDeviceSubClass 0 + bDeviceProtocol 0 + bMaxPacketSize0 64 + idVendor 0x05c6 Qualcomm, Inc. + idProduct 0x9215 Acer Gobi 2000 Wireless Modem + bcdDevice 2.32 + iManufacturer 1 Quectel + iProduct 2 Quectel LTE Module + iSerial 0 + bNumConfigurations 1 + Configuration Descriptor: + bLength 9 + bDescriptorType 2 + wTotalLength 209 + bNumInterfaces 5 + bConfigurationValue 1 + iConfiguration 0 + bmAttributes 0xa0 + (Bus Powered) + Remote Wakeup + MaxPower 500mA + +Signed-off-by: Petr Štetiar +[johan: rename define and add comment ] +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/qcserial.c | 40 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +--- a/drivers/usb/serial/qcserial.c ++++ b/drivers/usb/serial/qcserial.c +@@ -22,6 +22,8 @@ + #define DRIVER_AUTHOR "Qualcomm Inc" + #define DRIVER_DESC "Qualcomm USB Serial driver" + ++#define QUECTEL_EC20_PID 0x9215 ++ + /* standard device layouts supported by this driver */ + enum qcserial_layouts { + QCSERIAL_G2K = 0, /* Gobi 2000 */ +@@ -169,6 +171,38 @@ static const struct usb_device_id id_tab + }; + MODULE_DEVICE_TABLE(usb, id_table); + ++static int handle_quectel_ec20(struct device *dev, int ifnum) ++{ ++ int altsetting = 0; ++ ++ /* ++ * Quectel EC20 Mini PCIe LTE module layout: ++ * 0: DM/DIAG (use libqcdm from ModemManager for communication) ++ * 1: NMEA ++ * 2: AT-capable modem port ++ * 3: Modem interface ++ * 4: NDIS ++ */ ++ switch (ifnum) { ++ case 0: ++ dev_dbg(dev, "Quectel EC20 DM/DIAG interface found\n"); ++ break; ++ case 1: ++ dev_dbg(dev, "Quectel EC20 NMEA GPS interface found\n"); ++ break; ++ case 2: ++ case 3: ++ dev_dbg(dev, "Quectel EC20 Modem port found\n"); ++ break; ++ case 4: ++ /* Don't claim the QMI/net interface */ ++ altsetting = -1; ++ break; ++ } ++ ++ return altsetting; ++} ++ + static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) + { + struct usb_host_interface *intf = serial->interface->cur_altsetting; +@@ -237,6 +271,12 @@ static int qcprobe(struct usb_serial *se + altsetting = -1; + break; + case QCSERIAL_G2K: ++ /* handle non-standard layouts */ ++ if (nintf == 5 && id->idProduct == QUECTEL_EC20_PID) { ++ altsetting = handle_quectel_ec20(dev, ifnum); ++ goto done; ++ } ++ + /* + * Gobi 2K+ USB layout: + * 0: QMI/net diff --git a/queue-4.2/usb-qcserial-fix-support-for-hp-lt4112-lte-hspa-gobi-4g-modem.patch b/queue-4.2/usb-qcserial-fix-support-for-hp-lt4112-lte-hspa-gobi-4g-modem.patch new file mode 100644 index 00000000000..51ed595ed4f --- /dev/null +++ b/queue-4.2/usb-qcserial-fix-support-for-hp-lt4112-lte-hspa-gobi-4g-modem.patch @@ -0,0 +1,107 @@ +From 59536da34513c594af2a6fd35ba65ea45b6960a1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +Date: Mon, 16 Nov 2015 13:15:46 +0100 +Subject: USB: qcserial: Fix support for HP lt4112 LTE/HSPA+ Gobi 4G Modem +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= + +commit 59536da34513c594af2a6fd35ba65ea45b6960a1 upstream. + +The DEVICE_HWI type was added under the faulty assumption that Huawei +devices based on Qualcomm chipsets and firmware use the static USB +interface numbering known from Gobi devices. But this model does +not apply to Huawei devices like the HP branded lt4112 (Huawei me906e). +Huawei firmwares will dynamically assign interface numbers. Functions +are renumbered when the firmware is reconfigured. + +Fix by changing the DEVICE_HWI type to use a simplified version +of Huawei's subclass + protocol scheme: Blacklisting known network +interface combinations and assuming the rest are serial. + +Reported-and-tested-by: Muri Nicanor +Tested-by: Martin Hauke +Fixes: e7181d005e84 ("USB: qcserial: Add support for HP lt4112 LTE/HSPA+ Gobi 4G Modem") +Signed-off-by: Bjørn Mork +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/qcserial.c | 54 ++++++++++++++++++++++++++---------------- + 1 file changed, 34 insertions(+), 20 deletions(-) + +--- a/drivers/usb/serial/qcserial.c ++++ b/drivers/usb/serial/qcserial.c +@@ -212,6 +212,10 @@ static int qcprobe(struct usb_serial *se + __u8 ifnum; + int altsetting = -1; + ++ /* we only support vendor specific functions */ ++ if (intf->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) ++ goto done; ++ + nintf = serial->dev->actconfig->desc.bNumInterfaces; + dev_dbg(dev, "Num Interfaces = %d\n", nintf); + ifnum = intf->desc.bInterfaceNumber; +@@ -337,29 +341,39 @@ static int qcprobe(struct usb_serial *se + break; + case QCSERIAL_HWI: + /* +- * Huawei layout: +- * 0: AT-capable modem port +- * 1: DM/DIAG +- * 2: AT-capable modem port +- * 3: CCID-compatible PCSC interface +- * 4: QMI/net +- * 5: NMEA ++ * Huawei devices map functions by subclass + protocol ++ * instead of interface numbers. The protocol identify ++ * a specific function, while the subclass indicate a ++ * specific firmware source ++ * ++ * This is a blacklist of functions known to be ++ * non-serial. The rest are assumed to be serial and ++ * will be handled by this driver + */ +- switch (ifnum) { +- case 0: +- case 2: +- dev_dbg(dev, "Modem port found\n"); +- break; +- case 1: +- dev_dbg(dev, "DM/DIAG interface found\n"); +- break; +- case 5: +- dev_dbg(dev, "NMEA GPS interface found\n"); +- break; +- default: +- /* don't claim any unsupported interface */ ++ switch (intf->desc.bInterfaceProtocol) { ++ /* QMI combined (qmi_wwan) */ ++ case 0x07: ++ case 0x37: ++ case 0x67: ++ /* QMI data (qmi_wwan) */ ++ case 0x08: ++ case 0x38: ++ case 0x68: ++ /* QMI control (qmi_wwan) */ ++ case 0x09: ++ case 0x39: ++ case 0x69: ++ /* NCM like (huawei_cdc_ncm) */ ++ case 0x16: ++ case 0x46: ++ case 0x76: + altsetting = -1; + break; ++ default: ++ dev_dbg(dev, "Huawei type serial port found (%02x/%02x/%02x)\n", ++ intf->desc.bInterfaceClass, ++ intf->desc.bInterfaceSubClass, ++ intf->desc.bInterfaceProtocol); + } + break; + default: diff --git a/queue-4.2/usb-serial-option-add-support-for-novatel-mifi-usb620l.patch b/queue-4.2/usb-serial-option-add-support-for-novatel-mifi-usb620l.patch new file mode 100644 index 00000000000..08be693d7f5 --- /dev/null +++ b/queue-4.2/usb-serial-option-add-support-for-novatel-mifi-usb620l.patch @@ -0,0 +1,48 @@ +From e07af133c3e2716db25e3e1e1d9f10c2088e9c1a Mon Sep 17 00:00:00 2001 +From: Aleksander Morgado +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 + +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 +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + 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) }, diff --git a/queue-4.2/usb-ti_usb_3410_5052-add-honeywell-hgi80-id.patch b/queue-4.2/usb-ti_usb_3410_5052-add-honeywell-hgi80-id.patch new file mode 100644 index 00000000000..ff63fcb1398 --- /dev/null +++ b/queue-4.2/usb-ti_usb_3410_5052-add-honeywell-hgi80-id.patch @@ -0,0 +1,52 @@ +From 1bcb49e663f88bccee35b8688e6a3da2bea31fd4 Mon Sep 17 00:00:00 2001 +From: David Woodhouse +Date: Sat, 14 Nov 2015 16:49:30 +0000 +Subject: USB: ti_usb_3410_5052: Add Honeywell HGI80 ID + +From: David Woodhouse + +commit 1bcb49e663f88bccee35b8688e6a3da2bea31fd4 upstream. + +The Honeywell HGI80 is a wireless interface to the evohome connected +thermostat. It uses a TI 3410 USB-serial port. + +Signed-off-by: David Woodhouse +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/ti_usb_3410_5052.c | 2 ++ + drivers/usb/serial/ti_usb_3410_5052.h | 4 ++++ + 2 files changed, 6 insertions(+) + +--- a/drivers/usb/serial/ti_usb_3410_5052.c ++++ b/drivers/usb/serial/ti_usb_3410_5052.c +@@ -159,6 +159,7 @@ static const struct usb_device_id ti_id_ + { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_STEREO_PLUG_ID) }, + { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_STRIP_PORT_ID) }, + { USB_DEVICE(TI_VENDOR_ID, FRI2_PRODUCT_ID) }, ++ { USB_DEVICE(HONEYWELL_VENDOR_ID, HONEYWELL_HGI80_PRODUCT_ID) }, + { } /* terminator */ + }; + +@@ -191,6 +192,7 @@ static const struct usb_device_id ti_id_ + { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_PRODUCT_ID) }, + { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_STRIP_PORT_ID) }, + { USB_DEVICE(TI_VENDOR_ID, FRI2_PRODUCT_ID) }, ++ { USB_DEVICE(HONEYWELL_VENDOR_ID, HONEYWELL_HGI80_PRODUCT_ID) }, + { } /* terminator */ + }; + +--- a/drivers/usb/serial/ti_usb_3410_5052.h ++++ b/drivers/usb/serial/ti_usb_3410_5052.h +@@ -56,6 +56,10 @@ + #define ABBOTT_PRODUCT_ID ABBOTT_STEREO_PLUG_ID + #define ABBOTT_STRIP_PORT_ID 0x3420 + ++/* Honeywell vendor and product IDs */ ++#define HONEYWELL_VENDOR_ID 0x10ac ++#define HONEYWELL_HGI80_PRODUCT_ID 0x0102 /* Honeywell HGI80 */ ++ + /* Commands */ + #define TI_GET_VERSION 0x01 + #define TI_GET_PORT_STATUS 0x02 diff --git a/queue-4.2/usblp-do-not-set-task_interruptible-before-lock.patch b/queue-4.2/usblp-do-not-set-task_interruptible-before-lock.patch new file mode 100644 index 00000000000..050ee8406de --- /dev/null +++ b/queue-4.2/usblp-do-not-set-task_interruptible-before-lock.patch @@ -0,0 +1,61 @@ +From 19cd80a214821f4b558560ebd76bfb2c38b4f3d8 Mon Sep 17 00:00:00 2001 +From: Jiri Slaby +Date: Mon, 2 Nov 2015 10:27:00 +0100 +Subject: usblp: do not set TASK_INTERRUPTIBLE before lock + +From: Jiri Slaby + +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 [] 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: +... + [] warn_slowpath_fmt+0x46/0x50 + [] __might_sleep+0x7d/0x90 + [] mutex_lock_interruptible_nested+0x2f/0x4b0 + [] usblp_wwait+0xcc/0x310 [usblp] + [] usblp_write+0x72/0x350 [usblp] + [] __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 +Fixes: 7f477358e2 ("usblp: Implement the ENOSPC convention") +Acked-By: Pete Zaitcev +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -873,11 +873,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) diff --git a/queue-4.2/xhci-workaround-to-get-intel-xhci-reset-working-more-reliably.patch b/queue-4.2/xhci-workaround-to-get-intel-xhci-reset-working-more-reliably.patch new file mode 100644 index 00000000000..d086100f3fd --- /dev/null +++ b/queue-4.2/xhci-workaround-to-get-intel-xhci-reset-working-more-reliably.patch @@ -0,0 +1,48 @@ +From a5964396190d0c40dd549c23848c282fffa5d1f2 Mon Sep 17 00:00:00 2001 +From: Rajmohan Mani +Date: Wed, 18 Nov 2015 10:48:20 +0200 +Subject: xhci: Workaround to get Intel xHCI reset working more reliably + +From: Rajmohan Mani + +commit a5964396190d0c40dd549c23848c282fffa5d1f2 upstream. + +Existing Intel xHCI controllers require a delay of 1 mS, +after setting the CMD_RESET bit in command register, before +accessing any HC registers. This allows the HC to complete +the reset operation and be ready for HC register access. +Without this delay, the subsequent HC register access, +may result in a system hang, very rarely. + +Verified CherryView / Braswell platforms go through over +5000 warm reboot cycles (which was not possible without +this patch), without any xHCI reset hang. + +Signed-off-by: Rajmohan Mani +Tested-by: Joe Lawrence +Signed-off-by: Mathias Nyman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/usb/host/xhci.c ++++ b/drivers/usb/host/xhci.c +@@ -175,6 +175,16 @@ int xhci_reset(struct xhci_hcd *xhci) + command |= CMD_RESET; + writel(command, &xhci->op_regs->command); + ++ /* Existing Intel xHCI controllers require a delay of 1 mS, ++ * after setting the CMD_RESET bit, and before accessing any ++ * HC registers. This allows the HC to complete the ++ * reset operation and be ready for HC register access. ++ * Without this delay, the subsequent HC register access, ++ * may result in a system hang very rarely. ++ */ ++ if (xhci->quirks & XHCI_INTEL_HOST) ++ udelay(1000); ++ + ret = xhci_handshake(&xhci->op_regs->command, + CMD_RESET, 0, 10 * 1000 * 1000); + if (ret)