--- /dev/null
+From 30c9bb0d7603e7b3f4d6a0ea231e1cddae020c32 Mon Sep 17 00:00:00 2001
+From: Lv Zheng <lv.zheng@intel.com>
+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 <lv.zheng@intel.com>
+
+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 <lukas@wunner.de>
+Tested-by: Chen Yu <yu.c.chen@intel.com>
+Signed-off-by: Lv Zheng <lv.zheng@intel.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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++) {
--- /dev/null
+From 13407376b255325fa817798800117a839f3aa055 Mon Sep 17 00:00:00 2001
+From: Jiri Slaby <jslaby@suse.cz>
+Date: Sat, 19 Mar 2016 11:49:43 +0100
+Subject: Bluetooth: vhci: purge unhandled skbs
+
+From: Jiri Slaby <jslaby@suse.cz>
+
+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 <err.h>
+ #include <fcntl.h>
+ #include <stdio.h>
+ #include <unistd.h>
+
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/uio.h>
+
+ 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:
+...
+ [<ffffffff81ece010>] __alloc_skb+0x0/0x5a0
+ [<ffffffffa021886c>] vhci_create_device+0x5c/0x580 [hci_vhci]
+ [<ffffffffa0219436>] vhci_write+0x306/0x4c8 [hci_vhci]
+
+Fixes: 23424c0d31 (Bluetooth: Add support creating virtual AMP controllers)
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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);
+
--- /dev/null
+From b49b927f16acee626c56a1af4ab4cb062f75b5df Mon Sep 17 00:00:00 2001
+From: Roger Quadros <rogerq@ti.com>
+Date: Mon, 9 May 2016 11:28:37 +0300
+Subject: mfd: omap-usb-tll: Fix scheduling while atomic BUG
+
+From: Roger Quadros <rogerq@ti.com>
+
+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: [<c049597c>] __driver_attach+0x60/0xac
+[ 5.896923] #1: (&dev->mutex){......}, at: [<c049598c>] __driver_attach+0x70/0xac
+[ 5.896946] #2: (tll_lock){+.+...}, at: [<c04c2630>] omap_tll_enable+0x2c/0xd0
+[ 5.896966] #3: (prepare_lock){+.+...}, at: [<c05ce9c8>] 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] [<c010e714>] (unwind_backtrace) from [<c010af34>] (show_stack+0x10/0x14)
+[ 5.897087] [<c010af34>] (show_stack) from [<c040aa7c>] (dump_stack+0x88/0xc0)
+[ 5.897099] [<c040aa7c>] (dump_stack) from [<c020c558>] (__schedule_bug+0xac/0xd0)
+[ 5.897111] [<c020c558>] (__schedule_bug) from [<c06f3d44>] (__schedule+0x88/0x7e4)
+[ 5.897120] [<c06f3d44>] (__schedule) from [<c06f46d8>] (schedule+0x9c/0xc0)
+[ 5.897129] [<c06f46d8>] (schedule) from [<c06f4904>] (schedule_preempt_disabled+0x14/0x20)
+[ 5.897140] [<c06f4904>] (schedule_preempt_disabled) from [<c06f64e4>] (mutex_lock_nested+0x258/0x43c)
+[ 5.897150] [<c06f64e4>] (mutex_lock_nested) from [<c05ce9c8>] (clk_prepare_lock+0x48/0xe0)
+[ 5.897160] [<c05ce9c8>] (clk_prepare_lock) from [<c05d0e7c>] (clk_prepare+0x10/0x28)
+[ 5.897169] [<c05d0e7c>] (clk_prepare) from [<c04c2668>] (omap_tll_enable+0x64/0xd0)
+[ 5.897180] [<c04c2668>] (omap_tll_enable) from [<c04c1728>] (usbhs_runtime_resume+0x18/0x17c)
+[ 5.897192] [<c04c1728>] (usbhs_runtime_resume) from [<c049d404>] (pm_generic_runtime_resume+0x2c/0x40)
+[ 5.897202] [<c049d404>] (pm_generic_runtime_resume) from [<c049f180>] (__rpm_callback+0x38/0x68)
+[ 5.897210] [<c049f180>] (__rpm_callback) from [<c049f220>] (rpm_callback+0x70/0x88)
+[ 5.897218] [<c049f220>] (rpm_callback) from [<c04a0a00>] (rpm_resume+0x4ec/0x7ec)
+[ 5.897227] [<c04a0a00>] (rpm_resume) from [<c04a0f48>] (__pm_runtime_resume+0x4c/0x64)
+[ 5.897236] [<c04a0f48>] (__pm_runtime_resume) from [<c04958dc>] (driver_probe_device+0x30/0x70)
+[ 5.897246] [<c04958dc>] (driver_probe_device) from [<c04959a4>] (__driver_attach+0x88/0xac)
+[ 5.897256] [<c04959a4>] (__driver_attach) from [<c04940f8>] (bus_for_each_dev+0x50/0x84)
+[ 5.897267] [<c04940f8>] (bus_for_each_dev) from [<c0494e40>] (bus_add_driver+0xcc/0x1e4)
+[ 5.897276] [<c0494e40>] (bus_add_driver) from [<c0496914>] (driver_register+0xac/0xf4)
+[ 5.897286] [<c0496914>] (driver_register) from [<c01018e0>] (do_one_initcall+0x100/0x1b8)
+[ 5.897296] [<c01018e0>] (do_one_initcall) from [<c01c7a54>] (do_init_module+0x58/0x1c0)
+[ 5.897304] [<c01c7a54>] (do_init_module) from [<c01c8a3c>] (SyS_finit_module+0x88/0x90)
+[ 5.897313] [<c01c8a3c>] (SyS_finit_module) from [<c0107120>] (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 <hns@goldelico.com>
+Tested-by: H. Nikolaus Schaller <hns@goldelico.com>
+Signed-off-by: Roger Quadros <rogerq@ti.com>
+Signed-off-by: Lee Jones <lee.jones@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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]);
+ }
+ }
+
--- /dev/null
+From 32ecd320db39bcb007679ed42f283740641b81ea Mon Sep 17 00:00:00 2001
+From: Matt Gumbel <matthew.k.gumbel@intel.com>
+Date: Fri, 20 May 2016 10:33:46 +0300
+Subject: mmc: longer timeout for long read time quirk
+
+From: Matt Gumbel <matthew.k.gumbel@intel.com>
+
+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 <matthew.k.gumbel@intel.com>
+Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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;
+ }
+
--- /dev/null
+From 1c447116d017a98c90f8f71c8c5a611e0aa42178 Mon Sep 17 00:00:00 2001
+From: Adrian Hunter <adrian.hunter@intel.com>
+Date: Thu, 5 May 2016 08:12:28 +0300
+Subject: mmc: mmc: Fix partition switch timeout for some eMMCs
+
+From: Adrian Hunter <adrian.hunter@intel.com>
+
+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 <adrian.hunter@intel.com>
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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)
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