From: Greg Kroah-Hartman Date: Tue, 3 Jan 2017 19:56:07 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v4.9.1~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2fe3288b21a33d09bc029a93cca1bdf9cc84e435;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: alsa-hda-ca0132-add-quirk-for-alienware-15-r2-2016.patch alsa-hda-fix-headset-mic-problem-on-a-dell-laptop.patch alsa-hda-gate-the-mic-jack-on-hp-z1-gen3-aio.patch alsa-hda-ignore-the-assoc-and-seq-when-comparing-pin-configurations.patch alsa-hda-when-comparing-pin-configurations-ignore-assoc-in-addition-to-seq.patch alsa-hiface-fix-m2tech-hiface-driver-sampling-rate-change.patch alsa-usb-audio-add-quickcam-communicate-deluxe-s7500-to-volume_control_quirks.patch usb-cdc-acm-add-device-id-for-gw-instek-afg-125.patch usb-gadget-composite-always-set-ep-mult-to-a-sensible-value.patch usb-gadget-composite-correctly-initialize-ep-maxpacket.patch usb-gadget-f_uac2-fix-error-handling-at-afunc_bind.patch usb-hub-fix-auto-remount-of-safely-removed-or-ejected-usb-3-devices.patch usb-serial-kl5kusb105-fix-open-error-path.patch usb-serial-option-add-dlink-dwm-158.patch usb-serial-option-add-support-for-telit-le922a-pids-0x1040-0x1041.patch usb-uhci-report-non-pme-wakeup-signalling-for-intel-hardware.patch --- diff --git a/queue-4.4/alsa-hda-ca0132-add-quirk-for-alienware-15-r2-2016.patch b/queue-4.4/alsa-hda-ca0132-add-quirk-for-alienware-15-r2-2016.patch new file mode 100644 index 00000000000..7b8c61e52f4 --- /dev/null +++ b/queue-4.4/alsa-hda-ca0132-add-quirk-for-alienware-15-r2-2016.patch @@ -0,0 +1,33 @@ +From b5337cfe067e96b8a98699da90c7dcd2bec21133 Mon Sep 17 00:00:00 2001 +From: Sven Hahne +Date: Fri, 25 Nov 2016 14:16:43 +0100 +Subject: ALSA: hda/ca0132 - Add quirk for Alienware 15 R2 2016 + +From: Sven Hahne + +commit b5337cfe067e96b8a98699da90c7dcd2bec21133 upstream. + +I'm using an Alienware 15 R2 and had to use the alienware quirks to +get my headphone output working. + +I fixed it by adding, SND_PCI_QUIRK(0x1028, 0x0708, "Alienware 15 R2 +2016", QUIRK_ALIENWARE) to the patch. + +Signed-off-by: Sven Hahne +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_ca0132.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/patch_ca0132.c ++++ b/sound/pci/hda/patch_ca0132.c +@@ -780,6 +780,7 @@ static const struct hda_pintbl alienware + static const struct snd_pci_quirk ca0132_quirks[] = { + SND_PCI_QUIRK(0x1028, 0x0685, "Alienware 15 2015", QUIRK_ALIENWARE), + SND_PCI_QUIRK(0x1028, 0x0688, "Alienware 17 2015", QUIRK_ALIENWARE), ++ SND_PCI_QUIRK(0x1028, 0x0708, "Alienware 15 R2 2016", QUIRK_ALIENWARE), + {} + }; + diff --git a/queue-4.4/alsa-hda-fix-headset-mic-problem-on-a-dell-laptop.patch b/queue-4.4/alsa-hda-fix-headset-mic-problem-on-a-dell-laptop.patch new file mode 100644 index 00000000000..07634336c15 --- /dev/null +++ b/queue-4.4/alsa-hda-fix-headset-mic-problem-on-a-dell-laptop.patch @@ -0,0 +1,32 @@ +From 989dbe4a30728c047316ab87e5fa8b609951ce7c Mon Sep 17 00:00:00 2001 +From: Hui Wang +Date: Wed, 23 Nov 2016 16:05:38 +0800 +Subject: ALSA: hda - fix headset-mic problem on a Dell laptop + +From: Hui Wang + +commit 989dbe4a30728c047316ab87e5fa8b609951ce7c upstream. + +This group of new pins is not in the pin quirk table yet, adding +them to the pin quirk table to fix the headset-mic problem. + +Signed-off-by: Hui Wang +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_realtek.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -5899,6 +5899,9 @@ static const struct snd_hda_pin_quirk al + {0x12, 0x90a60180}, + {0x14, 0x90170120}, + {0x21, 0x02211030}), ++ SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, ++ {0x1b, 0x01011020}, ++ {0x21, 0x02211010}), + SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, + {0x12, 0x90a60160}, + {0x14, 0x90170120}, diff --git a/queue-4.4/alsa-hda-gate-the-mic-jack-on-hp-z1-gen3-aio.patch b/queue-4.4/alsa-hda-gate-the-mic-jack-on-hp-z1-gen3-aio.patch new file mode 100644 index 00000000000..39a10d692ef --- /dev/null +++ b/queue-4.4/alsa-hda-gate-the-mic-jack-on-hp-z1-gen3-aio.patch @@ -0,0 +1,68 @@ +From f73cd43ac3b41c0f09a126387f302bbc0d9c726d Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 6 Dec 2016 11:55:17 +0100 +Subject: ALSA: hda - Gate the mic jack on HP Z1 Gen3 AiO + +From: Takashi Iwai + +commit f73cd43ac3b41c0f09a126387f302bbc0d9c726d upstream. + +HP Z1 Gen3 AiO with Conexant codec doesn't give an unsolicited event +to the headset mic pin upon the jack plugging, it reports only to the +headphone pin. It results in the missing mic switching. Let's fix up +by simply gating the jack event. + +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_conexant.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +--- a/sound/pci/hda/patch_conexant.c ++++ b/sound/pci/hda/patch_conexant.c +@@ -262,6 +262,7 @@ enum { + CXT_FIXUP_CAP_MIX_AMP_5047, + CXT_FIXUP_MUTE_LED_EAPD, + CXT_FIXUP_HP_SPECTRE, ++ CXT_FIXUP_HP_GATE_MIC, + }; + + /* for hda_fixup_thinkpad_acpi() */ +@@ -633,6 +634,17 @@ static void cxt_fixup_cap_mix_amp_5047(s + (1 << AC_AMPCAP_MUTE_SHIFT)); + } + ++static void cxt_fixup_hp_gate_mic_jack(struct hda_codec *codec, ++ const struct hda_fixup *fix, ++ int action) ++{ ++ /* the mic pin (0x19) doesn't give an unsolicited event; ++ * probe the mic pin together with the headphone pin (0x16) ++ */ ++ if (action == HDA_FIXUP_ACT_PROBE) ++ snd_hda_jack_set_gating_jack(codec, 0x19, 0x16); ++} ++ + /* ThinkPad X200 & co with cxt5051 */ + static const struct hda_pintbl cxt_pincfg_lenovo_x200[] = { + { 0x16, 0x042140ff }, /* HP (seq# overridden) */ +@@ -774,6 +786,10 @@ static const struct hda_fixup cxt_fixups + { } + } + }, ++ [CXT_FIXUP_HP_GATE_MIC] = { ++ .type = HDA_FIXUP_FUNC, ++ .v.func = cxt_fixup_hp_gate_mic_jack, ++ }, + }; + + static const struct snd_pci_quirk cxt5045_fixups[] = { +@@ -824,6 +840,7 @@ static const struct snd_pci_quirk cxt506 + SND_PCI_QUIRK(0x1025, 0x054c, "Acer Aspire 3830TG", CXT_FIXUP_ASPIRE_DMIC), + SND_PCI_QUIRK(0x1025, 0x054f, "Acer Aspire 4830T", CXT_FIXUP_ASPIRE_DMIC), + SND_PCI_QUIRK(0x103c, 0x8174, "HP Spectre x360", CXT_FIXUP_HP_SPECTRE), ++ SND_PCI_QUIRK(0x103c, 0x8115, "HP Z1 Gen3", CXT_FIXUP_HP_GATE_MIC), + SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN), + SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO), + SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410), diff --git a/queue-4.4/alsa-hda-ignore-the-assoc-and-seq-when-comparing-pin-configurations.patch b/queue-4.4/alsa-hda-ignore-the-assoc-and-seq-when-comparing-pin-configurations.patch new file mode 100644 index 00000000000..9ca2002dc1b --- /dev/null +++ b/queue-4.4/alsa-hda-ignore-the-assoc-and-seq-when-comparing-pin-configurations.patch @@ -0,0 +1,37 @@ +From 64047d7f4912de1769d1bf0d34c6322494b13779 Mon Sep 17 00:00:00 2001 +From: Hui Wang +Date: Wed, 23 Nov 2016 16:05:37 +0800 +Subject: ALSA: hda - ignore the assoc and seq when comparing pin configurations + +From: Hui Wang + +commit 64047d7f4912de1769d1bf0d34c6322494b13779 upstream. + +More and more pin configurations have been adding to the pin quirk +table, lots of them are only different from assoc and seq, but they +all apply to the same QUIRK_FIXUP, if we don't compare assoc and seq +when matching pin configurations, it will greatly reduce the pin +quirk table size. + +We have tested this change on a couple of Dell laptops, it worked +well. + +Signed-off-by: Hui Wang +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/hda_auto_parser.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/pci/hda/hda_auto_parser.c ++++ b/sound/pci/hda/hda_auto_parser.c +@@ -901,7 +901,7 @@ static bool pin_config_match(struct hda_ + for (; t_pins->nid; t_pins++) { + if (t_pins->nid == nid) { + found = 1; +- if (t_pins->val == cfg) ++ if ((t_pins->val & 0xfffffff0) == (cfg & 0xfffffff0)) + break; + else if ((cfg & 0xf0000000) == 0x40000000 && (t_pins->val & 0xf0000000) == 0x40000000) + break; diff --git a/queue-4.4/alsa-hda-when-comparing-pin-configurations-ignore-assoc-in-addition-to-seq.patch b/queue-4.4/alsa-hda-when-comparing-pin-configurations-ignore-assoc-in-addition-to-seq.patch new file mode 100644 index 00000000000..55513f4102f --- /dev/null +++ b/queue-4.4/alsa-hda-when-comparing-pin-configurations-ignore-assoc-in-addition-to-seq.patch @@ -0,0 +1,48 @@ +From 5e0ad0d8747f3e4803a9c3d96d64dd7332506d3c Mon Sep 17 00:00:00 2001 +From: Kai-Heng Feng +Date: Tue, 6 Dec 2016 16:56:27 +0800 +Subject: ALSA: hda: when comparing pin configurations, ignore assoc in addition to seq + +From: Kai-Heng Feng + +commit 5e0ad0d8747f3e4803a9c3d96d64dd7332506d3c upstream. + +Commit [64047d7f4912 ALSA: hda - ignore the assoc and seq when comparing +pin configurations] intented to ignore both seq and assoc at pin +comparing, but it only ignored seq. So that commit may still fail to +match pins on some machines. +Change the bitmask to also ignore assoc. + +v2: Use macro to do bit masking. + +Thanks to Hui Wang for the analysis. + +Fixes: 64047d7f4912 ("ALSA: hda - ignore the assoc and seq when comparing...") +Signed-off-by: Kai-Heng Feng +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/hda_auto_parser.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/sound/pci/hda/hda_auto_parser.c ++++ b/sound/pci/hda/hda_auto_parser.c +@@ -884,6 +884,8 @@ void snd_hda_apply_fixup(struct hda_code + } + EXPORT_SYMBOL_GPL(snd_hda_apply_fixup); + ++#define IGNORE_SEQ_ASSOC (~(AC_DEFCFG_SEQUENCE | AC_DEFCFG_DEF_ASSOC)) ++ + static bool pin_config_match(struct hda_codec *codec, + const struct hda_pintbl *pins) + { +@@ -901,7 +903,7 @@ static bool pin_config_match(struct hda_ + for (; t_pins->nid; t_pins++) { + if (t_pins->nid == nid) { + found = 1; +- if ((t_pins->val & 0xfffffff0) == (cfg & 0xfffffff0)) ++ if ((t_pins->val & IGNORE_SEQ_ASSOC) == (cfg & IGNORE_SEQ_ASSOC)) + break; + else if ((cfg & 0xf0000000) == 0x40000000 && (t_pins->val & 0xf0000000) == 0x40000000) + break; diff --git a/queue-4.4/alsa-hiface-fix-m2tech-hiface-driver-sampling-rate-change.patch b/queue-4.4/alsa-hiface-fix-m2tech-hiface-driver-sampling-rate-change.patch new file mode 100644 index 00000000000..ce8793fc511 --- /dev/null +++ b/queue-4.4/alsa-hiface-fix-m2tech-hiface-driver-sampling-rate-change.patch @@ -0,0 +1,35 @@ +From 995c6a7fd9b9212abdf01160f6ce3193176be503 Mon Sep 17 00:00:00 2001 +From: Jussi Laako +Date: Mon, 28 Nov 2016 11:27:45 +0200 +Subject: ALSA: hiface: Fix M2Tech hiFace driver sampling rate change + +From: Jussi Laako + +commit 995c6a7fd9b9212abdf01160f6ce3193176be503 upstream. + +Sampling rate changes after first set one are not reflected to the +hardware, while driver and ALSA think the rate has been changed. + +Fix the problem by properly stopping the interface at the beginning of +prepare call, allowing new rate to be set to the hardware. This keeps +the hardware in sync with the driver. + +Signed-off-by: Jussi Laako +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/hiface/pcm.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/sound/usb/hiface/pcm.c ++++ b/sound/usb/hiface/pcm.c +@@ -445,6 +445,8 @@ static int hiface_pcm_prepare(struct snd + + mutex_lock(&rt->stream_mutex); + ++ hiface_pcm_stream_stop(rt); ++ + sub->dma_off = 0; + sub->period_off = 0; + diff --git a/queue-4.4/alsa-usb-audio-add-quickcam-communicate-deluxe-s7500-to-volume_control_quirks.patch b/queue-4.4/alsa-usb-audio-add-quickcam-communicate-deluxe-s7500-to-volume_control_quirks.patch new file mode 100644 index 00000000000..2ffe28c1053 --- /dev/null +++ b/queue-4.4/alsa-usb-audio-add-quickcam-communicate-deluxe-s7500-to-volume_control_quirks.patch @@ -0,0 +1,42 @@ +From 82ffb6fc637150b279f49e174166d2aa3853eaf4 Mon Sep 17 00:00:00 2001 +From: Con Kolivas +Date: Fri, 9 Dec 2016 15:15:57 +1100 +Subject: ALSA: usb-audio: Add QuickCam Communicate Deluxe/S7500 to volume_control_quirks + +From: Con Kolivas + +commit 82ffb6fc637150b279f49e174166d2aa3853eaf4 upstream. + +The Logitech QuickCam Communicate Deluxe/S7500 microphone fails with the +following warning. + +[ 6.778995] usb 2-1.2.2.2: Warning! Unlikely big volume range (=3072), +cval->res is probably wrong. +[ 6.778996] usb 2-1.2.2.2: [5] FU [Mic Capture Volume] ch = 1, val = +4608/7680/1 + +Adding it to the list of devices in volume_control_quirks makes it work +properly, fixing related typo. + +Signed-off-by: Con Kolivas +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/mixer.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/sound/usb/mixer.c ++++ b/sound/usb/mixer.c +@@ -931,9 +931,10 @@ static void volume_control_quirks(struct + case USB_ID(0x046d, 0x0826): /* HD Webcam c525 */ + case USB_ID(0x046d, 0x08ca): /* Logitech Quickcam Fusion */ + case USB_ID(0x046d, 0x0991): ++ case USB_ID(0x046d, 0x09a2): /* QuickCam Communicate Deluxe/S7500 */ + /* Most audio usb devices lie about volume resolution. + * Most Logitech webcams have res = 384. +- * Proboly there is some logitech magic behind this number --fishor ++ * Probably there is some logitech magic behind this number --fishor + */ + if (!strcmp(kctl->id.name, "Mic Capture Volume")) { + usb_audio_info(chip, diff --git a/queue-4.4/series b/queue-4.4/series index a670dc540ce..79f7e1a1d55 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -2,3 +2,19 @@ btrfs-limit-async_work-allocation-and-worker-func-duration.patch btrfs-fix-tree-search-logic-when-replaying-directory-entry-deletes.patch btrfs-store-and-load-values-of-stripes_min-stripes_max-in-balance-status-item.patch btrfs-fix-qgroup-rescan-worker-initialization.patch +usb-serial-option-add-support-for-telit-le922a-pids-0x1040-0x1041.patch +usb-serial-option-add-dlink-dwm-158.patch +usb-serial-kl5kusb105-fix-open-error-path.patch +usb-cdc-acm-add-device-id-for-gw-instek-afg-125.patch +usb-hub-fix-auto-remount-of-safely-removed-or-ejected-usb-3-devices.patch +usb-gadget-f_uac2-fix-error-handling-at-afunc_bind.patch +usb-gadget-composite-correctly-initialize-ep-maxpacket.patch +usb-gadget-composite-always-set-ep-mult-to-a-sensible-value.patch +usb-uhci-report-non-pme-wakeup-signalling-for-intel-hardware.patch +alsa-usb-audio-add-quickcam-communicate-deluxe-s7500-to-volume_control_quirks.patch +alsa-hiface-fix-m2tech-hiface-driver-sampling-rate-change.patch +alsa-hda-ca0132-add-quirk-for-alienware-15-r2-2016.patch +alsa-hda-ignore-the-assoc-and-seq-when-comparing-pin-configurations.patch +alsa-hda-fix-headset-mic-problem-on-a-dell-laptop.patch +alsa-hda-gate-the-mic-jack-on-hp-z1-gen3-aio.patch +alsa-hda-when-comparing-pin-configurations-ignore-assoc-in-addition-to-seq.patch diff --git a/queue-4.4/usb-cdc-acm-add-device-id-for-gw-instek-afg-125.patch b/queue-4.4/usb-cdc-acm-add-device-id-for-gw-instek-afg-125.patch new file mode 100644 index 00000000000..0b13e7d0694 --- /dev/null +++ b/queue-4.4/usb-cdc-acm-add-device-id-for-gw-instek-afg-125.patch @@ -0,0 +1,30 @@ +From 301216044e4c27d5a7323c1fa766266fad00db5e Mon Sep 17 00:00:00 2001 +From: Nathaniel Quillin +Date: Mon, 5 Dec 2016 06:53:00 -0800 +Subject: USB: cdc-acm: add device id for GW Instek AFG-125 + +From: Nathaniel Quillin + +commit 301216044e4c27d5a7323c1fa766266fad00db5e upstream. + +Add device-id entry for GW Instek AFG-125, which has a byte swapped +bInterfaceSubClass (0x20). + +Signed-off-by: Nathaniel Quillin +Acked-by: Oliver Neukum +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/class/cdc-acm.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -1708,6 +1708,7 @@ static const struct usb_device_id acm_id + { USB_DEVICE(0x20df, 0x0001), /* Simtec Electronics Entropy Key */ + .driver_info = QUIRK_CONTROL_LINE_STATE, }, + { USB_DEVICE(0x2184, 0x001c) }, /* GW Instek AFG-2225 */ ++ { USB_DEVICE(0x2184, 0x0036) }, /* GW Instek AFG-125 */ + { USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */ + }, + /* Motorola H24 HSPA module: */ diff --git a/queue-4.4/usb-gadget-composite-always-set-ep-mult-to-a-sensible-value.patch b/queue-4.4/usb-gadget-composite-always-set-ep-mult-to-a-sensible-value.patch new file mode 100644 index 00000000000..4b249caf74b --- /dev/null +++ b/queue-4.4/usb-gadget-composite-always-set-ep-mult-to-a-sensible-value.patch @@ -0,0 +1,66 @@ +From eaa496ffaaf19591fe471a36cef366146eeb9153 Mon Sep 17 00:00:00 2001 +From: Felipe Balbi +Date: Wed, 28 Sep 2016 12:33:31 +0300 +Subject: usb: gadget: composite: always set ep->mult to a sensible value + +From: Felipe Balbi + +commit eaa496ffaaf19591fe471a36cef366146eeb9153 upstream. + +ep->mult is supposed to be set to Isochronous and +Interrupt Endapoint's multiplier value. This value +is computed from different places depending on the +link speed. + +If we're dealing with HighSpeed, then it's part of +bits [12:11] of wMaxPacketSize. This case wasn't +taken into consideration before. + +While at that, also make sure the ep->mult defaults +to one so drivers can use it unconditionally and +assume they'll never multiply ep->maxpacket to zero. + +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/composite.c | 9 +++++++-- + drivers/usb/gadget/function/uvc_video.c | 2 +- + 2 files changed, 8 insertions(+), 3 deletions(-) + +--- a/drivers/usb/gadget/composite.c ++++ b/drivers/usb/gadget/composite.c +@@ -148,7 +148,12 @@ ep_found: + _ep->desc = chosen_desc; + _ep->comp_desc = NULL; + _ep->maxburst = 0; +- _ep->mult = 0; ++ _ep->mult = 1; ++ ++ if (g->speed == USB_SPEED_HIGH && (usb_endpoint_xfer_isoc(_ep->desc) || ++ usb_endpoint_xfer_int(_ep->desc))) ++ _ep->mult = usb_endpoint_maxp_mult(_ep->desc); ++ + if (!want_comp_desc) + return 0; + +@@ -165,7 +170,7 @@ ep_found: + switch (usb_endpoint_type(_ep->desc)) { + case USB_ENDPOINT_XFER_ISOC: + /* mult: bits 1:0 of bmAttributes */ +- _ep->mult = comp_desc->bmAttributes & 0x3; ++ _ep->mult = (comp_desc->bmAttributes & 0x3) + 1; + case USB_ENDPOINT_XFER_BULK: + case USB_ENDPOINT_XFER_INT: + _ep->maxburst = comp_desc->bMaxBurst + 1; +--- a/drivers/usb/gadget/function/uvc_video.c ++++ b/drivers/usb/gadget/function/uvc_video.c +@@ -243,7 +243,7 @@ uvc_video_alloc_requests(struct uvc_vide + + req_size = video->ep->maxpacket + * max_t(unsigned int, video->ep->maxburst, 1) +- * (video->ep->mult + 1); ++ * (video->ep->mult); + + for (i = 0; i < UVC_NUM_REQUESTS; ++i) { + video->req_buffer[i] = kmalloc(req_size, GFP_KERNEL); diff --git a/queue-4.4/usb-gadget-composite-correctly-initialize-ep-maxpacket.patch b/queue-4.4/usb-gadget-composite-correctly-initialize-ep-maxpacket.patch new file mode 100644 index 00000000000..68ca335ea68 --- /dev/null +++ b/queue-4.4/usb-gadget-composite-correctly-initialize-ep-maxpacket.patch @@ -0,0 +1,41 @@ +From e8f29bb719b47a234f33b0af62974d7a9521a52c Mon Sep 17 00:00:00 2001 +From: Felipe Balbi +Date: Wed, 28 Sep 2016 10:38:11 +0300 +Subject: usb: gadget: composite: correctly initialize ep->maxpacket + +From: Felipe Balbi + +commit e8f29bb719b47a234f33b0af62974d7a9521a52c upstream. + +usb_endpoint_maxp() returns wMaxPacketSize in its +raw form. Without taking into consideration that it +also contains other bits reserved for isochronous +endpoints. + +This patch fixes one occasion where this is a +problem by making sure that we initialize +ep->maxpacket only with lower 10 bits of the value +returned by usb_endpoint_maxp(). Note that seperate +patches will be necessary to audit all call sites of +usb_endpoint_maxp() and make sure that +usb_endpoint_maxp() only returns lower 10 bits of +wMaxPacketSize. + +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/composite.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/gadget/composite.c ++++ b/drivers/usb/gadget/composite.c +@@ -144,7 +144,7 @@ int config_ep_by_speed(struct usb_gadget + + ep_found: + /* commit results */ +- _ep->maxpacket = usb_endpoint_maxp(chosen_desc); ++ _ep->maxpacket = usb_endpoint_maxp(chosen_desc) & 0x7ff; + _ep->desc = chosen_desc; + _ep->comp_desc = NULL; + _ep->maxburst = 0; diff --git a/queue-4.4/usb-gadget-f_uac2-fix-error-handling-at-afunc_bind.patch b/queue-4.4/usb-gadget-f_uac2-fix-error-handling-at-afunc_bind.patch new file mode 100644 index 00000000000..a93a828df44 --- /dev/null +++ b/queue-4.4/usb-gadget-f_uac2-fix-error-handling-at-afunc_bind.patch @@ -0,0 +1,71 @@ +From f1d3861d63a5d79b8968a02eea1dcb01bb684e62 Mon Sep 17 00:00:00 2001 +From: Peter Chen +Date: Tue, 8 Nov 2016 10:10:44 +0800 +Subject: usb: gadget: f_uac2: fix error handling at afunc_bind + +From: Peter Chen + +commit f1d3861d63a5d79b8968a02eea1dcb01bb684e62 upstream. + +The current error handling flow uses incorrect goto label, fix it + +Fixes: d12a8727171c ("usb: gadget: function: Remove redundant usb_free_all_descriptors") +Signed-off-by: Peter Chen +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/function/f_uac2.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +--- a/drivers/usb/gadget/function/f_uac2.c ++++ b/drivers/usb/gadget/function/f_uac2.c +@@ -1079,13 +1079,13 @@ afunc_bind(struct usb_configuration *cfg + agdev->out_ep = usb_ep_autoconfig(gadget, &fs_epout_desc); + if (!agdev->out_ep) { + dev_err(dev, "%s:%d Error!\n", __func__, __LINE__); +- goto err; ++ return ret; + } + + agdev->in_ep = usb_ep_autoconfig(gadget, &fs_epin_desc); + if (!agdev->in_ep) { + dev_err(dev, "%s:%d Error!\n", __func__, __LINE__); +- goto err; ++ return ret; + } + + uac2->p_prm.uac2 = uac2; +@@ -1102,7 +1102,7 @@ afunc_bind(struct usb_configuration *cfg + + ret = usb_assign_descriptors(fn, fs_audio_desc, hs_audio_desc, NULL); + if (ret) +- goto err; ++ return ret; + + prm = &agdev->uac2.c_prm; + prm->max_psize = hs_epout_desc.wMaxPacketSize; +@@ -1117,19 +1117,19 @@ afunc_bind(struct usb_configuration *cfg + prm->rbuf = kzalloc(prm->max_psize * USB_XFERS, GFP_KERNEL); + if (!prm->rbuf) { + prm->max_psize = 0; +- goto err_free_descs; ++ goto err; + } + + ret = alsa_uac2_init(agdev); + if (ret) +- goto err_free_descs; ++ goto err; + return 0; + +-err_free_descs: +- usb_free_all_descriptors(fn); + err: + kfree(agdev->uac2.p_prm.rbuf); + kfree(agdev->uac2.c_prm.rbuf); ++err_free_descs: ++ usb_free_all_descriptors(fn); + return -EINVAL; + } + diff --git a/queue-4.4/usb-hub-fix-auto-remount-of-safely-removed-or-ejected-usb-3-devices.patch b/queue-4.4/usb-hub-fix-auto-remount-of-safely-removed-or-ejected-usb-3-devices.patch new file mode 100644 index 00000000000..0226bdd27cd --- /dev/null +++ b/queue-4.4/usb-hub-fix-auto-remount-of-safely-removed-or-ejected-usb-3-devices.patch @@ -0,0 +1,171 @@ +From 37be66767e3cae4fd16e064d8bb7f9f72bf5c045 Mon Sep 17 00:00:00 2001 +From: Mathias Nyman +Date: Thu, 17 Nov 2016 11:14:14 +0200 +Subject: usb: hub: Fix auto-remount of safely removed or ejected USB-3 devices + +From: Mathias Nyman + +commit 37be66767e3cae4fd16e064d8bb7f9f72bf5c045 upstream. + +USB-3 does not have any link state that will avoid negotiating a connection +with a plugged-in cable but will signal the host when the cable is +unplugged. + +For USB-3 we used to first set the link to Disabled, then to RxDdetect to +be able to detect cable connects or disconnects. But in RxDetect the +connected device is detected again and eventually enabled. + +Instead set the link into U3 and disable remote wakeups for the device. +This is what Windows does, and what Alan Stern suggested. + +Cc: Alan Stern +Acked-by: Alan Stern +Signed-off-by: Mathias Nyman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/hub.c | 101 +++++++++++++++++-------------------------------- + 1 file changed, 36 insertions(+), 65 deletions(-) + +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -101,6 +101,8 @@ EXPORT_SYMBOL_GPL(ehci_cf_port_reset_rws + + static void hub_release(struct kref *kref); + static int usb_reset_and_verify_device(struct usb_device *udev); ++static void hub_usb3_port_prepare_disable(struct usb_hub *hub, ++ struct usb_port *port_dev); + + static inline char *portspeed(struct usb_hub *hub, int portstatus) + { +@@ -883,82 +885,28 @@ static int hub_set_port_link_state(struc + } + + /* +- * If USB 3.0 ports are placed into the Disabled state, they will no longer +- * detect any device connects or disconnects. This is generally not what the +- * USB core wants, since it expects a disabled port to produce a port status +- * change event when a new device connects. +- * +- * Instead, set the link state to Disabled, wait for the link to settle into +- * that state, clear any change bits, and then put the port into the RxDetect +- * state. ++ * USB-3 does not have a similar link state as USB-2 that will avoid negotiating ++ * a connection with a plugged-in cable but will signal the host when the cable ++ * is unplugged. Disable remote wake and set link state to U3 for USB-3 devices + */ +-static int hub_usb3_port_disable(struct usb_hub *hub, int port1) +-{ +- int ret; +- int total_time; +- u16 portchange, portstatus; +- +- if (!hub_is_superspeed(hub->hdev)) +- return -EINVAL; +- +- ret = hub_port_status(hub, port1, &portstatus, &portchange); +- if (ret < 0) +- return ret; +- +- /* +- * USB controller Advanced Micro Devices, Inc. [AMD] FCH USB XHCI +- * Controller [1022:7814] will have spurious result making the following +- * usb 3.0 device hotplugging route to the 2.0 root hub and recognized +- * as high-speed device if we set the usb 3.0 port link state to +- * Disabled. Since it's already in USB_SS_PORT_LS_RX_DETECT state, we +- * check the state here to avoid the bug. +- */ +- if ((portstatus & USB_PORT_STAT_LINK_STATE) == +- USB_SS_PORT_LS_RX_DETECT) { +- dev_dbg(&hub->ports[port1 - 1]->dev, +- "Not disabling port; link state is RxDetect\n"); +- return ret; +- } +- +- ret = hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_SS_DISABLED); +- if (ret) +- return ret; +- +- /* Wait for the link to enter the disabled state. */ +- for (total_time = 0; ; total_time += HUB_DEBOUNCE_STEP) { +- ret = hub_port_status(hub, port1, &portstatus, &portchange); +- if (ret < 0) +- return ret; +- +- if ((portstatus & USB_PORT_STAT_LINK_STATE) == +- USB_SS_PORT_LS_SS_DISABLED) +- break; +- if (total_time >= HUB_DEBOUNCE_TIMEOUT) +- break; +- msleep(HUB_DEBOUNCE_STEP); +- } +- if (total_time >= HUB_DEBOUNCE_TIMEOUT) +- dev_warn(&hub->ports[port1 - 1]->dev, +- "Could not disable after %d ms\n", total_time); +- +- return hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_RX_DETECT); +-} +- + static int hub_port_disable(struct usb_hub *hub, int port1, int set_state) + { + struct usb_port *port_dev = hub->ports[port1 - 1]; + struct usb_device *hdev = hub->hdev; + int ret = 0; + +- if (port_dev->child && set_state) +- usb_set_device_state(port_dev->child, USB_STATE_NOTATTACHED); + if (!hub->error) { +- if (hub_is_superspeed(hub->hdev)) +- ret = hub_usb3_port_disable(hub, port1); +- else ++ if (hub_is_superspeed(hub->hdev)) { ++ hub_usb3_port_prepare_disable(hub, port_dev); ++ ret = hub_set_port_link_state(hub, port_dev->portnum, ++ USB_SS_PORT_LS_U3); ++ } else { + ret = usb_clear_port_feature(hdev, port1, + USB_PORT_FEAT_ENABLE); ++ } + } ++ if (port_dev->child && set_state) ++ usb_set_device_state(port_dev->child, USB_STATE_NOTATTACHED); + if (ret && ret != -ENODEV) + dev_err(&port_dev->dev, "cannot disable (err = %d)\n", ret); + return ret; +@@ -4073,6 +4021,26 @@ void usb_unlocked_enable_lpm(struct usb_ + } + EXPORT_SYMBOL_GPL(usb_unlocked_enable_lpm); + ++/* usb3 devices use U3 for disabled, make sure remote wakeup is disabled */ ++static void hub_usb3_port_prepare_disable(struct usb_hub *hub, ++ struct usb_port *port_dev) ++{ ++ struct usb_device *udev = port_dev->child; ++ int ret; ++ ++ if (udev && udev->port_is_suspended && udev->do_remote_wakeup) { ++ ret = hub_set_port_link_state(hub, port_dev->portnum, ++ USB_SS_PORT_LS_U0); ++ if (!ret) { ++ msleep(USB_RESUME_TIMEOUT); ++ ret = usb_disable_remote_wakeup(udev); ++ } ++ if (ret) ++ dev_warn(&udev->dev, ++ "Port disable: can't disable remote wake\n"); ++ udev->do_remote_wakeup = 0; ++ } ++} + + #else /* CONFIG_PM */ + +@@ -4080,6 +4048,9 @@ EXPORT_SYMBOL_GPL(usb_unlocked_enable_lp + #define hub_resume NULL + #define hub_reset_resume NULL + ++static inline void hub_usb3_port_prepare_disable(struct usb_hub *hub, ++ struct usb_port *port_dev) { } ++ + int usb_disable_lpm(struct usb_device *udev) + { + return 0; diff --git a/queue-4.4/usb-serial-kl5kusb105-fix-open-error-path.patch b/queue-4.4/usb-serial-kl5kusb105-fix-open-error-path.patch new file mode 100644 index 00000000000..676097b20fe --- /dev/null +++ b/queue-4.4/usb-serial-kl5kusb105-fix-open-error-path.patch @@ -0,0 +1,72 @@ +From 6774d5f53271d5f60464f824748995b71da401ab Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Tue, 29 Nov 2016 16:55:01 +0100 +Subject: USB: serial: kl5kusb105: fix open error path + +From: Johan Hovold + +commit 6774d5f53271d5f60464f824748995b71da401ab upstream. + +Kill urbs and disable read before returning from open on failure to +retrieve the line state. + +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/kl5kusb105.c | 33 ++++++++++++++++++++++++--------- + 1 file changed, 24 insertions(+), 9 deletions(-) + +--- a/drivers/usb/serial/kl5kusb105.c ++++ b/drivers/usb/serial/kl5kusb105.c +@@ -296,7 +296,7 @@ static int klsi_105_open(struct tty_str + rc = usb_serial_generic_open(tty, port); + if (rc) { + retval = rc; +- goto exit; ++ goto err_free_cfg; + } + + rc = usb_control_msg(port->serial->dev, +@@ -315,17 +315,32 @@ static int klsi_105_open(struct tty_str + dev_dbg(&port->dev, "%s - enabled reading\n", __func__); + + rc = klsi_105_get_line_state(port, &line_state); +- if (rc >= 0) { +- spin_lock_irqsave(&priv->lock, flags); +- priv->line_state = line_state; +- spin_unlock_irqrestore(&priv->lock, flags); +- dev_dbg(&port->dev, "%s - read line state 0x%lx\n", __func__, line_state); +- retval = 0; +- } else ++ if (rc < 0) { + retval = rc; ++ goto err_disable_read; ++ } ++ ++ spin_lock_irqsave(&priv->lock, flags); ++ priv->line_state = line_state; ++ spin_unlock_irqrestore(&priv->lock, flags); ++ dev_dbg(&port->dev, "%s - read line state 0x%lx\n", __func__, ++ line_state); ++ ++ return 0; + +-exit: ++err_disable_read: ++ usb_control_msg(port->serial->dev, ++ usb_sndctrlpipe(port->serial->dev, 0), ++ KL5KUSB105A_SIO_CONFIGURE, ++ USB_TYPE_VENDOR | USB_DIR_OUT, ++ KL5KUSB105A_SIO_CONFIGURE_READ_OFF, ++ 0, /* index */ ++ NULL, 0, ++ KLSI_TIMEOUT); ++ usb_serial_generic_close(port); ++err_free_cfg: + kfree(cfg); ++ + return retval; + } + diff --git a/queue-4.4/usb-serial-option-add-dlink-dwm-158.patch b/queue-4.4/usb-serial-option-add-dlink-dwm-158.patch new file mode 100644 index 00000000000..5563c290e30 --- /dev/null +++ b/queue-4.4/usb-serial-option-add-dlink-dwm-158.patch @@ -0,0 +1,29 @@ +From d8a12b7117b42fd708f1e908498350232bdbd5ff Mon Sep 17 00:00:00 2001 +From: Giuseppe Lippolis +Date: Tue, 6 Dec 2016 21:24:19 +0100 +Subject: USB: serial: option: add dlink dwm-158 + +From: Giuseppe Lippolis + +commit d8a12b7117b42fd708f1e908498350232bdbd5ff upstream. + +Adding registration for 3G modem DWM-158 in usb-serial-option + +Signed-off-by: Giuseppe Lippolis +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/option.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -1995,6 +1995,7 @@ static const struct usb_device_id option + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d02, 0xff, 0x00, 0x00) }, + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x02, 0x01) }, + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) }, ++ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d04, 0xff) }, /* D-Link DWM-158 */ + { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e19, 0xff), /* D-Link DWM-221 B1 */ + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */ diff --git a/queue-4.4/usb-serial-option-add-support-for-telit-le922a-pids-0x1040-0x1041.patch b/queue-4.4/usb-serial-option-add-support-for-telit-le922a-pids-0x1040-0x1041.patch new file mode 100644 index 00000000000..ad872a93d03 --- /dev/null +++ b/queue-4.4/usb-serial-option-add-support-for-telit-le922a-pids-0x1040-0x1041.patch @@ -0,0 +1,44 @@ +From 5b09eff0c379002527ad72ea5ea38f25da8a8650 Mon Sep 17 00:00:00 2001 +From: Daniele Palmas +Date: Thu, 1 Dec 2016 16:38:39 +0100 +Subject: USB: serial: option: add support for Telit LE922A PIDs 0x1040, 0x1041 + +From: Daniele Palmas + +commit 5b09eff0c379002527ad72ea5ea38f25da8a8650 upstream. + +This patch adds support for PIDs 0x1040, 0x1041 of Telit LE922A. + +Since the interface positions are the same than the ones used +for other Telit compositions, previous defined blacklists are used. + +Signed-off-by: Daniele Palmas +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/option.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -268,6 +268,8 @@ static void option_instat_callback(struc + #define TELIT_PRODUCT_CC864_SINGLE 0x1006 + #define TELIT_PRODUCT_DE910_DUAL 0x1010 + #define TELIT_PRODUCT_UE910_V2 0x1012 ++#define TELIT_PRODUCT_LE922_USBCFG1 0x1040 ++#define TELIT_PRODUCT_LE922_USBCFG2 0x1041 + #define TELIT_PRODUCT_LE922_USBCFG0 0x1042 + #define TELIT_PRODUCT_LE922_USBCFG3 0x1043 + #define TELIT_PRODUCT_LE922_USBCFG5 0x1045 +@@ -1210,6 +1212,10 @@ static const struct usb_device_id option + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UE910_V2) }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG0), + .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 }, ++ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG1), ++ .driver_info = (kernel_ulong_t)&telit_le910_blacklist }, ++ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG2), ++ .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG3), + .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG5, 0xff), diff --git a/queue-4.4/usb-uhci-report-non-pme-wakeup-signalling-for-intel-hardware.patch b/queue-4.4/usb-uhci-report-non-pme-wakeup-signalling-for-intel-hardware.patch new file mode 100644 index 00000000000..c87938ffa74 --- /dev/null +++ b/queue-4.4/usb-uhci-report-non-pme-wakeup-signalling-for-intel-hardware.patch @@ -0,0 +1,38 @@ +From ccdb6be9ec6580ef69f68949ebe26e0fb58a6fb0 Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Fri, 21 Oct 2016 16:49:07 -0400 +Subject: USB: UHCI: report non-PME wakeup signalling for Intel hardware + +From: Alan Stern + +commit ccdb6be9ec6580ef69f68949ebe26e0fb58a6fb0 upstream. + +The UHCI controllers in Intel chipsets rely on a platform-specific non-PME +mechanism for wakeup signalling. They can generate wakeup signals even +though they don't support PME. + +We need to let the USB core know this so that it will enable runtime +suspend for UHCI controllers. + +Signed-off-by: Alan Stern +Signed-off-by: Bjorn Helgaas +Acked-by: Greg Kroah-Hartman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/uhci-pci.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/usb/host/uhci-pci.c ++++ b/drivers/usb/host/uhci-pci.c +@@ -129,6 +129,10 @@ static int uhci_pci_init(struct usb_hcd + if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_HP) + uhci->wait_for_hp = 1; + ++ /* Intel controllers use non-PME wakeup signalling */ ++ if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_INTEL) ++ device_set_run_wake(uhci_dev(uhci), 1); ++ + /* Set up pointers to PCI-specific functions */ + uhci->reset_hc = uhci_pci_reset_hc; + uhci->check_and_reset_hc = uhci_pci_check_and_reset_hc;