--- /dev/null
+From da60626e7d02a4f385cae80e450afc8b07035368 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel@armlinux.org.uk>
+Date: Fri, 19 Aug 2016 16:34:45 +0100
+Subject: ARM: sa1100: clear reset status prior to reboot
+
+From: Russell King <rmk+kernel@armlinux.org.uk>
+
+commit da60626e7d02a4f385cae80e450afc8b07035368 upstream.
+
+Clear the current reset status prior to rebooting the platform. This
+adds the bit missing from 04fef228fb00 ("[ARM] pxa: introduce
+reset_status and clear_reset_status for driver's usage").
+
+Fixes: 04fef228fb00 ("[ARM] pxa: introduce reset_status and clear_reset_status for driver's usage")
+Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/mach-sa1100/generic.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/arm/mach-sa1100/generic.c
++++ b/arch/arm/mach-sa1100/generic.c
+@@ -34,6 +34,7 @@
+
+ #include <mach/hardware.h>
+ #include <mach/irqs.h>
++#include <mach/reset.h>
+
+ #include "generic.h"
+ #include <clocksource/pxa.h>
+@@ -95,6 +96,8 @@ static void sa1100_power_off(void)
+
+ void sa11x0_restart(enum reboot_mode mode, const char *cmd)
+ {
++ clear_reset_status(RESET_STATUS_ALL);
++
+ if (mode == REBOOT_SOFT) {
+ /* Jump into ROM at address 0 */
+ soft_restart(0);
--- /dev/null
+From 02ba38a5b6d6e0bc89c7b74651f1873055028a56 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel@armlinux.org.uk>
+Date: Fri, 19 Aug 2016 12:44:29 +0100
+Subject: ARM: sa1100: fix 3.6864MHz clock
+
+From: Russell King <rmk+kernel@armlinux.org.uk>
+
+commit 02ba38a5b6d6e0bc89c7b74651f1873055028a56 upstream.
+
+pxa_timer wants to be able to call clk_enable() etc on this clock,
+but our clk_enable() implementation expects non-NULL enable/disable
+operations. Provide these dummy implementations.
+
+Unable to handle kernel NULL pointer dereference at virtual address 00000000
+pgd = c0204000
+[00000000] *pgd=00000000
+Internal error: Oops: 80000005 [#1] ARM
+Modules linked in:
+CPU: 0 PID: 0 Comm: swapper Not tainted 4.8.0-rc2+ #887
+Hardware name: Intel-Assabet
+task: c0644590 task.stack: c0640000
+PC is at 0x0
+LR is at clk_enable+0x40/0x58
+pc : [<00000000>] lr : [<c021b178>] psr: 600000d3
+sp : c0641f60 ip : c0641f4c fp : c0641f74
+r10: c1ffc7a0 r9 : 6901b118 r8 : 00000001
+r7 : c0639a34 r6 : 0000001b r5 : a00000d3 r4 : c0645d70
+r3 : c0645d78 r2 : 00000001 r1 : c0641ef0 r0 : c0645d70
+Flags: nZCv IRQs off FIQs off Mode SVC_32 ISA ARM Segment none
+Control: c020717f Table: c020717f DAC: 00000053
+Process swapper (pid: 0, stack limit = 0xc0640188)
+Stack: (0xc0641f60 to 0xc0642000)
+1f60: 00384000 c08762e4 c0641f98 c0641f78 c063308c c021b144 00000000 00000000
+1f80: 00000000 c0660b20 ffffffff c0641fa8 c0641f9c c06220ec c0633058 c0641fb8
+1fa0: c0641fac c061f114 c06220dc c0641ff4 c0641fbc c061bb68 c061f0fc ffffffff
+1fc0: ffffffff 00000000 c061b6cc c0639a34 c0660cd4 c0642038 c0639a30 c0645434
+1fe0: c0204000 c06380f8 00000000 c0641ff8 c0208048 c061b954 00000000 00000000
+Backtrace:
+[<c021b138>] (clk_enable) from [<c063308c>] (pxa_timer_nodt_init+0x40/0x120)
+ r5:c08762e4 r4:00384000
+[<c063304c>] (pxa_timer_nodt_init) from [<c06220ec>] (sa1100_timer_init+0x1c/0x20)
+ r6:ffffffff r5:c0660b20 r4:00000000
+[<c06220d0>] (sa1100_timer_init) from [<c061f114>] (time_init+0x24/0x2c)
+[<c061f0f0>] (time_init) from [<c061bb68>] (start_kernel+0x220/0x42c)
+[<c061b948>] (start_kernel) from [<c0208048>] (0xc0208048)
+ r10:c06380f8 r8:c0204000 r7:c0645434 r6:c0639a30 r5:c0642038 r4:c0660cd4
+Code: bad PC value
+---[ end trace 0000000000000000 ]---
+Kernel panic - not syncing: Attempted to kill the idle task!
+
+Fixes: ee3a4020f7c9 ("ARM: 8250/1: sa1100: provide OSTIMER0 clock for pxa_timer")
+Acked-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
+Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/mach-sa1100/clock.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/arch/arm/mach-sa1100/clock.c
++++ b/arch/arm/mach-sa1100/clock.c
+@@ -125,6 +125,8 @@ static unsigned long clk_36864_get_rate(
+ }
+
+ static struct clkops clk_36864_ops = {
++ .enable = clk_cpu_enable,
++ .disable = clk_cpu_disable,
+ .get_rate = clk_36864_get_rate,
+ };
+
--- /dev/null
+From 198b51e8a6a31d3a6f8e9dd9cade3635d0291f26 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel@armlinux.org.uk>
+Date: Fri, 19 Aug 2016 12:47:54 +0100
+Subject: ARM: sa1100: register clocks early
+
+From: Russell King <rmk+kernel@armlinux.org.uk>
+
+commit 198b51e8a6a31d3a6f8e9dd9cade3635d0291f26 upstream.
+
+Since we switched to use pxa_timer, we need to provide the OSTIMER0
+clock. However, as the clock is initialised early, we need to provide
+the clock early as well, so that pxa_timer can find it. Adding the
+clock to the clkdev table at core_initcall() time is way too late.
+
+Move the initialisation earlier.
+
+Fixes: ee3a4020f7c9 ("ARM: 8250/1: sa1100: provide OSTIMER0 clock for pxa_timer")
+Acked-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
+Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/mach-sa1100/clock.c | 3 +--
+ arch/arm/mach-sa1100/generic.c | 1 +
+ arch/arm/mach-sa1100/generic.h | 2 ++
+ 3 files changed, 4 insertions(+), 2 deletions(-)
+
+--- a/arch/arm/mach-sa1100/clock.c
++++ b/arch/arm/mach-sa1100/clock.c
+@@ -140,9 +140,8 @@ static struct clk_lookup sa11xx_clkregs[
+ CLKDEV_INIT(NULL, "OSTIMER0", &clk_36864),
+ };
+
+-static int __init sa11xx_clk_init(void)
++int __init sa11xx_clk_init(void)
+ {
+ clkdev_add_table(sa11xx_clkregs, ARRAY_SIZE(sa11xx_clkregs));
+ return 0;
+ }
+-core_initcall(sa11xx_clk_init);
+--- a/arch/arm/mach-sa1100/generic.c
++++ b/arch/arm/mach-sa1100/generic.c
+@@ -388,6 +388,7 @@ void __init sa1100_init_irq(void)
+ sa11x0_init_irq_nodt(IRQ_GPIO0_SC, irq_resource.start);
+
+ sa1100_init_gpio();
++ sa11xx_clk_init();
+ }
+
+ /*
+--- a/arch/arm/mach-sa1100/generic.h
++++ b/arch/arm/mach-sa1100/generic.h
+@@ -44,3 +44,5 @@ int sa11x0_pm_init(void);
+ #else
+ static inline int sa11x0_pm_init(void) { return 0; }
+ #endif
++
++int sa11xx_clk_init(void);
--- /dev/null
+From 06dfe5cc0cc684e735cb0232fdb756d30780b05d Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel@armlinux.org.uk>
+Date: Tue, 6 Sep 2016 14:34:05 +0100
+Subject: ARM: sa1111: fix pcmcia suspend/resume
+
+From: Russell King <rmk+kernel@armlinux.org.uk>
+
+commit 06dfe5cc0cc684e735cb0232fdb756d30780b05d upstream.
+
+SA1111 PCMCIA was broken when PCMCIA switched to using dev_pm_ops for
+the PCMCIA socket class. PCMCIA used to handle suspend/resume via the
+socket hosting device, which happened at normal device suspend/resume
+time.
+
+However, the referenced commit changed this: much of the resume now
+happens much earlier, in the noirq resume handler of dev_pm_ops.
+
+However, on SA1111, the PCMCIA device is not accessible as the SA1111
+has not been resumed at _noirq time. It's slightly worse than that,
+because the SA1111 has already been put to sleep at _noirq time, so
+suspend doesn't work properly.
+
+Fix this by converting the core SA1111 code to use dev_pm_ops as well,
+and performing its own suspend/resume at noirq time.
+
+This fixes these errors in the kernel log:
+
+pcmcia_socket pcmcia_socket0: time out after reset
+pcmcia_socket pcmcia_socket1: time out after reset
+
+and the resulting lack of PCMCIA cards after a S2RAM cycle.
+
+Fixes: d7646f7632549 ("pcmcia: use dev_pm_ops for class pcmcia_socket_class")
+Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/common/sa1111.c | 22 +++++++++++++---------
+ 1 file changed, 13 insertions(+), 9 deletions(-)
+
+--- a/arch/arm/common/sa1111.c
++++ b/arch/arm/common/sa1111.c
+@@ -869,9 +869,9 @@ struct sa1111_save_data {
+
+ #ifdef CONFIG_PM
+
+-static int sa1111_suspend(struct platform_device *dev, pm_message_t state)
++static int sa1111_suspend_noirq(struct device *dev)
+ {
+- struct sa1111 *sachip = platform_get_drvdata(dev);
++ struct sa1111 *sachip = dev_get_drvdata(dev);
+ struct sa1111_save_data *save;
+ unsigned long flags;
+ unsigned int val;
+@@ -934,9 +934,9 @@ static int sa1111_suspend(struct platfor
+ * restored by their respective drivers, and must be called
+ * via LDM after this function.
+ */
+-static int sa1111_resume(struct platform_device *dev)
++static int sa1111_resume_noirq(struct device *dev)
+ {
+- struct sa1111 *sachip = platform_get_drvdata(dev);
++ struct sa1111 *sachip = dev_get_drvdata(dev);
+ struct sa1111_save_data *save;
+ unsigned long flags, id;
+ void __iomem *base;
+@@ -952,7 +952,7 @@ static int sa1111_resume(struct platform
+ id = sa1111_readl(sachip->base + SA1111_SKID);
+ if ((id & SKID_ID_MASK) != SKID_SA1111_ID) {
+ __sa1111_remove(sachip);
+- platform_set_drvdata(dev, NULL);
++ dev_set_drvdata(dev, NULL);
+ kfree(save);
+ return 0;
+ }
+@@ -1003,8 +1003,8 @@ static int sa1111_resume(struct platform
+ }
+
+ #else
+-#define sa1111_suspend NULL
+-#define sa1111_resume NULL
++#define sa1111_suspend_noirq NULL
++#define sa1111_resume_noirq NULL
+ #endif
+
+ static int sa1111_probe(struct platform_device *pdev)
+@@ -1038,6 +1038,11 @@ static int sa1111_remove(struct platform
+ return 0;
+ }
+
++static struct dev_pm_ops sa1111_pm_ops = {
++ .suspend_noirq = sa1111_suspend_noirq,
++ .resume_noirq = sa1111_resume_noirq,
++};
++
+ /*
+ * Not sure if this should be on the system bus or not yet.
+ * We really want some way to register a system device at
+@@ -1050,10 +1055,9 @@ static int sa1111_remove(struct platform
+ static struct platform_driver sa1111_device_driver = {
+ .probe = sa1111_probe,
+ .remove = sa1111_remove,
+- .suspend = sa1111_suspend,
+- .resume = sa1111_resume,
+ .driver = {
+ .name = "sa1111",
++ .pm = &sa1111_pm_ops,
+ },
+ };
+
--- /dev/null
+From c2f321126e31cd69365e65ecd4a7c774e4fc71d2 Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa+renesas@sang-engineering.com>
+Date: Tue, 30 Aug 2016 21:50:22 +0200
+Subject: ARM: shmobile: fix regulator quirk for Gen2
+
+From: Wolfram Sang <wsa+renesas@sang-engineering.com>
+
+commit c2f321126e31cd69365e65ecd4a7c774e4fc71d2 upstream.
+
+The current implementation only works if the da9xxx devices are added
+before their drivers are registered. Only then it can apply the fixes to
+both devices. Otherwise, the driver for the first device gets probed
+before the fix for the second device can be applied. This is what
+fails when using the IP core switcher or when having the i2c master
+driver as a module.
+
+So, we need to disable both da9xxx once we detected one of them. We now
+use i2c_transfer with hardcoded i2c_messages and device addresses, so we
+don't need the da9xxx client devices to be instantiated. Because the
+fixup is used on specific boards only, the addresses are not going to
+change.
+
+Fixes: 663fbb52159cca ("ARM: shmobile: R-Car Gen2: Add da9063/da9210 regulator quirk")
+Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
+Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> (r8a7791/koelsch)
+Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c | 62 ++++++++-------------
+ 1 file changed, 26 insertions(+), 36 deletions(-)
+
+--- a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
++++ b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
+@@ -41,39 +41,26 @@
+
+ #define REGULATOR_IRQ_MASK BIT(2) /* IRQ2, active low */
+
+-static void __iomem *irqc;
+-
+-static const u8 da9063_mask_regs[] = {
+- DA9063_REG_IRQ_MASK_A,
+- DA9063_REG_IRQ_MASK_B,
+- DA9063_REG_IRQ_MASK_C,
+- DA9063_REG_IRQ_MASK_D,
+-};
+-
+-/* DA9210 System Control and Event Registers */
++/* start of DA9210 System Control and Event Registers */
+ #define DA9210_REG_MASK_A 0x54
+-#define DA9210_REG_MASK_B 0x55
+-
+-static const u8 da9210_mask_regs[] = {
+- DA9210_REG_MASK_A,
+- DA9210_REG_MASK_B,
+-};
+
+-static void da9xxx_mask_irqs(struct i2c_client *client, const u8 regs[],
+- unsigned int nregs)
+-{
+- unsigned int i;
+-
+- dev_info(&client->dev, "Masking %s interrupt sources\n", client->name);
++static void __iomem *irqc;
+
+- for (i = 0; i < nregs; i++) {
+- int error = i2c_smbus_write_byte_data(client, regs[i], ~0);
+- if (error) {
+- dev_err(&client->dev, "i2c error %d\n", error);
+- return;
+- }
+- }
+-}
++/* first byte sets the memory pointer, following are consecutive reg values */
++static u8 da9063_irq_clr[] = { DA9063_REG_IRQ_MASK_A, 0xff, 0xff, 0xff, 0xff };
++static u8 da9210_irq_clr[] = { DA9210_REG_MASK_A, 0xff, 0xff };
++
++static struct i2c_msg da9xxx_msgs[2] = {
++ {
++ .addr = 0x58,
++ .len = ARRAY_SIZE(da9063_irq_clr),
++ .buf = da9063_irq_clr,
++ }, {
++ .addr = 0x68,
++ .len = ARRAY_SIZE(da9210_irq_clr),
++ .buf = da9210_irq_clr,
++ },
++};
+
+ static int regulator_quirk_notify(struct notifier_block *nb,
+ unsigned long action, void *data)
+@@ -93,12 +80,15 @@ static int regulator_quirk_notify(struct
+ client = to_i2c_client(dev);
+ dev_dbg(dev, "Detected %s\n", client->name);
+
+- if ((client->addr == 0x58 && !strcmp(client->name, "da9063")))
+- da9xxx_mask_irqs(client, da9063_mask_regs,
+- ARRAY_SIZE(da9063_mask_regs));
+- else if (client->addr == 0x68 && !strcmp(client->name, "da9210"))
+- da9xxx_mask_irqs(client, da9210_mask_regs,
+- ARRAY_SIZE(da9210_mask_regs));
++ if ((client->addr == 0x58 && !strcmp(client->name, "da9063")) ||
++ (client->addr == 0x68 && !strcmp(client->name, "da9210"))) {
++ int ret;
++
++ dev_info(&client->dev, "clearing da9063/da9210 interrupts\n");
++ ret = i2c_transfer(client->adapter, da9xxx_msgs, ARRAY_SIZE(da9xxx_msgs));
++ if (ret != ARRAY_SIZE(da9xxx_msgs))
++ dev_err(&client->dev, "i2c error %d\n", ret);
++ }
+
+ mon = ioread32(irqc + IRQC_MONITOR);
+ if (mon & REGULATOR_IRQ_MASK)
--- /dev/null
+From 539d5c48a4aff5a4afcff117418618b49126c54c Mon Sep 17 00:00:00 2001
+From: Hugo Grostabussiat <bonstra@bonstra.fr.eu.org>
+Date: Tue, 16 Aug 2016 20:34:07 +0200
+Subject: ARM: sun5i: Fix typo in trip point temperature
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Hugo Grostabussiat <bonstra@bonstra.fr.eu.org>
+
+commit 539d5c48a4aff5a4afcff117418618b49126c54c upstream.
+
+Set cpu_alert0 temperature to 85°C instead of 850°C.
+
+Fixes: 32a5d2d170cc ("ARM: dts: sun5i: Add cpu thermal zones to dtsi")
+Signed-off-by: Hugo Grostabussiat <bonstra@bonstra.fr.eu.org>
+Acked-by: Chen-Yu Tsai <wens@csie.org>
+Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/boot/dts/sun5i-a13.dtsi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/sun5i-a13.dtsi
++++ b/arch/arm/boot/dts/sun5i-a13.dtsi
+@@ -83,7 +83,7 @@
+ trips {
+ cpu_alert0: cpu_alert0 {
+ /* milliCelsius */
+- temperature = <850000>;
++ temperature = <85000>;
+ hysteresis = <2000>;
+ type = "passive";
+ };
--- /dev/null
+From aaab50fcea78ae3414c3afc25aae8d0603df34d0 Mon Sep 17 00:00:00 2001
+From: Sven Eckelmann <sven@narfation.org>
+Date: Wed, 29 Jun 2016 19:29:30 +0300
+Subject: ath9k: Fix programming of minCCA power threshold
+
+From: Sven Eckelmann <sven@narfation.org>
+
+commit aaab50fcea78ae3414c3afc25aae8d0603df34d0 upstream.
+
+The function ar9003_hw_apply_minccapwr_thresh takes as second parameter not
+a pointer to the channel but a boolean value describing whether the channel
+is 2.4GHz or not. This broke (according to the origin commit) the ETSI
+regulatory compliance on 5GHz channels.
+
+Fixes: 3533bf6b15a0 ("ath9k: Fix regulatory compliance")
+Signed-off-by: Sven Eckelmann <sven@narfation.org>
+Cc: Simon Wunderlich <sw@simonwunderlich.de>
+Cc: Sujith Manoharan <c_manoha@qca.qualcomm.com>
+Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
++++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+@@ -4176,7 +4176,7 @@ static void ath9k_hw_ar9300_set_board_va
+ if (!AR_SREV_9330(ah) && !AR_SREV_9340(ah) && !AR_SREV_9531(ah))
+ ar9003_hw_internal_regulator_apply(ah);
+ ar9003_hw_apply_tuning_caps(ah);
+- ar9003_hw_apply_minccapwr_thresh(ah, chan);
++ ar9003_hw_apply_minccapwr_thresh(ah, is2ghz);
+ ar9003_hw_txend_to_xpa_off_apply(ah, is2ghz);
+ ar9003_hw_thermometer_apply(ah);
+ ar9003_hw_thermo_cal_apply(ah);
--- /dev/null
+From 55f1cf83d5cf885c75267269729805852039c834 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Wed, 13 Jul 2016 13:08:55 +0300
+Subject: avr32: off by one in at32_init_pio()
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+commit 55f1cf83d5cf885c75267269729805852039c834 upstream.
+
+The pio_dev[] array has MAX_NR_PIO_DEVICES elements so the > should be
+>=.
+
+Fixes: 5f97f7f9400d ('[PATCH] avr32 architecture')
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/avr32/mach-at32ap/pio.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/avr32/mach-at32ap/pio.c
++++ b/arch/avr32/mach-at32ap/pio.c
+@@ -435,7 +435,7 @@ void __init at32_init_pio(struct platfor
+ struct resource *regs;
+ struct pio_device *pio;
+
+- if (pdev->id > MAX_NR_PIO_DEVICES) {
++ if (pdev->id >= MAX_NR_PIO_DEVICES) {
+ dev_err(&pdev->dev, "only %d PIO devices supported\n",
+ MAX_NR_PIO_DEVICES);
+ return;
--- /dev/null
+From 52b9c330c6a8a4b5a1819bdaddf4ec76ab571e81 Mon Sep 17 00:00:00 2001
+From: Omar Sandoval <osandov@fb.com>
+Date: Wed, 8 Jun 2016 18:22:20 -0700
+Subject: blk-mq: actually hook up defer list when running requests
+
+From: Omar Sandoval <osandov@fb.com>
+
+commit 52b9c330c6a8a4b5a1819bdaddf4ec76ab571e81 upstream.
+
+If ->queue_rq() returns BLK_MQ_RQ_QUEUE_OK, we use continue and skip
+over the rest of the loop body. However, dptr is assigned later in the
+loop body, and the BLK_MQ_RQ_QUEUE_OK case is exactly the case that we'd
+want it for.
+
+NVMe isn't actually using BLK_MQ_F_DEFER_ISSUE yet, nor is any other
+in-tree driver, but if the code's going to be there, it might as well
+work.
+
+Fixes: 74c450521dd8 ("blk-mq: add a 'list' parameter to ->queue_rq()")
+Signed-off-by: Omar Sandoval <osandov@fb.com>
+Signed-off-by: Jens Axboe <axboe@fb.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ block/blk-mq.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/block/blk-mq.c
++++ b/block/blk-mq.c
+@@ -780,7 +780,7 @@ static void __blk_mq_run_hw_queue(struct
+ switch (ret) {
+ case BLK_MQ_RQ_QUEUE_OK:
+ queued++;
+- continue;
++ break;
+ case BLK_MQ_RQ_QUEUE_BUSY:
+ list_add(&rq->queuelist, &rq_list);
+ __blk_mq_requeue_request(rq);
--- /dev/null
+From dbb50887c8f619fc5c3489783ebc3122bc134a31 Mon Sep 17 00:00:00 2001
+From: Daniel Borkmann <daniel@iogearbox.net>
+Date: Wed, 27 Jul 2016 11:40:14 -0700
+Subject: Bluetooth: split sk_filter in l2cap_sock_recv_cb
+
+From: Daniel Borkmann <daniel@iogearbox.net>
+
+commit dbb50887c8f619fc5c3489783ebc3122bc134a31 upstream.
+
+During an audit for sk_filter(), we found that rx_busy_skb handling
+in l2cap_sock_recv_cb() and l2cap_sock_recvmsg() looks not quite as
+intended.
+
+The assumption from commit e328140fdacb ("Bluetooth: Use event-driven
+approach for handling ERTM receive buffer") is that errors returned
+from sock_queue_rcv_skb() are due to receive buffer shortage. However,
+nothing should prevent doing a setsockopt() with SO_ATTACH_FILTER on
+the socket, that could drop some of the incoming skbs when handled in
+sock_queue_rcv_skb().
+
+In that case sock_queue_rcv_skb() will return with -EPERM, propagated
+from sk_filter() and if in L2CAP_MODE_ERTM mode, wrong assumption was
+that we failed due to receive buffer being full. From that point onwards,
+due to the to-be-dropped skb being held in rx_busy_skb, we cannot make
+any forward progress as rx_busy_skb is never cleared from l2cap_sock_recvmsg(),
+due to the filter drop verdict over and over coming from sk_filter().
+Meanwhile, in l2cap_sock_recv_cb() all new incoming skbs are being
+dropped due to rx_busy_skb being occupied.
+
+Instead, just use __sock_queue_rcv_skb() where an error really tells that
+there's a receive buffer issue. Split the sk_filter() and enable it for
+non-segmented modes at queuing time since at this point in time the skb has
+already been through the ERTM state machine and it has been acked, so dropping
+is not allowed. Instead, for ERTM and streaming mode, call sk_filter() in
+l2cap_data_rcv() so the packet can be dropped before the state machine sees it.
+
+Fixes: e328140fdacb ("Bluetooth: Use event-driven approach for handling ERTM receive buffer")
+Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
+Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
+Acked-by: Willem de Bruijn <willemb@google.com>
+Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/bluetooth/l2cap_core.c | 8 ++++++++
+ net/bluetooth/l2cap_sock.c | 14 ++++++++++++--
+ 2 files changed, 20 insertions(+), 2 deletions(-)
+
+--- a/net/bluetooth/l2cap_core.c
++++ b/net/bluetooth/l2cap_core.c
+@@ -32,6 +32,7 @@
+
+ #include <linux/debugfs.h>
+ #include <linux/crc16.h>
++#include <linux/filter.h>
+
+ #include <net/bluetooth/bluetooth.h>
+ #include <net/bluetooth/hci_core.h>
+@@ -5825,6 +5826,9 @@ static int l2cap_reassemble_sdu(struct l
+ if (chan->sdu)
+ break;
+
++ if (!pskb_may_pull(skb, L2CAP_SDULEN_SIZE))
++ break;
++
+ chan->sdu_len = get_unaligned_le16(skb->data);
+ skb_pull(skb, L2CAP_SDULEN_SIZE);
+
+@@ -6602,6 +6606,10 @@ static int l2cap_data_rcv(struct l2cap_c
+ goto drop;
+ }
+
++ if ((chan->mode == L2CAP_MODE_ERTM ||
++ chan->mode == L2CAP_MODE_STREAMING) && sk_filter(chan->data, skb))
++ goto drop;
++
+ if (!control->sframe) {
+ int err;
+
+--- a/net/bluetooth/l2cap_sock.c
++++ b/net/bluetooth/l2cap_sock.c
+@@ -1019,7 +1019,7 @@ static int l2cap_sock_recvmsg(struct soc
+ goto done;
+
+ if (pi->rx_busy_skb) {
+- if (!sock_queue_rcv_skb(sk, pi->rx_busy_skb))
++ if (!__sock_queue_rcv_skb(sk, pi->rx_busy_skb))
+ pi->rx_busy_skb = NULL;
+ else
+ goto done;
+@@ -1270,7 +1270,17 @@ static int l2cap_sock_recv_cb(struct l2c
+ goto done;
+ }
+
+- err = sock_queue_rcv_skb(sk, skb);
++ if (chan->mode != L2CAP_MODE_ERTM &&
++ chan->mode != L2CAP_MODE_STREAMING) {
++ /* Even if no filter is attached, we could potentially
++ * get errors from security modules, etc.
++ */
++ err = sk_filter(sk, skb);
++ if (err)
++ goto done;
++ }
++
++ err = __sock_queue_rcv_skb(sk, skb);
+
+ /* For ERTM, handle one skb that doesn't fit into the recv
+ * buffer. This is important to do because the data frames
--- /dev/null
+From 3935e08768ff777da6496521b1fc36f72823672c Mon Sep 17 00:00:00 2001
+From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
+Date: Wed, 29 Jun 2016 19:44:51 +0200
+Subject: dmaengine: at_xdmac: fix debug string
+
+From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
+
+commit 3935e08768ff777da6496521b1fc36f72823672c upstream.
+
+mbr_ds is an integer, don't use %pad to print it.
+
+Fixes: commit 268914f4e7a0 ("dmaengine: at_xdmac: use %pad format string for dma_addr_t")
+Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
+Signed-off-by: Vinod Koul <vinod.koul@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/dma/at_xdmac.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/dma/at_xdmac.c
++++ b/drivers/dma/at_xdmac.c
+@@ -1183,8 +1183,8 @@ static struct at_xdmac_desc *at_xdmac_me
+ desc->lld.mbr_cfg = chan_cc;
+
+ dev_dbg(chan2dev(chan),
+- "%s: lld: mbr_da=%pad, mbr_ds=%pad, mbr_ubc=0x%08x, mbr_cfg=0x%08x\n",
+- __func__, &desc->lld.mbr_da, &desc->lld.mbr_ds, desc->lld.mbr_ubc,
++ "%s: lld: mbr_da=%pad, mbr_ds=0x%08x, mbr_ubc=0x%08x, mbr_cfg=0x%08x\n",
++ __func__, &desc->lld.mbr_da, desc->lld.mbr_ds, desc->lld.mbr_ubc,
+ desc->lld.mbr_cfg);
+
+ return desc;
--- /dev/null
+From e44c153b30c9a0580fc2b5a93f3c6d593def2278 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Mon, 9 May 2016 05:22:55 -0300
+Subject: [media] em28xx-i2c: rt_mutex_trylock() returns zero on failure
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+commit e44c153b30c9a0580fc2b5a93f3c6d593def2278 upstream.
+
+The code is checking for negative returns but it should be checking for
+zero.
+
+Fixes: aab3125c43d8 ('[media] em28xx: add support for registering multiple i2c buses')
+
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/usb/em28xx/em28xx-i2c.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+--- a/drivers/media/usb/em28xx/em28xx-i2c.c
++++ b/drivers/media/usb/em28xx/em28xx-i2c.c
+@@ -507,9 +507,8 @@ static int em28xx_i2c_xfer(struct i2c_ad
+ if (dev->disconnected)
+ return -ENODEV;
+
+- rc = rt_mutex_trylock(&dev->i2c_bus_lock);
+- if (rc < 0)
+- return rc;
++ if (!rt_mutex_trylock(&dev->i2c_bus_lock))
++ return -EAGAIN;
+
+ /* Switch I2C bus if needed */
+ if (bus != dev->cur_i2c_bus &&
--- /dev/null
+From dd7328e4c53649c1c7ec36bc1cf5b229b8662047 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Thu, 7 Jul 2016 11:23:59 +0300
+Subject: fnic: pci_dma_mapping_error() doesn't return an error code
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+commit dd7328e4c53649c1c7ec36bc1cf5b229b8662047 upstream.
+
+pci_dma_mapping_error() returns true on error and false on success.
+
+Fixes: fd6ddfa4c1dd ('fnic: check pci_map_single() return value')
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/scsi/fnic/fnic_fcs.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/scsi/fnic/fnic_fcs.c
++++ b/drivers/scsi/fnic/fnic_fcs.c
+@@ -954,8 +954,8 @@ int fnic_alloc_rq_frame(struct vnic_rq *
+ skb_put(skb, len);
+ pa = pci_map_single(fnic->pdev, skb->data, len, PCI_DMA_FROMDEVICE);
+
+- r = pci_dma_mapping_error(fnic->pdev, pa);
+- if (r) {
++ if (pci_dma_mapping_error(fnic->pdev, pa)) {
++ r = -ENOMEM;
+ printk(KERN_ERR "PCI mapping failed with error %d\n", r);
+ goto free_skb;
+ }
+@@ -1093,8 +1093,8 @@ static int fnic_send_frame(struct fnic *
+
+ pa = pci_map_single(fnic->pdev, eth_hdr, tot_len, PCI_DMA_TODEVICE);
+
+- ret = pci_dma_mapping_error(fnic->pdev, pa);
+- if (ret) {
++ if (pci_dma_mapping_error(fnic->pdev, pa)) {
++ ret = -ENOMEM;
+ printk(KERN_ERR "DMA map failed with error %d\n", ret);
+ goto free_skb_on_err;
+ }
--- /dev/null
+From d7e92e15e92fc987640772bf110586898b5f15aa Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Mon, 4 Jul 2016 10:21:40 -0300
+Subject: [media] gspca: avoid unused variable warnings
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit d7e92e15e92fc987640772bf110586898b5f15aa upstream.
+
+When CONFIG_INPUT is disabled, multiple gspca backend drivers
+print compile-time warnings about unused variables:
+
+media/usb/gspca/cpia1.c: In function 'sd_stopN':
+media/usb/gspca/cpia1.c:1627:13: error: unused variable 'sd' [-Werror=unused-variable]
+media/usb/gspca/konica.c: In function 'sd_stopN':
+media/usb/gspca/konica.c:246:13: error: unused variable 'sd' [-Werror=unused-variable]
+
+This annotates the variables as __maybe_unused, to let the compiler
+know that they are declared intentionally.
+
+Fixes: ee186fd96a5f ("[media] gscpa_t613: Add support for the camera button")
+Fixes: c2f644aeeba3 ("[media] gspca_cpia1: Add support for button")
+Fixes: b517af722860 ("V4L/DVB: gspca_konica: New gspca subdriver for konica chipset using cams")
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/usb/gspca/cpia1.c | 2 +-
+ drivers/media/usb/gspca/konica.c | 2 +-
+ drivers/media/usb/gspca/t613.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/media/usb/gspca/cpia1.c
++++ b/drivers/media/usb/gspca/cpia1.c
+@@ -1624,7 +1624,7 @@ static int sd_start(struct gspca_dev *gs
+
+ static void sd_stopN(struct gspca_dev *gspca_dev)
+ {
+- struct sd *sd = (struct sd *) gspca_dev;
++ struct sd *sd __maybe_unused = (struct sd *) gspca_dev;
+
+ command_pause(gspca_dev);
+
+--- a/drivers/media/usb/gspca/konica.c
++++ b/drivers/media/usb/gspca/konica.c
+@@ -243,7 +243,7 @@ static int sd_start(struct gspca_dev *gs
+
+ static void sd_stopN(struct gspca_dev *gspca_dev)
+ {
+- struct sd *sd = (struct sd *) gspca_dev;
++ struct sd *sd __maybe_unused = (struct sd *) gspca_dev;
+
+ konica_stream_off(gspca_dev);
+ #if IS_ENABLED(CONFIG_INPUT)
+--- a/drivers/media/usb/gspca/t613.c
++++ b/drivers/media/usb/gspca/t613.c
+@@ -837,7 +837,7 @@ static void sd_pkt_scan(struct gspca_dev
+ u8 *data, /* isoc packet */
+ int len) /* iso packet length */
+ {
+- struct sd *sd = (struct sd *) gspca_dev;
++ struct sd *sd __maybe_unused = (struct sd *) gspca_dev;
+ int pkt_type;
+
+ if (data[0] == 0x5a) {
--- /dev/null
+From 61dc0a446e5d08f2de8a24b45f69a1e302bb1b1b Mon Sep 17 00:00:00 2001
+From: Nishanth Menon <nm@ti.com>
+Date: Fri, 24 Jun 2016 11:50:39 -0500
+Subject: hwrng: omap - Fix assumption that runtime_get_sync will always succeed
+
+From: Nishanth Menon <nm@ti.com>
+
+commit 61dc0a446e5d08f2de8a24b45f69a1e302bb1b1b upstream.
+
+pm_runtime_get_sync does return a error value that must be checked for
+error conditions, else, due to various reasons, the device maynot be
+enabled and the system will crash due to lack of clock to the hardware
+module.
+
+Before:
+12.562784] [00000000] *pgd=fe193835
+12.562792] Internal error: : 1406 [#1] SMP ARM
+[...]
+12.562864] CPU: 1 PID: 241 Comm: modprobe Not tainted 4.7.0-rc4-next-20160624 #2
+12.562867] Hardware name: Generic DRA74X (Flattened Device Tree)
+12.562872] task: ed51f140 ti: ed44c000 task.ti: ed44c000
+12.562886] PC is at omap4_rng_init+0x20/0x84 [omap_rng]
+12.562899] LR is at set_current_rng+0xc0/0x154 [rng_core]
+[...]
+
+After the proper checks:
+[ 94.366705] omap_rng 48090000.rng: _od_fail_runtime_resume: FIXME:
+missing hwmod/omap_dev info
+[ 94.375767] omap_rng 48090000.rng: Failed to runtime_get device -19
+[ 94.382351] omap_rng 48090000.rng: initialization failed.
+
+Fixes: 665d92fa85b5 ("hwrng: OMAP: convert to use runtime PM")
+Cc: Paul Walmsley <paul@pwsan.com>
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/char/hw_random/omap-rng.c | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+--- a/drivers/char/hw_random/omap-rng.c
++++ b/drivers/char/hw_random/omap-rng.c
+@@ -384,7 +384,12 @@ static int omap_rng_probe(struct platfor
+ }
+
+ pm_runtime_enable(&pdev->dev);
+- pm_runtime_get_sync(&pdev->dev);
++ ret = pm_runtime_get_sync(&pdev->dev);
++ if (ret) {
++ dev_err(&pdev->dev, "Failed to runtime_get device: %d\n", ret);
++ pm_runtime_put_noidle(&pdev->dev);
++ goto err_ioremap;
++ }
+
+ ret = (dev->of_node) ? of_get_omap_rng_device_details(priv, pdev) :
+ get_omap_rng_device_details(priv);
+@@ -435,8 +440,15 @@ static int __maybe_unused omap_rng_suspe
+ static int __maybe_unused omap_rng_resume(struct device *dev)
+ {
+ struct omap_rng_dev *priv = dev_get_drvdata(dev);
++ int ret;
++
++ ret = pm_runtime_get_sync(dev);
++ if (ret) {
++ dev_err(dev, "Failed to runtime_get device: %d\n", ret);
++ pm_runtime_put_noidle(dev);
++ return ret;
++ }
+
+- pm_runtime_get_sync(dev);
+ priv->pdata->init(priv);
+
+ return 0;
--- /dev/null
+From 849a9627299100ae3f0ce573fc87d2b476f3bb59 Mon Sep 17 00:00:00 2001
+From: striebit <shaul.triebitz@intel.com>
+Date: Tue, 7 Jun 2016 15:05:26 +0300
+Subject: iwlmvm: mvm: set correct state in smart-fifo configuration
+
+From: striebit <shaul.triebitz@intel.com>
+
+commit 849a9627299100ae3f0ce573fc87d2b476f3bb59 upstream.
+
+Currently the state sent in SF configuration is always
+FULL_ON.
+This commit sets the correct state (e.g. INIT_OFF
+when station is not associated).
+
+Fixes: commit f4a3ee493e69 ("iwlwifi: mvm: Always enable the smart FIFO")
+Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
+Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/iwlwifi/mvm/sf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/iwlwifi/mvm/sf.c
++++ b/drivers/net/wireless/iwlwifi/mvm/sf.c
+@@ -215,7 +215,7 @@ static int iwl_mvm_sf_config(struct iwl_
+ enum iwl_sf_state new_state)
+ {
+ struct iwl_sf_cfg_cmd sf_cmd = {
+- .state = cpu_to_le32(SF_FULL_ON),
++ .state = cpu_to_le32(new_state),
+ };
+ struct ieee80211_sta *sta;
+ int ret = 0;
--- /dev/null
+From fa1ce54ea38f7f83473fce62e64fefbd7ebd170e Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert@linux-m68k.org>
+Date: Sun, 5 Jun 2016 11:17:10 +0200
+Subject: NFC: fdp: Detect errors from fdp_nci_create_conn()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Geert Uytterhoeven <geert@linux-m68k.org>
+
+commit fa1ce54ea38f7f83473fce62e64fefbd7ebd170e upstream.
+
+drivers/nfc/fdp/fdp.c: In function ‘fdp_nci_patch_otp’:
+drivers/nfc/fdp/fdp.c:373: warning: comparison is always false due to limited range of data type
+drivers/nfc/fdp/fdp.c: In function ‘fdp_nci_patch_ram’:
+drivers/nfc/fdp/fdp.c:444: warning: comparison is always false due to limited range of data type
+
+fdp_nci_create_conn() may return a negative error code, which is
+silently ignored by assigning it to a u8.
+
+Change conn_id from u8 to int to fix this.
+
+Fixes: a06347c04c13e380 ("NFC: Add Intel Fields Peak NFC solution driver")
+Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/nfc/fdp/fdp.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/nfc/fdp/fdp.c
++++ b/drivers/nfc/fdp/fdp.c
+@@ -352,7 +352,7 @@ static int fdp_nci_patch_otp(struct nci_
+ {
+ struct fdp_nci_info *info = nci_get_drvdata(ndev);
+ struct device *dev = &info->phy->i2c_dev->dev;
+- u8 conn_id;
++ int conn_id;
+ int r = 0;
+
+ if (info->otp_version >= info->otp_patch_version)
+@@ -423,7 +423,7 @@ static int fdp_nci_patch_ram(struct nci_
+ {
+ struct fdp_nci_info *info = nci_get_drvdata(ndev);
+ struct device *dev = &info->phy->i2c_dev->dev;
+- u8 conn_id;
++ int conn_id;
+ int r = 0;
+
+ if (info->ram_version >= info->ram_patch_version)
--- /dev/null
+From ae6c33ba6e37eea3012fe2640b22400ef3f2d0f3 Mon Sep 17 00:00:00 2001
+From: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
+Date: Thu, 25 Aug 2016 15:17:00 -0700
+Subject: printk: fix parsing of "brl=" option
+
+From: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
+
+commit ae6c33ba6e37eea3012fe2640b22400ef3f2d0f3 upstream.
+
+Commit bbeddf52adc1 ("printk: move braille console support into separate
+braille.[ch] files") moved the parsing of braille-related options into
+_braille_console_setup(), changing the type of variable str from char*
+to char**. In this commit, memcmp(str, "brl,", 4) was correctly updated
+to memcmp(*str, "brl,", 4) but not memcmp(str, "brl=", 4).
+
+Update the code to make "brl=" option work again and replace memcmp()
+with strncmp() to make the compiler able to detect such an issue.
+
+Fixes: bbeddf52adc1 ("printk: move braille console support into separate braille.[ch] files")
+Link: http://lkml.kernel.org/r/20160823165700.28952-1-nicolas.iooss_linux@m4x.org
+Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
+Cc: Joe Perches <joe@perches.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/printk/braille.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/kernel/printk/braille.c
++++ b/kernel/printk/braille.c
+@@ -9,10 +9,10 @@
+
+ char *_braille_console_setup(char **str, char **brl_options)
+ {
+- if (!memcmp(*str, "brl,", 4)) {
++ if (!strncmp(*str, "brl,", 4)) {
+ *brl_options = "";
+ *str += 4;
+- } else if (!memcmp(str, "brl=", 4)) {
++ } else if (!strncmp(*str, "brl=", 4)) {
+ *brl_options = *str + 4;
+ *str = strchr(*brl_options, ',');
+ if (!*str)
--- /dev/null
+From 52d210d961a62a9662e27f14d6505d6741b2fb02 Mon Sep 17 00:00:00 2001
+From: Geliang Tang <geliangtang@163.com>
+Date: Sat, 7 Nov 2015 12:43:49 +0800
+Subject: pstore: drop file opened reference count
+
+From: Geliang Tang <geliangtang@163.com>
+
+commit 52d210d961a62a9662e27f14d6505d6741b2fb02 upstream.
+
+In ee1d267423a1 ("pstore: add pstore unregister") I added:
+ .owner = THIS_MODULE,
+in both pstore_fs_type and pstore_file_operations to increase a reference
+count when pstore filesystem is mounted and pstore file is opened.
+
+But, it's repetitive. There is no need to increase the opened reference
+count. We only need to increase the mounted reference count. When a file
+is opened, the filesystem can't be unmounted. Hence the pstore module
+can't be unloaded either.
+
+So I drop the opened reference count in this patch.
+
+Fixes: ee1d267423a1 ("pstore: add pstore unregister")
+Signed-off-by: Geliang Tang <geliangtang@163.com>
+Signed-off-by: Kees Cook <keescook@chromium.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/pstore/inode.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/fs/pstore/inode.c
++++ b/fs/pstore/inode.c
+@@ -178,7 +178,6 @@ static loff_t pstore_file_llseek(struct
+ }
+
+ static const struct file_operations pstore_file_operations = {
+- .owner = THIS_MODULE,
+ .open = pstore_file_open,
+ .read = pstore_file_read,
+ .llseek = pstore_file_llseek,
--- /dev/null
+From 290284776bb281759b11faa287b8abccaf74bfcb Mon Sep 17 00:00:00 2001
+From: Stephen Boyd <sboyd@codeaurora.org>
+Date: Mon, 11 Jul 2016 14:50:07 -0700
+Subject: regulator: qcom_smd: Fix voltage ranges for pm8x41
+
+From: Stephen Boyd <sboyd@codeaurora.org>
+
+commit 290284776bb281759b11faa287b8abccaf74bfcb upstream.
+
+The voltage ranges listed here are wrong. The correct ranges can
+be seen in the "native" spmi regulator driver
+qcom_spmi-regulator.c at pldo_ranges[], ftsmps_ranges[] and
+boost_ranges[] for the pldo, ftsmps, and boost type regulators.
+Port these ranges over to the RPM SMD regulator driver so that we
+list the appropriate set of supported voltages on pldos.
+
+Doing this allows us to specify a voltage like 3075000 for l24,
+whereas before that wasn't a supported voltage.
+
+Fixes: da65e367b67e ("regulator: Regulator driver for the Qualcomm RPM")
+Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
+Reviewed-by: Andy Gross <andy.gross@linaro.org>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/regulator/qcom_smd-regulator.c | 17 +++++++++--------
+ 1 file changed, 9 insertions(+), 8 deletions(-)
+
+--- a/drivers/regulator/qcom_smd-regulator.c
++++ b/drivers/regulator/qcom_smd-regulator.c
+@@ -166,29 +166,30 @@ static const struct regulator_desc pm8x4
+ static const struct regulator_desc pm8841_ftsmps = {
+ .linear_ranges = (struct regulator_linear_range[]) {
+ REGULATOR_LINEAR_RANGE(350000, 0, 184, 5000),
+- REGULATOR_LINEAR_RANGE(700000, 185, 339, 10000),
++ REGULATOR_LINEAR_RANGE(1280000, 185, 261, 10000),
+ },
+ .n_linear_ranges = 2,
+- .n_voltages = 340,
++ .n_voltages = 262,
+ .ops = &rpm_smps_ldo_ops,
+ };
+
+ static const struct regulator_desc pm8941_boost = {
+ .linear_ranges = (struct regulator_linear_range[]) {
+- REGULATOR_LINEAR_RANGE(4000000, 0, 15, 100000),
++ REGULATOR_LINEAR_RANGE(4000000, 0, 30, 50000),
+ },
+ .n_linear_ranges = 1,
+- .n_voltages = 16,
++ .n_voltages = 31,
+ .ops = &rpm_smps_ldo_ops,
+ };
+
+ static const struct regulator_desc pm8941_pldo = {
+ .linear_ranges = (struct regulator_linear_range[]) {
+- REGULATOR_LINEAR_RANGE( 750000, 0, 30, 25000),
+- REGULATOR_LINEAR_RANGE(1500000, 31, 99, 50000),
++ REGULATOR_LINEAR_RANGE( 750000, 0, 63, 12500),
++ REGULATOR_LINEAR_RANGE(1550000, 64, 126, 25000),
++ REGULATOR_LINEAR_RANGE(3100000, 127, 163, 50000),
+ },
+- .n_linear_ranges = 2,
+- .n_voltages = 100,
++ .n_linear_ranges = 3,
++ .n_voltages = 164,
+ .ops = &rpm_smps_ldo_ops,
+ };
+
--- /dev/null
+From 919163f6362ac23138d31fc8befdd52e5d7e488d Mon Sep 17 00:00:00 2001
+From: Stephen Boyd <stephen.boyd@linaro.org>
+Date: Sat, 25 Jun 2016 22:52:13 -0700
+Subject: regulator: qcom_spmi: Add support for get_mode/set_mode on switches
+
+From: Stephen Boyd <stephen.boyd@linaro.org>
+
+commit 919163f6362ac23138d31fc8befdd52e5d7e488d upstream.
+
+The voltage switches support mode switching, so add support for
+these ops to those types of regulators.
+
+Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
+Fixes: e92a4047419c ("regulator: Add QCOM SPMI regulator driver")
+Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/regulator/qcom_spmi-regulator.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/regulator/qcom_spmi-regulator.c
++++ b/drivers/regulator/qcom_spmi-regulator.c
+@@ -1050,6 +1050,8 @@ static struct regulator_ops spmi_vs_ops
+ .set_pull_down = spmi_regulator_common_set_pull_down,
+ .set_soft_start = spmi_regulator_common_set_soft_start,
+ .set_over_current_protection = spmi_regulator_vs_ocp,
++ .set_mode = spmi_regulator_common_set_mode,
++ .get_mode = spmi_regulator_common_get_mode,
+ };
+
+ static struct regulator_ops spmi_boost_ops = {
--- /dev/null
+From c333dfe8dba7d3e47e97e1cee3c38123e19ae73c Mon Sep 17 00:00:00 2001
+From: Stephen Boyd <stephen.boyd@linaro.org>
+Date: Sat, 25 Jun 2016 22:52:11 -0700
+Subject: regulator: qcom_spmi: Add support for S4 supply on pm8941
+
+From: Stephen Boyd <stephen.boyd@linaro.org>
+
+commit c333dfe8dba7d3e47e97e1cee3c38123e19ae73c upstream.
+
+The S4 supply is sometimes called the boost regulator because it
+outputs 5V. Typically it's connected to the 5vs1 and 5vs2
+switches for use in USB OTG and HDMI applications. Add support
+for this regulator which was mistakenly left out from the initial
+submission of this driver.
+
+Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
+Fixes: e92a4047419c ("regulator: Add QCOM SPMI regulator driver")
+Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt | 4 ++--
+ drivers/regulator/qcom_spmi-regulator.c | 1 +
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+--- a/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt
++++ b/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt
+@@ -81,8 +81,8 @@ pm8916:
+ l14, l15, l16, l17, l18
+
+ pm8941:
+- s1, s2, s3, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14,
+- l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, lvs1, lvs2, lvs3,
++ s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13,
++ l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, lvs1, lvs2, lvs3,
+ mvs1, mvs2
+
+ The content of each sub-node is defined by the standard binding for regulators -
+--- a/drivers/regulator/qcom_spmi-regulator.c
++++ b/drivers/regulator/qcom_spmi-regulator.c
+@@ -1440,6 +1440,7 @@ static const struct spmi_regulator_data
+ { "s1", 0x1400, "vdd_s1", },
+ { "s2", 0x1700, "vdd_s2", },
+ { "s3", 0x1a00, "vdd_s3", },
++ { "s4", 0xa000, },
+ { "l1", 0x4000, "vdd_l1_l3", },
+ { "l2", 0x4100, "vdd_l2_lvs_1_2_3", },
+ { "l3", 0x4200, "vdd_l1_l3", },
--- /dev/null
+From 93bfe79b03365f410aa91caf04263173c008ecdf Mon Sep 17 00:00:00 2001
+From: Stephen Boyd <stephen.boyd@linaro.org>
+Date: Sat, 25 Jun 2016 22:52:12 -0700
+Subject: regulator: qcom_spmi: Update mvs1/mvs2 switches on pm8941
+
+From: Stephen Boyd <stephen.boyd@linaro.org>
+
+commit 93bfe79b03365f410aa91caf04263173c008ecdf upstream.
+
+The mvs1 and mvs2 switches are actually called 5vs1 and 5vs2 on
+some datasheets. Let's rename them to match the datasheets and
+also match the RPM based regulator driver which calls these by
+their 5vs names (see qcom_smd-regulator.c). There aren't any
+users of these regulators so far, so there aren't any concerns of
+DT ABI breakage here. While we're here making updates to the
+switches, also mandate usage of the OCP irq for these switches
+too.
+
+Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
+Fixes: e92a4047419c ("regulator: Add QCOM SPMI regulator driver")
+Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt | 2 +-
+ drivers/regulator/qcom_spmi-regulator.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+--- a/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt
++++ b/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt
+@@ -83,7 +83,7 @@ pm8916:
+ pm8941:
+ s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13,
+ l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, lvs1, lvs2, lvs3,
+- mvs1, mvs2
++ 5vs1, 5vs2
+
+ The content of each sub-node is defined by the standard binding for regulators -
+ see regulator.txt - with additional custom properties described below:
+--- a/drivers/regulator/qcom_spmi-regulator.c
++++ b/drivers/regulator/qcom_spmi-regulator.c
+@@ -1470,8 +1470,8 @@ static const struct spmi_regulator_data
+ { "lvs1", 0x8000, "vdd_l2_lvs_1_2_3", },
+ { "lvs2", 0x8100, "vdd_l2_lvs_1_2_3", },
+ { "lvs3", 0x8200, "vdd_l2_lvs_1_2_3", },
+- { "mvs1", 0x8300, "vin_5vs", },
+- { "mvs2", 0x8400, "vin_5vs", },
++ { "5vs1", 0x8300, "vin_5vs", "ocp-5vs1", },
++ { "5vs2", 0x8400, "vin_5vs", "ocp-5vs2", },
+ { }
+ };
+
mips-fix-uretprobe-implementation.patch
mips-malta-fix-iocu-disable-switch-read-for-mips64.patch
mips-uprobes-fix-use-of-uninitialised-variable.patch
+printk-fix-parsing-of-brl-option.patch
+bluetooth-split-sk_filter-in-l2cap_sock_recv_cb.patch
+tpm-fix-byte-order-for-the-value-read-by-tpm2_get_tpm_pt.patch
+regulator-qcom_spmi-add-support-for-s4-supply-on-pm8941.patch
+regulator-qcom_spmi-add-support-for-get_mode-set_mode-on-switches.patch
+regulator-qcom_spmi-update-mvs1-mvs2-switches-on-pm8941.patch
+regulator-qcom_smd-fix-voltage-ranges-for-pm8x41.patch
+arm-sun5i-fix-typo-in-trip-point-temperature.patch
+arm-sa1100-register-clocks-early.patch
+arm-sa1100-fix-3.6864mhz-clock.patch
+arm-sa1100-clear-reset-status-prior-to-reboot.patch
+arm-shmobile-fix-regulator-quirk-for-gen2.patch
+arm-sa1111-fix-pcmcia-suspend-resume.patch
+hwrng-omap-fix-assumption-that-runtime_get_sync-will-always-succeed.patch
+blk-mq-actually-hook-up-defer-list-when-running-requests.patch
+pstore-drop-file-opened-reference-count.patch
+tile-define-at_vector_size_arch-for-arch_dlinfo.patch
+iwlmvm-mvm-set-correct-state-in-smart-fifo-configuration.patch
+nfc-fdp-detect-errors-from-fdp_nci_create_conn.patch
+em28xx-i2c-rt_mutex_trylock-returns-zero-on-failure.patch
+gspca-avoid-unused-variable-warnings.patch
+ath9k-fix-programming-of-mincca-power-threshold.patch
+avr32-off-by-one-in-at32_init_pio.patch
+fnic-pci_dma_mapping_error-doesn-t-return-an-error-code.patch
+dmaengine-at_xdmac-fix-debug-string.patch
--- /dev/null
+From cdf8b4633075f2171d440d2e37c9c2609019a81a Mon Sep 17 00:00:00 2001
+From: James Hogan <james.hogan@imgtec.com>
+Date: Mon, 25 Jul 2016 16:59:54 +0100
+Subject: tile: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO
+
+From: James Hogan <james.hogan@imgtec.com>
+
+commit cdf8b4633075f2171d440d2e37c9c2609019a81a upstream.
+
+AT_VECTOR_SIZE_ARCH should be defined with the maximum number of
+NEW_AUX_ENT entries that ARCH_DLINFO can contain, but it wasn't defined
+for tile at all even though ARCH_DLINFO will contain one NEW_AUX_ENT for
+the VDSO address.
+
+This shouldn't be a problem as AT_VECTOR_SIZE_BASE includes space for
+AT_BASE_PLATFORM which tile doesn't use, but lets define it now and add
+the comment above ARCH_DLINFO as found in several other architectures to
+remind future modifiers of ARCH_DLINFO to keep AT_VECTOR_SIZE_ARCH up to
+date.
+
+Fixes: 4a556f4f56da ("tile: implement gettimeofday() via vDSO")
+Signed-off-by: James Hogan <james.hogan@imgtec.com>
+Cc: Chris Metcalf <cmetcalf@mellanox.com>
+Signed-off-by: Chris Metcalf <cmetcalf@mellanox.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/tile/include/asm/elf.h | 1 +
+ arch/tile/include/uapi/asm/auxvec.h | 2 ++
+ 2 files changed, 3 insertions(+)
+
+--- a/arch/tile/include/asm/elf.h
++++ b/arch/tile/include/asm/elf.h
+@@ -129,6 +129,7 @@ extern int dump_task_regs(struct task_st
+ struct linux_binprm;
+ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
+ int executable_stack);
++/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
+ #define ARCH_DLINFO \
+ do { \
+ NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE); \
+--- a/arch/tile/include/uapi/asm/auxvec.h
++++ b/arch/tile/include/uapi/asm/auxvec.h
+@@ -18,4 +18,6 @@
+ /* The vDSO location. */
+ #define AT_SYSINFO_EHDR 33
+
++#define AT_VECTOR_SIZE_ARCH 1 /* entries in ARCH_DLINFO */
++
+ #endif /* _ASM_TILE_AUXVEC_H */
--- /dev/null
+From 1b0612b04090e416828c0dd5ed197b0913d834a0 Mon Sep 17 00:00:00 2001
+From: "apronin@chromium.org" <apronin@chromium.org>
+Date: Thu, 14 Jul 2016 18:07:18 -0700
+Subject: tpm: fix byte-order for the value read by tpm2_get_tpm_pt
+
+From: apronin@chromium.org <apronin@chromium.org>
+
+commit 1b0612b04090e416828c0dd5ed197b0913d834a0 upstream.
+
+The result must be converted from BE byte order, which is used by the
+TPM2 protocol. This has not popped out because tpm2_get_tpm_pt() has
+been only used for probing.
+
+Fixes: 7a1d7e6dd76a ("tpm: TPM 2.0 baseline support")
+Change-Id: I7d71cd379b1a3b7659d20a1b6008216762596590
+Signed-off-by: Andrey Pronin <apronin@chromium.org>
+Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
+Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
+Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/char/tpm/tpm2-cmd.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/char/tpm/tpm2-cmd.c
++++ b/drivers/char/tpm/tpm2-cmd.c
+@@ -657,7 +657,7 @@ ssize_t tpm2_get_tpm_pt(struct tpm_chip
+
+ rc = tpm_transmit_cmd(chip, &cmd, sizeof(cmd), desc);
+ if (!rc)
+- *value = cmd.params.get_tpm_pt_out.value;
++ *value = be32_to_cpu(cmd.params.get_tpm_pt_out.value);
+
+ return rc;
+ }