From: Greg Kroah-Hartman Date: Tue, 26 Jan 2016 02:46:53 +0000 (-0800) Subject: 4.4-stable patches X-Git-Tag: v3.10.96~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e8df9e279928cc7975eeebadd71bb62c9a21c9a2;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: asoc-compress-fix-compress-device-direction-check.patch asoc-wm5110-fix-pga-clear-when-disabling-dre.patch rtlwifi-fix-memory-leak-for-usb-device.patch usb-core-lpm-fix-usb3_hardware_lpm-sysfs-node.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.4/asoc-compress-fix-compress-device-direction-check.patch b/queue-4.4/asoc-compress-fix-compress-device-direction-check.patch new file mode 100644 index 00000000000..ce2d3c77c15 --- /dev/null +++ b/queue-4.4/asoc-compress-fix-compress-device-direction-check.patch @@ -0,0 +1,63 @@ +From a1068045883ed4a18363a4ebad0c3d55e473b716 Mon Sep 17 00:00:00 2001 +From: Vinod Koul +Date: Thu, 7 Jan 2016 21:48:14 +0530 +Subject: ASoC: compress: Fix compress device direction check + +From: Vinod Koul + +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 +Signed-off-by: Vinod Koul +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -630,6 +630,7 @@ int snd_soc_new_compress(struct snd_soc_ + 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"); +@@ -641,11 +642,27 @@ int snd_soc_new_compress(struct snd_soc_ + 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.4/asoc-wm5110-fix-pga-clear-when-disabling-dre.patch b/queue-4.4/asoc-wm5110-fix-pga-clear-when-disabling-dre.patch new file mode 100644 index 00000000000..3945ae8f790 --- /dev/null +++ b/queue-4.4/asoc-wm5110-fix-pga-clear-when-disabling-dre.patch @@ -0,0 +1,47 @@ +From 24338722cfa23fdf4e08c6189a11f7e3a902d86a Mon Sep 17 00:00:00 2001 +From: Charles Keepax +Date: Wed, 6 Jan 2016 15:15:37 +0000 +Subject: ASoC: wm5110: Fix PGA clear when disabling DRE + +From: Charles Keepax + +commit 24338722cfa23fdf4e08c6189a11f7e3a902d86a upstream. + +We don't want to use a bypassed write in wm5110_clear_pga_volume, +we might disable the DRE whilst the CODEC is powered down. A +normal regmap_write will always go to the hardware (when not on +cache_only) even if the written value matches the cache. As using +a normal write will still achieve the desired behaviour of bring +the cache and hardware in sync, this patch updates the function +to use a normal write, which avoids issues when the CODEC is +powered down. + +Signed-off-by: Charles Keepax +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/wm5110.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +--- a/sound/soc/codecs/wm5110.c ++++ b/sound/soc/codecs/wm5110.c +@@ -360,15 +360,13 @@ static int wm5110_hp_ev(struct snd_soc_d + + static int wm5110_clear_pga_volume(struct arizona *arizona, int output) + { +- struct reg_sequence clear_pga = { +- ARIZONA_OUTPUT_PATH_CONFIG_1L + output * 4, 0x80 +- }; ++ unsigned int reg = ARIZONA_OUTPUT_PATH_CONFIG_1L + output * 4; + int ret; + +- ret = regmap_multi_reg_write_bypassed(arizona->regmap, &clear_pga, 1); ++ ret = regmap_write(arizona->regmap, reg, 0x80); + if (ret) + dev_err(arizona->dev, "Failed to clear PGA (0x%x): %d\n", +- clear_pga.reg, ret); ++ reg, ret); + + return ret; + } diff --git a/queue-4.4/rtlwifi-fix-memory-leak-for-usb-device.patch b/queue-4.4/rtlwifi-fix-memory-leak-for-usb-device.patch new file mode 100644 index 00000000000..f07671419c8 --- /dev/null +++ b/queue-4.4/rtlwifi-fix-memory-leak-for-usb-device.patch @@ -0,0 +1,36 @@ +From 17bc55864f81dd730d05f09b1641312a7990d636 Mon Sep 17 00:00:00 2001 +From: Peter Wu +Date: Mon, 7 Dec 2015 01:07:31 +0100 +Subject: rtlwifi: fix memory leak for USB device + +From: Peter Wu + +commit 17bc55864f81dd730d05f09b1641312a7990d636 upstream. + +Free skb for received frames with a wrong checksum. This can happen +pretty rapidly, exhausting all memory. + +This fixes a memleak (detected with kmemleak). Originally found while +using monitor mode, but it also appears during managed mode (once the +link is up). + +Signed-off-by: Peter Wu +ACKed-by: Larry Finger +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/realtek/rtlwifi/usb.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/net/wireless/realtek/rtlwifi/usb.c ++++ b/drivers/net/wireless/realtek/rtlwifi/usb.c +@@ -531,6 +531,8 @@ static void _rtl_usb_rx_process_noagg(st + ieee80211_rx(hw, skb); + else + dev_kfree_skb_any(skb); ++ } else { ++ dev_kfree_skb_any(skb); + } + } + diff --git a/queue-4.4/series b/queue-4.4/series index 27c22baa907..ec86b1b72c6 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -27,3 +27,9 @@ alsa-hda-fix-bass-pin-fixup-for-asus-n550jx.patch alsa-hda-fix-missing-module-loading-with-model-generic-option.patch alsa-hda-flush-the-pending-probe-work-at-remove.patch alsa-timer-handle-disconnection-more-safely.patch +asoc-wm5110-fix-pga-clear-when-disabling-dre.patch +asoc-compress-fix-compress-device-direction-check.patch +rtlwifi-fix-memory-leak-for-usb-device.patch +usb-cp210x-add-id-for-elv-marble-sound-board-1.patch +usb-core-lpm-fix-usb3_hardware_lpm-sysfs-node.patch +xhci-refuse-loading-if-nousb-is-used.patch diff --git a/queue-4.4/usb-core-lpm-fix-usb3_hardware_lpm-sysfs-node.patch b/queue-4.4/usb-core-lpm-fix-usb3_hardware_lpm-sysfs-node.patch new file mode 100644 index 00000000000..6e50178af1e --- /dev/null +++ b/queue-4.4/usb-core-lpm-fix-usb3_hardware_lpm-sysfs-node.patch @@ -0,0 +1,252 @@ +From bf5ce5bf3cc7136fd7fe5e8999a580bc93a9c8f6 Mon Sep 17 00:00:00 2001 +From: Lu Baolu +Date: Sat, 14 Nov 2015 16:26:32 +0800 +Subject: usb: core: lpm: fix usb3_hardware_lpm sysfs node + +From: Lu Baolu + +commit bf5ce5bf3cc7136fd7fe5e8999a580bc93a9c8f6 upstream. + +Commit 655fe4effe0f ("usbcore: add sysfs support to xHCI usb3 +hardware LPM") introduced usb3_hardware_lpm sysfs node. This +doesn't show the correct status of USB3 U1 and U2 LPM status. + +This patch fixes this by replacing usb3_hardware_lpm with two +nodes, usb3_hardware_lpm_u1 (for U1) and usb3_hardware_lpm_u2 +(for U2), and recording the U1/U2 LPM status in right places. + +This patch should be back-ported to kernels as old as 4.3, +that contains Commit 655fe4effe0f ("usbcore: add sysfs support +to xHCI usb3 hardware LPM"). + +Signed-off-by: Lu Baolu +Signed-off-by: Greg Kroah-Hartman + +--- + Documentation/ABI/testing/sysfs-bus-usb | 16 +++++++------ + Documentation/usb/power-management.txt | 11 ++++----- + drivers/usb/core/hub.c | 39 ++++++++++++++++++++++++-------- + drivers/usb/core/sysfs.c | 31 +++++++++++++++++++++---- + include/linux/usb.h | 4 +++ + 5 files changed, 75 insertions(+), 26 deletions(-) + +--- a/Documentation/ABI/testing/sysfs-bus-usb ++++ b/Documentation/ABI/testing/sysfs-bus-usb +@@ -134,19 +134,21 @@ Description: + enabled for the device. Developer can write y/Y/1 or n/N/0 to + the file to enable/disable the feature. + +-What: /sys/bus/usb/devices/.../power/usb3_hardware_lpm +-Date: June 2015 ++What: /sys/bus/usb/devices/.../power/usb3_hardware_lpm_u1 ++ /sys/bus/usb/devices/.../power/usb3_hardware_lpm_u2 ++Date: November 2015 + Contact: Kevin Strasser ++ Lu Baolu + Description: + If CONFIG_PM is set and a USB 3.0 lpm-capable device is plugged + in to a xHCI host which supports link PM, it will check if U1 + and U2 exit latencies have been set in the BOS descriptor; if +- the check is is passed and the host supports USB3 hardware LPM, ++ the check is passed and the host supports USB3 hardware LPM, + USB3 hardware LPM will be enabled for the device and the USB +- device directory will contain a file named +- power/usb3_hardware_lpm. The file holds a string value (enable +- or disable) indicating whether or not USB3 hardware LPM is +- enabled for the device. ++ device directory will contain two files named ++ power/usb3_hardware_lpm_u1 and power/usb3_hardware_lpm_u2. These ++ files hold a string value (enable or disable) indicating whether ++ or not USB3 hardware LPM U1 or U2 is enabled for the device. + + What: /sys/bus/usb/devices/.../removable + Date: February 2012 +--- a/Documentation/usb/power-management.txt ++++ b/Documentation/usb/power-management.txt +@@ -537,17 +537,18 @@ relevant attribute files are usb2_hardwa + can write y/Y/1 or n/N/0 to the file to enable/disable + USB2 hardware LPM manually. This is for test purpose mainly. + +- power/usb3_hardware_lpm ++ power/usb3_hardware_lpm_u1 ++ power/usb3_hardware_lpm_u2 + + When a USB 3.0 lpm-capable device is plugged in to a + xHCI host which supports link PM, it will check if U1 + and U2 exit latencies have been set in the BOS + descriptor; if the check is is passed and the host + supports USB3 hardware LPM, USB3 hardware LPM will be +- enabled for the device and this file will be created. +- The file holds a string value (enable or disable) +- indicating whether or not USB3 hardware LPM is +- enabled for the device. ++ enabled for the device and these files will be created. ++ The files hold a string value (enable or disable) ++ indicating whether or not USB3 hardware LPM U1 or U2 ++ is enabled for the device. + + USB Port Power Control + ---------------------- +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -3895,17 +3895,30 @@ static void usb_enable_link_state(struct + return; + } + +- if (usb_set_lpm_timeout(udev, state, timeout)) ++ if (usb_set_lpm_timeout(udev, state, timeout)) { + /* If we can't set the parent hub U1/U2 timeout, + * device-initiated LPM won't be allowed either, so let the xHCI + * host know that this link state won't be enabled. + */ + hcd->driver->disable_usb3_lpm_timeout(hcd, udev, state); ++ } else { ++ /* Only a configured device will accept the Set Feature ++ * U1/U2_ENABLE ++ */ ++ if (udev->actconfig) ++ usb_set_device_initiated_lpm(udev, state, true); + +- /* Only a configured device will accept the Set Feature U1/U2_ENABLE */ +- else if (udev->actconfig) +- usb_set_device_initiated_lpm(udev, state, true); +- ++ /* As soon as usb_set_lpm_timeout(timeout) returns 0, the ++ * hub-initiated LPM is enabled. Thus, LPM is enabled no ++ * matter the result of usb_set_device_initiated_lpm(). ++ * The only difference is whether device is able to initiate ++ * LPM. ++ */ ++ if (state == USB3_LPM_U1) ++ udev->usb3_lpm_u1_enabled = 1; ++ else if (state == USB3_LPM_U2) ++ udev->usb3_lpm_u2_enabled = 1; ++ } + } + + /* +@@ -3945,6 +3958,18 @@ static int usb_disable_link_state(struct + dev_warn(&udev->dev, "Could not disable xHCI %s timeout, " + "bus schedule bandwidth may be impacted.\n", + usb3_lpm_names[state]); ++ ++ /* As soon as usb_set_lpm_timeout(0) return 0, hub initiated LPM ++ * is disabled. Hub will disallows link to enter U1/U2 as well, ++ * even device is initiating LPM. Hence LPM is disabled if hub LPM ++ * timeout set to 0, no matter device-initiated LPM is disabled or ++ * not. ++ */ ++ if (state == USB3_LPM_U1) ++ udev->usb3_lpm_u1_enabled = 0; ++ else if (state == USB3_LPM_U2) ++ udev->usb3_lpm_u2_enabled = 0; ++ + return 0; + } + +@@ -3979,8 +4004,6 @@ int usb_disable_lpm(struct usb_device *u + if (usb_disable_link_state(hcd, udev, USB3_LPM_U2)) + goto enable_lpm; + +- udev->usb3_lpm_enabled = 0; +- + return 0; + + enable_lpm: +@@ -4038,8 +4061,6 @@ void usb_enable_lpm(struct usb_device *u + + usb_enable_link_state(hcd, udev, USB3_LPM_U1); + usb_enable_link_state(hcd, udev, USB3_LPM_U2); +- +- udev->usb3_lpm_enabled = 1; + } + EXPORT_SYMBOL_GPL(usb_enable_lpm); + +--- a/drivers/usb/core/sysfs.c ++++ b/drivers/usb/core/sysfs.c +@@ -531,7 +531,7 @@ static ssize_t usb2_lpm_besl_store(struc + } + static DEVICE_ATTR_RW(usb2_lpm_besl); + +-static ssize_t usb3_hardware_lpm_show(struct device *dev, ++static ssize_t usb3_hardware_lpm_u1_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + struct usb_device *udev = to_usb_device(dev); +@@ -539,7 +539,7 @@ static ssize_t usb3_hardware_lpm_show(st + + usb_lock_device(udev); + +- if (udev->usb3_lpm_enabled) ++ if (udev->usb3_lpm_u1_enabled) + p = "enabled"; + else + p = "disabled"; +@@ -548,7 +548,26 @@ static ssize_t usb3_hardware_lpm_show(st + + return sprintf(buf, "%s\n", p); + } +-static DEVICE_ATTR_RO(usb3_hardware_lpm); ++static DEVICE_ATTR_RO(usb3_hardware_lpm_u1); ++ ++static ssize_t usb3_hardware_lpm_u2_show(struct device *dev, ++ struct device_attribute *attr, char *buf) ++{ ++ struct usb_device *udev = to_usb_device(dev); ++ const char *p; ++ ++ usb_lock_device(udev); ++ ++ if (udev->usb3_lpm_u2_enabled) ++ p = "enabled"; ++ else ++ p = "disabled"; ++ ++ usb_unlock_device(udev); ++ ++ return sprintf(buf, "%s\n", p); ++} ++static DEVICE_ATTR_RO(usb3_hardware_lpm_u2); + + static struct attribute *usb2_hardware_lpm_attr[] = { + &dev_attr_usb2_hardware_lpm.attr, +@@ -562,7 +581,8 @@ static struct attribute_group usb2_hardw + }; + + static struct attribute *usb3_hardware_lpm_attr[] = { +- &dev_attr_usb3_hardware_lpm.attr, ++ &dev_attr_usb3_hardware_lpm_u1.attr, ++ &dev_attr_usb3_hardware_lpm_u2.attr, + NULL, + }; + static struct attribute_group usb3_hardware_lpm_attr_group = { +@@ -592,7 +612,8 @@ static int add_power_attributes(struct d + if (udev->usb2_hw_lpm_capable == 1) + rc = sysfs_merge_group(&dev->kobj, + &usb2_hardware_lpm_attr_group); +- if (udev->lpm_capable == 1) ++ if (udev->speed == USB_SPEED_SUPER && ++ udev->lpm_capable == 1) + rc = sysfs_merge_group(&dev->kobj, + &usb3_hardware_lpm_attr_group); + } +--- a/include/linux/usb.h ++++ b/include/linux/usb.h +@@ -511,6 +511,8 @@ struct usb3_lpm_parameters { + * @usb2_hw_lpm_enabled: USB2 hardware LPM is enabled + * @usb2_hw_lpm_allowed: Userspace allows USB 2.0 LPM to be enabled + * @usb3_lpm_enabled: USB3 hardware LPM enabled ++ * @usb3_lpm_u1_enabled: USB3 hardware U1 LPM enabled ++ * @usb3_lpm_u2_enabled: USB3 hardware U2 LPM enabled + * @string_langid: language ID for strings + * @product: iProduct string, if present (static) + * @manufacturer: iManufacturer string, if present (static) +@@ -584,6 +586,8 @@ struct usb_device { + unsigned usb2_hw_lpm_enabled:1; + unsigned usb2_hw_lpm_allowed:1; + unsigned usb3_lpm_enabled:1; ++ unsigned usb3_lpm_u1_enabled:1; ++ unsigned usb3_lpm_u2_enabled:1; + int string_langid; + + /* static strings from the device */ diff --git a/queue-4.4/usb-cp210x-add-id-for-elv-marble-sound-board-1.patch b/queue-4.4/usb-cp210x-add-id-for-elv-marble-sound-board-1.patch new file mode 100644 index 00000000000..9e8da959b40 --- /dev/null +++ b/queue-4.4/usb-cp210x-add-id-for-elv-marble-sound-board-1.patch @@ -0,0 +1,29 @@ +From f7d7f59ab124748156ea551edf789994f05da342 Mon Sep 17 00:00:00 2001 +From: Oliver Freyermuth +Date: Mon, 28 Dec 2015 18:37:38 +0100 +Subject: USB: cp210x: add ID for ELV Marble Sound Board 1 + +From: Oliver Freyermuth + +commit f7d7f59ab124748156ea551edf789994f05da342 upstream. + +Add the USB device ID for ELV Marble Sound Board 1. + +Signed-off-by: Oliver Freyermuth +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + 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.4/xhci-refuse-loading-if-nousb-is-used.patch b/queue-4.4/xhci-refuse-loading-if-nousb-is-used.patch new file mode 100644 index 00000000000..6d7fa479d42 --- /dev/null +++ b/queue-4.4/xhci-refuse-loading-if-nousb-is-used.patch @@ -0,0 +1,31 @@ +From 1eaf35e4dd592c59041bc1ed3248c46326da1f5f Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Thu, 3 Dec 2015 15:03:34 +0100 +Subject: xhci: refuse loading if nousb is used + +From: Oliver Neukum + +commit 1eaf35e4dd592c59041bc1ed3248c46326da1f5f upstream. + +The module should fail to load. + +Signed-off-by: Oliver Neukum +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/usb/host/xhci.c ++++ b/drivers/usb/host/xhci.c +@@ -5059,6 +5059,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; + } +