]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Jan 2016 02:47:04 +0000 (18:47 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Jan 2016 02:47:04 +0000 (18:47 -0800)
added patches:
airspy-increase-usb-control-message-buffer-size.patch
asoc-arizona-fix-bclk-for-sample-rates-that-are-multiple-of-4khz.patch
asoc-compress-fix-compress-device-direction-check.patch
asoc-davinci-mcasp-fix-xdata-check-in-mcasp_start_tx.patch
asoc-es8328-fix-deemphasis-values.patch
asoc-wm8974-set-cache-type-for-regmap.patch
usb-cp210x-add-id-for-elv-marble-sound-board-1.patch
usb-fix-invalid-memory-access-in-hub_activate.patch
usb-ipaq.c-fix-a-timeout-loop.patch
usb-xhci-fix-config-fail-of-fs-hub-behind-a-hs-hub-with-mtt.patch
xhci-refuse-loading-if-nousb-is-used.patch

12 files changed:
queue-4.1/airspy-increase-usb-control-message-buffer-size.patch [new file with mode: 0644]
queue-4.1/asoc-arizona-fix-bclk-for-sample-rates-that-are-multiple-of-4khz.patch [new file with mode: 0644]
queue-4.1/asoc-compress-fix-compress-device-direction-check.patch [new file with mode: 0644]
queue-4.1/asoc-davinci-mcasp-fix-xdata-check-in-mcasp_start_tx.patch [new file with mode: 0644]
queue-4.1/asoc-es8328-fix-deemphasis-values.patch [new file with mode: 0644]
queue-4.1/asoc-wm8974-set-cache-type-for-regmap.patch [new file with mode: 0644]
queue-4.1/series
queue-4.1/usb-cp210x-add-id-for-elv-marble-sound-board-1.patch [new file with mode: 0644]
queue-4.1/usb-fix-invalid-memory-access-in-hub_activate.patch [new file with mode: 0644]
queue-4.1/usb-ipaq.c-fix-a-timeout-loop.patch [new file with mode: 0644]
queue-4.1/usb-xhci-fix-config-fail-of-fs-hub-behind-a-hs-hub-with-mtt.patch [new file with mode: 0644]
queue-4.1/xhci-refuse-loading-if-nousb-is-used.patch [new file with mode: 0644]

diff --git a/queue-4.1/airspy-increase-usb-control-message-buffer-size.patch b/queue-4.1/airspy-increase-usb-control-message-buffer-size.patch
new file mode 100644 (file)
index 0000000..f659099
--- /dev/null
@@ -0,0 +1,37 @@
+From aa0850e1d56623845b46350ffd971afa9241886d Mon Sep 17 00:00:00 2001
+From: Antti Palosaari <crope@iki.fi>
+Date: Mon, 26 Oct 2015 18:58:14 -0200
+Subject: [media] airspy: increase USB control message buffer size
+
+From: Antti Palosaari <crope@iki.fi>
+
+commit aa0850e1d56623845b46350ffd971afa9241886d upstream.
+
+Driver requested device firmware version string during probe using
+only 24 byte long buffer. That buffer is too small for newer firmware
+versions, which causes device firmware hang - device stops responding
+to any commands after that. Increase buffer size to 128 which should
+be enough for any current and future version strings.
+
+Link: https://github.com/airspy/host/issues/27
+
+Reported-by: Benjamin Vernoux <bvernoux@gmail.com>
+Signed-off-by: Antti Palosaari <crope@iki.fi>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/usb/airspy/airspy.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/media/usb/airspy/airspy.c
++++ b/drivers/media/usb/airspy/airspy.c
+@@ -132,7 +132,7 @@ struct airspy {
+       int            urbs_submitted;
+       /* USB control message buffer */
+-      #define BUF_SIZE 24
++      #define BUF_SIZE 128
+       u8 buf[BUF_SIZE];
+       /* Current configuration */
diff --git a/queue-4.1/asoc-arizona-fix-bclk-for-sample-rates-that-are-multiple-of-4khz.patch b/queue-4.1/asoc-arizona-fix-bclk-for-sample-rates-that-are-multiple-of-4khz.patch
new file mode 100644 (file)
index 0000000..284f0fb
--- /dev/null
@@ -0,0 +1,33 @@
+From e73694d871867cae8471d2350ce89acb38bc2b63 Mon Sep 17 00:00:00 2001
+From: Nikesh Oswal <Nikesh.Oswal@cirrus.com>
+Date: Wed, 23 Dec 2015 14:18:05 +0000
+Subject: ASoC: arizona: Fix bclk for sample rates that are multiple of 4kHz
+
+From: Nikesh Oswal <Nikesh.Oswal@cirrus.com>
+
+commit e73694d871867cae8471d2350ce89acb38bc2b63 upstream.
+
+For a sample rate of 12kHz the bclk was taken from the 44.1kHz table as
+we test for a multiple of 8kHz. This patch fixes this issue by testing
+for multiples of 4kHz instead.
+
+Signed-off-by: Nikesh Oswal <Nikesh.Oswal@cirrus.com>
+Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/arizona.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/soc/codecs/arizona.c
++++ b/sound/soc/codecs/arizona.c
+@@ -1354,7 +1354,7 @@ static int arizona_hw_params(struct snd_
+       bool reconfig;
+       unsigned int aif_tx_state, aif_rx_state;
+-      if (params_rate(params) % 8000)
++      if (params_rate(params) % 4000)
+               rates = &arizona_44k1_bclk_rates[0];
+       else
+               rates = &arizona_48k_bclk_rates[0];
diff --git a/queue-4.1/asoc-compress-fix-compress-device-direction-check.patch b/queue-4.1/asoc-compress-fix-compress-device-direction-check.patch
new file mode 100644 (file)
index 0000000..83f688b
--- /dev/null
@@ -0,0 +1,63 @@
+From a1068045883ed4a18363a4ebad0c3d55e473b716 Mon Sep 17 00:00:00 2001
+From: Vinod Koul <vinod.koul@intel.com>
+Date: Thu, 7 Jan 2016 21:48:14 +0530
+Subject: ASoC: compress: Fix compress device direction check
+
+From: Vinod Koul <vinod.koul@intel.com>
+
+commit a1068045883ed4a18363a4ebad0c3d55e473b716 upstream.
+
+The detection of direction for compress was only taking into account codec
+capabilities and not CPU ones. Fix this by checking the CPU side capabilities
+as well
+
+Tested-by: Ashish Panwar <ashish.panwar@intel.com>
+Signed-off-by: Vinod Koul <vinod.koul@intel.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/soc-compress.c |   23 ++++++++++++++++++++---
+ 1 file changed, 20 insertions(+), 3 deletions(-)
+
+--- a/sound/soc/soc-compress.c
++++ b/sound/soc/soc-compress.c
+@@ -623,6 +623,7 @@ int soc_new_compress(struct snd_soc_pcm_
+       struct snd_pcm *be_pcm;
+       char new_name[64];
+       int ret = 0, direction = 0;
++      int playback = 0, capture = 0;
+       if (rtd->num_codecs > 1) {
+               dev_err(rtd->card->dev, "Multicodec not supported for compressed stream\n");
+@@ -634,11 +635,27 @@ int soc_new_compress(struct snd_soc_pcm_
+                       rtd->dai_link->stream_name, codec_dai->name, num);
+       if (codec_dai->driver->playback.channels_min)
++              playback = 1;
++      if (codec_dai->driver->capture.channels_min)
++              capture = 1;
++
++      capture = capture && cpu_dai->driver->capture.channels_min;
++      playback = playback && cpu_dai->driver->playback.channels_min;
++
++      /*
++       * Compress devices are unidirectional so only one of the directions
++       * should be set, check for that (xor)
++       */
++      if (playback + capture != 1) {
++              dev_err(rtd->card->dev, "Invalid direction for compress P %d, C %d\n",
++                              playback, capture);
++              return -EINVAL;
++      }
++
++      if(playback)
+               direction = SND_COMPRESS_PLAYBACK;
+-      else if (codec_dai->driver->capture.channels_min)
+-              direction = SND_COMPRESS_CAPTURE;
+       else
+-              return -EINVAL;
++              direction = SND_COMPRESS_CAPTURE;
+       compr = kzalloc(sizeof(*compr), GFP_KERNEL);
+       if (compr == NULL) {
diff --git a/queue-4.1/asoc-davinci-mcasp-fix-xdata-check-in-mcasp_start_tx.patch b/queue-4.1/asoc-davinci-mcasp-fix-xdata-check-in-mcasp_start_tx.patch
new file mode 100644 (file)
index 0000000..49994ed
--- /dev/null
@@ -0,0 +1,33 @@
+From e2a0c9fa80227be5ee017b5476638829dd41cb39 Mon Sep 17 00:00:00 2001
+From: Peter Ujfalusi <peter.ujfalusi@ti.com>
+Date: Fri, 11 Dec 2015 13:06:24 +0200
+Subject: ASoC: davinci-mcasp: Fix XDATA check in mcasp_start_tx
+
+From: Peter Ujfalusi <peter.ujfalusi@ti.com>
+
+commit e2a0c9fa80227be5ee017b5476638829dd41cb39 upstream.
+
+The condition for checking for XDAT being cleared was not correct.
+
+Fixes: 36bcecd0a73eb ("ASoC: davinci-mcasp: Correct TX start sequence")
+Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/davinci/davinci-mcasp.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sound/soc/davinci/davinci-mcasp.c
++++ b/sound/soc/davinci/davinci-mcasp.c
+@@ -221,8 +221,8 @@ static void mcasp_start_tx(struct davinc
+       /* wait for XDATA to be cleared */
+       cnt = 0;
+-      while (!(mcasp_get_reg(mcasp, DAVINCI_MCASP_TXSTAT_REG) &
+-               ~XRDATA) && (cnt < 100000))
++      while ((mcasp_get_reg(mcasp, DAVINCI_MCASP_TXSTAT_REG) & XRDATA) &&
++             (cnt < 100000))
+               cnt++;
+       /* Release TX state machine */
diff --git a/queue-4.1/asoc-es8328-fix-deemphasis-values.patch b/queue-4.1/asoc-es8328-fix-deemphasis-values.patch
new file mode 100644 (file)
index 0000000..7a8b94e
--- /dev/null
@@ -0,0 +1,82 @@
+From 84ebac4d04d25ac5c1b1dc3ae621fd465eb38f4e Mon Sep 17 00:00:00 2001
+From: John Keeping <john@metanate.com>
+Date: Wed, 9 Dec 2015 11:38:13 +0000
+Subject: ASoC: es8328: Fix deemphasis values
+
+From: John Keeping <john@metanate.com>
+
+commit 84ebac4d04d25ac5c1b1dc3ae621fd465eb38f4e upstream.
+
+This is using completely the wrong mask and value when updating the
+register.  Since the correct values are already defined in the header,
+switch to using a table with explicit constants rather than shifting the
+array index.
+
+Signed-off-by: John Keeping <john@metanate.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/es8328.c |   25 +++++++++++++++++--------
+ sound/soc/codecs/es8328.h |    1 +
+ 2 files changed, 18 insertions(+), 8 deletions(-)
+
+--- a/sound/soc/codecs/es8328.c
++++ b/sound/soc/codecs/es8328.c
+@@ -85,7 +85,15 @@ static const DECLARE_TLV_DB_SCALE(pga_tl
+ static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0);
+ static const DECLARE_TLV_DB_SCALE(mic_tlv, 0, 300, 0);
+-static const int deemph_settings[] = { 0, 32000, 44100, 48000 };
++static const struct {
++      int rate;
++      unsigned int val;
++} deemph_settings[] = {
++      { 0,     ES8328_DACCONTROL6_DEEMPH_OFF },
++      { 32000, ES8328_DACCONTROL6_DEEMPH_32k },
++      { 44100, ES8328_DACCONTROL6_DEEMPH_44_1k },
++      { 48000, ES8328_DACCONTROL6_DEEMPH_48k },
++};
+ static int es8328_set_deemph(struct snd_soc_codec *codec)
+ {
+@@ -97,21 +105,22 @@ static int es8328_set_deemph(struct snd_
+        * rate.
+        */
+       if (es8328->deemph) {
+-              best = 1;
+-              for (i = 2; i < ARRAY_SIZE(deemph_settings); i++) {
+-                      if (abs(deemph_settings[i] - es8328->playback_fs) <
+-                          abs(deemph_settings[best] - es8328->playback_fs))
++              best = 0;
++              for (i = 1; i < ARRAY_SIZE(deemph_settings); i++) {
++                      if (abs(deemph_settings[i].rate - es8328->playback_fs) <
++                          abs(deemph_settings[best].rate - es8328->playback_fs))
+                               best = i;
+               }
+-              val = best << 1;
++              val = deemph_settings[best].val;
+       } else {
+-              val = 0;
++              val = ES8328_DACCONTROL6_DEEMPH_OFF;
+       }
+       dev_dbg(codec->dev, "Set deemphasis %d\n", val);
+-      return snd_soc_update_bits(codec, ES8328_DACCONTROL6, 0x6, val);
++      return snd_soc_update_bits(codec, ES8328_DACCONTROL6,
++                      ES8328_DACCONTROL6_DEEMPH_MASK, val);
+ }
+ static int es8328_get_deemph(struct snd_kcontrol *kcontrol,
+--- a/sound/soc/codecs/es8328.h
++++ b/sound/soc/codecs/es8328.h
+@@ -153,6 +153,7 @@ int es8328_probe(struct device *dev, str
+ #define ES8328_DACCONTROL6_CLICKFREE (1 << 3)
+ #define ES8328_DACCONTROL6_DAC_INVR (1 << 4)
+ #define ES8328_DACCONTROL6_DAC_INVL (1 << 5)
++#define ES8328_DACCONTROL6_DEEMPH_MASK (3 << 6)
+ #define ES8328_DACCONTROL6_DEEMPH_OFF (0 << 6)
+ #define ES8328_DACCONTROL6_DEEMPH_32k (1 << 6)
+ #define ES8328_DACCONTROL6_DEEMPH_44_1k (2 << 6)
diff --git a/queue-4.1/asoc-wm8974-set-cache-type-for-regmap.patch b/queue-4.1/asoc-wm8974-set-cache-type-for-regmap.patch
new file mode 100644 (file)
index 0000000..c750ac6
--- /dev/null
@@ -0,0 +1,32 @@
+From 1ea5998afe903384ddc16391d4c023cd4c867bea Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans@mansr.com>
+Date: Fri, 11 Dec 2015 11:27:08 +0000
+Subject: ASoC: wm8974: set cache type for regmap
+
+From: Mans Rullgard <mans@mansr.com>
+
+commit 1ea5998afe903384ddc16391d4c023cd4c867bea upstream.
+
+Attempting to use this codec driver triggers a BUG() in regcache_sync()
+since no cache type is set.  The register map of this device is fairly
+small and has few holes so a flat cache is suitable.
+
+Signed-off-by: Mans Rullgard <mans@mansr.com>
+Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/wm8974.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/soc/codecs/wm8974.c
++++ b/sound/soc/codecs/wm8974.c
+@@ -575,6 +575,7 @@ static const struct regmap_config wm8974
+       .max_register = WM8974_MONOMIX,
+       .reg_defaults = wm8974_reg_defaults,
+       .num_reg_defaults = ARRAY_SIZE(wm8974_reg_defaults),
++      .cache_type = REGCACHE_FLAT,
+ };
+ static int wm8974_probe(struct snd_soc_codec *codec)
index d985850a214750954c61da7bf095c6f23079e3f2..c872ee79a4daa981259a3642cd24c42ab374a98e 100644 (file)
@@ -48,3 +48,14 @@ alsa-hda-flush-the-pending-probe-work-at-remove.patch
 alsa-timer-handle-disconnection-more-safely.patch
 asoc-rsnd-fixup-scu_sys_int_en1-address.patch
 asoc-wm8962-correct-addresses-for-hpf_c_0-1.patch
+asoc-es8328-fix-deemphasis-values.patch
+asoc-wm8974-set-cache-type-for-regmap.patch
+asoc-davinci-mcasp-fix-xdata-check-in-mcasp_start_tx.patch
+asoc-arizona-fix-bclk-for-sample-rates-that-are-multiple-of-4khz.patch
+asoc-compress-fix-compress-device-direction-check.patch
+usb-xhci-fix-config-fail-of-fs-hub-behind-a-hs-hub-with-mtt.patch
+airspy-increase-usb-control-message-buffer-size.patch
+usb-fix-invalid-memory-access-in-hub_activate.patch
+usb-ipaq.c-fix-a-timeout-loop.patch
+usb-cp210x-add-id-for-elv-marble-sound-board-1.patch
+xhci-refuse-loading-if-nousb-is-used.patch
diff --git a/queue-4.1/usb-cp210x-add-id-for-elv-marble-sound-board-1.patch b/queue-4.1/usb-cp210x-add-id-for-elv-marble-sound-board-1.patch
new file mode 100644 (file)
index 0000000..9e8da95
--- /dev/null
@@ -0,0 +1,29 @@
+From f7d7f59ab124748156ea551edf789994f05da342 Mon Sep 17 00:00:00 2001
+From: Oliver Freyermuth <o.freyermuth@googlemail.com>
+Date: Mon, 28 Dec 2015 18:37:38 +0100
+Subject: USB: cp210x: add ID for ELV Marble Sound Board 1
+
+From: Oliver Freyermuth <o.freyermuth@googlemail.com>
+
+commit f7d7f59ab124748156ea551edf789994f05da342 upstream.
+
+Add the USB device ID for ELV Marble Sound Board 1.
+
+Signed-off-by: Oliver Freyermuth <o.freyermuth@googlemail.com>
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/cp210x.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/usb/serial/cp210x.c
++++ b/drivers/usb/serial/cp210x.c
+@@ -160,6 +160,7 @@ static const struct usb_device_id id_tab
+       { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
+       { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
+       { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
++      { USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */
+       { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */
+       { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */
+       { USB_DEVICE(0x1BA4, 0x0002) }, /* Silicon Labs 358x factory default */
diff --git a/queue-4.1/usb-fix-invalid-memory-access-in-hub_activate.patch b/queue-4.1/usb-fix-invalid-memory-access-in-hub_activate.patch
new file mode 100644 (file)
index 0000000..7b1e292
--- /dev/null
@@ -0,0 +1,82 @@
+From e50293ef9775c5f1cf3fcc093037dd6a8c5684ea Mon Sep 17 00:00:00 2001
+From: Alan Stern <stern@rowland.harvard.edu>
+Date: Wed, 16 Dec 2015 13:32:38 -0500
+Subject: USB: fix invalid memory access in hub_activate()
+
+From: Alan Stern <stern@rowland.harvard.edu>
+
+commit e50293ef9775c5f1cf3fcc093037dd6a8c5684ea upstream.
+
+Commit 8520f38099cc ("USB: change hub initialization sleeps to
+delayed_work") changed the hub_activate() routine to make part of it
+run in a workqueue.  However, the commit failed to take a reference to
+the usb_hub structure or to lock the hub interface while doing so.  As
+a result, if a hub is plugged in and quickly unplugged before the work
+routine can run, the routine will try to access memory that has been
+deallocated.  Or, if the hub is unplugged while the routine is
+running, the memory may be deallocated while it is in active use.
+
+This patch fixes the problem by taking a reference to the usb_hub at
+the start of hub_activate() and releasing it at the end (when the work
+is finished), and by locking the hub interface while the work routine
+is running.  It also adds a check at the start of the routine to see
+if the hub has already been disconnected, in which nothing should be
+done.
+
+Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
+Reported-by: Alexandru Cornea <alexandru.cornea@intel.com>
+Tested-by: Alexandru Cornea <alexandru.cornea@intel.com>
+Fixes: 8520f38099cc ("USB: change hub initialization sleeps to delayed_work")
+CC: <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/core/hub.c |   22 +++++++++++++++++++---
+ 1 file changed, 19 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/core/hub.c
++++ b/drivers/usb/core/hub.c
+@@ -1034,10 +1034,20 @@ static void hub_activate(struct usb_hub
+       unsigned delay;
+       /* Continue a partial initialization */
+-      if (type == HUB_INIT2)
+-              goto init2;
+-      if (type == HUB_INIT3)
++      if (type == HUB_INIT2 || type == HUB_INIT3) {
++              device_lock(hub->intfdev);
++
++              /* Was the hub disconnected while we were waiting? */
++              if (hub->disconnected) {
++                      device_unlock(hub->intfdev);
++                      kref_put(&hub->kref, hub_release);
++                      return;
++              }
++              if (type == HUB_INIT2)
++                      goto init2;
+               goto init3;
++      }
++      kref_get(&hub->kref);
+       /* The superspeed hub except for root hub has to use Hub Depth
+        * value as an offset into the route string to locate the bits
+@@ -1235,6 +1245,7 @@ static void hub_activate(struct usb_hub
+                       queue_delayed_work(system_power_efficient_wq,
+                                       &hub->init_work,
+                                       msecs_to_jiffies(delay));
++                      device_unlock(hub->intfdev);
+                       return;         /* Continues at init3: below */
+               } else {
+                       msleep(delay);
+@@ -1256,6 +1267,11 @@ static void hub_activate(struct usb_hub
+       /* Allow autosuspend if it was suppressed */
+       if (type <= HUB_INIT3)
+               usb_autopm_put_interface_async(to_usb_interface(hub->intfdev));
++
++      if (type == HUB_INIT2 || type == HUB_INIT3)
++              device_unlock(hub->intfdev);
++
++      kref_put(&hub->kref, hub_release);
+ }
+ /* Implement the continuations for the delays above */
diff --git a/queue-4.1/usb-ipaq.c-fix-a-timeout-loop.patch b/queue-4.1/usb-ipaq.c-fix-a-timeout-loop.patch
new file mode 100644 (file)
index 0000000..f7035bf
--- /dev/null
@@ -0,0 +1,33 @@
+From abdc9a3b4bac97add99e1d77dc6d28623afe682b Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Wed, 16 Dec 2015 14:06:37 +0300
+Subject: USB: ipaq.c: fix a timeout loop
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+commit abdc9a3b4bac97add99e1d77dc6d28623afe682b upstream.
+
+The code expects the loop to end with "retries" set to zero but, because
+it is a post-op, it will end set to -1.  I have fixed this by moving the
+decrement inside the loop.
+
+Fixes: 014aa2a3c32e ('USB: ipaq: minor ipaq_open() cleanup.')
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/ipaq.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/serial/ipaq.c
++++ b/drivers/usb/serial/ipaq.c
+@@ -531,7 +531,8 @@ static int ipaq_open(struct tty_struct *
+        * through. Since this has a reasonably high failure rate, we retry
+        * several times.
+        */
+-      while (retries--) {
++      while (retries) {
++              retries--;
+               result = usb_control_msg(serial->dev,
+                               usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21,
+                               0x1, 0, NULL, 0, 100);
diff --git a/queue-4.1/usb-xhci-fix-config-fail-of-fs-hub-behind-a-hs-hub-with-mtt.patch b/queue-4.1/usb-xhci-fix-config-fail-of-fs-hub-behind-a-hs-hub-with-mtt.patch
new file mode 100644 (file)
index 0000000..2ed0297
--- /dev/null
@@ -0,0 +1,47 @@
+From 096b110a3dd3c868e4610937c80d2e3f3357c1a9 Mon Sep 17 00:00:00 2001
+From: Chunfeng Yun <chunfeng.yun@mediatek.com>
+Date: Fri, 4 Dec 2015 15:53:43 +0200
+Subject: usb: xhci: fix config fail of FS hub behind a HS hub with MTT
+
+From: Chunfeng Yun <chunfeng.yun@mediatek.com>
+
+commit 096b110a3dd3c868e4610937c80d2e3f3357c1a9 upstream.
+
+if a full speed hub connects to a high speed hub which
+supports MTT, the MTT field of its slot context will be set
+to 1 when xHCI driver setups an xHCI virtual device in
+xhci_setup_addressable_virt_dev(); once usb core fetch its
+hub descriptor, and need to update the xHC's internal data
+structures for the device, the HUB field of its slot context
+will be set to 1 too, meanwhile MTT is also set before,
+this will cause configure endpoint command fail, so in the
+case, we should clear MTT to 0 for full speed hub according
+to section 6.2.2
+
+Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
+Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/host/xhci.c |    8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/drivers/usb/host/xhci.c
++++ b/drivers/usb/host/xhci.c
+@@ -4794,8 +4794,16 @@ int xhci_update_hub_device(struct usb_hc
+       ctrl_ctx->add_flags |= cpu_to_le32(SLOT_FLAG);
+       slot_ctx = xhci_get_slot_ctx(xhci, config_cmd->in_ctx);
+       slot_ctx->dev_info |= cpu_to_le32(DEV_HUB);
++      /*
++       * refer to section 6.2.2: MTT should be 0 for full speed hub,
++       * but it may be already set to 1 when setup an xHCI virtual
++       * device, so clear it anyway.
++       */
+       if (tt->multi)
+               slot_ctx->dev_info |= cpu_to_le32(DEV_MTT);
++      else if (hdev->speed == USB_SPEED_FULL)
++              slot_ctx->dev_info &= cpu_to_le32(~DEV_MTT);
++
+       if (xhci->hci_version > 0x95) {
+               xhci_dbg(xhci, "xHCI version %x needs hub "
+                               "TT think time and number of ports\n",
diff --git a/queue-4.1/xhci-refuse-loading-if-nousb-is-used.patch b/queue-4.1/xhci-refuse-loading-if-nousb-is-used.patch
new file mode 100644 (file)
index 0000000..f99e3e2
--- /dev/null
@@ -0,0 +1,31 @@
+From 1eaf35e4dd592c59041bc1ed3248c46326da1f5f Mon Sep 17 00:00:00 2001
+From: Oliver Neukum <oneukum@suse.com>
+Date: Thu, 3 Dec 2015 15:03:34 +0100
+Subject: xhci: refuse loading if nousb is used
+
+From: Oliver Neukum <oneukum@suse.com>
+
+commit 1eaf35e4dd592c59041bc1ed3248c46326da1f5f upstream.
+
+The module should fail to load.
+
+Signed-off-by: Oliver Neukum <oneukum@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/host/xhci.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/usb/host/xhci.c
++++ b/drivers/usb/host/xhci.c
+@@ -5054,6 +5054,10 @@ static int __init xhci_hcd_init(void)
+       BUILD_BUG_ON(sizeof(struct xhci_intr_reg) != 8*32/8);
+       /* xhci_run_regs has eight fields and embeds 128 xhci_intr_regs */
+       BUILD_BUG_ON(sizeof(struct xhci_run_regs) != (8+8*128)*32/8);
++
++      if (usb_disabled())
++              return -ENODEV;
++
+       return 0;
+ }