summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pagano <mpagano@gentoo.org>2015-04-27 13:18:01 -0400
committerMike Pagano <mpagano@gentoo.org>2015-04-27 13:18:01 -0400
commit7aba46559287bc51c362786a611c31b910e0934b (patch)
treef0a0195c50ffd6d89d02992e38f66b586d439fda
parentLinux patch 3.18.11 (diff)
downloadlinux-patches-7aba46559287bc51c362786a611c31b910e0934b.tar.gz
linux-patches-7aba46559287bc51c362786a611c31b910e0934b.tar.bz2
linux-patches-7aba46559287bc51c362786a611c31b910e0934b.zip
Linux patch 3.18.123.18-14
-rw-r--r--0000_README4
-rw-r--r--1011_linux-3.18.12.patch2634
2 files changed, 2638 insertions, 0 deletions
diff --git a/0000_README b/0000_README
index 7616ed8b..8dd852f4 100644
--- a/0000_README
+++ b/0000_README
@@ -87,6 +87,10 @@ Patch: 1010_linux-3.18.11.patch
From: http://www.kernel.org
Desc: Linux 3.18.11
+Patch: 1011_linux-3.18.12.patch
+From: http://www.kernel.org
+Desc: Linux 3.18.12
+
Patch: 1500_XATTR_USER_PREFIX.patch
From: https://bugs.gentoo.org/show_bug.cgi?id=470644
Desc: Support for namespace user.pax.* on tmpfs.
diff --git a/1011_linux-3.18.12.patch b/1011_linux-3.18.12.patch
new file mode 100644
index 00000000..182f8ae8
--- /dev/null
+++ b/1011_linux-3.18.12.patch
@@ -0,0 +1,2634 @@
+diff --git a/Makefile b/Makefile
+index da8dc1350de3..d64f6bf7cd55 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,6 @@
+ VERSION = 3
+ PATCHLEVEL = 18
+-SUBLEVEL = 11
++SUBLEVEL = 12
+ EXTRAVERSION =
+ NAME = Diseased Newt
+
+diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h
+index a9eee33dfa62..101a42bde728 100644
+--- a/arch/arm64/include/asm/mmu_context.h
++++ b/arch/arm64/include/asm/mmu_context.h
+@@ -151,6 +151,15 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
+ {
+ unsigned int cpu = smp_processor_id();
+
++ /*
++ * init_mm.pgd does not contain any user mappings and it is always
++ * active for kernel addresses in TTBR1. Just set the reserved TTBR0.
++ */
++ if (next == &init_mm) {
++ cpu_set_reserved_ttbr0();
++ return;
++ }
++
+ if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next)) || prev != next)
+ check_and_switch_context(next, tsk);
+ }
+diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec2-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec2-0.dtsi
+index 1382fec9e8c5..7fcb1ac0f232 100644
+--- a/arch/powerpc/boot/dts/fsl/pq3-etsec2-0.dtsi
++++ b/arch/powerpc/boot/dts/fsl/pq3-etsec2-0.dtsi
+@@ -50,6 +50,7 @@ ethernet@b0000 {
+ fsl,num_tx_queues = <0x8>;
+ fsl,magic-packet;
+ local-mac-address = [ 00 00 00 00 00 00 ];
++ ranges;
+
+ queue-group@b0000 {
+ #address-cells = <1>;
+diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec2-1.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec2-1.dtsi
+index 221cd2ea5b31..9f25427c1527 100644
+--- a/arch/powerpc/boot/dts/fsl/pq3-etsec2-1.dtsi
++++ b/arch/powerpc/boot/dts/fsl/pq3-etsec2-1.dtsi
+@@ -50,6 +50,7 @@ ethernet@b1000 {
+ fsl,num_tx_queues = <0x8>;
+ fsl,magic-packet;
+ local-mac-address = [ 00 00 00 00 00 00 ];
++ ranges;
+
+ queue-group@b1000 {
+ #address-cells = <1>;
+diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec2-2.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec2-2.dtsi
+index 61456c317609..cd7c318ab131 100644
+--- a/arch/powerpc/boot/dts/fsl/pq3-etsec2-2.dtsi
++++ b/arch/powerpc/boot/dts/fsl/pq3-etsec2-2.dtsi
+@@ -49,6 +49,7 @@ ethernet@b2000 {
+ fsl,num_tx_queues = <0x8>;
+ fsl,magic-packet;
+ local-mac-address = [ 00 00 00 00 00 00 ];
++ ranges;
+
+ queue-group@b2000 {
+ #address-cells = <1>;
+diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
+index 72e783ea0681..5e0198425194 100644
+--- a/arch/powerpc/kernel/exceptions-64s.S
++++ b/arch/powerpc/kernel/exceptions-64s.S
+@@ -1399,7 +1399,7 @@ machine_check_handle_early:
+ bne 9f /* continue in V mode if we are. */
+
+ 5:
+-#ifdef CONFIG_KVM_BOOK3S_64_HV
++#ifdef CONFIG_KVM_BOOK3S_64_HANDLER
+ /*
+ * We are coming from kernel context. Check if we are coming from
+ * guest. if yes, then we can continue. We will fall through
+diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
+index e7cb6d4a871a..f8c9ff7886e1 100644
+--- a/arch/powerpc/platforms/pseries/mobility.c
++++ b/arch/powerpc/platforms/pseries/mobility.c
+@@ -25,10 +25,10 @@
+ static struct kobject *mobility_kobj;
+
+ struct update_props_workarea {
+- u32 phandle;
+- u32 state;
+- u64 reserved;
+- u32 nprops;
++ __be32 phandle;
++ __be32 state;
++ __be64 reserved;
++ __be32 nprops;
+ } __packed;
+
+ #define NODE_ACTION_MASK 0xff000000
+@@ -54,11 +54,11 @@ static int mobility_rtas_call(int token, char *buf, s32 scope)
+ return rc;
+ }
+
+-static int delete_dt_node(u32 phandle)
++static int delete_dt_node(__be32 phandle)
+ {
+ struct device_node *dn;
+
+- dn = of_find_node_by_phandle(phandle);
++ dn = of_find_node_by_phandle(be32_to_cpu(phandle));
+ if (!dn)
+ return -ENOENT;
+
+@@ -127,7 +127,7 @@ static int update_dt_property(struct device_node *dn, struct property **prop,
+ return 0;
+ }
+
+-static int update_dt_node(u32 phandle, s32 scope)
++static int update_dt_node(__be32 phandle, s32 scope)
+ {
+ struct update_props_workarea *upwa;
+ struct device_node *dn;
+@@ -136,6 +136,7 @@ static int update_dt_node(u32 phandle, s32 scope)
+ char *prop_data;
+ char *rtas_buf;
+ int update_properties_token;
++ u32 nprops;
+ u32 vd;
+
+ update_properties_token = rtas_token("ibm,update-properties");
+@@ -146,7 +147,7 @@ static int update_dt_node(u32 phandle, s32 scope)
+ if (!rtas_buf)
+ return -ENOMEM;
+
+- dn = of_find_node_by_phandle(phandle);
++ dn = of_find_node_by_phandle(be32_to_cpu(phandle));
+ if (!dn) {
+ kfree(rtas_buf);
+ return -ENOENT;
+@@ -162,6 +163,7 @@ static int update_dt_node(u32 phandle, s32 scope)
+ break;
+
+ prop_data = rtas_buf + sizeof(*upwa);
++ nprops = be32_to_cpu(upwa->nprops);
+
+ /* On the first call to ibm,update-properties for a node the
+ * the first property value descriptor contains an empty
+@@ -170,17 +172,17 @@ static int update_dt_node(u32 phandle, s32 scope)
+ */
+ if (*prop_data == 0) {
+ prop_data++;
+- vd = *(u32 *)prop_data;
++ vd = be32_to_cpu(*(__be32 *)prop_data);
+ prop_data += vd + sizeof(vd);
+- upwa->nprops--;
++ nprops--;
+ }
+
+- for (i = 0; i < upwa->nprops; i++) {
++ for (i = 0; i < nprops; i++) {
+ char *prop_name;
+
+ prop_name = prop_data;
+ prop_data += strlen(prop_name) + 1;
+- vd = *(u32 *)prop_data;
++ vd = be32_to_cpu(*(__be32 *)prop_data);
+ prop_data += sizeof(vd);
+
+ switch (vd) {
+@@ -212,13 +214,13 @@ static int update_dt_node(u32 phandle, s32 scope)
+ return 0;
+ }
+
+-static int add_dt_node(u32 parent_phandle, u32 drc_index)
++static int add_dt_node(__be32 parent_phandle, __be32 drc_index)
+ {
+ struct device_node *dn;
+ struct device_node *parent_dn;
+ int rc;
+
+- parent_dn = of_find_node_by_phandle(parent_phandle);
++ parent_dn = of_find_node_by_phandle(be32_to_cpu(parent_phandle));
+ if (!parent_dn)
+ return -ENOENT;
+
+@@ -237,7 +239,7 @@ static int add_dt_node(u32 parent_phandle, u32 drc_index)
+ int pseries_devicetree_update(s32 scope)
+ {
+ char *rtas_buf;
+- u32 *data;
++ __be32 *data;
+ int update_nodes_token;
+ int rc;
+
+@@ -254,17 +256,17 @@ int pseries_devicetree_update(s32 scope)
+ if (rc && rc != 1)
+ break;
+
+- data = (u32 *)rtas_buf + 4;
+- while (*data & NODE_ACTION_MASK) {
++ data = (__be32 *)rtas_buf + 4;
++ while (be32_to_cpu(*data) & NODE_ACTION_MASK) {
+ int i;
+- u32 action = *data & NODE_ACTION_MASK;
+- int node_count = *data & NODE_COUNT_MASK;
++ u32 action = be32_to_cpu(*data) & NODE_ACTION_MASK;
++ u32 node_count = be32_to_cpu(*data) & NODE_COUNT_MASK;
+
+ data++;
+
+ for (i = 0; i < node_count; i++) {
+- u32 phandle = *data++;
+- u32 drc_index;
++ __be32 phandle = *data++;
++ __be32 drc_index;
+
+ switch (action) {
+ case DELETE_DT_NODE:
+diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h
+index 0da5865df5b1..8e1f5f67e25f 100644
+--- a/drivers/base/regmap/internal.h
++++ b/drivers/base/regmap/internal.h
+@@ -237,4 +237,12 @@ extern struct regcache_ops regcache_rbtree_ops;
+ extern struct regcache_ops regcache_lzo_ops;
+ extern struct regcache_ops regcache_flat_ops;
+
++static inline const char *regmap_name(const struct regmap *map)
++{
++ if (map->dev)
++ return dev_name(map->dev);
++
++ return map->name;
++}
++
+ #endif
+diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c
+index f3e8fe0cc650..9d09c5bb5874 100644
+--- a/drivers/base/regmap/regcache-rbtree.c
++++ b/drivers/base/regmap/regcache-rbtree.c
+@@ -307,7 +307,7 @@ static int regcache_rbtree_insert_to_block(struct regmap *map,
+ if (pos == 0) {
+ memmove(blk + offset * map->cache_word_size,
+ blk, rbnode->blklen * map->cache_word_size);
+- bitmap_shift_right(present, present, offset, blklen);
++ bitmap_shift_left(present, present, offset, blklen);
+ }
+
+ /* update the rbnode block, its size and the base register */
+diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
+index f1280dc356d0..e5c1eda6a4c1 100644
+--- a/drivers/base/regmap/regcache.c
++++ b/drivers/base/regmap/regcache.c
+@@ -213,7 +213,7 @@ int regcache_read(struct regmap *map,
+ ret = map->cache_ops->read(map, reg, value);
+
+ if (ret == 0)
+- trace_regmap_reg_read_cache(map->dev, reg, *value);
++ trace_regmap_reg_read_cache(map, reg, *value);
+
+ return ret;
+ }
+@@ -306,7 +306,7 @@ int regcache_sync(struct regmap *map)
+ dev_dbg(map->dev, "Syncing %s cache\n",
+ map->cache_ops->name);
+ name = map->cache_ops->name;
+- trace_regcache_sync(map->dev, name, "start");
++ trace_regcache_sync(map, name, "start");
+
+ if (!map->cache_dirty)
+ goto out;
+@@ -341,7 +341,7 @@ out:
+
+ regmap_async_complete(map);
+
+- trace_regcache_sync(map->dev, name, "stop");
++ trace_regcache_sync(map, name, "stop");
+
+ return ret;
+ }
+@@ -376,7 +376,7 @@ int regcache_sync_region(struct regmap *map, unsigned int min,
+ name = map->cache_ops->name;
+ dev_dbg(map->dev, "Syncing %s cache from %d-%d\n", name, min, max);
+
+- trace_regcache_sync(map->dev, name, "start region");
++ trace_regcache_sync(map, name, "start region");
+
+ if (!map->cache_dirty)
+ goto out;
+@@ -396,7 +396,7 @@ out:
+
+ regmap_async_complete(map);
+
+- trace_regcache_sync(map->dev, name, "stop region");
++ trace_regcache_sync(map, name, "stop region");
+
+ return ret;
+ }
+@@ -423,7 +423,7 @@ int regcache_drop_region(struct regmap *map, unsigned int min,
+
+ map->lock(map->lock_arg);
+
+- trace_regcache_drop_region(map->dev, min, max);
++ trace_regcache_drop_region(map, min, max);
+
+ ret = map->cache_ops->drop(map, min, max);
+
+@@ -450,7 +450,7 @@ void regcache_cache_only(struct regmap *map, bool enable)
+ map->lock(map->lock_arg);
+ WARN_ON(map->cache_bypass && enable);
+ map->cache_only = enable;
+- trace_regmap_cache_only(map->dev, enable);
++ trace_regmap_cache_only(map, enable);
+ map->unlock(map->lock_arg);
+ }
+ EXPORT_SYMBOL_GPL(regcache_cache_only);
+@@ -488,7 +488,7 @@ void regcache_cache_bypass(struct regmap *map, bool enable)
+ map->lock(map->lock_arg);
+ WARN_ON(map->cache_only && enable);
+ map->cache_bypass = enable;
+- trace_regmap_cache_bypass(map->dev, enable);
++ trace_regmap_cache_bypass(map, enable);
+ map->unlock(map->lock_arg);
+ }
+ EXPORT_SYMBOL_GPL(regcache_cache_bypass);
+diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
+index d2f8a818d200..ee731bb7d957 100644
+--- a/drivers/base/regmap/regmap.c
++++ b/drivers/base/regmap/regmap.c
+@@ -1280,7 +1280,7 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg,
+ if (map->async && map->bus->async_write) {
+ struct regmap_async *async;
+
+- trace_regmap_async_write_start(map->dev, reg, val_len);
++ trace_regmap_async_write_start(map, reg, val_len);
+
+ spin_lock_irqsave(&map->async_lock, flags);
+ async = list_first_entry_or_null(&map->async_free,
+@@ -1338,8 +1338,7 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg,
+ return ret;
+ }
+
+- trace_regmap_hw_write_start(map->dev, reg,
+- val_len / map->format.val_bytes);
++ trace_regmap_hw_write_start(map, reg, val_len / map->format.val_bytes);
+
+ /* If we're doing a single register write we can probably just
+ * send the work_buf directly, otherwise try to do a gather
+@@ -1371,8 +1370,7 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg,
+ kfree(buf);
+ }
+
+- trace_regmap_hw_write_done(map->dev, reg,
+- val_len / map->format.val_bytes);
++ trace_regmap_hw_write_done(map, reg, val_len / map->format.val_bytes);
+
+ return ret;
+ }
+@@ -1406,12 +1404,12 @@ static int _regmap_bus_formatted_write(void *context, unsigned int reg,
+
+ map->format.format_write(map, reg, val);
+
+- trace_regmap_hw_write_start(map->dev, reg, 1);
++ trace_regmap_hw_write_start(map, reg, 1);
+
+ ret = map->bus->write(map->bus_context, map->work_buf,
+ map->format.buf_size);
+
+- trace_regmap_hw_write_done(map->dev, reg, 1);
++ trace_regmap_hw_write_done(map, reg, 1);
+
+ return ret;
+ }
+@@ -1469,7 +1467,7 @@ int _regmap_write(struct regmap *map, unsigned int reg,
+ dev_info(map->dev, "%x <= %x\n", reg, val);
+ #endif
+
+- trace_regmap_reg_write(map->dev, reg, val);
++ trace_regmap_reg_write(map, reg, val);
+
+ return map->reg_write(context, reg, val);
+ }
+@@ -1772,7 +1770,7 @@ static int _regmap_raw_multi_reg_write(struct regmap *map,
+ for (i = 0; i < num_regs; i++) {
+ int reg = regs[i].reg;
+ int val = regs[i].def;
+- trace_regmap_hw_write_start(map->dev, reg, 1);
++ trace_regmap_hw_write_start(map, reg, 1);
+ map->format.format_reg(u8, reg, map->reg_shift);
+ u8 += reg_bytes + pad_bytes;
+ map->format.format_val(u8, val, 0);
+@@ -1787,7 +1785,7 @@ static int _regmap_raw_multi_reg_write(struct regmap *map,
+
+ for (i = 0; i < num_regs; i++) {
+ int reg = regs[i].reg;
+- trace_regmap_hw_write_done(map->dev, reg, 1);
++ trace_regmap_hw_write_done(map, reg, 1);
+ }
+ return ret;
+ }
+@@ -2058,15 +2056,13 @@ static int _regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
+ */
+ u8[0] |= map->read_flag_mask;
+
+- trace_regmap_hw_read_start(map->dev, reg,
+- val_len / map->format.val_bytes);
++ trace_regmap_hw_read_start(map, reg, val_len / map->format.val_bytes);
+
+ ret = map->bus->read(map->bus_context, map->work_buf,
+ map->format.reg_bytes + map->format.pad_bytes,
+ val, val_len);
+
+- trace_regmap_hw_read_done(map->dev, reg,
+- val_len / map->format.val_bytes);
++ trace_regmap_hw_read_done(map, reg, val_len / map->format.val_bytes);
+
+ return ret;
+ }
+@@ -2122,7 +2118,7 @@ static int _regmap_read(struct regmap *map, unsigned int reg,
+ dev_info(map->dev, "%x => %x\n", reg, *val);
+ #endif
+
+- trace_regmap_reg_read(map->dev, reg, *val);
++ trace_regmap_reg_read(map, reg, *val);
+
+ if (!map->cache_bypass)
+ regcache_write(map, reg, *val);
+@@ -2479,7 +2475,7 @@ void regmap_async_complete_cb(struct regmap_async *async, int ret)
+ struct regmap *map = async->map;
+ bool wake;
+
+- trace_regmap_async_io_complete(map->dev);
++ trace_regmap_async_io_complete(map);
+
+ spin_lock(&map->async_lock);
+ list_move(&async->list, &map->async_free);
+@@ -2524,7 +2520,7 @@ int regmap_async_complete(struct regmap *map)
+ if (!map->bus || !map->bus->async_write)
+ return 0;
+
+- trace_regmap_async_complete_start(map->dev);
++ trace_regmap_async_complete_start(map);
+
+ wait_event(map->async_waitq, regmap_async_is_done(map));
+
+@@ -2533,7 +2529,7 @@ int regmap_async_complete(struct regmap *map)
+ map->async_ret = 0;
+ spin_unlock_irqrestore(&map->async_lock, flags);
+
+- trace_regmap_async_complete_done(map->dev);
++ trace_regmap_async_complete_done(map);
+
+ return ret;
+ }
+diff --git a/drivers/clocksource/time-efm32.c b/drivers/clocksource/time-efm32.c
+index bba62f9deefb..ec57ba2bbd87 100644
+--- a/drivers/clocksource/time-efm32.c
++++ b/drivers/clocksource/time-efm32.c
+@@ -225,12 +225,12 @@ static int __init efm32_clockevent_init(struct device_node *np)
+ clock_event_ddata.base = base;
+ clock_event_ddata.periodic_top = DIV_ROUND_CLOSEST(rate, 1024 * HZ);
+
+- setup_irq(irq, &efm32_clock_event_irq);
+-
+ clockevents_config_and_register(&clock_event_ddata.evtdev,
+ DIV_ROUND_CLOSEST(rate, 1024),
+ 0xf, 0xffff);
+
++ setup_irq(irq, &efm32_clock_event_irq);
++
+ return 0;
+
+ err_get_irq:
+diff --git a/drivers/clocksource/timer-sun5i.c b/drivers/clocksource/timer-sun5i.c
+index 02268448dc85..5dcbf90b8015 100644
+--- a/drivers/clocksource/timer-sun5i.c
++++ b/drivers/clocksource/timer-sun5i.c
+@@ -178,10 +178,6 @@ static void __init sun5i_timer_init(struct device_node *node)
+
+ ticks_per_jiffy = DIV_ROUND_UP(rate, HZ);
+
+- ret = setup_irq(irq, &sun5i_timer_irq);
+- if (ret)
+- pr_warn("failed to setup irq %d\n", irq);
+-
+ /* Enable timer0 interrupt */
+ val = readl(timer_base + TIMER_IRQ_EN_REG);
+ writel(val | TIMER_IRQ_EN(0), timer_base + TIMER_IRQ_EN_REG);
+@@ -191,6 +187,10 @@ static void __init sun5i_timer_init(struct device_node *node)
+
+ clockevents_config_and_register(&sun5i_clockevent, rate,
+ TIMER_SYNC_TICKS, 0xffffffff);
++
++ ret = setup_irq(irq, &sun5i_timer_irq);
++ if (ret)
++ pr_warn("failed to setup irq %d\n", irq);
+ }
+ CLOCKSOURCE_OF_DECLARE(sun5i_a13, "allwinner,sun5i-a13-hstimer",
+ sun5i_timer_init);
+diff --git a/drivers/cpuidle/cpuidle-mvebu-v7.c b/drivers/cpuidle/cpuidle-mvebu-v7.c
+index 45371bb16214..6066d790fd0e 100644
+--- a/drivers/cpuidle/cpuidle-mvebu-v7.c
++++ b/drivers/cpuidle/cpuidle-mvebu-v7.c
+@@ -37,11 +37,11 @@ static int mvebu_v7_enter_idle(struct cpuidle_device *dev,
+ deepidle = true;
+
+ ret = mvebu_v7_cpu_suspend(deepidle);
++ cpu_pm_exit();
++
+ if (ret)
+ return ret;
+
+- cpu_pm_exit();
+-
+ return index;
+ }
+
+diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
+index a630161473a4..c396e1b69d93 100644
+--- a/drivers/dma/dw/platform.c
++++ b/drivers/dma/dw/platform.c
+@@ -25,6 +25,8 @@
+
+ #include "internal.h"
+
++#define DRV_NAME "dw_dmac"
++
+ static struct dma_chan *dw_dma_of_xlate(struct of_phandle_args *dma_spec,
+ struct of_dma *ofdma)
+ {
+@@ -279,7 +281,7 @@ static struct platform_driver dw_driver = {
+ .remove = dw_remove,
+ .shutdown = dw_shutdown,
+ .driver = {
+- .name = "dw_dmac",
++ .name = DRV_NAME,
+ .pm = &dw_dev_pm_ops,
+ .of_match_table = of_match_ptr(dw_dma_of_id_table),
+ .acpi_match_table = ACPI_PTR(dw_dma_acpi_id_table),
+@@ -300,3 +302,4 @@ module_exit(dw_exit);
+
+ MODULE_LICENSE("GPL v2");
+ MODULE_DESCRIPTION("Synopsys DesignWare DMA Controller platform driver");
++MODULE_ALIAS("platform:" DRV_NAME);
+diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
+index 3cdaac8944eb..a46c4af2ac98 100644
+--- a/drivers/edac/sb_edac.c
++++ b/drivers/edac/sb_edac.c
+@@ -135,6 +135,7 @@ static inline int sad_pkg(const struct interleave_pkg *table, u32 reg,
+
+ #define TOLM 0x80
+ #define TOHM 0x84
++#define HASWELL_TOLM 0xd0
+ #define HASWELL_TOHM_0 0xd4
+ #define HASWELL_TOHM_1 0xd8
+
+@@ -706,8 +707,8 @@ static u64 haswell_get_tolm(struct sbridge_pvt *pvt)
+ {
+ u32 reg;
+
+- pci_read_config_dword(pvt->info.pci_vtd, TOLM, &reg);
+- return (GET_BITFIELD(reg, 26, 31) << 26) | 0x1ffffff;
++ pci_read_config_dword(pvt->info.pci_vtd, HASWELL_TOLM, &reg);
++ return (GET_BITFIELD(reg, 26, 31) << 26) | 0x3ffffff;
+ }
+
+ static u64 haswell_get_tohm(struct sbridge_pvt *pvt)
+@@ -848,7 +849,7 @@ static int get_dimm_config(struct mem_ctl_info *mci)
+ else
+ edac_dbg(0, "Memory is unregistered\n");
+
+- if (mtype == MEM_DDR4 || MEM_RDDR4)
++ if (mtype == MEM_DDR4 || mtype == MEM_RDDR4)
+ banks = 16;
+ else
+ banks = 8;
+diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
+index 23e26e0768b5..2176874a41b1 100644
+--- a/drivers/input/mouse/synaptics.c
++++ b/drivers/input/mouse/synaptics.c
+@@ -120,32 +120,41 @@ void synaptics_reset(struct psmouse *psmouse)
+
+ static bool cr48_profile_sensor;
+
++#define ANY_BOARD_ID 0
+ struct min_max_quirk {
+ const char * const *pnp_ids;
++ struct {
++ unsigned long int min, max;
++ } board_id;
+ int x_min, x_max, y_min, y_max;
+ };
+
+ static const struct min_max_quirk min_max_pnpid_table[] = {
+ {
+ (const char * const []){"LEN0033", NULL},
++ {ANY_BOARD_ID, ANY_BOARD_ID},
+ 1024, 5052, 2258, 4832
+ },
+ {
+- (const char * const []){"LEN0035", "LEN0042", NULL},
++ (const char * const []){"LEN0042", NULL},
++ {ANY_BOARD_ID, ANY_BOARD_ID},
+ 1232, 5710, 1156, 4696
+ },
+ {
+ (const char * const []){"LEN0034", "LEN0036", "LEN0037",
+ "LEN0039", "LEN2002", "LEN2004",
+ NULL},
++ {ANY_BOARD_ID, 2961},
+ 1024, 5112, 2024, 4832
+ },
+ {
+ (const char * const []){"LEN2001", NULL},
++ {ANY_BOARD_ID, ANY_BOARD_ID},
+ 1024, 5022, 2508, 4832
+ },
+ {
+ (const char * const []){"LEN2006", NULL},
++ {ANY_BOARD_ID, ANY_BOARD_ID},
+ 1264, 5675, 1171, 4688
+ },
+ { }
+@@ -241,6 +250,10 @@ static int synaptics_board_id(struct psmouse *psmouse)
+ struct synaptics_data *priv = psmouse->private;
+ unsigned char bid[3];
+
++ /* firmwares prior 7.5 have no board_id encoded */
++ if (SYN_ID_FULL(priv->identity) < 0x705)
++ return 0;
++
+ if (synaptics_send_cmd(psmouse, SYN_QUE_MODES, bid))
+ return -1;
+ priv->board_id = ((bid[0] & 0xfc) << 6) | bid[1];
+@@ -343,7 +356,6 @@ static int synaptics_resolution(struct psmouse *psmouse)
+ {
+ struct synaptics_data *priv = psmouse->private;
+ unsigned char resp[3];
+- int i;
+
+ if (SYN_ID_MAJOR(priv->identity) < 4)
+ return 0;
+@@ -355,17 +367,6 @@ static int synaptics_resolution(struct psmouse *psmouse)
+ }
+ }
+
+- for (i = 0; min_max_pnpid_table[i].pnp_ids; i++) {
+- if (psmouse_matches_pnp_id(psmouse,
+- min_max_pnpid_table[i].pnp_ids)) {
+- priv->x_min = min_max_pnpid_table[i].x_min;
+- priv->x_max = min_max_pnpid_table[i].x_max;
+- priv->y_min = min_max_pnpid_table[i].y_min;
+- priv->y_max = min_max_pnpid_table[i].y_max;
+- return 0;
+- }
+- }
+-
+ if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 5 &&
+ SYN_CAP_MAX_DIMENSIONS(priv->ext_cap_0c)) {
+ if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_MAX_COORDS, resp)) {
+@@ -374,23 +375,69 @@ static int synaptics_resolution(struct psmouse *psmouse)
+ } else {
+ priv->x_max = (resp[0] << 5) | ((resp[1] & 0x0f) << 1);
+ priv->y_max = (resp[2] << 5) | ((resp[1] & 0xf0) >> 3);
++ psmouse_info(psmouse,
++ "queried max coordinates: x [..%d], y [..%d]\n",
++ priv->x_max, priv->y_max);
+ }
+ }
+
+- if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 7 &&
+- SYN_CAP_MIN_DIMENSIONS(priv->ext_cap_0c)) {
++ if (SYN_CAP_MIN_DIMENSIONS(priv->ext_cap_0c) &&
++ (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 7 ||
++ /*
++ * Firmware v8.1 does not report proper number of extended
++ * capabilities, but has been proven to report correct min
++ * coordinates.
++ */
++ SYN_ID_FULL(priv->identity) == 0x801)) {
+ if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_MIN_COORDS, resp)) {
+ psmouse_warn(psmouse,
+ "device claims to have min coordinates query, but I'm not able to read it.\n");
+ } else {
+ priv->x_min = (resp[0] << 5) | ((resp[1] & 0x0f) << 1);
+ priv->y_min = (resp[2] << 5) | ((resp[1] & 0xf0) >> 3);
++ psmouse_info(psmouse,
++ "queried min coordinates: x [%d..], y [%d..]\n",
++ priv->x_min, priv->y_min);
+ }
+ }
+
+ return 0;
+ }
+
++/*
++ * Apply quirk(s) if the hardware matches
++ */
++
++static void synaptics_apply_quirks(struct psmouse *psmouse)
++{
++ struct synaptics_data *priv = psmouse->private;
++ int i;
++
++ for (i = 0; min_max_pnpid_table[i].pnp_ids; i++) {
++ if (!psmouse_matches_pnp_id(psmouse,
++ min_max_pnpid_table[i].pnp_ids))
++ continue;
++
++ if (min_max_pnpid_table[i].board_id.min != ANY_BOARD_ID &&
++ priv->board_id < min_max_pnpid_table[i].board_id.min)
++ continue;
++
++ if (min_max_pnpid_table[i].board_id.max != ANY_BOARD_ID &&
++ priv->board_id > min_max_pnpid_table[i].board_id.max)
++ continue;
++
++ priv->x_min = min_max_pnpid_table[i].x_min;
++ priv->x_max = min_max_pnpid_table[i].x_max;
++ priv->y_min = min_max_pnpid_table[i].y_min;
++ priv->y_max = min_max_pnpid_table[i].y_max;
++ psmouse_info(psmouse,
++ "quirked min/max coordinates: x [%d..%d], y [%d..%d]\n",
++ priv->x_min, priv->x_max,
++ priv->y_min, priv->y_max);
++ break;
++ }
++}
++
+ static int synaptics_query_hardware(struct psmouse *psmouse)
+ {
+ if (synaptics_identify(psmouse))
+@@ -406,6 +453,8 @@ static int synaptics_query_hardware(struct psmouse *psmouse)
+ if (synaptics_resolution(psmouse))
+ return -1;
+
++ synaptics_apply_quirks(psmouse);
++
+ return 0;
+ }
+
+@@ -613,6 +662,18 @@ static void synaptics_parse_agm(const unsigned char buf[],
+ priv->agm_pending = true;
+ }
+
++static void synaptics_parse_ext_buttons(const unsigned char buf[],
++ struct synaptics_data *priv,
++ struct synaptics_hw_state *hw)
++{
++ unsigned int ext_bits =
++ (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) + 1) >> 1;
++ unsigned int ext_mask = GENMASK(ext_bits - 1, 0);
++
++ hw->ext_buttons = buf[4] & ext_mask;
++ hw->ext_buttons |= (buf[5] & ext_mask) << ext_bits;
++}
++
+ static bool is_forcepad;
+
+ static int synaptics_parse_hw_state(const unsigned char buf[],
+@@ -699,28 +760,9 @@ static int synaptics_parse_hw_state(const unsigned char buf[],
+ hw->down = ((buf[0] ^ buf[3]) & 0x02) ? 1 : 0;
+ }
+
+- if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) &&
++ if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) > 0 &&
+ ((buf[0] ^ buf[3]) & 0x02)) {
+- switch (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) & ~0x01) {
+- default:
+- /*
+- * if nExtBtn is greater than 8 it should be
+- * considered invalid and treated as 0
+- */
+- break;
+- case 8:
+- hw->ext_buttons |= ((buf[5] & 0x08)) ? 0x80 : 0;
+- hw->ext_buttons |= ((buf[4] & 0x08)) ? 0x40 : 0;
+- case 6:
+- hw->ext_buttons |= ((buf[5] & 0x04)) ? 0x20 : 0;
+- hw->ext_buttons |= ((buf[4] & 0x04)) ? 0x10 : 0;
+- case 4:
+- hw->ext_buttons |= ((buf[5] & 0x02)) ? 0x08 : 0;
+- hw->ext_buttons |= ((buf[4] & 0x02)) ? 0x04 : 0;
+- case 2:
+- hw->ext_buttons |= ((buf[5] & 0x01)) ? 0x02 : 0;
+- hw->ext_buttons |= ((buf[4] & 0x01)) ? 0x01 : 0;
+- }
++ synaptics_parse_ext_buttons(buf, priv, hw);
+ }
+ } else {
+ hw->x = (((buf[1] & 0x1f) << 8) | buf[2]);
+@@ -782,12 +824,35 @@ static void synaptics_report_semi_mt_data(struct input_dev *dev,
+ }
+ }
+
++static void synaptics_report_ext_buttons(struct psmouse *psmouse,
++ const struct synaptics_hw_state *hw)
++{
++ struct input_dev *dev = psmouse->dev;
++ struct synaptics_data *priv = psmouse->private;
++ int ext_bits = (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) + 1) >> 1;
++ int i;
++
++ if (!SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap))
++ return;
++
++ /* Bug in FW 8.1, buttons are reported only when ExtBit is 1 */
++ if (SYN_ID_FULL(priv->identity) == 0x801 &&
++ !((psmouse->packet[0] ^ psmouse->packet[3]) & 0x02))
++ return;
++
++ for (i = 0; i < ext_bits; i++) {
++ input_report_key(dev, BTN_0 + 2 * i,
++ hw->ext_buttons & (1 << i));
++ input_report_key(dev, BTN_1 + 2 * i,
++ hw->ext_buttons & (1 << (i + ext_bits)));
++ }
++}
++
+ static void synaptics_report_buttons(struct psmouse *psmouse,
+ const struct synaptics_hw_state *hw)
+ {
+ struct input_dev *dev = psmouse->dev;
+ struct synaptics_data *priv = psmouse->private;
+- int i;
+
+ input_report_key(dev, BTN_LEFT, hw->left);
+ input_report_key(dev, BTN_RIGHT, hw->right);
+@@ -800,8 +865,7 @@ static void synaptics_report_buttons(struct psmouse *psmouse,
+ input_report_key(dev, BTN_BACK, hw->down);
+ }
+
+- for (i = 0; i < SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap); i++)
+- input_report_key(dev, BTN_0 + i, hw->ext_buttons & (1 << i));
++ synaptics_report_ext_buttons(psmouse, hw);
+ }
+
+ static void synaptics_report_slot(struct input_dev *dev, int slot,
+diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c
+index 37de0173b6d2..74adcd2c967e 100644
+--- a/drivers/md/dm-io.c
++++ b/drivers/md/dm-io.c
+@@ -289,9 +289,16 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where,
+ struct request_queue *q = bdev_get_queue(where->bdev);
+ unsigned short logical_block_size = queue_logical_block_size(q);
+ sector_t num_sectors;
++ unsigned int uninitialized_var(special_cmd_max_sectors);
+
+- /* Reject unsupported discard requests */
+- if ((rw & REQ_DISCARD) && !blk_queue_discard(q)) {
++ /*
++ * Reject unsupported discard and write same requests.
++ */
++ if (rw & REQ_DISCARD)
++ special_cmd_max_sectors = q->limits.max_discard_sectors;
++ else if (rw & REQ_WRITE_SAME)
++ special_cmd_max_sectors = q->limits.max_write_same_sectors;
++ if ((rw & (REQ_DISCARD | REQ_WRITE_SAME)) && special_cmd_max_sectors == 0) {
+ dec_count(io, region, -EOPNOTSUPP);
+ return;
+ }
+@@ -317,7 +324,7 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where,
+ store_io_and_region_in_bio(bio, io, region);
+
+ if (rw & REQ_DISCARD) {
+- num_sectors = min_t(sector_t, q->limits.max_discard_sectors, remaining);
++ num_sectors = min_t(sector_t, special_cmd_max_sectors, remaining);
+ bio->bi_iter.bi_size = num_sectors << SECTOR_SHIFT;
+ remaining -= num_sectors;
+ } else if (rw & REQ_WRITE_SAME) {
+@@ -326,7 +333,7 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where,
+ */
+ dp->get_page(dp, &page, &len, &offset);
+ bio_add_page(bio, page, logical_block_size, offset);
+- num_sectors = min_t(sector_t, q->limits.max_write_same_sectors, remaining);
++ num_sectors = min_t(sector_t, special_cmd_max_sectors, remaining);
+ bio->bi_iter.bi_size = num_sectors << SECTOR_SHIFT;
+
+ offset = 0;
+diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
+index 8b204ae216ab..33de9f7a7180 100644
+--- a/drivers/md/dm-snap.c
++++ b/drivers/md/dm-snap.c
+@@ -20,6 +20,8 @@
+ #include <linux/log2.h>
+ #include <linux/dm-kcopyd.h>
+
++#include "dm.h"
++
+ #include "dm-exception-store.h"
+
+ #define DM_MSG_PREFIX "snapshots"
+@@ -291,12 +293,23 @@ struct origin {
+ };
+
+ /*
++ * This structure is allocated for each origin target
++ */
++struct dm_origin {
++ struct dm_dev *dev;
++ struct dm_target *ti;
++ unsigned split_boundary;
++ struct list_head hash_list;
++};
++
++/*
+ * Size of the hash table for origin volumes. If we make this
+ * the size of the minors list then it should be nearly perfect
+ */
+ #define ORIGIN_HASH_SIZE 256
+ #define ORIGIN_MASK 0xFF
+ static struct list_head *_origins;
++static struct list_head *_dm_origins;
+ static struct rw_semaphore _origins_lock;
+
+ static DECLARE_WAIT_QUEUE_HEAD(_pending_exceptions_done);
+@@ -310,12 +323,22 @@ static int init_origin_hash(void)
+ _origins = kmalloc(ORIGIN_HASH_SIZE * sizeof(struct list_head),
+ GFP_KERNEL);
+ if (!_origins) {
+- DMERR("unable to allocate memory");
++ DMERR("unable to allocate memory for _origins");
+ return -ENOMEM;
+ }
+-
+ for (i = 0; i < ORIGIN_HASH_SIZE; i++)
+ INIT_LIST_HEAD(_origins + i);
++
++ _dm_origins = kmalloc(ORIGIN_HASH_SIZE * sizeof(struct list_head),
++ GFP_KERNEL);
++ if (!_dm_origins) {
++ DMERR("unable to allocate memory for _dm_origins");
++ kfree(_origins);
++ return -ENOMEM;
++ }
++ for (i = 0; i < ORIGIN_HASH_SIZE; i++)
++ INIT_LIST_HEAD(_dm_origins + i);
++
+ init_rwsem(&_origins_lock);
+
+ return 0;
+@@ -324,6 +347,7 @@ static int init_origin_hash(void)
+ static void exit_origin_hash(void)
+ {
+ kfree(_origins);
++ kfree(_dm_origins);
+ }
+
+ static unsigned origin_hash(struct block_device *bdev)
+@@ -350,6 +374,30 @@ static void __insert_origin(struct origin *o)
+ list_add_tail(&o->hash_list, sl);
+ }
+
++static struct dm_origin *__lookup_dm_origin(struct block_device *origin)
++{
++ struct list_head *ol;
++ struct dm_origin *o;
++
++ ol = &_dm_origins[origin_hash(origin)];
++ list_for_each_entry (o, ol, hash_list)
++ if (bdev_equal(o->dev->bdev, origin))
++ return o;
++
++ return NULL;
++}
++
++static void __insert_dm_origin(struct dm_origin *o)
++{
++ struct list_head *sl = &_dm_origins[origin_hash(o->dev->bdev)];
++ list_add_tail(&o->hash_list, sl);
++}
++
++static void __remove_dm_origin(struct dm_origin *o)
++{
++ list_del(&o->hash_list);
++}
++
+ /*
+ * _origins_lock must be held when calling this function.
+ * Returns number of snapshots registered using the supplied cow device, plus:
+@@ -1840,9 +1888,40 @@ static int snapshot_preresume(struct dm_target *ti)
+ static void snapshot_resume(struct dm_target *ti)
+ {
+ struct dm_snapshot *s = ti->private;
+- struct dm_snapshot *snap_src = NULL, *snap_dest = NULL;
++ struct dm_snapshot *snap_src = NULL, *snap_dest = NULL, *snap_merging = NULL;
++ struct dm_origin *o;
++ struct mapped_device *origin_md = NULL;
++ bool must_restart_merging = false;
+
+ down_read(&_origins_lock);
++
++ o = __lookup_dm_origin(s->origin->bdev);
++ if (o)
++ origin_md = dm_table_get_md(o->ti->table);
++ if (!origin_md) {
++ (void) __find_snapshots_sharing_cow(s, NULL, NULL, &snap_merging);
++ if (snap_merging)
++ origin_md = dm_table_get_md(snap_merging->ti->table);
++ }
++ if (origin_md == dm_table_get_md(ti->table))
++ origin_md = NULL;
++ if (origin_md) {
++ if (dm_hold(origin_md))
++ origin_md = NULL;
++ }
++
++ up_read(&_origins_lock);
++
++ if (origin_md) {
++ dm_internal_suspend(origin_md);
++ if (snap_merging && test_bit(RUNNING_MERGE, &snap_merging->state_bits)) {
++ must_restart_merging = true;
++ stop_merge(snap_merging);
++ }
++ }
++
++ down_read(&_origins_lock);
++
+ (void) __find_snapshots_sharing_cow(s, &snap_src, &snap_dest, NULL);
+ if (snap_src && snap_dest) {
+ down_write(&snap_src->lock);
+@@ -1851,8 +1930,16 @@ static void snapshot_resume(struct dm_target *ti)
+ up_write(&snap_dest->lock);
+ up_write(&snap_src->lock);
+ }
++
+ up_read(&_origins_lock);
+
++ if (origin_md) {
++ if (must_restart_merging)
++ start_merge(snap_merging);
++ dm_internal_resume(origin_md);
++ dm_put(origin_md);
++ }
++
+ /* Now we have correct chunk size, reregister */
+ reregister_snapshot(s);
+
+@@ -2133,11 +2220,6 @@ static int origin_write_extent(struct dm_snapshot *merging_snap,
+ * Origin: maps a linear range of a device, with hooks for snapshotting.
+ */
+
+-struct dm_origin {
+- struct dm_dev *dev;
+- unsigned split_boundary;
+-};
+-
+ /*
+ * Construct an origin mapping: <dev_path>
+ * The context for an origin is merely a 'struct dm_dev *'
+@@ -2166,6 +2248,7 @@ static int origin_ctr(struct dm_target *ti, unsigned int argc, char **argv)
+ goto bad_open;
+ }
+
++ o->ti = ti;
+ ti->private = o;
+ ti->num_flush_bios = 1;
+
+@@ -2180,6 +2263,7 @@ bad_alloc:
+ static void origin_dtr(struct dm_target *ti)
+ {
+ struct dm_origin *o = ti->private;
++
+ dm_put_device(ti, o->dev);
+ kfree(o);
+ }
+@@ -2216,6 +2300,19 @@ static void origin_resume(struct dm_target *ti)
+ struct dm_origin *o = ti->private;
+
+ o->split_boundary = get_origin_minimum_chunksize(o->dev->bdev);
++
++ down_write(&_origins_lock);
++ __insert_dm_origin(o);
++ up_write(&_origins_lock);
++}
++
++static void origin_postsuspend(struct dm_target *ti)
++{
++ struct dm_origin *o = ti->private;
++
++ down_write(&_origins_lock);
++ __remove_dm_origin(o);
++ up_write(&_origins_lock);
+ }
+
+ static void origin_status(struct dm_target *ti, status_type_t type,
+@@ -2258,12 +2355,13 @@ static int origin_iterate_devices(struct dm_target *ti,
+
+ static struct target_type origin_target = {
+ .name = "snapshot-origin",
+- .version = {1, 8, 1},
++ .version = {1, 9, 0},
+ .module = THIS_MODULE,
+ .ctr = origin_ctr,
+ .dtr = origin_dtr,
+ .map = origin_map,
+ .resume = origin_resume,
++ .postsuspend = origin_postsuspend,
+ .status = origin_status,
+ .merge = origin_merge,
+ .iterate_devices = origin_iterate_devices,
+@@ -2271,7 +2369,7 @@ static struct target_type origin_target = {
+
+ static struct target_type snapshot_target = {
+ .name = "snapshot",
+- .version = {1, 12, 0},
++ .version = {1, 13, 0},
+ .module = THIS_MODULE,
+ .ctr = snapshot_ctr,
+ .dtr = snapshot_dtr,
+@@ -2285,7 +2383,7 @@ static struct target_type snapshot_target = {
+
+ static struct target_type merge_target = {
+ .name = dm_snapshot_merge_target_name,
+- .version = {1, 2, 0},
++ .version = {1, 3, 0},
+ .module = THIS_MODULE,
+ .ctr = snapshot_ctr,
+ .dtr = snapshot_dtr,
+diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
+index ac6b0ff161ea..0801e35b9940 100644
+--- a/drivers/md/dm-thin.c
++++ b/drivers/md/dm-thin.c
+@@ -2003,17 +2003,6 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio)
+ return DM_MAPIO_REMAPPED;
+
+ case -ENODATA:
+- if (get_pool_mode(tc->pool) == PM_READ_ONLY) {
+- /*
+- * This block isn't provisioned, and we have no way
+- * of doing so.
+- */
+- handle_unserviceable_bio(tc->pool, bio);
+- cell_defer_no_holder_no_free(tc, &cell1);
+- return DM_MAPIO_SUBMITTED;
+- }
+- /* fall through */
+-
+ case -EWOULDBLOCK:
+ /*
+ * In future, the failed dm_thin_find_block above could
+diff --git a/drivers/md/dm.c b/drivers/md/dm.c
+index cec85c5bae9e..042114fbd200 100644
+--- a/drivers/md/dm.c
++++ b/drivers/md/dm.c
+@@ -2507,6 +2507,19 @@ void dm_get(struct mapped_device *md)
+ BUG_ON(test_bit(DMF_FREEING, &md->flags));
+ }
+
++int dm_hold(struct mapped_device *md)
++{
++ spin_lock(&_minor_lock);
++ if (test_bit(DMF_FREEING, &md->flags)) {
++ spin_unlock(&_minor_lock);
++ return -EBUSY;
++ }
++ dm_get(md);
++ spin_unlock(&_minor_lock);
++ return 0;
++}
++EXPORT_SYMBOL_GPL(dm_hold);
++
+ const char *dm_device_name(struct mapped_device *md)
+ {
+ return md->name;
+@@ -2526,10 +2539,16 @@ static void __dm_destroy(struct mapped_device *md, bool wait)
+ set_bit(DMF_FREEING, &md->flags);
+ spin_unlock(&_minor_lock);
+
++ /*
++ * Take suspend_lock so that presuspend and postsuspend methods
++ * do not race with internal suspend.
++ */
++ mutex_lock(&md->suspend_lock);
+ if (!dm_suspended_md(md)) {
+ dm_table_presuspend_targets(map);
+ dm_table_postsuspend_targets(map);
+ }
++ mutex_unlock(&md->suspend_lock);
+
+ /* dm_put_live_table must be before msleep, otherwise deadlock is possible */
+ dm_put_live_table(md, srcu_idx);
+@@ -2881,6 +2900,7 @@ void dm_internal_suspend(struct mapped_device *md)
+ flush_workqueue(md->wq);
+ dm_wait_for_completion(md, TASK_UNINTERRUPTIBLE);
+ }
++EXPORT_SYMBOL_GPL(dm_internal_suspend);
+
+ void dm_internal_resume(struct mapped_device *md)
+ {
+@@ -2892,6 +2912,7 @@ void dm_internal_resume(struct mapped_device *md)
+ done:
+ mutex_unlock(&md->suspend_lock);
+ }
++EXPORT_SYMBOL_GPL(dm_internal_resume);
+
+ /*-----------------------------------------------------------------
+ * Event notification.
+diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
+index bd2696136eee..177fa31e5aad 100644
+--- a/drivers/mfd/kempld-core.c
++++ b/drivers/mfd/kempld-core.c
+@@ -740,7 +740,7 @@ static int __init kempld_init(void)
+ for (id = kempld_dmi_table;
+ id->matches[0].slot != DMI_NONE; id++)
+ if (strstr(id->ident, force_device_id))
+- if (id->callback && id->callback(id))
++ if (id->callback && !id->callback(id))
+ break;
+ if (id->matches[0].slot == DMI_NONE)
+ return -ENODEV;
+diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
+index e2e3aaf501a2..30f088be6a1a 100644
+--- a/drivers/net/ethernet/amd/pcnet32.c
++++ b/drivers/net/ethernet/amd/pcnet32.c
+@@ -1543,7 +1543,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
+ {
+ struct pcnet32_private *lp;
+ int i, media;
+- int fdx, mii, fset, dxsuflo;
++ int fdx, mii, fset, dxsuflo, sram;
+ int chip_version;
+ char *chipname;
+ struct net_device *dev;
+@@ -1580,7 +1580,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
+ }
+
+ /* initialize variables */
+- fdx = mii = fset = dxsuflo = 0;
++ fdx = mii = fset = dxsuflo = sram = 0;
+ chip_version = (chip_version >> 12) & 0xffff;
+
+ switch (chip_version) {
+@@ -1613,6 +1613,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
+ chipname = "PCnet/FAST III 79C973"; /* PCI */
+ fdx = 1;
+ mii = 1;
++ sram = 1;
+ break;
+ case 0x2626:
+ chipname = "PCnet/Home 79C978"; /* PCI */
+@@ -1636,6 +1637,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
+ chipname = "PCnet/FAST III 79C975"; /* PCI */
+ fdx = 1;
+ mii = 1;
++ sram = 1;
+ break;
+ case 0x2628:
+ chipname = "PCnet/PRO 79C976";
+@@ -1664,6 +1666,31 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
+ dxsuflo = 1;
+ }
+
++ /*
++ * The Am79C973/Am79C975 controllers come with 12K of SRAM
++ * which we can use for the Tx/Rx buffers but most importantly,
++ * the use of SRAM allow us to use the BCR18:NOUFLO bit to avoid
++ * Tx fifo underflows.
++ */
++ if (sram) {
++ /*
++ * The SRAM is being configured in two steps. First we
++ * set the SRAM size in the BCR25:SRAM_SIZE bits. According
++ * to the datasheet, each bit corresponds to a 512-byte
++ * page so we can have at most 24 pages. The SRAM_SIZE
++ * holds the value of the upper 8 bits of the 16-bit SRAM size.
++ * The low 8-bits start at 0x00 and end at 0xff. So the
++ * address range is from 0x0000 up to 0x17ff. Therefore,
++ * the SRAM_SIZE is set to 0x17. The next step is to set
++ * the BCR26:SRAM_BND midway through so the Tx and Rx
++ * buffers can share the SRAM equally.
++ */
++ a->write_bcr(ioaddr, 25, 0x17);
++ a->write_bcr(ioaddr, 26, 0xc);
++ /* And finally enable the NOUFLO bit */
++ a->write_bcr(ioaddr, 18, a->read_bcr(ioaddr, 18) | (1 << 11));
++ }
++
+ dev = alloc_etherdev(sizeof(*lp));
+ if (!dev) {
+ ret = -ENOMEM;
+diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
+index 40b6d1d006d7..af2486965782 100644
+--- a/drivers/net/wireless/rtlwifi/base.c
++++ b/drivers/net/wireless/rtlwifi/base.c
+@@ -1314,8 +1314,11 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
+ }
+
+ return true;
+- } else if (0x86DD == ether_type) {
+- return true;
++ } else if (ETH_P_IPV6 == ether_type) {
++ /* TODO: Handle any IPv6 cases that need special handling.
++ * For now, always return false
++ */
++ goto end;
+ }
+
+ end:
+diff --git a/drivers/of/irq.c b/drivers/of/irq.c
+index 1471e0a223a5..b97363adca0b 100644
+--- a/drivers/of/irq.c
++++ b/drivers/of/irq.c
+@@ -290,7 +290,7 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_ar
+ struct device_node *p;
+ const __be32 *intspec, *tmp, *addr;
+ u32 intsize, intlen;
+- int i, res = -EINVAL;
++ int i, res;
+
+ pr_debug("of_irq_parse_one: dev=%s, index=%d\n", of_node_full_name(device), index);
+
+@@ -323,15 +323,19 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_ar
+
+ /* Get size of interrupt specifier */
+ tmp = of_get_property(p, "#interrupt-cells", NULL);
+- if (tmp == NULL)
++ if (tmp == NULL) {
++ res = -EINVAL;
+ goto out;
++ }
+ intsize = be32_to_cpu(*tmp);
+
+ pr_debug(" intsize=%d intlen=%d\n", intsize, intlen);
+
+ /* Check index */
+- if ((index + 1) * intsize > intlen)
++ if ((index + 1) * intsize > intlen) {
++ res = -EINVAL;
+ goto out;
++ }
+
+ /* Copy intspec into irq structure */
+ intspec += index * intsize;
+diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
+index ff5eec5af817..2733112b3527 100644
+--- a/drivers/phy/phy-core.c
++++ b/drivers/phy/phy-core.c
+@@ -51,7 +51,9 @@ static void devm_phy_consume(struct device *dev, void *res)
+
+ static int devm_phy_match(struct device *dev, void *res, void *match_data)
+ {
+- return res == match_data;
++ struct phy **phy = res;
++
++ return *phy == match_data;
+ }
+
+ static struct phy *phy_lookup(struct device *device, const char *port)
+diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
+index 1878e5b567ef..1a7f5fc11623 100644
+--- a/drivers/regulator/palmas-regulator.c
++++ b/drivers/regulator/palmas-regulator.c
+@@ -1572,6 +1572,10 @@ static int palmas_regulators_probe(struct platform_device *pdev)
+ if (!pmic)
+ return -ENOMEM;
+
++ if (of_device_is_compatible(node, "ti,tps659038-pmic"))
++ palmas_generic_regs_info[PALMAS_REG_REGEN2].ctrl_addr =
++ TPS659038_REGEN2_CTRL;
++
+ pmic->dev = &pdev->dev;
+ pmic->palmas = palmas;
+ palmas->pmic = pmic;
+diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
+index 73f9feecda72..272a2646a759 100644
+--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
++++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
+@@ -1598,7 +1598,7 @@ static int tcm_qla2xxx_check_initiator_node_acl(
+ /*
+ * Finally register the new FC Nexus with TCM
+ */
+- __transport_register_session(se_nacl->se_tpg, se_nacl, se_sess, sess);
++ transport_register_session(se_nacl->se_tpg, se_nacl, se_sess, sess);
+
+ return 0;
+ }
+diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
+index 9f83d2950748..6976f8aa8562 100644
+--- a/drivers/spi/spi-qup.c
++++ b/drivers/spi/spi-qup.c
+@@ -489,7 +489,7 @@ static int spi_qup_probe(struct platform_device *pdev)
+ struct resource *res;
+ struct device *dev;
+ void __iomem *base;
+- u32 max_freq, iomode;
++ u32 max_freq, iomode, num_cs;
+ int ret, irq, size;
+
+ dev = &pdev->dev;
+@@ -541,10 +541,11 @@ static int spi_qup_probe(struct platform_device *pdev)
+ }
+
+ /* use num-cs unless not present or out of range */
+- if (of_property_read_u16(dev->of_node, "num-cs",
+- &master->num_chipselect) ||
+- (master->num_chipselect > SPI_NUM_CHIPSELECTS))
++ if (of_property_read_u32(dev->of_node, "num-cs", &num_cs) ||
++ num_cs > SPI_NUM_CHIPSELECTS)
+ master->num_chipselect = SPI_NUM_CHIPSELECTS;
++ else
++ master->num_chipselect = num_cs;
+
+ master->bus_num = pdev->id;
+ master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP;
+diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
+index 50f20f243981..1c72be19e70e 100644
+--- a/drivers/spi/spi.c
++++ b/drivers/spi/spi.c
+@@ -1073,13 +1073,14 @@ void spi_finalize_current_message(struct spi_master *master)
+ "failed to unprepare message: %d\n", ret);
+ }
+ }
++
++ trace_spi_message_done(mesg);
++
+ master->cur_msg_prepared = false;
+
+ mesg->state = NULL;
+ if (mesg->complete)
+ mesg->complete(mesg->context);
+-
+- trace_spi_message_done(mesg);
+ }
+ EXPORT_SYMBOL_GPL(spi_finalize_current_message);
+
+diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
+index e505af91bfd0..fb62e8dd11ba 100644
+--- a/drivers/staging/vt6655/rf.c
++++ b/drivers/staging/vt6655/rf.c
+@@ -923,6 +923,7 @@ bool RFbSetPower(
+ break;
+ case RATE_6M:
+ case RATE_9M:
++ case RATE_12M:
+ case RATE_18M:
+ byPwr = pDevice->abyOFDMPwrTbl[uCH];
+ if (pDevice->byRFType == RF_UW2452)
+diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
+index c42cde59f598..c4286ccac320 100644
+--- a/drivers/staging/vt6656/rf.c
++++ b/drivers/staging/vt6656/rf.c
+@@ -640,6 +640,7 @@ int vnt_rf_setpower(struct vnt_private *priv, u32 rate, u32 channel)
+ break;
+ case RATE_6M:
+ case RATE_9M:
++ case RATE_12M:
+ case RATE_18M:
+ case RATE_24M:
+ case RATE_36M:
+diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c
+index 97b486c3dda1..583e755d8091 100644
+--- a/drivers/target/tcm_fc/tfc_io.c
++++ b/drivers/target/tcm_fc/tfc_io.c
+@@ -359,7 +359,7 @@ void ft_invl_hw_context(struct ft_cmd *cmd)
+ ep = fc_seq_exch(seq);
+ if (ep) {
+ lport = ep->lp;
+- if (lport && (ep->xid <= lport->lro_xid))
++ if (lport && (ep->xid <= lport->lro_xid)) {
+ /*
+ * "ddp_done" trigger invalidation of HW
+ * specific DDP context
+@@ -374,6 +374,7 @@ void ft_invl_hw_context(struct ft_cmd *cmd)
+ * identified using ep->xid)
+ */
+ cmd->was_ddp_setup = 0;
++ }
+ }
+ }
+ }
+diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
+index 0444d3f8971a..c42bf8da56db 100644
+--- a/drivers/usb/chipidea/udc.c
++++ b/drivers/usb/chipidea/udc.c
+@@ -933,6 +933,13 @@ __acquires(hwep->lock)
+ return retval;
+ }
+
++static int otg_a_alt_hnp_support(struct ci_hdrc *ci)
++{
++ dev_warn(&ci->gadget.dev,
++ "connect the device to an alternate port if you want HNP\n");
++ return isr_setup_status_phase(ci);
++}
++
+ /**
+ * isr_setup_packet_handler: setup packet handler
+ * @ci: UDC descriptor
+@@ -1065,6 +1072,10 @@ __acquires(ci->lock)
+ ci);
+ }
+ break;
++ case USB_DEVICE_A_ALT_HNP_SUPPORT:
++ if (ci_otg_is_fsm_mode(ci))
++ err = otg_a_alt_hnp_support(ci);
++ break;
+ default:
+ goto delegate;
+ }
+diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c
+index 98e8340a5bb1..c812fefe0e50 100644
+--- a/drivers/usb/common/usb-otg-fsm.c
++++ b/drivers/usb/common/usb-otg-fsm.c
+@@ -150,9 +150,9 @@ static int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state)
+ break;
+ case OTG_STATE_B_PERIPHERAL:
+ otg_chrg_vbus(fsm, 0);
+- otg_loc_conn(fsm, 1);
+ otg_loc_sof(fsm, 0);
+ otg_set_protocol(fsm, PROTO_GADGET);
++ otg_loc_conn(fsm, 1);
+ break;
+ case OTG_STATE_B_WAIT_ACON:
+ otg_chrg_vbus(fsm, 0);
+@@ -213,10 +213,10 @@ static int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state)
+
+ break;
+ case OTG_STATE_A_PERIPHERAL:
+- otg_loc_conn(fsm, 1);
+ otg_loc_sof(fsm, 0);
+ otg_set_protocol(fsm, PROTO_GADGET);
+ otg_drv_vbus(fsm, 1);
++ otg_loc_conn(fsm, 1);
+ otg_add_timer(fsm, A_BIDL_ADIS);
+ break;
+ case OTG_STATE_A_WAIT_VFALL:
+diff --git a/drivers/usb/phy/phy-am335x-control.c b/drivers/usb/phy/phy-am335x-control.c
+index 35b6083b7999..d5eca7b9c555 100644
+--- a/drivers/usb/phy/phy-am335x-control.c
++++ b/drivers/usb/phy/phy-am335x-control.c
+@@ -126,6 +126,9 @@ struct phy_control *am335x_get_phy_control(struct device *dev)
+ return NULL;
+
+ dev = bus_find_device(&platform_bus_type, NULL, node, match);
++ if (!dev)
++ return NULL;
++
+ ctrl_usb = dev_get_drvdata(dev);
+ if (!ctrl_usb)
+ return NULL;
+diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h
+index cd047d0cc7a6..cd4ba61330c8 100644
+--- a/drivers/usb/storage/unusual_uas.h
++++ b/drivers/usb/storage/unusual_uas.h
+@@ -103,6 +103,13 @@ UNUSUAL_DEV(0x0bc2, 0xab2a, 0x0000, 0x9999,
+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+ US_FL_NO_ATA_1X),
+
++/* Reported-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> */
++UNUSUAL_DEV(0x13fd, 0x3940, 0x0000, 0x9999,
++ "Initio Corporation",
++ "",
++ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
++ US_FL_NO_ATA_1X),
++
+ /* Reported-by: Tom Arild Naess <tanaess@gmail.com> */
+ UNUSUAL_DEV(0x152d, 0x0539, 0x0000, 0x9999,
+ "JMicron",
+diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
+index c9703d4d6f67..440d78f39c01 100644
+--- a/drivers/virtio/virtio_balloon.c
++++ b/drivers/virtio/virtio_balloon.c
+@@ -28,6 +28,7 @@
+ #include <linux/slab.h>
+ #include <linux/module.h>
+ #include <linux/balloon_compaction.h>
++#include <linux/wait.h>
+
+ /*
+ * Balloon device works in 4K page units. So each page is pointed to by
+@@ -290,17 +291,25 @@ static void update_balloon_size(struct virtio_balloon *vb)
+ static int balloon(void *_vballoon)
+ {
+ struct virtio_balloon *vb = _vballoon;
++ DEFINE_WAIT_FUNC(wait, woken_wake_function);
+
+ set_freezable();
+ while (!kthread_should_stop()) {
+ s64 diff;
+
+ try_to_freeze();
+- wait_event_interruptible(vb->config_change,
+- (diff = towards_target(vb)) != 0
+- || vb->need_stats_update
+- || kthread_should_stop()
+- || freezing(current));
++
++ add_wait_queue(&vb->config_change, &wait);
++ for (;;) {
++ if ((diff = towards_target(vb)) != 0 ||
++ vb->need_stats_update ||
++ kthread_should_stop() ||
++ freezing(current))
++ break;
++ wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
++ }
++ remove_wait_queue(&vb->config_change, &wait);
++
+ if (vb->need_stats_update)
+ stats_handle_request(vb);
+ if (diff > 0)
+@@ -443,6 +452,8 @@ static int virtballoon_probe(struct virtio_device *vdev)
+ if (err)
+ goto out_free_vb;
+
++ virtio_device_ready(vdev);
++
+ vb->thread = kthread_run(balloon, vb, "vballoon");
+ if (IS_ERR(vb->thread)) {
+ err = PTR_ERR(vb->thread);
+diff --git a/fs/hfsplus/brec.c b/fs/hfsplus/brec.c
+index 6e560d56094b..754fdf8c6356 100644
+--- a/fs/hfsplus/brec.c
++++ b/fs/hfsplus/brec.c
+@@ -131,13 +131,16 @@ skip:
+ hfs_bnode_write(node, entry, data_off + key_len, entry_len);
+ hfs_bnode_dump(node);
+
+- if (new_node) {
+- /* update parent key if we inserted a key
+- * at the start of the first node
+- */
+- if (!rec && new_node != node)
+- hfs_brec_update_parent(fd);
++ /*
++ * update parent key if we inserted a key
++ * at the start of the node and it is not the new node
++ */
++ if (!rec && new_node != node) {
++ hfs_bnode_read_key(node, fd->search_key, data_off + size);
++ hfs_brec_update_parent(fd);
++ }
+
++ if (new_node) {
+ hfs_bnode_put(fd->bnode);
+ if (!new_node->parent) {
+ hfs_btree_inc_height(tree);
+@@ -168,9 +171,6 @@ skip:
+ goto again;
+ }
+
+- if (!rec)
+- hfs_brec_update_parent(fd);
+-
+ return 0;
+ }
+
+@@ -370,6 +370,8 @@ again:
+ if (IS_ERR(parent))
+ return PTR_ERR(parent);
+ __hfs_brec_find(parent, fd, hfs_find_rec_by_key);
++ if (fd->record < 0)
++ return -ENOENT;
+ hfs_bnode_dump(parent);
+ rec = fd->record;
+
+diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
+index e1707de043ae..c51706b7a36e 100644
+--- a/include/linux/device-mapper.h
++++ b/include/linux/device-mapper.h
+@@ -366,6 +366,7 @@ int dm_create(int minor, struct mapped_device **md);
+ */
+ struct mapped_device *dm_get_md(dev_t dev);
+ void dm_get(struct mapped_device *md);
++int dm_hold(struct mapped_device *md);
+ void dm_put(struct mapped_device *md);
+
+ /*
+diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
+index fb0390a1a498..ee7b1ce7a6f8 100644
+--- a/include/linux/mfd/palmas.h
++++ b/include/linux/mfd/palmas.h
+@@ -2999,6 +2999,9 @@ enum usb_irq_events {
+ #define PALMAS_GPADC_TRIM15 0x0E
+ #define PALMAS_GPADC_TRIM16 0x0F
+
++/* TPS659038 regen2_ctrl offset iss different from palmas */
++#define TPS659038_REGEN2_CTRL 0x12
++
+ /* TPS65917 Interrupt registers */
+
+ /* Registers for function INTERRUPT */
+diff --git a/include/linux/wait.h b/include/linux/wait.h
+index e4a8eb9312ea..fc0e99395fbb 100644
+--- a/include/linux/wait.h
++++ b/include/linux/wait.h
+@@ -13,9 +13,12 @@ typedef struct __wait_queue wait_queue_t;
+ typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key);
+ int default_wake_function(wait_queue_t *wait, unsigned mode, int flags, void *key);
+
++/* __wait_queue::flags */
++#define WQ_FLAG_EXCLUSIVE 0x01
++#define WQ_FLAG_WOKEN 0x02
++
+ struct __wait_queue {
+ unsigned int flags;
+-#define WQ_FLAG_EXCLUSIVE 0x01
+ void *private;
+ wait_queue_func_t func;
+ struct list_head task_list;
+@@ -830,6 +833,8 @@ void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int sta
+ long prepare_to_wait_event(wait_queue_head_t *q, wait_queue_t *wait, int state);
+ void finish_wait(wait_queue_head_t *q, wait_queue_t *wait);
+ void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, unsigned int mode, void *key);
++long wait_woken(wait_queue_t *wait, unsigned mode, long timeout);
++int woken_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
+ int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
+ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
+
+diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h
+index 23d561512f64..22317d2b52ab 100644
+--- a/include/trace/events/regmap.h
++++ b/include/trace/events/regmap.h
+@@ -7,27 +7,26 @@
+ #include <linux/ktime.h>
+ #include <linux/tracepoint.h>
+
+-struct device;
+-struct regmap;
++#include "../../../drivers/base/regmap/internal.h"
+
+ /*
+ * Log register events
+ */
+ DECLARE_EVENT_CLASS(regmap_reg,
+
+- TP_PROTO(struct device *dev, unsigned int reg,
++ TP_PROTO(struct regmap *map, unsigned int reg,
+ unsigned int val),
+
+- TP_ARGS(dev, reg, val),
++ TP_ARGS(map, reg, val),
+
+ TP_STRUCT__entry(
+- __string( name, dev_name(dev) )
+- __field( unsigned int, reg )
+- __field( unsigned int, val )
++ __string( name, regmap_name(map) )
++ __field( unsigned int, reg )
++ __field( unsigned int, val )
+ ),
+
+ TP_fast_assign(
+- __assign_str(name, dev_name(dev));
++ __assign_str(name, regmap_name(map));
+ __entry->reg = reg;
+ __entry->val = val;
+ ),
+@@ -39,45 +38,45 @@ DECLARE_EVENT_CLASS(regmap_reg,
+
+ DEFINE_EVENT(regmap_reg, regmap_reg_write,
+
+- TP_PROTO(struct device *dev, unsigned int reg,
++ TP_PROTO(struct regmap *map, unsigned int reg,
+ unsigned int val),
+
+- TP_ARGS(dev, reg, val)
++ TP_ARGS(map, reg, val)
+
+ );
+
+ DEFINE_EVENT(regmap_reg, regmap_reg_read,
+
+- TP_PROTO(struct device *dev, unsigned int reg,
++ TP_PROTO(struct regmap *map, unsigned int reg,
+ unsigned int val),
+
+- TP_ARGS(dev, reg, val)
++ TP_ARGS(map, reg, val)
+
+ );
+
+ DEFINE_EVENT(regmap_reg, regmap_reg_read_cache,
+
+- TP_PROTO(struct device *dev, unsigned int reg,
++ TP_PROTO(struct regmap *map, unsigned int reg,
+ unsigned int val),
+
+- TP_ARGS(dev, reg, val)
++ TP_ARGS(map, reg, val)
+
+ );
+
+ DECLARE_EVENT_CLASS(regmap_block,
+
+- TP_PROTO(struct device *dev, unsigned int reg, int count),
++ TP_PROTO(struct regmap *map, unsigned int reg, int count),
+
+- TP_ARGS(dev, reg, count),
++ TP_ARGS(map, reg, count),
+
+ TP_STRUCT__entry(
+- __string( name, dev_name(dev) )
+- __field( unsigned int, reg )
+- __field( int, count )
++ __string( name, regmap_name(map) )
++ __field( unsigned int, reg )
++ __field( int, count )
+ ),
+
+ TP_fast_assign(
+- __assign_str(name, dev_name(dev));
++ __assign_str(name, regmap_name(map));
+ __entry->reg = reg;
+ __entry->count = count;
+ ),
+@@ -89,48 +88,48 @@ DECLARE_EVENT_CLASS(regmap_block,
+
+ DEFINE_EVENT(regmap_block, regmap_hw_read_start,
+
+- TP_PROTO(struct device *dev, unsigned int reg, int count),
++ TP_PROTO(struct regmap *map, unsigned int reg, int count),
+
+- TP_ARGS(dev, reg, count)
++ TP_ARGS(map, reg, count)
+ );
+
+ DEFINE_EVENT(regmap_block, regmap_hw_read_done,
+
+- TP_PROTO(struct device *dev, unsigned int reg, int count),
++ TP_PROTO(struct regmap *map, unsigned int reg, int count),
+
+- TP_ARGS(dev, reg, count)
++ TP_ARGS(map, reg, count)
+ );
+
+ DEFINE_EVENT(regmap_block, regmap_hw_write_start,
+
+- TP_PROTO(struct device *dev, unsigned int reg, int count),
++ TP_PROTO(struct regmap *map, unsigned int reg, int count),
+
+- TP_ARGS(dev, reg, count)
++ TP_ARGS(map, reg, count)
+ );
+
+ DEFINE_EVENT(regmap_block, regmap_hw_write_done,
+
+- TP_PROTO(struct device *dev, unsigned int reg, int count),
++ TP_PROTO(struct regmap *map, unsigned int reg, int count),
+
+- TP_ARGS(dev, reg, count)
++ TP_ARGS(map, reg, count)
+ );
+
+ TRACE_EVENT(regcache_sync,
+
+- TP_PROTO(struct device *dev, const char *type,
++ TP_PROTO(struct regmap *map, const char *type,
+ const char *status),
+
+- TP_ARGS(dev, type, status),
++ TP_ARGS(map, type, status),
+
+ TP_STRUCT__entry(
+- __string( name, dev_name(dev) )
+- __string( status, status )
+- __string( type, type )
+- __field( int, type )
++ __string( name, regmap_name(map) )
++ __string( status, status )
++ __string( type, type )
++ __field( int, type )
+ ),
+
+ TP_fast_assign(
+- __assign_str(name, dev_name(dev));
++ __assign_str(name, regmap_name(map));
+ __assign_str(status, status);
+ __assign_str(type, type);
+ ),
+@@ -141,17 +140,17 @@ TRACE_EVENT(regcache_sync,
+
+ DECLARE_EVENT_CLASS(regmap_bool,
+
+- TP_PROTO(struct device *dev, bool flag),
++ TP_PROTO(struct regmap *map, bool flag),
+
+- TP_ARGS(dev, flag),
++ TP_ARGS(map, flag),
+
+ TP_STRUCT__entry(
+- __string( name, dev_name(dev) )
+- __field( int, flag )
++ __string( name, regmap_name(map) )
++ __field( int, flag )
+ ),
+
+ TP_fast_assign(
+- __assign_str(name, dev_name(dev));
++ __assign_str(name, regmap_name(map));
+ __entry->flag = flag;
+ ),
+
+@@ -161,32 +160,32 @@ DECLARE_EVENT_CLASS(regmap_bool,
+
+ DEFINE_EVENT(regmap_bool, regmap_cache_only,
+
+- TP_PROTO(struct device *dev, bool flag),
++ TP_PROTO(struct regmap *map, bool flag),
+
+- TP_ARGS(dev, flag)
++ TP_ARGS(map, flag)
+
+ );
+
+ DEFINE_EVENT(regmap_bool, regmap_cache_bypass,
+
+- TP_PROTO(struct device *dev, bool flag),
++ TP_PROTO(struct regmap *map, bool flag),
+
+- TP_ARGS(dev, flag)
++ TP_ARGS(map, flag)
+
+ );
+
+ DECLARE_EVENT_CLASS(regmap_async,
+
+- TP_PROTO(struct device *dev),
++ TP_PROTO(struct regmap *map),
+
+- TP_ARGS(dev),
++ TP_ARGS(map),
+
+ TP_STRUCT__entry(
+- __string( name, dev_name(dev) )
++ __string( name, regmap_name(map) )
+ ),
+
+ TP_fast_assign(
+- __assign_str(name, dev_name(dev));
++ __assign_str(name, regmap_name(map));
+ ),
+
+ TP_printk("%s", __get_str(name))
+@@ -194,50 +193,50 @@ DECLARE_EVENT_CLASS(regmap_async,
+
+ DEFINE_EVENT(regmap_block, regmap_async_write_start,
+
+- TP_PROTO(struct device *dev, unsigned int reg, int count),
++ TP_PROTO(struct regmap *map, unsigned int reg, int count),
+
+- TP_ARGS(dev, reg, count)
++ TP_ARGS(map, reg, count)
+ );
+
+ DEFINE_EVENT(regmap_async, regmap_async_io_complete,
+
+- TP_PROTO(struct device *dev),
++ TP_PROTO(struct regmap *map),
+
+- TP_ARGS(dev)
++ TP_ARGS(map)
+
+ );
+
+ DEFINE_EVENT(regmap_async, regmap_async_complete_start,
+
+- TP_PROTO(struct device *dev),
++ TP_PROTO(struct regmap *map),
+
+- TP_ARGS(dev)
++ TP_ARGS(map)
+
+ );
+
+ DEFINE_EVENT(regmap_async, regmap_async_complete_done,
+
+- TP_PROTO(struct device *dev),
++ TP_PROTO(struct regmap *map),
+
+- TP_ARGS(dev)
++ TP_ARGS(map)
+
+ );
+
+ TRACE_EVENT(regcache_drop_region,
+
+- TP_PROTO(struct device *dev, unsigned int from,
++ TP_PROTO(struct regmap *map, unsigned int from,
+ unsigned int to),
+
+- TP_ARGS(dev, from, to),
++ TP_ARGS(map, from, to),
+
+ TP_STRUCT__entry(
+- __string( name, dev_name(dev) )
+- __field( unsigned int, from )
+- __field( unsigned int, to )
++ __string( name, regmap_name(map) )
++ __field( unsigned int, from )
++ __field( unsigned int, to )
+ ),
+
+ TP_fast_assign(
+- __assign_str(name, dev_name(dev));
++ __assign_str(name, regmap_name(map));
+ __entry->from = from;
+ __entry->to = to;
+ ),
+diff --git a/kernel/events/core.c b/kernel/events/core.c
+index 2ab023803945..e631dacdb165 100644
+--- a/kernel/events/core.c
++++ b/kernel/events/core.c
+@@ -4412,6 +4412,13 @@ static void perf_pending_event(struct irq_work *entry)
+ {
+ struct perf_event *event = container_of(entry,
+ struct perf_event, pending);
++ int rctx;
++
++ rctx = perf_swevent_get_recursion_context();
++ /*
++ * If we 'fail' here, that's OK, it means recursion is already disabled
++ * and we won't recurse 'further'.
++ */
+
+ if (event->pending_disable) {
+ event->pending_disable = 0;
+@@ -4422,6 +4429,9 @@ static void perf_pending_event(struct irq_work *entry)
+ event->pending_wakeup = 0;
+ perf_event_wakeup(event);
+ }
++
++ if (rctx >= 0)
++ perf_swevent_put_recursion_context(rctx);
+ }
+
+ /*
+diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c
+index 5a62915f47a8..4dae1885db6f 100644
+--- a/kernel/sched/wait.c
++++ b/kernel/sched/wait.c
+@@ -297,6 +297,67 @@ int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *
+ }
+ EXPORT_SYMBOL(autoremove_wake_function);
+
++
++/*
++ * DEFINE_WAIT_FUNC(wait, woken_wake_func);
++ *
++ * add_wait_queue(&wq, &wait);
++ * for (;;) {
++ * if (condition)
++ * break;
++ *
++ * p->state = mode; condition = true;
++ * smp_mb(); // A smp_wmb(); // C
++ * if (!wait->flags & WQ_FLAG_WOKEN) wait->flags |= WQ_FLAG_WOKEN;
++ * schedule() try_to_wake_up();
++ * p->state = TASK_RUNNING; ~~~~~~~~~~~~~~~~~~
++ * wait->flags &= ~WQ_FLAG_WOKEN; condition = true;
++ * smp_mb() // B smp_wmb(); // C
++ * wait->flags |= WQ_FLAG_WOKEN;
++ * }
++ * remove_wait_queue(&wq, &wait);
++ *
++ */
++long wait_woken(wait_queue_t *wait, unsigned mode, long timeout)
++{
++ set_current_state(mode); /* A */
++ /*
++ * The above implies an smp_mb(), which matches with the smp_wmb() from
++ * woken_wake_function() such that if we observe WQ_FLAG_WOKEN we must
++ * also observe all state before the wakeup.
++ */
++ if (!(wait->flags & WQ_FLAG_WOKEN))
++ timeout = schedule_timeout(timeout);
++ __set_current_state(TASK_RUNNING);
++
++ /*
++ * The below implies an smp_mb(), it too pairs with the smp_wmb() from
++ * woken_wake_function() such that we must either observe the wait
++ * condition being true _OR_ WQ_FLAG_WOKEN such that we will not miss
++ * an event.
++ */
++ set_mb(wait->flags, wait->flags & ~WQ_FLAG_WOKEN); /* B */
++
++ return timeout;
++}
++EXPORT_SYMBOL(wait_woken);
++
++int woken_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key)
++{
++ /*
++ * Although this function is called under waitqueue lock, LOCK
++ * doesn't imply write barrier and the users expects write
++ * barrier semantics on wakeup functions. The following
++ * smp_wmb() is equivalent to smp_wmb() in try_to_wake_up()
++ * and is paired with set_mb() in wait_woken().
++ */
++ smp_wmb(); /* C */
++ wait->flags |= WQ_FLAG_WOKEN;
++
++ return default_wake_function(wait, mode, sync, key);
++}
++EXPORT_SYMBOL(woken_wake_function);
++
+ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *arg)
+ {
+ struct wait_bit_key *key = arg;
+diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
+index 8d1653caffdb..56a65536c8f1 100644
+--- a/net/ceph/messenger.c
++++ b/net/ceph/messenger.c
+@@ -484,7 +484,7 @@ static int ceph_tcp_connect(struct ceph_connection *con)
+ IPPROTO_TCP, &sock);
+ if (ret)
+ return ret;
+- sock->sk->sk_allocation = GFP_NOFS | __GFP_MEMALLOC;
++ sock->sk->sk_allocation = GFP_NOFS;
+
+ #ifdef CONFIG_LOCKDEP
+ lockdep_set_class(&sock->sk->sk_lock, &socket_class);
+@@ -510,8 +510,6 @@ static int ceph_tcp_connect(struct ceph_connection *con)
+ return ret;
+ }
+
+- sk_set_memalloc(sock->sk);
+-
+ con->sock = sock;
+ return 0;
+ }
+@@ -2772,11 +2770,8 @@ static void con_work(struct work_struct *work)
+ {
+ struct ceph_connection *con = container_of(work, struct ceph_connection,
+ work.work);
+- unsigned long pflags = current->flags;
+ bool fault;
+
+- current->flags |= PF_MEMALLOC;
+-
+ mutex_lock(&con->mutex);
+ while (true) {
+ int ret;
+@@ -2830,8 +2825,6 @@ static void con_work(struct work_struct *work)
+ con_fault_finish(con);
+
+ con->ops->put(con);
+-
+- tsk_restore_flags(current, pflags, PF_MEMALLOC);
+ }
+
+ /*
+diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
+index 8c68da30595d..91c1aca65ae9 100644
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -58,13 +58,24 @@ struct ieee80211_local;
+ #define IEEE80211_UNSET_POWER_LEVEL INT_MIN
+
+ /*
+- * Some APs experience problems when working with U-APSD. Decrease the
+- * probability of that happening by using legacy mode for all ACs but VO.
+- * The AP that caused us trouble was a Cisco 4410N. It ignores our
+- * setting, and always treats non-VO ACs as legacy.
++ * Some APs experience problems when working with U-APSD. Decreasing the
++ * probability of that happening by using legacy mode for all ACs but VO isn't
++ * enough.
++ *
++ * Cisco 4410N originally forced us to enable VO by default only because it
++ * treated non-VO ACs as legacy.
++ *
++ * However some APs (notably Netgear R7000) silently reclassify packets to
++ * different ACs. Since u-APSD ACs require trigger frames for frame retrieval
++ * clients would never see some frames (e.g. ARP responses) or would fetch them
++ * accidentally after a long time.
++ *
++ * It makes little sense to enable u-APSD queues by default because it needs
++ * userspace applications to be aware of it to actually take advantage of the
++ * possible additional powersavings. Implicitly depending on driver autotrigger
++ * frame support doesn't make much sense.
+ */
+-#define IEEE80211_DEFAULT_UAPSD_QUEUES \
+- IEEE80211_WMM_IE_STA_QOSINFO_AC_VO
++#define IEEE80211_DEFAULT_UAPSD_QUEUES 0
+
+ #define IEEE80211_DEFAULT_MAX_SP_LEN \
+ IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL
+diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
+index 7d6379bd2cb8..bb77d6d7258a 100644
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -2108,6 +2108,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
+ hdr = (struct ieee80211_hdr *) skb->data;
+ mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen);
+
++ if (ieee80211_drop_unencrypted(rx, hdr->frame_control))
++ return RX_DROP_MONITOR;
++
+ /* frame is in RMC, don't forward */
+ if (ieee80211_is_data(hdr->frame_control) &&
+ is_multicast_ether_addr(hdr->addr1) &&
+diff --git a/net/mac80211/util.c b/net/mac80211/util.c
+index 3c61060a4d2b..0043256df486 100644
+--- a/net/mac80211/util.c
++++ b/net/mac80211/util.c
+@@ -3050,7 +3050,7 @@ int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata,
+ wdev_iter = &sdata_iter->wdev;
+
+ if (sdata_iter == sdata ||
+- rcu_access_pointer(sdata_iter->vif.chanctx_conf) == NULL ||
++ !ieee80211_sdata_running(sdata_iter) ||
+ local->hw.wiphy->software_iftypes & BIT(wdev_iter->iftype))
+ continue;
+
+diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
+index 213048ad31c7..5fed79cfe45a 100644
+--- a/net/wireless/nl80211.c
++++ b/net/wireless/nl80211.c
+@@ -4311,6 +4311,16 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
+ if (parse_station_flags(info, dev->ieee80211_ptr->iftype, &params))
+ return -EINVAL;
+
++ /* HT/VHT requires QoS, but if we don't have that just ignore HT/VHT
++ * as userspace might just pass through the capabilities from the IEs
++ * directly, rather than enforcing this restriction and returning an
++ * error in this case.
++ */
++ if (!(params.sta_flags_set & BIT(NL80211_STA_FLAG_WME))) {
++ params.ht_capa = NULL;
++ params.vht_capa = NULL;
++ }
++
+ /* When you run into this, adjust the code below for the new flag */
+ BUILD_BUG_ON(NL80211_STA_FLAG_MAX != 7);
+
+diff --git a/sound/soc/codecs/adav80x.c b/sound/soc/codecs/adav80x.c
+index ce3cdca9fc62..01ab70a7f59f 100644
+--- a/sound/soc/codecs/adav80x.c
++++ b/sound/soc/codecs/adav80x.c
+@@ -317,7 +317,7 @@ static int adav80x_put_deemph(struct snd_kcontrol *kcontrol,
+ {
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);
+- unsigned int deemph = ucontrol->value.enumerated.item[0];
++ unsigned int deemph = ucontrol->value.integer.value[0];
+
+ if (deemph > 1)
+ return -EINVAL;
+@@ -333,7 +333,7 @@ static int adav80x_get_deemph(struct snd_kcontrol *kcontrol,
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);
+
+- ucontrol->value.enumerated.item[0] = adav80x->deemph;
++ ucontrol->value.integer.value[0] = adav80x->deemph;
+ return 0;
+ };
+
+diff --git a/sound/soc/codecs/ak4641.c b/sound/soc/codecs/ak4641.c
+index 7afe8f482088..570ec04fe411 100644
+--- a/sound/soc/codecs/ak4641.c
++++ b/sound/soc/codecs/ak4641.c
+@@ -76,7 +76,7 @@ static int ak4641_put_deemph(struct snd_kcontrol *kcontrol,
+ {
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct ak4641_priv *ak4641 = snd_soc_codec_get_drvdata(codec);
+- int deemph = ucontrol->value.enumerated.item[0];
++ int deemph = ucontrol->value.integer.value[0];
+
+ if (deemph > 1)
+ return -EINVAL;
+@@ -92,7 +92,7 @@ static int ak4641_get_deemph(struct snd_kcontrol *kcontrol,
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct ak4641_priv *ak4641 = snd_soc_codec_get_drvdata(codec);
+
+- ucontrol->value.enumerated.item[0] = ak4641->deemph;
++ ucontrol->value.integer.value[0] = ak4641->deemph;
+ return 0;
+ };
+
+diff --git a/sound/soc/codecs/ak4671.c b/sound/soc/codecs/ak4671.c
+index 998fa0c5a0b9..61a31802cf79 100644
+--- a/sound/soc/codecs/ak4671.c
++++ b/sound/soc/codecs/ak4671.c
+@@ -343,25 +343,25 @@ static const struct snd_soc_dapm_widget ak4671_dapm_widgets[] = {
+ };
+
+ static const struct snd_soc_dapm_route ak4671_intercon[] = {
+- {"DAC Left", "NULL", "PMPLL"},
+- {"DAC Right", "NULL", "PMPLL"},
+- {"ADC Left", "NULL", "PMPLL"},
+- {"ADC Right", "NULL", "PMPLL"},
++ {"DAC Left", NULL, "PMPLL"},
++ {"DAC Right", NULL, "PMPLL"},
++ {"ADC Left", NULL, "PMPLL"},
++ {"ADC Right", NULL, "PMPLL"},
+
+ /* Outputs */
+- {"LOUT1", "NULL", "LOUT1 Mixer"},
+- {"ROUT1", "NULL", "ROUT1 Mixer"},
+- {"LOUT2", "NULL", "LOUT2 Mix Amp"},
+- {"ROUT2", "NULL", "ROUT2 Mix Amp"},
+- {"LOUT3", "NULL", "LOUT3 Mixer"},
+- {"ROUT3", "NULL", "ROUT3 Mixer"},
++ {"LOUT1", NULL, "LOUT1 Mixer"},
++ {"ROUT1", NULL, "ROUT1 Mixer"},
++ {"LOUT2", NULL, "LOUT2 Mix Amp"},
++ {"ROUT2", NULL, "ROUT2 Mix Amp"},
++ {"LOUT3", NULL, "LOUT3 Mixer"},
++ {"ROUT3", NULL, "ROUT3 Mixer"},
+
+ {"LOUT1 Mixer", "DACL", "DAC Left"},
+ {"ROUT1 Mixer", "DACR", "DAC Right"},
+ {"LOUT2 Mixer", "DACHL", "DAC Left"},
+ {"ROUT2 Mixer", "DACHR", "DAC Right"},
+- {"LOUT2 Mix Amp", "NULL", "LOUT2 Mixer"},
+- {"ROUT2 Mix Amp", "NULL", "ROUT2 Mixer"},
++ {"LOUT2 Mix Amp", NULL, "LOUT2 Mixer"},
++ {"ROUT2 Mix Amp", NULL, "ROUT2 Mixer"},
+ {"LOUT3 Mixer", "DACSL", "DAC Left"},
+ {"ROUT3 Mixer", "DACSR", "DAC Right"},
+
+@@ -381,18 +381,18 @@ static const struct snd_soc_dapm_route ak4671_intercon[] = {
+ {"LIN2", NULL, "Mic Bias"},
+ {"RIN2", NULL, "Mic Bias"},
+
+- {"ADC Left", "NULL", "LIN MUX"},
+- {"ADC Right", "NULL", "RIN MUX"},
++ {"ADC Left", NULL, "LIN MUX"},
++ {"ADC Right", NULL, "RIN MUX"},
+
+ /* Analog Loops */
+- {"LIN1 Mixing Circuit", "NULL", "LIN1"},
+- {"RIN1 Mixing Circuit", "NULL", "RIN1"},
+- {"LIN2 Mixing Circuit", "NULL", "LIN2"},
+- {"RIN2 Mixing Circuit", "NULL", "RIN2"},
+- {"LIN3 Mixing Circuit", "NULL", "LIN3"},
+- {"RIN3 Mixing Circuit", "NULL", "RIN3"},
+- {"LIN4 Mixing Circuit", "NULL", "LIN4"},
+- {"RIN4 Mixing Circuit", "NULL", "RIN4"},
++ {"LIN1 Mixing Circuit", NULL, "LIN1"},
++ {"RIN1 Mixing Circuit", NULL, "RIN1"},
++ {"LIN2 Mixing Circuit", NULL, "LIN2"},
++ {"RIN2 Mixing Circuit", NULL, "RIN2"},
++ {"LIN3 Mixing Circuit", NULL, "LIN3"},
++ {"RIN3 Mixing Circuit", NULL, "RIN3"},
++ {"LIN4 Mixing Circuit", NULL, "LIN4"},
++ {"RIN4 Mixing Circuit", NULL, "RIN4"},
+
+ {"LOUT1 Mixer", "LINL1", "LIN1 Mixing Circuit"},
+ {"ROUT1 Mixer", "RINR1", "RIN1 Mixing Circuit"},
+diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
+index 93cec52f4733..6ec074fec068 100644
+--- a/sound/soc/codecs/cs4271.c
++++ b/sound/soc/codecs/cs4271.c
+@@ -287,7 +287,7 @@ static int cs4271_get_deemph(struct snd_kcontrol *kcontrol,
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);
+
+- ucontrol->value.enumerated.item[0] = cs4271->deemph;
++ ucontrol->value.integer.value[0] = cs4271->deemph;
+ return 0;
+ }
+
+@@ -297,7 +297,7 @@ static int cs4271_put_deemph(struct snd_kcontrol *kcontrol,
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);
+
+- cs4271->deemph = ucontrol->value.enumerated.item[0];
++ cs4271->deemph = ucontrol->value.integer.value[0];
+ return cs4271_set_deemph(codec);
+ }
+
+diff --git a/sound/soc/codecs/da732x.c b/sound/soc/codecs/da732x.c
+index 61b2f9a2eef1..e3110c67f3b2 100644
+--- a/sound/soc/codecs/da732x.c
++++ b/sound/soc/codecs/da732x.c
+@@ -876,11 +876,11 @@ static const struct snd_soc_dapm_widget da732x_dapm_widgets[] = {
+
+ static const struct snd_soc_dapm_route da732x_dapm_routes[] = {
+ /* Inputs */
+- {"AUX1L PGA", "NULL", "AUX1L"},
+- {"AUX1R PGA", "NULL", "AUX1R"},
++ {"AUX1L PGA", NULL, "AUX1L"},
++ {"AUX1R PGA", NULL, "AUX1R"},
+ {"MIC1 PGA", NULL, "MIC1"},
+- {"MIC2 PGA", "NULL", "MIC2"},
+- {"MIC3 PGA", "NULL", "MIC3"},
++ {"MIC2 PGA", NULL, "MIC2"},
++ {"MIC3 PGA", NULL, "MIC3"},
+
+ /* Capture Path */
+ {"ADC1 Left MUX", "MIC1", "MIC1 PGA"},
+diff --git a/sound/soc/codecs/es8328.c b/sound/soc/codecs/es8328.c
+index f27325155ace..c5f35a07e8e4 100644
+--- a/sound/soc/codecs/es8328.c
++++ b/sound/soc/codecs/es8328.c
+@@ -120,7 +120,7 @@ static int es8328_get_deemph(struct snd_kcontrol *kcontrol,
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct es8328_priv *es8328 = snd_soc_codec_get_drvdata(codec);
+
+- ucontrol->value.enumerated.item[0] = es8328->deemph;
++ ucontrol->value.integer.value[0] = es8328->deemph;
+ return 0;
+ }
+
+@@ -129,7 +129,7 @@ static int es8328_put_deemph(struct snd_kcontrol *kcontrol,
+ {
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct es8328_priv *es8328 = snd_soc_codec_get_drvdata(codec);
+- int deemph = ucontrol->value.enumerated.item[0];
++ int deemph = ucontrol->value.integer.value[0];
+ int ret;
+
+ if (deemph > 1)
+diff --git a/sound/soc/codecs/pcm1681.c b/sound/soc/codecs/pcm1681.c
+index a722a023c262..477e13d30971 100644
+--- a/sound/soc/codecs/pcm1681.c
++++ b/sound/soc/codecs/pcm1681.c
+@@ -118,7 +118,7 @@ static int pcm1681_get_deemph(struct snd_kcontrol *kcontrol,
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct pcm1681_private *priv = snd_soc_codec_get_drvdata(codec);
+
+- ucontrol->value.enumerated.item[0] = priv->deemph;
++ ucontrol->value.integer.value[0] = priv->deemph;
+
+ return 0;
+ }
+@@ -129,7 +129,7 @@ static int pcm1681_put_deemph(struct snd_kcontrol *kcontrol,
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct pcm1681_private *priv = snd_soc_codec_get_drvdata(codec);
+
+- priv->deemph = ucontrol->value.enumerated.item[0];
++ priv->deemph = ucontrol->value.integer.value[0];
+
+ return pcm1681_set_deemph(codec);
+ }
+diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
+index f1287ff8dd29..7de7431efcb3 100644
+--- a/sound/soc/codecs/sgtl5000.c
++++ b/sound/soc/codecs/sgtl5000.c
+@@ -1136,13 +1136,7 @@ static int sgtl5000_set_power_regs(struct snd_soc_codec *codec)
+ /* Enable VDDC charge pump */
+ ana_pwr |= SGTL5000_VDDC_CHRGPMP_POWERUP;
+ } else if (vddio >= 3100 && vdda >= 3100) {
+- /*
+- * if vddio and vddd > 3.1v,
+- * charge pump should be clean before set ana_pwr
+- */
+- snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER,
+- SGTL5000_VDDC_CHRGPMP_POWERUP, 0);
+-
++ ana_pwr &= ~SGTL5000_VDDC_CHRGPMP_POWERUP;
+ /* VDDC use VDDIO rail */
+ lreg_ctrl |= SGTL5000_VDDC_ASSN_OVRD;
+ lreg_ctrl |= SGTL5000_VDDC_MAN_ASSN_VDDIO <<
+diff --git a/sound/soc/codecs/sn95031.c b/sound/soc/codecs/sn95031.c
+index cf8fa40662f0..01af05172452 100644
+--- a/sound/soc/codecs/sn95031.c
++++ b/sound/soc/codecs/sn95031.c
+@@ -531,8 +531,8 @@ static const struct snd_soc_dapm_route sn95031_audio_map[] = {
+ /* speaker map */
+ { "IHFOUTL", NULL, "Speaker Rail"},
+ { "IHFOUTR", NULL, "Speaker Rail"},
+- { "IHFOUTL", "NULL", "Speaker Left Playback"},
+- { "IHFOUTR", "NULL", "Speaker Right Playback"},
++ { "IHFOUTL", NULL, "Speaker Left Playback"},
++ { "IHFOUTR", NULL, "Speaker Right Playback"},
+ { "Speaker Left Playback", NULL, "Speaker Left Filter"},
+ { "Speaker Right Playback", NULL, "Speaker Right Filter"},
+ { "Speaker Left Filter", NULL, "IHFDAC Left"},
+diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c
+index 249ef5c4c762..32942bed34b1 100644
+--- a/sound/soc/codecs/tas5086.c
++++ b/sound/soc/codecs/tas5086.c
+@@ -281,7 +281,7 @@ static int tas5086_get_deemph(struct snd_kcontrol *kcontrol,
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct tas5086_private *priv = snd_soc_codec_get_drvdata(codec);
+
+- ucontrol->value.enumerated.item[0] = priv->deemph;
++ ucontrol->value.integer.value[0] = priv->deemph;
+
+ return 0;
+ }
+@@ -292,7 +292,7 @@ static int tas5086_put_deemph(struct snd_kcontrol *kcontrol,
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct tas5086_private *priv = snd_soc_codec_get_drvdata(codec);
+
+- priv->deemph = ucontrol->value.enumerated.item[0];
++ priv->deemph = ucontrol->value.integer.value[0];
+
+ return tas5086_set_deemph(codec);
+ }
+diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c
+index 34ef65c52a7d..8eeab47a4235 100644
+--- a/sound/soc/codecs/wm2000.c
++++ b/sound/soc/codecs/wm2000.c
+@@ -610,7 +610,7 @@ static int wm2000_anc_mode_get(struct snd_kcontrol *kcontrol,
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);
+
+- ucontrol->value.enumerated.item[0] = wm2000->anc_active;
++ ucontrol->value.integer.value[0] = wm2000->anc_active;
+
+ return 0;
+ }
+@@ -620,7 +620,7 @@ static int wm2000_anc_mode_put(struct snd_kcontrol *kcontrol,
+ {
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);
+- int anc_active = ucontrol->value.enumerated.item[0];
++ int anc_active = ucontrol->value.integer.value[0];
+ int ret;
+
+ if (anc_active > 1)
+@@ -643,7 +643,7 @@ static int wm2000_speaker_get(struct snd_kcontrol *kcontrol,
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);
+
+- ucontrol->value.enumerated.item[0] = wm2000->spk_ena;
++ ucontrol->value.integer.value[0] = wm2000->spk_ena;
+
+ return 0;
+ }
+@@ -653,7 +653,7 @@ static int wm2000_speaker_put(struct snd_kcontrol *kcontrol,
+ {
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);
+- int val = ucontrol->value.enumerated.item[0];
++ int val = ucontrol->value.integer.value[0];
+ int ret;
+
+ if (val > 1)
+diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
+index eebb3280bfad..19a53dca3433 100644
+--- a/sound/soc/codecs/wm8731.c
++++ b/sound/soc/codecs/wm8731.c
+@@ -122,7 +122,7 @@ static int wm8731_get_deemph(struct snd_kcontrol *kcontrol,
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec);
+
+- ucontrol->value.enumerated.item[0] = wm8731->deemph;
++ ucontrol->value.integer.value[0] = wm8731->deemph;
+
+ return 0;
+ }
+@@ -132,7 +132,7 @@ static int wm8731_put_deemph(struct snd_kcontrol *kcontrol,
+ {
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec);
+- int deemph = ucontrol->value.enumerated.item[0];
++ int deemph = ucontrol->value.integer.value[0];
+ int ret = 0;
+
+ if (deemph > 1)
+diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
+index c038b3e04398..5b758756dd80 100644
+--- a/sound/soc/codecs/wm8903.c
++++ b/sound/soc/codecs/wm8903.c
+@@ -441,7 +441,7 @@ static int wm8903_get_deemph(struct snd_kcontrol *kcontrol,
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
+
+- ucontrol->value.enumerated.item[0] = wm8903->deemph;
++ ucontrol->value.integer.value[0] = wm8903->deemph;
+
+ return 0;
+ }
+@@ -451,7 +451,7 @@ static int wm8903_put_deemph(struct snd_kcontrol *kcontrol,
+ {
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
+- int deemph = ucontrol->value.enumerated.item[0];
++ int deemph = ucontrol->value.integer.value[0];
+ int ret = 0;
+
+ if (deemph > 1)
+diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
+index 4d2d2b1380d5..af2446f16cdd 100644
+--- a/sound/soc/codecs/wm8904.c
++++ b/sound/soc/codecs/wm8904.c
+@@ -525,7 +525,7 @@ static int wm8904_get_deemph(struct snd_kcontrol *kcontrol,
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
+
+- ucontrol->value.enumerated.item[0] = wm8904->deemph;
++ ucontrol->value.integer.value[0] = wm8904->deemph;
+ return 0;
+ }
+
+@@ -534,7 +534,7 @@ static int wm8904_put_deemph(struct snd_kcontrol *kcontrol,
+ {
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
+- int deemph = ucontrol->value.enumerated.item[0];
++ int deemph = ucontrol->value.integer.value[0];
+
+ if (deemph > 1)
+ return -EINVAL;
+diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c
+index 09d91d9dc4ee..7d0b01bcab4b 100644
+--- a/sound/soc/codecs/wm8955.c
++++ b/sound/soc/codecs/wm8955.c
+@@ -393,7 +393,7 @@ static int wm8955_get_deemph(struct snd_kcontrol *kcontrol,
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec);
+
+- ucontrol->value.enumerated.item[0] = wm8955->deemph;
++ ucontrol->value.integer.value[0] = wm8955->deemph;
+ return 0;
+ }
+
+@@ -402,7 +402,7 @@ static int wm8955_put_deemph(struct snd_kcontrol *kcontrol,
+ {
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec);
+- int deemph = ucontrol->value.enumerated.item[0];
++ int deemph = ucontrol->value.integer.value[0];
+
+ if (deemph > 1)
+ return -EINVAL;
+diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
+index 641f940c138d..ab9931c280b2 100644
+--- a/sound/soc/codecs/wm8960.c
++++ b/sound/soc/codecs/wm8960.c
+@@ -181,7 +181,7 @@ static int wm8960_get_deemph(struct snd_kcontrol *kcontrol,
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
+
+- ucontrol->value.enumerated.item[0] = wm8960->deemph;
++ ucontrol->value.integer.value[0] = wm8960->deemph;
+ return 0;
+ }
+
+@@ -190,7 +190,7 @@ static int wm8960_put_deemph(struct snd_kcontrol *kcontrol,
+ {
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
+- int deemph = ucontrol->value.enumerated.item[0];
++ int deemph = ucontrol->value.integer.value[0];
+
+ if (deemph > 1)
+ return -EINVAL;