From 7af6b7d3d995405f58b4359804de3052876b6b9c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 17 Apr 2015 14:25:59 +0200 Subject: [PATCH] 3.10-stable patches added patches: cpuidle-acpi-do-not-overwrite-name-and-description-of-c0.patch dmaengine-omap-dma-fix-memory-leak-when-terminating-running-transfer.patch iio-imu-use-iio_trigger_get-for-indio_dev-trig-assignment.patch iio-inv_mpu6050-clear-timestamps-fifo-while-resetting-hardware-fifo.patch usb-xhci-apply-xhci_avoid_bei-quirk-to-all-intel-xhci-controllers.patch --- ...overwrite-name-and-description-of-c0.patch | 38 ++++++++++ ...ak-when-terminating-running-transfer.patch | 40 ++++++++++ ...er_get-for-indio_dev-trig-assignment.patch | 37 +++++++++ ...s-fifo-while-resetting-hardware-fifo.patch | 76 +++++++++++++++++++ queue-3.10/series | 5 ++ ...-quirk-to-all-intel-xhci-controllers.patch | 56 ++++++++++++++ 6 files changed, 252 insertions(+) create mode 100644 queue-3.10/cpuidle-acpi-do-not-overwrite-name-and-description-of-c0.patch create mode 100644 queue-3.10/dmaengine-omap-dma-fix-memory-leak-when-terminating-running-transfer.patch create mode 100644 queue-3.10/iio-imu-use-iio_trigger_get-for-indio_dev-trig-assignment.patch create mode 100644 queue-3.10/iio-inv_mpu6050-clear-timestamps-fifo-while-resetting-hardware-fifo.patch create mode 100644 queue-3.10/usb-xhci-apply-xhci_avoid_bei-quirk-to-all-intel-xhci-controllers.patch diff --git a/queue-3.10/cpuidle-acpi-do-not-overwrite-name-and-description-of-c0.patch b/queue-3.10/cpuidle-acpi-do-not-overwrite-name-and-description-of-c0.patch new file mode 100644 index 00000000000..c498bdcebb3 --- /dev/null +++ b/queue-3.10/cpuidle-acpi-do-not-overwrite-name-and-description-of-c0.patch @@ -0,0 +1,38 @@ +From c7e8bdf5872c5a8f5a6494e16fe839c38a0d3d3d Mon Sep 17 00:00:00 2001 +From: Thomas Schlichter +Date: Tue, 31 Mar 2015 20:24:39 +0200 +Subject: cpuidle: ACPI: do not overwrite name and description of C0 + +From: Thomas Schlichter + +commit c7e8bdf5872c5a8f5a6494e16fe839c38a0d3d3d upstream. + +Fix a bug that leads to showing the name and description of C-state C0 +as "" in sysfs after the ACPI C-states changed (e.g. after AC->DC +or DC->AC +transition). + +The function poll_idle_init() in drivers/cpuidle/driver.c initializes the +state 0 during cpuidle_register_driver(), so we better do not overwrite it +again with '\0' during acpi_processor_cst_has_changed(). + +Signed-off-by: Thomas Schlichter +Reviewed-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/processor_idle.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/acpi/processor_idle.c ++++ b/drivers/acpi/processor_idle.c +@@ -978,7 +978,7 @@ static int acpi_processor_setup_cpuidle_ + return -EINVAL; + + drv->safe_state_index = -1; +- for (i = 0; i < CPUIDLE_STATE_MAX; i++) { ++ for (i = CPUIDLE_DRIVER_STATE_START; i < CPUIDLE_STATE_MAX; i++) { + drv->states[i].name[0] = '\0'; + drv->states[i].desc[0] = '\0'; + } diff --git a/queue-3.10/dmaengine-omap-dma-fix-memory-leak-when-terminating-running-transfer.patch b/queue-3.10/dmaengine-omap-dma-fix-memory-leak-when-terminating-running-transfer.patch new file mode 100644 index 00000000000..9923d1fa1c3 --- /dev/null +++ b/queue-3.10/dmaengine-omap-dma-fix-memory-leak-when-terminating-running-transfer.patch @@ -0,0 +1,40 @@ +From 02d88b735f5a60f04dbf6d051b76e1877a0d0844 Mon Sep 17 00:00:00 2001 +From: Peter Ujfalusi +Date: Fri, 27 Mar 2015 13:35:52 +0200 +Subject: dmaengine: omap-dma: Fix memory leak when terminating running transfer + +From: Peter Ujfalusi + +commit 02d88b735f5a60f04dbf6d051b76e1877a0d0844 upstream. + +In omap_dma_start_desc the vdesc->node is removed from the virt-dma +framework managed lists (to be precise from the desc_issued list). +If a terminate_all comes before the transfer finishes the omap_desc will +not be freed up because it is not in any of the lists and we stopped the +DMA channel so the transfer will not going to complete. +There is no special sequence for leaking memory when using cyclic (audio) +transfer: with every start and stop of a cyclic transfer the driver leaks +struct omap_desc worth of memory. + +Free up the allocated memory directly in omap_dma_terminate_all() since the +framework will not going to do that for us. + +Signed-off-by: Peter Ujfalusi +CC: +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/dma/omap-dma.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/dma/omap-dma.c ++++ b/drivers/dma/omap-dma.c +@@ -487,6 +487,7 @@ static int omap_dma_terminate_all(struct + * c->desc is NULL and exit.) + */ + if (c->desc) { ++ omap_dma_desc_free(&c->desc->vd); + c->desc = NULL; + /* Avoid stopping the dma twice */ + if (!c->paused) diff --git a/queue-3.10/iio-imu-use-iio_trigger_get-for-indio_dev-trig-assignment.patch b/queue-3.10/iio-imu-use-iio_trigger_get-for-indio_dev-trig-assignment.patch new file mode 100644 index 00000000000..590890adf56 --- /dev/null +++ b/queue-3.10/iio-imu-use-iio_trigger_get-for-indio_dev-trig-assignment.patch @@ -0,0 +1,37 @@ +From 4ce7ca89d6e8eae9e201cd0e972ba323f33e2fb4 Mon Sep 17 00:00:00 2001 +From: Darshana Padmadas +Date: Sat, 28 Mar 2015 12:07:14 +0530 +Subject: iio: imu: Use iio_trigger_get for indio_dev->trig assignment + +From: Darshana Padmadas + +commit 4ce7ca89d6e8eae9e201cd0e972ba323f33e2fb4 upstream. + +This patch uses iio_trigger_get to increment the reference +count of trigger device, to avoid incorrect assignment. +Can result in a null pointer dereference during removal if the +trigger has been changed before removal. + +This patch refers to a similar situation encountered through the +following discussion: +http://www.spinics.net/lists/linux-iio/msg13669.html + +Signed-off-by: Darshana Padmadas +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/imu/adis_trigger.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/imu/adis_trigger.c ++++ b/drivers/iio/imu/adis_trigger.c +@@ -60,7 +60,7 @@ int adis_probe_trigger(struct adis *adis + iio_trigger_set_drvdata(adis->trig, adis); + ret = iio_trigger_register(adis->trig); + +- indio_dev->trig = adis->trig; ++ indio_dev->trig = iio_trigger_get(adis->trig); + if (ret) + goto error_free_irq; + diff --git a/queue-3.10/iio-inv_mpu6050-clear-timestamps-fifo-while-resetting-hardware-fifo.patch b/queue-3.10/iio-inv_mpu6050-clear-timestamps-fifo-while-resetting-hardware-fifo.patch new file mode 100644 index 00000000000..5374e9dee82 --- /dev/null +++ b/queue-3.10/iio-inv_mpu6050-clear-timestamps-fifo-while-resetting-hardware-fifo.patch @@ -0,0 +1,76 @@ +From 4dac0a8eefd55bb1f157d1a5a084531334a2d74c Mon Sep 17 00:00:00 2001 +From: Viorel Suman +Date: Wed, 18 Feb 2015 20:05:21 +0200 +Subject: iio: inv_mpu6050: Clear timestamps fifo while resetting hardware fifo + +From: Viorel Suman + +commit 4dac0a8eefd55bb1f157d1a5a084531334a2d74c upstream. + +A hardware fifo reset always imply an invalidation of the +existing timestamps, so we'll clear timestamps fifo on +successfull hardware fifo reset. + +Signed-off-by: Viorel Suman +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 25 ++++++++++++++----------- + 1 file changed, 14 insertions(+), 11 deletions(-) + +--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c ++++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c +@@ -25,6 +25,16 @@ + #include + #include "inv_mpu_iio.h" + ++static void inv_clear_kfifo(struct inv_mpu6050_state *st) ++{ ++ unsigned long flags; ++ ++ /* take the spin lock sem to avoid interrupt kick in */ ++ spin_lock_irqsave(&st->time_stamp_lock, flags); ++ kfifo_reset(&st->timestamps); ++ spin_unlock_irqrestore(&st->time_stamp_lock, flags); ++} ++ + int inv_reset_fifo(struct iio_dev *indio_dev) + { + int result; +@@ -51,6 +61,10 @@ int inv_reset_fifo(struct iio_dev *indio + INV_MPU6050_BIT_FIFO_RST); + if (result) + goto reset_fifo_fail; ++ ++ /* clear timestamps fifo */ ++ inv_clear_kfifo(st); ++ + /* enable interrupt */ + if (st->chip_config.accl_fifo_enable || + st->chip_config.gyro_fifo_enable) { +@@ -84,16 +98,6 @@ reset_fifo_fail: + return result; + } + +-static void inv_clear_kfifo(struct inv_mpu6050_state *st) +-{ +- unsigned long flags; +- +- /* take the spin lock sem to avoid interrupt kick in */ +- spin_lock_irqsave(&st->time_stamp_lock, flags); +- kfifo_reset(&st->timestamps); +- spin_unlock_irqrestore(&st->time_stamp_lock, flags); +-} +- + /** + * inv_mpu6050_irq_handler() - Cache a timestamp at each data ready interrupt. + */ +@@ -187,7 +191,6 @@ end_session: + flush_fifo: + /* Flush HW and SW FIFOs. */ + inv_reset_fifo(indio_dev); +- inv_clear_kfifo(st); + mutex_unlock(&indio_dev->mlock); + iio_trigger_notify_done(indio_dev->trig); + diff --git a/queue-3.10/series b/queue-3.10/series index e7d697981e2..5bcd7e4c77c 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -14,3 +14,8 @@ radeon-do-not-directly-dereference-pointers-to-bios-area.patch usb-ftdi_sio-added-custom-pid-for-synapse-wireless-product.patch usb-ftdi_sio-use-jtag-quirk-for-snap-connect-e10.patch defer-processing-of-req_preempt-requests-for-blocked-devices.patch +iio-inv_mpu6050-clear-timestamps-fifo-while-resetting-hardware-fifo.patch +iio-imu-use-iio_trigger_get-for-indio_dev-trig-assignment.patch +dmaengine-omap-dma-fix-memory-leak-when-terminating-running-transfer.patch +cpuidle-acpi-do-not-overwrite-name-and-description-of-c0.patch +usb-xhci-apply-xhci_avoid_bei-quirk-to-all-intel-xhci-controllers.patch diff --git a/queue-3.10/usb-xhci-apply-xhci_avoid_bei-quirk-to-all-intel-xhci-controllers.patch b/queue-3.10/usb-xhci-apply-xhci_avoid_bei-quirk-to-all-intel-xhci-controllers.patch new file mode 100644 index 00000000000..a54f66083cf --- /dev/null +++ b/queue-3.10/usb-xhci-apply-xhci_avoid_bei-quirk-to-all-intel-xhci-controllers.patch @@ -0,0 +1,56 @@ +From 227a4fd801c8a9fa2c4700ab98ec1aec06e3b44d Mon Sep 17 00:00:00 2001 +From: Lu Baolu +Date: Mon, 23 Mar 2015 18:27:42 +0200 +Subject: usb: xhci: apply XHCI_AVOID_BEI quirk to all Intel xHCI controllers + +From: Lu Baolu + +commit 227a4fd801c8a9fa2c4700ab98ec1aec06e3b44d upstream. + +When a device with an isochronous endpoint is plugged into the Intel +xHCI host controller, and the driver submits multiple frames per URB, +the xHCI driver will set the Block Event Interrupt (BEI) flag on all +but the last TD for the URB. This causes the host controller to place +an event on the event ring, but not send an interrupt. When the last +TD for the URB completes, BEI is cleared, and we get an interrupt for +the whole URB. + +However, under Intel xHCI host controllers, if the event ring is full +of events from transfers with BEI set, an "Event Ring is Full" event +will be posted to the last entry of the event ring, but no interrupt +is generated. Host will cease all transfer and command executions and +wait until software completes handling the pending events in the event +ring. That means xHC stops, but event of "event ring is full" is not +notified. As the result, the xHC looks like dead to user. + +This patch is to apply XHCI_AVOID_BEI quirk to Intel xHC devices. And +it should be backported to kernels as old as 3.0, that contains the +commit 69e848c2090a ("Intel xhci: Support EHCI/xHCI port switching."). + +Signed-off-by: Lu Baolu +Tested-by: Alistair Grant +Signed-off-by: Mathias Nyman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci-pci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/host/xhci-pci.c ++++ b/drivers/usb/host/xhci-pci.c +@@ -94,6 +94,7 @@ static void xhci_pci_quirks(struct devic + if (pdev->vendor == PCI_VENDOR_ID_INTEL) { + xhci->quirks |= XHCI_LPM_SUPPORT; + xhci->quirks |= XHCI_INTEL_HOST; ++ xhci->quirks |= XHCI_AVOID_BEI; + } + if (pdev->vendor == PCI_VENDOR_ID_INTEL && + pdev->device == PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI) { +@@ -109,7 +110,6 @@ static void xhci_pci_quirks(struct devic + * PPT chipsets. + */ + xhci->quirks |= XHCI_SPURIOUS_REBOOT; +- xhci->quirks |= XHCI_AVOID_BEI; + } + if (pdev->vendor == PCI_VENDOR_ID_ETRON && + pdev->device == PCI_DEVICE_ID_ASROCK_P67) { -- 2.47.3