From: Greg Kroah-Hartman Date: Mon, 10 Nov 2014 04:41:14 +0000 (+0900) Subject: 3.17-stable patches X-Git-Tag: v3.10.60~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e10199451ddb58936cdf2ddd26b6799aa0c917f3;p=thirdparty%2Fkernel%2Fstable-queue.git 3.17-stable patches added patches: iio-adc-mxs-lradc-disable-the-clock-on-probe-failure.patch iio-as3935-allocate-correct-iio_device-size.patch iio-st_sensors-fix-buffer-copy.patch phy-omap-usb2-enable-runtime-pm-of-omap-usb2-phy-properly.patch revert-usb-dwc3-dwc3-omap-disable-enable-only-wrapper-interrupts-in-prepare-complete.patch rt2x00-support-ralink-5362.patch serial-fix-divide-by-zero-fault-in-uart_get_divisor.patch serial-msm_serial-fix-kgdb-continue.patch spi-fsl-dspi-fix-ctar-selection.patch spi-pl022-fix-incorrect-dma_unmap_sg.patch spi-pxa2xx-toggle-clocks-on-suspend-if-not-disabled-by-runtime-pm.patch staging-iio-ad5933-drop-raw-from-channel-names.patch staging-iio-ad5933-fix-null-pointer-deref-when-enabling-buffer.patch staging-iio-ade7758-fix-check-if-channels-are-enabled-in-prenable.patch staging-iio-ade7758-fix-null-pointer-deref-when-enabling-buffer.patch staging-iio-ade7758-remove-raw-from-channel-name.patch uas-add-no_ata_1x-for-via-vl711-devices.patch uas-add-us_fl_no_ata_1x-quirk-for-1-more-seagate-model.patch uas-add-us_fl_no_ata_1x-quirk-for-2-more-seagate-models.patch usb-cdc-acm-add-device-id-for-gw-instek-afg-2225.patch usb-cdc-acm-add-quirk-for-control-line-state-requests.patch usb-cdc-acm-only-raise-dtr-on-transitions-from-b0.patch usb-chipidea-fix-oops-when-removing-the-ci_hdrc-module.patch usb-dwc3-gadget-properly-initialize-link-trb.patch usb-ffs-fix-regression-when-quirk_ep_out_aligned_size-flag-is-set.patch usb-gadget-f_fs-remove-redundant-ffs_data_get.patch usb-musb-cppi41-restart-hrtimer-only-if-not-yet-done.patch usb-musb-dsps-start-otg-timer-on-resume-again.patch usb-option-add-haier-ce81b-cdma-modem.patch usb-option-add-support-for-telit-le910.patch usb-serial-cp210x-add-silicon-labs-358x-vid-and-pid.patch usb-serial-ftdi_sio-add-awinda-station-and-dongle-products.patch usb-serial-ftdi_sio-add-bricked-ftdi-device-pid.patch wireless-rt2x00-add-new-rt2800usb-device.patch --- diff --git a/queue-3.17/iio-adc-mxs-lradc-disable-the-clock-on-probe-failure.patch b/queue-3.17/iio-adc-mxs-lradc-disable-the-clock-on-probe-failure.patch new file mode 100644 index 00000000000..1efb64fa98b --- /dev/null +++ b/queue-3.17/iio-adc-mxs-lradc-disable-the-clock-on-probe-failure.patch @@ -0,0 +1,60 @@ +From 75d7ed3b9e7cb79a3b0e1f417fb674d54b4fc668 Mon Sep 17 00:00:00 2001 +From: Fabio Estevam +Date: Sat, 4 Oct 2014 08:50:21 -0300 +Subject: iio: adc: mxs-lradc: Disable the clock on probe failure + +From: Fabio Estevam + +commit 75d7ed3b9e7cb79a3b0e1f417fb674d54b4fc668 upstream. + +We should disable lradc->clk in the case of errors in the probe function. + +Signed-off-by: Fabio Estevam +Reviewed-by: Marek Vasut +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/iio/adc/mxs-lradc.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +--- a/drivers/staging/iio/adc/mxs-lradc.c ++++ b/drivers/staging/iio/adc/mxs-lradc.c +@@ -1565,14 +1565,16 @@ static int mxs_lradc_probe(struct platfo + /* Grab all IRQ sources */ + for (i = 0; i < of_cfg->irq_count; i++) { + lradc->irq[i] = platform_get_irq(pdev, i); +- if (lradc->irq[i] < 0) +- return lradc->irq[i]; ++ if (lradc->irq[i] < 0) { ++ ret = lradc->irq[i]; ++ goto err_clk; ++ } + + ret = devm_request_irq(dev, lradc->irq[i], + mxs_lradc_handle_irq, 0, + of_cfg->irq_name[i], iio); + if (ret) +- return ret; ++ goto err_clk; + } + + lradc->vref_mv = of_cfg->vref_mv; +@@ -1594,7 +1596,7 @@ static int mxs_lradc_probe(struct platfo + &mxs_lradc_trigger_handler, + &mxs_lradc_buffer_ops); + if (ret) +- return ret; ++ goto err_clk; + + ret = mxs_lradc_trigger_init(iio); + if (ret) +@@ -1649,6 +1651,8 @@ err_dev: + mxs_lradc_trigger_remove(iio); + err_trig: + iio_triggered_buffer_cleanup(iio); ++err_clk: ++ clk_disable_unprepare(lradc->clk); + return ret; + } + diff --git a/queue-3.17/iio-as3935-allocate-correct-iio_device-size.patch b/queue-3.17/iio-as3935-allocate-correct-iio_device-size.patch new file mode 100644 index 00000000000..34c0fe16114 --- /dev/null +++ b/queue-3.17/iio-as3935-allocate-correct-iio_device-size.patch @@ -0,0 +1,29 @@ +From f73cde600d410ad4b31362a9c348016e40a146ea Mon Sep 17 00:00:00 2001 +From: George McCollister +Date: Fri, 31 Oct 2014 15:44:00 +0000 +Subject: iio: as3935: allocate correct iio_device size + +From: George McCollister + +commit f73cde600d410ad4b31362a9c348016e40a146ea upstream. + +Signed-off-by: George McCollister +Acked-by: Hartmut Knaack +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/proximity/as3935.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/proximity/as3935.c ++++ b/drivers/iio/proximity/as3935.c +@@ -330,7 +330,7 @@ static int as3935_probe(struct spi_devic + return -EINVAL; + } + +- indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(st)); ++ indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); + if (!indio_dev) + return -ENOMEM; + diff --git a/queue-3.17/iio-st_sensors-fix-buffer-copy.patch b/queue-3.17/iio-st_sensors-fix-buffer-copy.patch new file mode 100644 index 00000000000..625ae3bd689 --- /dev/null +++ b/queue-3.17/iio-st_sensors-fix-buffer-copy.patch @@ -0,0 +1,31 @@ +From 4250c90b30b8bf2a1a21122ba0484f8f351f152d Mon Sep 17 00:00:00 2001 +From: Robin van der Gracht +Date: Mon, 29 Sep 2014 15:00:07 +0200 +Subject: iio: st_sensors: Fix buffer copy + +From: Robin van der Gracht + +commit 4250c90b30b8bf2a1a21122ba0484f8f351f152d upstream. + +Use byte_for_channel as iterator to properly initialize the buffer. + +Signed-off-by: Robin van der Gracht +Acked-by: Denis Ciocca +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/common/st_sensors/st_sensors_buffer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/common/st_sensors/st_sensors_buffer.c ++++ b/drivers/iio/common/st_sensors/st_sensors_buffer.c +@@ -71,7 +71,7 @@ int st_sensors_get_buffer_element(struct + goto st_sensors_free_memory; + } + +- for (i = 0; i < n * num_data_channels; i++) { ++ for (i = 0; i < n * byte_for_channel; i++) { + if (i < n) + buf[i] = rx_array[i]; + else diff --git a/queue-3.17/phy-omap-usb2-enable-runtime-pm-of-omap-usb2-phy-properly.patch b/queue-3.17/phy-omap-usb2-enable-runtime-pm-of-omap-usb2-phy-properly.patch new file mode 100644 index 00000000000..5f2ef93f46b --- /dev/null +++ b/queue-3.17/phy-omap-usb2-enable-runtime-pm-of-omap-usb2-phy-properly.patch @@ -0,0 +1,49 @@ +From f20531a9aae0c7378d9fa75b4b5d99b7eecab066 Mon Sep 17 00:00:00 2001 +From: Oussama Ghorbel +Date: Tue, 4 Nov 2014 11:47:06 +0530 +Subject: phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly + +From: Oussama Ghorbel + +commit f20531a9aae0c7378d9fa75b4b5d99b7eecab066 upstream. + +The USB OTG port does not work since v3.16 on omap platform. +This is a regression introduced by the commit +eb82a3d846fa (phy: omap-usb2: Balance pm_runtime_enable() on probe failure + and remove). +This because the call to pm_runtime_enable() function is moved after the +call to devm_phy_create() function, which has side effect since later in +the subsequent calls of devm_phy_create() there is a check with +pm_runtime_enabled() to configure few things. + +Fixes: eb82a3d846fa +Signed-off-by: Oussama Ghorbel +Tested-by: Rabin Vincent +Signed-off-by: Kishon Vijay Abraham I +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/phy/phy-omap-usb2.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/phy/phy-omap-usb2.c ++++ b/drivers/phy/phy-omap-usb2.c +@@ -262,14 +262,16 @@ static int omap_usb2_probe(struct platfo + otg->phy = &phy->phy; + + platform_set_drvdata(pdev, phy); ++ pm_runtime_enable(phy->dev); + + generic_phy = devm_phy_create(phy->dev, NULL, &ops, NULL); +- if (IS_ERR(generic_phy)) ++ if (IS_ERR(generic_phy)) { ++ pm_runtime_disable(phy->dev); + return PTR_ERR(generic_phy); ++ } + + phy_set_drvdata(generic_phy, phy); + +- pm_runtime_enable(phy->dev); + phy_provider = devm_of_phy_provider_register(phy->dev, + of_phy_simple_xlate); + if (IS_ERR(phy_provider)) { diff --git a/queue-3.17/revert-usb-dwc3-dwc3-omap-disable-enable-only-wrapper-interrupts-in-prepare-complete.patch b/queue-3.17/revert-usb-dwc3-dwc3-omap-disable-enable-only-wrapper-interrupts-in-prepare-complete.patch new file mode 100644 index 00000000000..9d6c717104d --- /dev/null +++ b/queue-3.17/revert-usb-dwc3-dwc3-omap-disable-enable-only-wrapper-interrupts-in-prepare-complete.patch @@ -0,0 +1,67 @@ +From b01ff5cb2fc99d45e4edc97077b6e17186570a16 Mon Sep 17 00:00:00 2001 +From: Roger Quadros +Date: Tue, 7 Oct 2014 09:40:57 -0500 +Subject: Revert "usb: dwc3: dwc3-omap: Disable/Enable only wrapper interrupts in prepare/complete" + +From: Roger Quadros + +commit b01ff5cb2fc99d45e4edc97077b6e17186570a16 upstream. + +This reverts commit 02dae36aa649a66c5c6181157ddd806e7b4913fc. + +That commit is bogus in two ways: + +1) There's no way dwc3-omap's ->suspend() can cause any effect + on xhci's ->suspend(). Linux device driver model guarantees + that a parent's ->suspend() will only be called after all + children are suspended. dwc3-omap is the parent of the + parent of xhci. + +2) When implementing Deep Sleep states where context is lost, + USBOTGSS_IRQ0 register, well, looses context so we + _must_ rewrite it otherwise core IRQs will never be + reenabled and USB will appear to be dead. + +Fixes: 02dae36 (usb: dwc3: dwc3-omap: Disable/Enable only + wrapper interrupts in prepare/complete) +Cc: George Cherian +Signed-off-by: Roger Quadros +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/dwc3/dwc3-omap.c | 15 ++------------- + 1 file changed, 2 insertions(+), 13 deletions(-) + +--- a/drivers/usb/dwc3/dwc3-omap.c ++++ b/drivers/usb/dwc3/dwc3-omap.c +@@ -599,7 +599,7 @@ static int dwc3_omap_prepare(struct devi + { + struct dwc3_omap *omap = dev_get_drvdata(dev); + +- dwc3_omap_write_irqmisc_set(omap, 0x00); ++ dwc3_omap_disable_irqs(omap); + + return 0; + } +@@ -607,19 +607,8 @@ static int dwc3_omap_prepare(struct devi + static void dwc3_omap_complete(struct device *dev) + { + struct dwc3_omap *omap = dev_get_drvdata(dev); +- u32 reg; + +- reg = (USBOTGSS_IRQMISC_OEVT | +- USBOTGSS_IRQMISC_DRVVBUS_RISE | +- USBOTGSS_IRQMISC_CHRGVBUS_RISE | +- USBOTGSS_IRQMISC_DISCHRGVBUS_RISE | +- USBOTGSS_IRQMISC_IDPULLUP_RISE | +- USBOTGSS_IRQMISC_DRVVBUS_FALL | +- USBOTGSS_IRQMISC_CHRGVBUS_FALL | +- USBOTGSS_IRQMISC_DISCHRGVBUS_FALL | +- USBOTGSS_IRQMISC_IDPULLUP_FALL); +- +- dwc3_omap_write_irqmisc_set(omap, reg); ++ dwc3_omap_enable_irqs(omap); + } + + static int dwc3_omap_suspend(struct device *dev) diff --git a/queue-3.17/rt2x00-support-ralink-5362.patch b/queue-3.17/rt2x00-support-ralink-5362.patch new file mode 100644 index 00000000000..bef2bdd248d --- /dev/null +++ b/queue-3.17/rt2x00-support-ralink-5362.patch @@ -0,0 +1,98 @@ +From ac0372abf8524a7572a9cdaac6495eb2eba20457 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Canek=20Pel=C3=A1ez=20Vald=C3=A9s?= +Date: Sun, 24 Aug 2014 19:06:11 -0500 +Subject: rt2x00: support Ralink 5362. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: =?UTF-8?q?Canek=20Pel=C3=A1ez=20Vald=C3=A9s?= + +commit ac0372abf8524a7572a9cdaac6495eb2eba20457 upstream. + +Signed-off-by: Canek Peláez Valdés +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/rt2x00/rt2800.h | 4 +++- + drivers/net/wireless/rt2x00/rt2800lib.c | 6 ++++++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/rt2x00/rt2800.h ++++ b/drivers/net/wireless/rt2x00/rt2800.h +@@ -52,6 +52,7 @@ + * RF5592 2.4G/5G 2T2R + * RF3070 2.4G 1T1R + * RF5360 2.4G 1T1R ++ * RF5362 2.4G 1T1R + * RF5370 2.4G 1T1R + * RF5390 2.4G 1T1R + */ +@@ -72,6 +73,7 @@ + #define RF3070 0x3070 + #define RF3290 0x3290 + #define RF5360 0x5360 ++#define RF5362 0x5362 + #define RF5370 0x5370 + #define RF5372 0x5372 + #define RF5390 0x5390 +@@ -2145,7 +2147,7 @@ struct mac_iveiv_entry { + /* Bits [7-4] for RF3320 (RT3370/RT3390), on other chipsets reserved */ + #define RFCSR3_PA1_BIAS_CCK FIELD8(0x70) + #define RFCSR3_PA2_CASCODE_BIAS_CCKK FIELD8(0x80) +-/* Bits for RF3290/RF5360/RF5370/RF5372/RF5390/RF5392 */ ++/* Bits for RF3290/RF5360/RF5362/RF5370/RF5372/RF5390/RF5392 */ + #define RFCSR3_VCOCAL_EN FIELD8(0x80) + /* Bits for RF3050 */ + #define RFCSR3_BIT1 FIELD8(0x02) +--- a/drivers/net/wireless/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c +@@ -3186,6 +3186,7 @@ static void rt2800_config_channel(struct + break; + case RF3070: + case RF5360: ++ case RF5362: + case RF5370: + case RF5372: + case RF5390: +@@ -3203,6 +3204,7 @@ static void rt2800_config_channel(struct + rt2x00_rf(rt2x00dev, RF3290) || + rt2x00_rf(rt2x00dev, RF3322) || + rt2x00_rf(rt2x00dev, RF5360) || ++ rt2x00_rf(rt2x00dev, RF5362) || + rt2x00_rf(rt2x00dev, RF5370) || + rt2x00_rf(rt2x00dev, RF5372) || + rt2x00_rf(rt2x00dev, RF5390) || +@@ -4317,6 +4319,7 @@ void rt2800_vco_calibration(struct rt2x0 + case RF3070: + case RF3290: + case RF5360: ++ case RF5362: + case RF5370: + case RF5372: + case RF5390: +@@ -7095,6 +7098,7 @@ static int rt2800_init_eeprom(struct rt2 + case RF3320: + case RF3322: + case RF5360: ++ case RF5362: + case RF5370: + case RF5372: + case RF5390: +@@ -7551,6 +7555,7 @@ static int rt2800_probe_hw_mode(struct r + case RF3320: + case RF3322: + case RF5360: ++ case RF5362: + case RF5370: + case RF5372: + case RF5390: +@@ -7680,6 +7685,7 @@ static int rt2800_probe_hw_mode(struct r + case RF3070: + case RF3290: + case RF5360: ++ case RF5362: + case RF5370: + case RF5372: + case RF5390: diff --git a/queue-3.17/serial-fix-divide-by-zero-fault-in-uart_get_divisor.patch b/queue-3.17/serial-fix-divide-by-zero-fault-in-uart_get_divisor.patch new file mode 100644 index 00000000000..7f98b93501f --- /dev/null +++ b/queue-3.17/serial-fix-divide-by-zero-fault-in-uart_get_divisor.patch @@ -0,0 +1,48 @@ +From 547039ec502076e60034eeb79611df3433a99b7d Mon Sep 17 00:00:00 2001 +From: Peter Hurley +Date: Thu, 16 Oct 2014 13:46:38 -0400 +Subject: serial: Fix divide-by-zero fault in uart_get_divisor() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Peter Hurley + +commit 547039ec502076e60034eeb79611df3433a99b7d upstream. + +uart_get_baud_rate() will return baud == 0 if the max rate is set +to the "magic" 38400 rate and the SPD_* flags are also specified. +On the first iteration, if the current baud rate is higher than the +max, the baud rate is clamped at the max (which in the degenerate +case is 38400). On the second iteration, the now-"magic" 38400 baud +rate selects the possibly higher alternate baud rate indicated by +the SPD_* flag. Since only two loop iterations are performed, the +loop is exited, a kernel WARNING is generated and a baud rate of +0 is returned. + +Reproducible with: + setserial /dev/ttyS0 spd_hi base_baud 38400 + +Only perform the "magic" 38400 -> SPD_* baud transform on the first +loop iteration, which prevents the degenerate case from recognizing +the clamped baud rate as the "magic" 38400 value. + +Reported-by: Robert Święcki +Signed-off-by: Peter Hurley +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/serial_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/tty/serial/serial_core.c ++++ b/drivers/tty/serial/serial_core.c +@@ -362,7 +362,7 @@ uart_get_baud_rate(struct uart_port *por + * The spd_hi, spd_vhi, spd_shi, spd_warp kludge... + * Die! Die! Die! + */ +- if (baud == 38400) ++ if (try == 0 && baud == 38400) + baud = altbaud; + + /* diff --git a/queue-3.17/serial-msm_serial-fix-kgdb-continue.patch b/queue-3.17/serial-msm_serial-fix-kgdb-continue.patch new file mode 100644 index 00000000000..e3558807a70 --- /dev/null +++ b/queue-3.17/serial-msm_serial-fix-kgdb-continue.patch @@ -0,0 +1,105 @@ +From 8b374399468da1c25db5b5d436b167aafc10fbdc Mon Sep 17 00:00:00 2001 +From: Stephen Boyd +Date: Tue, 5 Aug 2014 18:37:24 -0700 +Subject: serial: msm_serial: Fix kgdb continue + +From: Stephen Boyd + +commit 8b374399468da1c25db5b5d436b167aafc10fbdc upstream. + +Frank reports that after continuing in kgdb the RX stale event +doesn't occur until after the RX fifo is filled up with exactly +the amount of characters programmed for the RX watermark (in this +case it's 48). To read a single character from the uartdm +hardware we force a stale event so that any characters in the RX +packing buffer are flushed into the RX fifo immediately instead +of waiting for a stale timeout or for the fifo to fill. Forcing +that stale event asserts the stale interrupt but we never clear +that interrupt via UART_CR_CMD_RESET_STALE_INT in the polling +functions. So when kgdb continues the stale interrupt is left +pending in the hardware and we don't timeout with a stale event, +like we usually would if a user typed one character on the +console, until the reset stale interrupt and stale event commands +are sent. Frank could get things working again by running +handle_rx_dm(). By putting enough characters into the fifo he +could trigger a watermark interrupt, and thus cause +handle_rx_dm() to run finally resetting the stale interrupt +and enabling the stale event so that single characters would +cause timeouts again. + +The fix is to just do what the interrupt routine was doing all +along and clear the stale interrupt and enable the event again. +Doing this also smooths over any differences in the fifo behavior +between v1.3 and v1.4 hardware allowing us to skip forcing the +uart into single character mode. + +Reviewed-by: Frank Rowand +Tested-by: Frank Rowand +Fixes: f7e54d7ad743 "msm_serial: Add support for poll_{get,put}_char()" +Signed-off-by: Stephen Boyd +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/msm_serial.c | 22 +++++++--------------- + 1 file changed, 7 insertions(+), 15 deletions(-) + +--- a/drivers/tty/serial/msm_serial.c ++++ b/drivers/tty/serial/msm_serial.c +@@ -683,17 +683,6 @@ static void msm_power(struct uart_port * + } + + #ifdef CONFIG_CONSOLE_POLL +-static int msm_poll_init(struct uart_port *port) +-{ +- struct msm_port *msm_port = UART_TO_MSM(port); +- +- /* Enable single character mode on RX FIFO */ +- if (msm_port->is_uartdm >= UARTDM_1P4) +- msm_write(port, UARTDM_DMEN_RX_SC_ENABLE, UARTDM_DMEN); +- +- return 0; +-} +- + static int msm_poll_get_char_single(struct uart_port *port) + { + struct msm_port *msm_port = UART_TO_MSM(port); +@@ -705,7 +694,7 @@ static int msm_poll_get_char_single(stru + return msm_read(port, rf_reg) & 0xff; + } + +-static int msm_poll_get_char_dm_1p3(struct uart_port *port) ++static int msm_poll_get_char_dm(struct uart_port *port) + { + int c; + static u32 slop; +@@ -729,6 +718,10 @@ static int msm_poll_get_char_dm_1p3(stru + slop = msm_read(port, UARTDM_RF); + c = sp[0]; + count--; ++ msm_write(port, UART_CR_CMD_RESET_STALE_INT, UART_CR); ++ msm_write(port, 0xFFFFFF, UARTDM_DMRX); ++ msm_write(port, UART_CR_CMD_STALE_EVENT_ENABLE, ++ UART_CR); + } else { + c = NO_POLL_CHAR; + } +@@ -752,8 +745,8 @@ static int msm_poll_get_char(struct uart + imr = msm_read(port, UART_IMR); + msm_write(port, 0, UART_IMR); + +- if (msm_port->is_uartdm == UARTDM_1P3) +- c = msm_poll_get_char_dm_1p3(port); ++ if (msm_port->is_uartdm) ++ c = msm_poll_get_char_dm(port); + else + c = msm_poll_get_char_single(port); + +@@ -812,7 +805,6 @@ static struct uart_ops msm_uart_pops = { + .verify_port = msm_verify_port, + .pm = msm_power, + #ifdef CONFIG_CONSOLE_POLL +- .poll_init = msm_poll_init, + .poll_get_char = msm_poll_get_char, + .poll_put_char = msm_poll_put_char, + #endif diff --git a/queue-3.17/series b/queue-3.17/series index 149883249af..0c6880269ad 100644 --- a/queue-3.17/series +++ b/queue-3.17/series @@ -185,3 +185,37 @@ x86-acpi-do-not-translate-gsi-number-if-ioapic-is-disabled.patch acpi-irq-x86-return-irq-instead-of-gsi-in-mp_register_gsi.patch acpi-ec-fix-regression-due-to-conflicting-firmware-behavior-between-samsung-and-acer.patch oom-pm-oom-killed-task-shouldn-t-escape-pm-suspend.patch +iio-st_sensors-fix-buffer-copy.patch +iio-adc-mxs-lradc-disable-the-clock-on-probe-failure.patch +staging-iio-ad5933-fix-null-pointer-deref-when-enabling-buffer.patch +staging-iio-ad5933-drop-raw-from-channel-names.patch +iio-as3935-allocate-correct-iio_device-size.patch +staging-iio-ade7758-fix-null-pointer-deref-when-enabling-buffer.patch +staging-iio-ade7758-fix-check-if-channels-are-enabled-in-prenable.patch +staging-iio-ade7758-remove-raw-from-channel-name.patch +serial-msm_serial-fix-kgdb-continue.patch +serial-fix-divide-by-zero-fault-in-uart_get_divisor.patch +usb-serial-cp210x-add-silicon-labs-358x-vid-and-pid.patch +usb-serial-ftdi_sio-add-awinda-station-and-dongle-products.patch +usb-serial-ftdi_sio-add-bricked-ftdi-device-pid.patch +usb-cdc-acm-add-device-id-for-gw-instek-afg-2225.patch +usb-cdc-acm-only-raise-dtr-on-transitions-from-b0.patch +usb-cdc-acm-add-quirk-for-control-line-state-requests.patch +phy-omap-usb2-enable-runtime-pm-of-omap-usb2-phy-properly.patch +usb-option-add-support-for-telit-le910.patch +usb-option-add-haier-ce81b-cdma-modem.patch +rt2x00-support-ralink-5362.patch +wireless-rt2x00-add-new-rt2800usb-device.patch +revert-usb-dwc3-dwc3-omap-disable-enable-only-wrapper-interrupts-in-prepare-complete.patch +usb-dwc3-gadget-properly-initialize-link-trb.patch +spi-pl022-fix-incorrect-dma_unmap_sg.patch +spi-fsl-dspi-fix-ctar-selection.patch +spi-pxa2xx-toggle-clocks-on-suspend-if-not-disabled-by-runtime-pm.patch +uas-add-no_ata_1x-for-via-vl711-devices.patch +uas-add-us_fl_no_ata_1x-quirk-for-2-more-seagate-models.patch +uas-add-us_fl_no_ata_1x-quirk-for-1-more-seagate-model.patch +usb-musb-cppi41-restart-hrtimer-only-if-not-yet-done.patch +usb-musb-dsps-start-otg-timer-on-resume-again.patch +usb-gadget-f_fs-remove-redundant-ffs_data_get.patch +usb-ffs-fix-regression-when-quirk_ep_out_aligned_size-flag-is-set.patch +usb-chipidea-fix-oops-when-removing-the-ci_hdrc-module.patch diff --git a/queue-3.17/spi-fsl-dspi-fix-ctar-selection.patch b/queue-3.17/spi-fsl-dspi-fix-ctar-selection.patch new file mode 100644 index 00000000000..e1457196a24 --- /dev/null +++ b/queue-3.17/spi-fsl-dspi-fix-ctar-selection.patch @@ -0,0 +1,43 @@ +From 5cc7b04740effa5cc0af53f434134b5859d58b73 Mon Sep 17 00:00:00 2001 +From: Alexander Stein +Date: Tue, 4 Nov 2014 09:20:18 +0100 +Subject: spi: fsl-dspi: Fix CTAR selection + +From: Alexander Stein + +commit 5cc7b04740effa5cc0af53f434134b5859d58b73 upstream. + +There are only 4 CTAR registers (CTAR0 - CTAR3) so we can only use the +lower 2 bits of the chip select to select a CTAR register. +SPI_PUSHR_CTAS used the lower 3 bits which would result in wrong bit values +if the chip selects 4/5 are used. For those chip selects SPI_CTAR even +calculated offsets of non-existing registers. + +Signed-off-by: Alexander Stein +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/spi/spi-fsl-dspi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/spi/spi-fsl-dspi.c ++++ b/drivers/spi/spi-fsl-dspi.c +@@ -46,7 +46,7 @@ + + #define SPI_TCR 0x08 + +-#define SPI_CTAR(x) (0x0c + (x * 4)) ++#define SPI_CTAR(x) (0x0c + (((x) & 0x3) * 4)) + #define SPI_CTAR_FMSZ(x) (((x) & 0x0000000f) << 27) + #define SPI_CTAR_CPOL(x) ((x) << 26) + #define SPI_CTAR_CPHA(x) ((x) << 25) +@@ -70,7 +70,7 @@ + + #define SPI_PUSHR 0x34 + #define SPI_PUSHR_CONT (1 << 31) +-#define SPI_PUSHR_CTAS(x) (((x) & 0x00000007) << 28) ++#define SPI_PUSHR_CTAS(x) (((x) & 0x00000003) << 28) + #define SPI_PUSHR_EOQ (1 << 27) + #define SPI_PUSHR_CTCNT (1 << 26) + #define SPI_PUSHR_PCS(x) (((1 << x) & 0x0000003f) << 16) diff --git a/queue-3.17/spi-pl022-fix-incorrect-dma_unmap_sg.patch b/queue-3.17/spi-pl022-fix-incorrect-dma_unmap_sg.patch new file mode 100644 index 00000000000..f51a0971a64 --- /dev/null +++ b/queue-3.17/spi-pl022-fix-incorrect-dma_unmap_sg.patch @@ -0,0 +1,32 @@ +From 3ffa6158f002e096d28ede71be4e0ee8ab20baa2 Mon Sep 17 00:00:00 2001 +From: Ray Jui +Date: Thu, 9 Oct 2014 11:44:54 -0700 +Subject: spi: pl022: Fix incorrect dma_unmap_sg + +From: Ray Jui + +commit 3ffa6158f002e096d28ede71be4e0ee8ab20baa2 upstream. + +When mapped RX DMA entries are unmapped in an error condition when DMA +is firstly configured in the driver, the number of TX DMA entries was +passed in, which is incorrect + +Signed-off-by: Ray Jui +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/spi/spi-pl022.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/spi/spi-pl022.c ++++ b/drivers/spi/spi-pl022.c +@@ -1074,7 +1074,7 @@ err_rxdesc: + pl022->sgt_tx.nents, DMA_TO_DEVICE); + err_tx_sgmap: + dma_unmap_sg(rxchan->device->dev, pl022->sgt_rx.sgl, +- pl022->sgt_tx.nents, DMA_FROM_DEVICE); ++ pl022->sgt_rx.nents, DMA_FROM_DEVICE); + err_rx_sgmap: + sg_free_table(&pl022->sgt_tx); + err_alloc_tx_sg: diff --git a/queue-3.17/spi-pxa2xx-toggle-clocks-on-suspend-if-not-disabled-by-runtime-pm.patch b/queue-3.17/spi-pxa2xx-toggle-clocks-on-suspend-if-not-disabled-by-runtime-pm.patch new file mode 100644 index 00000000000..48ae0ea6f89 --- /dev/null +++ b/queue-3.17/spi-pxa2xx-toggle-clocks-on-suspend-if-not-disabled-by-runtime-pm.patch @@ -0,0 +1,71 @@ +From 2b9375b91bef65b837bed61a05fb387159b38ddf Mon Sep 17 00:00:00 2001 +From: Dmitry Eremin-Solenikov +Date: Thu, 6 Nov 2014 14:08:29 +0300 +Subject: spi: pxa2xx: toggle clocks on suspend if not disabled by runtime PM + +From: Dmitry Eremin-Solenikov + +commit 2b9375b91bef65b837bed61a05fb387159b38ddf upstream. + +If PM_RUNTIME is enabled, it is easy to trigger the following backtrace +on pxa2xx hosts: + +------------[ cut here ]------------ +WARNING: CPU: 0 PID: 1 at /home/lumag/linux/arch/arm/mach-pxa/clock.c:35 clk_disable+0xa0/0xa8() +Modules linked in: +CPU: 0 PID: 1 Comm: swapper Not tainted 3.17.0-00007-g1b3d2ee-dirty #104 +[] (unwind_backtrace) from [] (show_stack+0x10/0x14) +[] (show_stack) from [] (warn_slowpath_common+0x6c/0x8c) +[] (warn_slowpath_common) from [] (warn_slowpath_null+0x1c/0x24) +[] (warn_slowpath_null) from [] (clk_disable+0xa0/0xa8) +[] (clk_disable) from [] (pxa2xx_spi_suspend+0x2c/0x34) +[] (pxa2xx_spi_suspend) from [] (platform_pm_suspend+0x2c/0x54) +[] (platform_pm_suspend) from [] (dpm_run_callback.isra.14+0x2c/0x74) +[] (dpm_run_callback.isra.14) from [] (__device_suspend+0x120/0x2f8) +[] (__device_suspend) from [] (dpm_suspend+0x50/0x208) +[] (dpm_suspend) from [] (suspend_devices_and_enter+0x8c/0x3a0) +[] (suspend_devices_and_enter) from [] (pm_suspend+0x214/0x2a8) +[] (pm_suspend) from [] (test_suspend+0x14c/0x1dc) +[] (test_suspend) from [] (do_one_initcall+0x8c/0x1fc) +[] (do_one_initcall) from [] (kernel_init_freeable+0xf4/0x1b4) +[] (kernel_init_freeable) from [] (kernel_init+0x8/0xec) +[] (kernel_init) from [] (ret_from_fork+0x14/0x24) +---[ end trace 46524156d8faa4f6 ]--- + +This happens because suspend function tries to disable a clock that is +already disabled by runtime_suspend callback. Add if +(!pm_runtime_suspended()) checks to suspend/resume path. + +Fixes: 7d94a505858 (spi/pxa2xx: add support for runtime PM) +Signed-off-by: Dmitry Eremin-Solenikov +Reported-by: Andrea Adami +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/spi/spi-pxa2xx.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/spi/spi-pxa2xx.c ++++ b/drivers/spi/spi-pxa2xx.c +@@ -1276,7 +1276,9 @@ static int pxa2xx_spi_suspend(struct dev + if (status != 0) + return status; + write_SSCR0(0, drv_data->ioaddr); +- clk_disable_unprepare(ssp->clk); ++ ++ if (!pm_runtime_suspended(dev)) ++ clk_disable_unprepare(ssp->clk); + + return 0; + } +@@ -1290,7 +1292,8 @@ static int pxa2xx_spi_resume(struct devi + pxa2xx_spi_dma_resume(drv_data); + + /* Enable the SSP clock */ +- clk_prepare_enable(ssp->clk); ++ if (!pm_runtime_suspended(dev)) ++ clk_prepare_enable(ssp->clk); + + /* Restore LPSS private register bits */ + lpss_ssp_setup(drv_data); diff --git a/queue-3.17/staging-iio-ad5933-drop-raw-from-channel-names.patch b/queue-3.17/staging-iio-ad5933-drop-raw-from-channel-names.patch new file mode 100644 index 00000000000..f82af9c65ed --- /dev/null +++ b/queue-3.17/staging-iio-ad5933-drop-raw-from-channel-names.patch @@ -0,0 +1,40 @@ +From 6822ee34ad57b29a3b44df2c2829910f03c34fa4 Mon Sep 17 00:00:00 2001 +From: Lars-Peter Clausen +Date: Thu, 25 Sep 2014 15:27:00 +0100 +Subject: staging:iio:ad5933: Drop "raw" from channel names + +From: Lars-Peter Clausen + +commit 6822ee34ad57b29a3b44df2c2829910f03c34fa4 upstream. + +"raw" is the name of a channel property, but should not be part of the +channel name itself. + +Signed-off-by: Lars-Peter Clausen +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/iio/impedance-analyzer/ad5933.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/staging/iio/impedance-analyzer/ad5933.c ++++ b/drivers/staging/iio/impedance-analyzer/ad5933.c +@@ -125,7 +125,7 @@ static const struct iio_chan_spec ad5933 + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = 0, +- .extend_name = "real_raw", ++ .extend_name = "real", + .address = AD5933_REG_REAL_DATA, + .scan_index = 0, + .scan_type = { +@@ -137,7 +137,7 @@ static const struct iio_chan_spec ad5933 + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = 0, +- .extend_name = "imag_raw", ++ .extend_name = "imag", + .address = AD5933_REG_IMAG_DATA, + .scan_index = 1, + .scan_type = { diff --git a/queue-3.17/staging-iio-ad5933-fix-null-pointer-deref-when-enabling-buffer.patch b/queue-3.17/staging-iio-ad5933-fix-null-pointer-deref-when-enabling-buffer.patch new file mode 100644 index 00000000000..d0d6c071f64 --- /dev/null +++ b/queue-3.17/staging-iio-ad5933-fix-null-pointer-deref-when-enabling-buffer.patch @@ -0,0 +1,116 @@ +From 824269c5868d2a7a26417e5ef3841a27d42c6139 Mon Sep 17 00:00:00 2001 +From: Lars-Peter Clausen +Date: Thu, 25 Sep 2014 15:27:00 +0100 +Subject: staging:iio:ad5933: Fix NULL pointer deref when enabling buffer + +From: Lars-Peter Clausen + +commit 824269c5868d2a7a26417e5ef3841a27d42c6139 upstream. + +In older versions of the IIO framework it was possible to pass a +completely different set of channels to iio_buffer_register() as the one +that is assigned to the IIO device. Commit 959d2952d124 ("staging:iio: make +iio_sw_buffer_preenable much more general.") introduced a restriction that +requires that the set of channels that is passed to iio_buffer_register() is +a subset of the channels assigned to the IIO device as the IIO core will use +the list of channels that is assigned to the device to lookup a channel by +scan index in iio_compute_scan_bytes(). If it can not find the channel the +function will crash. This patch fixes the issue by making sure that the same +set of channels is assigned to the IIO device and passed to +iio_buffer_register(). + +Fixes the follow NULL pointer derefernce kernel crash: + Unable to handle kernel NULL pointer dereference at virtual address 00000016 + pgd = d53d0000 + [00000016] *pgd=1534e831, *pte=00000000, *ppte=00000000 + Internal error: Oops: 17 [#1] PREEMPT SMP ARM + Modules linked in: + CPU: 1 PID: 1626 Comm: bash Not tainted 3.15.0-19969-g2a180eb-dirty #9545 + task: d6c124c0 ti: d539a000 task.ti: d539a000 + PC is at iio_compute_scan_bytes+0x34/0xa8 + LR is at iio_compute_scan_bytes+0x34/0xa8 + pc : [] lr : [] psr: 60070013 + sp : d539beb8 ip : 00000001 fp : 00000000 + r10: 00000002 r9 : 00000000 r8 : 00000001 + r7 : 00000000 r6 : d6dc8800 r5 : d7571000 r4 : 00000002 + r3 : d7571000 r2 : 00000044 r1 : 00000001 r0 : 00000000 + Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user + Control: 18c5387d Table: 153d004a DAC: 00000015 + Process bash (pid: 1626, stack limit = 0xd539a240) + Stack: (0xd539beb8 to 0xd539c000) + bea0: c02fc0e4 d7571000 + bec0: d76c1640 d6dc8800 d757117c 00000000 d757112c c0305b04 d76c1690 d76c1640 + bee0: d7571188 00000002 00000000 d7571000 d539a000 00000000 000dd1c8 c0305d54 + bf00: d7571010 0160b868 00000002 c69d3900 d7573278 d7573308 c69d3900 c01ece90 + bf20: 00000002 c0103fac c0103f6c d539bf88 00000002 c69d3b00 c69d3b0c c0103468 + bf40: 00000000 00000000 d7694a00 00000002 000af408 d539bf88 c000dd84 c00b2f94 + bf60: d7694a00 000af408 00000002 d7694a00 d7694a00 00000002 000af408 c000dd84 + bf80: 00000000 c00b32d0 00000000 00000000 00000002 b6f1aa78 00000002 000af408 + bfa0: 00000004 c000dc00 b6f1aa78 00000002 00000001 000af408 00000002 00000000 + bfc0: b6f1aa78 00000002 000af408 00000004 be806a4c 000a6094 00000000 000dd1c8 + bfe0: 00000000 be8069cc b6e8ab77 b6ec125c 40070010 00000001 22940489 154a5007 + [] (iio_compute_scan_bytes) from [] (__iio_update_buffers+0x248/0x438) + [] (__iio_update_buffers) from [] (iio_buffer_store_enable+0x60/0x7c) + [] (iio_buffer_store_enable) from [] (dev_attr_store+0x18/0x24) + [] (dev_attr_store) from [] (sysfs_kf_write+0x40/0x4c) + [] (sysfs_kf_write) from [] (kernfs_fop_write+0x110/0x154) + [] (kernfs_fop_write) from [] (vfs_write+0xd0/0x160) + [] (vfs_write) from [] (SyS_write+0x40/0x78) + [] (SyS_write) from [] (ret_fast_syscall+0x0/0x30) + Code: ea00000e e1a01008 e1a00005 ebfff6fc (e5d0a016) + +Fixes: 959d2952d124 ("staging:iio: make iio_sw_buffer_preenable much more general.") +Signed-off-by: Lars-Peter Clausen +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/iio/impedance-analyzer/ad5933.c | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +--- a/drivers/staging/iio/impedance-analyzer/ad5933.c ++++ b/drivers/staging/iio/impedance-analyzer/ad5933.c +@@ -115,6 +115,7 @@ static const struct iio_chan_spec ad5933 + .channel = 0, + .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), + .address = AD5933_REG_TEMP_DATA, ++ .scan_index = -1, + .scan_type = { + .sign = 's', + .realbits = 14, +@@ -125,8 +126,6 @@ static const struct iio_chan_spec ad5933 + .indexed = 1, + .channel = 0, + .extend_name = "real_raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | +- BIT(IIO_CHAN_INFO_SCALE), + .address = AD5933_REG_REAL_DATA, + .scan_index = 0, + .scan_type = { +@@ -139,8 +138,6 @@ static const struct iio_chan_spec ad5933 + .indexed = 1, + .channel = 0, + .extend_name = "imag_raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | +- BIT(IIO_CHAN_INFO_SCALE), + .address = AD5933_REG_IMAG_DATA, + .scan_index = 1, + .scan_type = { +@@ -748,14 +745,14 @@ static int ad5933_probe(struct i2c_clien + indio_dev->name = id->name; + indio_dev->modes = INDIO_DIRECT_MODE; + indio_dev->channels = ad5933_channels; +- indio_dev->num_channels = 1; /* only register temp0_input */ ++ indio_dev->num_channels = ARRAY_SIZE(ad5933_channels); + + ret = ad5933_register_ring_funcs_and_init(indio_dev); + if (ret) + goto error_disable_reg; + +- /* skip temp0_input, register in0_(real|imag)_raw */ +- ret = iio_buffer_register(indio_dev, &ad5933_channels[1], 2); ++ ret = iio_buffer_register(indio_dev, ad5933_channels, ++ ARRAY_SIZE(ad5933_channels)); + if (ret) + goto error_unreg_ring; + diff --git a/queue-3.17/staging-iio-ade7758-fix-check-if-channels-are-enabled-in-prenable.patch b/queue-3.17/staging-iio-ade7758-fix-check-if-channels-are-enabled-in-prenable.patch new file mode 100644 index 00000000000..80e2580d183 --- /dev/null +++ b/queue-3.17/staging-iio-ade7758-fix-check-if-channels-are-enabled-in-prenable.patch @@ -0,0 +1,31 @@ +From 79fa64eb2ee8ccb4bcad7f54caa2699730b10b22 Mon Sep 17 00:00:00 2001 +From: Lars-Peter Clausen +Date: Tue, 4 Nov 2014 18:03:15 +0100 +Subject: staging:iio:ade7758: Fix check if channels are enabled in prenable + +From: Lars-Peter Clausen + +commit 79fa64eb2ee8ccb4bcad7f54caa2699730b10b22 upstream. + +We should check if a channel is enabled, not if no channels are enabled. + +Fixes: 550268ca1111 ("staging:iio: scrap scan_count and ensure all drivers use active_scan_mask") +Signed-off-by: Lars-Peter Clausen +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/iio/meter/ade7758_ring.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/iio/meter/ade7758_ring.c ++++ b/drivers/staging/iio/meter/ade7758_ring.c +@@ -87,7 +87,7 @@ static int ade7758_ring_preenable(struct + { + unsigned channel; + +- if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength)) ++ if (bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength)) + return -EINVAL; + + channel = find_first_bit(indio_dev->active_scan_mask, diff --git a/queue-3.17/staging-iio-ade7758-fix-null-pointer-deref-when-enabling-buffer.patch b/queue-3.17/staging-iio-ade7758-fix-null-pointer-deref-when-enabling-buffer.patch new file mode 100644 index 00000000000..8aa27210f8e --- /dev/null +++ b/queue-3.17/staging-iio-ade7758-fix-null-pointer-deref-when-enabling-buffer.patch @@ -0,0 +1,256 @@ +From e10554738cab4224e097c2f9d975ea781a4fcde4 Mon Sep 17 00:00:00 2001 +From: Lars-Peter Clausen +Date: Tue, 4 Nov 2014 18:03:14 +0100 +Subject: staging:iio:ade7758: Fix NULL pointer deref when enabling buffer + +From: Lars-Peter Clausen + +commit e10554738cab4224e097c2f9d975ea781a4fcde4 upstream. + +In older versions of the IIO framework it was possible to pass a completely +different set of channels to iio_buffer_register() as the one that is +assigned to the IIO device. Commit 959d2952d124 ("staging:iio: make +iio_sw_buffer_preenable much more general.") introduced a restriction that +requires that the set of channels that is passed to iio_buffer_register() is +a subset of the channels assigned to the IIO device as the IIO core will use +the list of channels that is assigned to the device to lookup a channel by +scan index in iio_compute_scan_bytes(). If it can not find the channel the +function will crash. This patch fixes the issue by making sure that the same +set of channels is assigned to the IIO device and passed to +iio_buffer_register(). + +Note that we need to remove the IIO_CHAN_INFO_RAW and IIO_CHAN_INFO_SCALE +info attributes from the channels since we don't actually want those to be +registered. + +Fixes the following crash: + Unable to handle kernel NULL pointer dereference at virtual address 00000016 + pgd = d2094000 + [00000016] *pgd=16e39831, *pte=00000000, *ppte=00000000 + Internal error: Oops: 17 [#1] PREEMPT SMP ARM + Modules linked in: + CPU: 1 PID: 1695 Comm: bash Not tainted 3.17.0-06329-g29461ee #9686 + task: d7768040 ti: d5bd4000 task.ti: d5bd4000 + PC is at iio_compute_scan_bytes+0x38/0xc0 + LR is at iio_compute_scan_bytes+0x34/0xc0 + pc : [] lr : [] psr: 60070013 + sp : d5bd5ec0 ip : 00000000 fp : 00000000 + r10: d769f934 r9 : 00000000 r8 : 00000001 + r7 : 00000000 r6 : c8fc6240 r5 : d769f800 r4 : 00000000 + r3 : d769f800 r2 : 00000000 r1 : ffffffff r0 : 00000000 + Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user + Control: 18c5387d Table: 1209404a DAC: 00000015 + Process bash (pid: 1695, stack limit = 0xd5bd4240) + Stack: (0xd5bd5ec0 to 0xd5bd6000) + 5ec0: d769f800 d7435640 c8fc6240 d769f984 00000000 c03175a4 d7435690 d7435640 + 5ee0: d769f990 00000002 00000000 d769f800 d5bd4000 00000000 000b43a8 c03177f4 + 5f00: d769f810 0162b8c8 00000002 c8fc7e00 d77f1d08 d77f1da8 c8fc7e00 c01faf1c + 5f20: 00000002 c010694c c010690c d5bd5f88 00000002 c8fc6840 c8fc684c c0105e08 + 5f40: 00000000 00000000 d20d1580 00000002 000af408 d5bd5f88 c000de84 c00b76d4 + 5f60: d20d1580 000af408 00000002 d20d1580 d20d1580 00000002 000af408 c000de84 + 5f80: 00000000 c00b7a44 00000000 00000000 00000002 b6ebea78 00000002 000af408 + 5fa0: 00000004 c000dd00 b6ebea78 00000002 00000001 000af408 00000002 00000000 + 5fc0: b6ebea78 00000002 000af408 00000004 bee96a4c 000a6094 00000000 000b43a8 + 5fe0: 00000000 bee969cc b6e2eb77 b6e6525c 40070010 00000001 00000000 00000000 + [] (iio_compute_scan_bytes) from [] (__iio_update_buffers+0x248/0x438) + [] (__iio_update_buffers) from [] (iio_buffer_store_enable+0x60/0x7c) + [] (iio_buffer_store_enable) from [] (dev_attr_store+0x18/0x24) + [] (dev_attr_store) from [] (sysfs_kf_write+0x40/0x4c) + [] (sysfs_kf_write) from [] (kernfs_fop_write+0x110/0x154) + [] (kernfs_fop_write) from [] (vfs_write+0xbc/0x170) + [] (vfs_write) from [] (SyS_write+0x40/0x78) + [] (SyS_write) from [] (ret_fast_syscall+0x0/0x30) + +Fixes: 959d2952d124 ("staging:iio: make iio_sw_buffer_preenable much more general.") +Signed-off-by: Lars-Peter Clausen +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/iio/meter/ade7758.h | 1 + drivers/staging/iio/meter/ade7758_core.c | 33 +------------------------------ + drivers/staging/iio/meter/ade7758_ring.c | 3 -- + 3 files changed, 3 insertions(+), 34 deletions(-) + +--- a/drivers/staging/iio/meter/ade7758.h ++++ b/drivers/staging/iio/meter/ade7758.h +@@ -119,7 +119,6 @@ struct ade7758_state { + u8 *tx; + u8 *rx; + struct mutex buf_lock; +- const struct iio_chan_spec *ade7758_ring_channels; + struct spi_transfer ring_xfer[4]; + struct spi_message ring_msg; + /* +--- a/drivers/staging/iio/meter/ade7758_core.c ++++ b/drivers/staging/iio/meter/ade7758_core.c +@@ -631,8 +631,6 @@ static const struct iio_chan_spec ade775 + .indexed = 1, + .channel = 0, + .extend_name = "raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), +- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), + .address = AD7758_WT(AD7758_PHASE_A, AD7758_VOLTAGE), + .scan_index = 0, + .scan_type = { +@@ -645,8 +643,6 @@ static const struct iio_chan_spec ade775 + .indexed = 1, + .channel = 0, + .extend_name = "raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), +- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), + .address = AD7758_WT(AD7758_PHASE_A, AD7758_CURRENT), + .scan_index = 1, + .scan_type = { +@@ -659,8 +655,6 @@ static const struct iio_chan_spec ade775 + .indexed = 1, + .channel = 0, + .extend_name = "apparent_raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), +- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), + .address = AD7758_WT(AD7758_PHASE_A, AD7758_APP_PWR), + .scan_index = 2, + .scan_type = { +@@ -673,8 +667,6 @@ static const struct iio_chan_spec ade775 + .indexed = 1, + .channel = 0, + .extend_name = "active_raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), +- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), + .address = AD7758_WT(AD7758_PHASE_A, AD7758_ACT_PWR), + .scan_index = 3, + .scan_type = { +@@ -687,8 +679,6 @@ static const struct iio_chan_spec ade775 + .indexed = 1, + .channel = 0, + .extend_name = "reactive_raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), +- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), + .address = AD7758_WT(AD7758_PHASE_A, AD7758_REACT_PWR), + .scan_index = 4, + .scan_type = { +@@ -701,8 +691,6 @@ static const struct iio_chan_spec ade775 + .indexed = 1, + .channel = 1, + .extend_name = "raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), +- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), + .address = AD7758_WT(AD7758_PHASE_B, AD7758_VOLTAGE), + .scan_index = 5, + .scan_type = { +@@ -715,8 +703,6 @@ static const struct iio_chan_spec ade775 + .indexed = 1, + .channel = 1, + .extend_name = "raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), +- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), + .address = AD7758_WT(AD7758_PHASE_B, AD7758_CURRENT), + .scan_index = 6, + .scan_type = { +@@ -729,8 +715,6 @@ static const struct iio_chan_spec ade775 + .indexed = 1, + .channel = 1, + .extend_name = "apparent_raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), +- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), + .address = AD7758_WT(AD7758_PHASE_B, AD7758_APP_PWR), + .scan_index = 7, + .scan_type = { +@@ -743,8 +727,6 @@ static const struct iio_chan_spec ade775 + .indexed = 1, + .channel = 1, + .extend_name = "active_raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), +- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), + .address = AD7758_WT(AD7758_PHASE_B, AD7758_ACT_PWR), + .scan_index = 8, + .scan_type = { +@@ -757,8 +739,6 @@ static const struct iio_chan_spec ade775 + .indexed = 1, + .channel = 1, + .extend_name = "reactive_raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), +- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), + .address = AD7758_WT(AD7758_PHASE_B, AD7758_REACT_PWR), + .scan_index = 9, + .scan_type = { +@@ -771,8 +751,6 @@ static const struct iio_chan_spec ade775 + .indexed = 1, + .channel = 2, + .extend_name = "raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), +- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), + .address = AD7758_WT(AD7758_PHASE_C, AD7758_VOLTAGE), + .scan_index = 10, + .scan_type = { +@@ -785,8 +763,6 @@ static const struct iio_chan_spec ade775 + .indexed = 1, + .channel = 2, + .extend_name = "raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), +- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), + .address = AD7758_WT(AD7758_PHASE_C, AD7758_CURRENT), + .scan_index = 11, + .scan_type = { +@@ -799,8 +775,6 @@ static const struct iio_chan_spec ade775 + .indexed = 1, + .channel = 2, + .extend_name = "apparent_raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), +- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), + .address = AD7758_WT(AD7758_PHASE_C, AD7758_APP_PWR), + .scan_index = 12, + .scan_type = { +@@ -813,8 +787,6 @@ static const struct iio_chan_spec ade775 + .indexed = 1, + .channel = 2, + .extend_name = "active_raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), +- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), + .address = AD7758_WT(AD7758_PHASE_C, AD7758_ACT_PWR), + .scan_index = 13, + .scan_type = { +@@ -827,8 +799,6 @@ static const struct iio_chan_spec ade775 + .indexed = 1, + .channel = 2, + .extend_name = "reactive_raw", +- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), +- .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), + .address = AD7758_WT(AD7758_PHASE_C, AD7758_REACT_PWR), + .scan_index = 14, + .scan_type = { +@@ -869,13 +839,14 @@ static int ade7758_probe(struct spi_devi + goto error_free_rx; + } + st->us = spi; +- st->ade7758_ring_channels = &ade7758_channels[0]; + mutex_init(&st->buf_lock); + + indio_dev->name = spi->dev.driver->name; + indio_dev->dev.parent = &spi->dev; + indio_dev->info = &ade7758_info; + indio_dev->modes = INDIO_DIRECT_MODE; ++ indio_dev->channels = ade7758_channels; ++ indio_dev->num_channels = ARRAY_SIZE(ade7758_channels); + + ret = ade7758_configure_ring(indio_dev); + if (ret) +--- a/drivers/staging/iio/meter/ade7758_ring.c ++++ b/drivers/staging/iio/meter/ade7758_ring.c +@@ -85,7 +85,6 @@ static irqreturn_t ade7758_trigger_handl + **/ + static int ade7758_ring_preenable(struct iio_dev *indio_dev) + { +- struct ade7758_state *st = iio_priv(indio_dev); + unsigned channel; + + if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength)) +@@ -95,7 +94,7 @@ static int ade7758_ring_preenable(struct + indio_dev->masklength); + + ade7758_write_waveform_type(&indio_dev->dev, +- st->ade7758_ring_channels[channel].address); ++ indio_dev->channels[channel].address); + + return 0; + } diff --git a/queue-3.17/staging-iio-ade7758-remove-raw-from-channel-name.patch b/queue-3.17/staging-iio-ade7758-remove-raw-from-channel-name.patch new file mode 100644 index 00000000000..261680f145c --- /dev/null +++ b/queue-3.17/staging-iio-ade7758-remove-raw-from-channel-name.patch @@ -0,0 +1,151 @@ +From b598aacc29331e7e638cd509108600e916c6331b Mon Sep 17 00:00:00 2001 +From: Lars-Peter Clausen +Date: Tue, 4 Nov 2014 18:03:16 +0100 +Subject: staging:iio:ade7758: Remove "raw" from channel name + +From: Lars-Peter Clausen + +commit b598aacc29331e7e638cd509108600e916c6331b upstream. + +"raw" is a property of a channel, but should not be part of the name of +channel. + +Signed-off-by: Lars-Peter Clausen +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/iio/meter/ade7758_core.c | 24 +++++++++--------------- + 1 file changed, 9 insertions(+), 15 deletions(-) + +--- a/drivers/staging/iio/meter/ade7758_core.c ++++ b/drivers/staging/iio/meter/ade7758_core.c +@@ -630,7 +630,6 @@ static const struct iio_chan_spec ade775 + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = 0, +- .extend_name = "raw", + .address = AD7758_WT(AD7758_PHASE_A, AD7758_VOLTAGE), + .scan_index = 0, + .scan_type = { +@@ -642,7 +641,6 @@ static const struct iio_chan_spec ade775 + .type = IIO_CURRENT, + .indexed = 1, + .channel = 0, +- .extend_name = "raw", + .address = AD7758_WT(AD7758_PHASE_A, AD7758_CURRENT), + .scan_index = 1, + .scan_type = { +@@ -654,7 +652,7 @@ static const struct iio_chan_spec ade775 + .type = IIO_POWER, + .indexed = 1, + .channel = 0, +- .extend_name = "apparent_raw", ++ .extend_name = "apparent", + .address = AD7758_WT(AD7758_PHASE_A, AD7758_APP_PWR), + .scan_index = 2, + .scan_type = { +@@ -666,7 +664,7 @@ static const struct iio_chan_spec ade775 + .type = IIO_POWER, + .indexed = 1, + .channel = 0, +- .extend_name = "active_raw", ++ .extend_name = "active", + .address = AD7758_WT(AD7758_PHASE_A, AD7758_ACT_PWR), + .scan_index = 3, + .scan_type = { +@@ -678,7 +676,7 @@ static const struct iio_chan_spec ade775 + .type = IIO_POWER, + .indexed = 1, + .channel = 0, +- .extend_name = "reactive_raw", ++ .extend_name = "reactive", + .address = AD7758_WT(AD7758_PHASE_A, AD7758_REACT_PWR), + .scan_index = 4, + .scan_type = { +@@ -690,7 +688,6 @@ static const struct iio_chan_spec ade775 + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = 1, +- .extend_name = "raw", + .address = AD7758_WT(AD7758_PHASE_B, AD7758_VOLTAGE), + .scan_index = 5, + .scan_type = { +@@ -702,7 +699,6 @@ static const struct iio_chan_spec ade775 + .type = IIO_CURRENT, + .indexed = 1, + .channel = 1, +- .extend_name = "raw", + .address = AD7758_WT(AD7758_PHASE_B, AD7758_CURRENT), + .scan_index = 6, + .scan_type = { +@@ -714,7 +710,7 @@ static const struct iio_chan_spec ade775 + .type = IIO_POWER, + .indexed = 1, + .channel = 1, +- .extend_name = "apparent_raw", ++ .extend_name = "apparent", + .address = AD7758_WT(AD7758_PHASE_B, AD7758_APP_PWR), + .scan_index = 7, + .scan_type = { +@@ -726,7 +722,7 @@ static const struct iio_chan_spec ade775 + .type = IIO_POWER, + .indexed = 1, + .channel = 1, +- .extend_name = "active_raw", ++ .extend_name = "active", + .address = AD7758_WT(AD7758_PHASE_B, AD7758_ACT_PWR), + .scan_index = 8, + .scan_type = { +@@ -738,7 +734,7 @@ static const struct iio_chan_spec ade775 + .type = IIO_POWER, + .indexed = 1, + .channel = 1, +- .extend_name = "reactive_raw", ++ .extend_name = "reactive", + .address = AD7758_WT(AD7758_PHASE_B, AD7758_REACT_PWR), + .scan_index = 9, + .scan_type = { +@@ -750,7 +746,6 @@ static const struct iio_chan_spec ade775 + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = 2, +- .extend_name = "raw", + .address = AD7758_WT(AD7758_PHASE_C, AD7758_VOLTAGE), + .scan_index = 10, + .scan_type = { +@@ -762,7 +757,6 @@ static const struct iio_chan_spec ade775 + .type = IIO_CURRENT, + .indexed = 1, + .channel = 2, +- .extend_name = "raw", + .address = AD7758_WT(AD7758_PHASE_C, AD7758_CURRENT), + .scan_index = 11, + .scan_type = { +@@ -774,7 +768,7 @@ static const struct iio_chan_spec ade775 + .type = IIO_POWER, + .indexed = 1, + .channel = 2, +- .extend_name = "apparent_raw", ++ .extend_name = "apparent", + .address = AD7758_WT(AD7758_PHASE_C, AD7758_APP_PWR), + .scan_index = 12, + .scan_type = { +@@ -786,7 +780,7 @@ static const struct iio_chan_spec ade775 + .type = IIO_POWER, + .indexed = 1, + .channel = 2, +- .extend_name = "active_raw", ++ .extend_name = "active", + .address = AD7758_WT(AD7758_PHASE_C, AD7758_ACT_PWR), + .scan_index = 13, + .scan_type = { +@@ -798,7 +792,7 @@ static const struct iio_chan_spec ade775 + .type = IIO_POWER, + .indexed = 1, + .channel = 2, +- .extend_name = "reactive_raw", ++ .extend_name = "reactive", + .address = AD7758_WT(AD7758_PHASE_C, AD7758_REACT_PWR), + .scan_index = 14, + .scan_type = { diff --git a/queue-3.17/uas-add-no_ata_1x-for-via-vl711-devices.patch b/queue-3.17/uas-add-no_ata_1x-for-via-vl711-devices.patch new file mode 100644 index 00000000000..5ecec427af8 --- /dev/null +++ b/queue-3.17/uas-add-no_ata_1x-for-via-vl711-devices.patch @@ -0,0 +1,32 @@ +From 673029fe9c16c95600bdaca4760673527af32edf Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 9 Oct 2014 17:27:56 +0200 +Subject: uas: Add NO_ATA_1X for VIA VL711 devices + +From: Hans de Goede + +commit 673029fe9c16c95600bdaca4760673527af32edf upstream. + +Just like some Seagate enclosures, these devices do not seem to grok ata +pass through commands. + +Signed-off-by: Hans de Goede +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/storage/unusual_uas.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/usb/storage/unusual_uas.h ++++ b/drivers/usb/storage/unusual_uas.h +@@ -75,3 +75,10 @@ UNUSUAL_DEV(0x174c, 0x5106, 0x0000, 0x99 + "ASM1051", + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_IGNORE_UAS), ++ ++/* Reported-by: Hans de Goede */ ++UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999, ++ "VIA", ++ "VL711", ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL, ++ US_FL_NO_ATA_1X), diff --git a/queue-3.17/uas-add-us_fl_no_ata_1x-quirk-for-1-more-seagate-model.patch b/queue-3.17/uas-add-us_fl_no_ata_1x-quirk-for-1-more-seagate-model.patch new file mode 100644 index 00000000000..acbfacd87de --- /dev/null +++ b/queue-3.17/uas-add-us_fl_no_ata_1x-quirk-for-1-more-seagate-model.patch @@ -0,0 +1,35 @@ +From aee0ce3ae73c566ace9958302e001d3cbbb0a623 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 31 Oct 2014 14:37:32 +0100 +Subject: uas: Add US_FL_NO_ATA_1X quirk for 1 more Seagate model + +From: Hans de Goede + +commit aee0ce3ae73c566ace9958302e001d3cbbb0a623 upstream. + +These drives hang when receiving ATA12 commands, so set the US_FL_NO_ATA_1X +quirk to filter these out. + +Signed-off-by: Hans de Goede +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/storage/unusual_uas.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/usb/storage/unusual_uas.h ++++ b/drivers/usb/storage/unusual_uas.h +@@ -75,6 +75,13 @@ UNUSUAL_DEV(0x0bc2, 0xab20, 0x0000, 0x99 + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_NO_ATA_1X), + ++/* https://bbs.archlinux.org/viewtopic.php?id=183190 */ ++UNUSUAL_DEV(0x0bc2, 0xab21, 0x0000, 0x9999, ++ "Seagate", ++ "Backup+ BK", ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL, ++ US_FL_NO_ATA_1X), ++ + /* Reported-by: Claudio Bizzarri */ + UNUSUAL_DEV(0x152d, 0x0567, 0x0000, 0x9999, + "JMicron", diff --git a/queue-3.17/uas-add-us_fl_no_ata_1x-quirk-for-2-more-seagate-models.patch b/queue-3.17/uas-add-us_fl_no_ata_1x-quirk-for-2-more-seagate-models.patch new file mode 100644 index 00000000000..14cf9b2cbe1 --- /dev/null +++ b/queue-3.17/uas-add-us_fl_no_ata_1x-quirk-for-2-more-seagate-models.patch @@ -0,0 +1,42 @@ +From d1d9548256fbdf2e049d6413a5266c41e73658ee Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 23 Oct 2014 14:40:57 +0200 +Subject: uas: Add US_FL_NO_ATA_1X quirk for 2 more Seagate models + +From: Hans de Goede + +commit d1d9548256fbdf2e049d6413a5266c41e73658ee upstream. + +These drives hang when receiving ATA12 commands, so set the US_FL_NO_ATA_1X +quirk to filter these out. + +Signed-off-by: Hans de Goede +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/storage/unusual_uas.h | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/drivers/usb/storage/unusual_uas.h ++++ b/drivers/usb/storage/unusual_uas.h +@@ -54,6 +54,20 @@ UNUSUAL_DEV(0x0bc2, 0x3312, 0x0000, 0x99 + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_NO_ATA_1X), + ++/* Reported-by: Hans de Goede */ ++UNUSUAL_DEV(0x0bc2, 0x3320, 0x0000, 0x9999, ++ "Seagate", ++ "Expansion Desk", ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL, ++ US_FL_NO_ATA_1X), ++ ++/* Reported-by: Bogdan Mihalcea */ ++UNUSUAL_DEV(0x0bc2, 0xa003, 0x0000, 0x9999, ++ "Seagate", ++ "Backup Plus", ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL, ++ US_FL_NO_ATA_1X), ++ + /* https://bbs.archlinux.org/viewtopic.php?id=183190 */ + UNUSUAL_DEV(0x0bc2, 0xab20, 0x0000, 0x9999, + "Seagate", diff --git a/queue-3.17/usb-cdc-acm-add-device-id-for-gw-instek-afg-2225.patch b/queue-3.17/usb-cdc-acm-add-device-id-for-gw-instek-afg-2225.patch new file mode 100644 index 00000000000..96c24c39054 --- /dev/null +++ b/queue-3.17/usb-cdc-acm-add-device-id-for-gw-instek-afg-2225.patch @@ -0,0 +1,30 @@ +From cf84a691a61606a2e7269907d3727e2d9fa148ee Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Mon, 27 Oct 2014 18:34:33 +0100 +Subject: USB: cdc-acm: add device id for GW Instek AFG-2225 + +From: Johan Hovold + +commit cf84a691a61606a2e7269907d3727e2d9fa148ee upstream. + +Add device-id entry for GW Instek AFG-2225, which has a byte swapped +bInterfaceSubClass (0x20). + +Reported-by: Karl Palsson +Signed-off-by: Johan Hovold +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 +@@ -1681,6 +1681,7 @@ static const struct usb_device_id acm_id + { USB_DEVICE(0x0572, 0x1328), /* Shiro / Aztech USB MODEM UM-3100 */ + .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ + }, ++ { USB_DEVICE(0x2184, 0x001c) }, /* GW Instek AFG-2225 */ + { USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */ + }, + /* Motorola H24 HSPA module: */ diff --git a/queue-3.17/usb-cdc-acm-add-quirk-for-control-line-state-requests.patch b/queue-3.17/usb-cdc-acm-add-quirk-for-control-line-state-requests.patch new file mode 100644 index 00000000000..21e53ce897c --- /dev/null +++ b/queue-3.17/usb-cdc-acm-add-quirk-for-control-line-state-requests.patch @@ -0,0 +1,84 @@ +From 2a8cdfde9237c4e1bd7c2e68c415b006491d23cc Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Thu, 6 Nov 2014 18:08:33 +0100 +Subject: USB: cdc-acm: add quirk for control-line state requests + +From: Johan Hovold + +commit 2a8cdfde9237c4e1bd7c2e68c415b006491d23cc upstream. + +Add new quirk for devices that cannot handle control-line state +requests. + +Note that we currently send these requests to all devices, regardless of +whether they claim to support it, but that errors are only logged if +support is claimed. + +Since commit 0943d8ead30e ("USB: cdc-acm: use tty-port dtr_rts"), which +only changed the timings for these requests slightly, this has been +reported to cause occasional firmware crashes on Simtec Electronics +Entropy Key devices after re-enumeration. Enable the quirk for this +device. + +Reported-by: Nix +Tested-by: Nix +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/class/cdc-acm.c | 14 ++++++++++++-- + drivers/usb/class/cdc-acm.h | 2 ++ + 2 files changed, 14 insertions(+), 2 deletions(-) + +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -145,8 +145,15 @@ static int acm_ctrl_msg(struct acm *acm, + /* devices aren't required to support these requests. + * the cdc acm descriptor tells whether they do... + */ +-#define acm_set_control(acm, control) \ +- acm_ctrl_msg(acm, USB_CDC_REQ_SET_CONTROL_LINE_STATE, control, NULL, 0) ++static inline int acm_set_control(struct acm *acm, int control) ++{ ++ if (acm->quirks & QUIRK_CONTROL_LINE_STATE) ++ return -EOPNOTSUPP; ++ ++ return acm_ctrl_msg(acm, USB_CDC_REQ_SET_CONTROL_LINE_STATE, ++ control, NULL, 0); ++} ++ + #define acm_set_line(acm, line) \ + acm_ctrl_msg(acm, USB_CDC_REQ_SET_LINE_CODING, 0, line, sizeof *(line)) + #define acm_send_break(acm, ms) \ +@@ -1315,6 +1322,7 @@ made_compressed_probe: + tty_port_init(&acm->port); + acm->port.ops = &acm_port_ops; + init_usb_anchor(&acm->delayed); ++ acm->quirks = quirks; + + buf = usb_alloc_coherent(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma); + if (!buf) { +@@ -1682,6 +1690,8 @@ static const struct usb_device_id acm_id + { USB_DEVICE(0x0572, 0x1328), /* Shiro / Aztech USB MODEM UM-3100 */ + .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ + }, ++ { USB_DEVICE(0x20df, 0x0001), /* Simtec Electronics Entropy Key */ ++ .driver_info = QUIRK_CONTROL_LINE_STATE, }, + { USB_DEVICE(0x2184, 0x001c) }, /* GW Instek AFG-2225 */ + { USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */ + }, +--- a/drivers/usb/class/cdc-acm.h ++++ b/drivers/usb/class/cdc-acm.h +@@ -121,6 +121,7 @@ struct acm { + unsigned int throttle_req:1; /* throttle requested */ + u8 bInterval; + struct usb_anchor delayed; /* writes queued for a device about to be woken */ ++ unsigned long quirks; + }; + + #define CDC_DATA_INTERFACE_TYPE 0x0a +@@ -132,3 +133,4 @@ struct acm { + #define NOT_A_MODEM BIT(3) + #define NO_DATA_INTERFACE BIT(4) + #define IGNORE_DEVICE BIT(5) ++#define QUIRK_CONTROL_LINE_STATE BIT(6) diff --git a/queue-3.17/usb-cdc-acm-only-raise-dtr-on-transitions-from-b0.patch b/queue-3.17/usb-cdc-acm-only-raise-dtr-on-transitions-from-b0.patch new file mode 100644 index 00000000000..48e65bda17e --- /dev/null +++ b/queue-3.17/usb-cdc-acm-only-raise-dtr-on-transitions-from-b0.patch @@ -0,0 +1,38 @@ +From 4473d054ceb572557954f9536731d39b20937b0c Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Wed, 5 Nov 2014 18:41:59 +0100 +Subject: USB: cdc-acm: only raise DTR on transitions from B0 + +From: Johan Hovold + +commit 4473d054ceb572557954f9536731d39b20937b0c upstream. + +Make sure to only raise DTR on transitions from B0 in set_termios. + +Also allow set_termios to be called from open with a termios_old of +NULL. Note that DTR will not be raised prematurely in this case. + +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/class/cdc-acm.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -980,11 +980,12 @@ static void acm_tty_set_termios(struct t + /* FIXME: Needs to clear unsupported bits in the termios */ + acm->clocal = ((termios->c_cflag & CLOCAL) != 0); + +- if (!newline.dwDTERate) { ++ if (C_BAUD(tty) == B0) { + newline.dwDTERate = acm->line.dwDTERate; + newctrl &= ~ACM_CTRL_DTR; +- } else ++ } else if (termios_old && (termios_old->c_cflag & CBAUD) == B0) { + newctrl |= ACM_CTRL_DTR; ++ } + + if (newctrl != acm->ctrlout) + acm_set_control(acm, acm->ctrlout = newctrl); diff --git a/queue-3.17/usb-chipidea-fix-oops-when-removing-the-ci_hdrc-module.patch b/queue-3.17/usb-chipidea-fix-oops-when-removing-the-ci_hdrc-module.patch new file mode 100644 index 00000000000..73c44d80295 --- /dev/null +++ b/queue-3.17/usb-chipidea-fix-oops-when-removing-the-ci_hdrc-module.patch @@ -0,0 +1,34 @@ +From 9680b60ed79edaf52f84b65cbb20859bbb26cb68 Mon Sep 17 00:00:00 2001 +From: Torsten Fleischer +Date: Sun, 26 Oct 2014 19:33:13 +0800 +Subject: usb: chipidea: Fix oops when removing the ci_hdrc module + +From: Torsten Fleischer + +commit 9680b60ed79edaf52f84b65cbb20859bbb26cb68 upstream. + +The call of 'kfree(ci->hw_bank.regmap)' in ci_hdrc_remove() sometimes causes +a kernel oops when removing the ci_hdrc module. + +Since there is no separate memory allocated for the ci->hw_bank.regmap array, +there is no need to free it. + +Signed-off-by: Torsten Fleischer +Signed-off-by: Peter Chen +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/chipidea/core.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/usb/chipidea/core.c ++++ b/drivers/usb/chipidea/core.c +@@ -732,7 +732,6 @@ static int ci_hdrc_remove(struct platfor + ci_role_destroy(ci); + ci_hdrc_enter_lpm(ci, true); + usb_phy_shutdown(ci->transceiver); +- kfree(ci->hw_bank.regmap); + + return 0; + } diff --git a/queue-3.17/usb-dwc3-gadget-properly-initialize-link-trb.patch b/queue-3.17/usb-dwc3-gadget-properly-initialize-link-trb.patch new file mode 100644 index 00000000000..44111c31d95 --- /dev/null +++ b/queue-3.17/usb-dwc3-gadget-properly-initialize-link-trb.patch @@ -0,0 +1,42 @@ +From 1200a82a59b6aa65758ccc92c3447b98c53cd7a2 Mon Sep 17 00:00:00 2001 +From: Jack Pham +Date: Tue, 21 Oct 2014 16:31:10 -0700 +Subject: usb: dwc3: gadget: Properly initialize LINK TRB + +From: Jack Pham + +commit 1200a82a59b6aa65758ccc92c3447b98c53cd7a2 upstream. + +On ISOC endpoints the last trb_pool entry used as a +LINK TRB is not getting zeroed out correctly due to +memset being called incorrectly and in the wrong place. +If pool allocated from DMA was not zero-initialized +to begin with this will result in the size and ctrl +values being random garbage. Call memset correctly after +assignment of the trb_link pointer. + +Fixes: f6bafc6a1c ("usb: dwc3: convert TRBs into bitshifts") +Signed-off-by: Jack Pham +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/dwc3/gadget.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/usb/dwc3/gadget.c ++++ b/drivers/usb/dwc3/gadget.c +@@ -615,12 +615,11 @@ static int __dwc3_gadget_ep_enable(struc + if (!usb_endpoint_xfer_isoc(desc)) + return 0; + +- memset(&trb_link, 0, sizeof(trb_link)); +- + /* Link TRB for ISOC. The HWO bit is never reset */ + trb_st_hw = &dep->trb_pool[0]; + + trb_link = &dep->trb_pool[DWC3_TRB_NUM - 1]; ++ memset(trb_link, 0, sizeof(*trb_link)); + + trb_link->bpl = lower_32_bits(dwc3_trb_dma_offset(dep, trb_st_hw)); + trb_link->bph = upper_32_bits(dwc3_trb_dma_offset(dep, trb_st_hw)); diff --git a/queue-3.17/usb-ffs-fix-regression-when-quirk_ep_out_aligned_size-flag-is-set.patch b/queue-3.17/usb-ffs-fix-regression-when-quirk_ep_out_aligned_size-flag-is-set.patch new file mode 100644 index 00000000000..9f902809183 --- /dev/null +++ b/queue-3.17/usb-ffs-fix-regression-when-quirk_ep_out_aligned_size-flag-is-set.patch @@ -0,0 +1,109 @@ +From c0d31b3c3d9a025b8d5a57c35671e60c5f388bf7 Mon Sep 17 00:00:00 2001 +From: David Cohen +Date: Mon, 13 Oct 2014 11:15:54 -0700 +Subject: usb: ffs: fix regression when quirk_ep_out_aligned_size flag is set + +From: David Cohen + +commit c0d31b3c3d9a025b8d5a57c35671e60c5f388bf7 upstream. + +The commit '2e4c7553cd usb: gadget: f_fs: add aio support' broke the +quirk implemented to align buffer size to maxpacketsize on out endpoint. +As result, functionfs does not work on Intel platforms using dwc3 driver +(i.e. Bay Trail and Merrifield). This patch fixes the issue. + +This code is based on a previous Qiuxu's patch. + +Fixes: 2e4c7553cd (usb: gadget: f_fs: add aio support) +Signed-off-by: David Cohen +Signed-off-by: Qiuxu Zhuo +Acked-by: Michal Nazarewicz +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/function/f_fs.c | 40 +++++++++++++++++++++++++++++++------ + 1 file changed, 34 insertions(+), 6 deletions(-) + +--- a/drivers/usb/gadget/function/f_fs.c ++++ b/drivers/usb/gadget/function/f_fs.c +@@ -648,15 +648,26 @@ static void ffs_user_copy_worker(struct + if (io_data->read && ret > 0) { + int i; + size_t pos = 0; ++ ++ /* ++ * Since req->length may be bigger than io_data->len (after ++ * being rounded up to maxpacketsize), we may end up with more ++ * data then user space has space for. ++ */ ++ ret = min_t(int, ret, io_data->len); ++ + use_mm(io_data->mm); + for (i = 0; i < io_data->nr_segs; i++) { ++ size_t len = min_t(size_t, ret - pos, ++ io_data->iovec[i].iov_len); ++ if (!len) ++ break; + if (unlikely(copy_to_user(io_data->iovec[i].iov_base, +- &io_data->buf[pos], +- io_data->iovec[i].iov_len))) { ++ &io_data->buf[pos], len))) { + ret = -EFAULT; + break; + } +- pos += io_data->iovec[i].iov_len; ++ pos += len; + } + unuse_mm(io_data->mm); + } +@@ -688,7 +699,7 @@ static ssize_t ffs_epfile_io(struct file + struct ffs_epfile *epfile = file->private_data; + struct ffs_ep *ep; + char *data = NULL; +- ssize_t ret, data_len; ++ ssize_t ret, data_len = -EINVAL; + int halt; + + /* Are we still active? */ +@@ -788,13 +799,30 @@ static ssize_t ffs_epfile_io(struct file + /* Fire the request */ + struct usb_request *req; + ++ /* ++ * Sanity Check: even though data_len can't be used ++ * uninitialized at the time I write this comment, some ++ * compilers complain about this situation. ++ * In order to keep the code clean from warnings, data_len is ++ * being initialized to -EINVAL during its declaration, which ++ * means we can't rely on compiler anymore to warn no future ++ * changes won't result in data_len being used uninitialized. ++ * For such reason, we're adding this redundant sanity check ++ * here. ++ */ ++ if (unlikely(data_len == -EINVAL)) { ++ WARN(1, "%s: data_len == -EINVAL\n", __func__); ++ ret = -EINVAL; ++ goto error_lock; ++ } ++ + if (io_data->aio) { + req = usb_ep_alloc_request(ep->ep, GFP_KERNEL); + if (unlikely(!req)) + goto error_lock; + + req->buf = data; +- req->length = io_data->len; ++ req->length = data_len; + + io_data->buf = data; + io_data->ep = ep->ep; +@@ -816,7 +844,7 @@ static ssize_t ffs_epfile_io(struct file + + req = ep->req; + req->buf = data; +- req->length = io_data->len; ++ req->length = data_len; + + req->context = &done; + req->complete = ffs_epfile_io_complete; diff --git a/queue-3.17/usb-gadget-f_fs-remove-redundant-ffs_data_get.patch b/queue-3.17/usb-gadget-f_fs-remove-redundant-ffs_data_get.patch new file mode 100644 index 00000000000..0fe925b35dd --- /dev/null +++ b/queue-3.17/usb-gadget-f_fs-remove-redundant-ffs_data_get.patch @@ -0,0 +1,40 @@ +From a3058a5d82e296daaca07411c3738a9ddd79f302 Mon Sep 17 00:00:00 2001 +From: Robert Baldyga +Date: Thu, 9 Oct 2014 09:41:16 +0200 +Subject: usb: gadget: f_fs: remove redundant ffs_data_get() + +From: Robert Baldyga + +commit a3058a5d82e296daaca07411c3738a9ddd79f302 upstream. + +During FunctionFS bind, ffs_data_get() function was called twice +(in functionfs_bind() and in ffs_do_functionfs_bind()), while on unbind +ffs_data_put() was called once (in functionfs_unbind() function). +In result refcount never reached value 0, and ffs memory resources has +been never released. + +Since ffs_data_get() call in ffs_do_functionfs_bind() is redundant +and not neccessary, we remove it to have equal number of gets ans puts, +and free allocated memory after refcount reach 0. + +Fixes: 5920cda (usb: gadget: FunctionFS: convert to new function + interface with backward compatibility) +Signed-off-by: Robert Baldyga +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/function/f_fs.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/usb/gadget/function/f_fs.c ++++ b/drivers/usb/gadget/function/f_fs.c +@@ -2626,8 +2626,6 @@ static inline struct f_fs_opts *ffs_do_f + func->conf = c; + func->gadget = c->cdev->gadget; + +- ffs_data_get(func->ffs); +- + /* + * in drivers/usb/gadget/configfs.c:configfs_composite_bind() + * configurations are bound in sequence with list_for_each_entry, diff --git a/queue-3.17/usb-musb-cppi41-restart-hrtimer-only-if-not-yet-done.patch b/queue-3.17/usb-musb-cppi41-restart-hrtimer-only-if-not-yet-done.patch new file mode 100644 index 00000000000..c2e46cb3110 --- /dev/null +++ b/queue-3.17/usb-musb-cppi41-restart-hrtimer-only-if-not-yet-done.patch @@ -0,0 +1,63 @@ +From d2e6d62c9cbbc2da4211f672dbeea08960e29a80 Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner +Date: Thu, 2 Oct 2014 17:32:16 +0200 +Subject: usb: musb: cppi41: restart hrtimer only if not yet done + +From: Thomas Gleixner + +commit d2e6d62c9cbbc2da4211f672dbeea08960e29a80 upstream. + +commit c58d80f52 ("usb: musb: Ensure that cppi41 timer gets armed on +premature DMA TX irq") fixed hrtimer scheduling bug. There is one left +which does not trigger that often. +The following scenario is still possible: + + lock(&x->lock); + hrtimer_start(&x->t); + unlock(&x->lock); + +expires: + t->function(); + lock(&x->lock); + lock(&x->lock); if (!hrtimer_queued(&x->t)) + hrtimer_start(&x->t); + unlock(&x->lock); + + if (!list_empty(x->early_tx_list)) + ret = HRTIMER_RESTART; +-> hrtimer_forward_now(...) + } else + ret = HRTIMER_NORESTART; + + unlock(&x->lock); + +and the timer callback returns HRTIMER_RESTART for an armed timer. This +is wrong and we run into the BUG_ON() in __run_hrtimer(). +This can happens on SMP or PREEMPT-RT. +The patch fixes the problem by only starting the timer if the timer is +not yet queued. + +Reported-by: Torben Hohn +Signed-off-by: Thomas Gleixner +[bigeasy: collected information and created a patch + description based + on it] +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/musb/musb_cppi41.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/usb/musb/musb_cppi41.c ++++ b/drivers/usb/musb/musb_cppi41.c +@@ -209,7 +209,8 @@ static enum hrtimer_restart cppi41_reche + } + } + +- if (!list_empty(&controller->early_tx_list)) { ++ if (!list_empty(&controller->early_tx_list) && ++ !hrtimer_is_queued(&controller->early_tx)) { + ret = HRTIMER_RESTART; + hrtimer_forward_now(&controller->early_tx, + ktime_set(0, 50 * NSEC_PER_USEC)); diff --git a/queue-3.17/usb-musb-dsps-start-otg-timer-on-resume-again.patch b/queue-3.17/usb-musb-dsps-start-otg-timer-on-resume-again.patch new file mode 100644 index 00000000000..9a89fca18e2 --- /dev/null +++ b/queue-3.17/usb-musb-dsps-start-otg-timer-on-resume-again.patch @@ -0,0 +1,35 @@ +From 53185b3a441a6cc9bb3f57e924342d249138dcd6 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Mon, 13 Oct 2014 12:16:13 +0200 +Subject: usb: musb: dsps: start OTG timer on resume again + +From: Sebastian Andrzej Siewior + +commit 53185b3a441a6cc9bb3f57e924342d249138dcd6 upstream. + +Commit 468bcc2a2ca ("usb: musb: dsps: kill OTG timer on suspend") stopped +the timer in suspend path but forgot the re-enable it in the resume +path. This patch fixes the behaviour. + +Fixes 468bcc2a2ca "usb: musb: dsps: kill OTG timer on suspend" +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/musb/musb_dsps.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/usb/musb/musb_dsps.c ++++ b/drivers/usb/musb/musb_dsps.c +@@ -896,7 +896,9 @@ static int dsps_resume(struct device *de + dsps_writel(mbase, wrp->mode, glue->context.mode); + dsps_writel(mbase, wrp->tx_mode, glue->context.tx_mode); + dsps_writel(mbase, wrp->rx_mode, glue->context.rx_mode); +- setup_timer(&glue->timer, otg_timer, (unsigned long) musb); ++ if (musb->xceiv->state == OTG_STATE_B_IDLE && ++ musb->port_mode == MUSB_PORT_MODE_DUAL_ROLE) ++ mod_timer(&glue->timer, jiffies + wrp->poll_seconds * HZ); + + return 0; + } diff --git a/queue-3.17/usb-option-add-haier-ce81b-cdma-modem.patch b/queue-3.17/usb-option-add-haier-ce81b-cdma-modem.patch new file mode 100644 index 00000000000..797f5556124 --- /dev/null +++ b/queue-3.17/usb-option-add-haier-ce81b-cdma-modem.patch @@ -0,0 +1,42 @@ +From 012eee1522318b5ccd64d277d50ac32f7e9974fe Mon Sep 17 00:00:00 2001 +From: Dan Williams +Date: Tue, 14 Oct 2014 11:10:41 -0500 +Subject: USB: option: add Haier CE81B CDMA modem + +From: Dan Williams + +commit 012eee1522318b5ccd64d277d50ac32f7e9974fe upstream. + +Port layout: + +0: QCDM/DIAG +1: NMEA +2: AT +3: AT/PPP + +Signed-off-by: Dan Williams +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 +@@ -362,6 +362,7 @@ static void option_instat_callback(struc + + /* Haier products */ + #define HAIER_VENDOR_ID 0x201e ++#define HAIER_PRODUCT_CE81B 0x10f8 + #define HAIER_PRODUCT_CE100 0x2009 + + /* Cinterion (formerly Siemens) products */ +@@ -1620,6 +1621,7 @@ static const struct usb_device_id option + { USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) }, + { USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) }, + { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(HAIER_VENDOR_ID, HAIER_PRODUCT_CE81B, 0xff, 0xff, 0xff) }, + /* Pirelli */ + { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_1, 0xff) }, + { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_2, 0xff) }, diff --git a/queue-3.17/usb-option-add-support-for-telit-le910.patch b/queue-3.17/usb-option-add-support-for-telit-le910.patch new file mode 100644 index 00000000000..bafd5370249 --- /dev/null +++ b/queue-3.17/usb-option-add-support-for-telit-le910.patch @@ -0,0 +1,52 @@ +From 2d0eb862dd477c3c4f32b201254ca0b40e6f465c Mon Sep 17 00:00:00 2001 +From: Daniele Palmas +Date: Tue, 14 Oct 2014 10:47:37 +0200 +Subject: usb: option: add support for Telit LE910 + +From: Daniele Palmas + +commit 2d0eb862dd477c3c4f32b201254ca0b40e6f465c upstream. + +Add VID/PID for Telit LE910 modem. Interfaces description is almost the +same than LE920, except that the qmi interface is number 2 (instead than +5). + +Signed-off-by: Daniele Palmas +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/option.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -269,6 +269,7 @@ static void option_instat_callback(struc + #define TELIT_PRODUCT_DE910_DUAL 0x1010 + #define TELIT_PRODUCT_UE910_V2 0x1012 + #define TELIT_PRODUCT_LE920 0x1200 ++#define TELIT_PRODUCT_LE910 0x1201 + + /* ZTE PRODUCTS */ + #define ZTE_VENDOR_ID 0x19d2 +@@ -588,6 +589,11 @@ static const struct option_blacklist_inf + .reserved = BIT(3) | BIT(4), + }; + ++static const struct option_blacklist_info telit_le910_blacklist = { ++ .sendsetup = BIT(0), ++ .reserved = BIT(1) | BIT(2), ++}; ++ + static const struct option_blacklist_info telit_le920_blacklist = { + .sendsetup = BIT(0), + .reserved = BIT(1) | BIT(5), +@@ -1137,6 +1143,8 @@ static const struct usb_device_id option + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UE910_V2) }, ++ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910), ++ .driver_info = (kernel_ulong_t)&telit_le910_blacklist }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920), + .driver_info = (kernel_ulong_t)&telit_le920_blacklist }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */ diff --git a/queue-3.17/usb-serial-cp210x-add-silicon-labs-358x-vid-and-pid.patch b/queue-3.17/usb-serial-cp210x-add-silicon-labs-358x-vid-and-pid.patch new file mode 100644 index 00000000000..b80f7e0bb29 --- /dev/null +++ b/queue-3.17/usb-serial-cp210x-add-silicon-labs-358x-vid-and-pid.patch @@ -0,0 +1,31 @@ +From 35cc83eab097e5720a9cc0ec12bdc3a726f58381 Mon Sep 17 00:00:00 2001 +From: Nathaniel Ting +Date: Fri, 3 Oct 2014 12:01:20 -0400 +Subject: USB: serial: cp210x: add Silicon Labs 358x VID and PID + +From: Nathaniel Ting + +commit 35cc83eab097e5720a9cc0ec12bdc3a726f58381 upstream. + +Enable Silicon Labs Ember VID chips to enumerate with the cp210x usb serial +driver. EM358x devices operating with the Ember Z-Net 5.1.2 stack may now +connect to host PCs over a USB serial link. + +Signed-off-by: Nathaniel Ting +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 +@@ -155,6 +155,7 @@ static const struct usb_device_id id_tab + { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ + { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ + { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */ ++ { USB_DEVICE(0x1BA4, 0x0002) }, /* Silicon Labs 358x factory default */ + { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */ + { USB_DEVICE(0x1D6F, 0x0010) }, /* Seluxit ApS RF Dongle */ + { USB_DEVICE(0x1E29, 0x0102) }, /* Festo CPX-USB */ diff --git a/queue-3.17/usb-serial-ftdi_sio-add-awinda-station-and-dongle-products.patch b/queue-3.17/usb-serial-ftdi_sio-add-awinda-station-and-dongle-products.patch new file mode 100644 index 00000000000..a1fb0b3ce51 --- /dev/null +++ b/queue-3.17/usb-serial-ftdi_sio-add-awinda-station-and-dongle-products.patch @@ -0,0 +1,50 @@ +From edd74ffab1f6909eee400c7de8ce621870aacac9 Mon Sep 17 00:00:00 2001 +From: Frans Klaver +Date: Fri, 10 Oct 2014 11:52:08 +0200 +Subject: usb: serial: ftdi_sio: add Awinda Station and Dongle products + +From: Frans Klaver + +commit edd74ffab1f6909eee400c7de8ce621870aacac9 upstream. + +Add new IDs for the Xsens Awinda Station and Awinda Dongle. + +While at it, order the definitions by PID and add a logical separation +between devices using Xsens' VID and those using FTDI's VID. + +Signed-off-by: Frans Klaver +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/ftdi_sio.c | 2 ++ + drivers/usb/serial/ftdi_sio_ids.h | 6 +++++- + 2 files changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/usb/serial/ftdi_sio.c ++++ b/drivers/usb/serial/ftdi_sio.c +@@ -661,6 +661,8 @@ static const struct usb_device_id id_tab + { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_5_PID) }, + { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_6_PID) }, + { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) }, ++ { USB_DEVICE(XSENS_VID, XSENS_AWINDA_DONGLE_PID) }, ++ { USB_DEVICE(XSENS_VID, XSENS_AWINDA_STATION_PID) }, + { USB_DEVICE(XSENS_VID, XSENS_CONVERTER_PID) }, + { USB_DEVICE(XSENS_VID, XSENS_MTW_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) }, +--- a/drivers/usb/serial/ftdi_sio_ids.h ++++ b/drivers/usb/serial/ftdi_sio_ids.h +@@ -143,8 +143,12 @@ + * Xsens Technologies BV products (http://www.xsens.com). + */ + #define XSENS_VID 0x2639 +-#define XSENS_CONVERTER_PID 0xD00D /* Xsens USB-serial converter */ ++#define XSENS_AWINDA_STATION_PID 0x0101 ++#define XSENS_AWINDA_DONGLE_PID 0x0102 + #define XSENS_MTW_PID 0x0200 /* Xsens MTw */ ++#define XSENS_CONVERTER_PID 0xD00D /* Xsens USB-serial converter */ ++ ++/* Xsens devices using FTDI VID */ + #define XSENS_CONVERTER_0_PID 0xD388 /* Xsens USB converter */ + #define XSENS_CONVERTER_1_PID 0xD389 /* Xsens Wireless Receiver */ + #define XSENS_CONVERTER_2_PID 0xD38A diff --git a/queue-3.17/usb-serial-ftdi_sio-add-bricked-ftdi-device-pid.patch b/queue-3.17/usb-serial-ftdi_sio-add-bricked-ftdi-device-pid.patch new file mode 100644 index 00000000000..75d675e6184 --- /dev/null +++ b/queue-3.17/usb-serial-ftdi_sio-add-bricked-ftdi-device-pid.patch @@ -0,0 +1,54 @@ +From 7f2719f0003da1ad13124ef00f48d7514c79e30d Mon Sep 17 00:00:00 2001 +From: Perry Hung +Date: Wed, 22 Oct 2014 23:31:34 -0400 +Subject: usb: serial: ftdi_sio: add "bricked" FTDI device PID + +From: Perry Hung + +commit 7f2719f0003da1ad13124ef00f48d7514c79e30d upstream. + +An official recent Windows driver from FTDI detects counterfeit devices +and reprograms the internal EEPROM containing the USB PID to 0, effectively +bricking the device. + +Add support for this VID/PID pair to correctly bind the driver on these +devices. + +See: +http://hackaday.com/2014/10/22/watch-that-windows-update-ftdi-drivers-are-killing-fake-chips/ + +Signed-off-by: Perry Hung +Acked-by: Greg Kroah-Hartman +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/ftdi_sio.c | 1 + + drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ + 2 files changed, 7 insertions(+) + +--- a/drivers/usb/serial/ftdi_sio.c ++++ b/drivers/usb/serial/ftdi_sio.c +@@ -140,6 +140,7 @@ static struct ftdi_sio_quirk ftdi_8u2232 + * /sys/bus/usb-serial/drivers/ftdi_sio/new_id and send a patch or report. + */ + static const struct usb_device_id id_table_combined[] = { ++ { USB_DEVICE(FTDI_VID, FTDI_BRICK_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_ZEITCONTROL_TAGTRACE_MIFARE_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_CTI_MINI_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_CTI_NANO_PID) }, +--- a/drivers/usb/serial/ftdi_sio_ids.h ++++ b/drivers/usb/serial/ftdi_sio_ids.h +@@ -30,6 +30,12 @@ + + /*** third-party PIDs (using FTDI_VID) ***/ + ++/* ++ * Certain versions of the official Windows FTDI driver reprogrammed ++ * counterfeit FTDI devices to PID 0. Support these devices anyway. ++ */ ++#define FTDI_BRICK_PID 0x0000 ++ + #define FTDI_LUMEL_PD12_PID 0x6002 + + /* diff --git a/queue-3.17/wireless-rt2x00-add-new-rt2800usb-device.patch b/queue-3.17/wireless-rt2x00-add-new-rt2800usb-device.patch new file mode 100644 index 00000000000..f8327c6fcb7 --- /dev/null +++ b/queue-3.17/wireless-rt2x00-add-new-rt2800usb-device.patch @@ -0,0 +1,32 @@ +From 664d6a792785cc677c2091038ce10322c8d04ae1 Mon Sep 17 00:00:00 2001 +From: Cyril Brulebois +Date: Tue, 28 Oct 2014 16:42:41 +0100 +Subject: wireless: rt2x00: add new rt2800usb device + +From: Cyril Brulebois + +commit 664d6a792785cc677c2091038ce10322c8d04ae1 upstream. + +0x1b75 0xa200 AirLive WN-200USB wireless 11b/g/n dongle + +References: https://bugs.debian.org/766802 +Reported-by: Martin Mokrejs +Signed-off-by: Cyril Brulebois +Acked-by: Stanislaw Gruszka +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/rt2x00/rt2800usb.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/wireless/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c +@@ -1111,6 +1111,7 @@ static struct usb_device_id rt2800usb_de + /* Ovislink */ + { USB_DEVICE(0x1b75, 0x3071) }, + { USB_DEVICE(0x1b75, 0x3072) }, ++ { USB_DEVICE(0x1b75, 0xa200) }, + /* Para */ + { USB_DEVICE(0x20b8, 0x8888) }, + /* Pegatron */