From: Greg Kroah-Hartman Date: Sun, 29 May 2016 22:20:02 +0000 (-0700) Subject: 3.14-stable patches X-Git-Tag: v3.14.71~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=767bee19e9daef3caf449468294605da7277d3d6;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: acpi-osi-fix-an-issue-that-acpi_osi-cannot-disable-acpica-internal-strings.patch bluetooth-vhci-purge-unhandled-skbs.patch mfd-omap-usb-tll-fix-scheduling-while-atomic-bug.patch mmc-longer-timeout-for-long-read-time-quirk.patch mmc-mmc-fix-partition-switch-timeout-for-some-emmcs.patch --- diff --git a/queue-3.14/acpi-osi-fix-an-issue-that-acpi_osi-cannot-disable-acpica-internal-strings.patch b/queue-3.14/acpi-osi-fix-an-issue-that-acpi_osi-cannot-disable-acpica-internal-strings.patch new file mode 100644 index 00000000000..4dbcce97f9d --- /dev/null +++ b/queue-3.14/acpi-osi-fix-an-issue-that-acpi_osi-cannot-disable-acpica-internal-strings.patch @@ -0,0 +1,113 @@ +From 30c9bb0d7603e7b3f4d6a0ea231e1cddae020c32 Mon Sep 17 00:00:00 2001 +From: Lv Zheng +Date: Tue, 3 May 2016 16:48:20 +0800 +Subject: ACPI / osi: Fix an issue that acpi_osi=!* cannot disable ACPICA internal strings + +From: Lv Zheng + +commit 30c9bb0d7603e7b3f4d6a0ea231e1cddae020c32 upstream. + +The order of the _OSI related functionalities is as follows: + + acpi_blacklisted() + acpi_dmi_osi_linux() + acpi_osi_setup() + acpi_osi_setup() + acpi_update_interfaces() if "!*" + <<<<<<<<<<<<<<<<<<<<<<<< + parse_args() + __setup("acpi_osi=") + acpi_osi_setup_linux() + acpi_update_interfaces() if "!*" + <<<<<<<<<<<<<<<<<<<<<<<< + acpi_early_init() + acpi_initialize_subsystem() + acpi_ut_initialize_interfaces() + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + acpi_bus_init() + acpi_os_initialize1() + acpi_install_interface_handler(acpi_osi_handler) + acpi_osi_setup_late() + acpi_update_interfaces() for "!" + >>>>>>>>>>>>>>>>>>>>>>>> + acpi_osi_handler() + +Since acpi_osi_setup_linux() can override acpi_dmi_osi_linux(), the command +line setting can override the DMI detection. That's why acpi_blacklisted() +is put before __setup("acpi_osi="). + +Then we can notice the following wrong invocation order. There are +acpi_update_interfaces() (marked by <<<<) calls invoked before +acpi_ut_initialize_interfaces() (marked by ^^^^). This makes it impossible +to use acpi_osi=!* correctly from OSI DMI table or from the command line. +The use of acpi_osi=!* is meant to disable both ACPICA +(acpi_gbl_supported_interfaces) and Linux specific strings +(osi_setup_entries) while the ACPICA part should have stopped working +because of the order issue. + +This patch fixes this issue by moving acpi_update_interfaces() to where +it is invoked for acpi_osi=! (marked by >>>>) as this is ensured to be +invoked after acpi_ut_initialize_interfaces() (marked by ^^^^). Linux +specific strings are still handled in the original place in order to make +the following command line working: acpi_osi=!* acpi_osi="Module Device". + +Note that since acpi_osi=!* is meant to further disable linux specific +string comparing to the acpi_osi=!, there is no such use case in our bug +fixing work and hence there is no one using acpi_osi=!* either from the +command line or from the DMI quirks, this issue is just a theoretical +issue. + +Fixes: 741d81280ad2 (ACPI: Add facility to remove all _OSI strings) +Tested-by: Lukas Wunner +Tested-by: Chen Yu +Signed-off-by: Lv Zheng +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/osl.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +--- a/drivers/acpi/osl.c ++++ b/drivers/acpi/osl.c +@@ -138,7 +138,7 @@ static struct osi_linux { + unsigned int enable:1; + unsigned int dmi:1; + unsigned int cmdline:1; +- unsigned int default_disabling:1; ++ u8 default_disabling; + } osi_linux = {0, 0, 0, 0}; + + static u32 acpi_osi_handler(acpi_string interface, u32 supported) +@@ -1420,10 +1420,13 @@ void __init acpi_osi_setup(char *str) + if (*str == '!') { + str++; + if (*str == '\0') { +- osi_linux.default_disabling = 1; ++ /* Do not override acpi_osi=!* */ ++ if (!osi_linux.default_disabling) ++ osi_linux.default_disabling = ++ ACPI_DISABLE_ALL_VENDOR_STRINGS; + return; + } else if (*str == '*') { +- acpi_update_interfaces(ACPI_DISABLE_ALL_STRINGS); ++ osi_linux.default_disabling = ACPI_DISABLE_ALL_STRINGS; + for (i = 0; i < OSI_STRING_ENTRIES_MAX; i++) { + osi = &osi_setup_entries[i]; + osi->enable = false; +@@ -1496,10 +1499,13 @@ static void __init acpi_osi_setup_late(v + acpi_status status; + + if (osi_linux.default_disabling) { +- status = acpi_update_interfaces(ACPI_DISABLE_ALL_VENDOR_STRINGS); ++ status = acpi_update_interfaces(osi_linux.default_disabling); + + if (ACPI_SUCCESS(status)) +- printk(KERN_INFO PREFIX "Disabled all _OSI OS vendors\n"); ++ printk(KERN_INFO PREFIX "Disabled all _OSI OS vendors%s\n", ++ osi_linux.default_disabling == ++ ACPI_DISABLE_ALL_STRINGS ? ++ " and feature groups" : ""); + } + + for (i = 0; i < OSI_STRING_ENTRIES_MAX; i++) { diff --git a/queue-3.14/bluetooth-vhci-purge-unhandled-skbs.patch b/queue-3.14/bluetooth-vhci-purge-unhandled-skbs.patch new file mode 100644 index 00000000000..96873513399 --- /dev/null +++ b/queue-3.14/bluetooth-vhci-purge-unhandled-skbs.patch @@ -0,0 +1,85 @@ +From 13407376b255325fa817798800117a839f3aa055 Mon Sep 17 00:00:00 2001 +From: Jiri Slaby +Date: Sat, 19 Mar 2016 11:49:43 +0100 +Subject: Bluetooth: vhci: purge unhandled skbs + +From: Jiri Slaby + +commit 13407376b255325fa817798800117a839f3aa055 upstream. + +The write handler allocates skbs and queues them into data->readq. +Read side should read them, if there is any. If there is none, skbs +should be dropped by hdev->flush. But this happens only if the device +is HCI_UP, i.e. hdev->power_on work was triggered already. When it was +not, skbs stay allocated in the queue when /dev/vhci is closed. So +purge the queue in ->release. + +Program to reproduce: + #include + #include + #include + #include + + #include + #include + #include + + int main() + { + char buf[] = { 0xff, 0 }; + struct iovec iov = { + .iov_base = buf, + .iov_len = sizeof(buf), + }; + int fd; + + while (1) { + fd = open("/dev/vhci", O_RDWR); + if (fd < 0) + err(1, "open"); + + usleep(50); + + if (writev(fd, &iov, 1) < 0) + err(1, "writev"); + + usleep(50); + + close(fd); + } + + return 0; + } + +Result: +kmemleak: 4609 new suspected memory leaks +unreferenced object 0xffff88059f4d5440 (size 232): + comm "vhci", pid 1084, jiffies 4294912542 (age 37569.296s) + hex dump (first 32 bytes): + 20 f0 23 87 05 88 ff ff 20 f0 23 87 05 88 ff ff .#..... .#..... + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + backtrace: +... + [] __alloc_skb+0x0/0x5a0 + [] vhci_create_device+0x5c/0x580 [hci_vhci] + [] vhci_write+0x306/0x4c8 [hci_vhci] + +Fixes: 23424c0d31 (Bluetooth: Add support creating virtual AMP controllers) +Signed-off-by: Jiri Slaby +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/bluetooth/hci_vhci.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/bluetooth/hci_vhci.c ++++ b/drivers/bluetooth/hci_vhci.c +@@ -340,6 +340,7 @@ static int vhci_release(struct inode *in + hci_free_dev(hdev); + } + ++ skb_queue_purge(&data->readq); + file->private_data = NULL; + kfree(data); + diff --git a/queue-3.14/mfd-omap-usb-tll-fix-scheduling-while-atomic-bug.patch b/queue-3.14/mfd-omap-usb-tll-fix-scheduling-while-atomic-bug.patch new file mode 100644 index 00000000000..dd2f41933cd --- /dev/null +++ b/queue-3.14/mfd-omap-usb-tll-fix-scheduling-while-atomic-bug.patch @@ -0,0 +1,111 @@ +From b49b927f16acee626c56a1af4ab4cb062f75b5df Mon Sep 17 00:00:00 2001 +From: Roger Quadros +Date: Mon, 9 May 2016 11:28:37 +0300 +Subject: mfd: omap-usb-tll: Fix scheduling while atomic BUG + +From: Roger Quadros + +commit b49b927f16acee626c56a1af4ab4cb062f75b5df upstream. + +We shouldn't be calling clk_prepare_enable()/clk_prepare_disable() +in an atomic context. + +Fixes the following issue: + +[ 5.830970] ehci-omap: OMAP-EHCI Host Controller driver +[ 5.830974] driver_register 'ehci-omap' +[ 5.895849] driver_register 'wl1271_sdio' +[ 5.896870] BUG: scheduling while atomic: udevd/994/0x00000002 +[ 5.896876] 4 locks held by udevd/994: +[ 5.896904] #0: (&dev->mutex){......}, at: [] __driver_attach+0x60/0xac +[ 5.896923] #1: (&dev->mutex){......}, at: [] __driver_attach+0x70/0xac +[ 5.896946] #2: (tll_lock){+.+...}, at: [] omap_tll_enable+0x2c/0xd0 +[ 5.896966] #3: (prepare_lock){+.+...}, at: [] clk_prepare_lock+0x48/0xe0 +[ 5.897042] Modules linked in: wlcore_sdio(+) ehci_omap(+) dwc3_omap snd_soc_ts3a225e leds_is31fl319x bq27xxx_battery_i2c tsc2007 bq27xxx_battery bq2429x_charger ina2xx tca8418_keypad as5013 leds_tca6507 twl6040_vibra gpio_twl6040 bmp085_i2c(+) palmas_gpadc usb3503 palmas_pwrbutton bmg160_i2c(+) bmp085 bma150(+) bmg160_core bmp280 input_polldev snd_soc_omap_mcbsp snd_soc_omap_mcpdm snd_soc_omap snd_pcm_dmaengine +[ 5.897048] Preemption disabled at:[< (null)>] (null) +[ 5.897051] +[ 5.897059] CPU: 0 PID: 994 Comm: udevd Not tainted 4.6.0-rc5-letux+ #233 +[ 5.897062] Hardware name: Generic OMAP5 (Flattened Device Tree) +[ 5.897076] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) +[ 5.897087] [] (show_stack) from [] (dump_stack+0x88/0xc0) +[ 5.897099] [] (dump_stack) from [] (__schedule_bug+0xac/0xd0) +[ 5.897111] [] (__schedule_bug) from [] (__schedule+0x88/0x7e4) +[ 5.897120] [] (__schedule) from [] (schedule+0x9c/0xc0) +[ 5.897129] [] (schedule) from [] (schedule_preempt_disabled+0x14/0x20) +[ 5.897140] [] (schedule_preempt_disabled) from [] (mutex_lock_nested+0x258/0x43c) +[ 5.897150] [] (mutex_lock_nested) from [] (clk_prepare_lock+0x48/0xe0) +[ 5.897160] [] (clk_prepare_lock) from [] (clk_prepare+0x10/0x28) +[ 5.897169] [] (clk_prepare) from [] (omap_tll_enable+0x64/0xd0) +[ 5.897180] [] (omap_tll_enable) from [] (usbhs_runtime_resume+0x18/0x17c) +[ 5.897192] [] (usbhs_runtime_resume) from [] (pm_generic_runtime_resume+0x2c/0x40) +[ 5.897202] [] (pm_generic_runtime_resume) from [] (__rpm_callback+0x38/0x68) +[ 5.897210] [] (__rpm_callback) from [] (rpm_callback+0x70/0x88) +[ 5.897218] [] (rpm_callback) from [] (rpm_resume+0x4ec/0x7ec) +[ 5.897227] [] (rpm_resume) from [] (__pm_runtime_resume+0x4c/0x64) +[ 5.897236] [] (__pm_runtime_resume) from [] (driver_probe_device+0x30/0x70) +[ 5.897246] [] (driver_probe_device) from [] (__driver_attach+0x88/0xac) +[ 5.897256] [] (__driver_attach) from [] (bus_for_each_dev+0x50/0x84) +[ 5.897267] [] (bus_for_each_dev) from [] (bus_add_driver+0xcc/0x1e4) +[ 5.897276] [] (bus_add_driver) from [] (driver_register+0xac/0xf4) +[ 5.897286] [] (driver_register) from [] (do_one_initcall+0x100/0x1b8) +[ 5.897296] [] (do_one_initcall) from [] (do_init_module+0x58/0x1c0) +[ 5.897304] [] (do_init_module) from [] (SyS_finit_module+0x88/0x90) +[ 5.897313] [] (SyS_finit_module) from [] (ret_fast_syscall+0x0/0x1c) +[ 5.912697] ------------[ cut here ]------------ +[ 5.912711] WARNING: CPU: 0 PID: 994 at kernel/sched/core.c:2996 _raw_spin_unlock+0x28/0x58 +[ 5.912717] DEBUG_LOCKS_WARN_ON(val > preempt_count()) + +Reported-by: H. Nikolaus Schaller +Tested-by: H. Nikolaus Schaller +Signed-off-by: Roger Quadros +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mfd/omap-usb-tll.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +--- a/drivers/mfd/omap-usb-tll.c ++++ b/drivers/mfd/omap-usb-tll.c +@@ -269,6 +269,8 @@ static int usbtll_omap_probe(struct plat + + if (IS_ERR(tll->ch_clk[i])) + dev_dbg(dev, "can't get clock : %s\n", clkname); ++ else ++ clk_prepare(tll->ch_clk[i]); + } + + pm_runtime_put_sync(dev); +@@ -301,9 +303,12 @@ static int usbtll_omap_remove(struct pla + tll_dev = NULL; + spin_unlock(&tll_lock); + +- for (i = 0; i < tll->nch; i++) +- if (!IS_ERR(tll->ch_clk[i])) ++ for (i = 0; i < tll->nch; i++) { ++ if (!IS_ERR(tll->ch_clk[i])) { ++ clk_unprepare(tll->ch_clk[i]); + clk_put(tll->ch_clk[i]); ++ } ++ } + + pm_runtime_disable(&pdev->dev); + return 0; +@@ -421,7 +426,7 @@ int omap_tll_enable(struct usbhs_omap_pl + if (IS_ERR(tll->ch_clk[i])) + continue; + +- r = clk_prepare_enable(tll->ch_clk[i]); ++ r = clk_enable(tll->ch_clk[i]); + if (r) { + dev_err(tll_dev, + "Error enabling ch %d clock: %d\n", i, r); +@@ -449,7 +454,7 @@ int omap_tll_disable(struct usbhs_omap_p + for (i = 0; i < tll->nch; i++) { + if (omap_usb_mode_needs_tll(pdata->port_mode[i])) { + if (!IS_ERR(tll->ch_clk[i])) +- clk_disable_unprepare(tll->ch_clk[i]); ++ clk_disable(tll->ch_clk[i]); + } + } + diff --git a/queue-3.14/mmc-longer-timeout-for-long-read-time-quirk.patch b/queue-3.14/mmc-longer-timeout-for-long-read-time-quirk.patch new file mode 100644 index 00000000000..838d94cdc07 --- /dev/null +++ b/queue-3.14/mmc-longer-timeout-for-long-read-time-quirk.patch @@ -0,0 +1,63 @@ +From 32ecd320db39bcb007679ed42f283740641b81ea Mon Sep 17 00:00:00 2001 +From: Matt Gumbel +Date: Fri, 20 May 2016 10:33:46 +0300 +Subject: mmc: longer timeout for long read time quirk + +From: Matt Gumbel + +commit 32ecd320db39bcb007679ed42f283740641b81ea upstream. + +008GE0 Toshiba mmc in some Intel Baytrail tablets responds to +MMC_SEND_EXT_CSD in 450-600ms. + +This patch will... + +() Increase the long read time quirk timeout from 300ms to 600ms. Original + author of that quirk says 300ms was only a guess and that the number + may need to be raised in the future. + +() Add this specific MMC to the quirk + +Signed-off-by: Matt Gumbel +Signed-off-by: Adrian Hunter +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/card/block.c | 5 +++-- + drivers/mmc/core/core.c | 4 ++-- + 2 files changed, 5 insertions(+), 4 deletions(-) + +--- a/drivers/mmc/card/block.c ++++ b/drivers/mmc/card/block.c +@@ -2352,11 +2352,12 @@ static const struct mmc_fixup blk_fixups + MMC_QUIRK_BLK_NO_CMD23), + + /* +- * Some Micron MMC cards needs longer data read timeout than +- * indicated in CSD. ++ * Some MMC cards need longer data read timeout than indicated in CSD. + */ + MMC_FIXUP(CID_NAME_ANY, CID_MANFID_MICRON, 0x200, add_quirk_mmc, + MMC_QUIRK_LONG_READ_TIME), ++ MMC_FIXUP("008GE0", CID_MANFID_TOSHIBA, CID_OEMID_ANY, add_quirk_mmc, ++ MMC_QUIRK_LONG_READ_TIME), + + /* + * On these Samsung MoviNAND parts, performing secure erase or +--- a/drivers/mmc/core/core.c ++++ b/drivers/mmc/core/core.c +@@ -822,11 +822,11 @@ void mmc_set_data_timeout(struct mmc_dat + /* + * Some cards require longer data read timeout than indicated in CSD. + * Address this by setting the read timeout to a "reasonably high" +- * value. For the cards tested, 300ms has proven enough. If necessary, ++ * value. For the cards tested, 600ms has proven enough. If necessary, + * this value can be increased if other problematic cards require this. + */ + if (mmc_card_long_read_time(card) && data->flags & MMC_DATA_READ) { +- data->timeout_ns = 300000000; ++ data->timeout_ns = 600000000; + data->timeout_clks = 0; + } + diff --git a/queue-3.14/mmc-mmc-fix-partition-switch-timeout-for-some-emmcs.patch b/queue-3.14/mmc-mmc-fix-partition-switch-timeout-for-some-emmcs.patch new file mode 100644 index 00000000000..a5634d4aea3 --- /dev/null +++ b/queue-3.14/mmc-mmc-fix-partition-switch-timeout-for-some-emmcs.patch @@ -0,0 +1,56 @@ +From 1c447116d017a98c90f8f71c8c5a611e0aa42178 Mon Sep 17 00:00:00 2001 +From: Adrian Hunter +Date: Thu, 5 May 2016 08:12:28 +0300 +Subject: mmc: mmc: Fix partition switch timeout for some eMMCs + +From: Adrian Hunter + +commit 1c447116d017a98c90f8f71c8c5a611e0aa42178 upstream. + +Some eMMCs set the partition switch timeout too low. + +Now typically eMMCs are considered a critical component (e.g. because +they store the root file system) and consequently are expected to be +reliable. Thus we can neglect the use case where eMMCs can't switch +reliably and we might want a lower timeout to facilitate speedy +recovery. + +Although we could employ a quirk for the cards that are affected (if +we could identify them all), as described above, there is little +benefit to having a low timeout, so instead simply set a minimum +timeout. + +The minimum is set to 300ms somewhat arbitrarily - the examples that +have been seen had a timeout of 10ms but were sometimes taking 60-70ms. + +Signed-off-by: Adrian Hunter +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/core/mmc.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/mmc/core/mmc.c ++++ b/drivers/mmc/core/mmc.c +@@ -267,6 +267,9 @@ static void mmc_select_card_type(struct + card->ext_csd.card_type = card_type; + } + ++/* Minimum partition switch timeout in milliseconds */ ++#define MMC_MIN_PART_SWITCH_TIME 300 ++ + /* + * Decode extended CSD. + */ +@@ -331,6 +334,10 @@ static int mmc_read_ext_csd(struct mmc_c + + /* EXT_CSD value is in units of 10ms, but we store in ms */ + card->ext_csd.part_time = 10 * ext_csd[EXT_CSD_PART_SWITCH_TIME]; ++ /* Some eMMC set the value too low so set a minimum */ ++ if (card->ext_csd.part_time && ++ card->ext_csd.part_time < MMC_MIN_PART_SWITCH_TIME) ++ card->ext_csd.part_time = MMC_MIN_PART_SWITCH_TIME; + + /* Sleep / awake timeout in 100ns units */ + if (sa_shift > 0 && sa_shift <= 0x17) diff --git a/queue-3.14/series b/queue-3.14/series index eb56148bf7b..dac95dfcd86 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -5,3 +5,8 @@ fs-cifs-correctly-to-anonymous-authentication-via-ntlmssp.patch ring-buffer-use-long-for-nr_pages-to-avoid-overflow-failures.patch ring-buffer-prevent-overflow-of-size-in-ring_buffer_resize.patch crypto-caam-fix-caam_jr_alloc-ret-code.patch +mfd-omap-usb-tll-fix-scheduling-while-atomic-bug.patch +mmc-mmc-fix-partition-switch-timeout-for-some-emmcs.patch +acpi-osi-fix-an-issue-that-acpi_osi-cannot-disable-acpica-internal-strings.patch +mmc-longer-timeout-for-long-read-time-quirk.patch +bluetooth-vhci-purge-unhandled-skbs.patch