From 798dc0e3f72f77b12b06351891c02c13a20dd562 Mon Sep 17 00:00:00 2001 From: Peter Vicman Date: Sat, 30 Apr 2016 16:59:37 +0200 Subject: [PATCH] imx6: update linux patches --- .../linux-000-commits-d08b62d-ade5a7b.patch | 16315 ------ .../linux-000-commits-d08b62d-ecef1c7.patch | 44835 ++++++++++++++++ .../linux-320-udoo-lvds-support.patch | 268 - .../4.4-xbian/linux-330-tbs2910-dts-fix.patch | 11 - 4 files changed, 44835 insertions(+), 16594 deletions(-) delete mode 100644 projects/imx6/patches/linux/4.4-xbian/linux-000-commits-d08b62d-ade5a7b.patch create mode 100644 projects/imx6/patches/linux/4.4-xbian/linux-000-commits-d08b62d-ecef1c7.patch delete mode 100644 projects/imx6/patches/linux/4.4-xbian/linux-320-udoo-lvds-support.patch delete mode 100644 projects/imx6/patches/linux/4.4-xbian/linux-330-tbs2910-dts-fix.patch diff --git a/projects/imx6/patches/linux/4.4-xbian/linux-000-commits-d08b62d-ade5a7b.patch b/projects/imx6/patches/linux/4.4-xbian/linux-000-commits-d08b62d-ade5a7b.patch deleted file mode 100644 index 2305cc7d56..0000000000 --- a/projects/imx6/patches/linux/4.4-xbian/linux-000-commits-d08b62d-ade5a7b.patch +++ /dev/null @@ -1,16315 +0,0 @@ -From eb69269a27cf75c34e22728a5499ce4ca9e3bc4e Mon Sep 17 00:00:00 2001 -From: Fugang Duan -Date: Fri, 10 Oct 2014 16:25:26 +0800 -Subject: [PATCH 01/13] ENGR00299323-10 net:fec: add enet AVB Ubuntu Gstreamer - demo support - -Support Gstreamer AVB demo support. - -ring1 -> ClassA, ring2 -> ClassB, ring0 -> Best Effort - -For QoS: ring1 > ring2 > ring0 -For bandwidth reverse: - 50% bandwidth -> ClassA - 33% bandwidth -> ClassB - 17% bandwidth -> Best effort queue - -In general, ClassA run audio, ClassB run video. -Since AVB demo use big bandwidth streaming, video cost more than -33Mbps bandwidth, and with Qos limitation: ClassA >= ClassB > Best effort, -so we have to change ring2 bandwidth equal to ring1 bandwidth (50%). -After validate on FPGA, AVB demo can work fine for audio and video. - -Signed-off-by: Fugang Duan -(cherry picked from commit 93d6579a7b3d2dafa721c835df5d5f7d30ed386e) -(cherry picked from commit 2f78438d70c847f0570ece98cd7933041e36f6bd) -Signed-off-by: Matus Kral ---- - drivers/net/ethernet/freescale/fec_main.c | 35 ++++++++++++++++++++++++++++++- - 1 file changed, 34 insertions(+), 1 deletion(-) - -diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c -index 969922a..d9f1ab3 100644 ---- a/drivers/net/ethernet/freescale/fec_main.c -+++ b/drivers/net/ethernet/freescale/fec_main.c -@@ -18,7 +18,7 @@ - * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be) - * Copyright (c) 2004-2006 Macq Electronique SA. - * -- * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. -+ * Copyright (C) 2010-2014 Freescale Semiconductor, Inc. - */ - - #include -@@ -70,6 +70,7 @@ static void fec_enet_itr_coal_init(struct net_device *ndev); - #define DRIVER_NAME "fec" - - #define FEC_ENET_GET_QUQUE(_x) ((_x == 0) ? 1 : ((_x == 1) ? 2 : 0)) -+static const u16 fec_enet_vlan_pri_to_queue[8] = {1, 1, 1, 1, 2, 2, 2, 2}; - - /* Pause frame feild and FIFO threshold */ - #define FEC_ENET_FCE (1 << 5) -@@ -3171,10 +3172,42 @@ static int fec_set_features(struct net_device *netdev, - return 0; - } - -+u16 fec_enet_get_raw_vlan_tci(struct sk_buff *skb) -+{ -+ struct vlan_ethhdr *vhdr; -+ unsigned short vlan_TCI = 0; -+ -+ if (skb->protocol == ntohs(ETH_P_ALL)) { -+ vhdr = (struct vlan_ethhdr *)(skb->data); -+ vlan_TCI = ntohs(vhdr->h_vlan_TCI); -+ } -+ -+ return vlan_TCI; -+} -+ -+u16 fec_enet_select_queue(struct net_device *ndev, struct sk_buff *skb, -+ void *accel_priv, select_queue_fallback_t fallback) -+{ -+ struct fec_enet_private *fep = netdev_priv(ndev); -+ const struct platform_device_id *id_entry = -+ platform_get_device_id(fep->pdev); -+ u16 vlan_tag; -+ -+ if (!(id_entry->driver_data & FEC_QUIRK_HAS_AVB)) -+ return skb_tx_hash(ndev, skb); -+ -+ vlan_tag = fec_enet_get_raw_vlan_tci(skb); -+ if (!vlan_tag) -+ return vlan_tag; -+ -+ return fec_enet_vlan_pri_to_queue[vlan_tag >> 13]; -+} -+ - static const struct net_device_ops fec_netdev_ops = { - .ndo_open = fec_enet_open, - .ndo_stop = fec_enet_close, - .ndo_start_xmit = fec_enet_start_xmit, -+ .ndo_select_queue = fec_enet_select_queue, - .ndo_set_rx_mode = set_multicast_list, - .ndo_change_mtu = eth_change_mtu, - .ndo_validate_addr = eth_validate_addr, - -From 4455ed29cc7a523a293bbe766a75aab04a7f9372 Mon Sep 17 00:00:00 2001 -From: Matus Kral -Date: Sun, 3 Apr 2016 09:09:27 +0200 -Subject: [PATCH 02/13] apply Real-Time patch -rt13 - ---- - Documentation/kernel-parameters.txt | 9 + - Makefile | 3 + - arch/Kconfig | 1 + - arch/arm/kvm/arm.c | 12 +- - arch/arm/kvm/psci.c | 4 +- - arch/arm/mach-at91/Kconfig | 1 + - arch/arm/mach-at91/at91rm9200.c | 2 - - arch/arm/mach-at91/at91sam9.c | 2 - - arch/arm/mach-at91/generic.h | 13 +- - arch/arm/mach-at91/pm.c | 70 +++++- - arch/arm/mach-at91/sama5.c | 2 +- - arch/arm64/kernel/debug-monitors.c | 21 +- - arch/mips/kvm/mips.c | 8 +- - arch/powerpc/include/asm/kvm_host.h | 4 +- - arch/powerpc/kvm/book3s_hv.c | 22 +- - arch/s390/include/asm/kvm_host.h | 2 +- - arch/s390/kvm/interrupt.c | 4 +- - arch/x86/kernel/kvm.c | 37 +-- - arch/x86/kvm/lapic.c | 6 +- - block/blk-core.c | 4 +- - block/blk-mq.c | 4 +- - drivers/block/zram/zram_drv.c | 30 +-- - drivers/block/zram/zram_drv.h | 41 +++ - drivers/clk/at91/clk-generated.c | 95 ++++--- - drivers/clk/at91/clk-h32mx.c | 40 +-- - drivers/clk/at91/clk-main.c | 324 +++++++++++------------- - drivers/clk/at91/clk-master.c | 94 +++---- - drivers/clk/at91/clk-peripheral.c | 136 +++++----- - drivers/clk/at91/clk-pll.c | 150 +++++------ - drivers/clk/at91/clk-plldiv.c | 44 ++-- - drivers/clk/at91/clk-programmable.c | 96 +++---- - drivers/clk/at91/clk-slow.c | 34 +-- - drivers/clk/at91/clk-smd.c | 56 +++-- - drivers/clk/at91/clk-system.c | 96 +++---- - drivers/clk/at91/clk-usb.c | 123 ++++----- - drivers/clk/at91/clk-utmi.c | 80 ++---- - drivers/clk/at91/pmc.c | 426 +------------------------------- - drivers/clk/at91/pmc.h | 98 +------- - drivers/clocksource/tcb_clksrc.c | 33 ++- - drivers/clocksource/timer-atmel-pit.c | 8 +- - drivers/gpu/drm/i915/i915_irq.c | 2 + - drivers/gpu/drm/i915/intel_sprite.c | 11 +- - drivers/gpu/drm/radeon/radeon_display.c | 2 + - drivers/iommu/amd_iommu.c | 12 +- - drivers/tty/serial/sc16is7xx.c | 2 +- - drivers/usb/gadget/function/f_fs.c | 2 +- - drivers/usb/gadget/udc/atmel_usba_udc.c | 20 +- - drivers/usb/gadget/udc/atmel_usba_udc.h | 2 + - fs/btrfs/volumes.c | 1 - - fs/f2fs/f2fs.h | 4 +- - include/linux/blkdev.h | 2 +- - include/linux/clk/at91_pmc.h | 12 - - include/linux/completion.h | 8 +- - include/linux/ftrace.h | 12 + - include/linux/hrtimer.h | 2 +- - include/linux/kvm_host.h | 5 +- - include/linux/list_bl.h | 12 +- - include/linux/locallock.h | 6 +- - include/linux/sched.h | 2 - - include/linux/spinlock_rt.h | 25 +- - include/linux/suspend.h | 6 + - include/linux/swait.h | 173 +++++++++++++ - include/linux/wait-simple.h | 207 ---------------- - include/trace/events/hist.h | 1 + - include/trace/events/writeback.h | 121 ++++----- - kernel/cpu.c | 4 +- - kernel/events/core.c | 1 + - kernel/futex.c | 18 +- - kernel/irq/irqdesc.c | 21 +- - kernel/irq/manage.c | 2 +- - kernel/locking/lglock.c | 6 +- - kernel/locking/rt.c | 2 - - kernel/locking/rtmutex.c | 244 +++++++++++------- - kernel/power/hibernate.c | 7 + - kernel/power/suspend.c | 5 + - kernel/printk/printk.c | 116 ++++----- - kernel/rcu/rcutorture.c | 7 + - kernel/rcu/tree.c | 24 +- - kernel/rcu/tree.h | 15 +- - kernel/rcu/tree_plugin.h | 26 +- - kernel/sched/Makefile | 2 +- - kernel/sched/completion.c | 10 +- - kernel/sched/core.c | 21 +- - kernel/sched/swait.c | 143 +++++++++++ - kernel/sched/wait-simple.c | 115 --------- - kernel/sched/work-simple.c | 8 +- - kernel/softirq.c | 8 +- - kernel/stop_machine.c | 40 +-- - kernel/time/tick-broadcast-hrtimer.c | 1 + - kernel/trace/trace_irqsoff.c | 8 +- - lib/dump_stack.c | 4 +- - localversion-rt | 2 +- - mm/backing-dev.c | 4 +- - mm/zsmalloc.c | 4 +- - net/core/dev.c | 6 +- - virt/kvm/async_pf.c | 4 +- - virt/kvm/kvm_main.c | 17 +- - 97 files changed, 1679 insertions(+), 2103 deletions(-) - create mode 100644 include/linux/swait.h - delete mode 100644 include/linux/wait-simple.h - create mode 100644 kernel/sched/swait.c - delete mode 100644 kernel/sched/wait-simple.c - -diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index 742f69d..bcaf28e 100644 ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -1629,6 +1629,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted. - ip= [IP_PNP] - See Documentation/filesystems/nfs/nfsroot.txt. - -+ irqaffinity= [SMP] Set the default irq affinity mask -+ Format: -+ ,..., -+ or -+ - -+ (must be a positive range in ascending order) -+ or a mixture -+ ,...,- -+ - irqfixup [HW] - When an interrupt is not handled search all handlers - for it. Intended to get systems with badly broken -diff --git a/Makefile b/Makefile -index 87d12b4..d95c4a4 100644 ---- a/Makefile -+++ b/Makefile -@@ -767,6 +767,9 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=strict-prototypes) - # Prohibit date/time macros, which would make the build non-deterministic - KBUILD_CFLAGS += $(call cc-option,-Werror=date-time) - -+# enforce correct pointer usage -+#KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types) -+ - # use the deterministic mode of AR if available - KBUILD_ARFLAGS := $(call ar-option,D) - -diff --git a/arch/Kconfig b/arch/Kconfig -index 81592b3..3b26d76 100644 ---- a/arch/Kconfig -+++ b/arch/Kconfig -@@ -53,6 +53,7 @@ config KPROBES - config JUMP_LABEL - bool "Optimize very unlikely/likely branches" - depends on HAVE_ARCH_JUMP_LABEL -+ depends on (!INTERRUPT_OFF_HIST && !PREEMPT_OFF_HIST && !WAKEUP_LATENCY_HIST && !MISSED_TIMER_OFFSETS_HIST) - help - This option enables a transparent branch optimization that - makes certain almost-always-true or almost-always-false branch -diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c -index 4f5c42a..bb43bc3 100644 ---- a/arch/arm/kvm/arm.c -+++ b/arch/arm/kvm/arm.c -@@ -498,16 +498,16 @@ static void kvm_arm_resume_guest(struct kvm *kvm) - struct kvm_vcpu *vcpu; - - kvm_for_each_vcpu(i, vcpu, kvm) { -- struct swait_head *wq = kvm_arch_vcpu_wq(vcpu); -+ struct swait_queue_head *wq = kvm_arch_vcpu_wq(vcpu); - - vcpu->arch.pause = false; -- swait_wake_interruptible(wq); -+ swake_up(wq); - } - } - - static void vcpu_sleep(struct kvm_vcpu *vcpu) - { -- struct swait_head *wq = kvm_arch_vcpu_wq(vcpu); -+ struct swait_queue_head *wq = kvm_arch_vcpu_wq(vcpu); - - swait_event_interruptible(*wq, ((!vcpu->arch.power_off) && - (!vcpu->arch.pause))); -@@ -568,7 +568,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) - * involves poking the GIC, which must be done in a - * non-preemptible context. - */ -- preempt_disable(); -+ migrate_disable(); - kvm_timer_flush_hwstate(vcpu); - kvm_vgic_flush_hwstate(vcpu); - -@@ -587,7 +587,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) - local_irq_enable(); - kvm_timer_sync_hwstate(vcpu); - kvm_vgic_sync_hwstate(vcpu); -- preempt_enable(); -+ migrate_enable(); - continue; - } - -@@ -641,7 +641,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) - - kvm_vgic_sync_hwstate(vcpu); - -- preempt_enable(); -+ migrate_enable(); - - ret = handle_exit(vcpu, run, ret); - } -diff --git a/arch/arm/kvm/psci.c b/arch/arm/kvm/psci.c -index 08148c4..c2b1315 100644 ---- a/arch/arm/kvm/psci.c -+++ b/arch/arm/kvm/psci.c -@@ -70,7 +70,7 @@ static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu) - { - struct kvm *kvm = source_vcpu->kvm; - struct kvm_vcpu *vcpu = NULL; -- struct swait_head *wq; -+ struct swait_queue_head *wq; - unsigned long cpu_id; - unsigned long context_id; - phys_addr_t target_pc; -@@ -119,7 +119,7 @@ static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu) - smp_mb(); /* Make sure the above is visible */ - - wq = kvm_arch_vcpu_wq(vcpu); -- swait_wake_interruptible(wq); -+ swake_up(wq); - - return PSCI_RET_SUCCESS; - } -diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig -index 28656c2..3f50130 100644 ---- a/arch/arm/mach-at91/Kconfig -+++ b/arch/arm/mach-at91/Kconfig -@@ -99,6 +99,7 @@ config HAVE_AT91_USB_CLK - config COMMON_CLK_AT91 - bool - select COMMON_CLK -+ select MFD_SYSCON - - config HAVE_AT91_SMD - bool -diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c -index c1a7c6c..63b4fa2 100644 ---- a/arch/arm/mach-at91/at91rm9200.c -+++ b/arch/arm/mach-at91/at91rm9200.c -@@ -12,7 +12,6 @@ - #include - - #include --#include - - #include "generic.h" - #include "soc.h" -@@ -33,7 +32,6 @@ static void __init at91rm9200_dt_device_init(void) - - of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev); - -- arm_pm_idle = at91rm9200_idle; - at91rm9200_pm_init(); - } - -diff --git a/arch/arm/mach-at91/at91sam9.c b/arch/arm/mach-at91/at91sam9.c -index 7eb64f7..cada2a6 100644 ---- a/arch/arm/mach-at91/at91sam9.c -+++ b/arch/arm/mach-at91/at91sam9.c -@@ -62,8 +62,6 @@ static void __init at91sam9_common_init(void) - soc_dev = soc_device_to_device(soc); - - of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev); -- -- arm_pm_idle = at91sam9_idle; - } - - static void __init at91sam9_dt_device_init(void) -diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h -index b0fa7dc..28ca57a 100644 ---- a/arch/arm/mach-at91/generic.h -+++ b/arch/arm/mach-at91/generic.h -@@ -11,27 +11,18 @@ - #ifndef _AT91_GENERIC_H - #define _AT91_GENERIC_H - --#include --#include -- -- /* Map io */ --extern void __init at91_map_io(void); --extern void __init at91_alt_map_io(void); -- --/* idle */ --extern void at91rm9200_idle(void); --extern void at91sam9_idle(void); -- - #ifdef CONFIG_PM - extern void __init at91rm9200_pm_init(void); - extern void __init at91sam9260_pm_init(void); - extern void __init at91sam9g45_pm_init(void); - extern void __init at91sam9x5_pm_init(void); -+extern void __init sama5_pm_init(void); - #else - static inline void __init at91rm9200_pm_init(void) { } - static inline void __init at91sam9260_pm_init(void) { } - static inline void __init at91sam9g45_pm_init(void) { } - static inline void __init at91sam9x5_pm_init(void) { } -+static inline void __init sama5_pm_init(void) { } - #endif - - #endif /* _AT91_GENERIC_H */ -diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c -index 23726fb3..f062701 100644 ---- a/arch/arm/mach-at91/pm.c -+++ b/arch/arm/mach-at91/pm.c -@@ -31,10 +31,13 @@ - #include - #include - #include -+#include - - #include "generic.h" - #include "pm.h" - -+static void __iomem *pmc; -+ - /* - * FIXME: this is needed to communicate between the pinctrl driver and - * the PM implementation in the machine. Possibly part of the PM -@@ -87,7 +90,7 @@ static int at91_pm_verify_clocks(void) - unsigned long scsr; - int i; - -- scsr = at91_pmc_read(AT91_PMC_SCSR); -+ scsr = readl(pmc + AT91_PMC_SCSR); - - /* USB must not be using PLLB */ - if ((scsr & at91_pm_data.uhp_udp_mask) != 0) { -@@ -101,8 +104,7 @@ static int at91_pm_verify_clocks(void) - - if ((scsr & (AT91_PMC_PCK0 << i)) == 0) - continue; -- -- css = at91_pmc_read(AT91_PMC_PCKR(i)) & AT91_PMC_CSS; -+ css = readl(pmc + AT91_PMC_PCKR(i)) & AT91_PMC_CSS; - if (css != AT91_PMC_CSS_SLOW) { - pr_err("AT91: PM - Suspend-to-RAM with PCK%d src %d\n", i, css); - return 0; -@@ -145,8 +147,8 @@ static void at91_pm_suspend(suspend_state_t state) - flush_cache_all(); - outer_disable(); - -- at91_suspend_sram_fn(at91_pmc_base, at91_ramc_base[0], -- at91_ramc_base[1], pm_data); -+ at91_suspend_sram_fn(pmc, at91_ramc_base[0], -+ at91_ramc_base[1], pm_data); - - outer_resume(); - } -@@ -353,6 +355,21 @@ static __init void at91_dt_ramc(void) - at91_pm_set_standby(standby); - } - -+void at91rm9200_idle(void) -+{ -+ /* -+ * Disable the processor clock. The processor will be automatically -+ * re-enabled by an interrupt or by a reset. -+ */ -+ writel(AT91_PMC_PCK, pmc + AT91_PMC_SCDR); -+} -+ -+void at91sam9_idle(void) -+{ -+ writel(AT91_PMC_PCK, pmc + AT91_PMC_SCDR); -+ cpu_do_idle(); -+} -+ - static void __init at91_pm_sram_init(void) - { - struct gen_pool *sram_pool; -@@ -399,13 +416,36 @@ static void __init at91_pm_sram_init(void) - &at91_pm_suspend_in_sram, at91_pm_suspend_in_sram_sz); - } - --static void __init at91_pm_init(void) -+static const struct of_device_id atmel_pmc_ids[] __initconst = { -+ { .compatible = "atmel,at91rm9200-pmc" }, -+ { .compatible = "atmel,at91sam9260-pmc" }, -+ { .compatible = "atmel,at91sam9g45-pmc" }, -+ { .compatible = "atmel,at91sam9n12-pmc" }, -+ { .compatible = "atmel,at91sam9x5-pmc" }, -+ { .compatible = "atmel,sama5d3-pmc" }, -+ { .compatible = "atmel,sama5d2-pmc" }, -+ { /* sentinel */ }, -+}; -+ -+static void __init at91_pm_init(void (*pm_idle)(void)) - { -- at91_pm_sram_init(); -+ struct device_node *pmc_np; - - if (at91_cpuidle_device.dev.platform_data) - platform_device_register(&at91_cpuidle_device); - -+ pmc_np = of_find_matching_node(NULL, atmel_pmc_ids); -+ pmc = of_iomap(pmc_np, 0); -+ if (!pmc) { -+ pr_err("AT91: PM not supported, PMC not found\n"); -+ return; -+ } -+ -+ if (pm_idle) -+ arm_pm_idle = pm_idle; -+ -+ at91_pm_sram_init(); -+ - if (at91_suspend_sram_fn) - suspend_set_ops(&at91_pm_ops); - else -@@ -424,7 +464,7 @@ void __init at91rm9200_pm_init(void) - at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP; - at91_pm_data.memctrl = AT91_MEMCTRL_MC; - -- at91_pm_init(); -+ at91_pm_init(at91rm9200_idle); - } - - void __init at91sam9260_pm_init(void) -@@ -432,7 +472,7 @@ void __init at91sam9260_pm_init(void) - at91_dt_ramc(); - at91_pm_data.memctrl = AT91_MEMCTRL_SDRAMC; - at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP; -- return at91_pm_init(); -+ at91_pm_init(at91sam9_idle); - } - - void __init at91sam9g45_pm_init(void) -@@ -440,7 +480,7 @@ void __init at91sam9g45_pm_init(void) - at91_dt_ramc(); - at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP; - at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR; -- return at91_pm_init(); -+ at91_pm_init(at91sam9_idle); - } - - void __init at91sam9x5_pm_init(void) -@@ -448,5 +488,13 @@ void __init at91sam9x5_pm_init(void) - at91_dt_ramc(); - at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP; - at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR; -- return at91_pm_init(); -+ at91_pm_init(at91sam9_idle); -+} -+ -+void __init sama5_pm_init(void) -+{ -+ at91_dt_ramc(); -+ at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP; -+ at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR; -+ at91_pm_init(NULL); - } -diff --git a/arch/arm/mach-at91/sama5.c b/arch/arm/mach-at91/sama5.c -index d9cf679..df8fdf1 100644 ---- a/arch/arm/mach-at91/sama5.c -+++ b/arch/arm/mach-at91/sama5.c -@@ -51,7 +51,7 @@ static void __init sama5_dt_device_init(void) - soc_dev = soc_device_to_device(soc); - - of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev); -- at91sam9x5_pm_init(); -+ sama5_pm_init(); - } - - static const char *const sama5_dt_board_compat[] __initconst = { -diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c -index 8aee3ae..c1492ba 100644 ---- a/arch/arm64/kernel/debug-monitors.c -+++ b/arch/arm64/kernel/debug-monitors.c -@@ -186,20 +186,21 @@ static void clear_regs_spsr_ss(struct pt_regs *regs) - - /* EL1 Single Step Handler hooks */ - static LIST_HEAD(step_hook); --static DEFINE_RWLOCK(step_hook_lock); -+static DEFINE_SPINLOCK(step_hook_lock); - - void register_step_hook(struct step_hook *hook) - { -- write_lock(&step_hook_lock); -- list_add(&hook->node, &step_hook); -- write_unlock(&step_hook_lock); -+ spin_lock(&step_hook_lock); -+ list_add_rcu(&hook->node, &step_hook); -+ spin_unlock(&step_hook_lock); - } - - void unregister_step_hook(struct step_hook *hook) - { -- write_lock(&step_hook_lock); -- list_del(&hook->node); -- write_unlock(&step_hook_lock); -+ spin_lock(&step_hook_lock); -+ list_del_rcu(&hook->node); -+ spin_unlock(&step_hook_lock); -+ synchronize_rcu(); - } - - /* -@@ -213,15 +214,15 @@ static int call_step_hook(struct pt_regs *regs, unsigned int esr) - struct step_hook *hook; - int retval = DBG_HOOK_ERROR; - -- read_lock(&step_hook_lock); -+ rcu_read_lock(); - -- list_for_each_entry(hook, &step_hook, node) { -+ list_for_each_entry_rcu(hook, &step_hook, node) { - retval = hook->fn(regs, esr); - if (retval == DBG_HOOK_HANDLED) - break; - } - -- read_unlock(&step_hook_lock); -+ rcu_read_unlock(); - - return retval; - } -diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c -index 2683d04..8a11329 100644 ---- a/arch/mips/kvm/mips.c -+++ b/arch/mips/kvm/mips.c -@@ -445,8 +445,8 @@ int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, - - dvcpu->arch.wait = 0; - -- if (waitqueue_active(&dvcpu->wq)) -- wake_up_interruptible(&dvcpu->wq); -+ if (swait_active(&dvcpu->wq)) -+ swake_up(&dvcpu->wq); - - return 0; - } -@@ -1174,8 +1174,8 @@ static void kvm_mips_comparecount_func(unsigned long data) - kvm_mips_callbacks->queue_timer_int(vcpu); - - vcpu->arch.wait = 0; -- if (waitqueue_active(&vcpu->wq)) -- wake_up_interruptible(&vcpu->wq); -+ if (swait_active(&vcpu->wq)) -+ swake_up(&vcpu->wq); - } - - /* low level hrtimer wake routine */ -diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h -index b439518..f8673ff 100644 ---- a/arch/powerpc/include/asm/kvm_host.h -+++ b/arch/powerpc/include/asm/kvm_host.h -@@ -286,7 +286,7 @@ struct kvmppc_vcore { - struct list_head runnable_threads; - struct list_head preempt_list; - spinlock_t lock; -- struct swait_head wq; -+ struct swait_queue_head wq; - spinlock_t stoltb_lock; /* protects stolen_tb and preempt_tb */ - u64 stolen_tb; - u64 preempt_tb; -@@ -626,7 +626,7 @@ struct kvm_vcpu_arch { - u8 prodded; - u32 last_inst; - -- struct swait_head *wqp; -+ struct swait_queue_head *wqp; - struct kvmppc_vcore *vcore; - int ret; - int trap; -diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c -index 32be32b..df34a64 100644 ---- a/arch/powerpc/kvm/book3s_hv.c -+++ b/arch/powerpc/kvm/book3s_hv.c -@@ -114,11 +114,11 @@ static bool kvmppc_ipi_thread(int cpu) - static void kvmppc_fast_vcpu_kick_hv(struct kvm_vcpu *vcpu) - { - int cpu; -- struct swait_head *wqp; -+ struct swait_queue_head *wqp; - - wqp = kvm_arch_vcpu_wq(vcpu); -- if (swaitqueue_active(wqp)) { -- swait_wake_interruptible(wqp); -+ if (swait_active(wqp)) { -+ swake_up(wqp); - ++vcpu->stat.halt_wakeup; - } - -@@ -707,8 +707,8 @@ int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu) - tvcpu->arch.prodded = 1; - smp_mb(); - if (vcpu->arch.ceded) { -- if (swaitqueue_active(&vcpu->wq)) { -- swait_wake_interruptible(&vcpu->wq); -+ if (swait_active(&vcpu->wq)) { -+ swake_up(&vcpu->wq); - vcpu->stat.halt_wakeup++; - } - } -@@ -1447,7 +1447,7 @@ static struct kvmppc_vcore *kvmppc_vcore_create(struct kvm *kvm, int core) - INIT_LIST_HEAD(&vcore->runnable_threads); - spin_lock_init(&vcore->lock); - spin_lock_init(&vcore->stoltb_lock); -- init_swait_head(&vcore->wq); -+ init_swait_queue_head(&vcore->wq); - vcore->preempt_tb = TB_NIL; - vcore->lpcr = kvm->arch.lpcr; - vcore->first_vcpuid = core * threads_per_subcore; -@@ -2519,9 +2519,9 @@ static void kvmppc_vcore_blocked(struct kvmppc_vcore *vc) - { - struct kvm_vcpu *vcpu; - int do_sleep = 1; -- DEFINE_SWAITER(wait); -+ DECLARE_SWAITQUEUE(wait); - -- swait_prepare(&vc->wq, &wait, TASK_INTERRUPTIBLE); -+ prepare_to_swait(&vc->wq, &wait, TASK_INTERRUPTIBLE); - - /* - * Check one last time for pending exceptions and ceded state after -@@ -2535,7 +2535,7 @@ static void kvmppc_vcore_blocked(struct kvmppc_vcore *vc) - } - - if (!do_sleep) { -- swait_finish(&vc->wq, &wait); -+ finish_swait(&vc->wq, &wait); - return; - } - -@@ -2543,7 +2543,7 @@ static void kvmppc_vcore_blocked(struct kvmppc_vcore *vc) - trace_kvmppc_vcore_blocked(vc, 0); - spin_unlock(&vc->lock); - schedule(); -- swait_finish(&vc->wq, &wait); -+ finish_swait(&vc->wq, &wait); - spin_lock(&vc->lock); - vc->vcore_state = VCORE_INACTIVE; - trace_kvmppc_vcore_blocked(vc, 1); -@@ -2599,7 +2599,7 @@ static int kvmppc_run_vcpu(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) - kvmppc_start_thread(vcpu, vc); - trace_kvm_guest_enter(vcpu); - } else if (vc->vcore_state == VCORE_SLEEPING) { -- swait_wake(&vc->wq); -+ swake_up(&vc->wq); - } - - } -diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h -index 2a84c76..bbdc539 100644 ---- a/arch/s390/include/asm/kvm_host.h -+++ b/arch/s390/include/asm/kvm_host.h -@@ -427,7 +427,7 @@ struct kvm_s390_irq_payload { - struct kvm_s390_local_interrupt { - spinlock_t lock; - struct kvm_s390_float_interrupt *float_int; -- struct swait_head *wq; -+ struct swait_queue_head *wq; - atomic_t *cpuflags; - DECLARE_BITMAP(sigp_emerg_pending, KVM_MAX_VCPUS); - struct kvm_s390_irq_payload irq; -diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c -index 8b4516b..cc862c4 100644 ---- a/arch/s390/kvm/interrupt.c -+++ b/arch/s390/kvm/interrupt.c -@@ -868,13 +868,13 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu) - - void kvm_s390_vcpu_wakeup(struct kvm_vcpu *vcpu) - { -- if (swaitqueue_active(&vcpu->wq)) { -+ if (swait_active(&vcpu->wq)) { - /* - * The vcpu gave up the cpu voluntarily, mark it as a good - * yield-candidate. - */ - vcpu->preempted = true; -- swait_wake_interruptible(&vcpu->wq); -+ swake_up(&vcpu->wq); - vcpu->stat.halt_wakeup++; - } - } -diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c -index 47190bd..8079508 100644 ---- a/arch/x86/kernel/kvm.c -+++ b/arch/x86/kernel/kvm.c -@@ -36,6 +36,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -91,14 +92,14 @@ static void kvm_io_delay(void) - - struct kvm_task_sleep_node { - struct hlist_node link; -- wait_queue_head_t wq; -+ struct swait_queue_head wq; - u32 token; - int cpu; - bool halted; - }; - - static struct kvm_task_sleep_head { -- spinlock_t lock; -+ raw_spinlock_t lock; - struct hlist_head list; - } async_pf_sleepers[KVM_TASK_SLEEP_HASHSIZE]; - -@@ -122,17 +123,17 @@ void kvm_async_pf_task_wait(u32 token) - u32 key = hash_32(token, KVM_TASK_SLEEP_HASHBITS); - struct kvm_task_sleep_head *b = &async_pf_sleepers[key]; - struct kvm_task_sleep_node n, *e; -- DEFINE_WAIT(wait); -+ DECLARE_SWAITQUEUE(wait); - - rcu_irq_enter(); - -- spin_lock(&b->lock); -+ raw_spin_lock(&b->lock); - e = _find_apf_task(b, token); - if (e) { - /* dummy entry exist -> wake up was delivered ahead of PF */ - hlist_del(&e->link); - kfree(e); -- spin_unlock(&b->lock); -+ raw_spin_unlock(&b->lock); - - rcu_irq_exit(); - return; -@@ -141,13 +142,13 @@ void kvm_async_pf_task_wait(u32 token) - n.token = token; - n.cpu = smp_processor_id(); - n.halted = is_idle_task(current) || preempt_count() > 1; -- init_waitqueue_head(&n.wq); -+ init_swait_queue_head(&n.wq); - hlist_add_head(&n.link, &b->list); -- spin_unlock(&b->lock); -+ raw_spin_unlock(&b->lock); - - for (;;) { - if (!n.halted) -- prepare_to_wait(&n.wq, &wait, TASK_UNINTERRUPTIBLE); -+ prepare_to_swait(&n.wq, &wait, TASK_UNINTERRUPTIBLE); - if (hlist_unhashed(&n.link)) - break; - -@@ -166,7 +167,7 @@ void kvm_async_pf_task_wait(u32 token) - } - } - if (!n.halted) -- finish_wait(&n.wq, &wait); -+ finish_swait(&n.wq, &wait); - - rcu_irq_exit(); - return; -@@ -178,8 +179,8 @@ static void apf_task_wake_one(struct kvm_task_sleep_node *n) - hlist_del_init(&n->link); - if (n->halted) - smp_send_reschedule(n->cpu); -- else if (waitqueue_active(&n->wq)) -- wake_up(&n->wq); -+ else if (swait_active(&n->wq)) -+ swake_up(&n->wq); - } - - static void apf_task_wake_all(void) -@@ -189,14 +190,14 @@ static void apf_task_wake_all(void) - for (i = 0; i < KVM_TASK_SLEEP_HASHSIZE; i++) { - struct hlist_node *p, *next; - struct kvm_task_sleep_head *b = &async_pf_sleepers[i]; -- spin_lock(&b->lock); -+ raw_spin_lock(&b->lock); - hlist_for_each_safe(p, next, &b->list) { - struct kvm_task_sleep_node *n = - hlist_entry(p, typeof(*n), link); - if (n->cpu == smp_processor_id()) - apf_task_wake_one(n); - } -- spin_unlock(&b->lock); -+ raw_spin_unlock(&b->lock); - } - } - -@@ -212,7 +213,7 @@ void kvm_async_pf_task_wake(u32 token) - } - - again: -- spin_lock(&b->lock); -+ raw_spin_lock(&b->lock); - n = _find_apf_task(b, token); - if (!n) { - /* -@@ -225,17 +226,17 @@ void kvm_async_pf_task_wake(u32 token) - * Allocation failed! Busy wait while other cpu - * handles async PF. - */ -- spin_unlock(&b->lock); -+ raw_spin_unlock(&b->lock); - cpu_relax(); - goto again; - } - n->token = token; - n->cpu = smp_processor_id(); -- init_waitqueue_head(&n->wq); -+ init_swait_queue_head(&n->wq); - hlist_add_head(&n->link, &b->list); - } else - apf_task_wake_one(n); -- spin_unlock(&b->lock); -+ raw_spin_unlock(&b->lock); - return; - } - EXPORT_SYMBOL_GPL(kvm_async_pf_task_wake); -@@ -486,7 +487,7 @@ void __init kvm_guest_init(void) - paravirt_ops_setup(); - register_reboot_notifier(&kvm_pv_reboot_nb); - for (i = 0; i < KVM_TASK_SLEEP_HASHSIZE; i++) -- spin_lock_init(&async_pf_sleepers[i].lock); -+ raw_spin_lock_init(&async_pf_sleepers[i].lock); - if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF)) - x86_init.irqs.trap_init = kvm_apf_trap_init; - -diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c -index 906a1ec..20d9e9f 100644 ---- a/arch/x86/kvm/lapic.c -+++ b/arch/x86/kvm/lapic.c -@@ -1195,7 +1195,7 @@ static void apic_update_lvtt(struct kvm_lapic *apic) - static void apic_timer_expired(struct kvm_lapic *apic) - { - struct kvm_vcpu *vcpu = apic->vcpu; -- struct swait_head *q = &vcpu->wq; -+ struct swait_queue_head *q = &vcpu->wq; - struct kvm_timer *ktimer = &apic->lapic_timer; - - if (atomic_read(&apic->lapic_timer.pending)) -@@ -1204,8 +1204,8 @@ static void apic_timer_expired(struct kvm_lapic *apic) - atomic_inc(&apic->lapic_timer.pending); - kvm_set_pending_timer(vcpu); - -- if (swaitqueue_active(q)) -- swait_wake_interruptible(q); -+ if (swait_active(q)) -+ swake_up(q); - - if (apic_lvtt_tscdeadline(apic)) - ktimer->expired_tscdeadline = ktimer->tscdeadline; -diff --git a/block/blk-core.c b/block/blk-core.c -index 4c8cefd..2f7afb9 100644 ---- a/block/blk-core.c -+++ b/block/blk-core.c -@@ -680,7 +680,7 @@ static void blk_queue_usage_counter_release(struct percpu_ref *ref) - struct request_queue *q = - container_of(ref, struct request_queue, q_usage_counter); - -- swait_wake_all(&q->mq_freeze_wq); -+ swake_up_all(&q->mq_freeze_wq); - } - - struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) -@@ -742,7 +742,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) - q->bypass_depth = 1; - __set_bit(QUEUE_FLAG_BYPASS, &q->queue_flags); - -- init_swait_head(&q->mq_freeze_wq); -+ init_swait_queue_head(&q->mq_freeze_wq); - - /* - * Init percpu_ref in atomic mode so that it's faster to shutdown. -diff --git a/block/blk-mq.c b/block/blk-mq.c -index 3c70813..7cdf19e 100644 ---- a/block/blk-mq.c -+++ b/block/blk-mq.c -@@ -130,7 +130,7 @@ void blk_mq_unfreeze_queue(struct request_queue *q) - WARN_ON_ONCE(freeze_depth < 0); - if (!freeze_depth) { - percpu_ref_reinit(&q->q_usage_counter); -- swait_wake_all(&q->mq_freeze_wq); -+ swake_up_all(&q->mq_freeze_wq); - } - } - EXPORT_SYMBOL_GPL(blk_mq_unfreeze_queue); -@@ -149,7 +149,7 @@ void blk_mq_wake_waiters(struct request_queue *q) - * dying, we need to ensure that processes currently waiting on - * the queue are notified as well. - */ -- swait_wake_all(&q->mq_freeze_wq); -+ swake_up_all(&q->mq_freeze_wq); - } - - bool blk_mq_can_queue(struct blk_mq_hw_ctx *hctx) -diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c -index 370c2f7..65e0b37 100644 ---- a/drivers/block/zram/zram_drv.c -+++ b/drivers/block/zram/zram_drv.c -@@ -520,6 +520,8 @@ static struct zram_meta *zram_meta_alloc(char *pool_name, u64 disksize) - goto out_error; - } - -+ zram_meta_init_table_locks(meta, disksize); -+ - return meta; - - out_error: -@@ -568,12 +570,12 @@ static int zram_decompress_page(struct zram *zram, char *mem, u32 index) - unsigned long handle; - size_t size; - -- bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value); -+ zram_lock_table(&meta->table[index]); - handle = meta->table[index].handle; - size = zram_get_obj_size(meta, index); - - if (!handle || zram_test_flag(meta, index, ZRAM_ZERO)) { -- bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value); -+ zram_unlock_table(&meta->table[index]); - clear_page(mem); - return 0; - } -@@ -584,7 +586,7 @@ static int zram_decompress_page(struct zram *zram, char *mem, u32 index) - else - ret = zcomp_decompress(zram->comp, cmem, size, mem); - zs_unmap_object(meta->mem_pool, handle); -- bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value); -+ zram_unlock_table(&meta->table[index]); - - /* Should NEVER happen. Return bio error if it does. */ - if (unlikely(ret)) { -@@ -604,14 +606,14 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec, - struct zram_meta *meta = zram->meta; - page = bvec->bv_page; - -- bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value); -+ zram_lock_table(&meta->table[index]); - if (unlikely(!meta->table[index].handle) || - zram_test_flag(meta, index, ZRAM_ZERO)) { -- bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value); -+ zram_unlock_table(&meta->table[index]); - handle_zero_page(bvec); - return 0; - } -- bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value); -+ zram_unlock_table(&meta->table[index]); - - if (is_partial_io(bvec)) - /* Use a temporary buffer to decompress the page */ -@@ -689,10 +691,10 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index, - if (user_mem) - kunmap_atomic(user_mem); - /* Free memory associated with this sector now. */ -- bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value); -+ zram_lock_table(&meta->table[index]); - zram_free_page(zram, index); - zram_set_flag(meta, index, ZRAM_ZERO); -- bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value); -+ zram_unlock_table(&meta->table[index]); - - atomic64_inc(&zram->stats.zero_pages); - ret = 0; -@@ -752,12 +754,12 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index, - * Free memory associated with this sector - * before overwriting unused sectors. - */ -- bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value); -+ zram_lock_table(&meta->table[index]); - zram_free_page(zram, index); - - meta->table[index].handle = handle; - zram_set_obj_size(meta, index, clen); -- bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value); -+ zram_unlock_table(&meta->table[index]); - - /* Update stats */ - atomic64_add(clen, &zram->stats.compr_data_size); -@@ -800,9 +802,9 @@ static void zram_bio_discard(struct zram *zram, u32 index, - } - - while (n >= PAGE_SIZE) { -- bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value); -+ zram_lock_table(&meta->table[index]); - zram_free_page(zram, index); -- bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value); -+ zram_unlock_table(&meta->table[index]); - atomic64_inc(&zram->stats.notify_free); - index++; - n -= PAGE_SIZE; -@@ -928,9 +930,9 @@ static void zram_slot_free_notify(struct block_device *bdev, - zram = bdev->bd_disk->private_data; - meta = zram->meta; - -- bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value); -+ zram_lock_table(&meta->table[index]); - zram_free_page(zram, index); -- bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value); -+ zram_unlock_table(&meta->table[index]); - atomic64_inc(&zram->stats.notify_free); - } - -diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h -index 8e92339..1e4a3c6 100644 ---- a/drivers/block/zram/zram_drv.h -+++ b/drivers/block/zram/zram_drv.h -@@ -72,6 +72,9 @@ enum zram_pageflags { - struct zram_table_entry { - unsigned long handle; - unsigned long value; -+#ifdef CONFIG_PREEMPT_RT_BASE -+ spinlock_t lock; -+#endif - }; - - struct zram_stats { -@@ -119,4 +122,42 @@ struct zram { - */ - bool claim; /* Protected by bdev->bd_mutex */ - }; -+ -+#ifndef CONFIG_PREEMPT_RT_BASE -+static inline void zram_lock_table(struct zram_table_entry *table) -+{ -+ bit_spin_lock(ZRAM_ACCESS, &table->value); -+} -+ -+static inline void zram_unlock_table(struct zram_table_entry *table) -+{ -+ bit_spin_unlock(ZRAM_ACCESS, &table->value); -+} -+ -+static inline void zram_meta_init_locks(struct zram_meta *meta, u64 disksize) { } -+#else /* CONFIG_PREEMPT_RT_BASE */ -+static inline void zram_lock_table(struct zram_table_entry *table) -+{ -+ spin_lock(&table->lock); -+ __set_bit(ZRAM_ACCESS, &table->value); -+} -+ -+static inline void zram_unlock_table(struct zram_table_entry *table) -+{ -+ __clear_bit(ZRAM_ACCESS, &table->value); -+ spin_unlock(&table->lock); -+} -+ -+static inline void zram_meta_init_table_locks(struct zram_meta *meta, u64 disksize) -+{ -+ size_t num_pages = disksize >> PAGE_SHIFT; -+ size_t index; -+ -+ for (index = 0; index < num_pages; index++) { -+ spinlock_t *lock = &meta->table[index].lock; -+ spin_lock_init(lock); -+ } -+} -+#endif /* CONFIG_PREEMPT_RT_BASE */ -+ - #endif -diff --git a/drivers/clk/at91/clk-generated.c b/drivers/clk/at91/clk-generated.c -index abc8094..4ad3298 100644 ---- a/drivers/clk/at91/clk-generated.c -+++ b/drivers/clk/at91/clk-generated.c -@@ -15,8 +15,8 @@ - #include - #include - #include --#include --#include -+#include -+#include - - #include "pmc.h" - -@@ -28,8 +28,9 @@ - - struct clk_generated { - struct clk_hw hw; -- struct at91_pmc *pmc; -+ struct regmap *regmap; - struct clk_range range; -+ spinlock_t *lock; - u32 id; - u32 gckdiv; - u8 parent_id; -@@ -41,49 +42,52 @@ struct clk_generated { - static int clk_generated_enable(struct clk_hw *hw) - { - struct clk_generated *gck = to_clk_generated(hw); -- struct at91_pmc *pmc = gck->pmc; -- u32 tmp; -+ unsigned long flags; - - pr_debug("GCLK: %s, gckdiv = %d, parent id = %d\n", - __func__, gck->gckdiv, gck->parent_id); - -- pmc_lock(pmc); -- pmc_write(pmc, AT91_PMC_PCR, (gck->id & AT91_PMC_PCR_PID_MASK)); -- tmp = pmc_read(pmc, AT91_PMC_PCR) & -- ~(AT91_PMC_PCR_GCKDIV_MASK | AT91_PMC_PCR_GCKCSS_MASK); -- pmc_write(pmc, AT91_PMC_PCR, tmp | AT91_PMC_PCR_GCKCSS(gck->parent_id) -- | AT91_PMC_PCR_CMD -- | AT91_PMC_PCR_GCKDIV(gck->gckdiv) -- | AT91_PMC_PCR_GCKEN); -- pmc_unlock(pmc); -+ spin_lock_irqsave(gck->lock, flags); -+ regmap_write(gck->regmap, AT91_PMC_PCR, -+ (gck->id & AT91_PMC_PCR_PID_MASK)); -+ regmap_update_bits(gck->regmap, AT91_PMC_PCR, -+ AT91_PMC_PCR_GCKDIV_MASK | AT91_PMC_PCR_GCKCSS_MASK | -+ AT91_PMC_PCR_CMD | AT91_PMC_PCR_GCKEN, -+ AT91_PMC_PCR_GCKCSS(gck->parent_id) | -+ AT91_PMC_PCR_CMD | -+ AT91_PMC_PCR_GCKDIV(gck->gckdiv) | -+ AT91_PMC_PCR_GCKEN); -+ spin_unlock_irqrestore(gck->lock, flags); - return 0; - } - - static void clk_generated_disable(struct clk_hw *hw) - { - struct clk_generated *gck = to_clk_generated(hw); -- struct at91_pmc *pmc = gck->pmc; -- u32 tmp; -- -- pmc_lock(pmc); -- pmc_write(pmc, AT91_PMC_PCR, (gck->id & AT91_PMC_PCR_PID_MASK)); -- tmp = pmc_read(pmc, AT91_PMC_PCR) & ~AT91_PMC_PCR_GCKEN; -- pmc_write(pmc, AT91_PMC_PCR, tmp | AT91_PMC_PCR_CMD); -- pmc_unlock(pmc); -+ unsigned long flags; -+ -+ spin_lock_irqsave(gck->lock, flags); -+ regmap_write(gck->regmap, AT91_PMC_PCR, -+ (gck->id & AT91_PMC_PCR_PID_MASK)); -+ regmap_update_bits(gck->regmap, AT91_PMC_PCR, -+ AT91_PMC_PCR_CMD | AT91_PMC_PCR_GCKEN, -+ AT91_PMC_PCR_CMD); -+ spin_unlock_irqrestore(gck->lock, flags); - } - - static int clk_generated_is_enabled(struct clk_hw *hw) - { - struct clk_generated *gck = to_clk_generated(hw); -- struct at91_pmc *pmc = gck->pmc; -- int ret; -+ unsigned long flags; -+ unsigned int status; - -- pmc_lock(pmc); -- pmc_write(pmc, AT91_PMC_PCR, (gck->id & AT91_PMC_PCR_PID_MASK)); -- ret = !!(pmc_read(pmc, AT91_PMC_PCR) & AT91_PMC_PCR_GCKEN); -- pmc_unlock(pmc); -+ spin_lock_irqsave(gck->lock, flags); -+ regmap_write(gck->regmap, AT91_PMC_PCR, -+ (gck->id & AT91_PMC_PCR_PID_MASK)); -+ regmap_read(gck->regmap, AT91_PMC_PCR, &status); -+ spin_unlock_irqrestore(gck->lock, flags); - -- return ret; -+ return status & AT91_PMC_PCR_GCKEN ? 1 : 0; - } - - static unsigned long -@@ -214,13 +218,14 @@ static const struct clk_ops generated_ops = { - */ - static void clk_generated_startup(struct clk_generated *gck) - { -- struct at91_pmc *pmc = gck->pmc; - u32 tmp; -+ unsigned long flags; - -- pmc_lock(pmc); -- pmc_write(pmc, AT91_PMC_PCR, (gck->id & AT91_PMC_PCR_PID_MASK)); -- tmp = pmc_read(pmc, AT91_PMC_PCR); -- pmc_unlock(pmc); -+ spin_lock_irqsave(gck->lock, flags); -+ regmap_write(gck->regmap, AT91_PMC_PCR, -+ (gck->id & AT91_PMC_PCR_PID_MASK)); -+ regmap_read(gck->regmap, AT91_PMC_PCR, &tmp); -+ spin_unlock_irqrestore(gck->lock, flags); - - gck->parent_id = (tmp & AT91_PMC_PCR_GCKCSS_MASK) - >> AT91_PMC_PCR_GCKCSS_OFFSET; -@@ -229,8 +234,8 @@ static void clk_generated_startup(struct clk_generated *gck) - } - - static struct clk * __init --at91_clk_register_generated(struct at91_pmc *pmc, const char *name, -- const char **parent_names, u8 num_parents, -+at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, const char -+ *name, const char **parent_names, u8 num_parents, - u8 id, const struct clk_range *range) - { - struct clk_generated *gck; -@@ -249,7 +254,8 @@ at91_clk_register_generated(struct at91_pmc *pmc, const char *name, - - gck->id = id; - gck->hw.init = &init; -- gck->pmc = pmc; -+ gck->regmap = regmap; -+ gck->lock = lock; - gck->range = *range; - - clk = clk_register(NULL, &gck->hw); -@@ -261,8 +267,7 @@ at91_clk_register_generated(struct at91_pmc *pmc, const char *name, - return clk; - } - --void __init of_sama5d2_clk_generated_setup(struct device_node *np, -- struct at91_pmc *pmc) -+void __init of_sama5d2_clk_generated_setup(struct device_node *np) - { - int num; - u32 id; -@@ -272,6 +277,7 @@ void __init of_sama5d2_clk_generated_setup(struct device_node *np, - const char *parent_names[GENERATED_SOURCE_MAX]; - struct device_node *gcknp; - struct clk_range range = CLK_RANGE(0, 0); -+ struct regmap *regmap; - - num_parents = of_clk_get_parent_count(np); - if (num_parents <= 0 || num_parents > GENERATED_SOURCE_MAX) -@@ -283,6 +289,10 @@ void __init of_sama5d2_clk_generated_setup(struct device_node *np, - if (!num || num > PERIPHERAL_MAX) - return; - -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) -+ return; -+ - for_each_child_of_node(np, gcknp) { - if (of_property_read_u32(gcknp, "reg", &id)) - continue; -@@ -296,11 +306,14 @@ void __init of_sama5d2_clk_generated_setup(struct device_node *np, - of_at91_get_clk_range(gcknp, "atmel,clk-output-range", - &range); - -- clk = at91_clk_register_generated(pmc, name, parent_names, -- num_parents, id, &range); -+ clk = at91_clk_register_generated(regmap, &pmc_pcr_lock, name, -+ parent_names, num_parents, -+ id, &range); - if (IS_ERR(clk)) - continue; - - of_clk_add_provider(gcknp, of_clk_src_simple_get, clk); - } - } -+CLK_OF_DECLARE(of_sama5d2_clk_generated_setup, "atmel,sama5d2-clk-generated", -+ of_sama5d2_clk_generated_setup); -diff --git a/drivers/clk/at91/clk-h32mx.c b/drivers/clk/at91/clk-h32mx.c -index 61566bc..819f584 100644 ---- a/drivers/clk/at91/clk-h32mx.c -+++ b/drivers/clk/at91/clk-h32mx.c -@@ -15,15 +15,9 @@ - #include - #include - #include --#include - #include --#include --#include --#include --#include --#include --#include --#include -+#include -+#include - - #include "pmc.h" - -@@ -31,7 +25,7 @@ - - struct clk_sama5d4_h32mx { - struct clk_hw hw; -- struct at91_pmc *pmc; -+ struct regmap *regmap; - }; - - #define to_clk_sama5d4_h32mx(hw) container_of(hw, struct clk_sama5d4_h32mx, hw) -@@ -40,8 +34,10 @@ static unsigned long clk_sama5d4_h32mx_recalc_rate(struct clk_hw *hw, - unsigned long parent_rate) - { - struct clk_sama5d4_h32mx *h32mxclk = to_clk_sama5d4_h32mx(hw); -+ unsigned int mckr; - -- if (pmc_read(h32mxclk->pmc, AT91_PMC_MCKR) & AT91_PMC_H32MXDIV) -+ regmap_read(h32mxclk->regmap, AT91_PMC_MCKR, &mckr); -+ if (mckr & AT91_PMC_H32MXDIV) - return parent_rate / 2; - - if (parent_rate > H32MX_MAX_FREQ) -@@ -70,18 +66,16 @@ static int clk_sama5d4_h32mx_set_rate(struct clk_hw *hw, unsigned long rate, - unsigned long parent_rate) - { - struct clk_sama5d4_h32mx *h32mxclk = to_clk_sama5d4_h32mx(hw); -- struct at91_pmc *pmc = h32mxclk->pmc; -- u32 tmp; -+ u32 mckr = 0; - - if (parent_rate != rate && (parent_rate / 2) != rate) - return -EINVAL; - -- pmc_lock(pmc); -- tmp = pmc_read(pmc, AT91_PMC_MCKR) & ~AT91_PMC_H32MXDIV; - if ((parent_rate / 2) == rate) -- tmp |= AT91_PMC_H32MXDIV; -- pmc_write(pmc, AT91_PMC_MCKR, tmp); -- pmc_unlock(pmc); -+ mckr = AT91_PMC_H32MXDIV; -+ -+ regmap_update_bits(h32mxclk->regmap, AT91_PMC_MCKR, -+ AT91_PMC_H32MXDIV, mckr); - - return 0; - } -@@ -92,14 +86,18 @@ static const struct clk_ops h32mx_ops = { - .set_rate = clk_sama5d4_h32mx_set_rate, - }; - --void __init of_sama5d4_clk_h32mx_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_sama5d4_clk_h32mx_setup(struct device_node *np) - { - struct clk_sama5d4_h32mx *h32mxclk; - struct clk_init_data init; - const char *parent_name; -+ struct regmap *regmap; - struct clk *clk; - -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) -+ return; -+ - h32mxclk = kzalloc(sizeof(*h32mxclk), GFP_KERNEL); - if (!h32mxclk) - return; -@@ -113,7 +111,7 @@ void __init of_sama5d4_clk_h32mx_setup(struct device_node *np, - init.flags = CLK_SET_RATE_GATE; - - h32mxclk->hw.init = &init; -- h32mxclk->pmc = pmc; -+ h32mxclk->regmap = regmap; - - clk = clk_register(NULL, &h32mxclk->hw); - if (!clk) { -@@ -123,3 +121,5 @@ void __init of_sama5d4_clk_h32mx_setup(struct device_node *np, - - of_clk_add_provider(np, of_clk_src_simple_get, clk); - } -+CLK_OF_DECLARE(of_sama5d4_clk_h32mx_setup, "atmel,sama5d4-clk-h32mx", -+ of_sama5d4_clk_h32mx_setup); -diff --git a/drivers/clk/at91/clk-main.c b/drivers/clk/at91/clk-main.c -index fd7247d..4bfc94d 100644 ---- a/drivers/clk/at91/clk-main.c -+++ b/drivers/clk/at91/clk-main.c -@@ -13,13 +13,8 @@ - #include - #include - #include --#include --#include --#include --#include --#include --#include --#include -+#include -+#include - - #include "pmc.h" - -@@ -34,18 +29,14 @@ - - struct clk_main_osc { - struct clk_hw hw; -- struct at91_pmc *pmc; -- unsigned int irq; -- wait_queue_head_t wait; -+ struct regmap *regmap; - }; - - #define to_clk_main_osc(hw) container_of(hw, struct clk_main_osc, hw) - - struct clk_main_rc_osc { - struct clk_hw hw; -- struct at91_pmc *pmc; -- unsigned int irq; -- wait_queue_head_t wait; -+ struct regmap *regmap; - unsigned long frequency; - unsigned long accuracy; - }; -@@ -54,51 +45,47 @@ struct clk_main_rc_osc { - - struct clk_rm9200_main { - struct clk_hw hw; -- struct at91_pmc *pmc; -+ struct regmap *regmap; - }; - - #define to_clk_rm9200_main(hw) container_of(hw, struct clk_rm9200_main, hw) - - struct clk_sam9x5_main { - struct clk_hw hw; -- struct at91_pmc *pmc; -- unsigned int irq; -- wait_queue_head_t wait; -+ struct regmap *regmap; - u8 parent; - }; - - #define to_clk_sam9x5_main(hw) container_of(hw, struct clk_sam9x5_main, hw) - --static irqreturn_t clk_main_osc_irq_handler(int irq, void *dev_id) -+static inline bool clk_main_osc_ready(struct regmap *regmap) - { -- struct clk_main_osc *osc = dev_id; -+ unsigned int status; - -- wake_up(&osc->wait); -- disable_irq_nosync(osc->irq); -+ regmap_read(regmap, AT91_PMC_SR, &status); - -- return IRQ_HANDLED; -+ return status & AT91_PMC_MOSCS; - } - - static int clk_main_osc_prepare(struct clk_hw *hw) - { - struct clk_main_osc *osc = to_clk_main_osc(hw); -- struct at91_pmc *pmc = osc->pmc; -+ struct regmap *regmap = osc->regmap; - u32 tmp; - -- tmp = pmc_read(pmc, AT91_CKGR_MOR) & ~MOR_KEY_MASK; -+ regmap_read(regmap, AT91_CKGR_MOR, &tmp); -+ tmp &= ~MOR_KEY_MASK; -+ - if (tmp & AT91_PMC_OSCBYPASS) - return 0; - - if (!(tmp & AT91_PMC_MOSCEN)) { - tmp |= AT91_PMC_MOSCEN | AT91_PMC_KEY; -- pmc_write(pmc, AT91_CKGR_MOR, tmp); -+ regmap_write(regmap, AT91_CKGR_MOR, tmp); - } - -- while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCS)) { -- enable_irq(osc->irq); -- wait_event(osc->wait, -- pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCS); -- } -+ while (!clk_main_osc_ready(regmap)) -+ cpu_relax(); - - return 0; - } -@@ -106,9 +93,10 @@ static int clk_main_osc_prepare(struct clk_hw *hw) - static void clk_main_osc_unprepare(struct clk_hw *hw) - { - struct clk_main_osc *osc = to_clk_main_osc(hw); -- struct at91_pmc *pmc = osc->pmc; -- u32 tmp = pmc_read(pmc, AT91_CKGR_MOR); -+ struct regmap *regmap = osc->regmap; -+ u32 tmp; - -+ regmap_read(regmap, AT91_CKGR_MOR, &tmp); - if (tmp & AT91_PMC_OSCBYPASS) - return; - -@@ -116,20 +104,22 @@ static void clk_main_osc_unprepare(struct clk_hw *hw) - return; - - tmp &= ~(AT91_PMC_KEY | AT91_PMC_MOSCEN); -- pmc_write(pmc, AT91_CKGR_MOR, tmp | AT91_PMC_KEY); -+ regmap_write(regmap, AT91_CKGR_MOR, tmp | AT91_PMC_KEY); - } - - static int clk_main_osc_is_prepared(struct clk_hw *hw) - { - struct clk_main_osc *osc = to_clk_main_osc(hw); -- struct at91_pmc *pmc = osc->pmc; -- u32 tmp = pmc_read(pmc, AT91_CKGR_MOR); -+ struct regmap *regmap = osc->regmap; -+ u32 tmp, status; - -+ regmap_read(regmap, AT91_CKGR_MOR, &tmp); - if (tmp & AT91_PMC_OSCBYPASS) - return 1; - -- return !!((pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCS) && -- (pmc_read(pmc, AT91_CKGR_MOR) & AT91_PMC_MOSCEN)); -+ regmap_read(regmap, AT91_PMC_SR, &status); -+ -+ return (status & AT91_PMC_MOSCS) && (tmp & AT91_PMC_MOSCEN); - } - - static const struct clk_ops main_osc_ops = { -@@ -139,18 +129,16 @@ static const struct clk_ops main_osc_ops = { - }; - - static struct clk * __init --at91_clk_register_main_osc(struct at91_pmc *pmc, -- unsigned int irq, -+at91_clk_register_main_osc(struct regmap *regmap, - const char *name, - const char *parent_name, - bool bypass) - { -- int ret; - struct clk_main_osc *osc; - struct clk *clk = NULL; - struct clk_init_data init; - -- if (!pmc || !irq || !name || !parent_name) -+ if (!name || !parent_name) - return ERR_PTR(-EINVAL); - - osc = kzalloc(sizeof(*osc), GFP_KERNEL); -@@ -164,85 +152,70 @@ at91_clk_register_main_osc(struct at91_pmc *pmc, - init.flags = CLK_IGNORE_UNUSED; - - osc->hw.init = &init; -- osc->pmc = pmc; -- osc->irq = irq; -- -- init_waitqueue_head(&osc->wait); -- irq_set_status_flags(osc->irq, IRQ_NOAUTOEN); -- ret = request_irq(osc->irq, clk_main_osc_irq_handler, -- IRQF_TRIGGER_HIGH, name, osc); -- if (ret) { -- kfree(osc); -- return ERR_PTR(ret); -- } -+ osc->regmap = regmap; - - if (bypass) -- pmc_write(pmc, AT91_CKGR_MOR, -- (pmc_read(pmc, AT91_CKGR_MOR) & -- ~(MOR_KEY_MASK | AT91_PMC_MOSCEN)) | -- AT91_PMC_OSCBYPASS | AT91_PMC_KEY); -+ regmap_update_bits(regmap, -+ AT91_CKGR_MOR, MOR_KEY_MASK | -+ AT91_PMC_MOSCEN, -+ AT91_PMC_OSCBYPASS | AT91_PMC_KEY); - - clk = clk_register(NULL, &osc->hw); -- if (IS_ERR(clk)) { -- free_irq(irq, osc); -+ if (IS_ERR(clk)) - kfree(osc); -- } - - return clk; - } - --void __init of_at91rm9200_clk_main_osc_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91rm9200_clk_main_osc_setup(struct device_node *np) - { - struct clk *clk; -- unsigned int irq; - const char *name = np->name; - const char *parent_name; -+ struct regmap *regmap; - bool bypass; - - of_property_read_string(np, "clock-output-names", &name); - bypass = of_property_read_bool(np, "atmel,osc-bypass"); - parent_name = of_clk_get_parent_name(np, 0); - -- irq = irq_of_parse_and_map(np, 0); -- if (!irq) -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) - return; - -- clk = at91_clk_register_main_osc(pmc, irq, name, parent_name, bypass); -+ clk = at91_clk_register_main_osc(regmap, name, parent_name, bypass); - if (IS_ERR(clk)) - return; - - of_clk_add_provider(np, of_clk_src_simple_get, clk); - } -+CLK_OF_DECLARE(at91rm9200_clk_main_osc, "atmel,at91rm9200-clk-main-osc", -+ of_at91rm9200_clk_main_osc_setup); - --static irqreturn_t clk_main_rc_osc_irq_handler(int irq, void *dev_id) -+static bool clk_main_rc_osc_ready(struct regmap *regmap) - { -- struct clk_main_rc_osc *osc = dev_id; -+ unsigned int status; - -- wake_up(&osc->wait); -- disable_irq_nosync(osc->irq); -+ regmap_read(regmap, AT91_PMC_SR, &status); - -- return IRQ_HANDLED; -+ return status & AT91_PMC_MOSCRCS; - } - - static int clk_main_rc_osc_prepare(struct clk_hw *hw) - { - struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw); -- struct at91_pmc *pmc = osc->pmc; -- u32 tmp; -+ struct regmap *regmap = osc->regmap; -+ unsigned int mor; - -- tmp = pmc_read(pmc, AT91_CKGR_MOR) & ~MOR_KEY_MASK; -+ regmap_read(regmap, AT91_CKGR_MOR, &mor); - -- if (!(tmp & AT91_PMC_MOSCRCEN)) { -- tmp |= AT91_PMC_MOSCRCEN | AT91_PMC_KEY; -- pmc_write(pmc, AT91_CKGR_MOR, tmp); -- } -+ if (!(mor & AT91_PMC_MOSCRCEN)) -+ regmap_update_bits(regmap, AT91_CKGR_MOR, -+ MOR_KEY_MASK | AT91_PMC_MOSCRCEN, -+ AT91_PMC_MOSCRCEN | AT91_PMC_KEY); - -- while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCRCS)) { -- enable_irq(osc->irq); -- wait_event(osc->wait, -- pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCRCS); -- } -+ while (!clk_main_rc_osc_ready(regmap)) -+ cpu_relax(); - - return 0; - } -@@ -250,23 +223,28 @@ static int clk_main_rc_osc_prepare(struct clk_hw *hw) - static void clk_main_rc_osc_unprepare(struct clk_hw *hw) - { - struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw); -- struct at91_pmc *pmc = osc->pmc; -- u32 tmp = pmc_read(pmc, AT91_CKGR_MOR); -+ struct regmap *regmap = osc->regmap; -+ unsigned int mor; -+ -+ regmap_read(regmap, AT91_CKGR_MOR, &mor); - -- if (!(tmp & AT91_PMC_MOSCRCEN)) -+ if (!(mor & AT91_PMC_MOSCRCEN)) - return; - -- tmp &= ~(MOR_KEY_MASK | AT91_PMC_MOSCRCEN); -- pmc_write(pmc, AT91_CKGR_MOR, tmp | AT91_PMC_KEY); -+ regmap_update_bits(regmap, AT91_CKGR_MOR, -+ MOR_KEY_MASK | AT91_PMC_MOSCRCEN, AT91_PMC_KEY); - } - - static int clk_main_rc_osc_is_prepared(struct clk_hw *hw) - { - struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw); -- struct at91_pmc *pmc = osc->pmc; -+ struct regmap *regmap = osc->regmap; -+ unsigned int mor, status; - -- return !!((pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCRCS) && -- (pmc_read(pmc, AT91_CKGR_MOR) & AT91_PMC_MOSCRCEN)); -+ regmap_read(regmap, AT91_CKGR_MOR, &mor); -+ regmap_read(regmap, AT91_PMC_SR, &status); -+ -+ return (mor & AT91_PMC_MOSCRCEN) && (status & AT91_PMC_MOSCRCS); - } - - static unsigned long clk_main_rc_osc_recalc_rate(struct clk_hw *hw, -@@ -294,17 +272,15 @@ static const struct clk_ops main_rc_osc_ops = { - }; - - static struct clk * __init --at91_clk_register_main_rc_osc(struct at91_pmc *pmc, -- unsigned int irq, -+at91_clk_register_main_rc_osc(struct regmap *regmap, - const char *name, - u32 frequency, u32 accuracy) - { -- int ret; - struct clk_main_rc_osc *osc; - struct clk *clk = NULL; - struct clk_init_data init; - -- if (!pmc || !irq || !name || !frequency) -+ if (!name || !frequency) - return ERR_PTR(-EINVAL); - - osc = kzalloc(sizeof(*osc), GFP_KERNEL); -@@ -318,63 +294,53 @@ at91_clk_register_main_rc_osc(struct at91_pmc *pmc, - init.flags = CLK_IS_ROOT | CLK_IGNORE_UNUSED; - - osc->hw.init = &init; -- osc->pmc = pmc; -- osc->irq = irq; -+ osc->regmap = regmap; - osc->frequency = frequency; - osc->accuracy = accuracy; - -- init_waitqueue_head(&osc->wait); -- irq_set_status_flags(osc->irq, IRQ_NOAUTOEN); -- ret = request_irq(osc->irq, clk_main_rc_osc_irq_handler, -- IRQF_TRIGGER_HIGH, name, osc); -- if (ret) -- return ERR_PTR(ret); -- - clk = clk_register(NULL, &osc->hw); -- if (IS_ERR(clk)) { -- free_irq(irq, osc); -+ if (IS_ERR(clk)) - kfree(osc); -- } - - return clk; - } - --void __init of_at91sam9x5_clk_main_rc_osc_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91sam9x5_clk_main_rc_osc_setup(struct device_node *np) - { - struct clk *clk; -- unsigned int irq; - u32 frequency = 0; - u32 accuracy = 0; - const char *name = np->name; -+ struct regmap *regmap; - - of_property_read_string(np, "clock-output-names", &name); - of_property_read_u32(np, "clock-frequency", &frequency); - of_property_read_u32(np, "clock-accuracy", &accuracy); - -- irq = irq_of_parse_and_map(np, 0); -- if (!irq) -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) - return; - -- clk = at91_clk_register_main_rc_osc(pmc, irq, name, frequency, -- accuracy); -+ clk = at91_clk_register_main_rc_osc(regmap, name, frequency, accuracy); - if (IS_ERR(clk)) - return; - - of_clk_add_provider(np, of_clk_src_simple_get, clk); - } -+CLK_OF_DECLARE(at91sam9x5_clk_main_rc_osc, "atmel,at91sam9x5-clk-main-rc-osc", -+ of_at91sam9x5_clk_main_rc_osc_setup); - - --static int clk_main_probe_frequency(struct at91_pmc *pmc) -+static int clk_main_probe_frequency(struct regmap *regmap) - { - unsigned long prep_time, timeout; -- u32 tmp; -+ unsigned int mcfr; - - timeout = jiffies + usecs_to_jiffies(MAINFRDY_TIMEOUT); - do { - prep_time = jiffies; -- tmp = pmc_read(pmc, AT91_CKGR_MCFR); -- if (tmp & AT91_PMC_MAINRDY) -+ regmap_read(regmap, AT91_CKGR_MCFR, &mcfr); -+ if (mcfr & AT91_PMC_MAINRDY) - return 0; - usleep_range(MAINF_LOOP_MIN_WAIT, MAINF_LOOP_MAX_WAIT); - } while (time_before(prep_time, timeout)); -@@ -382,34 +348,37 @@ static int clk_main_probe_frequency(struct at91_pmc *pmc) - return -ETIMEDOUT; - } - --static unsigned long clk_main_recalc_rate(struct at91_pmc *pmc, -+static unsigned long clk_main_recalc_rate(struct regmap *regmap, - unsigned long parent_rate) - { -- u32 tmp; -+ unsigned int mcfr; - - if (parent_rate) - return parent_rate; - - pr_warn("Main crystal frequency not set, using approximate value\n"); -- tmp = pmc_read(pmc, AT91_CKGR_MCFR); -- if (!(tmp & AT91_PMC_MAINRDY)) -+ regmap_read(regmap, AT91_CKGR_MCFR, &mcfr); -+ if (!(mcfr & AT91_PMC_MAINRDY)) - return 0; - -- return ((tmp & AT91_PMC_MAINF) * SLOW_CLOCK_FREQ) / MAINF_DIV; -+ return ((mcfr & AT91_PMC_MAINF) * SLOW_CLOCK_FREQ) / MAINF_DIV; - } - - static int clk_rm9200_main_prepare(struct clk_hw *hw) - { - struct clk_rm9200_main *clkmain = to_clk_rm9200_main(hw); - -- return clk_main_probe_frequency(clkmain->pmc); -+ return clk_main_probe_frequency(clkmain->regmap); - } - - static int clk_rm9200_main_is_prepared(struct clk_hw *hw) - { - struct clk_rm9200_main *clkmain = to_clk_rm9200_main(hw); -+ unsigned int status; -+ -+ regmap_read(clkmain->regmap, AT91_CKGR_MCFR, &status); - -- return !!(pmc_read(clkmain->pmc, AT91_CKGR_MCFR) & AT91_PMC_MAINRDY); -+ return status & AT91_PMC_MAINRDY ? 1 : 0; - } - - static unsigned long clk_rm9200_main_recalc_rate(struct clk_hw *hw, -@@ -417,7 +386,7 @@ static unsigned long clk_rm9200_main_recalc_rate(struct clk_hw *hw, - { - struct clk_rm9200_main *clkmain = to_clk_rm9200_main(hw); - -- return clk_main_recalc_rate(clkmain->pmc, parent_rate); -+ return clk_main_recalc_rate(clkmain->regmap, parent_rate); - } - - static const struct clk_ops rm9200_main_ops = { -@@ -427,7 +396,7 @@ static const struct clk_ops rm9200_main_ops = { - }; - - static struct clk * __init --at91_clk_register_rm9200_main(struct at91_pmc *pmc, -+at91_clk_register_rm9200_main(struct regmap *regmap, - const char *name, - const char *parent_name) - { -@@ -435,7 +404,7 @@ at91_clk_register_rm9200_main(struct at91_pmc *pmc, - struct clk *clk = NULL; - struct clk_init_data init; - -- if (!pmc || !name) -+ if (!name) - return ERR_PTR(-EINVAL); - - if (!parent_name) -@@ -452,7 +421,7 @@ at91_clk_register_rm9200_main(struct at91_pmc *pmc, - init.flags = 0; - - clkmain->hw.init = &init; -- clkmain->pmc = pmc; -+ clkmain->regmap = regmap; - - clk = clk_register(NULL, &clkmain->hw); - if (IS_ERR(clk)) -@@ -461,52 +430,54 @@ at91_clk_register_rm9200_main(struct at91_pmc *pmc, - return clk; - } - --void __init of_at91rm9200_clk_main_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91rm9200_clk_main_setup(struct device_node *np) - { - struct clk *clk; - const char *parent_name; - const char *name = np->name; -+ struct regmap *regmap; - - parent_name = of_clk_get_parent_name(np, 0); - of_property_read_string(np, "clock-output-names", &name); - -- clk = at91_clk_register_rm9200_main(pmc, name, parent_name); -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) -+ return; -+ -+ clk = at91_clk_register_rm9200_main(regmap, name, parent_name); - if (IS_ERR(clk)) - return; - - of_clk_add_provider(np, of_clk_src_simple_get, clk); - } -+CLK_OF_DECLARE(at91rm9200_clk_main, "atmel,at91rm9200-clk-main", -+ of_at91rm9200_clk_main_setup); - --static irqreturn_t clk_sam9x5_main_irq_handler(int irq, void *dev_id) -+static inline bool clk_sam9x5_main_ready(struct regmap *regmap) - { -- struct clk_sam9x5_main *clkmain = dev_id; -+ unsigned int status; - -- wake_up(&clkmain->wait); -- disable_irq_nosync(clkmain->irq); -+ regmap_read(regmap, AT91_PMC_SR, &status); - -- return IRQ_HANDLED; -+ return status & AT91_PMC_MOSCSELS ? 1 : 0; - } - - static int clk_sam9x5_main_prepare(struct clk_hw *hw) - { - struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw); -- struct at91_pmc *pmc = clkmain->pmc; -+ struct regmap *regmap = clkmain->regmap; - -- while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS)) { -- enable_irq(clkmain->irq); -- wait_event(clkmain->wait, -- pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS); -- } -+ while (!clk_sam9x5_main_ready(regmap)) -+ cpu_relax(); - -- return clk_main_probe_frequency(pmc); -+ return clk_main_probe_frequency(regmap); - } - - static int clk_sam9x5_main_is_prepared(struct clk_hw *hw) - { - struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw); - -- return !!(pmc_read(clkmain->pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS); -+ return clk_sam9x5_main_ready(clkmain->regmap); - } - - static unsigned long clk_sam9x5_main_recalc_rate(struct clk_hw *hw, -@@ -514,30 +485,28 @@ static unsigned long clk_sam9x5_main_recalc_rate(struct clk_hw *hw, - { - struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw); - -- return clk_main_recalc_rate(clkmain->pmc, parent_rate); -+ return clk_main_recalc_rate(clkmain->regmap, parent_rate); - } - - static int clk_sam9x5_main_set_parent(struct clk_hw *hw, u8 index) - { - struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw); -- struct at91_pmc *pmc = clkmain->pmc; -- u32 tmp; -+ struct regmap *regmap = clkmain->regmap; -+ unsigned int tmp; - - if (index > 1) - return -EINVAL; - -- tmp = pmc_read(pmc, AT91_CKGR_MOR) & ~MOR_KEY_MASK; -+ regmap_read(regmap, AT91_CKGR_MOR, &tmp); -+ tmp &= ~MOR_KEY_MASK; - - if (index && !(tmp & AT91_PMC_MOSCSEL)) -- pmc_write(pmc, AT91_CKGR_MOR, tmp | AT91_PMC_MOSCSEL); -+ regmap_write(regmap, AT91_CKGR_MOR, tmp | AT91_PMC_MOSCSEL); - else if (!index && (tmp & AT91_PMC_MOSCSEL)) -- pmc_write(pmc, AT91_CKGR_MOR, tmp & ~AT91_PMC_MOSCSEL); -+ regmap_write(regmap, AT91_CKGR_MOR, tmp & ~AT91_PMC_MOSCSEL); - -- while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS)) { -- enable_irq(clkmain->irq); -- wait_event(clkmain->wait, -- pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS); -- } -+ while (!clk_sam9x5_main_ready(regmap)) -+ cpu_relax(); - - return 0; - } -@@ -545,8 +514,11 @@ static int clk_sam9x5_main_set_parent(struct clk_hw *hw, u8 index) - static u8 clk_sam9x5_main_get_parent(struct clk_hw *hw) - { - struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw); -+ unsigned int status; -+ -+ regmap_read(clkmain->regmap, AT91_CKGR_MOR, &status); - -- return !!(pmc_read(clkmain->pmc, AT91_CKGR_MOR) & AT91_PMC_MOSCEN); -+ return status & AT91_PMC_MOSCEN ? 1 : 0; - } - - static const struct clk_ops sam9x5_main_ops = { -@@ -558,18 +530,17 @@ static const struct clk_ops sam9x5_main_ops = { - }; - - static struct clk * __init --at91_clk_register_sam9x5_main(struct at91_pmc *pmc, -- unsigned int irq, -+at91_clk_register_sam9x5_main(struct regmap *regmap, - const char *name, - const char **parent_names, - int num_parents) - { -- int ret; - struct clk_sam9x5_main *clkmain; - struct clk *clk = NULL; - struct clk_init_data init; -+ unsigned int status; - -- if (!pmc || !irq || !name) -+ if (!name) - return ERR_PTR(-EINVAL); - - if (!parent_names || !num_parents) -@@ -586,51 +557,42 @@ at91_clk_register_sam9x5_main(struct at91_pmc *pmc, - init.flags = CLK_SET_PARENT_GATE; - - clkmain->hw.init = &init; -- clkmain->pmc = pmc; -- clkmain->irq = irq; -- clkmain->parent = !!(pmc_read(clkmain->pmc, AT91_CKGR_MOR) & -- AT91_PMC_MOSCEN); -- init_waitqueue_head(&clkmain->wait); -- irq_set_status_flags(clkmain->irq, IRQ_NOAUTOEN); -- ret = request_irq(clkmain->irq, clk_sam9x5_main_irq_handler, -- IRQF_TRIGGER_HIGH, name, clkmain); -- if (ret) -- return ERR_PTR(ret); -+ clkmain->regmap = regmap; -+ regmap_read(clkmain->regmap, AT91_CKGR_MOR, &status); -+ clkmain->parent = status & AT91_PMC_MOSCEN ? 1 : 0; - - clk = clk_register(NULL, &clkmain->hw); -- if (IS_ERR(clk)) { -- free_irq(clkmain->irq, clkmain); -+ if (IS_ERR(clk)) - kfree(clkmain); -- } - - return clk; - } - --void __init of_at91sam9x5_clk_main_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91sam9x5_clk_main_setup(struct device_node *np) - { - struct clk *clk; - const char *parent_names[2]; - int num_parents; -- unsigned int irq; - const char *name = np->name; -+ struct regmap *regmap; - - num_parents = of_clk_get_parent_count(np); - if (num_parents <= 0 || num_parents > 2) - return; - - of_clk_parent_fill(np, parent_names, num_parents); -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) -+ return; - - of_property_read_string(np, "clock-output-names", &name); - -- irq = irq_of_parse_and_map(np, 0); -- if (!irq) -- return; -- -- clk = at91_clk_register_sam9x5_main(pmc, irq, name, parent_names, -+ clk = at91_clk_register_sam9x5_main(regmap, name, parent_names, - num_parents); - if (IS_ERR(clk)) - return; - - of_clk_add_provider(np, of_clk_src_simple_get, clk); - } -+CLK_OF_DECLARE(at91sam9x5_clk_main, "atmel,at91sam9x5-clk-main", -+ of_at91sam9x5_clk_main_setup); -diff --git a/drivers/clk/at91/clk-master.c b/drivers/clk/at91/clk-master.c -index 620ea32..7d4a186 100644 ---- a/drivers/clk/at91/clk-master.c -+++ b/drivers/clk/at91/clk-master.c -@@ -12,13 +12,8 @@ - #include - #include - #include --#include --#include --#include --#include --#include --#include --#include -+#include -+#include - - #include "pmc.h" - -@@ -44,32 +39,26 @@ struct clk_master_layout { - - struct clk_master { - struct clk_hw hw; -- struct at91_pmc *pmc; -- unsigned int irq; -- wait_queue_head_t wait; -+ struct regmap *regmap; - const struct clk_master_layout *layout; - const struct clk_master_characteristics *characteristics; - }; - --static irqreturn_t clk_master_irq_handler(int irq, void *dev_id) -+static inline bool clk_master_ready(struct regmap *regmap) - { -- struct clk_master *master = (struct clk_master *)dev_id; -+ unsigned int status; - -- wake_up(&master->wait); -- disable_irq_nosync(master->irq); -+ regmap_read(regmap, AT91_PMC_SR, &status); - -- return IRQ_HANDLED; -+ return status & AT91_PMC_MCKRDY ? 1 : 0; - } -+ - static int clk_master_prepare(struct clk_hw *hw) - { - struct clk_master *master = to_clk_master(hw); -- struct at91_pmc *pmc = master->pmc; - -- while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MCKRDY)) { -- enable_irq(master->irq); -- wait_event(master->wait, -- pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MCKRDY); -- } -+ while (!clk_master_ready(master->regmap)) -+ cpu_relax(); - - return 0; - } -@@ -78,7 +67,7 @@ static int clk_master_is_prepared(struct clk_hw *hw) - { - struct clk_master *master = to_clk_master(hw); - -- return !!(pmc_read(master->pmc, AT91_PMC_SR) & AT91_PMC_MCKRDY); -+ return clk_master_ready(master->regmap); - } - - static unsigned long clk_master_recalc_rate(struct clk_hw *hw, -@@ -88,18 +77,16 @@ static unsigned long clk_master_recalc_rate(struct clk_hw *hw, - u8 div; - unsigned long rate = parent_rate; - struct clk_master *master = to_clk_master(hw); -- struct at91_pmc *pmc = master->pmc; - const struct clk_master_layout *layout = master->layout; - const struct clk_master_characteristics *characteristics = - master->characteristics; -- u32 tmp; -+ unsigned int mckr; - -- pmc_lock(pmc); -- tmp = pmc_read(pmc, AT91_PMC_MCKR) & layout->mask; -- pmc_unlock(pmc); -+ regmap_read(master->regmap, AT91_PMC_MCKR, &mckr); -+ mckr &= layout->mask; - -- pres = (tmp >> layout->pres_shift) & MASTER_PRES_MASK; -- div = (tmp >> MASTER_DIV_SHIFT) & MASTER_DIV_MASK; -+ pres = (mckr >> layout->pres_shift) & MASTER_PRES_MASK; -+ div = (mckr >> MASTER_DIV_SHIFT) & MASTER_DIV_MASK; - - if (characteristics->have_div3_pres && pres == MASTER_PRES_MAX) - rate /= 3; -@@ -119,9 +106,11 @@ static unsigned long clk_master_recalc_rate(struct clk_hw *hw, - static u8 clk_master_get_parent(struct clk_hw *hw) - { - struct clk_master *master = to_clk_master(hw); -- struct at91_pmc *pmc = master->pmc; -+ unsigned int mckr; - -- return pmc_read(pmc, AT91_PMC_MCKR) & AT91_PMC_CSS; -+ regmap_read(master->regmap, AT91_PMC_MCKR, &mckr); -+ -+ return mckr & AT91_PMC_CSS; - } - - static const struct clk_ops master_ops = { -@@ -132,18 +121,17 @@ static const struct clk_ops master_ops = { - }; - - static struct clk * __init --at91_clk_register_master(struct at91_pmc *pmc, unsigned int irq, -+at91_clk_register_master(struct regmap *regmap, - const char *name, int num_parents, - const char **parent_names, - const struct clk_master_layout *layout, - const struct clk_master_characteristics *characteristics) - { -- int ret; - struct clk_master *master; - struct clk *clk = NULL; - struct clk_init_data init; - -- if (!pmc || !irq || !name || !num_parents || !parent_names) -+ if (!name || !num_parents || !parent_names) - return ERR_PTR(-EINVAL); - - master = kzalloc(sizeof(*master), GFP_KERNEL); -@@ -159,20 +147,10 @@ at91_clk_register_master(struct at91_pmc *pmc, unsigned int irq, - master->hw.init = &init; - master->layout = layout; - master->characteristics = characteristics; -- master->pmc = pmc; -- master->irq = irq; -- init_waitqueue_head(&master->wait); -- irq_set_status_flags(master->irq, IRQ_NOAUTOEN); -- ret = request_irq(master->irq, clk_master_irq_handler, -- IRQF_TRIGGER_HIGH, "clk-master", master); -- if (ret) { -- kfree(master); -- return ERR_PTR(ret); -- } -+ master->regmap = regmap; - - clk = clk_register(NULL, &master->hw); - if (IS_ERR(clk)) { -- free_irq(master->irq, master); - kfree(master); - } - -@@ -217,15 +195,15 @@ of_at91_clk_master_get_characteristics(struct device_node *np) - } - - static void __init --of_at91_clk_master_setup(struct device_node *np, struct at91_pmc *pmc, -+of_at91_clk_master_setup(struct device_node *np, - const struct clk_master_layout *layout) - { - struct clk *clk; - int num_parents; -- unsigned int irq; - const char *parent_names[MASTER_SOURCE_MAX]; - const char *name = np->name; - struct clk_master_characteristics *characteristics; -+ struct regmap *regmap; - - num_parents = of_clk_get_parent_count(np); - if (num_parents <= 0 || num_parents > MASTER_SOURCE_MAX) -@@ -239,11 +217,11 @@ of_at91_clk_master_setup(struct device_node *np, struct at91_pmc *pmc, - if (!characteristics) - return; - -- irq = irq_of_parse_and_map(np, 0); -- if (!irq) -- goto out_free_characteristics; -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) -+ return; - -- clk = at91_clk_register_master(pmc, irq, name, num_parents, -+ clk = at91_clk_register_master(regmap, name, num_parents, - parent_names, layout, - characteristics); - if (IS_ERR(clk)) -@@ -256,14 +234,16 @@ of_at91_clk_master_setup(struct device_node *np, struct at91_pmc *pmc, - kfree(characteristics); - } - --void __init of_at91rm9200_clk_master_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91rm9200_clk_master_setup(struct device_node *np) - { -- of_at91_clk_master_setup(np, pmc, &at91rm9200_master_layout); -+ of_at91_clk_master_setup(np, &at91rm9200_master_layout); - } -+CLK_OF_DECLARE(at91rm9200_clk_master, "atmel,at91rm9200-clk-master", -+ of_at91rm9200_clk_master_setup); - --void __init of_at91sam9x5_clk_master_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91sam9x5_clk_master_setup(struct device_node *np) - { -- of_at91_clk_master_setup(np, pmc, &at91sam9x5_master_layout); -+ of_at91_clk_master_setup(np, &at91sam9x5_master_layout); - } -+CLK_OF_DECLARE(at91sam9x5_clk_master, "atmel,at91sam9x5-clk-master", -+ of_at91sam9x5_clk_master_setup); -diff --git a/drivers/clk/at91/clk-peripheral.c b/drivers/clk/at91/clk-peripheral.c -index 58f3b56..d69cd2a 100644 ---- a/drivers/clk/at91/clk-peripheral.c -+++ b/drivers/clk/at91/clk-peripheral.c -@@ -12,11 +12,13 @@ - #include - #include - #include --#include --#include -+#include -+#include - - #include "pmc.h" - -+DEFINE_SPINLOCK(pmc_pcr_lock); -+ - #define PERIPHERAL_MAX 64 - - #define PERIPHERAL_AT91RM9200 0 -@@ -33,7 +35,7 @@ - - struct clk_peripheral { - struct clk_hw hw; -- struct at91_pmc *pmc; -+ struct regmap *regmap; - u32 id; - }; - -@@ -41,8 +43,9 @@ struct clk_peripheral { - - struct clk_sam9x5_peripheral { - struct clk_hw hw; -- struct at91_pmc *pmc; -+ struct regmap *regmap; - struct clk_range range; -+ spinlock_t *lock; - u32 id; - u32 div; - bool auto_div; -@@ -54,7 +57,6 @@ struct clk_sam9x5_peripheral { - static int clk_peripheral_enable(struct clk_hw *hw) - { - struct clk_peripheral *periph = to_clk_peripheral(hw); -- struct at91_pmc *pmc = periph->pmc; - int offset = AT91_PMC_PCER; - u32 id = periph->id; - -@@ -62,14 +64,14 @@ static int clk_peripheral_enable(struct clk_hw *hw) - return 0; - if (id > PERIPHERAL_ID_MAX) - offset = AT91_PMC_PCER1; -- pmc_write(pmc, offset, PERIPHERAL_MASK(id)); -+ regmap_write(periph->regmap, offset, PERIPHERAL_MASK(id)); -+ - return 0; - } - - static void clk_peripheral_disable(struct clk_hw *hw) - { - struct clk_peripheral *periph = to_clk_peripheral(hw); -- struct at91_pmc *pmc = periph->pmc; - int offset = AT91_PMC_PCDR; - u32 id = periph->id; - -@@ -77,21 +79,23 @@ static void clk_peripheral_disable(struct clk_hw *hw) - return; - if (id > PERIPHERAL_ID_MAX) - offset = AT91_PMC_PCDR1; -- pmc_write(pmc, offset, PERIPHERAL_MASK(id)); -+ regmap_write(periph->regmap, offset, PERIPHERAL_MASK(id)); - } - - static int clk_peripheral_is_enabled(struct clk_hw *hw) - { - struct clk_peripheral *periph = to_clk_peripheral(hw); -- struct at91_pmc *pmc = periph->pmc; - int offset = AT91_PMC_PCSR; -+ unsigned int status; - u32 id = periph->id; - - if (id < PERIPHERAL_ID_MIN) - return 1; - if (id > PERIPHERAL_ID_MAX) - offset = AT91_PMC_PCSR1; -- return !!(pmc_read(pmc, offset) & PERIPHERAL_MASK(id)); -+ regmap_read(periph->regmap, offset, &status); -+ -+ return status & PERIPHERAL_MASK(id) ? 1 : 0; - } - - static const struct clk_ops peripheral_ops = { -@@ -101,14 +105,14 @@ static const struct clk_ops peripheral_ops = { - }; - - static struct clk * __init --at91_clk_register_peripheral(struct at91_pmc *pmc, const char *name, -+at91_clk_register_peripheral(struct regmap *regmap, const char *name, - const char *parent_name, u32 id) - { - struct clk_peripheral *periph; - struct clk *clk = NULL; - struct clk_init_data init; - -- if (!pmc || !name || !parent_name || id > PERIPHERAL_ID_MAX) -+ if (!name || !parent_name || id > PERIPHERAL_ID_MAX) - return ERR_PTR(-EINVAL); - - periph = kzalloc(sizeof(*periph), GFP_KERNEL); -@@ -123,7 +127,7 @@ at91_clk_register_peripheral(struct at91_pmc *pmc, const char *name, - - periph->id = id; - periph->hw.init = &init; -- periph->pmc = pmc; -+ periph->regmap = regmap; - - clk = clk_register(NULL, &periph->hw); - if (IS_ERR(clk)) -@@ -160,53 +164,58 @@ static void clk_sam9x5_peripheral_autodiv(struct clk_sam9x5_peripheral *periph) - static int clk_sam9x5_peripheral_enable(struct clk_hw *hw) - { - struct clk_sam9x5_peripheral *periph = to_clk_sam9x5_peripheral(hw); -- struct at91_pmc *pmc = periph->pmc; -- u32 tmp; -+ unsigned long flags; - - if (periph->id < PERIPHERAL_ID_MIN) - return 0; - -- pmc_lock(pmc); -- pmc_write(pmc, AT91_PMC_PCR, (periph->id & AT91_PMC_PCR_PID_MASK)); -- tmp = pmc_read(pmc, AT91_PMC_PCR) & ~AT91_PMC_PCR_DIV_MASK; -- pmc_write(pmc, AT91_PMC_PCR, tmp | AT91_PMC_PCR_DIV(periph->div) -- | AT91_PMC_PCR_CMD -- | AT91_PMC_PCR_EN); -- pmc_unlock(pmc); -+ spin_lock_irqsave(periph->lock, flags); -+ regmap_write(periph->regmap, AT91_PMC_PCR, -+ (periph->id & AT91_PMC_PCR_PID_MASK)); -+ regmap_update_bits(periph->regmap, AT91_PMC_PCR, -+ AT91_PMC_PCR_DIV_MASK | AT91_PMC_PCR_CMD | -+ AT91_PMC_PCR_EN, -+ AT91_PMC_PCR_DIV(periph->div) | -+ AT91_PMC_PCR_CMD | -+ AT91_PMC_PCR_EN); -+ spin_unlock_irqrestore(periph->lock, flags); -+ - return 0; - } - - static void clk_sam9x5_peripheral_disable(struct clk_hw *hw) - { - struct clk_sam9x5_peripheral *periph = to_clk_sam9x5_peripheral(hw); -- struct at91_pmc *pmc = periph->pmc; -- u32 tmp; -+ unsigned long flags; - - if (periph->id < PERIPHERAL_ID_MIN) - return; - -- pmc_lock(pmc); -- pmc_write(pmc, AT91_PMC_PCR, (periph->id & AT91_PMC_PCR_PID_MASK)); -- tmp = pmc_read(pmc, AT91_PMC_PCR) & ~AT91_PMC_PCR_EN; -- pmc_write(pmc, AT91_PMC_PCR, tmp | AT91_PMC_PCR_CMD); -- pmc_unlock(pmc); -+ spin_lock_irqsave(periph->lock, flags); -+ regmap_write(periph->regmap, AT91_PMC_PCR, -+ (periph->id & AT91_PMC_PCR_PID_MASK)); -+ regmap_update_bits(periph->regmap, AT91_PMC_PCR, -+ AT91_PMC_PCR_EN | AT91_PMC_PCR_CMD, -+ AT91_PMC_PCR_CMD); -+ spin_unlock_irqrestore(periph->lock, flags); - } - - static int clk_sam9x5_peripheral_is_enabled(struct clk_hw *hw) - { - struct clk_sam9x5_peripheral *periph = to_clk_sam9x5_peripheral(hw); -- struct at91_pmc *pmc = periph->pmc; -- int ret; -+ unsigned long flags; -+ unsigned int status; - - if (periph->id < PERIPHERAL_ID_MIN) - return 1; - -- pmc_lock(pmc); -- pmc_write(pmc, AT91_PMC_PCR, (periph->id & AT91_PMC_PCR_PID_MASK)); -- ret = !!(pmc_read(pmc, AT91_PMC_PCR) & AT91_PMC_PCR_EN); -- pmc_unlock(pmc); -+ spin_lock_irqsave(periph->lock, flags); -+ regmap_write(periph->regmap, AT91_PMC_PCR, -+ (periph->id & AT91_PMC_PCR_PID_MASK)); -+ regmap_read(periph->regmap, AT91_PMC_PCR, &status); -+ spin_unlock_irqrestore(periph->lock, flags); - -- return ret; -+ return status & AT91_PMC_PCR_EN ? 1 : 0; - } - - static unsigned long -@@ -214,19 +223,20 @@ clk_sam9x5_peripheral_recalc_rate(struct clk_hw *hw, - unsigned long parent_rate) - { - struct clk_sam9x5_peripheral *periph = to_clk_sam9x5_peripheral(hw); -- struct at91_pmc *pmc = periph->pmc; -- u32 tmp; -+ unsigned long flags; -+ unsigned int status; - - if (periph->id < PERIPHERAL_ID_MIN) - return parent_rate; - -- pmc_lock(pmc); -- pmc_write(pmc, AT91_PMC_PCR, (periph->id & AT91_PMC_PCR_PID_MASK)); -- tmp = pmc_read(pmc, AT91_PMC_PCR); -- pmc_unlock(pmc); -+ spin_lock_irqsave(periph->lock, flags); -+ regmap_write(periph->regmap, AT91_PMC_PCR, -+ (periph->id & AT91_PMC_PCR_PID_MASK)); -+ regmap_read(periph->regmap, AT91_PMC_PCR, &status); -+ spin_unlock_irqrestore(periph->lock, flags); - -- if (tmp & AT91_PMC_PCR_EN) { -- periph->div = PERIPHERAL_RSHIFT(tmp); -+ if (status & AT91_PMC_PCR_EN) { -+ periph->div = PERIPHERAL_RSHIFT(status); - periph->auto_div = false; - } else { - clk_sam9x5_peripheral_autodiv(periph); -@@ -318,15 +328,15 @@ static const struct clk_ops sam9x5_peripheral_ops = { - }; - - static struct clk * __init --at91_clk_register_sam9x5_peripheral(struct at91_pmc *pmc, const char *name, -- const char *parent_name, u32 id, -- const struct clk_range *range) -+at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock, -+ const char *name, const char *parent_name, -+ u32 id, const struct clk_range *range) - { - struct clk_sam9x5_peripheral *periph; - struct clk *clk = NULL; - struct clk_init_data init; - -- if (!pmc || !name || !parent_name) -+ if (!name || !parent_name) - return ERR_PTR(-EINVAL); - - periph = kzalloc(sizeof(*periph), GFP_KERNEL); -@@ -342,7 +352,8 @@ at91_clk_register_sam9x5_peripheral(struct at91_pmc *pmc, const char *name, - periph->id = id; - periph->hw.init = &init; - periph->div = 0; -- periph->pmc = pmc; -+ periph->regmap = regmap; -+ periph->lock = lock; - periph->auto_div = true; - periph->range = *range; - -@@ -356,7 +367,7 @@ at91_clk_register_sam9x5_peripheral(struct at91_pmc *pmc, const char *name, - } - - static void __init --of_at91_clk_periph_setup(struct device_node *np, struct at91_pmc *pmc, u8 type) -+of_at91_clk_periph_setup(struct device_node *np, u8 type) - { - int num; - u32 id; -@@ -364,6 +375,7 @@ of_at91_clk_periph_setup(struct device_node *np, struct at91_pmc *pmc, u8 type) - const char *parent_name; - const char *name; - struct device_node *periphclknp; -+ struct regmap *regmap; - - parent_name = of_clk_get_parent_name(np, 0); - if (!parent_name) -@@ -373,6 +385,10 @@ of_at91_clk_periph_setup(struct device_node *np, struct at91_pmc *pmc, u8 type) - if (!num || num > PERIPHERAL_MAX) - return; - -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) -+ return; -+ - for_each_child_of_node(np, periphclknp) { - if (of_property_read_u32(periphclknp, "reg", &id)) - continue; -@@ -384,7 +400,7 @@ of_at91_clk_periph_setup(struct device_node *np, struct at91_pmc *pmc, u8 type) - name = periphclknp->name; - - if (type == PERIPHERAL_AT91RM9200) { -- clk = at91_clk_register_peripheral(pmc, name, -+ clk = at91_clk_register_peripheral(regmap, name, - parent_name, id); - } else { - struct clk_range range = CLK_RANGE(0, 0); -@@ -393,7 +409,9 @@ of_at91_clk_periph_setup(struct device_node *np, struct at91_pmc *pmc, u8 type) - "atmel,clk-output-range", - &range); - -- clk = at91_clk_register_sam9x5_peripheral(pmc, name, -+ clk = at91_clk_register_sam9x5_peripheral(regmap, -+ &pmc_pcr_lock, -+ name, - parent_name, - id, &range); - } -@@ -405,14 +423,16 @@ of_at91_clk_periph_setup(struct device_node *np, struct at91_pmc *pmc, u8 type) - } - } - --void __init of_at91rm9200_clk_periph_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91rm9200_clk_periph_setup(struct device_node *np) - { -- of_at91_clk_periph_setup(np, pmc, PERIPHERAL_AT91RM9200); -+ of_at91_clk_periph_setup(np, PERIPHERAL_AT91RM9200); - } -+CLK_OF_DECLARE(at91rm9200_clk_periph, "atmel,at91rm9200-clk-peripheral", -+ of_at91rm9200_clk_periph_setup); - --void __init of_at91sam9x5_clk_periph_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91sam9x5_clk_periph_setup(struct device_node *np) - { -- of_at91_clk_periph_setup(np, pmc, PERIPHERAL_AT91SAM9X5); -+ of_at91_clk_periph_setup(np, PERIPHERAL_AT91SAM9X5); - } -+CLK_OF_DECLARE(at91sam9x5_clk_periph, "atmel,at91sam9x5-clk-peripheral", -+ of_at91sam9x5_clk_periph_setup); -diff --git a/drivers/clk/at91/clk-pll.c b/drivers/clk/at91/clk-pll.c -index 18b60f4..fb2e0b5 100644 ---- a/drivers/clk/at91/clk-pll.c -+++ b/drivers/clk/at91/clk-pll.c -@@ -12,14 +12,8 @@ - #include - #include - #include --#include --#include --#include --#include --#include --#include --#include --#include -+#include -+#include - - #include "pmc.h" - -@@ -58,9 +52,7 @@ struct clk_pll_layout { - - struct clk_pll { - struct clk_hw hw; -- struct at91_pmc *pmc; -- unsigned int irq; -- wait_queue_head_t wait; -+ struct regmap *regmap; - u8 id; - u8 div; - u8 range; -@@ -69,20 +61,19 @@ struct clk_pll { - const struct clk_pll_characteristics *characteristics; - }; - --static irqreturn_t clk_pll_irq_handler(int irq, void *dev_id) -+static inline bool clk_pll_ready(struct regmap *regmap, int id) - { -- struct clk_pll *pll = (struct clk_pll *)dev_id; -+ unsigned int status; - -- wake_up(&pll->wait); -- disable_irq_nosync(pll->irq); -+ regmap_read(regmap, AT91_PMC_SR, &status); - -- return IRQ_HANDLED; -+ return status & PLL_STATUS_MASK(id) ? 1 : 0; - } - - static int clk_pll_prepare(struct clk_hw *hw) - { - struct clk_pll *pll = to_clk_pll(hw); -- struct at91_pmc *pmc = pll->pmc; -+ struct regmap *regmap = pll->regmap; - const struct clk_pll_layout *layout = pll->layout; - const struct clk_pll_characteristics *characteristics = - pll->characteristics; -@@ -90,39 +81,34 @@ static int clk_pll_prepare(struct clk_hw *hw) - u32 mask = PLL_STATUS_MASK(id); - int offset = PLL_REG(id); - u8 out = 0; -- u32 pllr, icpr; -+ unsigned int pllr; -+ unsigned int status; - u8 div; - u16 mul; - -- pllr = pmc_read(pmc, offset); -+ regmap_read(regmap, offset, &pllr); - div = PLL_DIV(pllr); - mul = PLL_MUL(pllr, layout); - -- if ((pmc_read(pmc, AT91_PMC_SR) & mask) && -+ regmap_read(regmap, AT91_PMC_SR, &status); -+ if ((status & mask) && - (div == pll->div && mul == pll->mul)) - return 0; - - if (characteristics->out) - out = characteristics->out[pll->range]; -- if (characteristics->icpll) { -- icpr = pmc_read(pmc, AT91_PMC_PLLICPR) & ~PLL_ICPR_MASK(id); -- icpr |= (characteristics->icpll[pll->range] << -- PLL_ICPR_SHIFT(id)); -- pmc_write(pmc, AT91_PMC_PLLICPR, icpr); -- } - -- pllr &= ~layout->pllr_mask; -- pllr |= layout->pllr_mask & -- (pll->div | (PLL_MAX_COUNT << PLL_COUNT_SHIFT) | -- (out << PLL_OUT_SHIFT) | -- ((pll->mul & layout->mul_mask) << layout->mul_shift)); -- pmc_write(pmc, offset, pllr); -- -- while (!(pmc_read(pmc, AT91_PMC_SR) & mask)) { -- enable_irq(pll->irq); -- wait_event(pll->wait, -- pmc_read(pmc, AT91_PMC_SR) & mask); -- } -+ if (characteristics->icpll) -+ regmap_update_bits(regmap, AT91_PMC_PLLICPR, PLL_ICPR_MASK(id), -+ characteristics->icpll[pll->range] << PLL_ICPR_SHIFT(id)); -+ -+ regmap_update_bits(regmap, offset, layout->pllr_mask, -+ pll->div | (PLL_MAX_COUNT << PLL_COUNT_SHIFT) | -+ (out << PLL_OUT_SHIFT) | -+ ((pll->mul & layout->mul_mask) << layout->mul_shift)); -+ -+ while (!clk_pll_ready(regmap, pll->id)) -+ cpu_relax(); - - return 0; - } -@@ -130,32 +116,35 @@ static int clk_pll_prepare(struct clk_hw *hw) - static int clk_pll_is_prepared(struct clk_hw *hw) - { - struct clk_pll *pll = to_clk_pll(hw); -- struct at91_pmc *pmc = pll->pmc; - -- return !!(pmc_read(pmc, AT91_PMC_SR) & -- PLL_STATUS_MASK(pll->id)); -+ return clk_pll_ready(pll->regmap, pll->id); - } - - static void clk_pll_unprepare(struct clk_hw *hw) - { - struct clk_pll *pll = to_clk_pll(hw); -- struct at91_pmc *pmc = pll->pmc; -- const struct clk_pll_layout *layout = pll->layout; -- int offset = PLL_REG(pll->id); -- u32 tmp = pmc_read(pmc, offset) & ~(layout->pllr_mask); -+ unsigned int mask = pll->layout->pllr_mask; - -- pmc_write(pmc, offset, tmp); -+ regmap_update_bits(pll->regmap, PLL_REG(pll->id), mask, ~mask); - } - - static unsigned long clk_pll_recalc_rate(struct clk_hw *hw, - unsigned long parent_rate) - { - struct clk_pll *pll = to_clk_pll(hw); -+ unsigned int pllr; -+ u16 mul; -+ u8 div; - -- if (!pll->div || !pll->mul) -+ regmap_read(pll->regmap, PLL_REG(pll->id), &pllr); -+ -+ div = PLL_DIV(pllr); -+ mul = PLL_MUL(pllr, pll->layout); -+ -+ if (!div || !mul) - return 0; - -- return (parent_rate / pll->div) * (pll->mul + 1); -+ return (parent_rate / div) * (mul + 1); - } - - static long clk_pll_get_best_div_mul(struct clk_pll *pll, unsigned long rate, -@@ -308,7 +297,7 @@ static const struct clk_ops pll_ops = { - }; - - static struct clk * __init --at91_clk_register_pll(struct at91_pmc *pmc, unsigned int irq, const char *name, -+at91_clk_register_pll(struct regmap *regmap, const char *name, - const char *parent_name, u8 id, - const struct clk_pll_layout *layout, - const struct clk_pll_characteristics *characteristics) -@@ -316,9 +305,8 @@ at91_clk_register_pll(struct at91_pmc *pmc, unsigned int irq, const char *name, - struct clk_pll *pll; - struct clk *clk = NULL; - struct clk_init_data init; -- int ret; - int offset = PLL_REG(id); -- u32 tmp; -+ unsigned int pllr; - - if (id > PLL_MAX_ID) - return ERR_PTR(-EINVAL); -@@ -337,23 +325,13 @@ at91_clk_register_pll(struct at91_pmc *pmc, unsigned int irq, const char *name, - pll->hw.init = &init; - pll->layout = layout; - pll->characteristics = characteristics; -- pll->pmc = pmc; -- pll->irq = irq; -- tmp = pmc_read(pmc, offset) & layout->pllr_mask; -- pll->div = PLL_DIV(tmp); -- pll->mul = PLL_MUL(tmp, layout); -- init_waitqueue_head(&pll->wait); -- irq_set_status_flags(pll->irq, IRQ_NOAUTOEN); -- ret = request_irq(pll->irq, clk_pll_irq_handler, IRQF_TRIGGER_HIGH, -- id ? "clk-pllb" : "clk-plla", pll); -- if (ret) { -- kfree(pll); -- return ERR_PTR(ret); -- } -+ pll->regmap = regmap; -+ regmap_read(regmap, offset, &pllr); -+ pll->div = PLL_DIV(pllr); -+ pll->mul = PLL_MUL(pllr, layout); - - clk = clk_register(NULL, &pll->hw); - if (IS_ERR(clk)) { -- free_irq(pll->irq, pll); - kfree(pll); - } - -@@ -483,12 +461,12 @@ of_at91_clk_pll_get_characteristics(struct device_node *np) - } - - static void __init --of_at91_clk_pll_setup(struct device_node *np, struct at91_pmc *pmc, -+of_at91_clk_pll_setup(struct device_node *np, - const struct clk_pll_layout *layout) - { - u32 id; -- unsigned int irq; - struct clk *clk; -+ struct regmap *regmap; - const char *parent_name; - const char *name = np->name; - struct clk_pll_characteristics *characteristics; -@@ -500,15 +478,15 @@ of_at91_clk_pll_setup(struct device_node *np, struct at91_pmc *pmc, - - of_property_read_string(np, "clock-output-names", &name); - -- characteristics = of_at91_clk_pll_get_characteristics(np); -- if (!characteristics) -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) - return; - -- irq = irq_of_parse_and_map(np, 0); -- if (!irq) -+ characteristics = of_at91_clk_pll_get_characteristics(np); -+ if (!characteristics) - return; - -- clk = at91_clk_register_pll(pmc, irq, name, parent_name, id, layout, -+ clk = at91_clk_register_pll(regmap, name, parent_name, id, layout, - characteristics); - if (IS_ERR(clk)) - goto out_free_characteristics; -@@ -520,26 +498,30 @@ of_at91_clk_pll_setup(struct device_node *np, struct at91_pmc *pmc, - kfree(characteristics); - } - --void __init of_at91rm9200_clk_pll_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91rm9200_clk_pll_setup(struct device_node *np) - { -- of_at91_clk_pll_setup(np, pmc, &at91rm9200_pll_layout); -+ of_at91_clk_pll_setup(np, &at91rm9200_pll_layout); - } -+CLK_OF_DECLARE(at91rm9200_clk_pll, "atmel,at91rm9200-clk-pll", -+ of_at91rm9200_clk_pll_setup); - --void __init of_at91sam9g45_clk_pll_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91sam9g45_clk_pll_setup(struct device_node *np) - { -- of_at91_clk_pll_setup(np, pmc, &at91sam9g45_pll_layout); -+ of_at91_clk_pll_setup(np, &at91sam9g45_pll_layout); - } -+CLK_OF_DECLARE(at91sam9g45_clk_pll, "atmel,at91sam9g45-clk-pll", -+ of_at91sam9g45_clk_pll_setup); - --void __init of_at91sam9g20_clk_pllb_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91sam9g20_clk_pllb_setup(struct device_node *np) - { -- of_at91_clk_pll_setup(np, pmc, &at91sam9g20_pllb_layout); -+ of_at91_clk_pll_setup(np, &at91sam9g20_pllb_layout); - } -+CLK_OF_DECLARE(at91sam9g20_clk_pllb, "atmel,at91sam9g20-clk-pllb", -+ of_at91sam9g20_clk_pllb_setup); - --void __init of_sama5d3_clk_pll_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_sama5d3_clk_pll_setup(struct device_node *np) - { -- of_at91_clk_pll_setup(np, pmc, &sama5d3_pll_layout); -+ of_at91_clk_pll_setup(np, &sama5d3_pll_layout); - } -+CLK_OF_DECLARE(sama5d3_clk_pll, "atmel,sama5d3-clk-pll", -+ of_sama5d3_clk_pll_setup); -diff --git a/drivers/clk/at91/clk-plldiv.c b/drivers/clk/at91/clk-plldiv.c -index ea22656..2bed264 100644 ---- a/drivers/clk/at91/clk-plldiv.c -+++ b/drivers/clk/at91/clk-plldiv.c -@@ -12,8 +12,8 @@ - #include - #include - #include --#include --#include -+#include -+#include - - #include "pmc.h" - -@@ -21,16 +21,18 @@ - - struct clk_plldiv { - struct clk_hw hw; -- struct at91_pmc *pmc; -+ struct regmap *regmap; - }; - - static unsigned long clk_plldiv_recalc_rate(struct clk_hw *hw, - unsigned long parent_rate) - { - struct clk_plldiv *plldiv = to_clk_plldiv(hw); -- struct at91_pmc *pmc = plldiv->pmc; -+ unsigned int mckr; - -- if (pmc_read(pmc, AT91_PMC_MCKR) & AT91_PMC_PLLADIV2) -+ regmap_read(plldiv->regmap, AT91_PMC_MCKR, &mckr); -+ -+ if (mckr & AT91_PMC_PLLADIV2) - return parent_rate / 2; - - return parent_rate; -@@ -57,18 +59,12 @@ static int clk_plldiv_set_rate(struct clk_hw *hw, unsigned long rate, - unsigned long parent_rate) - { - struct clk_plldiv *plldiv = to_clk_plldiv(hw); -- struct at91_pmc *pmc = plldiv->pmc; -- u32 tmp; - -- if (parent_rate != rate && (parent_rate / 2) != rate) -+ if ((parent_rate != rate) && (parent_rate / 2 != rate)) - return -EINVAL; - -- pmc_lock(pmc); -- tmp = pmc_read(pmc, AT91_PMC_MCKR) & ~AT91_PMC_PLLADIV2; -- if ((parent_rate / 2) == rate) -- tmp |= AT91_PMC_PLLADIV2; -- pmc_write(pmc, AT91_PMC_MCKR, tmp); -- pmc_unlock(pmc); -+ regmap_update_bits(plldiv->regmap, AT91_PMC_MCKR, AT91_PMC_PLLADIV2, -+ parent_rate != rate ? AT91_PMC_PLLADIV2 : 0); - - return 0; - } -@@ -80,7 +76,7 @@ static const struct clk_ops plldiv_ops = { - }; - - static struct clk * __init --at91_clk_register_plldiv(struct at91_pmc *pmc, const char *name, -+at91_clk_register_plldiv(struct regmap *regmap, const char *name, - const char *parent_name) - { - struct clk_plldiv *plldiv; -@@ -98,7 +94,7 @@ at91_clk_register_plldiv(struct at91_pmc *pmc, const char *name, - init.flags = CLK_SET_RATE_GATE; - - plldiv->hw.init = &init; -- plldiv->pmc = pmc; -+ plldiv->regmap = regmap; - - clk = clk_register(NULL, &plldiv->hw); - -@@ -109,27 +105,27 @@ at91_clk_register_plldiv(struct at91_pmc *pmc, const char *name, - } - - static void __init --of_at91_clk_plldiv_setup(struct device_node *np, struct at91_pmc *pmc) -+of_at91sam9x5_clk_plldiv_setup(struct device_node *np) - { - struct clk *clk; - const char *parent_name; - const char *name = np->name; -+ struct regmap *regmap; - - parent_name = of_clk_get_parent_name(np, 0); - - of_property_read_string(np, "clock-output-names", &name); - -- clk = at91_clk_register_plldiv(pmc, name, parent_name); -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) -+ return; - -+ clk = at91_clk_register_plldiv(regmap, name, parent_name); - if (IS_ERR(clk)) - return; - - of_clk_add_provider(np, of_clk_src_simple_get, clk); - return; - } -- --void __init of_at91sam9x5_clk_plldiv_setup(struct device_node *np, -- struct at91_pmc *pmc) --{ -- of_at91_clk_plldiv_setup(np, pmc); --} -+CLK_OF_DECLARE(at91sam9x5_clk_plldiv, "atmel,at91sam9x5-clk-plldiv", -+ of_at91sam9x5_clk_plldiv_setup); -diff --git a/drivers/clk/at91/clk-programmable.c b/drivers/clk/at91/clk-programmable.c -index 14b270b..bc0be62 100644 ---- a/drivers/clk/at91/clk-programmable.c -+++ b/drivers/clk/at91/clk-programmable.c -@@ -12,10 +12,8 @@ - #include - #include - #include --#include --#include --#include --#include -+#include -+#include - - #include "pmc.h" - -@@ -24,6 +22,7 @@ - - #define PROG_STATUS_MASK(id) (1 << ((id) + 8)) - #define PROG_PRES_MASK 0x7 -+#define PROG_PRES(layout, pckr) ((pckr >> layout->pres_shift) & PROG_PRES_MASK) - #define PROG_MAX_RM9200_CSS 3 - - struct clk_programmable_layout { -@@ -34,7 +33,7 @@ struct clk_programmable_layout { - - struct clk_programmable { - struct clk_hw hw; -- struct at91_pmc *pmc; -+ struct regmap *regmap; - u8 id; - const struct clk_programmable_layout *layout; - }; -@@ -44,14 +43,12 @@ struct clk_programmable { - static unsigned long clk_programmable_recalc_rate(struct clk_hw *hw, - unsigned long parent_rate) - { -- u32 pres; - struct clk_programmable *prog = to_clk_programmable(hw); -- struct at91_pmc *pmc = prog->pmc; -- const struct clk_programmable_layout *layout = prog->layout; -+ unsigned int pckr; -+ -+ regmap_read(prog->regmap, AT91_PMC_PCKR(prog->id), &pckr); - -- pres = (pmc_read(pmc, AT91_PMC_PCKR(prog->id)) >> layout->pres_shift) & -- PROG_PRES_MASK; -- return parent_rate >> pres; -+ return parent_rate >> PROG_PRES(prog->layout, pckr); - } - - static int clk_programmable_determine_rate(struct clk_hw *hw, -@@ -101,36 +98,36 @@ static int clk_programmable_set_parent(struct clk_hw *hw, u8 index) - { - struct clk_programmable *prog = to_clk_programmable(hw); - const struct clk_programmable_layout *layout = prog->layout; -- struct at91_pmc *pmc = prog->pmc; -- u32 tmp = pmc_read(pmc, AT91_PMC_PCKR(prog->id)) & ~layout->css_mask; -+ unsigned int mask = layout->css_mask; -+ unsigned int pckr = 0; - - if (layout->have_slck_mck) -- tmp &= AT91_PMC_CSSMCK_MCK; -+ mask |= AT91_PMC_CSSMCK_MCK; - - if (index > layout->css_mask) { -- if (index > PROG_MAX_RM9200_CSS && layout->have_slck_mck) { -- tmp |= AT91_PMC_CSSMCK_MCK; -- return 0; -- } else { -+ if (index > PROG_MAX_RM9200_CSS && !layout->have_slck_mck) - return -EINVAL; -- } -+ -+ pckr |= AT91_PMC_CSSMCK_MCK; - } - -- pmc_write(pmc, AT91_PMC_PCKR(prog->id), tmp | index); -+ regmap_update_bits(prog->regmap, AT91_PMC_PCKR(prog->id), mask, pckr); -+ - return 0; - } - - static u8 clk_programmable_get_parent(struct clk_hw *hw) - { -- u32 tmp; -- u8 ret; - struct clk_programmable *prog = to_clk_programmable(hw); -- struct at91_pmc *pmc = prog->pmc; - const struct clk_programmable_layout *layout = prog->layout; -+ unsigned int pckr; -+ u8 ret; -+ -+ regmap_read(prog->regmap, AT91_PMC_PCKR(prog->id), &pckr); -+ -+ ret = pckr & layout->css_mask; - -- tmp = pmc_read(pmc, AT91_PMC_PCKR(prog->id)); -- ret = tmp & layout->css_mask; -- if (layout->have_slck_mck && (tmp & AT91_PMC_CSSMCK_MCK) && !ret) -+ if (layout->have_slck_mck && (pckr & AT91_PMC_CSSMCK_MCK) && !ret) - ret = PROG_MAX_RM9200_CSS + 1; - - return ret; -@@ -140,26 +137,27 @@ static int clk_programmable_set_rate(struct clk_hw *hw, unsigned long rate, - unsigned long parent_rate) - { - struct clk_programmable *prog = to_clk_programmable(hw); -- struct at91_pmc *pmc = prog->pmc; - const struct clk_programmable_layout *layout = prog->layout; - unsigned long div = parent_rate / rate; -+ unsigned int pckr; - int shift = 0; -- u32 tmp = pmc_read(pmc, AT91_PMC_PCKR(prog->id)) & -- ~(PROG_PRES_MASK << layout->pres_shift); -+ -+ regmap_read(prog->regmap, AT91_PMC_PCKR(prog->id), &pckr); - - if (!div) - return -EINVAL; - - shift = fls(div) - 1; - -- if (div != (1<= PROG_PRES_MASK) - return -EINVAL; - -- pmc_write(pmc, AT91_PMC_PCKR(prog->id), -- tmp | (shift << layout->pres_shift)); -+ regmap_update_bits(prog->regmap, AT91_PMC_PCKR(prog->id), -+ PROG_PRES_MASK << layout->pres_shift, -+ shift << layout->pres_shift); - - return 0; - } -@@ -173,7 +171,7 @@ static const struct clk_ops programmable_ops = { - }; - - static struct clk * __init --at91_clk_register_programmable(struct at91_pmc *pmc, -+at91_clk_register_programmable(struct regmap *regmap, - const char *name, const char **parent_names, - u8 num_parents, u8 id, - const struct clk_programmable_layout *layout) -@@ -198,7 +196,7 @@ at91_clk_register_programmable(struct at91_pmc *pmc, - prog->id = id; - prog->layout = layout; - prog->hw.init = &init; -- prog->pmc = pmc; -+ prog->regmap = regmap; - - clk = clk_register(NULL, &prog->hw); - if (IS_ERR(clk)) -@@ -226,7 +224,7 @@ static const struct clk_programmable_layout at91sam9x5_programmable_layout = { - }; - - static void __init --of_at91_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc, -+of_at91_clk_prog_setup(struct device_node *np, - const struct clk_programmable_layout *layout) - { - int num; -@@ -236,6 +234,7 @@ of_at91_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc, - const char *parent_names[PROG_SOURCE_MAX]; - const char *name; - struct device_node *progclknp; -+ struct regmap *regmap; - - num_parents = of_clk_get_parent_count(np); - if (num_parents <= 0 || num_parents > PROG_SOURCE_MAX) -@@ -247,6 +246,10 @@ of_at91_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc, - if (!num || num > (PROG_ID_MAX + 1)) - return; - -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) -+ return; -+ - for_each_child_of_node(np, progclknp) { - if (of_property_read_u32(progclknp, "reg", &id)) - continue; -@@ -254,7 +257,7 @@ of_at91_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc, - if (of_property_read_string(np, "clock-output-names", &name)) - name = progclknp->name; - -- clk = at91_clk_register_programmable(pmc, name, -+ clk = at91_clk_register_programmable(regmap, name, - parent_names, num_parents, - id, layout); - if (IS_ERR(clk)) -@@ -265,20 +268,23 @@ of_at91_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc, - } - - --void __init of_at91rm9200_clk_prog_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91rm9200_clk_prog_setup(struct device_node *np) - { -- of_at91_clk_prog_setup(np, pmc, &at91rm9200_programmable_layout); -+ of_at91_clk_prog_setup(np, &at91rm9200_programmable_layout); - } -+CLK_OF_DECLARE(at91rm9200_clk_prog, "atmel,at91rm9200-clk-programmable", -+ of_at91rm9200_clk_prog_setup); - --void __init of_at91sam9g45_clk_prog_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91sam9g45_clk_prog_setup(struct device_node *np) - { -- of_at91_clk_prog_setup(np, pmc, &at91sam9g45_programmable_layout); -+ of_at91_clk_prog_setup(np, &at91sam9g45_programmable_layout); - } -+CLK_OF_DECLARE(at91sam9g45_clk_prog, "atmel,at91sam9g45-clk-programmable", -+ of_at91sam9g45_clk_prog_setup); - --void __init of_at91sam9x5_clk_prog_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91sam9x5_clk_prog_setup(struct device_node *np) - { -- of_at91_clk_prog_setup(np, pmc, &at91sam9x5_programmable_layout); -+ of_at91_clk_prog_setup(np, &at91sam9x5_programmable_layout); - } -+CLK_OF_DECLARE(at91sam9x5_clk_prog, "atmel,at91sam9x5-clk-programmable", -+ of_at91sam9x5_clk_prog_setup); -diff --git a/drivers/clk/at91/clk-slow.c b/drivers/clk/at91/clk-slow.c -index d0d5076..221c096 100644 ---- a/drivers/clk/at91/clk-slow.c -+++ b/drivers/clk/at91/clk-slow.c -@@ -13,17 +13,11 @@ - #include - #include - #include --#include - #include - #include - #include --#include --#include --#include --#include --#include --#include --#include -+#include -+#include - - #include "pmc.h" - #include "sckc.h" -@@ -59,7 +53,7 @@ struct clk_slow_rc_osc { - - struct clk_sam9260_slow { - struct clk_hw hw; -- struct at91_pmc *pmc; -+ struct regmap *regmap; - }; - - #define to_clk_sam9260_slow(hw) container_of(hw, struct clk_sam9260_slow, hw) -@@ -393,8 +387,11 @@ void __init of_at91sam9x5_clk_slow_setup(struct device_node *np, - static u8 clk_sam9260_slow_get_parent(struct clk_hw *hw) - { - struct clk_sam9260_slow *slowck = to_clk_sam9260_slow(hw); -+ unsigned int status; - -- return !!(pmc_read(slowck->pmc, AT91_PMC_SR) & AT91_PMC_OSCSEL); -+ regmap_read(slowck->regmap, AT91_PMC_SR, &status); -+ -+ return status & AT91_PMC_OSCSEL ? 1 : 0; - } - - static const struct clk_ops sam9260_slow_ops = { -@@ -402,7 +399,7 @@ static const struct clk_ops sam9260_slow_ops = { - }; - - static struct clk * __init --at91_clk_register_sam9260_slow(struct at91_pmc *pmc, -+at91_clk_register_sam9260_slow(struct regmap *regmap, - const char *name, - const char **parent_names, - int num_parents) -@@ -411,7 +408,7 @@ at91_clk_register_sam9260_slow(struct at91_pmc *pmc, - struct clk *clk = NULL; - struct clk_init_data init; - -- if (!pmc || !name) -+ if (!name) - return ERR_PTR(-EINVAL); - - if (!parent_names || !num_parents) -@@ -428,7 +425,7 @@ at91_clk_register_sam9260_slow(struct at91_pmc *pmc, - init.flags = 0; - - slowck->hw.init = &init; -- slowck->pmc = pmc; -+ slowck->regmap = regmap; - - clk = clk_register(NULL, &slowck->hw); - if (IS_ERR(clk)) -@@ -439,29 +436,34 @@ at91_clk_register_sam9260_slow(struct at91_pmc *pmc, - return clk; - } - --void __init of_at91sam9260_clk_slow_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91sam9260_clk_slow_setup(struct device_node *np) - { - struct clk *clk; - const char *parent_names[2]; - int num_parents; - const char *name = np->name; -+ struct regmap *regmap; - - num_parents = of_clk_get_parent_count(np); - if (num_parents != 2) - return; - - of_clk_parent_fill(np, parent_names, num_parents); -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) -+ return; - - of_property_read_string(np, "clock-output-names", &name); - -- clk = at91_clk_register_sam9260_slow(pmc, name, parent_names, -+ clk = at91_clk_register_sam9260_slow(regmap, name, parent_names, - num_parents); - if (IS_ERR(clk)) - return; - - of_clk_add_provider(np, of_clk_src_simple_get, clk); - } -+CLK_OF_DECLARE(at91sam9260_clk_slow, "atmel,at91sam9260-clk-slow", -+ of_at91sam9260_clk_slow_setup); - - /* - * FIXME: All slow clk users are not properly claiming it (get + prepare + -diff --git a/drivers/clk/at91/clk-smd.c b/drivers/clk/at91/clk-smd.c -index a7f8501..e6948a5 100644 ---- a/drivers/clk/at91/clk-smd.c -+++ b/drivers/clk/at91/clk-smd.c -@@ -12,8 +12,8 @@ - #include - #include - #include --#include --#include -+#include -+#include - - #include "pmc.h" - -@@ -24,7 +24,7 @@ - - struct at91sam9x5_clk_smd { - struct clk_hw hw; -- struct at91_pmc *pmc; -+ struct regmap *regmap; - }; - - #define to_at91sam9x5_clk_smd(hw) \ -@@ -33,13 +33,13 @@ struct at91sam9x5_clk_smd { - static unsigned long at91sam9x5_clk_smd_recalc_rate(struct clk_hw *hw, - unsigned long parent_rate) - { -- u32 tmp; -- u8 smddiv; - struct at91sam9x5_clk_smd *smd = to_at91sam9x5_clk_smd(hw); -- struct at91_pmc *pmc = smd->pmc; -+ unsigned int smdr; -+ u8 smddiv; -+ -+ regmap_read(smd->regmap, AT91_PMC_SMD, &smdr); -+ smddiv = (smdr & AT91_PMC_SMD_DIV) >> SMD_DIV_SHIFT; - -- tmp = pmc_read(pmc, AT91_PMC_SMD); -- smddiv = (tmp & AT91_PMC_SMD_DIV) >> SMD_DIV_SHIFT; - return parent_rate / (smddiv + 1); - } - -@@ -67,40 +67,38 @@ static long at91sam9x5_clk_smd_round_rate(struct clk_hw *hw, unsigned long rate, - - static int at91sam9x5_clk_smd_set_parent(struct clk_hw *hw, u8 index) - { -- u32 tmp; - struct at91sam9x5_clk_smd *smd = to_at91sam9x5_clk_smd(hw); -- struct at91_pmc *pmc = smd->pmc; - - if (index > 1) - return -EINVAL; -- tmp = pmc_read(pmc, AT91_PMC_SMD) & ~AT91_PMC_SMDS; -- if (index) -- tmp |= AT91_PMC_SMDS; -- pmc_write(pmc, AT91_PMC_SMD, tmp); -+ -+ regmap_update_bits(smd->regmap, AT91_PMC_SMD, AT91_PMC_SMDS, -+ index ? AT91_PMC_SMDS : 0); -+ - return 0; - } - - static u8 at91sam9x5_clk_smd_get_parent(struct clk_hw *hw) - { - struct at91sam9x5_clk_smd *smd = to_at91sam9x5_clk_smd(hw); -- struct at91_pmc *pmc = smd->pmc; -+ unsigned int smdr; - -- return pmc_read(pmc, AT91_PMC_SMD) & AT91_PMC_SMDS; -+ regmap_read(smd->regmap, AT91_PMC_SMD, &smdr); -+ -+ return smdr & AT91_PMC_SMDS; - } - - static int at91sam9x5_clk_smd_set_rate(struct clk_hw *hw, unsigned long rate, - unsigned long parent_rate) - { -- u32 tmp; - struct at91sam9x5_clk_smd *smd = to_at91sam9x5_clk_smd(hw); -- struct at91_pmc *pmc = smd->pmc; - unsigned long div = parent_rate / rate; - - if (parent_rate % rate || div < 1 || div > (SMD_MAX_DIV + 1)) - return -EINVAL; -- tmp = pmc_read(pmc, AT91_PMC_SMD) & ~AT91_PMC_SMD_DIV; -- tmp |= (div - 1) << SMD_DIV_SHIFT; -- pmc_write(pmc, AT91_PMC_SMD, tmp); -+ -+ regmap_update_bits(smd->regmap, AT91_PMC_SMD, AT91_PMC_SMD_DIV, -+ (div - 1) << SMD_DIV_SHIFT); - - return 0; - } -@@ -114,7 +112,7 @@ static const struct clk_ops at91sam9x5_smd_ops = { - }; - - static struct clk * __init --at91sam9x5_clk_register_smd(struct at91_pmc *pmc, const char *name, -+at91sam9x5_clk_register_smd(struct regmap *regmap, const char *name, - const char **parent_names, u8 num_parents) - { - struct at91sam9x5_clk_smd *smd; -@@ -132,7 +130,7 @@ at91sam9x5_clk_register_smd(struct at91_pmc *pmc, const char *name, - init.flags = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE; - - smd->hw.init = &init; -- smd->pmc = pmc; -+ smd->regmap = regmap; - - clk = clk_register(NULL, &smd->hw); - if (IS_ERR(clk)) -@@ -141,13 +139,13 @@ at91sam9x5_clk_register_smd(struct at91_pmc *pmc, const char *name, - return clk; - } - --void __init of_at91sam9x5_clk_smd_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91sam9x5_clk_smd_setup(struct device_node *np) - { - struct clk *clk; - int num_parents; - const char *parent_names[SMD_SOURCE_MAX]; - const char *name = np->name; -+ struct regmap *regmap; - - num_parents = of_clk_get_parent_count(np); - if (num_parents <= 0 || num_parents > SMD_SOURCE_MAX) -@@ -157,10 +155,16 @@ void __init of_at91sam9x5_clk_smd_setup(struct device_node *np, - - of_property_read_string(np, "clock-output-names", &name); - -- clk = at91sam9x5_clk_register_smd(pmc, name, parent_names, -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) -+ return; -+ -+ clk = at91sam9x5_clk_register_smd(regmap, name, parent_names, - num_parents); - if (IS_ERR(clk)) - return; - - of_clk_add_provider(np, of_clk_src_simple_get, clk); - } -+CLK_OF_DECLARE(at91sam9x5_clk_smd, "atmel,at91sam9x5-clk-smd", -+ of_at91sam9x5_clk_smd_setup); -diff --git a/drivers/clk/at91/clk-system.c b/drivers/clk/at91/clk-system.c -index 3f53143..8f35d81 100644 ---- a/drivers/clk/at91/clk-system.c -+++ b/drivers/clk/at91/clk-system.c -@@ -12,13 +12,8 @@ - #include - #include - #include --#include --#include --#include --#include --#include --#include --#include -+#include -+#include - - #include "pmc.h" - -@@ -29,9 +24,7 @@ - #define to_clk_system(hw) container_of(hw, struct clk_system, hw) - struct clk_system { - struct clk_hw hw; -- struct at91_pmc *pmc; -- unsigned int irq; -- wait_queue_head_t wait; -+ struct regmap *regmap; - u8 id; - }; - -@@ -39,58 +32,54 @@ static inline int is_pck(int id) - { - return (id >= 8) && (id <= 15); - } --static irqreturn_t clk_system_irq_handler(int irq, void *dev_id) -+ -+static inline bool clk_system_ready(struct regmap *regmap, int id) - { -- struct clk_system *sys = (struct clk_system *)dev_id; -+ unsigned int status; - -- wake_up(&sys->wait); -- disable_irq_nosync(sys->irq); -+ regmap_read(regmap, AT91_PMC_SR, &status); - -- return IRQ_HANDLED; -+ return status & (1 << id) ? 1 : 0; - } - - static int clk_system_prepare(struct clk_hw *hw) - { - struct clk_system *sys = to_clk_system(hw); -- struct at91_pmc *pmc = sys->pmc; -- u32 mask = 1 << sys->id; - -- pmc_write(pmc, AT91_PMC_SCER, mask); -+ regmap_write(sys->regmap, AT91_PMC_SCER, 1 << sys->id); - - if (!is_pck(sys->id)) - return 0; - -- while (!(pmc_read(pmc, AT91_PMC_SR) & mask)) { -- if (sys->irq) { -- enable_irq(sys->irq); -- wait_event(sys->wait, -- pmc_read(pmc, AT91_PMC_SR) & mask); -- } else -- cpu_relax(); -- } -+ while (!clk_system_ready(sys->regmap, sys->id)) -+ cpu_relax(); -+ - return 0; - } - - static void clk_system_unprepare(struct clk_hw *hw) - { - struct clk_system *sys = to_clk_system(hw); -- struct at91_pmc *pmc = sys->pmc; - -- pmc_write(pmc, AT91_PMC_SCDR, 1 << sys->id); -+ regmap_write(sys->regmap, AT91_PMC_SCDR, 1 << sys->id); - } - - static int clk_system_is_prepared(struct clk_hw *hw) - { - struct clk_system *sys = to_clk_system(hw); -- struct at91_pmc *pmc = sys->pmc; -+ unsigned int status; -+ -+ regmap_read(sys->regmap, AT91_PMC_SCSR, &status); - -- if (!(pmc_read(pmc, AT91_PMC_SCSR) & (1 << sys->id))) -+ if (!(status & (1 << sys->id))) - return 0; - - if (!is_pck(sys->id)) - return 1; - -- return !!(pmc_read(pmc, AT91_PMC_SR) & (1 << sys->id)); -+ regmap_read(sys->regmap, AT91_PMC_SR, &status); -+ -+ return status & (1 << sys->id) ? 1 : 0; - } - - static const struct clk_ops system_ops = { -@@ -100,13 +89,12 @@ static const struct clk_ops system_ops = { - }; - - static struct clk * __init --at91_clk_register_system(struct at91_pmc *pmc, const char *name, -- const char *parent_name, u8 id, int irq) -+at91_clk_register_system(struct regmap *regmap, const char *name, -+ const char *parent_name, u8 id) - { - struct clk_system *sys; - struct clk *clk = NULL; - struct clk_init_data init; -- int ret; - - if (!parent_name || id > SYSTEM_MAX_ID) - return ERR_PTR(-EINVAL); -@@ -123,44 +111,33 @@ at91_clk_register_system(struct at91_pmc *pmc, const char *name, - - sys->id = id; - sys->hw.init = &init; -- sys->pmc = pmc; -- sys->irq = irq; -- if (irq) { -- init_waitqueue_head(&sys->wait); -- irq_set_status_flags(sys->irq, IRQ_NOAUTOEN); -- ret = request_irq(sys->irq, clk_system_irq_handler, -- IRQF_TRIGGER_HIGH, name, sys); -- if (ret) { -- kfree(sys); -- return ERR_PTR(ret); -- } -- } -+ sys->regmap = regmap; - - clk = clk_register(NULL, &sys->hw); -- if (IS_ERR(clk)) { -- if (irq) -- free_irq(sys->irq, sys); -+ if (IS_ERR(clk)) - kfree(sys); -- } - - return clk; - } - --static void __init --of_at91_clk_sys_setup(struct device_node *np, struct at91_pmc *pmc) -+static void __init of_at91rm9200_clk_sys_setup(struct device_node *np) - { - int num; -- int irq = 0; - u32 id; - struct clk *clk; - const char *name; - struct device_node *sysclknp; - const char *parent_name; -+ struct regmap *regmap; - - num = of_get_child_count(np); - if (num > (SYSTEM_MAX_ID + 1)) - return; - -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) -+ return; -+ - for_each_child_of_node(np, sysclknp) { - if (of_property_read_u32(sysclknp, "reg", &id)) - continue; -@@ -168,21 +145,14 @@ of_at91_clk_sys_setup(struct device_node *np, struct at91_pmc *pmc) - if (of_property_read_string(np, "clock-output-names", &name)) - name = sysclknp->name; - -- if (is_pck(id)) -- irq = irq_of_parse_and_map(sysclknp, 0); -- - parent_name = of_clk_get_parent_name(sysclknp, 0); - -- clk = at91_clk_register_system(pmc, name, parent_name, id, irq); -+ clk = at91_clk_register_system(regmap, name, parent_name, id); - if (IS_ERR(clk)) - continue; - - of_clk_add_provider(sysclknp, of_clk_src_simple_get, clk); - } - } -- --void __init of_at91rm9200_clk_sys_setup(struct device_node *np, -- struct at91_pmc *pmc) --{ -- of_at91_clk_sys_setup(np, pmc); --} -+CLK_OF_DECLARE(at91rm9200_clk_sys, "atmel,at91rm9200-clk-system", -+ of_at91rm9200_clk_sys_setup); -diff --git a/drivers/clk/at91/clk-usb.c b/drivers/clk/at91/clk-usb.c -index 8ab8502..650ca45 100644 ---- a/drivers/clk/at91/clk-usb.c -+++ b/drivers/clk/at91/clk-usb.c -@@ -12,8 +12,8 @@ - #include - #include - #include --#include --#include -+#include -+#include - - #include "pmc.h" - -@@ -27,7 +27,7 @@ - - struct at91sam9x5_clk_usb { - struct clk_hw hw; -- struct at91_pmc *pmc; -+ struct regmap *regmap; - }; - - #define to_at91sam9x5_clk_usb(hw) \ -@@ -35,7 +35,7 @@ struct at91sam9x5_clk_usb { - - struct at91rm9200_clk_usb { - struct clk_hw hw; -- struct at91_pmc *pmc; -+ struct regmap *regmap; - u32 divisors[4]; - }; - -@@ -45,13 +45,12 @@ struct at91rm9200_clk_usb { - static unsigned long at91sam9x5_clk_usb_recalc_rate(struct clk_hw *hw, - unsigned long parent_rate) - { -- u32 tmp; -- u8 usbdiv; - struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); -- struct at91_pmc *pmc = usb->pmc; -+ unsigned int usbr; -+ u8 usbdiv; - -- tmp = pmc_read(pmc, AT91_PMC_USB); -- usbdiv = (tmp & AT91_PMC_OHCIUSBDIV) >> SAM9X5_USB_DIV_SHIFT; -+ regmap_read(usb->regmap, AT91_PMC_USB, &usbr); -+ usbdiv = (usbr & AT91_PMC_OHCIUSBDIV) >> SAM9X5_USB_DIV_SHIFT; - - return DIV_ROUND_CLOSEST(parent_rate, (usbdiv + 1)); - } -@@ -109,33 +108,31 @@ static int at91sam9x5_clk_usb_determine_rate(struct clk_hw *hw, - - static int at91sam9x5_clk_usb_set_parent(struct clk_hw *hw, u8 index) - { -- u32 tmp; - struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); -- struct at91_pmc *pmc = usb->pmc; - - if (index > 1) - return -EINVAL; -- tmp = pmc_read(pmc, AT91_PMC_USB) & ~AT91_PMC_USBS; -- if (index) -- tmp |= AT91_PMC_USBS; -- pmc_write(pmc, AT91_PMC_USB, tmp); -+ -+ regmap_update_bits(usb->regmap, AT91_PMC_USB, AT91_PMC_USBS, -+ index ? AT91_PMC_USBS : 0); -+ - return 0; - } - - static u8 at91sam9x5_clk_usb_get_parent(struct clk_hw *hw) - { - struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); -- struct at91_pmc *pmc = usb->pmc; -+ unsigned int usbr; - -- return pmc_read(pmc, AT91_PMC_USB) & AT91_PMC_USBS; -+ regmap_read(usb->regmap, AT91_PMC_USB, &usbr); -+ -+ return usbr & AT91_PMC_USBS; - } - - static int at91sam9x5_clk_usb_set_rate(struct clk_hw *hw, unsigned long rate, - unsigned long parent_rate) - { -- u32 tmp; - struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); -- struct at91_pmc *pmc = usb->pmc; - unsigned long div; - - if (!rate) -@@ -145,9 +142,8 @@ static int at91sam9x5_clk_usb_set_rate(struct clk_hw *hw, unsigned long rate, - if (div > SAM9X5_USB_MAX_DIV + 1 || !div) - return -EINVAL; - -- tmp = pmc_read(pmc, AT91_PMC_USB) & ~AT91_PMC_OHCIUSBDIV; -- tmp |= (div - 1) << SAM9X5_USB_DIV_SHIFT; -- pmc_write(pmc, AT91_PMC_USB, tmp); -+ regmap_update_bits(usb->regmap, AT91_PMC_USB, AT91_PMC_OHCIUSBDIV, -+ (div - 1) << SAM9X5_USB_DIV_SHIFT); - - return 0; - } -@@ -163,28 +159,28 @@ static const struct clk_ops at91sam9x5_usb_ops = { - static int at91sam9n12_clk_usb_enable(struct clk_hw *hw) - { - struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); -- struct at91_pmc *pmc = usb->pmc; - -- pmc_write(pmc, AT91_PMC_USB, -- pmc_read(pmc, AT91_PMC_USB) | AT91_PMC_USBS); -+ regmap_update_bits(usb->regmap, AT91_PMC_USB, AT91_PMC_USBS, -+ AT91_PMC_USBS); -+ - return 0; - } - - static void at91sam9n12_clk_usb_disable(struct clk_hw *hw) - { - struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); -- struct at91_pmc *pmc = usb->pmc; - -- pmc_write(pmc, AT91_PMC_USB, -- pmc_read(pmc, AT91_PMC_USB) & ~AT91_PMC_USBS); -+ regmap_update_bits(usb->regmap, AT91_PMC_USB, AT91_PMC_USBS, 0); - } - - static int at91sam9n12_clk_usb_is_enabled(struct clk_hw *hw) - { - struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); -- struct at91_pmc *pmc = usb->pmc; -+ unsigned int usbr; - -- return !!(pmc_read(pmc, AT91_PMC_USB) & AT91_PMC_USBS); -+ regmap_read(usb->regmap, AT91_PMC_USB, &usbr); -+ -+ return usbr & AT91_PMC_USBS; - } - - static const struct clk_ops at91sam9n12_usb_ops = { -@@ -197,7 +193,7 @@ static const struct clk_ops at91sam9n12_usb_ops = { - }; - - static struct clk * __init --at91sam9x5_clk_register_usb(struct at91_pmc *pmc, const char *name, -+at91sam9x5_clk_register_usb(struct regmap *regmap, const char *name, - const char **parent_names, u8 num_parents) - { - struct at91sam9x5_clk_usb *usb; -@@ -216,7 +212,7 @@ at91sam9x5_clk_register_usb(struct at91_pmc *pmc, const char *name, - CLK_SET_RATE_PARENT; - - usb->hw.init = &init; -- usb->pmc = pmc; -+ usb->regmap = regmap; - - clk = clk_register(NULL, &usb->hw); - if (IS_ERR(clk)) -@@ -226,7 +222,7 @@ at91sam9x5_clk_register_usb(struct at91_pmc *pmc, const char *name, - } - - static struct clk * __init --at91sam9n12_clk_register_usb(struct at91_pmc *pmc, const char *name, -+at91sam9n12_clk_register_usb(struct regmap *regmap, const char *name, - const char *parent_name) - { - struct at91sam9x5_clk_usb *usb; -@@ -244,7 +240,7 @@ at91sam9n12_clk_register_usb(struct at91_pmc *pmc, const char *name, - init.flags = CLK_SET_RATE_GATE | CLK_SET_RATE_PARENT; - - usb->hw.init = &init; -- usb->pmc = pmc; -+ usb->regmap = regmap; - - clk = clk_register(NULL, &usb->hw); - if (IS_ERR(clk)) -@@ -257,12 +253,12 @@ static unsigned long at91rm9200_clk_usb_recalc_rate(struct clk_hw *hw, - unsigned long parent_rate) - { - struct at91rm9200_clk_usb *usb = to_at91rm9200_clk_usb(hw); -- struct at91_pmc *pmc = usb->pmc; -- u32 tmp; -+ unsigned int pllbr; - u8 usbdiv; - -- tmp = pmc_read(pmc, AT91_CKGR_PLLBR); -- usbdiv = (tmp & AT91_PMC_USBDIV) >> RM9200_USB_DIV_SHIFT; -+ regmap_read(usb->regmap, AT91_CKGR_PLLBR, &pllbr); -+ -+ usbdiv = (pllbr & AT91_PMC_USBDIV) >> RM9200_USB_DIV_SHIFT; - if (usb->divisors[usbdiv]) - return parent_rate / usb->divisors[usbdiv]; - -@@ -310,10 +306,8 @@ static long at91rm9200_clk_usb_round_rate(struct clk_hw *hw, unsigned long rate, - static int at91rm9200_clk_usb_set_rate(struct clk_hw *hw, unsigned long rate, - unsigned long parent_rate) - { -- u32 tmp; - int i; - struct at91rm9200_clk_usb *usb = to_at91rm9200_clk_usb(hw); -- struct at91_pmc *pmc = usb->pmc; - unsigned long div; - - if (!rate) -@@ -323,10 +317,10 @@ static int at91rm9200_clk_usb_set_rate(struct clk_hw *hw, unsigned long rate, - - for (i = 0; i < RM9200_USB_DIV_TAB_SIZE; i++) { - if (usb->divisors[i] == div) { -- tmp = pmc_read(pmc, AT91_CKGR_PLLBR) & -- ~AT91_PMC_USBDIV; -- tmp |= i << RM9200_USB_DIV_SHIFT; -- pmc_write(pmc, AT91_CKGR_PLLBR, tmp); -+ regmap_update_bits(usb->regmap, AT91_CKGR_PLLBR, -+ AT91_PMC_USBDIV, -+ i << RM9200_USB_DIV_SHIFT); -+ - return 0; - } - } -@@ -341,7 +335,7 @@ static const struct clk_ops at91rm9200_usb_ops = { - }; - - static struct clk * __init --at91rm9200_clk_register_usb(struct at91_pmc *pmc, const char *name, -+at91rm9200_clk_register_usb(struct regmap *regmap, const char *name, - const char *parent_name, const u32 *divisors) - { - struct at91rm9200_clk_usb *usb; -@@ -359,7 +353,7 @@ at91rm9200_clk_register_usb(struct at91_pmc *pmc, const char *name, - init.flags = CLK_SET_RATE_PARENT; - - usb->hw.init = &init; -- usb->pmc = pmc; -+ usb->regmap = regmap; - memcpy(usb->divisors, divisors, sizeof(usb->divisors)); - - clk = clk_register(NULL, &usb->hw); -@@ -369,13 +363,13 @@ at91rm9200_clk_register_usb(struct at91_pmc *pmc, const char *name, - return clk; - } - --void __init of_at91sam9x5_clk_usb_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91sam9x5_clk_usb_setup(struct device_node *np) - { - struct clk *clk; - int num_parents; - const char *parent_names[USB_SOURCE_MAX]; - const char *name = np->name; -+ struct regmap *regmap; - - num_parents = of_clk_get_parent_count(np); - if (num_parents <= 0 || num_parents > USB_SOURCE_MAX) -@@ -385,19 +379,26 @@ void __init of_at91sam9x5_clk_usb_setup(struct device_node *np, - - of_property_read_string(np, "clock-output-names", &name); - -- clk = at91sam9x5_clk_register_usb(pmc, name, parent_names, num_parents); -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) -+ return; -+ -+ clk = at91sam9x5_clk_register_usb(regmap, name, parent_names, -+ num_parents); - if (IS_ERR(clk)) - return; - - of_clk_add_provider(np, of_clk_src_simple_get, clk); - } -+CLK_OF_DECLARE(at91sam9x5_clk_usb, "atmel,at91sam9x5-clk-usb", -+ of_at91sam9x5_clk_usb_setup); - --void __init of_at91sam9n12_clk_usb_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91sam9n12_clk_usb_setup(struct device_node *np) - { - struct clk *clk; - const char *parent_name; - const char *name = np->name; -+ struct regmap *regmap; - - parent_name = of_clk_get_parent_name(np, 0); - if (!parent_name) -@@ -405,20 +406,26 @@ void __init of_at91sam9n12_clk_usb_setup(struct device_node *np, - - of_property_read_string(np, "clock-output-names", &name); - -- clk = at91sam9n12_clk_register_usb(pmc, name, parent_name); -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) -+ return; -+ -+ clk = at91sam9n12_clk_register_usb(regmap, name, parent_name); - if (IS_ERR(clk)) - return; - - of_clk_add_provider(np, of_clk_src_simple_get, clk); - } -+CLK_OF_DECLARE(at91sam9n12_clk_usb, "atmel,at91sam9n12-clk-usb", -+ of_at91sam9n12_clk_usb_setup); - --void __init of_at91rm9200_clk_usb_setup(struct device_node *np, -- struct at91_pmc *pmc) -+static void __init of_at91rm9200_clk_usb_setup(struct device_node *np) - { - struct clk *clk; - const char *parent_name; - const char *name = np->name; - u32 divisors[4] = {0, 0, 0, 0}; -+ struct regmap *regmap; - - parent_name = of_clk_get_parent_name(np, 0); - if (!parent_name) -@@ -430,9 +437,15 @@ void __init of_at91rm9200_clk_usb_setup(struct device_node *np, - - of_property_read_string(np, "clock-output-names", &name); - -- clk = at91rm9200_clk_register_usb(pmc, name, parent_name, divisors); -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) -+ return; -+ -+ clk = at91rm9200_clk_register_usb(regmap, name, parent_name, divisors); - if (IS_ERR(clk)) - return; - - of_clk_add_provider(np, of_clk_src_simple_get, clk); - } -+CLK_OF_DECLARE(at91rm9200_clk_usb, "atmel,at91rm9200-clk-usb", -+ of_at91rm9200_clk_usb_setup); -diff --git a/drivers/clk/at91/clk-utmi.c b/drivers/clk/at91/clk-utmi.c -index ca561e9..61fcf39 100644 ---- a/drivers/clk/at91/clk-utmi.c -+++ b/drivers/clk/at91/clk-utmi.c -@@ -11,14 +11,9 @@ - #include - #include - #include --#include --#include - #include --#include --#include --#include --#include --#include -+#include -+#include - - #include "pmc.h" - -@@ -26,37 +21,30 @@ - - struct clk_utmi { - struct clk_hw hw; -- struct at91_pmc *pmc; -- unsigned int irq; -- wait_queue_head_t wait; -+ struct regmap *regmap; - }; - - #define to_clk_utmi(hw) container_of(hw, struct clk_utmi, hw) - --static irqreturn_t clk_utmi_irq_handler(int irq, void *dev_id) -+static inline bool clk_utmi_ready(struct regmap *regmap) - { -- struct clk_utmi *utmi = (struct clk_utmi *)dev_id; -+ unsigned int status; - -- wake_up(&utmi->wait); -- disable_irq_nosync(utmi->irq); -+ regmap_read(regmap, AT91_PMC_SR, &status); - -- return IRQ_HANDLED; -+ return status & AT91_PMC_LOCKU; - } - - static int clk_utmi_prepare(struct clk_hw *hw) - { - struct clk_utmi *utmi = to_clk_utmi(hw); -- struct at91_pmc *pmc = utmi->pmc; -- u32 tmp = pmc_read(pmc, AT91_CKGR_UCKR) | AT91_PMC_UPLLEN | -- AT91_PMC_UPLLCOUNT | AT91_PMC_BIASEN; -+ unsigned int uckr = AT91_PMC_UPLLEN | AT91_PMC_UPLLCOUNT | -+ AT91_PMC_BIASEN; - -- pmc_write(pmc, AT91_CKGR_UCKR, tmp); -+ regmap_update_bits(utmi->regmap, AT91_CKGR_UCKR, uckr, uckr); - -- while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_LOCKU)) { -- enable_irq(utmi->irq); -- wait_event(utmi->wait, -- pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_LOCKU); -- } -+ while (!clk_utmi_ready(utmi->regmap)) -+ cpu_relax(); - - return 0; - } -@@ -64,18 +52,15 @@ static int clk_utmi_prepare(struct clk_hw *hw) - static int clk_utmi_is_prepared(struct clk_hw *hw) - { - struct clk_utmi *utmi = to_clk_utmi(hw); -- struct at91_pmc *pmc = utmi->pmc; - -- return !!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_LOCKU); -+ return clk_utmi_ready(utmi->regmap); - } - - static void clk_utmi_unprepare(struct clk_hw *hw) - { - struct clk_utmi *utmi = to_clk_utmi(hw); -- struct at91_pmc *pmc = utmi->pmc; -- u32 tmp = pmc_read(pmc, AT91_CKGR_UCKR) & ~AT91_PMC_UPLLEN; - -- pmc_write(pmc, AT91_CKGR_UCKR, tmp); -+ regmap_update_bits(utmi->regmap, AT91_CKGR_UCKR, AT91_PMC_UPLLEN, 0); - } - - static unsigned long clk_utmi_recalc_rate(struct clk_hw *hw, -@@ -93,10 +78,9 @@ static const struct clk_ops utmi_ops = { - }; - - static struct clk * __init --at91_clk_register_utmi(struct at91_pmc *pmc, unsigned int irq, -+at91_clk_register_utmi(struct regmap *regmap, - const char *name, const char *parent_name) - { -- int ret; - struct clk_utmi *utmi; - struct clk *clk = NULL; - struct clk_init_data init; -@@ -112,52 +96,36 @@ at91_clk_register_utmi(struct at91_pmc *pmc, unsigned int irq, - init.flags = CLK_SET_RATE_GATE; - - utmi->hw.init = &init; -- utmi->pmc = pmc; -- utmi->irq = irq; -- init_waitqueue_head(&utmi->wait); -- irq_set_status_flags(utmi->irq, IRQ_NOAUTOEN); -- ret = request_irq(utmi->irq, clk_utmi_irq_handler, -- IRQF_TRIGGER_HIGH, "clk-utmi", utmi); -- if (ret) { -- kfree(utmi); -- return ERR_PTR(ret); -- } -+ utmi->regmap = regmap; - - clk = clk_register(NULL, &utmi->hw); -- if (IS_ERR(clk)) { -- free_irq(utmi->irq, utmi); -+ if (IS_ERR(clk)) - kfree(utmi); -- } - - return clk; - } - --static void __init --of_at91_clk_utmi_setup(struct device_node *np, struct at91_pmc *pmc) -+static void __init of_at91sam9x5_clk_utmi_setup(struct device_node *np) - { -- unsigned int irq; - struct clk *clk; - const char *parent_name; - const char *name = np->name; -+ struct regmap *regmap; - - parent_name = of_clk_get_parent_name(np, 0); - - of_property_read_string(np, "clock-output-names", &name); - -- irq = irq_of_parse_and_map(np, 0); -- if (!irq) -+ regmap = syscon_node_to_regmap(of_get_parent(np)); -+ if (IS_ERR(regmap)) - return; - -- clk = at91_clk_register_utmi(pmc, irq, name, parent_name); -+ clk = at91_clk_register_utmi(regmap, name, parent_name); - if (IS_ERR(clk)) - return; - - of_clk_add_provider(np, of_clk_src_simple_get, clk); - return; - } -- --void __init of_at91sam9x5_clk_utmi_setup(struct device_node *np, -- struct at91_pmc *pmc) --{ -- of_at91_clk_utmi_setup(np, pmc); --} -+CLK_OF_DECLARE(at91sam9x5_clk_utmi, "atmel,at91sam9x5-clk-utmi", -+ of_at91sam9x5_clk_utmi_setup); -diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c -index 8476b57..526df5b 100644 ---- a/drivers/clk/at91/pmc.c -+++ b/drivers/clk/at91/pmc.c -@@ -12,36 +12,13 @@ - #include - #include - #include --#include --#include --#include --#include --#include --#include --#include -+#include -+#include - - #include - - #include "pmc.h" - --void __iomem *at91_pmc_base; --EXPORT_SYMBOL_GPL(at91_pmc_base); -- --void at91rm9200_idle(void) --{ -- /* -- * Disable the processor clock. The processor will be automatically -- * re-enabled by an interrupt or by a reset. -- */ -- at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK); --} -- --void at91sam9_idle(void) --{ -- at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK); -- cpu_do_idle(); --} -- - int of_at91_get_clk_range(struct device_node *np, const char *propname, - struct clk_range *range) - { -@@ -64,402 +41,3 @@ int of_at91_get_clk_range(struct device_node *np, const char *propname, - return 0; - } - EXPORT_SYMBOL_GPL(of_at91_get_clk_range); -- --static void pmc_irq_mask(struct irq_data *d) --{ -- struct at91_pmc *pmc = irq_data_get_irq_chip_data(d); -- -- pmc_write(pmc, AT91_PMC_IDR, 1 << d->hwirq); --} -- --static void pmc_irq_unmask(struct irq_data *d) --{ -- struct at91_pmc *pmc = irq_data_get_irq_chip_data(d); -- -- pmc_write(pmc, AT91_PMC_IER, 1 << d->hwirq); --} -- --static int pmc_irq_set_type(struct irq_data *d, unsigned type) --{ -- if (type != IRQ_TYPE_LEVEL_HIGH) { -- pr_warn("PMC: type not supported (support only IRQ_TYPE_LEVEL_HIGH type)\n"); -- return -EINVAL; -- } -- -- return 0; --} -- --static void pmc_irq_suspend(struct irq_data *d) --{ -- struct at91_pmc *pmc = irq_data_get_irq_chip_data(d); -- -- pmc->imr = pmc_read(pmc, AT91_PMC_IMR); -- pmc_write(pmc, AT91_PMC_IDR, pmc->imr); --} -- --static void pmc_irq_resume(struct irq_data *d) --{ -- struct at91_pmc *pmc = irq_data_get_irq_chip_data(d); -- -- pmc_write(pmc, AT91_PMC_IER, pmc->imr); --} -- --static struct irq_chip pmc_irq = { -- .name = "PMC", -- .irq_disable = pmc_irq_mask, -- .irq_mask = pmc_irq_mask, -- .irq_unmask = pmc_irq_unmask, -- .irq_set_type = pmc_irq_set_type, -- .irq_suspend = pmc_irq_suspend, -- .irq_resume = pmc_irq_resume, --}; -- --static struct lock_class_key pmc_lock_class; -- --static int pmc_irq_map(struct irq_domain *h, unsigned int virq, -- irq_hw_number_t hw) --{ -- struct at91_pmc *pmc = h->host_data; -- -- irq_set_lockdep_class(virq, &pmc_lock_class); -- -- irq_set_chip_and_handler(virq, &pmc_irq, -- handle_level_irq); -- irq_set_chip_data(virq, pmc); -- -- return 0; --} -- --static int pmc_irq_domain_xlate(struct irq_domain *d, -- struct device_node *ctrlr, -- const u32 *intspec, unsigned int intsize, -- irq_hw_number_t *out_hwirq, -- unsigned int *out_type) --{ -- struct at91_pmc *pmc = d->host_data; -- const struct at91_pmc_caps *caps = pmc->caps; -- -- if (WARN_ON(intsize < 1)) -- return -EINVAL; -- -- *out_hwirq = intspec[0]; -- -- if (!(caps->available_irqs & (1 << *out_hwirq))) -- return -EINVAL; -- -- *out_type = IRQ_TYPE_LEVEL_HIGH; -- -- return 0; --} -- --static const struct irq_domain_ops pmc_irq_ops = { -- .map = pmc_irq_map, -- .xlate = pmc_irq_domain_xlate, --}; -- --static irqreturn_t pmc_irq_handler(int irq, void *data) --{ -- struct at91_pmc *pmc = (struct at91_pmc *)data; -- unsigned long sr; -- int n; -- -- sr = pmc_read(pmc, AT91_PMC_SR) & pmc_read(pmc, AT91_PMC_IMR); -- if (!sr) -- return IRQ_NONE; -- -- for_each_set_bit(n, &sr, BITS_PER_LONG) -- generic_handle_irq(irq_find_mapping(pmc->irqdomain, n)); -- -- return IRQ_HANDLED; --} -- --static const struct at91_pmc_caps at91rm9200_caps = { -- .available_irqs = AT91_PMC_MOSCS | AT91_PMC_LOCKA | AT91_PMC_LOCKB | -- AT91_PMC_MCKRDY | AT91_PMC_PCK0RDY | -- AT91_PMC_PCK1RDY | AT91_PMC_PCK2RDY | -- AT91_PMC_PCK3RDY, --}; -- --static const struct at91_pmc_caps at91sam9260_caps = { -- .available_irqs = AT91_PMC_MOSCS | AT91_PMC_LOCKA | AT91_PMC_LOCKB | -- AT91_PMC_MCKRDY | AT91_PMC_PCK0RDY | -- AT91_PMC_PCK1RDY, --}; -- --static const struct at91_pmc_caps at91sam9g45_caps = { -- .available_irqs = AT91_PMC_MOSCS | AT91_PMC_LOCKA | AT91_PMC_MCKRDY | -- AT91_PMC_LOCKU | AT91_PMC_PCK0RDY | -- AT91_PMC_PCK1RDY, --}; -- --static const struct at91_pmc_caps at91sam9n12_caps = { -- .available_irqs = AT91_PMC_MOSCS | AT91_PMC_LOCKA | AT91_PMC_LOCKB | -- AT91_PMC_MCKRDY | AT91_PMC_PCK0RDY | -- AT91_PMC_PCK1RDY | AT91_PMC_MOSCSELS | -- AT91_PMC_MOSCRCS | AT91_PMC_CFDEV, --}; -- --static const struct at91_pmc_caps at91sam9x5_caps = { -- .available_irqs = AT91_PMC_MOSCS | AT91_PMC_LOCKA | AT91_PMC_MCKRDY | -- AT91_PMC_LOCKU | AT91_PMC_PCK0RDY | -- AT91_PMC_PCK1RDY | AT91_PMC_MOSCSELS | -- AT91_PMC_MOSCRCS | AT91_PMC_CFDEV, --}; -- --static const struct at91_pmc_caps sama5d2_caps = { -- .available_irqs = AT91_PMC_MOSCS | AT91_PMC_LOCKA | AT91_PMC_MCKRDY | -- AT91_PMC_LOCKU | AT91_PMC_PCK0RDY | -- AT91_PMC_PCK1RDY | AT91_PMC_PCK2RDY | -- AT91_PMC_MOSCSELS | AT91_PMC_MOSCRCS | -- AT91_PMC_CFDEV | AT91_PMC_GCKRDY, --}; -- --static const struct at91_pmc_caps sama5d3_caps = { -- .available_irqs = AT91_PMC_MOSCS | AT91_PMC_LOCKA | AT91_PMC_MCKRDY | -- AT91_PMC_LOCKU | AT91_PMC_PCK0RDY | -- AT91_PMC_PCK1RDY | AT91_PMC_PCK2RDY | -- AT91_PMC_MOSCSELS | AT91_PMC_MOSCRCS | -- AT91_PMC_CFDEV, --}; -- --static struct at91_pmc *__init at91_pmc_init(struct device_node *np, -- void __iomem *regbase, int virq, -- const struct at91_pmc_caps *caps) --{ -- struct at91_pmc *pmc; -- -- if (!regbase || !virq || !caps) -- return NULL; -- -- at91_pmc_base = regbase; -- -- pmc = kzalloc(sizeof(*pmc), GFP_KERNEL); -- if (!pmc) -- return NULL; -- -- spin_lock_init(&pmc->lock); -- pmc->regbase = regbase; -- pmc->virq = virq; -- pmc->caps = caps; -- -- pmc->irqdomain = irq_domain_add_linear(np, 32, &pmc_irq_ops, pmc); -- -- if (!pmc->irqdomain) -- goto out_free_pmc; -- -- pmc_write(pmc, AT91_PMC_IDR, 0xffffffff); -- if (request_irq(pmc->virq, pmc_irq_handler, -- IRQF_SHARED | IRQF_COND_SUSPEND, "pmc", pmc)) -- goto out_remove_irqdomain; -- -- return pmc; -- --out_remove_irqdomain: -- irq_domain_remove(pmc->irqdomain); --out_free_pmc: -- kfree(pmc); -- -- return NULL; --} -- --static const struct of_device_id pmc_clk_ids[] __initconst = { -- /* Slow oscillator */ -- { -- .compatible = "atmel,at91sam9260-clk-slow", -- .data = of_at91sam9260_clk_slow_setup, -- }, -- /* Main clock */ -- { -- .compatible = "atmel,at91rm9200-clk-main-osc", -- .data = of_at91rm9200_clk_main_osc_setup, -- }, -- { -- .compatible = "atmel,at91sam9x5-clk-main-rc-osc", -- .data = of_at91sam9x5_clk_main_rc_osc_setup, -- }, -- { -- .compatible = "atmel,at91rm9200-clk-main", -- .data = of_at91rm9200_clk_main_setup, -- }, -- { -- .compatible = "atmel,at91sam9x5-clk-main", -- .data = of_at91sam9x5_clk_main_setup, -- }, -- /* PLL clocks */ -- { -- .compatible = "atmel,at91rm9200-clk-pll", -- .data = of_at91rm9200_clk_pll_setup, -- }, -- { -- .compatible = "atmel,at91sam9g45-clk-pll", -- .data = of_at91sam9g45_clk_pll_setup, -- }, -- { -- .compatible = "atmel,at91sam9g20-clk-pllb", -- .data = of_at91sam9g20_clk_pllb_setup, -- }, -- { -- .compatible = "atmel,sama5d3-clk-pll", -- .data = of_sama5d3_clk_pll_setup, -- }, -- { -- .compatible = "atmel,at91sam9x5-clk-plldiv", -- .data = of_at91sam9x5_clk_plldiv_setup, -- }, -- /* Master clock */ -- { -- .compatible = "atmel,at91rm9200-clk-master", -- .data = of_at91rm9200_clk_master_setup, -- }, -- { -- .compatible = "atmel,at91sam9x5-clk-master", -- .data = of_at91sam9x5_clk_master_setup, -- }, -- /* System clocks */ -- { -- .compatible = "atmel,at91rm9200-clk-system", -- .data = of_at91rm9200_clk_sys_setup, -- }, -- /* Peripheral clocks */ -- { -- .compatible = "atmel,at91rm9200-clk-peripheral", -- .data = of_at91rm9200_clk_periph_setup, -- }, -- { -- .compatible = "atmel,at91sam9x5-clk-peripheral", -- .data = of_at91sam9x5_clk_periph_setup, -- }, -- /* Programmable clocks */ -- { -- .compatible = "atmel,at91rm9200-clk-programmable", -- .data = of_at91rm9200_clk_prog_setup, -- }, -- { -- .compatible = "atmel,at91sam9g45-clk-programmable", -- .data = of_at91sam9g45_clk_prog_setup, -- }, -- { -- .compatible = "atmel,at91sam9x5-clk-programmable", -- .data = of_at91sam9x5_clk_prog_setup, -- }, -- /* UTMI clock */ --#if defined(CONFIG_HAVE_AT91_UTMI) -- { -- .compatible = "atmel,at91sam9x5-clk-utmi", -- .data = of_at91sam9x5_clk_utmi_setup, -- }, --#endif -- /* USB clock */ --#if defined(CONFIG_HAVE_AT91_USB_CLK) -- { -- .compatible = "atmel,at91rm9200-clk-usb", -- .data = of_at91rm9200_clk_usb_setup, -- }, -- { -- .compatible = "atmel,at91sam9x5-clk-usb", -- .data = of_at91sam9x5_clk_usb_setup, -- }, -- { -- .compatible = "atmel,at91sam9n12-clk-usb", -- .data = of_at91sam9n12_clk_usb_setup, -- }, --#endif -- /* SMD clock */ --#if defined(CONFIG_HAVE_AT91_SMD) -- { -- .compatible = "atmel,at91sam9x5-clk-smd", -- .data = of_at91sam9x5_clk_smd_setup, -- }, --#endif --#if defined(CONFIG_HAVE_AT91_H32MX) -- { -- .compatible = "atmel,sama5d4-clk-h32mx", -- .data = of_sama5d4_clk_h32mx_setup, -- }, --#endif --#if defined(CONFIG_HAVE_AT91_GENERATED_CLK) -- { -- .compatible = "atmel,sama5d2-clk-generated", -- .data = of_sama5d2_clk_generated_setup, -- }, --#endif -- { /*sentinel*/ } --}; -- --static void __init of_at91_pmc_setup(struct device_node *np, -- const struct at91_pmc_caps *caps) --{ -- struct at91_pmc *pmc; -- struct device_node *childnp; -- void (*clk_setup)(struct device_node *, struct at91_pmc *); -- const struct of_device_id *clk_id; -- void __iomem *regbase = of_iomap(np, 0); -- int virq; -- -- if (!regbase) -- return; -- -- virq = irq_of_parse_and_map(np, 0); -- if (!virq) -- return; -- -- pmc = at91_pmc_init(np, regbase, virq, caps); -- if (!pmc) -- return; -- for_each_child_of_node(np, childnp) { -- clk_id = of_match_node(pmc_clk_ids, childnp); -- if (!clk_id) -- continue; -- clk_setup = clk_id->data; -- clk_setup(childnp, pmc); -- } --} -- --static void __init of_at91rm9200_pmc_setup(struct device_node *np) --{ -- of_at91_pmc_setup(np, &at91rm9200_caps); --} --CLK_OF_DECLARE(at91rm9200_clk_pmc, "atmel,at91rm9200-pmc", -- of_at91rm9200_pmc_setup); -- --static void __init of_at91sam9260_pmc_setup(struct device_node *np) --{ -- of_at91_pmc_setup(np, &at91sam9260_caps); --} --CLK_OF_DECLARE(at91sam9260_clk_pmc, "atmel,at91sam9260-pmc", -- of_at91sam9260_pmc_setup); -- --static void __init of_at91sam9g45_pmc_setup(struct device_node *np) --{ -- of_at91_pmc_setup(np, &at91sam9g45_caps); --} --CLK_OF_DECLARE(at91sam9g45_clk_pmc, "atmel,at91sam9g45-pmc", -- of_at91sam9g45_pmc_setup); -- --static void __init of_at91sam9n12_pmc_setup(struct device_node *np) --{ -- of_at91_pmc_setup(np, &at91sam9n12_caps); --} --CLK_OF_DECLARE(at91sam9n12_clk_pmc, "atmel,at91sam9n12-pmc", -- of_at91sam9n12_pmc_setup); -- --static void __init of_at91sam9x5_pmc_setup(struct device_node *np) --{ -- of_at91_pmc_setup(np, &at91sam9x5_caps); --} --CLK_OF_DECLARE(at91sam9x5_clk_pmc, "atmel,at91sam9x5-pmc", -- of_at91sam9x5_pmc_setup); -- --static void __init of_sama5d2_pmc_setup(struct device_node *np) --{ -- of_at91_pmc_setup(np, &sama5d2_caps); --} --CLK_OF_DECLARE(sama5d2_clk_pmc, "atmel,sama5d2-pmc", -- of_sama5d2_pmc_setup); -- --static void __init of_sama5d3_pmc_setup(struct device_node *np) --{ -- of_at91_pmc_setup(np, &sama5d3_caps); --} --CLK_OF_DECLARE(sama5d3_clk_pmc, "atmel,sama5d3-pmc", -- of_sama5d3_pmc_setup); -diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h -index f657392..5771fff 100644 ---- a/drivers/clk/at91/pmc.h -+++ b/drivers/clk/at91/pmc.h -@@ -14,8 +14,11 @@ - - #include - #include -+#include - #include - -+extern spinlock_t pmc_pcr_lock; -+ - struct clk_range { - unsigned long min; - unsigned long max; -@@ -23,102 +26,7 @@ struct clk_range { - - #define CLK_RANGE(MIN, MAX) {.min = MIN, .max = MAX,} - --struct at91_pmc_caps { -- u32 available_irqs; --}; -- --struct at91_pmc { -- void __iomem *regbase; -- int virq; -- spinlock_t lock; -- const struct at91_pmc_caps *caps; -- struct irq_domain *irqdomain; -- u32 imr; --}; -- --static inline void pmc_lock(struct at91_pmc *pmc) --{ -- spin_lock(&pmc->lock); --} -- --static inline void pmc_unlock(struct at91_pmc *pmc) --{ -- spin_unlock(&pmc->lock); --} -- --static inline u32 pmc_read(struct at91_pmc *pmc, int offset) --{ -- return readl(pmc->regbase + offset); --} -- --static inline void pmc_write(struct at91_pmc *pmc, int offset, u32 value) --{ -- writel(value, pmc->regbase + offset); --} -- - int of_at91_get_clk_range(struct device_node *np, const char *propname, - struct clk_range *range); - --void of_at91sam9260_clk_slow_setup(struct device_node *np, -- struct at91_pmc *pmc); -- --void of_at91rm9200_clk_main_osc_setup(struct device_node *np, -- struct at91_pmc *pmc); --void of_at91sam9x5_clk_main_rc_osc_setup(struct device_node *np, -- struct at91_pmc *pmc); --void of_at91rm9200_clk_main_setup(struct device_node *np, -- struct at91_pmc *pmc); --void of_at91sam9x5_clk_main_setup(struct device_node *np, -- struct at91_pmc *pmc); -- --void of_at91rm9200_clk_pll_setup(struct device_node *np, -- struct at91_pmc *pmc); --void of_at91sam9g45_clk_pll_setup(struct device_node *np, -- struct at91_pmc *pmc); --void of_at91sam9g20_clk_pllb_setup(struct device_node *np, -- struct at91_pmc *pmc); --void of_sama5d3_clk_pll_setup(struct device_node *np, -- struct at91_pmc *pmc); --void of_at91sam9x5_clk_plldiv_setup(struct device_node *np, -- struct at91_pmc *pmc); -- --void of_at91rm9200_clk_master_setup(struct device_node *np, -- struct at91_pmc *pmc); --void of_at91sam9x5_clk_master_setup(struct device_node *np, -- struct at91_pmc *pmc); -- --void of_at91rm9200_clk_sys_setup(struct device_node *np, -- struct at91_pmc *pmc); -- --void of_at91rm9200_clk_periph_setup(struct device_node *np, -- struct at91_pmc *pmc); --void of_at91sam9x5_clk_periph_setup(struct device_node *np, -- struct at91_pmc *pmc); -- --void of_at91rm9200_clk_prog_setup(struct device_node *np, -- struct at91_pmc *pmc); --void of_at91sam9g45_clk_prog_setup(struct device_node *np, -- struct at91_pmc *pmc); --void of_at91sam9x5_clk_prog_setup(struct device_node *np, -- struct at91_pmc *pmc); -- --void of_at91sam9x5_clk_utmi_setup(struct device_node *np, -- struct at91_pmc *pmc); -- --void of_at91rm9200_clk_usb_setup(struct device_node *np, -- struct at91_pmc *pmc); --void of_at91sam9x5_clk_usb_setup(struct device_node *np, -- struct at91_pmc *pmc); --void of_at91sam9n12_clk_usb_setup(struct device_node *np, -- struct at91_pmc *pmc); -- --void of_at91sam9x5_clk_smd_setup(struct device_node *np, -- struct at91_pmc *pmc); -- --void of_sama5d4_clk_h32mx_setup(struct device_node *np, -- struct at91_pmc *pmc); -- --void of_sama5d2_clk_generated_setup(struct device_node *np, -- struct at91_pmc *pmc); -- - #endif /* __PMC_H_ */ -diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c -index 7524941..5b6f57f 100644 ---- a/drivers/clocksource/tcb_clksrc.c -+++ b/drivers/clocksource/tcb_clksrc.c -@@ -73,6 +73,7 @@ static struct clocksource clksrc = { - struct tc_clkevt_device { - struct clock_event_device clkevt; - struct clk *clk; -+ bool clk_enabled; - u32 freq; - void __iomem *regs; - }; -@@ -84,6 +85,24 @@ static struct tc_clkevt_device *to_tc_clkevt(struct clock_event_device *clkevt) - - static u32 timer_clock; - -+static void tc_clk_disable(struct clock_event_device *d) -+{ -+ struct tc_clkevt_device *tcd = to_tc_clkevt(d); -+ -+ clk_disable(tcd->clk); -+ tcd->clk_enabled = false; -+} -+ -+static void tc_clk_enable(struct clock_event_device *d) -+{ -+ struct tc_clkevt_device *tcd = to_tc_clkevt(d); -+ -+ if (tcd->clk_enabled) -+ return; -+ clk_enable(tcd->clk); -+ tcd->clk_enabled = true; -+} -+ - static int tc_shutdown(struct clock_event_device *d) - { - struct tc_clkevt_device *tcd = to_tc_clkevt(d); -@@ -91,8 +110,14 @@ static int tc_shutdown(struct clock_event_device *d) - - __raw_writel(0xff, regs + ATMEL_TC_REG(2, IDR)); - __raw_writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR)); -+ return 0; -+} -+ -+static int tc_shutdown_clk_off(struct clock_event_device *d) -+{ -+ tc_shutdown(d); - if (!clockevent_state_detached(d)) -- clk_disable(tcd->clk); -+ tc_clk_disable(d); - - return 0; - } -@@ -105,7 +130,7 @@ static int tc_set_oneshot(struct clock_event_device *d) - if (clockevent_state_oneshot(d) || clockevent_state_periodic(d)) - tc_shutdown(d); - -- clk_enable(tcd->clk); -+ tc_clk_enable(d); - - /* count up to RC, then irq and stop */ - __raw_writel(timer_clock | ATMEL_TC_CPCSTOP | ATMEL_TC_WAVE | -@@ -127,7 +152,7 @@ static int tc_set_periodic(struct clock_event_device *d) - /* By not making the gentime core emulate periodic mode on top - * of oneshot, we get lower overhead and improved accuracy. - */ -- clk_enable(tcd->clk); -+ tc_clk_enable(d); - - /* count up to RC, then irq and restart */ - __raw_writel(timer_clock | ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO, -@@ -165,7 +190,7 @@ static struct tc_clkevt_device clkevt = { - .rating = 200, - #endif - .set_next_event = tc_next_event, -- .set_state_shutdown = tc_shutdown, -+ .set_state_shutdown = tc_shutdown_clk_off, - .set_state_periodic = tc_set_periodic, - .set_state_oneshot = tc_set_oneshot, - }, -diff --git a/drivers/clocksource/timer-atmel-pit.c b/drivers/clocksource/timer-atmel-pit.c -index a7abdb6..7a40f7e 100644 ---- a/drivers/clocksource/timer-atmel-pit.c -+++ b/drivers/clocksource/timer-atmel-pit.c -@@ -46,6 +46,7 @@ struct pit_data { - u32 cycle; - u32 cnt; - unsigned int irq; -+ bool irq_requested; - struct clk *mck; - }; - -@@ -96,7 +97,10 @@ static int pit_clkevt_shutdown(struct clock_event_device *dev) - - /* disable irq, leaving the clocksource active */ - pit_write(data->base, AT91_PIT_MR, (data->cycle - 1) | AT91_PIT_PITEN); -- free_irq(data->irq, data); -+ if (data->irq_requested) { -+ free_irq(data->irq, data); -+ data->irq_requested = false; -+ } - return 0; - } - -@@ -115,6 +119,8 @@ static int pit_clkevt_set_periodic(struct clock_event_device *dev) - if (ret) - panic(pr_fmt("Unable to setup IRQ\n")); - -+ data->irq_requested = true; -+ - /* update clocksource counter */ - data->cnt += data->cycle * PIT_PICNT(pit_read(data->base, AT91_PIT_PIVR)); - pit_write(data->base, AT91_PIT_MR, -diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c -index 0f42a27..80a1db0 100644 ---- a/drivers/gpu/drm/i915/i915_irq.c -+++ b/drivers/gpu/drm/i915/i915_irq.c -@@ -812,6 +812,7 @@ static int i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, - spin_lock_irqsave(&dev_priv->uncore.lock, irqflags); - - /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ -+ preempt_disable_rt(); - - /* Get optional system timestamp before query. */ - if (stime) -@@ -863,6 +864,7 @@ static int i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, - *etime = ktime_get(); - - /* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */ -+ preempt_enable_rt(); - - spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags); - -diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c -index 56dc132..8771d66 100644 ---- a/drivers/gpu/drm/i915/intel_sprite.c -+++ b/drivers/gpu/drm/i915/intel_sprite.c -@@ -38,6 +38,7 @@ - #include "intel_drv.h" - #include - #include "i915_drv.h" -+#include - - static bool - format_is_yuv(uint32_t format) -@@ -64,6 +65,8 @@ static int usecs_to_scanlines(const struct drm_display_mode *adjusted_mode, - 1000 * adjusted_mode->crtc_htotal); - } - -+static DEFINE_LOCAL_IRQ_LOCK(pipe_update_lock); -+ - /** - * intel_pipe_update_start() - start update of a set of display registers - * @crtc: the crtc of which the registers are going to be updated -@@ -96,7 +99,7 @@ void intel_pipe_update_start(struct intel_crtc *crtc) - min = vblank_start - usecs_to_scanlines(adjusted_mode, 100); - max = vblank_start - 1; - -- local_irq_disable(); -+ local_lock_irq(pipe_update_lock); - - if (min <= 0 || max <= 0) - return; -@@ -126,11 +129,11 @@ void intel_pipe_update_start(struct intel_crtc *crtc) - break; - } - -- local_irq_enable(); -+ local_unlock_irq(pipe_update_lock); - - timeout = schedule_timeout(timeout); - -- local_irq_disable(); -+ local_lock_irq(pipe_update_lock); - } - - finish_wait(wq, &wait); -@@ -164,7 +167,7 @@ void intel_pipe_update_end(struct intel_crtc *crtc) - - trace_i915_pipe_update_end(crtc, end_vbl_count, scanline_end); - -- local_irq_enable(); -+ local_unlock_irq(pipe_update_lock); - - if (crtc->debug.start_vbl_count && - crtc->debug.start_vbl_count != end_vbl_count) { -diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c -index 3645b22..642854b 100644 ---- a/drivers/gpu/drm/radeon/radeon_display.c -+++ b/drivers/gpu/drm/radeon/radeon_display.c -@@ -1862,6 +1862,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, - struct radeon_device *rdev = dev->dev_private; - - /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ -+ preempt_disable_rt(); - - /* Get optional system timestamp before query. */ - if (stime) -@@ -1954,6 +1955,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, - *etime = ktime_get(); - - /* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */ -+ preempt_enable_rt(); - - /* Decode into vertical and horizontal scanout position. */ - *vpos = position & 0x1fff; -diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c -index fc836f5..f417aafe 100644 ---- a/drivers/iommu/amd_iommu.c -+++ b/drivers/iommu/amd_iommu.c -@@ -1952,10 +1952,10 @@ static int __attach_device(struct iommu_dev_data *dev_data, - int ret; - - /* -- * Must be called with IRQs disabled. Warn here to detect early -- * when its not. -+ * Must be called with IRQs disabled on a non RT kernel. Warn here to -+ * detect early when its not. - */ -- WARN_ON(!irqs_disabled()); -+ WARN_ON_NONRT(!irqs_disabled()); - - /* lock domain */ - spin_lock(&domain->lock); -@@ -2118,10 +2118,10 @@ static void __detach_device(struct iommu_dev_data *dev_data) - struct protection_domain *domain; - - /* -- * Must be called with IRQs disabled. Warn here to detect early -- * when its not. -+ * Must be called with IRQs disabled on a non RT kernel. Warn here to -+ * detect early when its not. - */ -- WARN_ON(!irqs_disabled()); -+ WARN_ON_NONRT(!irqs_disabled()); - - if (WARN_ON(!dev_data->domain)) - return; -diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c -index edb5305..7d5ee8a 100644 ---- a/drivers/tty/serial/sc16is7xx.c -+++ b/drivers/tty/serial/sc16is7xx.c -@@ -1230,7 +1230,7 @@ static int sc16is7xx_probe(struct device *dev, - - /* Setup interrupt */ - ret = devm_request_irq(dev, irq, sc16is7xx_irq, -- IRQF_ONESHOT | flags, dev_name(dev), s); -+ flags, dev_name(dev), s); - if (!ret) - return 0; - -diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c -index 3ba63db..4d47528 100644 ---- a/drivers/usb/gadget/function/f_fs.c -+++ b/drivers/usb/gadget/function/f_fs.c -@@ -1405,7 +1405,7 @@ static void ffs_data_put(struct ffs_data *ffs) - pr_info("%s(): freeing\n", __func__); - ffs_data_clear(ffs); - BUG_ON(waitqueue_active(&ffs->ev.waitq) || -- swaitqueue_active(&ffs->ep0req_completion.wait)); -+ swait_active(&ffs->ep0req_completion.wait)); - kfree(ffs->dev_name); - kfree(ffs); - } -diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c -index f92f5af..f9bba26 100644 ---- a/drivers/usb/gadget/udc/atmel_usba_udc.c -+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c -@@ -17,7 +17,9 @@ - #include - #include - #include -+#include - #include -+#include - #include - #include - #include -@@ -1888,20 +1890,15 @@ static int atmel_usba_stop(struct usb_gadget *gadget) - #ifdef CONFIG_OF - static void at91sam9rl_toggle_bias(struct usba_udc *udc, int is_on) - { -- unsigned int uckr = at91_pmc_read(AT91_CKGR_UCKR); -- -- if (is_on) -- at91_pmc_write(AT91_CKGR_UCKR, uckr | AT91_PMC_BIASEN); -- else -- at91_pmc_write(AT91_CKGR_UCKR, uckr & ~(AT91_PMC_BIASEN)); -+ regmap_update_bits(udc->pmc, AT91_CKGR_UCKR, AT91_PMC_BIASEN, -+ is_on ? AT91_PMC_BIASEN : 0); - } - - static void at91sam9g45_pulse_bias(struct usba_udc *udc) - { -- unsigned int uckr = at91_pmc_read(AT91_CKGR_UCKR); -- -- at91_pmc_write(AT91_CKGR_UCKR, uckr & ~(AT91_PMC_BIASEN)); -- at91_pmc_write(AT91_CKGR_UCKR, uckr | AT91_PMC_BIASEN); -+ regmap_update_bits(udc->pmc, AT91_CKGR_UCKR, AT91_PMC_BIASEN, 0); -+ regmap_update_bits(udc->pmc, AT91_CKGR_UCKR, AT91_PMC_BIASEN, -+ AT91_PMC_BIASEN); - } - - static const struct usba_udc_errata at91sam9rl_errata = { -@@ -1938,6 +1935,9 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, - return ERR_PTR(-EINVAL); - - udc->errata = match->data; -+ udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9g45-pmc"); -+ if (udc->errata && IS_ERR(udc->pmc)) -+ return ERR_CAST(udc->pmc); - - udc->num_ep = 0; - -diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.h b/drivers/usb/gadget/udc/atmel_usba_udc.h -index ea448a3..3e1c9d5 100644 ---- a/drivers/usb/gadget/udc/atmel_usba_udc.h -+++ b/drivers/usb/gadget/udc/atmel_usba_udc.h -@@ -354,6 +354,8 @@ struct usba_udc { - struct dentry *debugfs_root; - struct dentry *debugfs_regs; - #endif -+ -+ struct regmap *pmc; - }; - - static inline struct usba_ep *to_usba_ep(struct usb_ep *ep) -diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c -index 9c62a6f..9e08447 100644 ---- a/fs/btrfs/volumes.c -+++ b/fs/btrfs/volumes.c -@@ -232,7 +232,6 @@ static struct btrfs_device *__alloc_device(void) - spin_lock_init(&dev->reada_lock); - atomic_set(&dev->reada_in_flight, 0); - atomic_set(&dev->dev_stats_ccnt, 0); -- btrfs_device_data_ordered_init(dev); - INIT_RADIX_TREE(&dev->reada_zones, GFP_NOFS & ~__GFP_DIRECT_RECLAIM); - INIT_RADIX_TREE(&dev->reada_extents, GFP_NOFS & ~__GFP_DIRECT_RECLAIM); - -diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h -index 9db5500..5951c49 100644 ---- a/fs/f2fs/f2fs.h -+++ b/fs/f2fs/f2fs.h -@@ -24,7 +24,6 @@ - - #ifdef CONFIG_F2FS_CHECK_FS - #define f2fs_bug_on(sbi, condition) BUG_ON(condition) --#define f2fs_down_write(x, y) down_write_nest_lock(x, y) - #else - #define f2fs_bug_on(sbi, condition) \ - do { \ -@@ -33,7 +32,6 @@ - set_sbi_flag(sbi, SBI_NEED_FSCK); \ - } \ - } while (0) --#define f2fs_down_write(x, y) down_write(x) - #endif - - /* -@@ -959,7 +957,7 @@ static inline void f2fs_unlock_op(struct f2fs_sb_info *sbi) - - static inline void f2fs_lock_all(struct f2fs_sb_info *sbi) - { -- f2fs_down_write(&sbi->cp_rwsem, &sbi->cp_mutex); -+ down_write(&sbi->cp_rwsem); - } - - static inline void f2fs_unlock_all(struct f2fs_sb_info *sbi) -diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h -index fff4ec1..a8f18e0 100644 ---- a/include/linux/blkdev.h -+++ b/include/linux/blkdev.h -@@ -456,7 +456,7 @@ struct request_queue { - struct throtl_data *td; - #endif - struct rcu_head rcu_head; -- struct swait_head mq_freeze_wq; -+ struct swait_queue_head mq_freeze_wq; - struct percpu_ref q_usage_counter; - struct list_head all_q_node; - -diff --git a/include/linux/clk/at91_pmc.h b/include/linux/clk/at91_pmc.h -index 1e69322..17f413b 100644 ---- a/include/linux/clk/at91_pmc.h -+++ b/include/linux/clk/at91_pmc.h -@@ -16,18 +16,6 @@ - #ifndef AT91_PMC_H - #define AT91_PMC_H - --#ifndef __ASSEMBLY__ --extern void __iomem *at91_pmc_base; -- --#define at91_pmc_read(field) \ -- readl_relaxed(at91_pmc_base + field) -- --#define at91_pmc_write(field, value) \ -- writel_relaxed(value, at91_pmc_base + field) --#else --.extern at91_pmc_base --#endif -- - #define AT91_PMC_SCER 0x00 /* System Clock Enable Register */ - #define AT91_PMC_SCDR 0x04 /* System Clock Disable Register */ - -diff --git a/include/linux/completion.h b/include/linux/completion.h -index 3fe8d14..3bca159 100644 ---- a/include/linux/completion.h -+++ b/include/linux/completion.h -@@ -7,7 +7,7 @@ - * Atomic wait-for-completion handler data structures. - * See kernel/sched/completion.c for details. - */ --#include -+#include - - /* - * struct completion - structure used to maintain state for a "completion" -@@ -23,11 +23,11 @@ - */ - struct completion { - unsigned int done; -- struct swait_head wait; -+ struct swait_queue_head wait; - }; - - #define COMPLETION_INITIALIZER(work) \ -- { 0, SWAIT_HEAD_INITIALIZER((work).wait) } -+ { 0, __SWAIT_QUEUE_HEAD_INITIALIZER((work).wait) } - - #define COMPLETION_INITIALIZER_ONSTACK(work) \ - ({ init_completion(&work); work; }) -@@ -72,7 +72,7 @@ struct completion { - static inline void init_completion(struct completion *x) - { - x->done = 0; -- init_swait_head(&x->wait); -+ init_swait_queue_head(&x->wait); - } - - /** -diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h -index 60048c5..f2cd676 100644 ---- a/include/linux/ftrace.h -+++ b/include/linux/ftrace.h -@@ -694,6 +694,18 @@ static inline void __ftrace_enabled_restore(int enabled) - #define CALLER_ADDR5 ((unsigned long)ftrace_return_address(5)) - #define CALLER_ADDR6 ((unsigned long)ftrace_return_address(6)) - -+static inline unsigned long get_lock_parent_ip(void) -+{ -+ unsigned long addr = CALLER_ADDR0; -+ -+ if (!in_lock_functions(addr)) -+ return addr; -+ addr = CALLER_ADDR1; -+ if (!in_lock_functions(addr)) -+ return addr; -+ return CALLER_ADDR2; -+} -+ - #ifdef CONFIG_IRQSOFF_TRACER - extern void time_hardirqs_on(unsigned long a0, unsigned long a1); - extern void time_hardirqs_off(unsigned long a0, unsigned long a1); -diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h -index f606864..8fbcdfa 100644 ---- a/include/linux/hrtimer.h -+++ b/include/linux/hrtimer.h -@@ -91,7 +91,7 @@ enum hrtimer_restart { - * @irqsafe: timer can run in hardirq context - * @praecox: timer expiry time if expired at the time of programming - * @is_rel: Set if the timer was armed relative -- * @start_pid: timer statistics field to store the pid of the task which -+ * @start_pid: timer statistics field to store the pid of the task which - * started the timer - * @start_site: timer statistics field to store the site where the timer - * was started -diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h -index d856ccd..c690acc 100644 ---- a/include/linux/kvm_host.h -+++ b/include/linux/kvm_host.h -@@ -25,6 +25,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -243,7 +244,7 @@ struct kvm_vcpu { - int fpu_active; - int guest_fpu_loaded, guest_xcr0_loaded; - unsigned char fpu_counter; -- struct swait_head wq; -+ struct swait_queue_head wq; - struct pid *pid; - int sigset_active; - sigset_t sigset; -@@ -794,7 +795,7 @@ static inline bool kvm_arch_has_assigned_device(struct kvm *kvm) - } - #endif - --static inline struct swait_head *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu) -+static inline struct swait_queue_head *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu) - { - #ifdef __KVM_HAVE_ARCH_WQP - return vcpu->arch.wqp; -diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h -index 44f0b55..89ffaa7 100644 ---- a/include/linux/list_bl.h -+++ b/include/linux/list_bl.h -@@ -42,13 +42,15 @@ struct hlist_bl_node { - struct hlist_bl_node *next, **pprev; - }; - --static inline void INIT_HLIST_BL_HEAD(struct hlist_bl_head *h) --{ -- h->first = NULL; - #ifdef CONFIG_PREEMPT_RT_BASE -- raw_spin_lock_init(&h->lock); -+#define INIT_HLIST_BL_HEAD(h) \ -+do { \ -+ (h)->first = NULL; \ -+ raw_spin_lock_init(&(h)->lock); \ -+} while (0) -+#else -+#define INIT_HLIST_BL_HEAD(h) (h)->first = NULL - #endif --} - - static inline void INIT_HLIST_BL_NODE(struct hlist_bl_node *h) - { -diff --git a/include/linux/locallock.h b/include/linux/locallock.h -index 339ba00..6fe5928 100644 ---- a/include/linux/locallock.h -+++ b/include/linux/locallock.h -@@ -43,9 +43,9 @@ struct local_irq_lock { - * for CONFIG_PREEMPT_BASE map to the normal spin_* calls. - */ - #ifdef CONFIG_PREEMPT_RT_FULL --# define spin_lock_local(lock) rt_spin_lock(lock) --# define spin_trylock_local(lock) rt_spin_trylock(lock) --# define spin_unlock_local(lock) rt_spin_unlock(lock) -+# define spin_lock_local(lock) rt_spin_lock__no_mg(lock) -+# define spin_trylock_local(lock) rt_spin_trylock__no_mg(lock) -+# define spin_unlock_local(lock) rt_spin_unlock__no_mg(lock) - #else - # define spin_lock_local(lock) spin_lock(lock) - # define spin_trylock_local(lock) spin_trylock(lock) -diff --git a/include/linux/sched.h b/include/linux/sched.h -index b6a2358..58c5ec8 100644 ---- a/include/linux/sched.h -+++ b/include/linux/sched.h -@@ -183,8 +183,6 @@ extern void update_cpu_load_nohz(void); - static inline void update_cpu_load_nohz(void) { } - #endif - --extern unsigned long get_parent_ip(unsigned long addr); -- - extern void dump_cpu_task(int cpu); - - struct seq_file; -diff --git a/include/linux/spinlock_rt.h b/include/linux/spinlock_rt.h -index f757096..3b28255 100644 ---- a/include/linux/spinlock_rt.h -+++ b/include/linux/spinlock_rt.h -@@ -18,6 +18,10 @@ do { \ - __rt_spin_lock_init(slock, #slock, &__key); \ - } while (0) - -+void __lockfunc rt_spin_lock__no_mg(spinlock_t *lock); -+void __lockfunc rt_spin_unlock__no_mg(spinlock_t *lock); -+int __lockfunc rt_spin_trylock__no_mg(spinlock_t *lock); -+ - extern void __lockfunc rt_spin_lock(spinlock_t *lock); - extern unsigned long __lockfunc rt_spin_lock_trace_flags(spinlock_t *lock); - extern void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass); -@@ -32,20 +36,16 @@ extern int atomic_dec_and_spin_lock(atomic_t *atomic, spinlock_t *lock); - * lockdep-less calls, for derived types like rwlock: - * (for trylock they can use rt_mutex_trylock() directly. - */ -+extern void __lockfunc __rt_spin_lock__no_mg(struct rt_mutex *lock); - extern void __lockfunc __rt_spin_lock(struct rt_mutex *lock); - extern void __lockfunc __rt_spin_unlock(struct rt_mutex *lock); - extern int __lockfunc __rt_spin_trylock(struct rt_mutex *lock); - --#define spin_lock(lock) \ -- do { \ -- migrate_disable(); \ -- rt_spin_lock(lock); \ -- } while (0) -+#define spin_lock(lock) rt_spin_lock(lock) - - #define spin_lock_bh(lock) \ - do { \ - local_bh_disable(); \ -- migrate_disable(); \ - rt_spin_lock(lock); \ - } while (0) - -@@ -56,24 +56,19 @@ extern int __lockfunc __rt_spin_trylock(struct rt_mutex *lock); - #define spin_trylock(lock) \ - ({ \ - int __locked; \ -- migrate_disable(); \ - __locked = spin_do_trylock(lock); \ -- if (!__locked) \ -- migrate_enable(); \ - __locked; \ - }) - - #ifdef CONFIG_LOCKDEP - # define spin_lock_nested(lock, subclass) \ - do { \ -- migrate_disable(); \ - rt_spin_lock_nested(lock, subclass); \ - } while (0) - - #define spin_lock_bh_nested(lock, subclass) \ - do { \ - local_bh_disable(); \ -- migrate_disable(); \ - rt_spin_lock_nested(lock, subclass); \ - } while (0) - -@@ -81,7 +76,6 @@ extern int __lockfunc __rt_spin_trylock(struct rt_mutex *lock); - do { \ - typecheck(unsigned long, flags); \ - flags = 0; \ -- migrate_disable(); \ - rt_spin_lock_nested(lock, subclass); \ - } while (0) - #else -@@ -117,16 +111,11 @@ static inline unsigned long spin_lock_trace_flags(spinlock_t *lock) - /* FIXME: we need rt_spin_lock_nest_lock */ - #define spin_lock_nest_lock(lock, nest_lock) spin_lock_nested(lock, 0) - --#define spin_unlock(lock) \ -- do { \ -- rt_spin_unlock(lock); \ -- migrate_enable(); \ -- } while (0) -+#define spin_unlock(lock) rt_spin_unlock(lock) - - #define spin_unlock_bh(lock) \ - do { \ - rt_spin_unlock(lock); \ -- migrate_enable(); \ - local_bh_enable(); \ - } while (0) - -diff --git a/include/linux/suspend.h b/include/linux/suspend.h -index 8b6ec7e..9b77d4c 100644 ---- a/include/linux/suspend.h -+++ b/include/linux/suspend.h -@@ -194,6 +194,12 @@ struct platform_freeze_ops { - void (*end)(void); - }; - -+#if defined(CONFIG_SUSPEND) || defined(CONFIG_HIBERNATION) -+extern bool pm_in_action; -+#else -+# define pm_in_action false -+#endif -+ - #ifdef CONFIG_SUSPEND - /** - * suspend_set_ops - set platform dependent suspend operations -diff --git a/include/linux/swait.h b/include/linux/swait.h -new file mode 100644 -index 0000000..83f004a ---- /dev/null -+++ b/include/linux/swait.h -@@ -0,0 +1,173 @@ -+#ifndef _LINUX_SWAIT_H -+#define _LINUX_SWAIT_H -+ -+#include -+#include -+#include -+#include -+ -+/* -+ * Simple wait queues -+ * -+ * While these are very similar to the other/complex wait queues (wait.h) the -+ * most important difference is that the simple waitqueue allows for -+ * deterministic behaviour -- IOW it has strictly bounded IRQ and lock hold -+ * times. -+ * -+ * In order to make this so, we had to drop a fair number of features of the -+ * other waitqueue code; notably: -+ * -+ * - mixing INTERRUPTIBLE and UNINTERRUPTIBLE sleeps on the same waitqueue; -+ * all wakeups are TASK_NORMAL in order to avoid O(n) lookups for the right -+ * sleeper state. -+ * -+ * - the exclusive mode; because this requires preserving the list order -+ * and this is hard. -+ * -+ * - custom wake functions; because you cannot give any guarantees about -+ * random code. -+ * -+ * As a side effect of this; the data structures are slimmer. -+ * -+ * One would recommend using this wait queue where possible. -+ */ -+ -+struct task_struct; -+ -+struct swait_queue_head { -+ raw_spinlock_t lock; -+ struct list_head task_list; -+}; -+ -+struct swait_queue { -+ struct task_struct *task; -+ struct list_head task_list; -+}; -+ -+#define __SWAITQUEUE_INITIALIZER(name) { \ -+ .task = current, \ -+ .task_list = LIST_HEAD_INIT((name).task_list), \ -+} -+ -+#define DECLARE_SWAITQUEUE(name) \ -+ struct swait_queue name = __SWAITQUEUE_INITIALIZER(name) -+ -+#define __SWAIT_QUEUE_HEAD_INITIALIZER(name) { \ -+ .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \ -+ .task_list = LIST_HEAD_INIT((name).task_list), \ -+} -+ -+#define DECLARE_SWAIT_QUEUE_HEAD(name) \ -+ struct swait_queue_head name = __SWAIT_QUEUE_HEAD_INITIALIZER(name) -+ -+extern void __init_swait_queue_head(struct swait_queue_head *q, const char *name, -+ struct lock_class_key *key); -+ -+#define init_swait_queue_head(q) \ -+ do { \ -+ static struct lock_class_key __key; \ -+ __init_swait_queue_head((q), #q, &__key); \ -+ } while (0) -+ -+#ifdef CONFIG_LOCKDEP -+# define __SWAIT_QUEUE_HEAD_INIT_ONSTACK(name) \ -+ ({ init_swait_queue_head(&name); name; }) -+# define DECLARE_SWAIT_QUEUE_HEAD_ONSTACK(name) \ -+ struct swait_queue_head name = __SWAIT_QUEUE_HEAD_INIT_ONSTACK(name) -+#else -+# define DECLARE_SWAIT_QUEUE_HEAD_ONSTACK(name) \ -+ DECLARE_SWAIT_QUEUE_HEAD(name) -+#endif -+ -+static inline int swait_active(struct swait_queue_head *q) -+{ -+ return !list_empty(&q->task_list); -+} -+ -+extern void swake_up(struct swait_queue_head *q); -+extern void swake_up_all(struct swait_queue_head *q); -+extern void swake_up_locked(struct swait_queue_head *q); -+extern void swake_up_all_locked(struct swait_queue_head *q); -+ -+extern void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait); -+extern void prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait, int state); -+extern long prepare_to_swait_event(struct swait_queue_head *q, struct swait_queue *wait, int state); -+ -+extern void __finish_swait(struct swait_queue_head *q, struct swait_queue *wait); -+extern void finish_swait(struct swait_queue_head *q, struct swait_queue *wait); -+ -+/* as per ___wait_event() but for swait, therefore "exclusive == 0" */ -+#define ___swait_event(wq, condition, state, ret, cmd) \ -+({ \ -+ struct swait_queue __wait; \ -+ long __ret = ret; \ -+ \ -+ INIT_LIST_HEAD(&__wait.task_list); \ -+ for (;;) { \ -+ long __int = prepare_to_swait_event(&wq, &__wait, state);\ -+ \ -+ if (condition) \ -+ break; \ -+ \ -+ if (___wait_is_interruptible(state) && __int) { \ -+ __ret = __int; \ -+ break; \ -+ } \ -+ \ -+ cmd; \ -+ } \ -+ finish_swait(&wq, &__wait); \ -+ __ret; \ -+}) -+ -+#define __swait_event(wq, condition) \ -+ (void)___swait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, \ -+ schedule()) -+ -+#define swait_event(wq, condition) \ -+do { \ -+ if (condition) \ -+ break; \ -+ __swait_event(wq, condition); \ -+} while (0) -+ -+#define __swait_event_timeout(wq, condition, timeout) \ -+ ___swait_event(wq, ___wait_cond_timeout(condition), \ -+ TASK_UNINTERRUPTIBLE, timeout, \ -+ __ret = schedule_timeout(__ret)) -+ -+#define swait_event_timeout(wq, condition, timeout) \ -+({ \ -+ long __ret = timeout; \ -+ if (!___wait_cond_timeout(condition)) \ -+ __ret = __swait_event_timeout(wq, condition, timeout); \ -+ __ret; \ -+}) -+ -+#define __swait_event_interruptible(wq, condition) \ -+ ___swait_event(wq, condition, TASK_INTERRUPTIBLE, 0, \ -+ schedule()) -+ -+#define swait_event_interruptible(wq, condition) \ -+({ \ -+ int __ret = 0; \ -+ if (!(condition)) \ -+ __ret = __swait_event_interruptible(wq, condition); \ -+ __ret; \ -+}) -+ -+#define __swait_event_interruptible_timeout(wq, condition, timeout) \ -+ ___swait_event(wq, ___wait_cond_timeout(condition), \ -+ TASK_INTERRUPTIBLE, timeout, \ -+ __ret = schedule_timeout(__ret)) -+ -+#define swait_event_interruptible_timeout(wq, condition, timeout) \ -+({ \ -+ long __ret = timeout; \ -+ if (!___wait_cond_timeout(condition)) \ -+ __ret = __swait_event_interruptible_timeout(wq, \ -+ condition, timeout); \ -+ __ret; \ -+}) -+ -+#endif /* _LINUX_SWAIT_H */ -diff --git a/include/linux/wait-simple.h b/include/linux/wait-simple.h -deleted file mode 100644 -index f86bca2..0000000 ---- a/include/linux/wait-simple.h -+++ /dev/null -@@ -1,207 +0,0 @@ --#ifndef _LINUX_WAIT_SIMPLE_H --#define _LINUX_WAIT_SIMPLE_H -- --#include --#include -- --#include -- --struct swaiter { -- struct task_struct *task; -- struct list_head node; --}; -- --#define DEFINE_SWAITER(name) \ -- struct swaiter name = { \ -- .task = current, \ -- .node = LIST_HEAD_INIT((name).node), \ -- } -- --struct swait_head { -- raw_spinlock_t lock; -- struct list_head list; --}; -- --#define SWAIT_HEAD_INITIALIZER(name) { \ -- .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \ -- .list = LIST_HEAD_INIT((name).list), \ -- } -- --#define DEFINE_SWAIT_HEAD(name) \ -- struct swait_head name = SWAIT_HEAD_INITIALIZER(name) -- --extern void __init_swait_head(struct swait_head *h, struct lock_class_key *key); -- --#define init_swait_head(swh) \ -- do { \ -- static struct lock_class_key __key; \ -- \ -- __init_swait_head((swh), &__key); \ -- } while (0) -- --/* -- * Waiter functions -- */ --extern void swait_prepare_locked(struct swait_head *head, struct swaiter *w); --extern void swait_prepare(struct swait_head *head, struct swaiter *w, int state); --extern void swait_finish_locked(struct swait_head *head, struct swaiter *w); --extern void swait_finish(struct swait_head *head, struct swaiter *w); -- --/* Check whether a head has waiters enqueued */ --static inline bool swaitqueue_active(struct swait_head *h) --{ -- /* Make sure the condition is visible before checking list_empty() */ -- smp_mb(); -- return !list_empty(&h->list); --} -- --/* -- * Wakeup functions -- */ --extern unsigned int __swait_wake(struct swait_head *head, unsigned int state, unsigned int num); --extern unsigned int __swait_wake_locked(struct swait_head *head, unsigned int state, unsigned int num); -- --#define swait_wake(head) __swait_wake(head, TASK_NORMAL, 1) --#define swait_wake_interruptible(head) __swait_wake(head, TASK_INTERRUPTIBLE, 1) --#define swait_wake_all(head) __swait_wake(head, TASK_NORMAL, 0) --#define swait_wake_all_interruptible(head) __swait_wake(head, TASK_INTERRUPTIBLE, 0) -- --/* -- * Event API -- */ --#define __swait_event(wq, condition) \ --do { \ -- DEFINE_SWAITER(__wait); \ -- \ -- for (;;) { \ -- swait_prepare(&wq, &__wait, TASK_UNINTERRUPTIBLE); \ -- if (condition) \ -- break; \ -- schedule(); \ -- } \ -- swait_finish(&wq, &__wait); \ --} while (0) -- --/** -- * swait_event - sleep until a condition gets true -- * @wq: the waitqueue to wait on -- * @condition: a C expression for the event to wait for -- * -- * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the -- * @condition evaluates to true. The @condition is checked each time -- * the waitqueue @wq is woken up. -- * -- * wake_up() has to be called after changing any variable that could -- * change the result of the wait condition. -- */ --#define swait_event(wq, condition) \ --do { \ -- if (condition) \ -- break; \ -- __swait_event(wq, condition); \ --} while (0) -- --#define __swait_event_interruptible(wq, condition, ret) \ --do { \ -- DEFINE_SWAITER(__wait); \ -- \ -- for (;;) { \ -- swait_prepare(&wq, &__wait, TASK_INTERRUPTIBLE); \ -- if (condition) \ -- break; \ -- if (signal_pending(current)) { \ -- ret = -ERESTARTSYS; \ -- break; \ -- } \ -- schedule(); \ -- } \ -- swait_finish(&wq, &__wait); \ --} while (0) -- --#define __swait_event_interruptible_timeout(wq, condition, ret) \ --do { \ -- DEFINE_SWAITER(__wait); \ -- \ -- for (;;) { \ -- swait_prepare(&wq, &__wait, TASK_INTERRUPTIBLE); \ -- if (condition) \ -- break; \ -- if (signal_pending(current)) { \ -- ret = -ERESTARTSYS; \ -- break; \ -- } \ -- ret = schedule_timeout(ret); \ -- if (!ret) \ -- break; \ -- } \ -- swait_finish(&wq, &__wait); \ --} while (0) -- --/** -- * swait_event_interruptible - sleep until a condition gets true -- * @wq: the waitqueue to wait on -- * @condition: a C expression for the event to wait for -- * -- * The process is put to sleep (TASK_INTERRUPTIBLE) until the -- * @condition evaluates to true. The @condition is checked each time -- * the waitqueue @wq is woken up. -- * -- * wake_up() has to be called after changing any variable that could -- * change the result of the wait condition. -- */ --#define swait_event_interruptible(wq, condition) \ --({ \ -- int __ret = 0; \ -- if (!(condition)) \ -- __swait_event_interruptible(wq, condition, __ret); \ -- __ret; \ --}) -- --#define swait_event_interruptible_timeout(wq, condition, timeout) \ --({ \ -- int __ret = timeout; \ -- if (!(condition)) \ -- __swait_event_interruptible_timeout(wq, condition, __ret); \ -- __ret; \ --}) -- --#define __swait_event_timeout(wq, condition, ret) \ --do { \ -- DEFINE_SWAITER(__wait); \ -- \ -- for (;;) { \ -- swait_prepare(&wq, &__wait, TASK_UNINTERRUPTIBLE); \ -- if (condition) \ -- break; \ -- ret = schedule_timeout(ret); \ -- if (!ret) \ -- break; \ -- } \ -- swait_finish(&wq, &__wait); \ --} while (0) -- --/** -- * swait_event_timeout - sleep until a condition gets true or a timeout elapses -- * @wq: the waitqueue to wait on -- * @condition: a C expression for the event to wait for -- * @timeout: timeout, in jiffies -- * -- * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the -- * @condition evaluates to true. The @condition is checked each time -- * the waitqueue @wq is woken up. -- * -- * wake_up() has to be called after changing any variable that could -- * change the result of the wait condition. -- * -- * The function returns 0 if the @timeout elapsed, and the remaining -- * jiffies if the condition evaluated to true before the timeout elapsed. -- */ --#define swait_event_timeout(wq, condition, timeout) \ --({ \ -- long __ret = timeout; \ -- if (!(condition)) \ -- __swait_event_timeout(wq, condition, __ret); \ -- __ret; \ --}) -- --#endif -diff --git a/include/trace/events/hist.h b/include/trace/events/hist.h -index 6122e42..f7710de 100644 ---- a/include/trace/events/hist.h -+++ b/include/trace/events/hist.h -@@ -9,6 +9,7 @@ - - #if !defined(CONFIG_PREEMPT_OFF_HIST) && !defined(CONFIG_INTERRUPT_OFF_HIST) - #define trace_preemptirqsoff_hist(a, b) -+#define trace_preemptirqsoff_hist_rcuidle(a, b) - #else - TRACE_EVENT(preemptirqsoff_hist, - -diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h -index fff846b..73614ce 100644 ---- a/include/trace/events/writeback.h -+++ b/include/trace/events/writeback.h -@@ -134,58 +134,28 @@ DEFINE_EVENT(writeback_dirty_inode_template, writeback_dirty_inode, - #ifdef CREATE_TRACE_POINTS - #ifdef CONFIG_CGROUP_WRITEBACK - --static inline size_t __trace_wb_cgroup_size(struct bdi_writeback *wb) -+static inline unsigned int __trace_wb_assign_cgroup(struct bdi_writeback *wb) - { -- return kernfs_path_len(wb->memcg_css->cgroup->kn) + 1; -+ return wb->memcg_css->cgroup->kn->ino; - } - --static inline void __trace_wb_assign_cgroup(char *buf, struct bdi_writeback *wb) --{ -- struct cgroup *cgrp = wb->memcg_css->cgroup; -- char *path; -- -- path = cgroup_path(cgrp, buf, kernfs_path_len(cgrp->kn) + 1); -- WARN_ON_ONCE(path != buf); --} -- --static inline size_t __trace_wbc_cgroup_size(struct writeback_control *wbc) --{ -- if (wbc->wb) -- return __trace_wb_cgroup_size(wbc->wb); -- else -- return 2; --} -- --static inline void __trace_wbc_assign_cgroup(char *buf, -- struct writeback_control *wbc) -+static inline unsigned int __trace_wbc_assign_cgroup(struct writeback_control *wbc) - { - if (wbc->wb) -- __trace_wb_assign_cgroup(buf, wbc->wb); -+ return __trace_wb_assign_cgroup(wbc->wb); - else -- strcpy(buf, "/"); -+ return -1U; - } -- - #else /* CONFIG_CGROUP_WRITEBACK */ - --static inline size_t __trace_wb_cgroup_size(struct bdi_writeback *wb) --{ -- return 2; --} -- --static inline void __trace_wb_assign_cgroup(char *buf, struct bdi_writeback *wb) --{ -- strcpy(buf, "/"); --} -- --static inline size_t __trace_wbc_cgroup_size(struct writeback_control *wbc) -+static inline unsigned int __trace_wb_assign_cgroup(struct bdi_writeback *wb) - { -- return 2; -+ return -1U; - } - --static inline void __trace_wbc_assign_cgroup(char *buf, -- struct writeback_control *wbc) -+static inline unsigned int __trace_wbc_assign_cgroup(struct writeback_control *wbc) - { -- strcpy(buf, "/"); -+ return -1U; - } - - #endif /* CONFIG_CGROUP_WRITEBACK */ -@@ -201,7 +171,7 @@ DECLARE_EVENT_CLASS(writeback_write_inode_template, - __array(char, name, 32) - __field(unsigned long, ino) - __field(int, sync_mode) -- __dynamic_array(char, cgroup, __trace_wbc_cgroup_size(wbc)) -+ __field(unsigned int, cgroup_ino) - ), - - TP_fast_assign( -@@ -209,14 +179,14 @@ DECLARE_EVENT_CLASS(writeback_write_inode_template, - dev_name(inode_to_bdi(inode)->dev), 32); - __entry->ino = inode->i_ino; - __entry->sync_mode = wbc->sync_mode; -- __trace_wbc_assign_cgroup(__get_str(cgroup), wbc); -+ __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc); - ), - -- TP_printk("bdi %s: ino=%lu sync_mode=%d cgroup=%s", -+ TP_printk("bdi %s: ino=%lu sync_mode=%d cgroup_ino=%u", - __entry->name, - __entry->ino, - __entry->sync_mode, -- __get_str(cgroup) -+ __entry->cgroup_ino - ) - ); - -@@ -246,7 +216,7 @@ DECLARE_EVENT_CLASS(writeback_work_class, - __field(int, range_cyclic) - __field(int, for_background) - __field(int, reason) -- __dynamic_array(char, cgroup, __trace_wb_cgroup_size(wb)) -+ __field(unsigned int, cgroup_ino) - ), - TP_fast_assign( - strncpy(__entry->name, -@@ -258,10 +228,10 @@ DECLARE_EVENT_CLASS(writeback_work_class, - __entry->range_cyclic = work->range_cyclic; - __entry->for_background = work->for_background; - __entry->reason = work->reason; -- __trace_wb_assign_cgroup(__get_str(cgroup), wb); -+ __entry->cgroup_ino = __trace_wb_assign_cgroup(wb); - ), - TP_printk("bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d " -- "kupdate=%d range_cyclic=%d background=%d reason=%s cgroup=%s", -+ "kupdate=%d range_cyclic=%d background=%d reason=%s cgroup_ino=%u", - __entry->name, - MAJOR(__entry->sb_dev), MINOR(__entry->sb_dev), - __entry->nr_pages, -@@ -270,7 +240,7 @@ DECLARE_EVENT_CLASS(writeback_work_class, - __entry->range_cyclic, - __entry->for_background, - __print_symbolic(__entry->reason, WB_WORK_REASON), -- __get_str(cgroup) -+ __entry->cgroup_ino - ) - ); - #define DEFINE_WRITEBACK_WORK_EVENT(name) \ -@@ -300,15 +270,15 @@ DECLARE_EVENT_CLASS(writeback_class, - TP_ARGS(wb), - TP_STRUCT__entry( - __array(char, name, 32) -- __dynamic_array(char, cgroup, __trace_wb_cgroup_size(wb)) -+ __field(unsigned int, cgroup_ino) - ), - TP_fast_assign( - strncpy(__entry->name, dev_name(wb->bdi->dev), 32); -- __trace_wb_assign_cgroup(__get_str(cgroup), wb); -+ __entry->cgroup_ino = __trace_wb_assign_cgroup(wb); - ), -- TP_printk("bdi %s: cgroup=%s", -+ TP_printk("bdi %s: cgroup_ino=%u", - __entry->name, -- __get_str(cgroup) -+ __entry->cgroup_ino - ) - ); - #define DEFINE_WRITEBACK_EVENT(name) \ -@@ -347,7 +317,7 @@ DECLARE_EVENT_CLASS(wbc_class, - __field(int, range_cyclic) - __field(long, range_start) - __field(long, range_end) -- __dynamic_array(char, cgroup, __trace_wbc_cgroup_size(wbc)) -+ __field(unsigned int, cgroup_ino) - ), - - TP_fast_assign( -@@ -361,12 +331,12 @@ DECLARE_EVENT_CLASS(wbc_class, - __entry->range_cyclic = wbc->range_cyclic; - __entry->range_start = (long)wbc->range_start; - __entry->range_end = (long)wbc->range_end; -- __trace_wbc_assign_cgroup(__get_str(cgroup), wbc); -+ __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc); - ), - - TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d " - "bgrd=%d reclm=%d cyclic=%d " -- "start=0x%lx end=0x%lx cgroup=%s", -+ "start=0x%lx end=0x%lx cgroup_ino=%u", - __entry->name, - __entry->nr_to_write, - __entry->pages_skipped, -@@ -377,7 +347,7 @@ DECLARE_EVENT_CLASS(wbc_class, - __entry->range_cyclic, - __entry->range_start, - __entry->range_end, -- __get_str(cgroup) -+ __entry->cgroup_ino - ) - ) - -@@ -398,7 +368,7 @@ TRACE_EVENT(writeback_queue_io, - __field(long, age) - __field(int, moved) - __field(int, reason) -- __dynamic_array(char, cgroup, __trace_wb_cgroup_size(wb)) -+ __field(unsigned int, cgroup_ino) - ), - TP_fast_assign( - unsigned long *older_than_this = work->older_than_this; -@@ -408,15 +378,15 @@ TRACE_EVENT(writeback_queue_io, - (jiffies - *older_than_this) * 1000 / HZ : -1; - __entry->moved = moved; - __entry->reason = work->reason; -- __trace_wb_assign_cgroup(__get_str(cgroup), wb); -+ __entry->cgroup_ino = __trace_wb_assign_cgroup(wb); - ), -- TP_printk("bdi %s: older=%lu age=%ld enqueue=%d reason=%s cgroup=%s", -+ TP_printk("bdi %s: older=%lu age=%ld enqueue=%d reason=%s cgroup_ino=%u", - __entry->name, - __entry->older, /* older_than_this in jiffies */ - __entry->age, /* older_than_this in relative milliseconds */ - __entry->moved, - __print_symbolic(__entry->reason, WB_WORK_REASON), -- __get_str(cgroup) -+ __entry->cgroup_ino - ) - ); - -@@ -484,7 +454,7 @@ TRACE_EVENT(bdi_dirty_ratelimit, - __field(unsigned long, dirty_ratelimit) - __field(unsigned long, task_ratelimit) - __field(unsigned long, balanced_dirty_ratelimit) -- __dynamic_array(char, cgroup, __trace_wb_cgroup_size(wb)) -+ __field(unsigned int, cgroup_ino) - ), - - TP_fast_assign( -@@ -496,13 +466,13 @@ TRACE_EVENT(bdi_dirty_ratelimit, - __entry->task_ratelimit = KBps(task_ratelimit); - __entry->balanced_dirty_ratelimit = - KBps(wb->balanced_dirty_ratelimit); -- __trace_wb_assign_cgroup(__get_str(cgroup), wb); -+ __entry->cgroup_ino = __trace_wb_assign_cgroup(wb); - ), - - TP_printk("bdi %s: " - "write_bw=%lu awrite_bw=%lu dirty_rate=%lu " - "dirty_ratelimit=%lu task_ratelimit=%lu " -- "balanced_dirty_ratelimit=%lu cgroup=%s", -+ "balanced_dirty_ratelimit=%lu cgroup_ino=%u", - __entry->bdi, - __entry->write_bw, /* write bandwidth */ - __entry->avg_write_bw, /* avg write bandwidth */ -@@ -510,7 +480,7 @@ TRACE_EVENT(bdi_dirty_ratelimit, - __entry->dirty_ratelimit, /* base ratelimit */ - __entry->task_ratelimit, /* ratelimit with position control */ - __entry->balanced_dirty_ratelimit, /* the balanced ratelimit */ -- __get_str(cgroup) -+ __entry->cgroup_ino - ) - ); - -@@ -548,7 +518,7 @@ TRACE_EVENT(balance_dirty_pages, - __field( long, pause) - __field(unsigned long, period) - __field( long, think) -- __dynamic_array(char, cgroup, __trace_wb_cgroup_size(wb)) -+ __field(unsigned int, cgroup_ino) - ), - - TP_fast_assign( -@@ -571,7 +541,7 @@ TRACE_EVENT(balance_dirty_pages, - __entry->period = period * 1000 / HZ; - __entry->pause = pause * 1000 / HZ; - __entry->paused = (jiffies - start_time) * 1000 / HZ; -- __trace_wb_assign_cgroup(__get_str(cgroup), wb); -+ __entry->cgroup_ino = __trace_wb_assign_cgroup(wb); - ), - - -@@ -580,7 +550,7 @@ TRACE_EVENT(balance_dirty_pages, - "bdi_setpoint=%lu bdi_dirty=%lu " - "dirty_ratelimit=%lu task_ratelimit=%lu " - "dirtied=%u dirtied_pause=%u " -- "paused=%lu pause=%ld period=%lu think=%ld cgroup=%s", -+ "paused=%lu pause=%ld period=%lu think=%ld cgroup_ino=%u", - __entry->bdi, - __entry->limit, - __entry->setpoint, -@@ -595,7 +565,7 @@ TRACE_EVENT(balance_dirty_pages, - __entry->pause, /* ms */ - __entry->period, /* ms */ - __entry->think, /* ms */ -- __get_str(cgroup) -+ __entry->cgroup_ino - ) - ); - -@@ -609,8 +579,7 @@ TRACE_EVENT(writeback_sb_inodes_requeue, - __field(unsigned long, ino) - __field(unsigned long, state) - __field(unsigned long, dirtied_when) -- __dynamic_array(char, cgroup, -- __trace_wb_cgroup_size(inode_to_wb(inode))) -+ __field(unsigned int, cgroup_ino) - ), - - TP_fast_assign( -@@ -619,16 +588,16 @@ TRACE_EVENT(writeback_sb_inodes_requeue, - __entry->ino = inode->i_ino; - __entry->state = inode->i_state; - __entry->dirtied_when = inode->dirtied_when; -- __trace_wb_assign_cgroup(__get_str(cgroup), inode_to_wb(inode)); -+ __entry->cgroup_ino = __trace_wb_assign_cgroup(inode_to_wb(inode)); - ), - -- TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu cgroup=%s", -+ TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu cgroup_ino=%u", - __entry->name, - __entry->ino, - show_inode_state(__entry->state), - __entry->dirtied_when, - (jiffies - __entry->dirtied_when) / HZ, -- __get_str(cgroup) -+ __entry->cgroup_ino - ) - ); - -@@ -684,7 +653,7 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template, - __field(unsigned long, writeback_index) - __field(long, nr_to_write) - __field(unsigned long, wrote) -- __dynamic_array(char, cgroup, __trace_wbc_cgroup_size(wbc)) -+ __field(unsigned int, cgroup_ino) - ), - - TP_fast_assign( -@@ -696,11 +665,11 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template, - __entry->writeback_index = inode->i_mapping->writeback_index; - __entry->nr_to_write = nr_to_write; - __entry->wrote = nr_to_write - wbc->nr_to_write; -- __trace_wbc_assign_cgroup(__get_str(cgroup), wbc); -+ __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc); - ), - - TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu " -- "index=%lu to_write=%ld wrote=%lu cgroup=%s", -+ "index=%lu to_write=%ld wrote=%lu cgroup_ino=%u", - __entry->name, - __entry->ino, - show_inode_state(__entry->state), -@@ -709,7 +678,7 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template, - __entry->writeback_index, - __entry->nr_to_write, - __entry->wrote, -- __get_str(cgroup) -+ __entry->cgroup_ino - ) - ); - -diff --git a/kernel/cpu.c b/kernel/cpu.c -index 51aafc2..8edd3c7 100644 ---- a/kernel/cpu.c -+++ b/kernel/cpu.c -@@ -127,8 +127,8 @@ struct hotplug_pcp { - }; - - #ifdef CONFIG_PREEMPT_RT_FULL --# define hotplug_lock(hp) rt_spin_lock(&(hp)->lock) --# define hotplug_unlock(hp) rt_spin_unlock(&(hp)->lock) -+# define hotplug_lock(hp) rt_spin_lock__no_mg(&(hp)->lock) -+# define hotplug_unlock(hp) rt_spin_unlock__no_mg(&(hp)->lock) - #else - # define hotplug_lock(hp) mutex_lock(&(hp)->mutex) - # define hotplug_unlock(hp) mutex_unlock(&(hp)->mutex) -diff --git a/kernel/events/core.c b/kernel/events/core.c -index 33c8aa8..760f41d 100644 ---- a/kernel/events/core.c -+++ b/kernel/events/core.c -@@ -802,6 +802,7 @@ static void __perf_mux_hrtimer_init(struct perf_cpu_context *cpuctx, int cpu) - raw_spin_lock_init(&cpuctx->hrtimer_lock); - hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED); - timer->function = perf_mux_hrtimer_handler; -+ timer->irqsafe = 1; - } - - static int perf_mux_hrtimer_restart(struct perf_cpu_context *cpuctx) -diff --git a/kernel/futex.c b/kernel/futex.c -index a34e5ee..02bb869 100644 ---- a/kernel/futex.c -+++ b/kernel/futex.c -@@ -1226,7 +1226,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this, - if (pi_state->owner != current) - return -EINVAL; - -- raw_spin_lock(&pi_state->pi_mutex.wait_lock); -+ raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); - new_owner = rt_mutex_next_owner(&pi_state->pi_mutex); - - /* -@@ -1252,22 +1252,22 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this, - else if (curval != uval) - ret = -EINVAL; - if (ret) { -- raw_spin_unlock(&pi_state->pi_mutex.wait_lock); -+ raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); - return ret; - } - -- raw_spin_lock_irq(&pi_state->owner->pi_lock); -+ raw_spin_lock(&pi_state->owner->pi_lock); - WARN_ON(list_empty(&pi_state->list)); - list_del_init(&pi_state->list); -- raw_spin_unlock_irq(&pi_state->owner->pi_lock); -+ raw_spin_unlock(&pi_state->owner->pi_lock); - -- raw_spin_lock_irq(&new_owner->pi_lock); -+ raw_spin_lock(&new_owner->pi_lock); - WARN_ON(!list_empty(&pi_state->list)); - list_add(&pi_state->list, &new_owner->pi_state_list); - pi_state->owner = new_owner; -- raw_spin_unlock_irq(&new_owner->pi_lock); -+ raw_spin_unlock(&new_owner->pi_lock); - -- raw_spin_unlock(&pi_state->pi_mutex.wait_lock); -+ raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); - - deboost = rt_mutex_futex_unlock(&pi_state->pi_mutex, &wake_q, - &wake_sleeper_q); -@@ -2144,11 +2144,11 @@ static int fixup_owner(u32 __user *uaddr, struct futex_q *q, int locked) - * we returned due to timeout or signal without taking the - * rt_mutex. Too late. - */ -- raw_spin_lock(&q->pi_state->pi_mutex.wait_lock); -+ raw_spin_lock_irq(&q->pi_state->pi_mutex.wait_lock); - owner = rt_mutex_owner(&q->pi_state->pi_mutex); - if (!owner) - owner = rt_mutex_next_owner(&q->pi_state->pi_mutex); -- raw_spin_unlock(&q->pi_state->pi_mutex.wait_lock); -+ raw_spin_unlock_irq(&q->pi_state->pi_mutex.wait_lock); - ret = fixup_pi_state_owner(uaddr, q, owner); - goto out; - } -diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c -index 239e2ae..0b73349 100644 ---- a/kernel/irq/irqdesc.c -+++ b/kernel/irq/irqdesc.c -@@ -24,10 +24,27 @@ - static struct lock_class_key irq_desc_lock_class; - - #if defined(CONFIG_SMP) -+static int __init irq_affinity_setup(char *str) -+{ -+ zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT); -+ cpulist_parse(str, irq_default_affinity); -+ /* -+ * Set at least the boot cpu. We don't want to end up with -+ * bugreports caused by random comandline masks -+ */ -+ cpumask_set_cpu(smp_processor_id(), irq_default_affinity); -+ return 1; -+} -+__setup("irqaffinity=", irq_affinity_setup); -+ - static void __init init_irq_default_affinity(void) - { -- alloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT); -- cpumask_setall(irq_default_affinity); -+#ifdef CONFIG_CPUMASK_OFFSTACK -+ if (!irq_default_affinity) -+ zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT); -+#endif -+ if (cpumask_empty(irq_default_affinity)) -+ cpumask_setall(irq_default_affinity); - } - #else - static void __init init_irq_default_affinity(void) -diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index ba2a42a..8e89554 100644 ---- a/kernel/irq/manage.c -+++ b/kernel/irq/manage.c -@@ -2060,7 +2060,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state); - * This call sets the internal irqchip state of an interrupt, - * depending on the value of @which. - * -- * This function should be called with preemption disabled if the -+ * This function should be called with migration disabled if the - * interrupt controller has per-cpu registers. - */ - int irq_set_irqchip_state(unsigned int irq, enum irqchip_irq_state which, -diff --git a/kernel/locking/lglock.c b/kernel/locking/lglock.c -index d8be4fc..57e0ea7 100644 ---- a/kernel/locking/lglock.c -+++ b/kernel/locking/lglock.c -@@ -10,7 +10,7 @@ - # define lg_do_unlock(l) arch_spin_unlock(l) - #else - # define lg_lock_ptr struct rt_mutex --# define lg_do_lock(l) __rt_spin_lock(l) -+# define lg_do_lock(l) __rt_spin_lock__no_mg(l) - # define lg_do_unlock(l) __rt_spin_unlock(l) - #endif - /* -@@ -86,7 +86,7 @@ void lg_double_lock(struct lglock *lg, int cpu1, int cpu2) - if (cpu2 < cpu1) - swap(cpu1, cpu2); - -- preempt_disable(); -+ preempt_disable_nort(); - lock_acquire_shared(&lg->lock_dep_map, 0, 0, NULL, _RET_IP_); - lg_do_lock(per_cpu_ptr(lg->lock, cpu1)); - lg_do_lock(per_cpu_ptr(lg->lock, cpu2)); -@@ -97,7 +97,7 @@ void lg_double_unlock(struct lglock *lg, int cpu1, int cpu2) - lock_release(&lg->lock_dep_map, 1, _RET_IP_); - lg_do_unlock(per_cpu_ptr(lg->lock, cpu1)); - lg_do_unlock(per_cpu_ptr(lg->lock, cpu2)); -- preempt_enable(); -+ preempt_enable_nort(); - } - - void lg_global_lock(struct lglock *lg) -diff --git a/kernel/locking/rt.c b/kernel/locking/rt.c -index 1bbbcad5..d4ab61c 100644 ---- a/kernel/locking/rt.c -+++ b/kernel/locking/rt.c -@@ -235,7 +235,6 @@ EXPORT_SYMBOL(rt_read_trylock); - void __lockfunc rt_write_lock(rwlock_t *rwlock) - { - rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_); -- migrate_disable(); - __rt_spin_lock(&rwlock->lock); - } - EXPORT_SYMBOL(rt_write_lock); -@@ -249,7 +248,6 @@ void __lockfunc rt_read_lock(rwlock_t *rwlock) - * recursive read locks succeed when current owns the lock - */ - if (rt_mutex_owner(lock) != current) { -- migrate_disable(); - rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_); - __rt_spin_lock(lock); - } -diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c -index e1ddae3..6697100 100644 ---- a/kernel/locking/rtmutex.c -+++ b/kernel/locking/rtmutex.c -@@ -111,13 +111,14 @@ static inline void mark_rt_mutex_waiters(struct rt_mutex *lock) - * 2) Drop lock->wait_lock - * 3) Try to unlock the lock with cmpxchg - */ --static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock) -+static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock, -+ unsigned long flags) - __releases(lock->wait_lock) - { - struct task_struct *owner = rt_mutex_owner(lock); - - clear_rt_mutex_waiters(lock); -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); - /* - * If a new waiter comes in between the unlock and the cmpxchg - * we have two situations: -@@ -159,11 +160,12 @@ static inline void mark_rt_mutex_waiters(struct rt_mutex *lock) - /* - * Simple slow path only version: lock->owner is protected by lock->wait_lock. - */ --static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock) -+static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock, -+ unsigned long flags) - __releases(lock->wait_lock) - { - lock->owner = NULL; -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); - return true; - } - #endif -@@ -454,7 +456,6 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, - int ret = 0, depth = 0; - struct rt_mutex *lock; - bool detect_deadlock; -- unsigned long flags; - bool requeue = true; - - detect_deadlock = rt_mutex_cond_detect_deadlock(orig_waiter, chwalk); -@@ -497,7 +498,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, - /* - * [1] Task cannot go away as we did a get_task() before ! - */ -- raw_spin_lock_irqsave(&task->pi_lock, flags); -+ raw_spin_lock_irq(&task->pi_lock); - - /* - * [2] Get the waiter on which @task is blocked on. -@@ -581,7 +582,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, - * operations. - */ - if (!raw_spin_trylock(&lock->wait_lock)) { -- raw_spin_unlock_irqrestore(&task->pi_lock, flags); -+ raw_spin_unlock_irq(&task->pi_lock); - cpu_relax(); - goto retry; - } -@@ -612,7 +613,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, - /* - * No requeue[7] here. Just release @task [8] - */ -- raw_spin_unlock_irqrestore(&task->pi_lock, flags); -+ raw_spin_unlock(&task->pi_lock); - put_task_struct(task); - - /* -@@ -620,14 +621,14 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, - * If there is no owner of the lock, end of chain. - */ - if (!rt_mutex_owner(lock)) { -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irq(&lock->wait_lock); - return 0; - } - - /* [10] Grab the next task, i.e. owner of @lock */ - task = rt_mutex_owner(lock); - get_task_struct(task); -- raw_spin_lock_irqsave(&task->pi_lock, flags); -+ raw_spin_lock(&task->pi_lock); - - /* - * No requeue [11] here. We just do deadlock detection. -@@ -642,8 +643,8 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, - top_waiter = rt_mutex_top_waiter(lock); - - /* [13] Drop locks */ -- raw_spin_unlock_irqrestore(&task->pi_lock, flags); -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock(&task->pi_lock); -+ raw_spin_unlock_irq(&lock->wait_lock); - - /* If owner is not blocked, end of chain. */ - if (!next_lock) -@@ -664,7 +665,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, - rt_mutex_enqueue(lock, waiter); - - /* [8] Release the task */ -- raw_spin_unlock_irqrestore(&task->pi_lock, flags); -+ raw_spin_unlock(&task->pi_lock); - put_task_struct(task); - - /* -@@ -685,14 +686,14 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, - lock_top_waiter = rt_mutex_top_waiter(lock); - if (prerequeue_top_waiter != lock_top_waiter) - rt_mutex_wake_waiter(lock_top_waiter); -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irq(&lock->wait_lock); - return 0; - } - - /* [10] Grab the next task, i.e. the owner of @lock */ - task = rt_mutex_owner(lock); - get_task_struct(task); -- raw_spin_lock_irqsave(&task->pi_lock, flags); -+ raw_spin_lock(&task->pi_lock); - - /* [11] requeue the pi waiters if necessary */ - if (waiter == rt_mutex_top_waiter(lock)) { -@@ -746,8 +747,8 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, - top_waiter = rt_mutex_top_waiter(lock); - - /* [13] Drop the locks */ -- raw_spin_unlock_irqrestore(&task->pi_lock, flags); -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock(&task->pi_lock); -+ raw_spin_unlock_irq(&lock->wait_lock); - - /* - * Make the actual exit decisions [12], based on the stored -@@ -770,7 +771,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, - goto again; - - out_unlock_pi: -- raw_spin_unlock_irqrestore(&task->pi_lock, flags); -+ raw_spin_unlock_irq(&task->pi_lock); - out_put_task: - put_task_struct(task); - -@@ -799,7 +800,7 @@ static inline int lock_is_stealable(struct task_struct *task, - /* - * Try to take an rt-mutex - * -- * Must be called with lock->wait_lock held. -+ * Must be called with lock->wait_lock held and interrupts disabled - * - * @lock: The lock to be acquired. - * @task: The task which wants to acquire the lock -@@ -810,8 +811,6 @@ static int __try_to_take_rt_mutex(struct rt_mutex *lock, - struct task_struct *task, - struct rt_mutex_waiter *waiter, int mode) - { -- unsigned long flags; -- - /* - * Before testing whether we can acquire @lock, we set the - * RT_MUTEX_HAS_WAITERS bit in @lock->owner. This forces all -@@ -894,7 +893,7 @@ static int __try_to_take_rt_mutex(struct rt_mutex *lock, - * case, but conditionals are more expensive than a redundant - * store. - */ -- raw_spin_lock_irqsave(&task->pi_lock, flags); -+ raw_spin_lock(&task->pi_lock); - task->pi_blocked_on = NULL; - /* - * Finish the lock acquisition. @task is the new owner. If -@@ -903,7 +902,7 @@ static int __try_to_take_rt_mutex(struct rt_mutex *lock, - */ - if (rt_mutex_has_waiters(lock)) - rt_mutex_enqueue_pi(task, rt_mutex_top_waiter(lock)); -- raw_spin_unlock_irqrestore(&task->pi_lock, flags); -+ raw_spin_unlock(&task->pi_lock); - - takeit: - /* We got the lock. */ -@@ -925,14 +924,19 @@ static int __try_to_take_rt_mutex(struct rt_mutex *lock, - * preemptible spin_lock functions: - */ - static inline void rt_spin_lock_fastlock(struct rt_mutex *lock, -- void (*slowfn)(struct rt_mutex *lock)) -+ void (*slowfn)(struct rt_mutex *lock, -+ bool mg_off), -+ bool do_mig_dis) - { - might_sleep_no_state_check(); - -+ if (do_mig_dis) -+ migrate_disable(); -+ - if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) - rt_mutex_deadlock_account_lock(lock, current); - else -- slowfn(lock); -+ slowfn(lock, do_mig_dis); - } - - static inline void rt_spin_lock_fastunlock(struct rt_mutex *lock, -@@ -979,9 +983,6 @@ static int adaptive_wait(struct rt_mutex *lock, - } - #endif - --# define pi_lock(lock) raw_spin_lock_irq(lock) --# define pi_unlock(lock) raw_spin_unlock_irq(lock) -- - static int task_blocks_on_rt_mutex(struct rt_mutex *lock, - struct rt_mutex_waiter *waiter, - struct task_struct *task, -@@ -993,18 +994,20 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, - * We store the current state under p->pi_lock in p->saved_state and - * the try_to_wake_up() code handles this accordingly. - */ --static void noinline __sched rt_spin_lock_slowlock(struct rt_mutex *lock) -+static void noinline __sched rt_spin_lock_slowlock(struct rt_mutex *lock, -+ bool mg_off) - { - struct task_struct *lock_owner, *self = current; - struct rt_mutex_waiter waiter, *top_waiter; -+ unsigned long flags; - int ret; - - rt_mutex_init_waiter(&waiter, true); - -- raw_spin_lock(&lock->wait_lock); -+ raw_spin_lock_irqsave(&lock->wait_lock, flags); - - if (__try_to_take_rt_mutex(lock, self, NULL, STEAL_LATERAL)) { -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); - return; - } - -@@ -1016,10 +1019,10 @@ static void noinline __sched rt_spin_lock_slowlock(struct rt_mutex *lock) - * as well. We are serialized via pi_lock against wakeups. See - * try_to_wake_up(). - */ -- pi_lock(&self->pi_lock); -+ raw_spin_lock(&self->pi_lock); - self->saved_state = self->state; - __set_current_state_no_track(TASK_UNINTERRUPTIBLE); -- pi_unlock(&self->pi_lock); -+ raw_spin_unlock(&self->pi_lock); - - ret = task_blocks_on_rt_mutex(lock, &waiter, self, RT_MUTEX_MIN_CHAINWALK); - BUG_ON(ret); -@@ -1032,18 +1035,23 @@ static void noinline __sched rt_spin_lock_slowlock(struct rt_mutex *lock) - top_waiter = rt_mutex_top_waiter(lock); - lock_owner = rt_mutex_owner(lock); - -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); - - debug_rt_mutex_print_deadlock(&waiter); - -- if (top_waiter != &waiter || adaptive_wait(lock, lock_owner)) -+ if (top_waiter != &waiter || adaptive_wait(lock, lock_owner)) { -+ if (mg_off) -+ migrate_enable(); - schedule(); -+ if (mg_off) -+ migrate_disable(); -+ } - -- raw_spin_lock(&lock->wait_lock); -+ raw_spin_lock_irqsave(&lock->wait_lock, flags); - -- pi_lock(&self->pi_lock); -+ raw_spin_lock(&self->pi_lock); - __set_current_state_no_track(TASK_UNINTERRUPTIBLE); -- pi_unlock(&self->pi_lock); -+ raw_spin_unlock(&self->pi_lock); - } - - /* -@@ -1053,10 +1061,10 @@ static void noinline __sched rt_spin_lock_slowlock(struct rt_mutex *lock) - * happened while we were blocked. Clear saved_state so - * try_to_wakeup() does not get confused. - */ -- pi_lock(&self->pi_lock); -+ raw_spin_lock(&self->pi_lock); - __set_current_state_no_track(self->saved_state); - self->saved_state = TASK_RUNNING; -- pi_unlock(&self->pi_lock); -+ raw_spin_unlock(&self->pi_lock); - - /* - * try_to_take_rt_mutex() sets the waiter bit -@@ -1067,7 +1075,7 @@ static void noinline __sched rt_spin_lock_slowlock(struct rt_mutex *lock) - BUG_ON(rt_mutex_has_waiters(lock) && &waiter == rt_mutex_top_waiter(lock)); - BUG_ON(!RB_EMPTY_NODE(&waiter.tree_entry)); - -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); - - debug_rt_mutex_free_waiter(&waiter); - } -@@ -1080,10 +1088,11 @@ static void mark_wakeup_next_waiter(struct wake_q_head *wake_q, - */ - static void noinline __sched rt_spin_lock_slowunlock(struct rt_mutex *lock) - { -+ unsigned long flags; - WAKE_Q(wake_q); - WAKE_Q(wake_sleeper_q); - -- raw_spin_lock(&lock->wait_lock); -+ raw_spin_lock_irqsave(&lock->wait_lock, flags); - - debug_rt_mutex_unlock(lock); - -@@ -1091,13 +1100,13 @@ static void noinline __sched rt_spin_lock_slowunlock(struct rt_mutex *lock) - - if (!rt_mutex_has_waiters(lock)) { - lock->owner = NULL; -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); - return; - } - - mark_wakeup_next_waiter(&wake_q, &wake_sleeper_q, lock); - -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); - wake_up_q(&wake_q); - wake_up_q_sleeper(&wake_sleeper_q); - -@@ -1105,33 +1114,55 @@ static void noinline __sched rt_spin_lock_slowunlock(struct rt_mutex *lock) - rt_mutex_adjust_prio(current); - } - -+void __lockfunc rt_spin_lock__no_mg(spinlock_t *lock) -+{ -+ rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock, false); -+ spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); -+} -+EXPORT_SYMBOL(rt_spin_lock__no_mg); -+ - void __lockfunc rt_spin_lock(spinlock_t *lock) - { -- rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); -+ rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock, true); - spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); - } - EXPORT_SYMBOL(rt_spin_lock); - - void __lockfunc __rt_spin_lock(struct rt_mutex *lock) - { -- rt_spin_lock_fastlock(lock, rt_spin_lock_slowlock); -+ rt_spin_lock_fastlock(lock, rt_spin_lock_slowlock, true); - } - EXPORT_SYMBOL(__rt_spin_lock); - -+void __lockfunc __rt_spin_lock__no_mg(struct rt_mutex *lock) -+{ -+ rt_spin_lock_fastlock(lock, rt_spin_lock_slowlock, false); -+} -+EXPORT_SYMBOL(__rt_spin_lock__no_mg); -+ - #ifdef CONFIG_DEBUG_LOCK_ALLOC - void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass) - { -- rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); - spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); -+ rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock, true); - } - EXPORT_SYMBOL(rt_spin_lock_nested); - #endif - -+void __lockfunc rt_spin_unlock__no_mg(spinlock_t *lock) -+{ -+ /* NOTE: we always pass in '1' for nested, for simplicity */ -+ spin_release(&lock->dep_map, 1, _RET_IP_); -+ rt_spin_lock_fastunlock(&lock->lock, rt_spin_lock_slowunlock); -+} -+EXPORT_SYMBOL(rt_spin_unlock__no_mg); -+ - void __lockfunc rt_spin_unlock(spinlock_t *lock) - { - /* NOTE: we always pass in '1' for nested, for simplicity */ - spin_release(&lock->dep_map, 1, _RET_IP_); - rt_spin_lock_fastunlock(&lock->lock, rt_spin_lock_slowunlock); -+ migrate_enable(); - } - EXPORT_SYMBOL(rt_spin_unlock); - -@@ -1158,12 +1189,27 @@ int __lockfunc __rt_spin_trylock(struct rt_mutex *lock) - return rt_mutex_trylock(lock); - } - -+int __lockfunc rt_spin_trylock__no_mg(spinlock_t *lock) -+{ -+ int ret; -+ -+ ret = rt_mutex_trylock(&lock->lock); -+ if (ret) -+ spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); -+ return ret; -+} -+EXPORT_SYMBOL(rt_spin_trylock__no_mg); -+ - int __lockfunc rt_spin_trylock(spinlock_t *lock) - { -- int ret = rt_mutex_trylock(&lock->lock); -+ int ret; - -+ migrate_disable(); -+ ret = rt_mutex_trylock(&lock->lock); - if (ret) - spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); -+ else -+ migrate_enable(); - return ret; - } - EXPORT_SYMBOL(rt_spin_trylock); -@@ -1202,12 +1248,10 @@ int atomic_dec_and_spin_lock(atomic_t *atomic, spinlock_t *lock) - /* Subtract 1 from counter unless that drops it to 0 (ie. it was 1) */ - if (atomic_add_unless(atomic, -1, 1)) - return 0; -- migrate_disable(); - rt_spin_lock(lock); - if (atomic_dec_and_test(atomic)) - return 1; - rt_spin_unlock(lock); -- migrate_enable(); - return 0; - } - EXPORT_SYMBOL(atomic_dec_and_spin_lock); -@@ -1273,7 +1317,7 @@ try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, - * - * Prepare waiter and propagate pi chain - * -- * This must be called with lock->wait_lock held. -+ * This must be called with lock->wait_lock held and interrupts disabled - */ - static int task_blocks_on_rt_mutex(struct rt_mutex *lock, - struct rt_mutex_waiter *waiter, -@@ -1284,7 +1328,6 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, - struct rt_mutex_waiter *top_waiter = waiter; - struct rt_mutex *next_lock; - int chain_walk = 0, res; -- unsigned long flags; - - /* - * Early deadlock detection. We really don't want the task to -@@ -1298,7 +1341,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, - if (owner == task) - return -EDEADLK; - -- raw_spin_lock_irqsave(&task->pi_lock, flags); -+ raw_spin_lock(&task->pi_lock); - - /* - * In the case of futex requeue PI, this will be a proxy -@@ -1310,7 +1353,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, - * the task if PI_WAKEUP_INPROGRESS is set. - */ - if (task != current && task->pi_blocked_on == PI_WAKEUP_INPROGRESS) { -- raw_spin_unlock_irqrestore(&task->pi_lock, flags); -+ raw_spin_unlock(&task->pi_lock); - return -EAGAIN; - } - -@@ -1328,12 +1371,12 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, - - task->pi_blocked_on = waiter; - -- raw_spin_unlock_irqrestore(&task->pi_lock, flags); -+ raw_spin_unlock(&task->pi_lock); - - if (!owner) - return 0; - -- raw_spin_lock_irqsave(&owner->pi_lock, flags); -+ raw_spin_lock(&owner->pi_lock); - if (waiter == rt_mutex_top_waiter(lock)) { - rt_mutex_dequeue_pi(owner, top_waiter); - rt_mutex_enqueue_pi(owner, waiter); -@@ -1348,7 +1391,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, - /* Store the lock on which owner is blocked or NULL */ - next_lock = task_blocked_on_lock(owner); - -- raw_spin_unlock_irqrestore(&owner->pi_lock, flags); -+ raw_spin_unlock(&owner->pi_lock); - /* - * Even if full deadlock detection is on, if the owner is not - * blocked itself, we can avoid finding this out in the chain -@@ -1364,12 +1407,12 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, - */ - get_task_struct(owner); - -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irq(&lock->wait_lock); - - res = rt_mutex_adjust_prio_chain(owner, chwalk, lock, - next_lock, waiter, task); - -- raw_spin_lock(&lock->wait_lock); -+ raw_spin_lock_irq(&lock->wait_lock); - - return res; - } -@@ -1378,16 +1421,15 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, - * Remove the top waiter from the current tasks pi waiter tree and - * queue it up. - * -- * Called with lock->wait_lock held. -+ * Called with lock->wait_lock held and interrupts disabled. - */ - static void mark_wakeup_next_waiter(struct wake_q_head *wake_q, - struct wake_q_head *wake_sleeper_q, - struct rt_mutex *lock) - { - struct rt_mutex_waiter *waiter; -- unsigned long flags; - -- raw_spin_lock_irqsave(¤t->pi_lock, flags); -+ raw_spin_lock(¤t->pi_lock); - - waiter = rt_mutex_top_waiter(lock); - -@@ -1409,7 +1451,7 @@ static void mark_wakeup_next_waiter(struct wake_q_head *wake_q, - */ - lock->owner = (void *) RT_MUTEX_HAS_WAITERS; - -- raw_spin_unlock_irqrestore(¤t->pi_lock, flags); -+ raw_spin_unlock(¤t->pi_lock); - - if (waiter->savestate) - wake_q_add(wake_sleeper_q, waiter->task); -@@ -1420,7 +1462,7 @@ static void mark_wakeup_next_waiter(struct wake_q_head *wake_q, - /* - * Remove a waiter from a lock and give up - * -- * Must be called with lock->wait_lock held and -+ * Must be called with lock->wait_lock held and interrupts disabled. I must - * have just failed to try_to_take_rt_mutex(). - */ - static void remove_waiter(struct rt_mutex *lock, -@@ -1429,12 +1471,11 @@ static void remove_waiter(struct rt_mutex *lock, - bool is_top_waiter = (waiter == rt_mutex_top_waiter(lock)); - struct task_struct *owner = rt_mutex_owner(lock); - struct rt_mutex *next_lock = NULL; -- unsigned long flags; - -- raw_spin_lock_irqsave(¤t->pi_lock, flags); -+ raw_spin_lock(¤t->pi_lock); - rt_mutex_dequeue(lock, waiter); - current->pi_blocked_on = NULL; -- raw_spin_unlock_irqrestore(¤t->pi_lock, flags); -+ raw_spin_unlock(¤t->pi_lock); - - /* - * Only update priority if the waiter was the highest priority -@@ -1443,7 +1484,7 @@ static void remove_waiter(struct rt_mutex *lock, - if (!owner || !is_top_waiter) - return; - -- raw_spin_lock_irqsave(&owner->pi_lock, flags); -+ raw_spin_lock(&owner->pi_lock); - - rt_mutex_dequeue_pi(owner, waiter); - -@@ -1456,7 +1497,7 @@ static void remove_waiter(struct rt_mutex *lock, - if (rt_mutex_real_waiter(owner->pi_blocked_on)) - next_lock = task_blocked_on_lock(owner); - -- raw_spin_unlock_irqrestore(&owner->pi_lock, flags); -+ raw_spin_unlock(&owner->pi_lock); - - /* - * Don't walk the chain, if the owner task is not blocked -@@ -1468,12 +1509,12 @@ static void remove_waiter(struct rt_mutex *lock, - /* gets dropped in rt_mutex_adjust_prio_chain()! */ - get_task_struct(owner); - -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irq(&lock->wait_lock); - - rt_mutex_adjust_prio_chain(owner, RT_MUTEX_MIN_CHAINWALK, lock, - next_lock, NULL, current); - -- raw_spin_lock(&lock->wait_lock); -+ raw_spin_lock_irq(&lock->wait_lock); - } - - /* -@@ -1509,11 +1550,11 @@ void rt_mutex_adjust_pi(struct task_struct *task) - * __rt_mutex_slowlock() - Perform the wait-wake-try-to-take loop - * @lock: the rt_mutex to take - * @state: the state the task should block in (TASK_INTERRUPTIBLE -- * or TASK_UNINTERRUPTIBLE) -+ * or TASK_UNINTERRUPTIBLE) - * @timeout: the pre-initialized and started timer, or NULL for none - * @waiter: the pre-initialized rt_mutex_waiter - * -- * lock->wait_lock must be held by the caller. -+ * Must be called with lock->wait_lock held and interrupts disabled - */ - static int __sched - __rt_mutex_slowlock(struct rt_mutex *lock, int state, -@@ -1548,13 +1589,13 @@ __rt_mutex_slowlock(struct rt_mutex *lock, int state, - break; - } - -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irq(&lock->wait_lock); - - debug_rt_mutex_print_deadlock(waiter); - - schedule(); - -- raw_spin_lock(&lock->wait_lock); -+ raw_spin_lock_irq(&lock->wait_lock); - set_current_state(state); - } - -@@ -1668,17 +1709,26 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, - struct ww_acquire_ctx *ww_ctx) - { - struct rt_mutex_waiter waiter; -+ unsigned long flags; - int ret = 0; - - rt_mutex_init_waiter(&waiter, false); - -- raw_spin_lock(&lock->wait_lock); -+ /* -+ * Technically we could use raw_spin_[un]lock_irq() here, but this can -+ * be called in early boot if the cmpxchg() fast path is disabled -+ * (debug, no architecture support). In this case we will acquire the -+ * rtmutex with lock->wait_lock held. But we cannot unconditionally -+ * enable interrupts in that early boot case. So we need to use the -+ * irqsave/restore variants. -+ */ -+ raw_spin_lock_irqsave(&lock->wait_lock, flags); - - /* Try to acquire the lock again: */ - if (try_to_take_rt_mutex(lock, current, NULL)) { - if (ww_ctx) - ww_mutex_account_lock(lock, ww_ctx); -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); - return 0; - } - -@@ -1717,7 +1767,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, - */ - fixup_rt_mutex_waiters(lock); - -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); - - /* Remove pending timer: */ - if (unlikely(timeout)) -@@ -1733,6 +1783,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, - */ - static inline int rt_mutex_slowtrylock(struct rt_mutex *lock) - { -+ unsigned long flags; - int ret; - - /* -@@ -1744,10 +1795,10 @@ static inline int rt_mutex_slowtrylock(struct rt_mutex *lock) - return 0; - - /* -- * The mutex has currently no owner. Lock the wait lock and -- * try to acquire the lock. -+ * The mutex has currently no owner. Lock the wait lock and try to -+ * acquire the lock. We use irqsave here to support early boot calls. - */ -- raw_spin_lock(&lock->wait_lock); -+ raw_spin_lock_irqsave(&lock->wait_lock, flags); - - ret = try_to_take_rt_mutex(lock, current, NULL); - -@@ -1757,7 +1808,7 @@ static inline int rt_mutex_slowtrylock(struct rt_mutex *lock) - */ - fixup_rt_mutex_waiters(lock); - -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); - - return ret; - } -@@ -1770,7 +1821,10 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, - struct wake_q_head *wake_q, - struct wake_q_head *wake_sleeper_q) - { -- raw_spin_lock(&lock->wait_lock); -+ unsigned long flags; -+ -+ /* irqsave required to support early boot calls */ -+ raw_spin_lock_irqsave(&lock->wait_lock, flags); - - debug_rt_mutex_unlock(lock); - -@@ -1809,10 +1863,10 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, - */ - while (!rt_mutex_has_waiters(lock)) { - /* Drops lock->wait_lock ! */ -- if (unlock_rt_mutex_safe(lock) == true) -+ if (unlock_rt_mutex_safe(lock, flags) == true) - return false; - /* Relock the rtmutex and try again */ -- raw_spin_lock(&lock->wait_lock); -+ raw_spin_lock_irqsave(&lock->wait_lock, flags); - } - - /* -@@ -1823,7 +1877,7 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, - */ - mark_wakeup_next_waiter(wake_q, wake_sleeper_q, lock); - -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); - - /* check PI boosting */ - return true; -@@ -2135,10 +2189,10 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock, - { - int ret; - -- raw_spin_lock(&lock->wait_lock); -+ raw_spin_lock_irq(&lock->wait_lock); - - if (try_to_take_rt_mutex(lock, task, NULL)) { -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irq(&lock->wait_lock); - return 1; - } - -@@ -2161,14 +2215,14 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock, - * PI_REQUEUE_INPROGRESS, so that if the task is waking up - * it will know that we are in the process of requeuing it. - */ -- raw_spin_lock_irq(&task->pi_lock); -+ raw_spin_lock(&task->pi_lock); - if (task->pi_blocked_on) { -- raw_spin_unlock_irq(&task->pi_lock); -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock(&task->pi_lock); -+ raw_spin_unlock_irq(&lock->wait_lock); - return -EAGAIN; - } - task->pi_blocked_on = PI_REQUEUE_INPROGRESS; -- raw_spin_unlock_irq(&task->pi_lock); -+ raw_spin_unlock(&task->pi_lock); - #endif - - /* We enforce deadlock detection for futexes */ -@@ -2188,7 +2242,7 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock, - if (ret && rt_mutex_has_waiters(lock)) - remove_waiter(lock, waiter); - -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irq(&lock->wait_lock); - - debug_rt_mutex_print_deadlock(waiter); - -@@ -2236,7 +2290,7 @@ int rt_mutex_finish_proxy_lock(struct rt_mutex *lock, - { - int ret; - -- raw_spin_lock(&lock->wait_lock); -+ raw_spin_lock_irq(&lock->wait_lock); - - set_current_state(TASK_INTERRUPTIBLE); - -@@ -2252,7 +2306,7 @@ int rt_mutex_finish_proxy_lock(struct rt_mutex *lock, - */ - fixup_rt_mutex_waiters(lock); - -- raw_spin_unlock(&lock->wait_lock); -+ raw_spin_unlock_irq(&lock->wait_lock); - - return ret; - } -diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c -index bfd9e09..fbb23f9 100644 ---- a/kernel/power/hibernate.c -+++ b/kernel/power/hibernate.c -@@ -648,6 +648,10 @@ static void power_down(void) - cpu_relax(); - } - -+#ifndef CONFIG_SUSPEND -+bool pm_in_action; -+#endif -+ - /** - * hibernate - Carry out system hibernation, including saving the image. - */ -@@ -660,6 +664,8 @@ int hibernate(void) - return -EPERM; - } - -+ pm_in_action = true; -+ - lock_system_sleep(); - /* The snapshot device should not be opened while we're running */ - if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { -@@ -725,6 +731,7 @@ int hibernate(void) - atomic_inc(&snapshot_device_available); - Unlock: - unlock_system_sleep(); -+ pm_in_action = false; - return error; - } - -diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c -index 80ebc07..393bc34 100644 ---- a/kernel/power/suspend.c -+++ b/kernel/power/suspend.c -@@ -522,6 +522,8 @@ static int enter_state(suspend_state_t state) - return error; - } - -+bool pm_in_action; -+ - /** - * pm_suspend - Externally visible function for suspending the system. - * @state: System sleep state to enter. -@@ -536,6 +538,8 @@ int pm_suspend(suspend_state_t state) - if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX) - return -EINVAL; - -+ pm_in_action = true; -+ - error = enter_state(state); - if (error) { - suspend_stats.fail++; -@@ -543,6 +547,7 @@ int pm_suspend(suspend_state_t state) - } else { - suspend_stats.success++; - } -+ pm_in_action = false; - return error; - } - EXPORT_SYMBOL(pm_suspend); -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 69fbfde..f75e4b0 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -241,6 +241,65 @@ struct printk_log { - */ - static DEFINE_RAW_SPINLOCK(logbuf_lock); - -+#ifdef CONFIG_EARLY_PRINTK -+struct console *early_console; -+ -+static void early_vprintk(const char *fmt, va_list ap) -+{ -+ if (early_console) { -+ char buf[512]; -+ int n = vscnprintf(buf, sizeof(buf), fmt, ap); -+ -+ early_console->write(early_console, buf, n); -+ } -+} -+ -+asmlinkage void early_printk(const char *fmt, ...) -+{ -+ va_list ap; -+ -+ va_start(ap, fmt); -+ early_vprintk(fmt, ap); -+ va_end(ap); -+} -+ -+/* -+ * This is independent of any log levels - a global -+ * kill switch that turns off all of printk. -+ * -+ * Used by the NMI watchdog if early-printk is enabled. -+ */ -+static bool __read_mostly printk_killswitch; -+ -+static int __init force_early_printk_setup(char *str) -+{ -+ printk_killswitch = true; -+ return 0; -+} -+early_param("force_early_printk", force_early_printk_setup); -+ -+void printk_kill(void) -+{ -+ printk_killswitch = true; -+} -+ -+#ifdef CONFIG_PRINTK -+static int forced_early_printk(const char *fmt, va_list ap) -+{ -+ if (!printk_killswitch) -+ return 0; -+ early_vprintk(fmt, ap); -+ return 1; -+} -+#endif -+ -+#else -+static inline int forced_early_printk(const char *fmt, va_list ap) -+{ -+ return 0; -+} -+#endif -+ - #ifdef CONFIG_PRINTK - DECLARE_WAIT_QUEUE_HEAD(log_wait); - /* the next printk record to read by syslog(READ) or /proc/kmsg */ -@@ -1692,62 +1751,6 @@ static size_t cont_print_text(char *text, size_t size) - return textlen; - } - --#ifdef CONFIG_EARLY_PRINTK --struct console *early_console; -- --static void early_vprintk(const char *fmt, va_list ap) --{ -- if (early_console) { -- char buf[512]; -- int n = vscnprintf(buf, sizeof(buf), fmt, ap); -- -- early_console->write(early_console, buf, n); -- } --} -- --asmlinkage void early_printk(const char *fmt, ...) --{ -- va_list ap; -- -- va_start(ap, fmt); -- early_vprintk(fmt, ap); -- va_end(ap); --} -- --/* -- * This is independent of any log levels - a global -- * kill switch that turns off all of printk. -- * -- * Used by the NMI watchdog if early-printk is enabled. -- */ --static bool __read_mostly printk_killswitch; -- --static int __init force_early_printk_setup(char *str) --{ -- printk_killswitch = true; -- return 0; --} --early_param("force_early_printk", force_early_printk_setup); -- --void printk_kill(void) --{ -- printk_killswitch = true; --} -- --static int forced_early_printk(const char *fmt, va_list ap) --{ -- if (!printk_killswitch) -- return 0; -- early_vprintk(fmt, ap); -- return 1; --} --#else --static inline int forced_early_printk(const char *fmt, va_list ap) --{ -- return 0; --} --#endif -- - asmlinkage int vprintk_emit(int facility, int level, - const char *dict, size_t dictlen, - const char *fmt, va_list args) -@@ -2410,7 +2413,6 @@ void console_unlock(void) - start_critical_timings(); - local_irq_restore(flags); - #endif -- - if (do_cond_resched) - cond_resched(); - } -diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c -index d89328e..5bb3364 100644 ---- a/kernel/rcu/rcutorture.c -+++ b/kernel/rcu/rcutorture.c -@@ -390,6 +390,7 @@ static struct rcu_torture_ops rcu_ops = { - .name = "rcu" - }; - -+#ifndef CONFIG_PREEMPT_RT_FULL - /* - * Definitions for rcu_bh torture testing. - */ -@@ -429,6 +430,12 @@ static struct rcu_torture_ops rcu_bh_ops = { - .name = "rcu_bh" - }; - -+#else -+static struct rcu_torture_ops rcu_bh_ops = { -+ .ttype = INVALID_RCU_FLAVOR, -+}; -+#endif -+ - /* - * Don't even think about trying any of these in real life!!! - * The names includes "busted", and they really means it! -diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c -index 5359091..d862a20 100644 ---- a/kernel/rcu/tree.c -+++ b/kernel/rcu/tree.c -@@ -454,11 +454,13 @@ EXPORT_SYMBOL_GPL(rcu_batches_started_sched); - /* - * Return the number of RCU BH batches started thus far for debug & stats. - */ -+#ifndef CONFIG_PREEMPT_RT_FULL - unsigned long rcu_batches_started_bh(void) - { - return rcu_bh_state.gpnum; - } - EXPORT_SYMBOL_GPL(rcu_batches_started_bh); -+#endif - - /* - * Return the number of RCU batches completed thus far for debug & stats. -@@ -563,9 +565,11 @@ void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags, - case RCU_FLAVOR: - rsp = rcu_state_p; - break; -+#ifndef CONFIG_PREEMPT_RT_FULL - case RCU_BH_FLAVOR: - rsp = &rcu_bh_state; - break; -+#endif - case RCU_SCHED_FLAVOR: - rsp = &rcu_sched_state; - break; -@@ -1617,7 +1621,6 @@ static int rcu_future_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp) - int needmore; - struct rcu_data *rdp = this_cpu_ptr(rsp->rda); - -- rcu_nocb_gp_cleanup(rsp, rnp); - rnp->need_future_gp[c & 0x1] = 0; - needmore = rnp->need_future_gp[(c + 1) & 0x1]; - trace_rcu_future_gp(rnp, rdp, c, -@@ -1638,7 +1641,7 @@ static void rcu_gp_kthread_wake(struct rcu_state *rsp) - !READ_ONCE(rsp->gp_flags) || - !rsp->gp_kthread) - return; -- swait_wake(&rsp->gp_wq); -+ swake_up(&rsp->gp_wq); - } - - /* -@@ -2018,6 +2021,7 @@ static void rcu_gp_cleanup(struct rcu_state *rsp) - int nocb = 0; - struct rcu_data *rdp; - struct rcu_node *rnp = rcu_get_root(rsp); -+ struct swait_queue_head *sq; - - WRITE_ONCE(rsp->gp_activity, jiffies); - raw_spin_lock_irq(&rnp->lock); -@@ -2056,7 +2060,9 @@ static void rcu_gp_cleanup(struct rcu_state *rsp) - needgp = __note_gp_changes(rsp, rnp, rdp) || needgp; - /* smp_mb() provided by prior unlock-lock pair. */ - nocb += rcu_future_gp_cleanup(rsp, rnp); -+ sq = rcu_nocb_gp_get(rnp); - raw_spin_unlock_irq(&rnp->lock); -+ rcu_nocb_gp_cleanup(sq); - cond_resched_rcu_qs(); - WRITE_ONCE(rsp->gp_activity, jiffies); - rcu_gp_slow(rsp, gp_cleanup_delay); -@@ -2257,7 +2263,7 @@ static void rcu_report_qs_rsp(struct rcu_state *rsp, unsigned long flags) - WARN_ON_ONCE(!rcu_gp_in_progress(rsp)); - WRITE_ONCE(rsp->gp_flags, READ_ONCE(rsp->gp_flags) | RCU_GP_FLAG_FQS); - raw_spin_unlock_irqrestore(&rcu_get_root(rsp)->lock, flags); -- rcu_gp_kthread_wake(rsp); -+ swake_up(&rsp->gp_wq); /* Memory barrier implied by swake_up() path. */ - } - - /* -@@ -2918,7 +2924,7 @@ static void force_quiescent_state(struct rcu_state *rsp) - } - WRITE_ONCE(rsp->gp_flags, READ_ONCE(rsp->gp_flags) | RCU_GP_FLAG_FQS); - raw_spin_unlock_irqrestore(&rnp_old->lock, flags); -- rcu_gp_kthread_wake(rsp); -+ swake_up(&rsp->gp_wq); /* Memory barrier implied by swake_up() path. */ - } - - /* -@@ -3641,7 +3647,7 @@ static void __rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp, - raw_spin_unlock_irqrestore(&rnp->lock, flags); - if (wake) { - smp_mb(); /* EGP done before wake_up(). */ -- swait_wake(&rsp->expedited_wq); -+ swake_up(&rsp->expedited_wq); - } - break; - } -@@ -3898,7 +3904,7 @@ static void synchronize_sched_expedited_wait(struct rcu_state *rsp) - jiffies_start = jiffies; - - for (;;) { -- ret = swait_event_interruptible_timeout( -+ ret = swait_event_timeout( - rsp->expedited_wq, - sync_rcu_preempt_exp_done(rnp_root), - jiffies_stall); -@@ -4574,8 +4580,8 @@ static void __init rcu_init_one(struct rcu_state *rsp, - } - } - -- init_swait_head(&rsp->gp_wq); -- init_swait_head(&rsp->expedited_wq); -+ init_swait_queue_head(&rsp->gp_wq); -+ init_swait_queue_head(&rsp->expedited_wq); - rnp = rsp->level[rcu_num_lvls - 1]; - for_each_possible_cpu(i) { - while (i > rnp->grphi) -@@ -4695,7 +4701,9 @@ void __init rcu_init(void) - - rcu_bootup_announce(); - rcu_init_geometry(); -+#ifndef CONFIG_PREEMPT_RT_FULL - rcu_init_one(&rcu_bh_state, &rcu_bh_data); -+#endif - rcu_init_one(&rcu_sched_state, &rcu_sched_data); - if (dump_tree) - rcu_dump_rcu_node_tree(&rcu_sched_state); -diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h -index 588509d..c75834d 100644 ---- a/kernel/rcu/tree.h -+++ b/kernel/rcu/tree.h -@@ -27,8 +27,8 @@ - #include - #include - #include -+#include - #include --#include - - /* - * Define shape of hierarchy based on NR_CPUS, CONFIG_RCU_FANOUT, and -@@ -242,7 +242,7 @@ struct rcu_node { - /* Refused to boost: not sure why, though. */ - /* This can happen due to race conditions. */ - #ifdef CONFIG_RCU_NOCB_CPU -- struct swait_head nocb_gp_wq[2]; -+ struct swait_queue_head nocb_gp_wq[2]; - /* Place for rcu_nocb_kthread() to wait GP. */ - #endif /* #ifdef CONFIG_RCU_NOCB_CPU */ - int need_future_gp[2]; -@@ -394,7 +394,7 @@ struct rcu_data { - atomic_long_t nocb_q_count_lazy; /* invocation (all stages). */ - struct rcu_head *nocb_follower_head; /* CBs ready to invoke. */ - struct rcu_head **nocb_follower_tail; -- struct swait_head nocb_wq; /* For nocb kthreads to sleep on. */ -+ struct swait_queue_head nocb_wq; /* For nocb kthreads to sleep on. */ - struct task_struct *nocb_kthread; - int nocb_defer_wakeup; /* Defer wakeup of nocb_kthread. */ - -@@ -473,7 +473,7 @@ struct rcu_state { - unsigned long gpnum; /* Current gp number. */ - unsigned long completed; /* # of last completed gp. */ - struct task_struct *gp_kthread; /* Task for grace periods. */ -- struct swait_head gp_wq; /* Where GP task waits. */ -+ struct swait_queue_head gp_wq; /* Where GP task waits. */ - short gp_flags; /* Commands for GP task. */ - short gp_state; /* GP kthread sleep state. */ - -@@ -505,7 +505,7 @@ struct rcu_state { - atomic_long_t expedited_workdone3; /* # done by others #3. */ - atomic_long_t expedited_normal; /* # fallbacks to normal. */ - atomic_t expedited_need_qs; /* # CPUs left to check in. */ -- struct swait_head expedited_wq; /* Wait for check-ins. */ -+ struct swait_queue_head expedited_wq; /* Wait for check-ins. */ - int ncpus_snap; /* # CPUs seen last time. */ - - unsigned long jiffies_force_qs; /* Time at which to invoke */ -@@ -557,7 +557,9 @@ extern struct list_head rcu_struct_flavors; - */ - extern struct rcu_state rcu_sched_state; - -+#ifndef CONFIG_PREEMPT_RT_FULL - extern struct rcu_state rcu_bh_state; -+#endif - - #ifdef CONFIG_PREEMPT_RCU - extern struct rcu_state rcu_preempt_state; -@@ -605,7 +607,8 @@ static void zero_cpu_stall_ticks(struct rcu_data *rdp); - static void increment_cpu_stall_ticks(void); - static bool rcu_nocb_cpu_needs_barrier(struct rcu_state *rsp, int cpu); - static void rcu_nocb_gp_set(struct rcu_node *rnp, int nrq); --static void rcu_nocb_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp); -+static struct swait_queue_head *rcu_nocb_gp_get(struct rcu_node *rnp); -+static void rcu_nocb_gp_cleanup(struct swait_queue_head *sq); - static void rcu_init_one_nocb(struct rcu_node *rnp); - static bool __call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *rhp, - bool lazy, unsigned long flags); -diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h -index 0d2f27f2..8e119cf 100644 ---- a/kernel/rcu/tree_plugin.h -+++ b/kernel/rcu/tree_plugin.h -@@ -1717,9 +1717,9 @@ early_param("rcu_nocb_poll", parse_rcu_nocb_poll); - * Wake up any no-CBs CPUs' kthreads that were waiting on the just-ended - * grace period. - */ --static void rcu_nocb_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp) -+static void rcu_nocb_gp_cleanup(struct swait_queue_head *sq) - { -- swait_wake_all(&rnp->nocb_gp_wq[rnp->completed & 0x1]); -+ swake_up_all(sq); - } - - /* -@@ -1735,10 +1735,15 @@ static void rcu_nocb_gp_set(struct rcu_node *rnp, int nrq) - rnp->need_future_gp[(rnp->completed + 1) & 0x1] += nrq; - } - -+static struct swait_queue_head *rcu_nocb_gp_get(struct rcu_node *rnp) -+{ -+ return &rnp->nocb_gp_wq[rnp->completed & 0x1]; -+} -+ - static void rcu_init_one_nocb(struct rcu_node *rnp) - { -- init_swait_head(&rnp->nocb_gp_wq[0]); -- init_swait_head(&rnp->nocb_gp_wq[1]); -+ init_swait_queue_head(&rnp->nocb_gp_wq[0]); -+ init_swait_queue_head(&rnp->nocb_gp_wq[1]); - } - - #ifndef CONFIG_RCU_NOCB_CPU_ALL -@@ -1763,7 +1768,7 @@ static void wake_nocb_leader(struct rcu_data *rdp, bool force) - if (READ_ONCE(rdp_leader->nocb_leader_sleep) || force) { - /* Prior smp_mb__after_atomic() orders against prior enqueue. */ - WRITE_ONCE(rdp_leader->nocb_leader_sleep, false); -- swait_wake(&rdp_leader->nocb_wq); -+ swake_up(&rdp_leader->nocb_wq); - } - } - -@@ -2079,7 +2084,7 @@ static void nocb_leader_wait(struct rcu_data *my_rdp) - * List was empty, wake up the follower. - * Memory barriers supplied by atomic_long_add(). - */ -- swait_wake(&rdp->nocb_wq); -+ swake_up(&rdp->nocb_wq); - } - } - -@@ -2259,7 +2264,7 @@ void __init rcu_init_nohz(void) - static void __init rcu_boot_init_nocb_percpu_data(struct rcu_data *rdp) - { - rdp->nocb_tail = &rdp->nocb_head; -- init_swait_head(&rdp->nocb_wq); -+ init_swait_queue_head(&rdp->nocb_wq); - rdp->nocb_follower_tail = &rdp->nocb_follower_head; - } - -@@ -2409,7 +2414,7 @@ static bool rcu_nocb_cpu_needs_barrier(struct rcu_state *rsp, int cpu) - return false; - } - --static void rcu_nocb_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp) -+static void rcu_nocb_gp_cleanup(struct swait_queue_head *sq) - { - } - -@@ -2417,6 +2422,11 @@ static void rcu_nocb_gp_set(struct rcu_node *rnp, int nrq) - { - } - -+static struct swait_queue_head *rcu_nocb_gp_get(struct rcu_node *rnp) -+{ -+ return NULL; -+} -+ - static void rcu_init_one_nocb(struct rcu_node *rnp) - { - } -diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile -index a22fdb6..debedbe 100644 ---- a/kernel/sched/Makefile -+++ b/kernel/sched/Makefile -@@ -13,7 +13,7 @@ endif - - obj-y += core.o loadavg.o clock.o cputime.o - obj-y += idle_task.o fair.o rt.o deadline.o stop_task.o --obj-y += wait.o wait-simple.o work-simple.o completion.o idle.o -+obj-y += wait.o swait.o work-simple.o completion.o idle.o - obj-$(CONFIG_SMP) += cpupri.o cpudeadline.o - obj-$(CONFIG_SCHED_AUTOGROUP) += auto_group.o - obj-$(CONFIG_SCHEDSTATS) += stats.o -diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c -index 45ebcff..b62cf64 100644 ---- a/kernel/sched/completion.c -+++ b/kernel/sched/completion.c -@@ -32,7 +32,7 @@ void complete(struct completion *x) - - raw_spin_lock_irqsave(&x->wait.lock, flags); - x->done++; -- __swait_wake_locked(&x->wait, TASK_NORMAL, 1); -+ swake_up_locked(&x->wait); - raw_spin_unlock_irqrestore(&x->wait.lock, flags); - } - EXPORT_SYMBOL(complete); -@@ -52,7 +52,7 @@ void complete_all(struct completion *x) - - raw_spin_lock_irqsave(&x->wait.lock, flags); - x->done += UINT_MAX/2; -- __swait_wake_locked(&x->wait, TASK_NORMAL, 0); -+ swake_up_all_locked(&x->wait); - raw_spin_unlock_irqrestore(&x->wait.lock, flags); - } - EXPORT_SYMBOL(complete_all); -@@ -62,9 +62,9 @@ do_wait_for_common(struct completion *x, - long (*action)(long), long timeout, int state) - { - if (!x->done) { -- DEFINE_SWAITER(wait); -+ DECLARE_SWAITQUEUE(wait); - -- swait_prepare_locked(&x->wait, &wait); -+ __prepare_to_swait(&x->wait, &wait); - do { - if (signal_pending_state(state, current)) { - timeout = -ERESTARTSYS; -@@ -75,7 +75,7 @@ do_wait_for_common(struct completion *x, - timeout = action(timeout); - raw_spin_lock_irq(&x->wait.lock); - } while (!x->done && timeout); -- swait_finish_locked(&x->wait, &wait); -+ __finish_swait(&x->wait, &wait); - if (!x->done) - return timeout; - } -diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index b2959ea..94827a5 100644 ---- a/kernel/sched/core.c -+++ b/kernel/sched/core.c -@@ -3039,16 +3039,6 @@ u64 scheduler_tick_max_deferment(void) - } - #endif - --notrace unsigned long get_parent_ip(unsigned long addr) --{ -- if (in_lock_functions(addr)) { -- addr = CALLER_ADDR2; -- if (in_lock_functions(addr)) -- addr = CALLER_ADDR3; -- } -- return addr; --} -- - #if defined(CONFIG_PREEMPT) && (defined(CONFIG_DEBUG_PREEMPT) || \ - defined(CONFIG_PREEMPT_TRACER)) - -@@ -3070,7 +3060,7 @@ void preempt_count_add(int val) - PREEMPT_MASK - 10); - #endif - if (preempt_count() == val) { -- unsigned long ip = get_parent_ip(CALLER_ADDR1); -+ unsigned long ip = get_lock_parent_ip(); - #ifdef CONFIG_DEBUG_PREEMPT - current->preempt_disable_ip = ip; - #endif -@@ -3097,7 +3087,7 @@ void preempt_count_sub(int val) - #endif - - if (preempt_count() == val) -- trace_preempt_on(CALLER_ADDR0, get_parent_ip(CALLER_ADDR1)); -+ trace_preempt_on(CALLER_ADDR0, get_lock_parent_ip()); - __preempt_count_sub(val); - } - EXPORT_SYMBOL(preempt_count_sub); -@@ -3157,7 +3147,7 @@ void migrate_disable(void) - { - struct task_struct *p = current; - -- if (in_atomic()) { -+ if (in_atomic() || irqs_disabled()) { - #ifdef CONFIG_SCHED_DEBUG - p->migrate_disable_atomic++; - #endif -@@ -3180,7 +3170,6 @@ void migrate_disable(void) - preempt_lazy_disable(); - pin_current_cpu(); - p->migrate_disable = 1; -- p->nr_cpus_allowed = 1; - preempt_enable(); - } - EXPORT_SYMBOL(migrate_disable); -@@ -3189,7 +3178,7 @@ void migrate_enable(void) - { - struct task_struct *p = current; - -- if (in_atomic()) { -+ if (in_atomic() || irqs_disabled()) { - #ifdef CONFIG_SCHED_DEBUG - p->migrate_disable_atomic--; - #endif -@@ -3470,7 +3459,7 @@ static void __sched notrace preempt_schedule_common(void) - * set by a RT task. Oterwise we try to avoid beeing scheduled out as long as - * preempt_lazy_count counter >0. - */ --static int preemptible_lazy(void) -+static __always_inline int preemptible_lazy(void) - { - if (test_thread_flag(TIF_NEED_RESCHED)) - return 1; -diff --git a/kernel/sched/swait.c b/kernel/sched/swait.c -new file mode 100644 -index 0000000..205fe36 ---- /dev/null -+++ b/kernel/sched/swait.c -@@ -0,0 +1,143 @@ -+#include -+#include -+#include -+ -+void __init_swait_queue_head(struct swait_queue_head *q, const char *name, -+ struct lock_class_key *key) -+{ -+ raw_spin_lock_init(&q->lock); -+ lockdep_set_class_and_name(&q->lock, key, name); -+ INIT_LIST_HEAD(&q->task_list); -+} -+EXPORT_SYMBOL(__init_swait_queue_head); -+ -+/* -+ * The thing about the wake_up_state() return value; I think we can ignore it. -+ * -+ * If for some reason it would return 0, that means the previously waiting -+ * task is already running, so it will observe condition true (or has already). -+ */ -+void swake_up_locked(struct swait_queue_head *q) -+{ -+ struct swait_queue *curr; -+ -+ if (list_empty(&q->task_list)) -+ return; -+ -+ curr = list_first_entry(&q->task_list, typeof(*curr), task_list); -+ wake_up_process(curr->task); -+ list_del_init(&curr->task_list); -+} -+EXPORT_SYMBOL(swake_up_locked); -+ -+void swake_up_all_locked(struct swait_queue_head *q) -+{ -+ struct swait_queue *curr; -+ int wakes = 0; -+ -+ while (!list_empty(&q->task_list)) { -+ -+ curr = list_first_entry(&q->task_list, typeof(*curr), -+ task_list); -+ wake_up_process(curr->task); -+ list_del_init(&curr->task_list); -+ wakes++; -+ } -+ if (pm_in_action) -+ return; -+ WARN(wakes > 2, "complate_all() with %d waiters\n", wakes); -+} -+EXPORT_SYMBOL(swake_up_all_locked); -+ -+void swake_up(struct swait_queue_head *q) -+{ -+ unsigned long flags; -+ -+ if (!swait_active(q)) -+ return; -+ -+ raw_spin_lock_irqsave(&q->lock, flags); -+ swake_up_locked(q); -+ raw_spin_unlock_irqrestore(&q->lock, flags); -+} -+EXPORT_SYMBOL(swake_up); -+ -+/* -+ * Does not allow usage from IRQ disabled, since we must be able to -+ * release IRQs to guarantee bounded hold time. -+ */ -+void swake_up_all(struct swait_queue_head *q) -+{ -+ struct swait_queue *curr; -+ LIST_HEAD(tmp); -+ -+ if (!swait_active(q)) -+ return; -+ -+ raw_spin_lock_irq(&q->lock); -+ list_splice_init(&q->task_list, &tmp); -+ while (!list_empty(&tmp)) { -+ curr = list_first_entry(&tmp, typeof(*curr), task_list); -+ -+ wake_up_state(curr->task, TASK_NORMAL); -+ list_del_init(&curr->task_list); -+ -+ if (list_empty(&tmp)) -+ break; -+ -+ raw_spin_unlock_irq(&q->lock); -+ raw_spin_lock_irq(&q->lock); -+ } -+ raw_spin_unlock_irq(&q->lock); -+} -+EXPORT_SYMBOL(swake_up_all); -+ -+void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait) -+{ -+ wait->task = current; -+ if (list_empty(&wait->task_list)) -+ list_add(&wait->task_list, &q->task_list); -+} -+ -+void prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait, int state) -+{ -+ unsigned long flags; -+ -+ raw_spin_lock_irqsave(&q->lock, flags); -+ __prepare_to_swait(q, wait); -+ set_current_state(state); -+ raw_spin_unlock_irqrestore(&q->lock, flags); -+} -+EXPORT_SYMBOL(prepare_to_swait); -+ -+long prepare_to_swait_event(struct swait_queue_head *q, struct swait_queue *wait, int state) -+{ -+ if (signal_pending_state(state, current)) -+ return -ERESTARTSYS; -+ -+ prepare_to_swait(q, wait, state); -+ -+ return 0; -+} -+EXPORT_SYMBOL(prepare_to_swait_event); -+ -+void __finish_swait(struct swait_queue_head *q, struct swait_queue *wait) -+{ -+ __set_current_state(TASK_RUNNING); -+ if (!list_empty(&wait->task_list)) -+ list_del_init(&wait->task_list); -+} -+ -+void finish_swait(struct swait_queue_head *q, struct swait_queue *wait) -+{ -+ unsigned long flags; -+ -+ __set_current_state(TASK_RUNNING); -+ -+ if (!list_empty_careful(&wait->task_list)) { -+ raw_spin_lock_irqsave(&q->lock, flags); -+ list_del_init(&wait->task_list); -+ raw_spin_unlock_irqrestore(&q->lock, flags); -+ } -+} -+EXPORT_SYMBOL(finish_swait); -diff --git a/kernel/sched/wait-simple.c b/kernel/sched/wait-simple.c -deleted file mode 100644 -index 7dfa86d..0000000 ---- a/kernel/sched/wait-simple.c -+++ /dev/null -@@ -1,115 +0,0 @@ --/* -- * Simple waitqueues without fancy flags and callbacks -- * -- * (C) 2011 Thomas Gleixner -- * -- * Based on kernel/wait.c -- * -- * For licencing details see kernel-base/COPYING -- */ --#include --#include --#include --#include -- --/* Adds w to head->list. Must be called with head->lock locked. */ --static inline void __swait_enqueue(struct swait_head *head, struct swaiter *w) --{ -- list_add(&w->node, &head->list); -- /* We can't let the condition leak before the setting of head */ -- smp_mb(); --} -- --/* Removes w from head->list. Must be called with head->lock locked. */ --static inline void __swait_dequeue(struct swaiter *w) --{ -- list_del_init(&w->node); --} -- --void __init_swait_head(struct swait_head *head, struct lock_class_key *key) --{ -- raw_spin_lock_init(&head->lock); -- lockdep_set_class(&head->lock, key); -- INIT_LIST_HEAD(&head->list); --} --EXPORT_SYMBOL(__init_swait_head); -- --void swait_prepare_locked(struct swait_head *head, struct swaiter *w) --{ -- w->task = current; -- if (list_empty(&w->node)) -- __swait_enqueue(head, w); --} -- --void swait_prepare(struct swait_head *head, struct swaiter *w, int state) --{ -- unsigned long flags; -- -- raw_spin_lock_irqsave(&head->lock, flags); -- swait_prepare_locked(head, w); -- __set_current_state(state); -- raw_spin_unlock_irqrestore(&head->lock, flags); --} --EXPORT_SYMBOL(swait_prepare); -- --void swait_finish_locked(struct swait_head *head, struct swaiter *w) --{ -- __set_current_state(TASK_RUNNING); -- if (w->task) -- __swait_dequeue(w); --} -- --void swait_finish(struct swait_head *head, struct swaiter *w) --{ -- unsigned long flags; -- -- __set_current_state(TASK_RUNNING); -- if (w->task) { -- raw_spin_lock_irqsave(&head->lock, flags); -- __swait_dequeue(w); -- raw_spin_unlock_irqrestore(&head->lock, flags); -- } --} --EXPORT_SYMBOL(swait_finish); -- --unsigned int --__swait_wake_locked(struct swait_head *head, unsigned int state, unsigned int num) --{ -- struct swaiter *curr, *next; -- int woken = 0; -- -- list_for_each_entry_safe(curr, next, &head->list, node) { -- if (wake_up_state(curr->task, state)) { -- __swait_dequeue(curr); -- /* -- * The waiting task can free the waiter as -- * soon as curr->task = NULL is written, -- * without taking any locks. A memory barrier -- * is required here to prevent the following -- * store to curr->task from getting ahead of -- * the dequeue operation. -- */ -- smp_wmb(); -- curr->task = NULL; -- if (++woken == num) -- break; -- } -- } -- return woken; --} -- --unsigned int --__swait_wake(struct swait_head *head, unsigned int state, unsigned int num) --{ -- unsigned long flags; -- int woken; -- -- if (!swaitqueue_active(head)) -- return 0; -- -- raw_spin_lock_irqsave(&head->lock, flags); -- woken = __swait_wake_locked(head, state, num); -- raw_spin_unlock_irqrestore(&head->lock, flags); -- return woken; --} --EXPORT_SYMBOL(__swait_wake); -diff --git a/kernel/sched/work-simple.c b/kernel/sched/work-simple.c -index e57a052..9ffe405 100644 ---- a/kernel/sched/work-simple.c -+++ b/kernel/sched/work-simple.c -@@ -5,7 +5,7 @@ - * PREEMPT_RT_FULL safe. The callbacks are executed in kthread context. - */ - --#include -+#include - #include - #include - #include -@@ -19,7 +19,7 @@ static struct sworker *glob_worker; - - struct sworker { - struct list_head events; -- struct swait_head wq; -+ struct swait_queue_head wq; - - raw_spinlock_t lock; - -@@ -80,7 +80,7 @@ static struct sworker *swork_create(void) - - INIT_LIST_HEAD(&worker->events); - raw_spin_lock_init(&worker->lock); -- init_swait_head(&worker->wq); -+ init_swait_queue_head(&worker->wq); - - worker->task = kthread_run(swork_kthread, worker, "kswork"); - if (IS_ERR(worker->task)) { -@@ -117,7 +117,7 @@ bool swork_queue(struct swork_event *sev) - list_add_tail(&sev->item, &glob_worker->events); - raw_spin_unlock_irqrestore(&glob_worker->lock, flags); - -- swait_wake(&glob_worker->wq); -+ swake_up(&glob_worker->wq); - return true; - } - EXPORT_SYMBOL_GPL(swork_queue); -diff --git a/kernel/softirq.c b/kernel/softirq.c -index d1e999e..cb9c1d5 100644 ---- a/kernel/softirq.c -+++ b/kernel/softirq.c -@@ -287,9 +287,9 @@ void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) - - if (preempt_count() == cnt) { - #ifdef CONFIG_DEBUG_PREEMPT -- current->preempt_disable_ip = get_parent_ip(CALLER_ADDR1); -+ current->preempt_disable_ip = get_lock_parent_ip(); - #endif -- trace_preempt_off(CALLER_ADDR0, get_parent_ip(CALLER_ADDR1)); -+ trace_preempt_off(CALLER_ADDR0, get_lock_parent_ip()); - } - } - EXPORT_SYMBOL(__local_bh_disable_ip); -@@ -563,8 +563,10 @@ static void do_current_softirqs(void) - do_single_softirq(i); - } - softirq_clr_runner(i); -- unlock_softirq(i); - WARN_ON(current->softirq_nestcnt != 1); -+ local_irq_enable(); -+ unlock_softirq(i); -+ local_irq_disable(); - } - } - -diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c -index 2c5acc8..f84d3b4 100644 ---- a/kernel/stop_machine.c -+++ b/kernel/stop_machine.c -@@ -30,7 +30,7 @@ struct cpu_stop_done { - atomic_t nr_todo; /* nr left to execute */ - bool executed; /* actually executed? */ - int ret; /* collected return value */ -- struct task_struct *waiter; /* woken when nr_todo reaches 0 */ -+ struct completion completion; /* fired if nr_todo reaches 0 */ - }; - - /* the actual stopper, one per every possible cpu, enabled on online cpus */ -@@ -59,7 +59,7 @@ static void cpu_stop_init_done(struct cpu_stop_done *done, unsigned int nr_todo) - { - memset(done, 0, sizeof(*done)); - atomic_set(&done->nr_todo, nr_todo); -- done->waiter = current; -+ init_completion(&done->completion); - } - - /* signal completion unless @done is NULL */ -@@ -68,10 +68,8 @@ static void cpu_stop_signal_done(struct cpu_stop_done *done, bool executed) - if (done) { - if (executed) - done->executed = true; -- if (atomic_dec_and_test(&done->nr_todo)) { -- wake_up_process(done->waiter); -- done->waiter = NULL; -- } -+ if (atomic_dec_and_test(&done->nr_todo)) -+ complete(&done->completion); - } - } - -@@ -96,22 +94,6 @@ static void cpu_stop_queue_work(unsigned int cpu, struct cpu_stop_work *work) - raw_spin_unlock_irqrestore(&stopper->lock, flags); - } - --static void wait_for_stop_done(struct cpu_stop_done *done) --{ -- set_current_state(TASK_UNINTERRUPTIBLE); -- while (atomic_read(&done->nr_todo)) { -- schedule(); -- set_current_state(TASK_UNINTERRUPTIBLE); -- } -- /* -- * We need to wait until cpu_stop_signal_done() has cleared -- * done->waiter. -- */ -- while (done->waiter) -- cpu_relax(); -- set_current_state(TASK_RUNNING); --} -- - /** - * stop_one_cpu - stop a cpu - * @cpu: cpu to stop -@@ -143,7 +125,7 @@ int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg) - - cpu_stop_init_done(&done, 1); - cpu_stop_queue_work(cpu, &work); -- wait_for_stop_done(&done); -+ wait_for_completion(&done.completion); - return done.executed ? done.ret : -ENOENT; - } - -@@ -302,7 +284,7 @@ int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void * - - preempt_enable_nort(); - -- wait_for_stop_done(&done); -+ wait_for_completion(&done.completion); - - return done.executed ? done.ret : -ENOENT; - } -@@ -364,7 +346,7 @@ static int __stop_cpus(const struct cpumask *cpumask, - - cpu_stop_init_done(&done, cpumask_weight(cpumask)); - queue_stop_cpus_work(cpumask, fn, arg, &done, false); -- wait_for_stop_done(&done); -+ wait_for_completion(&done.completion); - return done.executed ? done.ret : -ENOENT; - } - -@@ -495,13 +477,7 @@ static void cpu_stopper_thread(unsigned int cpu) - kallsyms_lookup((unsigned long)fn, NULL, NULL, NULL, - ksym_buf), arg); - -- /* -- * Make sure that the wakeup and setting done->waiter -- * to NULL is atomic. -- */ -- local_irq_disable(); - cpu_stop_signal_done(done, true); -- local_irq_enable(); - goto repeat; - } - } -@@ -663,7 +639,7 @@ int stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data, - ret = multi_cpu_stop(&msdata); - - /* Busy wait for completion. */ -- while (atomic_read(&done.nr_todo)) -+ while (!completion_done(&done.completion)) - cpu_relax(); - - mutex_unlock(&stop_cpus_mutex); -diff --git a/kernel/time/tick-broadcast-hrtimer.c b/kernel/time/tick-broadcast-hrtimer.c -index 53d7184..1b4ac33 100644 ---- a/kernel/time/tick-broadcast-hrtimer.c -+++ b/kernel/time/tick-broadcast-hrtimer.c -@@ -106,5 +106,6 @@ void tick_setup_hrtimer_broadcast(void) - { - hrtimer_init(&bctimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); - bctimer.function = bc_handler; -+ bctimer.irqsafe = true; - clockevents_register_device(&ce_broadcast_hrtimer); - } -diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c -index 36e584f..069942c 100644 ---- a/kernel/trace/trace_irqsoff.c -+++ b/kernel/trace/trace_irqsoff.c -@@ -421,13 +421,13 @@ void start_critical_timings(void) - { - if (preempt_trace() || irq_trace()) - start_critical_timing(CALLER_ADDR0, CALLER_ADDR1); -- trace_preemptirqsoff_hist(TRACE_START, 1); -+ trace_preemptirqsoff_hist_rcuidle(TRACE_START, 1); - } - EXPORT_SYMBOL_GPL(start_critical_timings); - - void stop_critical_timings(void) - { -- trace_preemptirqsoff_hist(TRACE_STOP, 0); -+ trace_preemptirqsoff_hist_rcuidle(TRACE_STOP, 0); - if (preempt_trace() || irq_trace()) - stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1); - } -@@ -437,7 +437,7 @@ EXPORT_SYMBOL_GPL(stop_critical_timings); - #ifdef CONFIG_PROVE_LOCKING - void time_hardirqs_on(unsigned long a0, unsigned long a1) - { -- trace_preemptirqsoff_hist(IRQS_ON, 0); -+ trace_preemptirqsoff_hist_rcuidle(IRQS_ON, 0); - if (!preempt_trace() && irq_trace()) - stop_critical_timing(a0, a1); - } -@@ -446,7 +446,7 @@ void time_hardirqs_off(unsigned long a0, unsigned long a1) - { - if (!preempt_trace() && irq_trace()) - start_critical_timing(a0, a1); -- trace_preemptirqsoff_hist(IRQS_OFF, 1); -+ trace_preemptirqsoff_hist_rcuidle(IRQS_OFF, 1); - } - - #else /* !CONFIG_PROVE_LOCKING */ -diff --git a/lib/dump_stack.c b/lib/dump_stack.c -index 7ccbc6f..6745c62 100644 ---- a/lib/dump_stack.c -+++ b/lib/dump_stack.c -@@ -33,7 +33,7 @@ asmlinkage __visible void dump_stack(void) - * Permit this cpu to perform nested stack dumps while serialising - * against other CPUs - */ -- migrate_disable(); -+ preempt_disable(); - - retry: - cpu = smp_processor_id(); -@@ -52,7 +52,7 @@ asmlinkage __visible void dump_stack(void) - if (!was_locked) - atomic_set(&dump_lock, -1); - -- migrate_enable(); -+ preempt_enable(); - } - #else - asmlinkage __visible void dump_stack(void) -diff --git a/localversion-rt b/localversion-rt -index 5c84f62..76db1e9 100644 ---- a/localversion-rt -+++ b/localversion-rt -@@ -1 +1 @@ --+rt3 -++rt13 -diff --git a/mm/backing-dev.c b/mm/backing-dev.c -index cbe6f0b..6871838 100644 ---- a/mm/backing-dev.c -+++ b/mm/backing-dev.c -@@ -457,9 +457,9 @@ void wb_congested_put(struct bdi_writeback_congested *congested) - { - unsigned long flags; - -- local_irq_save(flags); -+ local_irq_save_nort(flags); - if (!atomic_dec_and_lock(&congested->refcnt, &cgwb_lock)) { -- local_irq_restore(flags); -+ local_irq_restore_nort(flags); - return; - } - -diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c -index fc08399..18cc59f 100644 ---- a/mm/zsmalloc.c -+++ b/mm/zsmalloc.c -@@ -1289,7 +1289,7 @@ void *zs_map_object(struct zs_pool *pool, unsigned long handle, - class = pool->size_class[class_idx]; - off = obj_idx_to_offset(page, obj_idx, class->size); - -- area = &get_cpu_var(zs_map_area); -+ area = per_cpu_ptr(&zs_map_area, get_cpu_light()); - area->vm_mm = mm; - if (off + class->size <= PAGE_SIZE) { - /* this object is contained entirely within a page */ -@@ -1342,7 +1342,7 @@ void zs_unmap_object(struct zs_pool *pool, unsigned long handle) - - __zs_unmap_object(area, pages, off, class->size); - } -- put_cpu_var(zs_map_area); -+ put_cpu_light(); - unpin_tag(handle); - } - EXPORT_SYMBOL_GPL(zs_unmap_object); -diff --git a/net/core/dev.c b/net/core/dev.c -index 5ec7abf..0e17592 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -2891,7 +2891,11 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q, - * This permits __QDISC___STATE_RUNNING owner to get the lock more - * often and dequeue packets faster. - */ -+#ifdef CONFIG_PREEMPT_RT_FULL -+ contended = true; -+#else - contended = qdisc_is_running(q); -+#endif - if (unlikely(contended)) - spin_lock(&q->busylock); - -@@ -2983,7 +2987,7 @@ static inline void xmit_rec_inc(void) - __this_cpu_inc(xmit_recursion); - } - --static inline int xmit_rec_dec(void) -+static inline void xmit_rec_dec(void) - { - __this_cpu_dec(xmit_recursion); - } -diff --git a/virt/kvm/async_pf.c b/virt/kvm/async_pf.c -index 57d9436..9378d09 100644 ---- a/virt/kvm/async_pf.c -+++ b/virt/kvm/async_pf.c -@@ -98,8 +98,8 @@ static void async_pf_execute(struct work_struct *work) - * This memory barrier pairs with prepare_to_wait's set_current_state() - */ - smp_mb(); -- if (swaitqueue_active(&vcpu->wq)) -- swait_wake_interruptible(&vcpu->wq); -+ if (swait_active(&vcpu->wq)) -+ swake_up(&vcpu->wq); - - mmput(mm); - kvm_put_kvm(vcpu->kvm); -diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c -index a076690..eeed326 100644 ---- a/virt/kvm/kvm_main.c -+++ b/virt/kvm/kvm_main.c -@@ -226,8 +226,7 @@ int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id) - vcpu->kvm = kvm; - vcpu->vcpu_id = id; - vcpu->pid = NULL; -- vcpu->halt_poll_ns = 0; -- init_swait_head(&vcpu->wq); -+ init_swait_queue_head(&vcpu->wq); - kvm_async_pf_vcpu_init(vcpu); - - vcpu->pre_pcpu = -1; -@@ -2002,7 +2001,7 @@ static int kvm_vcpu_check_block(struct kvm_vcpu *vcpu) - void kvm_vcpu_block(struct kvm_vcpu *vcpu) - { - ktime_t start, cur; -- DEFINE_SWAITER(wait); -+ DECLARE_SWAITQUEUE(wait); - bool waited = false; - u64 block_ns; - -@@ -2027,7 +2026,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu) - kvm_arch_vcpu_blocking(vcpu); - - for (;;) { -- swait_prepare(&vcpu->wq, &wait, TASK_INTERRUPTIBLE); -+ prepare_to_swait(&vcpu->wq, &wait, TASK_INTERRUPTIBLE); - - if (kvm_vcpu_check_block(vcpu) < 0) - break; -@@ -2036,7 +2035,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu) - schedule(); - } - -- swait_finish(&vcpu->wq, &wait); -+ finish_swait(&vcpu->wq, &wait); - cur = ktime_get(); - - kvm_arch_vcpu_unblocking(vcpu); -@@ -2068,11 +2067,11 @@ void kvm_vcpu_kick(struct kvm_vcpu *vcpu) - { - int me; - int cpu = vcpu->cpu; -- struct swait_head *wqp; -+ struct swait_queue_head *wqp; - - wqp = kvm_arch_vcpu_wq(vcpu); -- if (swaitqueue_active(wqp)) { -- swait_wake_interruptible(wqp); -+ if (swait_active(wqp)) { -+ swake_up(wqp); - ++vcpu->stat.halt_wakeup; - } - -@@ -2173,7 +2172,7 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me) - continue; - if (vcpu == me) - continue; -- if (swaitqueue_active(&vcpu->wq) && !kvm_arch_vcpu_runnable(vcpu)) -+ if (swait_active(&vcpu->wq) && !kvm_arch_vcpu_runnable(vcpu)) - continue; - if (!kvm_vcpu_eligible_for_directed_yield(vcpu)) - continue; - -From 7885305d87ec4603480459d48f5f54ebcc71fe20 Mon Sep 17 00:00:00 2001 -From: Jon Nettleton -Date: Tue, 11 Aug 2015 13:36:09 +0200 -Subject: [PATCH 03/13] gpu: galcore: Don't abuse the dma_* apis - -There is no reason we can't pass the device to the dma_* api's, -so do it. This does not follow the traditional vivante syntax -but it is more correct for in kernel drivers. - -(cherry picked from commit 3010fb04e38c5952d156afb1290e69a44c3017b8) -Signed-off-by: Matus Kral ---- - drivers/gpu/galcore/gc_hal_kernel_device.c | 3 +++ - drivers/gpu/galcore/gc_hal_kernel_device.h | 3 +++ - drivers/gpu/galcore/gc_hal_kernel_os.c | 20 ++++++++++---------- - drivers/gpu/galcore/gc_hal_kernel_probe.c | 5 +++-- - 4 files changed, 19 insertions(+), 12 deletions(-) - -diff --git a/drivers/gpu/galcore/gc_hal_kernel_device.c b/drivers/gpu/galcore/gc_hal_kernel_device.c -index e99d29f..42a0b24 100644 ---- a/drivers/gpu/galcore/gc_hal_kernel_device.c -+++ b/drivers/gpu/galcore/gc_hal_kernel_device.c -@@ -683,6 +683,7 @@ gckGALDEVICE_Construct( - IN gctINT PowerManagement, - IN gctINT GpuProfiler, - IN gcsDEVICE_CONSTRUCT_ARGS * Args, -+ IN struct device *dev, - OUT gckGALDEVICE *Device - ) - { -@@ -729,6 +730,8 @@ gckGALDEVICE_Construct( - - device->platform = Args->platform; - -+ device->dev = dev; -+ - gcmkONERROR(_DebugfsInit(device)); - - if (gckDEBUGFS_CreateNode( -diff --git a/drivers/gpu/galcore/gc_hal_kernel_device.h b/drivers/gpu/galcore/gc_hal_kernel_device.h -index c94d67c..4d66a6a 100644 ---- a/drivers/gpu/galcore/gc_hal_kernel_device.h -+++ b/drivers/gpu/galcore/gc_hal_kernel_device.h -@@ -30,6 +30,8 @@ - - typedef struct _gckGALDEVICE - { -+ struct device *dev; -+ - /* Objects. */ - gckOS os; - gckKERNEL kernels[gcdMAX_GPU_COUNT]; -@@ -175,6 +177,7 @@ gceSTATUS gckGALDEVICE_Construct( - IN gctINT PowerManagement, - IN gctINT GpuProfiler, - IN gcsDEVICE_CONSTRUCT_ARGS * Args, -+ IN struct device *dev, - OUT gckGALDEVICE *Device - ); - -diff --git a/drivers/gpu/galcore/gc_hal_kernel_os.c b/drivers/gpu/galcore/gc_hal_kernel_os.c -index e05262b..0457574 100644 ---- a/drivers/gpu/galcore/gc_hal_kernel_os.c -+++ b/drivers/gpu/galcore/gc_hal_kernel_os.c -@@ -1092,7 +1092,7 @@ gckOS_MapMemory( - } - - #ifndef NO_DMA_COHERENT -- if (dma_mmap_writecombine(gcvNULL, -+ if (dma_mmap_writecombine(Os->device->dev, - mdlMap->vma, - mdl->addr, - mdl->dmaHandle, -@@ -1411,9 +1411,9 @@ gckOS_AllocateNonPagedMemory( - - #ifndef NO_DMA_COHERENT - #ifdef CONFIG_ARM64 -- addr = dma_alloc_coherent(gcvNULL, -+ addr = dma_alloc_coherent(Os->device->dev, - #else -- addr = dma_alloc_writecombine(gcvNULL, -+ addr = dma_alloc_writecombine(Os->device->dev, - #endif - mdl->numPages * PAGE_SIZE, - &mdl->dmaHandle, -@@ -1442,7 +1442,7 @@ gckOS_AllocateNonPagedMemory( - #if !defined(CONFIG_PPC) - /* Cache invalidate. */ - dma_sync_single_for_device( -- gcvNULL, -+ Os->device->dev, - page_to_phys(page), - bytes, - DMA_FROM_DEVICE); -@@ -1523,7 +1523,7 @@ gckOS_AllocateNonPagedMemory( - } - - #ifndef NO_DMA_COHERENT -- if (dma_mmap_coherent(gcvNULL, -+ if (dma_mmap_coherent(Os->device->dev, - mdlMap->vma, - mdl->addr, - mdl->dmaHandle, -@@ -1681,9 +1681,9 @@ gceSTATUS gckOS_FreeNonPagedMemory( - - #ifndef NO_DMA_COHERENT - #ifdef CONFIG_ARM64 -- dma_free_coherent(gcvNULL, -+ dma_free_coherent(Os->device->dev, - #else -- dma_free_writecombine(gcvNULL, -+ dma_free_writecombine(Os->device->dev, - #endif - mdl->numPages * PAGE_SIZE, - mdl->addr, -@@ -5383,7 +5383,7 @@ gckOS_CacheClean( - } - - dma_sync_single_for_device( -- gcvNULL, -+ Os->device->dev, - (dma_addr_t)Physical, - Bytes, - DMA_TO_DEVICE); -@@ -5457,7 +5457,7 @@ gckOS_CacheInvalidate( - } - - dma_sync_single_for_device( -- gcvNULL, -+ Os->device->dev, - (dma_addr_t)Physical, - Bytes, - DMA_FROM_DEVICE); -@@ -5533,7 +5533,7 @@ gckOS_CacheFlush( - if (Physical != gcvINVALID_ADDRESS) - { - dma_sync_single_for_device( -- gcvNULL, -+ Os->device->dev, - (dma_addr_t)Physical, - Bytes, - DMA_BIDIRECTIONAL); -diff --git a/drivers/gpu/galcore/gc_hal_kernel_probe.c b/drivers/gpu/galcore/gc_hal_kernel_probe.c -index 10098c3..9c904bd 100644 ---- a/drivers/gpu/galcore/gc_hal_kernel_probe.c -+++ b/drivers/gpu/galcore/gc_hal_kernel_probe.c -@@ -758,7 +758,7 @@ static int drv_mmap( - } - - --static int drv_init(void) -+static int drv_init(struct platform_device *pdev) - { - int ret; - int result = -EINVAL; -@@ -812,6 +812,7 @@ static int drv_init(void) - powerManagement, - gpuProfiler, - &args, -+ &pdev->dev, - &device - ); - -@@ -975,7 +976,7 @@ static int gpu_probe(struct platform_device *pdev) - _UpdateModuleParam(&moduleParam); - } - -- ret = drv_init(); -+ ret = drv_init(pdev); - - if (!ret) - { - -From 6376b35377c9cdac5465b89c4401b6ceb3dee91e Mon Sep 17 00:00:00 2001 -From: Matus Kral -Date: Sun, 3 Apr 2016 13:29:34 +0200 -Subject: [PATCH 04/13] gpu: galcore: -rt13 updates - ---- - drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c -index 1685e57..ef8a9d2 100644 ---- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c -+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c -@@ -7730,8 +7730,8 @@ gckOS_WaitSignal( - : Wait * HZ / 1000; - #endif - -- DEFINE_SWAITER(wait); -- swait_prepare_locked(&signal->obj.wait, &wait); -+ DECLARE_SWAITQUEUE(wait); -+ __prepare_to_swait(&signal->obj.wait, &wait); - - while (gcvTRUE) - { -@@ -7809,7 +7809,7 @@ gckOS_WaitSignal( - } - } - -- swait_finish_locked(&signal->obj.wait, &wait); -+ __finish_swait(&signal->obj.wait, &wait); - - #if gcdDETECT_TIMEOUT - if (complained) - -From a665ce6296067e0685b559d9b355d10718c08ff3 Mon Sep 17 00:00:00 2001 -From: Matus Kral -Date: Sun, 3 Apr 2016 13:32:02 +0200 -Subject: [PATCH 05/13] mxc_hdmi: remove blank_state() and abort_stream() - handling - ---- - drivers/video/mxc/mxc_hdmi.c | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/drivers/video/mxc/mxc_hdmi.c b/drivers/video/mxc/mxc_hdmi.c -index 5587165..df91138 100644 ---- a/drivers/video/mxc/mxc_hdmi.c -+++ b/drivers/video/mxc/mxc_hdmi.c -@@ -1904,7 +1904,6 @@ static void mxc_hdmi_phy_disable(struct mxc_hdmi *hdmi) - if (!hdmi->phy_enabled) - return; - -- mxc_hdmi_abort_stream(); - hdmi_disable_overflow_interrupts(); - - /* Setting PHY to reset status */ -@@ -2489,7 +2488,6 @@ static void hotplug_worker(struct work_struct *work) - } else if (!(hdmi_phy_pol0 & hdmi->plug_mask)) { - /* Plugout event */ - dev_dbg(&hdmi->pdev->dev, "EVENT=plugout\n"); -- mxc_hdmi_abort_stream(); - mxc_hdmi_cable_disconnected(hdmi); - #if defined(CONFIG_MXC_HDMI_CEC) - mxc_hdmi_cec_handle(0x0); -@@ -2812,13 +2810,10 @@ static int mxc_hdmi_fb_event(struct notifier_block *nb, - - if (hdmi->hp_state > HDMI_HOTPLUG_DISCONNECTED) - mxc_hdmi_setup(hdmi, val); -- hdmi_set_blank_state(1); - - } else if (*((int *)event->data) != hdmi->blank) { - dev_dbg(&hdmi->pdev->dev, - "event=FB_EVENT_BLANK - BLANK\n"); -- mxc_hdmi_abort_stream(); -- hdmi_set_blank_state(0); - - mxc_hdmi_phy_disable(hdmi); - - -From fa3ba4775d9154b53411fbccd4ecc2599d534d26 Mon Sep 17 00:00:00 2001 -From: Matus Kral -Date: Mon, 4 Apr 2016 01:43:46 +0200 -Subject: [PATCH 06/13] clk: cosmetics, reorder - ---- - drivers/clk/imx/clk-imx6q.c | 23 +++++++++++++---------- - 1 file changed, 13 insertions(+), 10 deletions(-) - -diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c -index d3366be..ceb8703 100644 ---- a/drivers/clk/imx/clk-imx6q.c -+++ b/drivers/clk/imx/clk-imx6q.c -@@ -507,6 +507,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) - clk_data.clk_num = ARRAY_SIZE(clk); - of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); - -+ clk_register_clkdev(clk[IMX6QDL_CLK_GPT_3M], "gpt_3m", "imx-gpt.0"); - clk_register_clkdev(clk[IMX6QDL_CLK_ENET_REF], "enet_ref", NULL); - - if ((imx_get_soc_revision() != IMX_CHIP_REVISION_1_0) || -@@ -515,6 +516,10 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) - imx_clk_set_parent(clk[IMX6QDL_CLK_LDB_DI1_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]); - } - -+ imx_clk_set_rate(clk[IMX6QDL_CLK_PLL3_PFD1_540M], 540000000); -+ if (clk_on_imx6dl()) -+ imx_clk_set_parent(clk[IMX6QDL_CLK_IPU1_SEL], clk[IMX6QDL_CLK_PLL3_PFD1_540M]); -+ - imx_clk_set_parent(clk[IMX6QDL_CLK_IPU1_DI0_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]); - imx_clk_set_parent(clk[IMX6QDL_CLK_IPU1_DI1_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]); - imx_clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI0_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]); -@@ -524,8 +529,6 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) - imx_clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI0_SEL], clk[IMX6QDL_CLK_IPU2_DI0_PRE]); - imx_clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI1_SEL], clk[IMX6QDL_CLK_IPU2_DI1_PRE]); - -- imx_clk_set_rate(clk[IMX6QDL_CLK_PLL3_PFD1_540M], 540000000); -- imx_clk_set_parent(clk[IMX6QDL_CLK_IPU1_SEL], clk[IMX6QDL_CLK_PLL3_PFD1_540M]); - imx_clk_set_parent(clk[IMX6QDL_CLK_AXI_ALT_SEL], clk[IMX6QDL_CLK_PLL3_PFD1_540M]); - imx_clk_set_parent(clk[IMX6QDL_CLK_AXI_SEL], clk[IMX6QDL_CLK_AXI_ALT_SEL]); - /* set epdc/pxp axi clock to 200Mhz */ -@@ -543,6 +546,14 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) - */ - imx_clk_set_parent(clk[IMX6QDL_CLK_ENFC_SEL], clk[IMX6QDL_CLK_PLL2_PFD2_396M]); - -+ for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) -+ imx_clk_prepare_enable(clk[clks_init_on[i]]); -+ -+ if (IS_ENABLED(CONFIG_USB_MXS_PHY)) { -+ imx_clk_prepare_enable(clk[IMX6QDL_CLK_USBPHY1_GATE]); -+ imx_clk_prepare_enable(clk[IMX6QDL_CLK_USBPHY2_GATE]); -+ } -+ - /* gpu clock initilazation */ - /* - * On mx6dl, 2d core clock sources(sel, podf) is from 3d -@@ -588,14 +599,6 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) - - imx_register_uart_clocks(uart_clks); - -- for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) -- imx_clk_prepare_enable(clk[clks_init_on[i]]); -- -- if (IS_ENABLED(CONFIG_USB_MXS_PHY)) { -- imx_clk_prepare_enable(clk[IMX6QDL_CLK_USBPHY1_GATE]); -- imx_clk_prepare_enable(clk[IMX6QDL_CLK_USBPHY2_GATE]); -- } -- - imx_clk_set_parent(clk[IMX6QDL_CLK_VPU_AXI_SEL], clk[IMX6QDL_CLK_PLL2_PFD0_352M]); - - if (clk_on_imx6dl()) - -From a0d0665879629b6a24dd94f5206434cb9ab00b87 Mon Sep 17 00:00:00 2001 -From: Matus Kral -Date: Mon, 4 Apr 2016 03:16:05 +0200 -Subject: [PATCH 07/13] add mxc_v4l2.h to linux-libc-dev headers - ---- - include/uapi/linux/Kbuild | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild -index 18c9229..ba55082 100644 ---- a/include/uapi/linux/Kbuild -+++ b/include/uapi/linux/Kbuild -@@ -274,6 +274,7 @@ header-y += msg.h - header-y += mtio.h - header-y += mxcfb.h - header-y += mxc_dcic.h -+header-y += mxc_v4l2.h - header-y += ipu.h - header-y += nbd.h - header-y += ncp_fs.h - -From 8274eed9c6004cda725a67d12a0fd781326eb2dc Mon Sep 17 00:00:00 2001 -From: Matus Kral -Date: Mon, 4 Apr 2016 03:17:07 +0200 -Subject: [PATCH 08/13] ipu_device: do not overlap stripes - ---- - drivers/mxc/ipu3/ipu_device.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/drivers/mxc/ipu3/ipu_device.c b/drivers/mxc/ipu3/ipu_device.c -index e34e1ba..306639d 100644 ---- a/drivers/mxc/ipu3/ipu_device.c -+++ b/drivers/mxc/ipu3/ipu_device.c -@@ -485,6 +485,7 @@ cs_t colorspaceofpixel(int fmt) - } - EXPORT_SYMBOL_GPL(colorspaceofpixel); - -+inline - int need_csc(int ifmt, int ofmt) - { - cs_t ics, ocs; -@@ -501,26 +502,31 @@ int need_csc(int ifmt, int ofmt) - } - EXPORT_SYMBOL_GPL(need_csc); - -+inline - static int soc_max_in_width(u32 is_vdoa) - { - return is_vdoa ? 8192 : 4096; - } - -+inline - static int soc_max_vdi_in_width(void) - { - return IPU_MAX_VDI_IN_WIDTH; - } -+inline - static int soc_max_in_height(void) - { - return 4096; - } - -+inline - static int soc_max_out_width(void) - { - /* mx51/mx53/mx6q is 1024*/ - return 1024; - } - -+inline - static int soc_max_out_height(void) - { - /* mx51/mx53/mx6q is 1024*/ -@@ -859,7 +865,7 @@ static int update_split_setting(struct ipu_task_entry *t, bool vdi_split) - ret = ipu_calc_stripes_sizes(iw, - ow, - max_width, -- (((unsigned long long)1) << 32), /* 32bit for fractional*/ -+ 0,/*no overlap*/ /* 32bit for fractional*/ - 1, /* equal stripes */ - t->input.format, - t->output.format, -@@ -907,7 +913,7 @@ static int update_split_setting(struct ipu_task_entry *t, bool vdi_split) - ret = ipu_calc_stripes_sizes(ih, - oh, - soc_max_out_height(), -- (((unsigned long long)1) << 32), /* 32bit for fractional*/ -+ 0,/*no overlap*/ /* 32bit for fractional*/ - 0x1 | 0x2, /* equal stripes and vertical */ - t->input.format, - t->output.format, - -From ea5643bec4f6265a95528693c06d330092e05cc8 Mon Sep 17 00:00:00 2001 -From: Matus Kral -Date: Mon, 4 Apr 2016 03:43:49 +0200 -Subject: [PATCH 09/13] Revert "printk: do cond_resched() between lines while - outputting to consoles" - -This reverts commit a623f87a72de35096a9eae7cc7764d0c9533c2e9. - -Conflicts: - kernel/printk/printk.c ---- - include/linux/console.h | 1 - - kernel/panic.c | 3 ++- - kernel/printk/printk.c | 34 +--------------------------------- - 3 files changed, 3 insertions(+), 35 deletions(-) - -diff --git a/include/linux/console.h b/include/linux/console.h -index ea731af..bd19434 100644 ---- a/include/linux/console.h -+++ b/include/linux/console.h -@@ -150,7 +150,6 @@ extern int console_trylock(void); - extern void console_unlock(void); - extern void console_conditional_schedule(void); - extern void console_unblank(void); --extern void console_flush_on_panic(void); - extern struct tty_driver *console_device(int *); - extern void console_stop(struct console *); - extern void console_start(struct console *); -diff --git a/kernel/panic.c b/kernel/panic.c -index 50d4ae2..d74f25d 100644 ---- a/kernel/panic.c -+++ b/kernel/panic.c -@@ -157,7 +157,8 @@ void panic(const char *fmt, ...) - * panic() is not being callled from OOPS. - */ - debug_locks_off(); -- console_flush_on_panic(); -+ console_trylock(); -+ console_unlock(); - - if (!panic_blink) - panic_blink = no_blink; -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index f75e4b0..88995de 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -2319,24 +2319,13 @@ void console_unlock(void) - static u64 seen_seq; - unsigned long flags; - bool wake_klogd = false; -- bool do_cond_resched, retry; -+ bool retry; - - if (console_suspended) { - up_console_sem(); - return; - } - -- /* -- * Console drivers are called under logbuf_lock, so -- * @console_may_schedule should be cleared before; however, we may -- * end up dumping a lot of lines, for example, if called from -- * console registration path, and should invoke cond_resched() -- * between lines if allowable. Not doing so can cause a very long -- * scheduling stall on a slow console leading to RCU stall and -- * softlockup warnings which exacerbate the issue with more -- * messages practically incapacitating the system. -- */ -- do_cond_resched = console_may_schedule; - console_may_schedule = 0; - - /* flush buffered message fragment immediately to console */ -@@ -2413,8 +2402,6 @@ void console_unlock(void) - start_critical_timings(); - local_irq_restore(flags); - #endif -- if (do_cond_resched) -- cond_resched(); - } - console_locked = 0; - -@@ -2482,25 +2469,6 @@ void console_unblank(void) - console_unlock(); - } - --/** -- * console_flush_on_panic - flush console content on panic -- * -- * Immediately output all pending messages no matter what. -- */ --void console_flush_on_panic(void) --{ -- /* -- * If someone else is holding the console lock, trylock will fail -- * and may_schedule may be set. Ignore and proceed to unlock so -- * that messages are flushed out. As this can be called from any -- * context and we don't want to get preempted while flushing, -- * ensure may_schedule is cleared. -- */ -- console_trylock(); -- console_may_schedule = 0; -- console_unlock(); --} -- - /* - * Return the console tty driver structure and its associated index - */ - -From cf227a4cf2222a7d4fcc93016656a4dce684e5ae Mon Sep 17 00:00:00 2001 -From: Matus Kral -Date: Tue, 5 Apr 2016 10:37:31 +0200 -Subject: [PATCH 10/13] default configs update for xbian_defconfig_imx6_mvebu - ---- - arch/arm/configs/xbian_defconfig_imx6 | 6550 --------------------------- - arch/arm/configs/xbian_defconfig_imx6_mvebu | 199 +- - 2 files changed, 65 insertions(+), 6684 deletions(-) - delete mode 100644 arch/arm/configs/xbian_defconfig_imx6 - -diff --git a/arch/arm/configs/xbian_defconfig_imx6 b/arch/arm/configs/xbian_defconfig_imx6 -deleted file mode 100644 -index 20d0117..0000000 ---- a/arch/arm/configs/xbian_defconfig_imx6 -+++ /dev/null -@@ -1,6550 +0,0 @@ --# --# Automatically generated file; DO NOT EDIT. --# Linux/arm 4.4.1 Kernel Configuration --# --CONFIG_ARM=y --CONFIG_ARM_HAS_SG_CHAIN=y --CONFIG_MIGHT_HAVE_PCI=y --CONFIG_SYS_SUPPORTS_APM_EMULATION=y --CONFIG_HAVE_PROC_CPU=y --CONFIG_STACKTRACE_SUPPORT=y --CONFIG_LOCKDEP_SUPPORT=y --CONFIG_TRACE_IRQFLAGS_SUPPORT=y --CONFIG_RWSEM_XCHGADD_ALGORITHM=y --CONFIG_FIX_EARLYCON_MEM=y --CONFIG_GENERIC_HWEIGHT=y --CONFIG_GENERIC_CALIBRATE_DELAY=y --CONFIG_ZONE_DMA=y --CONFIG_NEED_DMA_MAP_STATE=y --CONFIG_ARCH_SUPPORTS_UPROBES=y --CONFIG_VECTORS_BASE=0xffff0000 --CONFIG_ARM_PATCH_PHYS_VIRT=y --CONFIG_GENERIC_BUG=y --CONFIG_PGTABLE_LEVELS=2 --CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" --CONFIG_IRQ_WORK=y --CONFIG_BUILDTIME_EXTABLE_SORT=y -- --# --# General setup --# --CONFIG_INIT_ENV_ARG_LIMIT=32 --CONFIG_CROSS_COMPILE="" --# CONFIG_COMPILE_TEST is not set --CONFIG_LOCALVERSION="" --# CONFIG_LOCALVERSION_AUTO is not set --CONFIG_HAVE_KERNEL_GZIP=y --CONFIG_HAVE_KERNEL_LZMA=y --CONFIG_HAVE_KERNEL_XZ=y --CONFIG_HAVE_KERNEL_LZO=y --CONFIG_HAVE_KERNEL_LZ4=y --CONFIG_KERNEL_GZIP=y --# CONFIG_KERNEL_LZMA is not set --# CONFIG_KERNEL_XZ is not set --# CONFIG_KERNEL_LZO is not set --# CONFIG_KERNEL_LZ4 is not set --CONFIG_DEFAULT_HOSTNAME="xbian" --CONFIG_SWAP=y --CONFIG_SYSVIPC=y --CONFIG_SYSVIPC_SYSCTL=y --CONFIG_POSIX_MQUEUE=y --CONFIG_POSIX_MQUEUE_SYSCTL=y --CONFIG_CROSS_MEMORY_ATTACH=y --CONFIG_FHANDLE=y --# CONFIG_USELIB is not set --# CONFIG_AUDIT is not set --CONFIG_HAVE_ARCH_AUDITSYSCALL=y -- --# --# IRQ subsystem --# --CONFIG_GENERIC_IRQ_PROBE=y --CONFIG_GENERIC_IRQ_SHOW=y --CONFIG_GENERIC_IRQ_SHOW_LEVEL=y --CONFIG_HARDIRQS_SW_RESEND=y --CONFIG_GENERIC_IRQ_CHIP=y --CONFIG_IRQ_DOMAIN=y --CONFIG_IRQ_DOMAIN_HIERARCHY=y --CONFIG_HANDLE_DOMAIN_IRQ=y --# CONFIG_IRQ_DOMAIN_DEBUG is not set --CONFIG_IRQ_FORCED_THREADING=y --CONFIG_SPARSE_IRQ=y --CONFIG_GENERIC_TIME_VSYSCALL=y --CONFIG_GENERIC_CLOCKEVENTS=y --CONFIG_ARCH_HAS_TICK_BROADCAST=y --CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y -- --# --# Timers subsystem --# --CONFIG_TICK_ONESHOT=y --CONFIG_NO_HZ_COMMON=y --# CONFIG_HZ_PERIODIC is not set --CONFIG_NO_HZ_IDLE=y --# CONFIG_NO_HZ_FULL is not set --# CONFIG_NO_HZ is not set --CONFIG_HIGH_RES_TIMERS=y -- --# --# CPU/Task time and stats accounting --# --# CONFIG_TICK_CPU_ACCOUNTING is not set --# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set --CONFIG_IRQ_TIME_ACCOUNTING=y --CONFIG_BSD_PROCESS_ACCT=y --CONFIG_BSD_PROCESS_ACCT_V3=y --# CONFIG_TASKSTATS is not set -- --# --# RCU Subsystem --# --CONFIG_PREEMPT_RCU=y --# CONFIG_RCU_EXPERT is not set --CONFIG_SRCU=y --# CONFIG_TASKS_RCU is not set --CONFIG_RCU_STALL_COMMON=y --# CONFIG_TREE_RCU_TRACE is not set --# CONFIG_RCU_EXPEDITE_BOOT is not set --CONFIG_BUILD_BIN2C=y --CONFIG_IKCONFIG=y --CONFIG_IKCONFIG_PROC=y --CONFIG_LOG_BUF_SHIFT=16 --CONFIG_LOG_CPU_MAX_BUF_SHIFT=13 --CONFIG_GENERIC_SCHED_CLOCK=y --CONFIG_CGROUPS=y --# CONFIG_CGROUP_DEBUG is not set --# CONFIG_CGROUP_FREEZER is not set --# CONFIG_CGROUP_PIDS is not set --# CONFIG_CGROUP_DEVICE is not set --# CONFIG_CPUSETS is not set --CONFIG_CGROUP_CPUACCT=y --# CONFIG_MEMCG is not set --# CONFIG_CGROUP_PERF is not set --CONFIG_CGROUP_SCHED=y --CONFIG_FAIR_GROUP_SCHED=y --CONFIG_CFS_BANDWIDTH=y --CONFIG_RT_GROUP_SCHED=y --CONFIG_BLK_CGROUP=y --# CONFIG_DEBUG_BLK_CGROUP is not set --# CONFIG_CHECKPOINT_RESTORE is not set --CONFIG_NAMESPACES=y --CONFIG_UTS_NS=y --CONFIG_IPC_NS=y --CONFIG_USER_NS=y --CONFIG_PID_NS=y --CONFIG_NET_NS=y --# CONFIG_SCHED_AUTOGROUP is not set --# CONFIG_SYSFS_DEPRECATED is not set --CONFIG_RELAY=y --CONFIG_BLK_DEV_INITRD=y --CONFIG_INITRAMFS_SOURCE="" --CONFIG_RD_GZIP=y --# CONFIG_RD_BZIP2 is not set --# CONFIG_RD_LZMA is not set --# CONFIG_RD_XZ is not set --CONFIG_RD_LZO=y --# CONFIG_RD_LZ4 is not set --# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set --CONFIG_SYSCTL=y --CONFIG_ANON_INODES=y --CONFIG_HAVE_UID16=y --CONFIG_BPF=y --CONFIG_EXPERT=y --# CONFIG_UID16 is not set --CONFIG_MULTIUSER=y --# CONFIG_SGETMASK_SYSCALL is not set --CONFIG_SYSFS_SYSCALL=y --CONFIG_SYSCTL_SYSCALL=y --CONFIG_KALLSYMS=y --CONFIG_KALLSYMS_ALL=y --CONFIG_PRINTK=y --CONFIG_BUG=y --CONFIG_BASE_FULL=y --CONFIG_FUTEX=y --CONFIG_EPOLL=y --CONFIG_SIGNALFD=y --CONFIG_TIMERFD=y --CONFIG_EVENTFD=y --# CONFIG_BPF_SYSCALL is not set --CONFIG_SHMEM=y --CONFIG_AIO=y --# CONFIG_ADVISE_SYSCALLS is not set --CONFIG_USERFAULTFD=y --CONFIG_PCI_QUIRKS=y --CONFIG_MEMBARRIER=y --CONFIG_EMBEDDED=y --CONFIG_HAVE_PERF_EVENTS=y --CONFIG_PERF_USE_VMALLOC=y -- --# --# Kernel Performance Events And Counters --# --CONFIG_PERF_EVENTS=y --# CONFIG_DEBUG_PERF_USE_VMALLOC is not set --# CONFIG_VM_EVENT_COUNTERS is not set --# CONFIG_SLUB_DEBUG is not set --# CONFIG_COMPAT_BRK is not set --# CONFIG_SLAB is not set --CONFIG_SLUB=y --# CONFIG_SLOB is not set --# CONFIG_SLUB_CPU_PARTIAL is not set --# CONFIG_SYSTEM_DATA_VERIFICATION is not set --# CONFIG_PROFILING is not set --CONFIG_TRACEPOINTS=y --CONFIG_KEXEC_CORE=y --CONFIG_HAVE_OPROFILE=y --# CONFIG_KPROBES is not set --# CONFIG_JUMP_LABEL is not set --# CONFIG_UPROBES is not set --# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set --CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y --CONFIG_ARCH_USE_BUILTIN_BSWAP=y --CONFIG_HAVE_KPROBES=y --CONFIG_HAVE_KRETPROBES=y --CONFIG_HAVE_OPTPROBES=y --CONFIG_HAVE_ARCH_TRACEHOOK=y --CONFIG_HAVE_DMA_ATTRS=y --CONFIG_HAVE_DMA_CONTIGUOUS=y --CONFIG_GENERIC_SMP_IDLE_THREAD=y --CONFIG_GENERIC_IDLE_POLL_SETUP=y --CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y --CONFIG_HAVE_CLK=y --CONFIG_HAVE_DMA_API_DEBUG=y --CONFIG_HAVE_HW_BREAKPOINT=y --CONFIG_HAVE_PERF_REGS=y --CONFIG_HAVE_PERF_USER_STACK_DUMP=y --CONFIG_HAVE_ARCH_JUMP_LABEL=y --CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y --CONFIG_HAVE_ARCH_SECCOMP_FILTER=y --CONFIG_HAVE_CC_STACKPROTECTOR=y --# CONFIG_CC_STACKPROTECTOR is not set --CONFIG_CC_STACKPROTECTOR_NONE=y --# CONFIG_CC_STACKPROTECTOR_REGULAR is not set --# CONFIG_CC_STACKPROTECTOR_STRONG is not set --CONFIG_HAVE_CONTEXT_TRACKING=y --CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y --CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y --CONFIG_HAVE_MOD_ARCH_SPECIFIC=y --CONFIG_MODULES_USE_ELF_REL=y --CONFIG_ARCH_HAS_ELF_RANDOMIZE=y --CONFIG_CLONE_BACKWARDS=y --CONFIG_OLD_SIGSUSPEND3=y --CONFIG_OLD_SIGACTION=y -- --# --# GCOV-based kernel profiling --# --# CONFIG_GCOV_KERNEL is not set --CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y --CONFIG_HAVE_GENERIC_DMA_COHERENT=y --CONFIG_RT_MUTEXES=y --CONFIG_BASE_SMALL=0 --CONFIG_MODULES=y --# CONFIG_MODULE_FORCE_LOAD is not set --CONFIG_MODULE_UNLOAD=y --# CONFIG_MODULE_FORCE_UNLOAD is not set --CONFIG_MODVERSIONS=y --CONFIG_MODULE_SRCVERSION_ALL=y --# CONFIG_MODULE_SIG is not set --# CONFIG_MODULE_COMPRESS is not set --CONFIG_MODULES_TREE_LOOKUP=y --CONFIG_BLOCK=y --CONFIG_LBDAF=y --CONFIG_BLK_DEV_BSG=y --CONFIG_BLK_DEV_BSGLIB=y --CONFIG_BLK_DEV_INTEGRITY=y --# CONFIG_BLK_DEV_THROTTLING is not set --# CONFIG_BLK_CMDLINE_PARSER is not set -- --# --# Partition Types --# --CONFIG_PARTITION_ADVANCED=y --# CONFIG_ACORN_PARTITION is not set --# CONFIG_AIX_PARTITION is not set --# CONFIG_OSF_PARTITION is not set --# CONFIG_AMIGA_PARTITION is not set --# CONFIG_ATARI_PARTITION is not set --CONFIG_MAC_PARTITION=y --CONFIG_MSDOS_PARTITION=y --CONFIG_BSD_DISKLABEL=y --CONFIG_MINIX_SUBPARTITION=y --CONFIG_SOLARIS_X86_PARTITION=y --CONFIG_UNIXWARE_DISKLABEL=y --CONFIG_LDM_PARTITION=y --# CONFIG_LDM_DEBUG is not set --# CONFIG_SGI_PARTITION is not set --# CONFIG_ULTRIX_PARTITION is not set --CONFIG_SUN_PARTITION=y --CONFIG_KARMA_PARTITION=y --CONFIG_EFI_PARTITION=y --# CONFIG_SYSV68_PARTITION is not set --# CONFIG_CMDLINE_PARTITION is not set -- --# --# IO Schedulers --# --CONFIG_IOSCHED_NOOP=y --CONFIG_IOSCHED_DEADLINE=y --CONFIG_IOSCHED_CFQ=y --# CONFIG_CFQ_GROUP_IOSCHED is not set --CONFIG_IOSCHED_BFQ=y --# CONFIG_CGROUP_BFQIO is not set --# CONFIG_DEFAULT_DEADLINE is not set --# CONFIG_DEFAULT_CFQ is not set --CONFIG_DEFAULT_BFQ=y --# CONFIG_DEFAULT_NOOP is not set --CONFIG_DEFAULT_IOSCHED="bfq" --CONFIG_PADATA=y --CONFIG_ASN1=m --CONFIG_UNINLINE_SPIN_UNLOCK=y --CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y --CONFIG_MUTEX_SPIN_ON_OWNER=y --CONFIG_RWSEM_SPIN_ON_OWNER=y --CONFIG_LOCK_SPIN_ON_OWNER=y --CONFIG_FREEZER=y -- --# --# System Type --# --CONFIG_MMU=y --CONFIG_ARCH_MULTIPLATFORM=y --# CONFIG_ARCH_REALVIEW is not set --# CONFIG_ARCH_VERSATILE is not set --# CONFIG_ARCH_CLPS711X is not set --# CONFIG_ARCH_GEMINI is not set --# CONFIG_ARCH_EBSA110 is not set --# CONFIG_ARCH_EP93XX is not set --# CONFIG_ARCH_FOOTBRIDGE is not set --# CONFIG_ARCH_NETX is not set --# CONFIG_ARCH_IOP13XX is not set --# CONFIG_ARCH_IOP32X is not set --# CONFIG_ARCH_IOP33X is not set --# CONFIG_ARCH_IXP4XX is not set --# CONFIG_ARCH_DOVE is not set --# CONFIG_ARCH_MV78XX0 is not set --# CONFIG_ARCH_ORION5X is not set --# CONFIG_ARCH_MMP is not set --# CONFIG_ARCH_KS8695 is not set --# CONFIG_ARCH_W90X900 is not set --# CONFIG_ARCH_LPC32XX is not set --# CONFIG_ARCH_PXA is not set --# CONFIG_ARCH_RPC is not set --# CONFIG_ARCH_SA1100 is not set --# CONFIG_ARCH_S3C24XX is not set --# CONFIG_ARCH_S3C64XX is not set --# CONFIG_ARCH_DAVINCI is not set --# CONFIG_ARCH_OMAP1 is not set -- --# --# Multiple platform selection --# -- --# --# CPU Core family selection --# --# CONFIG_ARCH_MULTI_V6 is not set --CONFIG_ARCH_MULTI_V7=y --CONFIG_ARCH_MULTI_V6_V7=y --# CONFIG_ARCH_MULTI_CPU_AUTO is not set --# CONFIG_ARCH_VIRT is not set --# CONFIG_ARCH_MVEBU is not set --# CONFIG_ARCH_ALPINE is not set --# CONFIG_ARCH_AT91 is not set --# CONFIG_ARCH_BCM is not set --# CONFIG_ARCH_BERLIN is not set --# CONFIG_ARCH_DIGICOLOR is not set --# CONFIG_ARCH_HIGHBANK is not set --# CONFIG_ARCH_HISI is not set --# CONFIG_ARCH_KEYSTONE is not set --# CONFIG_ARCH_MESON is not set --CONFIG_ARCH_MXC=y --CONFIG_HAVE_IMX_ANATOP=y --CONFIG_HAVE_IMX_GPC=y --CONFIG_HAVE_IMX_MMDC=y --CONFIG_HAVE_IMX_SRC=y -- --# --# Device tree only --# -- --# --# Cortex-A platforms --# --# CONFIG_SOC_IMX50 is not set --# CONFIG_SOC_IMX51 is not set --# CONFIG_SOC_IMX53 is not set --CONFIG_SOC_IMX6=y --CONFIG_SOC_IMX6Q=y --# CONFIG_SOC_IMX6SL is not set --# CONFIG_SOC_IMX6SX is not set --# CONFIG_SOC_IMX6UL is not set --# CONFIG_SOC_IMX7D is not set --# CONFIG_SOC_LS1021A is not set -- --# --# Cortex-A/Cortex-M asymmetric multiprocessing platforms --# --# CONFIG_SOC_VF610 is not set --# CONFIG_ARCH_MEDIATEK is not set -- --# --# TI OMAP/AM/DM/DRA Family --# --# CONFIG_ARCH_OMAP3 is not set --# CONFIG_ARCH_OMAP4 is not set --# CONFIG_SOC_OMAP5 is not set --# CONFIG_SOC_AM33XX is not set --# CONFIG_SOC_AM43XX is not set --# CONFIG_SOC_DRA7XX is not set --# CONFIG_ARCH_QCOM is not set --# CONFIG_ARCH_ROCKCHIP is not set --# CONFIG_ARCH_SOCFPGA is not set --# CONFIG_PLAT_SPEAR is not set --# CONFIG_ARCH_STI is not set --# CONFIG_ARCH_S5PV210 is not set --# CONFIG_ARCH_EXYNOS is not set --# CONFIG_ARCH_SHMOBILE_MULTI is not set --# CONFIG_ARCH_SUNXI is not set --# CONFIG_ARCH_SIRF is not set --# CONFIG_ARCH_TEGRA is not set --# CONFIG_ARCH_UNIPHIER is not set --# CONFIG_ARCH_U8500 is not set --# CONFIG_ARCH_VEXPRESS is not set --# CONFIG_ARCH_WM8850 is not set --# CONFIG_ARCH_ZX is not set --# CONFIG_ARCH_ZYNQ is not set -- --# --# Processor Type --# --CONFIG_CPU_V7=y --CONFIG_CPU_32v6K=y --CONFIG_CPU_32v7=y --CONFIG_CPU_ABRT_EV7=y --CONFIG_CPU_PABRT_V7=y --CONFIG_CPU_CACHE_V7=y --CONFIG_CPU_CACHE_VIPT=y --CONFIG_CPU_COPY_V6=y --CONFIG_CPU_TLB_V7=y --CONFIG_CPU_HAS_ASID=y --CONFIG_CPU_CP15=y --CONFIG_CPU_CP15_MMU=y -- --# --# Processor Features --# --# CONFIG_ARM_LPAE is not set --# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set --CONFIG_ARM_THUMB=y --# CONFIG_ARM_THUMBEE is not set --CONFIG_ARM_VIRT_EXT=y --CONFIG_SWP_EMULATE=y --# CONFIG_CPU_ICACHE_DISABLE is not set --# CONFIG_CPU_BPREDICT_DISABLE is not set --CONFIG_KUSER_HELPERS=y --CONFIG_VDSO=y --CONFIG_OUTER_CACHE=y --CONFIG_OUTER_CACHE_SYNC=y --CONFIG_MIGHT_HAVE_CACHE_L2X0=y --CONFIG_CACHE_L2X0=y --# CONFIG_PL310_ERRATA_588369 is not set --# CONFIG_PL310_ERRATA_727915 is not set --# CONFIG_PL310_ERRATA_753970 is not set --CONFIG_PL310_ERRATA_769419=y --CONFIG_ARM_L1_CACHE_SHIFT_6=y --CONFIG_ARM_L1_CACHE_SHIFT=6 --CONFIG_ARM_DMA_MEM_BUFFERABLE=y --CONFIG_ARM_HEAVY_MB=y --# CONFIG_ARM_KERNMEM_PERMS is not set --CONFIG_MULTI_IRQ_HANDLER=y --# CONFIG_ARM_ERRATA_430973 is not set --# CONFIG_ARM_ERRATA_643719 is not set --# CONFIG_ARM_ERRATA_720789 is not set --CONFIG_ARM_ERRATA_754322=y --# CONFIG_ARM_ERRATA_754327 is not set --CONFIG_ARM_ERRATA_764369=y --CONFIG_ARM_ERRATA_775420=y --# CONFIG_ARM_ERRATA_798181 is not set --# CONFIG_ARM_ERRATA_773022 is not set -- --# --# Bus support --# --CONFIG_PCI=y --CONFIG_PCI_DOMAINS=y --CONFIG_PCI_DOMAINS_GENERIC=y --CONFIG_PCI_SYSCALL=y --# CONFIG_PCI_MSI is not set --# CONFIG_PCI_DEBUG is not set --# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set --# CONFIG_PCI_STUB is not set --# CONFIG_PCI_IOV is not set --# CONFIG_PCI_PRI is not set --# CONFIG_PCI_PASID is not set -- --# --# PCI host controller drivers --# --CONFIG_PCIE_DW=y --CONFIG_PCI_IMX6=y --# CONFIG_PCI_HOST_GENERIC is not set --# CONFIG_PCI_LAYERSCAPE is not set --# CONFIG_PCIE_IPROC is not set --# CONFIG_PCIE_ALTERA is not set --CONFIG_PCIEPORTBUS=y --CONFIG_PCIEAER=y --# CONFIG_PCIE_ECRC is not set --# CONFIG_PCIEAER_INJECT is not set --CONFIG_PCIEASPM=y --# CONFIG_PCIEASPM_DEBUG is not set --CONFIG_PCIEASPM_DEFAULT=y --# CONFIG_PCIEASPM_POWERSAVE is not set --# CONFIG_PCIEASPM_PERFORMANCE is not set --CONFIG_PCIE_PME=y --# CONFIG_PCCARD is not set -- --# --# Kernel Features --# --CONFIG_HAVE_SMP=y --CONFIG_SMP=y --CONFIG_SMP_ON_UP=y --CONFIG_ARM_CPU_TOPOLOGY=y --# CONFIG_SCHED_MC is not set --# CONFIG_SCHED_SMT is not set --CONFIG_HAVE_ARM_SCU=y --# CONFIG_HAVE_ARM_ARCH_TIMER is not set --CONFIG_HAVE_ARM_TWD=y --# CONFIG_MCPM is not set --# CONFIG_BIG_LITTLE is not set --# CONFIG_VMSPLIT_3G is not set --# CONFIG_VMSPLIT_3G_OPT is not set --CONFIG_VMSPLIT_2G=y --# CONFIG_VMSPLIT_1G is not set --CONFIG_PAGE_OFFSET=0x80000000 --CONFIG_NR_CPUS=4 --CONFIG_HOTPLUG_CPU=y --# CONFIG_ARM_PSCI is not set --CONFIG_ARCH_NR_GPIO=0 --CONFIG_PREEMPT=y --CONFIG_HAVE_PREEMPT_LAZY=y --# CONFIG_PREEMPT_NONE is not set --# CONFIG_PREEMPT_VOLUNTARY is not set --CONFIG_PREEMPT__LL=y --# CONFIG_PREEMPT_RTB is not set --# CONFIG_PREEMPT_RT_FULL is not set --CONFIG_PREEMPT_COUNT=y --CONFIG_HZ_FIXED=0 --# CONFIG_HZ_100 is not set --# CONFIG_HZ_200 is not set --# CONFIG_HZ_250 is not set --CONFIG_HZ_300=y --# CONFIG_HZ_500 is not set --# CONFIG_HZ_1000 is not set --CONFIG_HZ=300 --CONFIG_SCHED_HRTICK=y --# CONFIG_THUMB2_KERNEL is not set --CONFIG_AEABI=y --# CONFIG_OABI_COMPAT is not set --# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set --# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set --CONFIG_HAVE_ARCH_PFN_VALID=y --CONFIG_HIGHMEM=y --# CONFIG_HIGHPTE is not set --# CONFIG_CPU_SW_DOMAIN_PAN is not set --CONFIG_HW_PERF_EVENTS=y --CONFIG_ARCH_WANT_GENERAL_HUGETLB=y --# CONFIG_ARM_MODULE_PLTS is not set --CONFIG_FLATMEM=y --CONFIG_FLAT_NODE_MEM_MAP=y --CONFIG_HAVE_MEMBLOCK=y --CONFIG_NO_BOOTMEM=y --CONFIG_MEMORY_ISOLATION=y --# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set --CONFIG_SPLIT_PTLOCK_CPUS=4 --CONFIG_COMPACTION=y --CONFIG_MIGRATION=y --# CONFIG_PHYS_ADDR_T_64BIT is not set --CONFIG_ZONE_DMA_FLAG=1 --CONFIG_BOUNCE=y --# CONFIG_KSM is not set --CONFIG_DEFAULT_MMAP_MIN_ADDR=16384 --CONFIG_CLEANCACHE=y --CONFIG_FRONTSWAP=y --CONFIG_CMA=y --# CONFIG_CMA_DEBUG is not set --# CONFIG_CMA_DEBUGFS is not set --CONFIG_CMA_AREAS=7 --# CONFIG_ZSWAP is not set --# CONFIG_ZPOOL is not set --# CONFIG_ZBUD is not set --# CONFIG_ZSMALLOC is not set --# CONFIG_IDLE_PAGE_TRACKING is not set --CONFIG_FRAME_VECTOR=y --CONFIG_FORCE_MAX_ZONEORDER=14 --CONFIG_ALIGNMENT_TRAP=y --# CONFIG_UACCESS_WITH_MEMCPY is not set --# CONFIG_SECCOMP is not set --CONFIG_SWIOTLB=y --CONFIG_IOMMU_HELPER=y --# CONFIG_XEN is not set -- --# --# Boot options --# --CONFIG_USE_OF=y --CONFIG_ATAGS=y --# CONFIG_DEPRECATED_PARAM_STRUCT is not set --CONFIG_ZBOOT_ROM_TEXT=0 --CONFIG_ZBOOT_ROM_BSS=0 --# CONFIG_ARM_APPENDED_DTB is not set --CONFIG_CMDLINE="console=ttymxc0,115200 rw root=/dev/mmcblk0p2 rootwait" --CONFIG_CMDLINE_FROM_BOOTLOADER=y --# CONFIG_CMDLINE_EXTEND is not set --# CONFIG_CMDLINE_FORCE is not set --CONFIG_KEXEC=y --CONFIG_ATAGS_PROC=y --# CONFIG_CRASH_DUMP is not set --CONFIG_AUTO_ZRELADDR=y -- --# --# CPU Power Management --# -- --# --# CPU Frequency scaling --# --CONFIG_CPU_FREQ=y --CONFIG_CPU_FREQ_GOV_COMMON=y --CONFIG_CPU_FREQ_STAT=y --CONFIG_CPU_FREQ_STAT_DETAILS=y --CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y --# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set --# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set --# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set --# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set --CONFIG_CPU_FREQ_GOV_PERFORMANCE=y --CONFIG_CPU_FREQ_GOV_POWERSAVE=y --CONFIG_CPU_FREQ_GOV_USERSPACE=y --CONFIG_CPU_FREQ_GOV_ONDEMAND=y --CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y -- --# --# CPU frequency scaling drivers --# --# CONFIG_CPUFREQ_DT is not set --# CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set --CONFIG_ARM_IMX6Q_CPUFREQ=y --# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set --# CONFIG_QORIQ_CPUFREQ is not set -- --# --# CPU Idle --# --CONFIG_CPU_IDLE=y --# CONFIG_CPU_IDLE_GOV_LADDER is not set --CONFIG_CPU_IDLE_GOV_MENU=y --CONFIG_DT_IDLE_STATES=y -- --# --# ARM CPU Idle Drivers --# --CONFIG_ARM_CPUIDLE=y --# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set -- --# --# Floating point emulation --# -- --# --# At least one emulation must be selected --# --CONFIG_VFP=y --CONFIG_VFPv3=y --CONFIG_NEON=y --CONFIG_KERNEL_MODE_NEON=y -- --# --# Userspace binary formats --# --CONFIG_BINFMT_ELF=y --CONFIG_BINFMT_SCRIPT=y --# CONFIG_HAVE_AOUT is not set --CONFIG_BINFMT_MISC=m --# CONFIG_COREDUMP is not set -- --# --# Power management options --# --CONFIG_SUSPEND=y --CONFIG_SUSPEND_FREEZER=y --# CONFIG_SUSPEND_SKIP_SYNC is not set --# CONFIG_HIBERNATION is not set --CONFIG_PM_SLEEP=y --CONFIG_PM_SLEEP_SMP=y --# CONFIG_PM_AUTOSLEEP is not set --# CONFIG_PM_WAKELOCKS is not set --CONFIG_PM=y --# CONFIG_PM_DEBUG is not set --# CONFIG_APM_EMULATION is not set --CONFIG_PM_OPP=y --CONFIG_PM_CLK=y --CONFIG_PM_GENERIC_DOMAINS=y --# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set --CONFIG_PM_GENERIC_DOMAINS_SLEEP=y --CONFIG_PM_GENERIC_DOMAINS_OF=y --CONFIG_CPU_PM=y --CONFIG_ARCH_SUSPEND_POSSIBLE=y --CONFIG_ARM_CPU_SUSPEND=y --CONFIG_ARCH_HIBERNATION_POSSIBLE=y --CONFIG_NET=y --CONFIG_NET_INGRESS=y -- --# --# Networking options --# --CONFIG_PACKET=y --CONFIG_PACKET_DIAG=y --CONFIG_UNIX=y --CONFIG_UNIX_DIAG=y --CONFIG_XFRM=y --CONFIG_XFRM_ALGO=y --CONFIG_XFRM_USER=y --CONFIG_XFRM_SUB_POLICY=y --CONFIG_XFRM_MIGRATE=y --CONFIG_XFRM_STATISTICS=y --CONFIG_XFRM_IPCOMP=m --CONFIG_NET_KEY=y --CONFIG_NET_KEY_MIGRATE=y --CONFIG_INET=y --CONFIG_IP_MULTICAST=y --CONFIG_IP_ADVANCED_ROUTER=y --# CONFIG_IP_FIB_TRIE_STATS is not set --CONFIG_IP_MULTIPLE_TABLES=y --CONFIG_IP_ROUTE_MULTIPATH=y --CONFIG_IP_ROUTE_VERBOSE=y --CONFIG_IP_ROUTE_CLASSID=y --CONFIG_IP_PNP=y --CONFIG_IP_PNP_DHCP=y --CONFIG_IP_PNP_BOOTP=y --# CONFIG_IP_PNP_RARP is not set --CONFIG_NET_IPIP=m --CONFIG_NET_IPGRE_DEMUX=m --CONFIG_NET_IP_TUNNEL=m --CONFIG_NET_IPGRE=m --CONFIG_NET_IPGRE_BROADCAST=y --CONFIG_IP_MROUTE=y --CONFIG_IP_MROUTE_MULTIPLE_TABLES=y --CONFIG_IP_PIMSM_V1=y --CONFIG_IP_PIMSM_V2=y --CONFIG_SYN_COOKIES=y --CONFIG_NET_IPVTI=m --CONFIG_NET_UDP_TUNNEL=m --# CONFIG_NET_FOU is not set --# CONFIG_NET_FOU_IP_TUNNELS is not set --CONFIG_INET_AH=m --CONFIG_INET_ESP=m --CONFIG_INET_IPCOMP=m --CONFIG_INET_XFRM_TUNNEL=m --CONFIG_INET_TUNNEL=m --CONFIG_INET_XFRM_MODE_TRANSPORT=m --CONFIG_INET_XFRM_MODE_TUNNEL=m --CONFIG_INET_XFRM_MODE_BEET=m --CONFIG_INET_LRO=m --CONFIG_INET_DIAG=y --CONFIG_INET_TCP_DIAG=y --CONFIG_INET_UDP_DIAG=m --CONFIG_TCP_CONG_ADVANCED=y --CONFIG_TCP_CONG_BIC=m --CONFIG_TCP_CONG_CUBIC=m --CONFIG_TCP_CONG_WESTWOOD=m --CONFIG_TCP_CONG_HTCP=m --CONFIG_TCP_CONG_HSTCP=m --CONFIG_TCP_CONG_HYBLA=m --CONFIG_TCP_CONG_VEGAS=y --CONFIG_TCP_CONG_SCALABLE=m --CONFIG_TCP_CONG_LP=m --CONFIG_TCP_CONG_VENO=m --CONFIG_TCP_CONG_YEAH=y --CONFIG_TCP_CONG_ILLINOIS=m --CONFIG_TCP_CONG_DCTCP=m --# CONFIG_TCP_CONG_CDG is not set --CONFIG_DEFAULT_VEGAS=y --# CONFIG_DEFAULT_RENO is not set --CONFIG_DEFAULT_TCP_CONG="vegas" --CONFIG_TCP_MD5SIG=y --CONFIG_IPV6=m --CONFIG_IPV6_ROUTER_PREF=y --CONFIG_IPV6_ROUTE_INFO=y --CONFIG_IPV6_OPTIMISTIC_DAD=y --CONFIG_INET6_AH=m --CONFIG_INET6_ESP=m --CONFIG_INET6_IPCOMP=m --CONFIG_IPV6_MIP6=m --CONFIG_IPV6_ILA=m --CONFIG_INET6_XFRM_TUNNEL=m --CONFIG_INET6_TUNNEL=m --CONFIG_INET6_XFRM_MODE_TRANSPORT=m --CONFIG_INET6_XFRM_MODE_TUNNEL=m --CONFIG_INET6_XFRM_MODE_BEET=m --CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m --CONFIG_IPV6_VTI=m --CONFIG_IPV6_SIT=m --CONFIG_IPV6_SIT_6RD=y --CONFIG_IPV6_NDISC_NODETYPE=y --CONFIG_IPV6_TUNNEL=m --CONFIG_IPV6_GRE=m --CONFIG_IPV6_MULTIPLE_TABLES=y --CONFIG_IPV6_SUBTREES=y --CONFIG_IPV6_MROUTE=y --CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y --CONFIG_IPV6_PIMSM_V2=y --CONFIG_NETWORK_SECMARK=y --CONFIG_NET_PTP_CLASSIFY=y --# CONFIG_NETWORK_PHY_TIMESTAMPING is not set --CONFIG_NETFILTER=y --# CONFIG_NETFILTER_DEBUG is not set --CONFIG_NETFILTER_ADVANCED=y --CONFIG_BRIDGE_NETFILTER=m -- --# --# Core Netfilter Configuration --# --CONFIG_NETFILTER_INGRESS=y --CONFIG_NETFILTER_NETLINK=m --CONFIG_NETFILTER_NETLINK_ACCT=m --CONFIG_NETFILTER_NETLINK_QUEUE=m --CONFIG_NETFILTER_NETLINK_LOG=m --CONFIG_NF_CONNTRACK=m --CONFIG_NF_LOG_COMMON=m --CONFIG_NF_CONNTRACK_MARK=y --CONFIG_NF_CONNTRACK_SECMARK=y --CONFIG_NF_CONNTRACK_ZONES=y --CONFIG_NF_CONNTRACK_PROCFS=y --CONFIG_NF_CONNTRACK_EVENTS=y --CONFIG_NF_CONNTRACK_TIMEOUT=y --CONFIG_NF_CONNTRACK_TIMESTAMP=y --CONFIG_NF_CONNTRACK_LABELS=y --CONFIG_NF_CT_PROTO_DCCP=m --CONFIG_NF_CT_PROTO_GRE=m --CONFIG_NF_CT_PROTO_SCTP=m --CONFIG_NF_CT_PROTO_UDPLITE=m --CONFIG_NF_CONNTRACK_AMANDA=m --CONFIG_NF_CONNTRACK_FTP=m --CONFIG_NF_CONNTRACK_H323=m --CONFIG_NF_CONNTRACK_IRC=m --CONFIG_NF_CONNTRACK_BROADCAST=m --CONFIG_NF_CONNTRACK_NETBIOS_NS=m --CONFIG_NF_CONNTRACK_SNMP=m --CONFIG_NF_CONNTRACK_PPTP=m --CONFIG_NF_CONNTRACK_SANE=m --CONFIG_NF_CONNTRACK_SIP=m --CONFIG_NF_CONNTRACK_TFTP=m --CONFIG_NF_CT_NETLINK=m --CONFIG_NF_CT_NETLINK_TIMEOUT=m --# CONFIG_NETFILTER_NETLINK_GLUE_CT is not set --CONFIG_NF_NAT=m --CONFIG_NF_NAT_NEEDED=y --CONFIG_NF_NAT_PROTO_DCCP=m --CONFIG_NF_NAT_PROTO_UDPLITE=m --CONFIG_NF_NAT_PROTO_SCTP=m --CONFIG_NF_NAT_AMANDA=m --CONFIG_NF_NAT_FTP=m --CONFIG_NF_NAT_IRC=m --CONFIG_NF_NAT_SIP=m --CONFIG_NF_NAT_TFTP=m --CONFIG_NF_NAT_REDIRECT=m --CONFIG_NETFILTER_SYNPROXY=m --CONFIG_NF_TABLES=m --CONFIG_NF_TABLES_INET=m --CONFIG_NF_TABLES_NETDEV=m --CONFIG_NFT_EXTHDR=m --CONFIG_NFT_META=m --CONFIG_NFT_CT=m --CONFIG_NFT_RBTREE=m --CONFIG_NFT_HASH=m --CONFIG_NFT_COUNTER=m --CONFIG_NFT_LOG=m --CONFIG_NFT_LIMIT=m --CONFIG_NFT_MASQ=m --CONFIG_NFT_REDIR=m --CONFIG_NFT_NAT=m --CONFIG_NFT_QUEUE=m --CONFIG_NFT_REJECT=m --CONFIG_NFT_REJECT_INET=m --CONFIG_NFT_COMPAT=m --CONFIG_NETFILTER_XTABLES=m -- --# --# Xtables combined modules --# --CONFIG_NETFILTER_XT_MARK=m --CONFIG_NETFILTER_XT_CONNMARK=m --CONFIG_NETFILTER_XT_SET=m -- --# --# Xtables targets --# --CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m --CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m --CONFIG_NETFILTER_XT_TARGET_CONNMARK=m --CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m --CONFIG_NETFILTER_XT_TARGET_CT=m --CONFIG_NETFILTER_XT_TARGET_DSCP=m --CONFIG_NETFILTER_XT_TARGET_HL=m --CONFIG_NETFILTER_XT_TARGET_HMARK=m --CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m --CONFIG_NETFILTER_XT_TARGET_LED=m --CONFIG_NETFILTER_XT_TARGET_LOG=m --CONFIG_NETFILTER_XT_TARGET_MARK=m --CONFIG_NETFILTER_XT_NAT=m --CONFIG_NETFILTER_XT_TARGET_NETMAP=m --CONFIG_NETFILTER_XT_TARGET_NFLOG=m --CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m --CONFIG_NETFILTER_XT_TARGET_NOTRACK=m --CONFIG_NETFILTER_XT_TARGET_RATEEST=m --CONFIG_NETFILTER_XT_TARGET_REDIRECT=m --CONFIG_NETFILTER_XT_TARGET_TEE=m --CONFIG_NETFILTER_XT_TARGET_TPROXY=m --CONFIG_NETFILTER_XT_TARGET_TRACE=m --CONFIG_NETFILTER_XT_TARGET_SECMARK=m --CONFIG_NETFILTER_XT_TARGET_TCPMSS=m --CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m -- --# --# Xtables matches --# --CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m --CONFIG_NETFILTER_XT_MATCH_BPF=m --CONFIG_NETFILTER_XT_MATCH_CGROUP=m --CONFIG_NETFILTER_XT_MATCH_CLUSTER=m --CONFIG_NETFILTER_XT_MATCH_COMMENT=m --CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m --CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m --CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m --CONFIG_NETFILTER_XT_MATCH_CONNMARK=m --CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m --CONFIG_NETFILTER_XT_MATCH_CPU=m --CONFIG_NETFILTER_XT_MATCH_DCCP=m --CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m --CONFIG_NETFILTER_XT_MATCH_DSCP=m --CONFIG_NETFILTER_XT_MATCH_ECN=m --CONFIG_NETFILTER_XT_MATCH_ESP=m --CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m --CONFIG_NETFILTER_XT_MATCH_HELPER=m --CONFIG_NETFILTER_XT_MATCH_HL=m --CONFIG_NETFILTER_XT_MATCH_IPCOMP=m --CONFIG_NETFILTER_XT_MATCH_IPRANGE=m --CONFIG_NETFILTER_XT_MATCH_IPVS=m --CONFIG_NETFILTER_XT_MATCH_L2TP=m --CONFIG_NETFILTER_XT_MATCH_LENGTH=m --CONFIG_NETFILTER_XT_MATCH_LIMIT=m --CONFIG_NETFILTER_XT_MATCH_MAC=m --CONFIG_NETFILTER_XT_MATCH_MARK=m --CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m --CONFIG_NETFILTER_XT_MATCH_NFACCT=m --CONFIG_NETFILTER_XT_MATCH_OSF=m --CONFIG_NETFILTER_XT_MATCH_OWNER=m --CONFIG_NETFILTER_XT_MATCH_POLICY=m --CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m --CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m --CONFIG_NETFILTER_XT_MATCH_QUOTA=m --CONFIG_NETFILTER_XT_MATCH_RATEEST=m --CONFIG_NETFILTER_XT_MATCH_REALM=m --CONFIG_NETFILTER_XT_MATCH_RECENT=m --CONFIG_NETFILTER_XT_MATCH_SCTP=m --CONFIG_NETFILTER_XT_MATCH_SOCKET=m --CONFIG_NETFILTER_XT_MATCH_STATE=m --CONFIG_NETFILTER_XT_MATCH_STATISTIC=m --CONFIG_NETFILTER_XT_MATCH_STRING=m --CONFIG_NETFILTER_XT_MATCH_TCPMSS=m --CONFIG_NETFILTER_XT_MATCH_TIME=m --CONFIG_NETFILTER_XT_MATCH_U32=m --CONFIG_IP_SET=m --CONFIG_IP_SET_MAX=256 --CONFIG_IP_SET_BITMAP_IP=m --CONFIG_IP_SET_BITMAP_IPMAC=m --CONFIG_IP_SET_BITMAP_PORT=m --CONFIG_IP_SET_HASH_IP=m --CONFIG_IP_SET_HASH_IPMARK=m --CONFIG_IP_SET_HASH_IPPORT=m --CONFIG_IP_SET_HASH_IPPORTIP=m --CONFIG_IP_SET_HASH_IPPORTNET=m --CONFIG_IP_SET_HASH_MAC=m --CONFIG_IP_SET_HASH_NETPORTNET=m --CONFIG_IP_SET_HASH_NET=m --CONFIG_IP_SET_HASH_NETNET=m --CONFIG_IP_SET_HASH_NETPORT=m --CONFIG_IP_SET_HASH_NETIFACE=m --CONFIG_IP_SET_LIST_SET=m --CONFIG_IP_VS=m --CONFIG_IP_VS_IPV6=y --# CONFIG_IP_VS_DEBUG is not set --CONFIG_IP_VS_TAB_BITS=12 -- --# --# IPVS transport protocol load balancing support --# --CONFIG_IP_VS_PROTO_TCP=y --CONFIG_IP_VS_PROTO_UDP=y --CONFIG_IP_VS_PROTO_AH_ESP=y --CONFIG_IP_VS_PROTO_ESP=y --CONFIG_IP_VS_PROTO_AH=y --CONFIG_IP_VS_PROTO_SCTP=y -- --# --# IPVS scheduler --# --CONFIG_IP_VS_RR=m --CONFIG_IP_VS_WRR=m --CONFIG_IP_VS_LC=m --CONFIG_IP_VS_WLC=m --CONFIG_IP_VS_FO=m --CONFIG_IP_VS_OVF=m --CONFIG_IP_VS_LBLC=m --CONFIG_IP_VS_LBLCR=m --CONFIG_IP_VS_DH=m --CONFIG_IP_VS_SH=m --CONFIG_IP_VS_SED=m --CONFIG_IP_VS_NQ=m -- --# --# IPVS SH scheduler --# --CONFIG_IP_VS_SH_TAB_BITS=8 -- --# --# IPVS application helper --# --CONFIG_IP_VS_FTP=m --CONFIG_IP_VS_NFCT=y --CONFIG_IP_VS_PE_SIP=m -- --# --# IP: Netfilter Configuration --# --CONFIG_NF_DEFRAG_IPV4=m --CONFIG_NF_CONNTRACK_IPV4=m --CONFIG_NF_CONNTRACK_PROC_COMPAT=y --CONFIG_NF_TABLES_IPV4=m --CONFIG_NFT_CHAIN_ROUTE_IPV4=m --CONFIG_NFT_REJECT_IPV4=m --CONFIG_NFT_DUP_IPV4=m --CONFIG_NF_TABLES_ARP=m --CONFIG_NF_DUP_IPV4=m --CONFIG_NF_LOG_ARP=m --CONFIG_NF_LOG_IPV4=m --CONFIG_NF_REJECT_IPV4=m --CONFIG_NF_NAT_IPV4=m --CONFIG_NFT_CHAIN_NAT_IPV4=m --CONFIG_NF_NAT_MASQUERADE_IPV4=m --CONFIG_NFT_MASQ_IPV4=m --CONFIG_NFT_REDIR_IPV4=m --CONFIG_NF_NAT_SNMP_BASIC=m --CONFIG_NF_NAT_PROTO_GRE=m --CONFIG_NF_NAT_PPTP=m --CONFIG_NF_NAT_H323=m --CONFIG_IP_NF_IPTABLES=m --CONFIG_IP_NF_MATCH_AH=m --CONFIG_IP_NF_MATCH_ECN=m --CONFIG_IP_NF_MATCH_RPFILTER=m --CONFIG_IP_NF_MATCH_TTL=m --CONFIG_IP_NF_FILTER=m --CONFIG_IP_NF_TARGET_REJECT=m --CONFIG_IP_NF_TARGET_SYNPROXY=m --CONFIG_IP_NF_NAT=m --CONFIG_IP_NF_TARGET_MASQUERADE=m --CONFIG_IP_NF_TARGET_NETMAP=m --CONFIG_IP_NF_TARGET_REDIRECT=m --CONFIG_IP_NF_MANGLE=m --CONFIG_IP_NF_TARGET_CLUSTERIP=m --CONFIG_IP_NF_TARGET_ECN=m --CONFIG_IP_NF_TARGET_TTL=m --CONFIG_IP_NF_RAW=m --CONFIG_IP_NF_ARPTABLES=m --CONFIG_IP_NF_ARPFILTER=m --CONFIG_IP_NF_ARP_MANGLE=m -- --# --# IPv6: Netfilter Configuration --# --CONFIG_NF_DEFRAG_IPV6=m --CONFIG_NF_CONNTRACK_IPV6=m --CONFIG_NF_TABLES_IPV6=m --CONFIG_NFT_CHAIN_ROUTE_IPV6=m --CONFIG_NFT_REJECT_IPV6=m --CONFIG_NFT_DUP_IPV6=m --CONFIG_NF_DUP_IPV6=m --CONFIG_NF_REJECT_IPV6=m --CONFIG_NF_LOG_IPV6=m --CONFIG_NF_NAT_IPV6=m --CONFIG_NFT_CHAIN_NAT_IPV6=m --CONFIG_NF_NAT_MASQUERADE_IPV6=m --CONFIG_NFT_MASQ_IPV6=m --CONFIG_NFT_REDIR_IPV6=m --CONFIG_IP6_NF_IPTABLES=m --CONFIG_IP6_NF_MATCH_AH=m --CONFIG_IP6_NF_MATCH_EUI64=m --CONFIG_IP6_NF_MATCH_FRAG=m --CONFIG_IP6_NF_MATCH_OPTS=m --CONFIG_IP6_NF_MATCH_HL=m --CONFIG_IP6_NF_MATCH_IPV6HEADER=m --CONFIG_IP6_NF_MATCH_MH=m --CONFIG_IP6_NF_MATCH_RPFILTER=m --CONFIG_IP6_NF_MATCH_RT=m --CONFIG_IP6_NF_TARGET_HL=m --CONFIG_IP6_NF_FILTER=m --CONFIG_IP6_NF_TARGET_REJECT=m --CONFIG_IP6_NF_TARGET_SYNPROXY=m --CONFIG_IP6_NF_MANGLE=m --CONFIG_IP6_NF_RAW=m --CONFIG_IP6_NF_NAT=m --CONFIG_IP6_NF_TARGET_MASQUERADE=m --CONFIG_IP6_NF_TARGET_NPT=m --CONFIG_NF_TABLES_BRIDGE=m --CONFIG_NFT_BRIDGE_META=m --CONFIG_NFT_BRIDGE_REJECT=m --CONFIG_NF_LOG_BRIDGE=m --CONFIG_BRIDGE_NF_EBTABLES=m --CONFIG_BRIDGE_EBT_BROUTE=m --CONFIG_BRIDGE_EBT_T_FILTER=m --CONFIG_BRIDGE_EBT_T_NAT=m --CONFIG_BRIDGE_EBT_802_3=m --CONFIG_BRIDGE_EBT_AMONG=m --CONFIG_BRIDGE_EBT_ARP=m --CONFIG_BRIDGE_EBT_IP=m --CONFIG_BRIDGE_EBT_IP6=m --CONFIG_BRIDGE_EBT_LIMIT=m --CONFIG_BRIDGE_EBT_MARK=m --CONFIG_BRIDGE_EBT_PKTTYPE=m --CONFIG_BRIDGE_EBT_STP=m --CONFIG_BRIDGE_EBT_VLAN=m --CONFIG_BRIDGE_EBT_ARPREPLY=m --CONFIG_BRIDGE_EBT_DNAT=m --CONFIG_BRIDGE_EBT_MARK_T=m --CONFIG_BRIDGE_EBT_REDIRECT=m --CONFIG_BRIDGE_EBT_SNAT=m --CONFIG_BRIDGE_EBT_LOG=m --CONFIG_BRIDGE_EBT_NFLOG=m --CONFIG_IP_DCCP=m --CONFIG_INET_DCCP_DIAG=m -- --# --# DCCP CCIDs Configuration --# --# CONFIG_IP_DCCP_CCID2_DEBUG is not set --CONFIG_IP_DCCP_CCID3=y --# CONFIG_IP_DCCP_CCID3_DEBUG is not set --CONFIG_IP_DCCP_TFRC_LIB=y -- --# --# DCCP Kernel Hacking --# --# CONFIG_IP_DCCP_DEBUG is not set --CONFIG_IP_SCTP=m --CONFIG_SCTP_DBG_OBJCNT=y --CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5=y --# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA1 is not set --# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE is not set --CONFIG_SCTP_COOKIE_HMAC_MD5=y --CONFIG_SCTP_COOKIE_HMAC_SHA1=y --CONFIG_RDS=m --# CONFIG_RDS_TCP is not set --# CONFIG_RDS_DEBUG is not set --CONFIG_TIPC=m --CONFIG_TIPC_MEDIA_UDP=y --# CONFIG_ATM is not set --CONFIG_L2TP=m --# CONFIG_L2TP_DEBUGFS is not set --CONFIG_L2TP_V3=y --CONFIG_L2TP_IP=m --CONFIG_L2TP_ETH=m --CONFIG_STP=m --CONFIG_BRIDGE=m --CONFIG_BRIDGE_IGMP_SNOOPING=y --CONFIG_BRIDGE_VLAN_FILTERING=y --CONFIG_HAVE_NET_DSA=y --CONFIG_VLAN_8021Q=m --# CONFIG_VLAN_8021Q_GVRP is not set --# CONFIG_VLAN_8021Q_MVRP is not set --# CONFIG_DECNET is not set --CONFIG_LLC=m --CONFIG_LLC2=m --# CONFIG_IPX is not set --CONFIG_ATALK=m --CONFIG_DEV_APPLETALK=m --CONFIG_IPDDP=m --CONFIG_IPDDP_ENCAP=y --# CONFIG_X25 is not set --# CONFIG_LAPB is not set --# CONFIG_PHONET is not set --# CONFIG_6LOWPAN is not set --# CONFIG_IEEE802154 is not set --CONFIG_NET_SCHED=y -- --# --# Queueing/Scheduling --# --CONFIG_NET_SCH_CBQ=y --CONFIG_NET_SCH_HTB=y --CONFIG_NET_SCH_HFSC=m --CONFIG_NET_SCH_PRIO=y --CONFIG_NET_SCH_MULTIQ=m --CONFIG_NET_SCH_RED=m --CONFIG_NET_SCH_SFB=m --CONFIG_NET_SCH_SFQ=y --CONFIG_NET_SCH_TEQL=m --CONFIG_NET_SCH_TBF=m --CONFIG_NET_SCH_GRED=m --CONFIG_NET_SCH_DSMARK=m --CONFIG_NET_SCH_NETEM=m --CONFIG_NET_SCH_DRR=m --CONFIG_NET_SCH_MQPRIO=m --CONFIG_NET_SCH_CHOKE=m --CONFIG_NET_SCH_QFQ=y --CONFIG_NET_SCH_CODEL=m --CONFIG_NET_SCH_FQ_CODEL=m --CONFIG_NET_SCH_FQ=m --CONFIG_NET_SCH_HHF=m --CONFIG_NET_SCH_PIE=m --CONFIG_NET_SCH_INGRESS=m --CONFIG_NET_SCH_PLUG=m -- --# --# Classification --# --CONFIG_NET_CLS=y --CONFIG_NET_CLS_BASIC=m --CONFIG_NET_CLS_TCINDEX=m --CONFIG_NET_CLS_ROUTE4=m --CONFIG_NET_CLS_FW=m --CONFIG_NET_CLS_U32=m --CONFIG_CLS_U32_PERF=y --CONFIG_CLS_U32_MARK=y --CONFIG_NET_CLS_RSVP=m --CONFIG_NET_CLS_RSVP6=m --CONFIG_NET_CLS_FLOW=m --CONFIG_NET_CLS_CGROUP=m --CONFIG_NET_CLS_BPF=m --CONFIG_NET_CLS_FLOWER=m --CONFIG_NET_EMATCH=y --CONFIG_NET_EMATCH_STACK=32 --CONFIG_NET_EMATCH_CMP=m --CONFIG_NET_EMATCH_NBYTE=m --CONFIG_NET_EMATCH_U32=m --CONFIG_NET_EMATCH_META=m --CONFIG_NET_EMATCH_TEXT=m --CONFIG_NET_EMATCH_CANID=m --CONFIG_NET_EMATCH_IPSET=m --CONFIG_NET_CLS_ACT=y --CONFIG_NET_ACT_POLICE=m --CONFIG_NET_ACT_GACT=m --CONFIG_GACT_PROB=y --CONFIG_NET_ACT_MIRRED=m --CONFIG_NET_ACT_IPT=m --CONFIG_NET_ACT_NAT=m --CONFIG_NET_ACT_PEDIT=m --CONFIG_NET_ACT_SIMP=m --CONFIG_NET_ACT_SKBEDIT=m --CONFIG_NET_ACT_CSUM=m --CONFIG_NET_ACT_VLAN=m --CONFIG_NET_ACT_BPF=m --CONFIG_NET_ACT_CONNMARK=m --CONFIG_NET_CLS_IND=y --CONFIG_NET_SCH_FIFO=y --# CONFIG_DCB is not set --CONFIG_DNS_RESOLVER=y --# CONFIG_BATMAN_ADV is not set --CONFIG_OPENVSWITCH=m --CONFIG_OPENVSWITCH_GRE=m --CONFIG_OPENVSWITCH_VXLAN=m --CONFIG_VSOCKETS=m --CONFIG_NETLINK_MMAP=y --CONFIG_NETLINK_DIAG=m --CONFIG_MPLS=y --CONFIG_NET_MPLS_GSO=m --# CONFIG_MPLS_ROUTING is not set --# CONFIG_HSR is not set --# CONFIG_NET_SWITCHDEV is not set --# CONFIG_NET_L3_MASTER_DEV is not set --CONFIG_RPS=y --CONFIG_RFS_ACCEL=y --CONFIG_XPS=y --CONFIG_CGROUP_NET_PRIO=y --CONFIG_CGROUP_NET_CLASSID=y --CONFIG_NET_RX_BUSY_POLL=y --CONFIG_BQL=y --# CONFIG_BPF_JIT is not set --CONFIG_NET_FLOW_LIMIT=y -- --# --# Network testing --# --# CONFIG_NET_PKTGEN is not set --# CONFIG_NET_DROP_MONITOR is not set --# CONFIG_HAMRADIO is not set --CONFIG_CAN=m --CONFIG_CAN_RAW=m --CONFIG_CAN_BCM=m --CONFIG_CAN_GW=m -- --# --# CAN Device Drivers --# --# CONFIG_CAN_VCAN is not set --# CONFIG_CAN_SLCAN is not set --CONFIG_CAN_DEV=m --CONFIG_CAN_CALC_BITTIMING=y --# CONFIG_CAN_LEDS is not set --# CONFIG_CAN_TI_HECC is not set --CONFIG_CAN_FLEXCAN=m --# CONFIG_CAN_GRCAN is not set --# CONFIG_CAN_RCAR is not set --# CONFIG_CAN_SJA1000 is not set --# CONFIG_CAN_C_CAN is not set --# CONFIG_CAN_M_CAN is not set --# CONFIG_CAN_CC770 is not set -- --# --# CAN SPI interfaces --# --# CONFIG_CAN_MCP251X is not set -- --# --# CAN USB interfaces --# --CONFIG_CAN_EMS_USB=m --CONFIG_CAN_ESD_USB2=m --CONFIG_CAN_GS_USB=m --CONFIG_CAN_KVASER_USB=m --CONFIG_CAN_PEAK_USB=m --CONFIG_CAN_8DEV_USB=m --# CONFIG_CAN_SOFTING is not set --# CONFIG_CAN_DEBUG_DEVICES is not set --CONFIG_IRDA=m -- --# --# IrDA protocols --# --CONFIG_IRLAN=m --CONFIG_IRNET=m --CONFIG_IRCOMM=m --CONFIG_IRDA_ULTRA=y -- --# --# IrDA options --# --# CONFIG_IRDA_CACHE_LAST_LSAP is not set --CONFIG_IRDA_FAST_RR=y --# CONFIG_IRDA_DEBUG is not set -- --# --# Infrared-port device drivers --# -- --# --# SIR device drivers --# --CONFIG_IRTTY_SIR=m -- --# --# Dongle support --# --CONFIG_DONGLE=y --CONFIG_ESI_DONGLE=m --CONFIG_ACTISYS_DONGLE=m --CONFIG_TEKRAM_DONGLE=m --CONFIG_TOIM3232_DONGLE=m --CONFIG_LITELINK_DONGLE=m --CONFIG_MA600_DONGLE=m --CONFIG_GIRBIL_DONGLE=m --CONFIG_MCP2120_DONGLE=m --CONFIG_OLD_BELKIN_DONGLE=m --CONFIG_ACT200L_DONGLE=m --CONFIG_KINGSUN_DONGLE=m --CONFIG_KSDAZZLE_DONGLE=m --CONFIG_KS959_DONGLE=m -- --# --# FIR device drivers --# --CONFIG_USB_IRDA=m --CONFIG_SIGMATEL_FIR=m --CONFIG_VLSI_FIR=m --CONFIG_MCS_FIR=m --CONFIG_BT=y --CONFIG_BT_BREDR=y --CONFIG_BT_RFCOMM=m --CONFIG_BT_RFCOMM_TTY=y --CONFIG_BT_BNEP=m --CONFIG_BT_BNEP_MC_FILTER=y --CONFIG_BT_BNEP_PROTO_FILTER=y --CONFIG_BT_CMTP=m --CONFIG_BT_HIDP=y --CONFIG_BT_HS=y --CONFIG_BT_LE=y --# CONFIG_BT_SELFTEST is not set --# CONFIG_BT_DEBUGFS is not set -- --# --# Bluetooth device drivers --# --CONFIG_BT_INTEL=y --CONFIG_BT_BCM=y --CONFIG_BT_RTL=m --CONFIG_BT_QCA=y --CONFIG_BT_HCIBTUSB=m --CONFIG_BT_HCIBTUSB_BCM=y --CONFIG_BT_HCIBTUSB_RTL=y --# CONFIG_BT_HCIBTSDIO is not set --CONFIG_BT_HCIUART=y --CONFIG_BT_HCIUART_H4=y --CONFIG_BT_HCIUART_BCSP=y --CONFIG_BT_HCIUART_ATH3K=y --CONFIG_BT_HCIUART_LL=y --CONFIG_BT_HCIUART_3WIRE=y --CONFIG_BT_HCIUART_INTEL=y --CONFIG_BT_HCIUART_BCM=y --CONFIG_BT_HCIUART_QCA=y --CONFIG_BT_HCIBCM203X=m --CONFIG_BT_HCIBPA10X=m --CONFIG_BT_HCIBFUSB=m --CONFIG_BT_HCIVHCI=m --CONFIG_BT_MRVL=m --CONFIG_BT_MRVL_SDIO=m --CONFIG_BT_ATH3K=m --CONFIG_BT_WILINK=m --CONFIG_AF_RXRPC=m --# CONFIG_AF_RXRPC_DEBUG is not set --# CONFIG_RXKAD is not set --CONFIG_FIB_RULES=y --CONFIG_WIRELESS=y --CONFIG_WIRELESS_EXT=y --CONFIG_WEXT_CORE=y --CONFIG_WEXT_PROC=y --CONFIG_WEXT_SPY=y --CONFIG_WEXT_PRIV=y --CONFIG_CFG80211=m --# CONFIG_NL80211_TESTMODE is not set --# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set --# CONFIG_CFG80211_REG_DEBUG is not set --# CONFIG_CFG80211_CERTIFICATION_ONUS is not set --# CONFIG_CFG80211_DEFAULT_PS is not set --# CONFIG_CFG80211_DEBUGFS is not set --# CONFIG_CFG80211_INTERNAL_REGDB is not set --CONFIG_CFG80211_CRDA_SUPPORT=y --CONFIG_CFG80211_WEXT=y --CONFIG_CFG80211_WEXT_EXPORT=y --CONFIG_LIB80211=m --CONFIG_LIB80211_CRYPT_WEP=m --CONFIG_LIB80211_CRYPT_CCMP=m --CONFIG_LIB80211_CRYPT_TKIP=m --# CONFIG_LIB80211_DEBUG is not set --CONFIG_MAC80211=m --CONFIG_MAC80211_HAS_RC=y --CONFIG_MAC80211_RC_MINSTREL=y --CONFIG_MAC80211_RC_MINSTREL_HT=y --CONFIG_MAC80211_RC_MINSTREL_VHT=y --CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y --CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" --CONFIG_MAC80211_MESH=y --CONFIG_MAC80211_LEDS=y --# CONFIG_MAC80211_DEBUGFS is not set --# CONFIG_MAC80211_MESSAGE_TRACING is not set --# CONFIG_MAC80211_DEBUG_MENU is not set --CONFIG_MAC80211_STA_HASH_MAX_SIZE=0 --# CONFIG_WIMAX is not set --CONFIG_RFKILL=y --CONFIG_RFKILL_LEDS=y --CONFIG_RFKILL_INPUT=y --CONFIG_RFKILL_REGULATOR=y --CONFIG_RFKILL_GPIO=y --# CONFIG_NET_9P is not set --CONFIG_CAIF=m --# CONFIG_CAIF_DEBUG is not set --CONFIG_CAIF_NETDEV=m --CONFIG_CAIF_USB=m --CONFIG_CEPH_LIB=m --# CONFIG_CEPH_LIB_PRETTYDEBUG is not set --CONFIG_CEPH_LIB_USE_DNS_RESOLVER=y --CONFIG_NFC=m --# CONFIG_NFC_DIGITAL is not set --# CONFIG_NFC_NCI is not set --# CONFIG_NFC_HCI is not set -- --# --# Near Field Communication (NFC) devices --# --# CONFIG_NFC_PN533 is not set --# CONFIG_NFC_SIM is not set --CONFIG_LWTUNNEL=y --CONFIG_HAVE_BPF_JIT=y -- --# --# Device Drivers --# -- --# --# Generic Driver Options --# --CONFIG_UEVENT_HELPER=y --CONFIG_UEVENT_HELPER_PATH="" --CONFIG_DEVTMPFS=y --CONFIG_DEVTMPFS_MOUNT=y --# CONFIG_STANDALONE is not set --# CONFIG_PREVENT_FIRMWARE_BUILD is not set --CONFIG_FW_LOADER=y --CONFIG_FIRMWARE_IN_KERNEL=y --CONFIG_EXTRA_FIRMWARE="" --CONFIG_FW_LOADER_USER_HELPER=y --CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y --CONFIG_WANT_DEV_COREDUMP=y --CONFIG_ALLOW_DEV_COREDUMP=y --CONFIG_DEV_COREDUMP=y --# CONFIG_DEBUG_DRIVER is not set --# CONFIG_DEBUG_DEVRES is not set --# CONFIG_SYS_HYPERVISOR is not set --# CONFIG_GENERIC_CPU_DEVICES is not set --CONFIG_SOC_BUS=y --CONFIG_REGMAP=y --CONFIG_REGMAP_I2C=y --CONFIG_REGMAP_SPI=y --CONFIG_REGMAP_MMIO=y --CONFIG_REGMAP_IRQ=y --CONFIG_DMA_SHARED_BUFFER=y --# CONFIG_FENCE_TRACE is not set --CONFIG_DMA_CMA=y -- --# --# Default contiguous memory area size: --# --CONFIG_CMA_SIZE_MBYTES=288 --CONFIG_CMA_SIZE_SEL_MBYTES=y --# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set --# CONFIG_CMA_SIZE_SEL_MIN is not set --# CONFIG_CMA_SIZE_SEL_MAX is not set --CONFIG_CMA_ALIGNMENT=8 -- --# --# Bus devices --# --# CONFIG_ARM_CCI400_PMU is not set --# CONFIG_ARM_CCI500_PMU is not set --# CONFIG_ARM_CCN is not set --# CONFIG_BRCMSTB_GISB_ARB is not set --CONFIG_IMX_WEIM=y --# CONFIG_VEXPRESS_CONFIG is not set --CONFIG_CONNECTOR=y --CONFIG_PROC_EVENTS=y --CONFIG_MTD=y --# CONFIG_MTD_TESTS is not set --# CONFIG_MTD_REDBOOT_PARTS is not set --CONFIG_MTD_CMDLINE_PARTS=y --# CONFIG_MTD_AFS_PARTS is not set --CONFIG_MTD_OF_PARTS=y --# CONFIG_MTD_AR7_PARTS is not set -- --# --# User Modules And Translation Layers --# --CONFIG_MTD_BLKDEVS=y --CONFIG_MTD_BLOCK=y --# CONFIG_FTL is not set --# CONFIG_NFTL is not set --# CONFIG_INFTL is not set --# CONFIG_RFD_FTL is not set --# CONFIG_SSFDC is not set --# CONFIG_SM_FTL is not set --# CONFIG_MTD_OOPS is not set --# CONFIG_MTD_SWAP is not set --# CONFIG_MTD_PARTITIONED_MASTER is not set -- --# --# RAM/ROM/Flash chip drivers --# --CONFIG_MTD_CFI=y --CONFIG_MTD_JEDECPROBE=y --CONFIG_MTD_GEN_PROBE=y --# CONFIG_MTD_CFI_ADV_OPTIONS is not set --CONFIG_MTD_MAP_BANK_WIDTH_1=y --CONFIG_MTD_MAP_BANK_WIDTH_2=y --CONFIG_MTD_MAP_BANK_WIDTH_4=y --# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set --# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set --# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set --CONFIG_MTD_CFI_I1=y --CONFIG_MTD_CFI_I2=y --# CONFIG_MTD_CFI_I4 is not set --# CONFIG_MTD_CFI_I8 is not set --CONFIG_MTD_CFI_INTELEXT=y --CONFIG_MTD_CFI_AMDSTD=y --CONFIG_MTD_CFI_STAA=y --CONFIG_MTD_CFI_UTIL=y --# CONFIG_MTD_RAM is not set --# CONFIG_MTD_ROM is not set --# CONFIG_MTD_ABSENT is not set -- --# --# Mapping drivers for chip access --# --# CONFIG_MTD_COMPLEX_MAPPINGS is not set --# CONFIG_MTD_PHYSMAP is not set --CONFIG_MTD_PHYSMAP_OF=y --# CONFIG_MTD_IMPA7 is not set --# CONFIG_MTD_INTEL_VR_NOR is not set --# CONFIG_MTD_PLATRAM is not set -- --# --# Self-contained MTD device drivers --# --# CONFIG_MTD_PMC551 is not set --CONFIG_MTD_DATAFLASH=y --# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set --# CONFIG_MTD_DATAFLASH_OTP is not set --# CONFIG_MTD_M25P80 is not set --CONFIG_MTD_SST25L=y --# CONFIG_MTD_SLRAM is not set --# CONFIG_MTD_PHRAM is not set --# CONFIG_MTD_MTDRAM is not set --# CONFIG_MTD_BLOCK2MTD is not set -- --# --# Disk-On-Chip Device Drivers --# --# CONFIG_MTD_DOCG3 is not set --CONFIG_MTD_NAND_ECC=y --# CONFIG_MTD_NAND_ECC_SMC is not set --CONFIG_MTD_NAND=y --# CONFIG_MTD_NAND_ECC_BCH is not set --# CONFIG_MTD_SM_COMMON is not set --# CONFIG_MTD_NAND_DENALI_PCI is not set --# CONFIG_MTD_NAND_DENALI_DT is not set --# CONFIG_MTD_NAND_GPIO is not set --# CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set --CONFIG_MTD_NAND_IDS=y --# CONFIG_MTD_NAND_RICOH is not set --# CONFIG_MTD_NAND_DISKONCHIP is not set --# CONFIG_MTD_NAND_DOCG4 is not set --# CONFIG_MTD_NAND_CAFE is not set --# CONFIG_MTD_NAND_NANDSIM is not set --# CONFIG_MTD_NAND_GPMI_NAND is not set --# CONFIG_MTD_NAND_BRCMNAND is not set --# CONFIG_MTD_NAND_PLATFORM is not set --CONFIG_MTD_NAND_MXC=y --# CONFIG_MTD_NAND_HISI504 is not set --# CONFIG_MTD_ONENAND is not set -- --# --# LPDDR & LPDDR2 PCM memory drivers --# --# CONFIG_MTD_LPDDR is not set --# CONFIG_MTD_LPDDR2_NVM is not set --CONFIG_MTD_SPI_NOR=m --CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y --CONFIG_SPI_FSL_QUADSPI=m --CONFIG_MTD_UBI=y --CONFIG_MTD_UBI_WL_THRESHOLD=4096 --CONFIG_MTD_UBI_BEB_LIMIT=20 --# CONFIG_MTD_UBI_FASTMAP is not set --# CONFIG_MTD_UBI_GLUEBI is not set --# CONFIG_MTD_UBI_BLOCK is not set --CONFIG_DTC=y --CONFIG_OF=y --# CONFIG_OF_UNITTEST is not set --CONFIG_OF_FLATTREE=y --CONFIG_OF_EARLY_FLATTREE=y --CONFIG_OF_ADDRESS=y --CONFIG_OF_ADDRESS_PCI=y --CONFIG_OF_IRQ=y --CONFIG_OF_NET=y --CONFIG_OF_MDIO=y --CONFIG_OF_PCI=y --CONFIG_OF_PCI_IRQ=y --CONFIG_OF_MTD=y --CONFIG_OF_RESERVED_MEM=y --# CONFIG_OF_OVERLAY is not set --CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y --# CONFIG_PARPORT is not set --CONFIG_BLK_DEV=y --# CONFIG_BLK_DEV_NULL_BLK is not set --# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set --# CONFIG_BLK_CPQ_CISS_DA is not set --# CONFIG_BLK_DEV_DAC960 is not set --# CONFIG_BLK_DEV_UMEM is not set --# CONFIG_BLK_DEV_COW_COMMON is not set --CONFIG_BLK_DEV_LOOP=m --CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 --CONFIG_BLK_DEV_CRYPTOLOOP=m --# CONFIG_BLK_DEV_DRBD is not set --# CONFIG_BLK_DEV_NBD is not set --# CONFIG_BLK_DEV_SX8 is not set --CONFIG_BLK_DEV_RAM=m --CONFIG_BLK_DEV_RAM_COUNT=16 --CONFIG_BLK_DEV_RAM_SIZE=65536 --CONFIG_CDROM_PKTCDVD=m --CONFIG_CDROM_PKTCDVD_BUFFERS=8 --# CONFIG_CDROM_PKTCDVD_WCACHE is not set --# CONFIG_ATA_OVER_ETH is not set --CONFIG_MG_DISK=y --CONFIG_MG_DISK_RES=0 --# CONFIG_BLK_DEV_RBD is not set --# CONFIG_BLK_DEV_RSXX is not set --# CONFIG_BLK_DEV_NVME is not set -- --# --# Misc devices --# --# CONFIG_SENSORS_LIS3LV02D is not set --# CONFIG_AD525X_DPOT is not set --# CONFIG_DUMMY_IRQ is not set --CONFIG_HWLAT_DETECTOR=m --# CONFIG_PHANTOM is not set --# CONFIG_SGI_IOC4 is not set --CONFIG_TIFM_CORE=y --CONFIG_TIFM_7XX1=y --# CONFIG_ICS932S401 is not set --CONFIG_ENCLOSURE_SERVICES=y --# CONFIG_HP_ILO is not set --# CONFIG_APDS9802ALS is not set --# CONFIG_ISL29003 is not set --# CONFIG_ISL29020 is not set --# CONFIG_SENSORS_TSL2550 is not set --# CONFIG_SENSORS_BH1780 is not set --# CONFIG_SENSORS_BH1770 is not set --# CONFIG_SENSORS_APDS990X is not set --# CONFIG_HMC6352 is not set --# CONFIG_DS1682 is not set --# CONFIG_TI_DAC7512 is not set --# CONFIG_BMP085_I2C is not set --# CONFIG_BMP085_SPI is not set --# CONFIG_USB_SWITCH_FSA9480 is not set --# CONFIG_LATTICE_ECP3_CONFIG is not set --CONFIG_SRAM=y --# CONFIG_C2PORT is not set -- --# --# EEPROM support --# --CONFIG_EEPROM_AT24=y --CONFIG_EEPROM_AT25=y --# CONFIG_EEPROM_LEGACY is not set --CONFIG_EEPROM_MAX6875=y --CONFIG_EEPROM_93CX6=m --# CONFIG_EEPROM_93XX46 is not set --CONFIG_CB710_CORE=y --# CONFIG_CB710_DEBUG is not set --CONFIG_CB710_DEBUG_ASSUMPTIONS=y -- --# --# Texas Instruments shared transport line discipline --# --CONFIG_TI_ST=m --# CONFIG_SENSORS_LIS3_SPI is not set --# CONFIG_SENSORS_LIS3_I2C is not set -- --# --# Altera FPGA firmware download module --# --CONFIG_ALTERA_STAPL=m -- --# --# Intel MIC Bus Driver --# -- --# --# SCIF Bus Driver --# -- --# --# Intel MIC Host Driver --# -- --# --# Intel MIC Card Driver --# -- --# --# SCIF Driver --# -- --# --# Intel MIC Coprocessor State Management (COSM) Drivers --# --CONFIG_ECHO=m --# CONFIG_CXL_BASE is not set --# CONFIG_CXL_KERNEL_API is not set --# CONFIG_CXL_EEH is not set --CONFIG_HAVE_IDE=y --# CONFIG_IDE is not set -- --# --# SCSI device support --# --CONFIG_SCSI_MOD=y --# CONFIG_RAID_ATTRS is not set --CONFIG_SCSI=y --CONFIG_SCSI_DMA=y --CONFIG_SCSI_NETLINK=y --# CONFIG_SCSI_MQ_DEFAULT is not set --CONFIG_SCSI_PROC_FS=y -- --# --# SCSI support type (disk, tape, CD-ROM) --# --CONFIG_BLK_DEV_SD=y --# CONFIG_CHR_DEV_ST is not set --# CONFIG_CHR_DEV_OSST is not set --CONFIG_BLK_DEV_SR=y --CONFIG_BLK_DEV_SR_VENDOR=y --CONFIG_CHR_DEV_SG=y --CONFIG_CHR_DEV_SCH=y --CONFIG_SCSI_ENCLOSURE=y --# CONFIG_SCSI_CONSTANTS is not set --CONFIG_SCSI_LOGGING=y --CONFIG_SCSI_SCAN_ASYNC=y -- --# --# SCSI Transports --# --# CONFIG_SCSI_SPI_ATTRS is not set --CONFIG_SCSI_FC_ATTRS=m --CONFIG_SCSI_ISCSI_ATTRS=m --# CONFIG_SCSI_SAS_ATTRS is not set --# CONFIG_SCSI_SAS_LIBSAS is not set --# CONFIG_SCSI_SRP_ATTRS is not set --CONFIG_SCSI_LOWLEVEL=y --CONFIG_ISCSI_TCP=m --CONFIG_ISCSI_BOOT_SYSFS=m --# CONFIG_SCSI_CXGB3_ISCSI is not set --# CONFIG_SCSI_CXGB4_ISCSI is not set --# CONFIG_SCSI_BNX2_ISCSI is not set --# CONFIG_SCSI_BNX2X_FCOE is not set --# CONFIG_BE2ISCSI is not set --# CONFIG_BLK_DEV_3W_XXXX_RAID is not set --# CONFIG_SCSI_HPSA is not set --# CONFIG_SCSI_3W_9XXX is not set --# CONFIG_SCSI_3W_SAS is not set --# CONFIG_SCSI_ACARD is not set --# CONFIG_SCSI_AACRAID is not set --# CONFIG_SCSI_AIC7XXX is not set --# CONFIG_SCSI_AIC79XX is not set --# CONFIG_SCSI_AIC94XX is not set --# CONFIG_SCSI_MVSAS is not set --# CONFIG_SCSI_MVUMI is not set --# CONFIG_SCSI_ADVANSYS is not set --# CONFIG_SCSI_ARCMSR is not set --# CONFIG_SCSI_ESAS2R is not set --# CONFIG_MEGARAID_NEWGEN is not set --# CONFIG_MEGARAID_LEGACY is not set --# CONFIG_MEGARAID_SAS is not set --# CONFIG_SCSI_MPT3SAS is not set --# CONFIG_SCSI_MPT2SAS is not set --CONFIG_SCSI_UFSHCD=m --# CONFIG_SCSI_UFSHCD_PCI is not set --CONFIG_SCSI_UFSHCD_PLATFORM=m --# CONFIG_SCSI_HPTIOP is not set --CONFIG_LIBFC=m --CONFIG_LIBFCOE=m --# CONFIG_FCOE is not set --# CONFIG_SCSI_SNIC is not set --# CONFIG_SCSI_DMX3191D is not set --# CONFIG_SCSI_FUTURE_DOMAIN is not set --# CONFIG_SCSI_IPS is not set --# CONFIG_SCSI_INITIO is not set --# CONFIG_SCSI_INIA100 is not set --# CONFIG_SCSI_STEX is not set --# CONFIG_SCSI_SYM53C8XX_2 is not set --# CONFIG_SCSI_IPR is not set --# CONFIG_SCSI_QLOGIC_1280 is not set --# CONFIG_SCSI_QLA_FC is not set --# CONFIG_SCSI_QLA_ISCSI is not set --# CONFIG_SCSI_LPFC is not set --# CONFIG_SCSI_DC395x is not set --# CONFIG_SCSI_AM53C974 is not set --# CONFIG_SCSI_NSP32 is not set --# CONFIG_SCSI_WD719X is not set --# CONFIG_SCSI_DEBUG is not set --# CONFIG_SCSI_PMCRAID is not set --# CONFIG_SCSI_PM8001 is not set --# CONFIG_SCSI_BFA_FC is not set --# CONFIG_SCSI_CHELSIO_FCOE is not set --# CONFIG_SCSI_DH is not set --CONFIG_SCSI_OSD_INITIATOR=m --# CONFIG_SCSI_OSD_ULD is not set --CONFIG_SCSI_OSD_DPRINT_SENSE=1 --# CONFIG_SCSI_OSD_DEBUG is not set --CONFIG_ATA=y --# CONFIG_ATA_NONSTANDARD is not set --# CONFIG_ATA_VERBOSE_ERROR is not set --CONFIG_SATA_PMP=y -- --# --# Controllers with non-SFF native interface --# --CONFIG_SATA_AHCI=y --CONFIG_SATA_AHCI_PLATFORM=y --CONFIG_AHCI_IMX=y --# CONFIG_AHCI_CEVA is not set --# CONFIG_AHCI_QORIQ is not set --# CONFIG_SATA_INIC162X is not set --# CONFIG_SATA_ACARD_AHCI is not set --# CONFIG_SATA_SIL24 is not set --CONFIG_ATA_SFF=y -- --# --# SFF controllers with custom DMA interface --# --# CONFIG_PDC_ADMA is not set --# CONFIG_SATA_QSTOR is not set --# CONFIG_SATA_SX4 is not set --CONFIG_ATA_BMDMA=y -- --# --# SATA SFF controllers with BMDMA --# --# CONFIG_ATA_PIIX is not set --# CONFIG_SATA_MV is not set --# CONFIG_SATA_NV is not set --# CONFIG_SATA_PROMISE is not set --# CONFIG_SATA_SIL is not set --# CONFIG_SATA_SIS is not set --# CONFIG_SATA_SVW is not set --# CONFIG_SATA_ULI is not set --# CONFIG_SATA_VIA is not set --# CONFIG_SATA_VITESSE is not set -- --# --# PATA SFF controllers with BMDMA --# --# CONFIG_PATA_ALI is not set --# CONFIG_PATA_AMD is not set --# CONFIG_PATA_ARTOP is not set --# CONFIG_PATA_ATIIXP is not set --# CONFIG_PATA_ATP867X is not set --# CONFIG_PATA_CMD64X is not set --# CONFIG_PATA_CYPRESS is not set --# CONFIG_PATA_EFAR is not set --# CONFIG_PATA_HPT366 is not set --# CONFIG_PATA_HPT37X is not set --# CONFIG_PATA_HPT3X2N is not set --# CONFIG_PATA_HPT3X3 is not set --CONFIG_PATA_IMX=y --# CONFIG_PATA_IT8213 is not set --# CONFIG_PATA_IT821X is not set --# CONFIG_PATA_JMICRON is not set --# CONFIG_PATA_MARVELL is not set --# CONFIG_PATA_NETCELL is not set --# CONFIG_PATA_NINJA32 is not set --# CONFIG_PATA_NS87415 is not set --# CONFIG_PATA_OLDPIIX is not set --# CONFIG_PATA_OPTIDMA is not set --# CONFIG_PATA_PDC2027X is not set --# CONFIG_PATA_PDC_OLD is not set --# CONFIG_PATA_RADISYS is not set --# CONFIG_PATA_RDC is not set --# CONFIG_PATA_SCH is not set --# CONFIG_PATA_SERVERWORKS is not set --# CONFIG_PATA_SIL680 is not set --# CONFIG_PATA_SIS is not set --# CONFIG_PATA_TOSHIBA is not set --# CONFIG_PATA_TRIFLEX is not set --# CONFIG_PATA_VIA is not set --# CONFIG_PATA_WINBOND is not set -- --# --# PIO-only SFF controllers --# --# CONFIG_PATA_CMD640_PCI is not set --# CONFIG_PATA_MPIIX is not set --# CONFIG_PATA_NS87410 is not set --# CONFIG_PATA_OPTI is not set --# CONFIG_PATA_PLATFORM is not set --# CONFIG_PATA_RZ1000 is not set -- --# --# Generic fallback / legacy drivers --# --# CONFIG_ATA_GENERIC is not set --# CONFIG_PATA_LEGACY is not set --CONFIG_MD=y --CONFIG_BLK_DEV_MD=y --CONFIG_MD_AUTODETECT=y --CONFIG_MD_LINEAR=y --CONFIG_MD_RAID0=y --CONFIG_MD_RAID1=y --CONFIG_MD_RAID10=y --CONFIG_MD_RAID456=m --CONFIG_MD_MULTIPATH=m --CONFIG_MD_FAULTY=m --# CONFIG_MD_CLUSTER is not set --CONFIG_BCACHE=m --# CONFIG_BCACHE_DEBUG is not set --# CONFIG_BCACHE_CLOSURES_DEBUG is not set --CONFIG_BLK_DEV_DM_BUILTIN=y --CONFIG_BLK_DEV_DM=m --# CONFIG_DM_MQ_DEFAULT is not set --# CONFIG_DM_DEBUG is not set --CONFIG_DM_BUFIO=m --CONFIG_DM_BIO_PRISON=m --CONFIG_DM_PERSISTENT_DATA=m --# CONFIG_DM_DEBUG_BLOCK_STACK_TRACING is not set --CONFIG_DM_CRYPT=m --CONFIG_DM_SNAPSHOT=m --CONFIG_DM_THIN_PROVISIONING=m --CONFIG_DM_CACHE=m --CONFIG_DM_CACHE_MQ=m --CONFIG_DM_CACHE_SMQ=m --CONFIG_DM_CACHE_CLEANER=m --# CONFIG_DM_ERA is not set --CONFIG_DM_MIRROR=m --CONFIG_DM_LOG_USERSPACE=m --CONFIG_DM_RAID=m --CONFIG_DM_ZERO=m --CONFIG_DM_MULTIPATH=m --CONFIG_DM_MULTIPATH_QL=m --CONFIG_DM_MULTIPATH_ST=m --CONFIG_DM_DELAY=m --CONFIG_DM_UEVENT=y --CONFIG_DM_FLAKEY=m --CONFIG_DM_VERITY=m --# CONFIG_DM_SWITCH is not set --# CONFIG_DM_LOG_WRITES is not set --# CONFIG_TARGET_CORE is not set --# CONFIG_FUSION is not set -- --# --# IEEE 1394 (FireWire) support --# --# CONFIG_FIREWIRE is not set --# CONFIG_FIREWIRE_NOSY is not set --CONFIG_NETDEVICES=y --CONFIG_MII=y --CONFIG_NET_CORE=y --CONFIG_BONDING=m --CONFIG_DUMMY=m --# CONFIG_EQUALIZER is not set --# CONFIG_NET_FC is not set --# CONFIG_IFB is not set --CONFIG_NET_TEAM=m --CONFIG_NET_TEAM_MODE_BROADCAST=m --CONFIG_NET_TEAM_MODE_ROUNDROBIN=m --CONFIG_NET_TEAM_MODE_RANDOM=m --CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m --CONFIG_NET_TEAM_MODE_LOADBALANCE=m --CONFIG_MACVLAN=m --CONFIG_MACVTAP=m --CONFIG_IPVLAN=m --CONFIG_VXLAN=m --# CONFIG_GENEVE is not set --CONFIG_NETCONSOLE=m --CONFIG_NETCONSOLE_DYNAMIC=y --CONFIG_NETPOLL=y --CONFIG_NET_POLL_CONTROLLER=y --CONFIG_TUN=m --# CONFIG_TUN_VNET_CROSS_LE is not set --CONFIG_VETH=m --CONFIG_NLMON=m --# CONFIG_ARCNET is not set -- --# --# CAIF transport drivers --# --# CONFIG_CAIF_TTY is not set --# CONFIG_CAIF_SPI_SLAVE is not set --# CONFIG_CAIF_HSI is not set --# CONFIG_CAIF_VIRTIO is not set -- --# --# Distributed Switch Architecture drivers --# --# CONFIG_NET_DSA_MV88E6XXX is not set --# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set --CONFIG_ETHERNET=y --CONFIG_MDIO=y --# CONFIG_NET_VENDOR_3COM is not set --# CONFIG_NET_VENDOR_ADAPTEC is not set --# CONFIG_NET_VENDOR_AGERE is not set --# CONFIG_NET_VENDOR_ALTEON is not set --# CONFIG_ALTERA_TSE is not set --# CONFIG_NET_VENDOR_AMD is not set --# CONFIG_NET_VENDOR_ARC is not set --CONFIG_NET_VENDOR_ATHEROS=y --CONFIG_ATL2=y --CONFIG_ATL1=y --CONFIG_ATL1E=y --CONFIG_ATL1C=y --CONFIG_ALX=y --# CONFIG_NET_VENDOR_AURORA is not set --# CONFIG_NET_CADENCE is not set --# CONFIG_NET_VENDOR_BROADCOM is not set --# CONFIG_NET_VENDOR_BROCADE is not set --# CONFIG_NET_VENDOR_CAVIUM is not set --# CONFIG_NET_VENDOR_CHELSIO is not set --# CONFIG_NET_VENDOR_CIRRUS is not set --# CONFIG_NET_VENDOR_CISCO is not set --# CONFIG_DM9000 is not set --# CONFIG_DNET is not set --# CONFIG_NET_VENDOR_DEC is not set --# CONFIG_NET_VENDOR_DLINK is not set --# CONFIG_NET_VENDOR_EMULEX is not set --# CONFIG_NET_VENDOR_EZCHIP is not set --# CONFIG_NET_VENDOR_EXAR is not set --# CONFIG_NET_VENDOR_FARADAY is not set --CONFIG_NET_VENDOR_FREESCALE=y --CONFIG_FEC=y --CONFIG_FSL_PQ_MDIO=y --CONFIG_FSL_XGMAC_MDIO=y --CONFIG_GIANFAR=y --# CONFIG_NET_VENDOR_HISILICON is not set --# CONFIG_NET_VENDOR_HP is not set --# CONFIG_NET_VENDOR_INTEL is not set --# CONFIG_JME is not set --# CONFIG_NET_VENDOR_MARVELL is not set --# CONFIG_NET_VENDOR_MELLANOX is not set --# CONFIG_NET_VENDOR_MICREL is not set --# CONFIG_NET_VENDOR_MICROCHIP is not set --# CONFIG_NET_VENDOR_MYRI is not set --# CONFIG_FEALNX is not set --# CONFIG_NET_VENDOR_NATSEMI is not set --# CONFIG_NET_VENDOR_NVIDIA is not set --# CONFIG_NET_VENDOR_OKI is not set --# CONFIG_ETHOC is not set --# CONFIG_NET_PACKET_ENGINE is not set --# CONFIG_NET_VENDOR_QLOGIC is not set --# CONFIG_NET_VENDOR_QUALCOMM is not set --# CONFIG_NET_VENDOR_REALTEK is not set --# CONFIG_NET_VENDOR_RENESAS is not set --# CONFIG_NET_VENDOR_RDC is not set --# CONFIG_NET_VENDOR_ROCKER is not set --# CONFIG_NET_VENDOR_SAMSUNG is not set --# CONFIG_NET_VENDOR_SEEQ is not set --# CONFIG_NET_VENDOR_SILAN is not set --# CONFIG_NET_VENDOR_SIS is not set --# CONFIG_SFC is not set --# CONFIG_NET_VENDOR_SMSC is not set --# CONFIG_NET_VENDOR_STMICRO is not set --# CONFIG_NET_VENDOR_SUN is not set --# CONFIG_NET_VENDOR_SYNOPSYS is not set --# CONFIG_NET_VENDOR_TEHUTI is not set --# CONFIG_NET_VENDOR_TI is not set --# CONFIG_NET_VENDOR_VIA is not set --# CONFIG_NET_VENDOR_WIZNET is not set --# CONFIG_FDDI is not set --# CONFIG_HIPPI is not set --CONFIG_PHYLIB=y -- --# --# MII PHY device drivers --# --# CONFIG_AQUANTIA_PHY is not set --CONFIG_AT803X_PHY=y --# CONFIG_AMD_PHY is not set --# CONFIG_MARVELL_PHY is not set --# CONFIG_DAVICOM_PHY is not set --# CONFIG_QSEMI_PHY is not set --# CONFIG_LXT_PHY is not set --# CONFIG_CICADA_PHY is not set --# CONFIG_VITESSE_PHY is not set --# CONFIG_TERANETICS_PHY is not set --# CONFIG_SMSC_PHY is not set --# CONFIG_BROADCOM_PHY is not set --# CONFIG_BCM7XXX_PHY is not set --# CONFIG_BCM87XX_PHY is not set --# CONFIG_ICPLUS_PHY is not set --# CONFIG_REALTEK_PHY is not set --# CONFIG_NATIONAL_PHY is not set --# CONFIG_STE10XP is not set --# CONFIG_LSI_ET1011C_PHY is not set --# CONFIG_MICREL_PHY is not set --# CONFIG_DP83848_PHY is not set --# CONFIG_DP83867_PHY is not set --CONFIG_MICROCHIP_PHY=m --CONFIG_FIXED_PHY=y --CONFIG_MDIO_BITBANG=y --CONFIG_MDIO_GPIO=y --CONFIG_MDIO_BUS_MUX=y --CONFIG_MDIO_BUS_MUX_GPIO=y --CONFIG_MDIO_BUS_MUX_MMIOREG=y --CONFIG_MDIO_BCM_UNIMAC=y --# CONFIG_MICREL_KS8995MA is not set --CONFIG_PPP=m --CONFIG_PPP_BSDCOMP=m --CONFIG_PPP_DEFLATE=m --CONFIG_PPP_FILTER=y --CONFIG_PPP_MPPE=m --CONFIG_PPP_MULTILINK=y --CONFIG_PPPOE=m --CONFIG_PPTP=m --CONFIG_PPPOL2TP=m --CONFIG_PPP_ASYNC=m --CONFIG_PPP_SYNC_TTY=m --CONFIG_SLIP=m --CONFIG_SLHC=m --CONFIG_SLIP_COMPRESSED=y --CONFIG_SLIP_SMART=y --CONFIG_SLIP_MODE_SLIP6=y --CONFIG_USB_NET_DRIVERS=y --CONFIG_USB_CATC=m --CONFIG_USB_KAWETH=m --CONFIG_USB_PEGASUS=m --CONFIG_USB_RTL8150=m --CONFIG_USB_RTL8152=m --CONFIG_USB_LAN78XX=m --CONFIG_USB_USBNET=m --CONFIG_USB_NET_AX8817X=m --CONFIG_USB_NET_AX88179_178A=m --CONFIG_USB_NET_CDCETHER=m --CONFIG_USB_NET_CDC_EEM=m --CONFIG_USB_NET_CDC_NCM=m --CONFIG_USB_NET_HUAWEI_CDC_NCM=m --CONFIG_USB_NET_CDC_MBIM=m --CONFIG_USB_NET_DM9601=m --CONFIG_USB_NET_SR9700=m --CONFIG_USB_NET_SR9800=m --CONFIG_USB_NET_SMSC75XX=m --CONFIG_USB_NET_SMSC95XX=m --CONFIG_USB_NET_GL620A=m --CONFIG_USB_NET_NET1080=m --CONFIG_USB_NET_PLUSB=m --CONFIG_USB_NET_MCS7830=m --CONFIG_USB_NET_RNDIS_HOST=m --CONFIG_USB_NET_CDC_SUBSET=m --CONFIG_USB_ALI_M5632=y --CONFIG_USB_AN2720=y --CONFIG_USB_BELKIN=y --CONFIG_USB_ARMLINUX=y --CONFIG_USB_EPSON2888=y --CONFIG_USB_KC2190=y --CONFIG_USB_NET_ZAURUS=m --CONFIG_USB_NET_CX82310_ETH=m --CONFIG_USB_NET_KALMIA=m --CONFIG_USB_NET_QMI_WWAN=m --CONFIG_USB_HSO=m --CONFIG_USB_NET_INT51X1=m --CONFIG_USB_IPHETH=m --CONFIG_USB_SIERRA_NET=m --CONFIG_USB_VL600=m --CONFIG_USB_NET_CH9200=m --CONFIG_WLAN=y --CONFIG_LIBERTAS_THINFIRM=m --# CONFIG_LIBERTAS_THINFIRM_DEBUG is not set --CONFIG_LIBERTAS_THINFIRM_USB=m --CONFIG_ATMEL=m --CONFIG_PCI_ATMEL=m --CONFIG_AT76C50X_USB=m --CONFIG_PRISM54=m --CONFIG_USB_ZD1201=m --CONFIG_USB_NET_RNDIS_WLAN=m --CONFIG_ADM8211=m --CONFIG_RTL8180=m --CONFIG_RTL8187=m --CONFIG_RTL8187_LEDS=y --CONFIG_MAC80211_HWSIM=m --CONFIG_MWL8K=m --CONFIG_ATH_COMMON=m --CONFIG_ATH_CARDS=m --# CONFIG_ATH_DEBUG is not set --CONFIG_ATH5K=m --# CONFIG_ATH5K_DEBUG is not set --# CONFIG_ATH5K_TRACER is not set --CONFIG_ATH5K_PCI=y --CONFIG_ATH9K_HW=m --CONFIG_ATH9K_COMMON=m --CONFIG_ATH9K_BTCOEX_SUPPORT=y --CONFIG_ATH9K=m --CONFIG_ATH9K_PCI=y --CONFIG_ATH9K_AHB=y --# CONFIG_ATH9K_DEBUGFS is not set --# CONFIG_ATH9K_DYNACK is not set --CONFIG_ATH9K_WOW=y --CONFIG_ATH9K_RFKILL=y --CONFIG_ATH9K_CHANNEL_CONTEXT=y --CONFIG_ATH9K_PCOEM=y --CONFIG_ATH9K_HTC=m --# CONFIG_ATH9K_HTC_DEBUGFS is not set --CONFIG_CARL9170=m --CONFIG_CARL9170_LEDS=y --CONFIG_CARL9170_WPC=y --CONFIG_CARL9170_HWRNG=y --CONFIG_ATH6KL=m --CONFIG_ATH6KL_SDIO=m --CONFIG_ATH6KL_USB=m --# CONFIG_ATH6KL_DEBUG is not set --# CONFIG_ATH6KL_TRACING is not set --CONFIG_AR5523=m --CONFIG_WIL6210=m --CONFIG_WIL6210_ISR_COR=y --CONFIG_WIL6210_TRACING=y --CONFIG_ATH10K=m --CONFIG_ATH10K_PCI=m --# CONFIG_ATH10K_DEBUG is not set --# CONFIG_ATH10K_DEBUGFS is not set --# CONFIG_ATH10K_TRACING is not set --CONFIG_WCN36XX=m --# CONFIG_WCN36XX_DEBUGFS is not set --CONFIG_B43=m --CONFIG_B43_BCMA=y --CONFIG_B43_SSB=y --CONFIG_B43_BUSES_BCMA_AND_SSB=y --# CONFIG_B43_BUSES_BCMA is not set --# CONFIG_B43_BUSES_SSB is not set --CONFIG_B43_PCI_AUTOSELECT=y --CONFIG_B43_PCICORE_AUTOSELECT=y --CONFIG_B43_SDIO=y --CONFIG_B43_BCMA_PIO=y --CONFIG_B43_PIO=y --CONFIG_B43_PHY_G=y --CONFIG_B43_PHY_N=y --CONFIG_B43_PHY_LP=y --CONFIG_B43_PHY_HT=y --CONFIG_B43_LEDS=y --CONFIG_B43_HWRNG=y --# CONFIG_B43_DEBUG is not set --CONFIG_B43LEGACY=m --CONFIG_B43LEGACY_PCI_AUTOSELECT=y --CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y --CONFIG_B43LEGACY_LEDS=y --CONFIG_B43LEGACY_HWRNG=y --# CONFIG_B43LEGACY_DEBUG is not set --CONFIG_B43LEGACY_DMA=y --CONFIG_B43LEGACY_PIO=y --CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y --# CONFIG_B43LEGACY_DMA_MODE is not set --# CONFIG_B43LEGACY_PIO_MODE is not set --CONFIG_BRCMUTIL=m --CONFIG_BRCMSMAC=m --CONFIG_BRCMFMAC=m --CONFIG_BRCMFMAC_PROTO_BCDC=y --CONFIG_BRCMFMAC_PROTO_MSGBUF=y --CONFIG_BRCMFMAC_SDIO=y --CONFIG_BRCMFMAC_USB=y --CONFIG_BRCMFMAC_PCIE=y --# CONFIG_BRCM_TRACING is not set --# CONFIG_BRCMDBG is not set --CONFIG_HOSTAP=m --CONFIG_HOSTAP_FIRMWARE=y --CONFIG_HOSTAP_FIRMWARE_NVRAM=y --CONFIG_HOSTAP_PLX=m --CONFIG_HOSTAP_PCI=m --CONFIG_IPW2100=m --CONFIG_IPW2100_MONITOR=y --# CONFIG_IPW2100_DEBUG is not set --CONFIG_IPW2200=m --CONFIG_IPW2200_MONITOR=y --CONFIG_IPW2200_RADIOTAP=y --CONFIG_IPW2200_PROMISCUOUS=y --CONFIG_IPW2200_QOS=y --CONFIG_IPW2200_DEBUG=y --CONFIG_LIBIPW=m --# CONFIG_LIBIPW_DEBUG is not set --CONFIG_IWLWIFI=m --CONFIG_IWLWIFI_LEDS=y --CONFIG_IWLDVM=m --CONFIG_IWLMVM=m --CONFIG_IWLWIFI_OPMODE_MODULAR=y --CONFIG_IWLWIFI_BCAST_FILTERING=y --CONFIG_IWLWIFI_UAPSD=y -- --# --# Debugging Options --# --# CONFIG_IWLWIFI_DEBUG is not set --CONFIG_IWLWIFI_DEVICE_TRACING=y --CONFIG_IWLEGACY=m --CONFIG_IWL4965=m --CONFIG_IWL3945=m -- --# --# iwl3945 / iwl4965 Debugging Options --# --# CONFIG_IWLEGACY_DEBUG is not set --CONFIG_LIBERTAS=m --CONFIG_LIBERTAS_USB=m --CONFIG_LIBERTAS_SDIO=m --CONFIG_LIBERTAS_SPI=m --# CONFIG_LIBERTAS_DEBUG is not set --CONFIG_LIBERTAS_MESH=y --CONFIG_HERMES=m --CONFIG_HERMES_PRISM=y --CONFIG_HERMES_CACHE_FW_ON_INIT=y --CONFIG_PLX_HERMES=m --CONFIG_TMD_HERMES=m --CONFIG_NORTEL_HERMES=m --CONFIG_PCI_HERMES=m --CONFIG_ORINOCO_USB=m --CONFIG_P54_COMMON=m --CONFIG_P54_USB=m --CONFIG_P54_PCI=m --CONFIG_P54_SPI=m --CONFIG_P54_SPI_DEFAULT_EEPROM=y --CONFIG_P54_LEDS=y --CONFIG_RT2X00=m --CONFIG_RT2400PCI=m --CONFIG_RT2500PCI=m --CONFIG_RT61PCI=m --CONFIG_RT2800PCI=m --CONFIG_RT2800PCI_RT33XX=y --CONFIG_RT2800PCI_RT35XX=y --CONFIG_RT2800PCI_RT53XX=y --CONFIG_RT2800PCI_RT3290=y --CONFIG_RT2500USB=m --CONFIG_RT73USB=m --CONFIG_RT2800USB=m --CONFIG_RT2800USB_RT33XX=y --CONFIG_RT2800USB_RT35XX=y --CONFIG_RT2800USB_RT3573=y --CONFIG_RT2800USB_RT53XX=y --CONFIG_RT2800USB_RT55XX=y --CONFIG_RT2800USB_UNKNOWN=y --CONFIG_RT2800_LIB=m --CONFIG_RT2800_LIB_MMIO=m --CONFIG_RT2X00_LIB_MMIO=m --CONFIG_RT2X00_LIB_PCI=m --CONFIG_RT2X00_LIB_USB=m --CONFIG_RT2X00_LIB=m --CONFIG_RT2X00_LIB_FIRMWARE=y --CONFIG_RT2X00_LIB_CRYPTO=y --CONFIG_RT2X00_LIB_LEDS=y --# CONFIG_RT2X00_DEBUG is not set --CONFIG_WL_MEDIATEK=y --CONFIG_MT7601U=m --CONFIG_RTL_CARDS=m --CONFIG_RTL8192CE=m --CONFIG_RTL8192SE=m --CONFIG_RTL8192DE=m --CONFIG_RTL8723AE=m --CONFIG_RTL8723BE=m --CONFIG_RTL8188EE=m --CONFIG_RTL8192EE=m --CONFIG_RTL8821AE=m --CONFIG_RTL8192CU=m --CONFIG_RTLWIFI=m --CONFIG_RTLWIFI_PCI=m --CONFIG_RTLWIFI_USB=m --CONFIG_RTLWIFI_DEBUG=y --CONFIG_RTL8192C_COMMON=m --CONFIG_RTL8723_COMMON=m --CONFIG_RTLBTCOEXIST=m --# CONFIG_RTL8XXXU is not set --CONFIG_WL_TI=y --CONFIG_WL1251=m --CONFIG_WL1251_SPI=m --CONFIG_WL1251_SDIO=m --CONFIG_WL12XX=m --CONFIG_WL18XX=m --CONFIG_WLCORE=m --CONFIG_WLCORE_SPI=m --CONFIG_WLCORE_SDIO=m --CONFIG_WILINK_PLATFORM_DATA=y --CONFIG_ZD1211RW=m --# CONFIG_ZD1211RW_DEBUG is not set --CONFIG_MWIFIEX=m --CONFIG_MWIFIEX_SDIO=m --CONFIG_MWIFIEX_PCIE=m --CONFIG_MWIFIEX_USB=m --CONFIG_CW1200=m --CONFIG_CW1200_WLAN_SDIO=m --CONFIG_CW1200_WLAN_SPI=m --CONFIG_RSI_91X=m --CONFIG_RSI_DEBUGFS=y --CONFIG_RSI_SDIO=m --CONFIG_RSI_USB=m -- --# --# Enable WiMAX (Networking options) to see the WiMAX drivers --# --CONFIG_WAN=y --CONFIG_HDLC=m --CONFIG_HDLC_RAW=m --CONFIG_HDLC_RAW_ETH=m --CONFIG_HDLC_CISCO=m --CONFIG_HDLC_FR=m --CONFIG_HDLC_PPP=m -- --# --# X.25/LAPB support is disabled --# --# CONFIG_PCI200SYN is not set --CONFIG_WANXL=m --# CONFIG_WANXL_BUILD_FIRMWARE is not set --CONFIG_PC300TOO=m --CONFIG_FARSYNC=m --CONFIG_DSCC4=m --# CONFIG_DSCC4_PCISYNC is not set --# CONFIG_DSCC4_PCI_RST is not set --# CONFIG_DLCI is not set --# CONFIG_VMXNET3 is not set --CONFIG_ISDN=y --CONFIG_ISDN_I4L=m --# CONFIG_ISDN_PPP is not set --# CONFIG_ISDN_AUDIO is not set -- --# --# ISDN feature submodules --# --# CONFIG_ISDN_DIVERSION is not set -- --# --# ISDN4Linux hardware drivers --# -- --# --# Passive cards --# --# CONFIG_ISDN_DRV_HISAX is not set -- --# --# Active cards --# --CONFIG_ISDN_CAPI=m --CONFIG_CAPI_TRACE=y --# CONFIG_ISDN_CAPI_CAPI20 is not set --# CONFIG_ISDN_CAPI_CAPIDRV is not set -- --# --# CAPI hardware drivers --# --# CONFIG_CAPI_AVM is not set --# CONFIG_CAPI_EICON is not set --CONFIG_ISDN_DRV_GIGASET=m --CONFIG_GIGASET_CAPI=y --# CONFIG_GIGASET_I4L is not set --# CONFIG_GIGASET_DUMMYLL is not set --# CONFIG_GIGASET_BASE is not set --# CONFIG_GIGASET_M105 is not set --# CONFIG_GIGASET_M101 is not set --# CONFIG_GIGASET_DEBUG is not set --CONFIG_HYSDN=m --CONFIG_HYSDN_CAPI=y --CONFIG_MISDN=m --CONFIG_MISDN_DSP=m --CONFIG_MISDN_L1OIP=m -- --# --# mISDN hardware drivers --# --CONFIG_MISDN_HFCPCI=m --CONFIG_MISDN_HFCMULTI=m --CONFIG_MISDN_HFCUSB=m --CONFIG_MISDN_AVMFRITZ=m --CONFIG_MISDN_SPEEDFAX=m --CONFIG_MISDN_INFINEON=m --CONFIG_MISDN_W6692=m --CONFIG_MISDN_NETJET=m --CONFIG_MISDN_IPAC=m --CONFIG_MISDN_ISAR=m --CONFIG_ISDN_HDLC=m --# CONFIG_NVM is not set -- --# --# Input device support --# --CONFIG_INPUT=y --CONFIG_INPUT_LEDS=m --CONFIG_INPUT_FF_MEMLESS=m --CONFIG_INPUT_POLLDEV=y --CONFIG_INPUT_SPARSEKMAP=m --CONFIG_INPUT_MATRIXKMAP=y -- --# --# Userland interfaces --# --CONFIG_INPUT_MOUSEDEV=m --# CONFIG_INPUT_MOUSEDEV_PSAUX is not set --CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 --CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 --CONFIG_INPUT_JOYDEV=m --CONFIG_INPUT_EVDEV=y --CONFIG_INPUT_EVBUG=m -- --# --# Input Device Drivers --# --CONFIG_INPUT_KEYBOARD=y --# CONFIG_KEYBOARD_ADP5588 is not set --# CONFIG_KEYBOARD_ADP5589 is not set --# CONFIG_KEYBOARD_ATKBD is not set --# CONFIG_KEYBOARD_QT1070 is not set --# CONFIG_KEYBOARD_QT2160 is not set --# CONFIG_KEYBOARD_LKKBD is not set --CONFIG_KEYBOARD_GPIO=y --CONFIG_KEYBOARD_GPIO_POLLED=y --CONFIG_KEYBOARD_TCA6416=m --CONFIG_KEYBOARD_TCA8418=m --CONFIG_KEYBOARD_MATRIX=m --# CONFIG_KEYBOARD_LM8323 is not set --# CONFIG_KEYBOARD_LM8333 is not set --# CONFIG_KEYBOARD_MAX7359 is not set --# CONFIG_KEYBOARD_MCS is not set --# CONFIG_KEYBOARD_MPR121 is not set --CONFIG_KEYBOARD_IMX=y --# CONFIG_KEYBOARD_NEWTON is not set --# CONFIG_KEYBOARD_OPENCORES is not set --# CONFIG_KEYBOARD_SAMSUNG is not set --# CONFIG_KEYBOARD_STOWAWAY is not set --# CONFIG_KEYBOARD_SUNKBD is not set --# CONFIG_KEYBOARD_OMAP4 is not set --CONFIG_KEYBOARD_XTKBD=m --# CONFIG_KEYBOARD_CAP11XX is not set --# CONFIG_KEYBOARD_BCM is not set --CONFIG_INPUT_MOUSE=y --CONFIG_MOUSE_PS2=m --CONFIG_MOUSE_PS2_ALPS=y --CONFIG_MOUSE_PS2_LOGIPS2PP=y --CONFIG_MOUSE_PS2_SYNAPTICS=y --CONFIG_MOUSE_PS2_CYPRESS=y --CONFIG_MOUSE_PS2_TRACKPOINT=y --CONFIG_MOUSE_PS2_ELANTECH=y --# CONFIG_MOUSE_PS2_SENTELIC is not set --# CONFIG_MOUSE_PS2_TOUCHKIT is not set --CONFIG_MOUSE_PS2_FOCALTECH=y --CONFIG_MOUSE_SERIAL=m --CONFIG_MOUSE_APPLETOUCH=m --CONFIG_MOUSE_BCM5974=m --CONFIG_MOUSE_CYAPA=m --CONFIG_MOUSE_ELAN_I2C=m --CONFIG_MOUSE_ELAN_I2C_I2C=y --# CONFIG_MOUSE_ELAN_I2C_SMBUS is not set --CONFIG_MOUSE_VSXXXAA=m --CONFIG_MOUSE_GPIO=m --CONFIG_MOUSE_SYNAPTICS_I2C=m --CONFIG_MOUSE_SYNAPTICS_USB=m --CONFIG_INPUT_JOYSTICK=y --CONFIG_JOYSTICK_ANALOG=m --CONFIG_JOYSTICK_A3D=m --CONFIG_JOYSTICK_ADI=m --CONFIG_JOYSTICK_COBRA=m --CONFIG_JOYSTICK_GF2K=m --CONFIG_JOYSTICK_GRIP=m --CONFIG_JOYSTICK_GRIP_MP=m --CONFIG_JOYSTICK_GUILLEMOT=m --CONFIG_JOYSTICK_INTERACT=m --CONFIG_JOYSTICK_SIDEWINDER=m --CONFIG_JOYSTICK_TMDC=m --CONFIG_JOYSTICK_IFORCE=m --CONFIG_JOYSTICK_IFORCE_USB=y --CONFIG_JOYSTICK_IFORCE_232=y --CONFIG_JOYSTICK_WARRIOR=m --CONFIG_JOYSTICK_MAGELLAN=m --CONFIG_JOYSTICK_SPACEORB=m --CONFIG_JOYSTICK_SPACEBALL=m --CONFIG_JOYSTICK_STINGER=m --CONFIG_JOYSTICK_TWIDJOY=m --CONFIG_JOYSTICK_ZHENHUA=m --CONFIG_JOYSTICK_AS5011=m --CONFIG_JOYSTICK_JOYDUMP=m --CONFIG_JOYSTICK_XPAD=m --CONFIG_JOYSTICK_XPAD_FF=y --CONFIG_JOYSTICK_XPAD_LEDS=y --# CONFIG_INPUT_TABLET is not set --CONFIG_INPUT_TOUCHSCREEN=y --CONFIG_TOUCHSCREEN_PROPERTIES=y --CONFIG_TOUCHSCREEN_ADS7846=m --CONFIG_TOUCHSCREEN_AD7877=m --CONFIG_TOUCHSCREEN_AD7879=m --CONFIG_TOUCHSCREEN_AD7879_I2C=m --CONFIG_TOUCHSCREEN_AD7879_SPI=m --CONFIG_TOUCHSCREEN_AR1021_I2C=m --CONFIG_TOUCHSCREEN_ATMEL_MXT=m --CONFIG_TOUCHSCREEN_AUO_PIXCIR=m --CONFIG_TOUCHSCREEN_BU21013=m --CONFIG_TOUCHSCREEN_CHIPONE_ICN8318=m --CONFIG_TOUCHSCREEN_CY8CTMG110=m --CONFIG_TOUCHSCREEN_CYTTSP_CORE=m --CONFIG_TOUCHSCREEN_CYTTSP_I2C=m --CONFIG_TOUCHSCREEN_CYTTSP_SPI=m --CONFIG_TOUCHSCREEN_CYTTSP4_CORE=m --CONFIG_TOUCHSCREEN_CYTTSP4_I2C=m --CONFIG_TOUCHSCREEN_CYTTSP4_SPI=m --CONFIG_TOUCHSCREEN_DA9052=m --CONFIG_TOUCHSCREEN_DYNAPRO=m --CONFIG_TOUCHSCREEN_HAMPSHIRE=m --CONFIG_TOUCHSCREEN_EETI=m --CONFIG_TOUCHSCREEN_EGALAX=m --CONFIG_TOUCHSCREEN_FT6236=m --CONFIG_TOUCHSCREEN_FUJITSU=m --CONFIG_TOUCHSCREEN_GOODIX=m --CONFIG_TOUCHSCREEN_ILI210X=m --CONFIG_TOUCHSCREEN_GUNZE=m --CONFIG_TOUCHSCREEN_ELAN=m --CONFIG_TOUCHSCREEN_ELO=m --CONFIG_TOUCHSCREEN_WACOM_W8001=m --CONFIG_TOUCHSCREEN_WACOM_I2C=m --CONFIG_TOUCHSCREEN_MAX11801=m --CONFIG_TOUCHSCREEN_MCS5000=m --CONFIG_TOUCHSCREEN_MMS114=m --CONFIG_TOUCHSCREEN_MTOUCH=m --CONFIG_TOUCHSCREEN_IMX6UL_TSC=m --CONFIG_TOUCHSCREEN_INEXIO=m --CONFIG_TOUCHSCREEN_MK712=m --CONFIG_TOUCHSCREEN_PENMOUNT=m --CONFIG_TOUCHSCREEN_EDT_FT5X06=m --CONFIG_TOUCHSCREEN_TOUCHRIGHT=m --CONFIG_TOUCHSCREEN_TOUCHWIN=m --CONFIG_TOUCHSCREEN_PIXCIR=m --CONFIG_TOUCHSCREEN_WDT87XX_I2C=m --CONFIG_TOUCHSCREEN_WM97XX=m --CONFIG_TOUCHSCREEN_WM9705=y --CONFIG_TOUCHSCREEN_WM9712=y --CONFIG_TOUCHSCREEN_WM9713=y --CONFIG_TOUCHSCREEN_USB_COMPOSITE=m --CONFIG_TOUCHSCREEN_MC13783=m --CONFIG_TOUCHSCREEN_USB_EGALAX=y --CONFIG_TOUCHSCREEN_USB_PANJIT=y --CONFIG_TOUCHSCREEN_USB_3M=y --CONFIG_TOUCHSCREEN_USB_ITM=y --CONFIG_TOUCHSCREEN_USB_ETURBO=y --CONFIG_TOUCHSCREEN_USB_GUNZE=y --CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y --CONFIG_TOUCHSCREEN_USB_IRTOUCH=y --CONFIG_TOUCHSCREEN_USB_IDEALTEK=y --CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y --CONFIG_TOUCHSCREEN_USB_GOTOP=y --CONFIG_TOUCHSCREEN_USB_JASTEC=y --CONFIG_TOUCHSCREEN_USB_ELO=y --CONFIG_TOUCHSCREEN_USB_E2I=y --CONFIG_TOUCHSCREEN_USB_ZYTRONIC=y --CONFIG_TOUCHSCREEN_USB_ETT_TC45USB=y --CONFIG_TOUCHSCREEN_USB_NEXIO=y --CONFIG_TOUCHSCREEN_USB_EASYTOUCH=y --CONFIG_TOUCHSCREEN_TOUCHIT213=m --CONFIG_TOUCHSCREEN_TSC_SERIO=m --CONFIG_TOUCHSCREEN_TSC200X_CORE=m --CONFIG_TOUCHSCREEN_TSC2004=m --CONFIG_TOUCHSCREEN_TSC2005=m --CONFIG_TOUCHSCREEN_TSC2007=m --CONFIG_TOUCHSCREEN_ST1232=m --CONFIG_TOUCHSCREEN_SUR40=m --CONFIG_TOUCHSCREEN_SX8654=m --CONFIG_TOUCHSCREEN_TPS6507X=m --CONFIG_TOUCHSCREEN_ZFORCE=m --CONFIG_TOUCHSCREEN_ROHM_BU21023=m --CONFIG_INPUT_MISC=y --CONFIG_INPUT_AD714X=m --CONFIG_INPUT_AD714X_I2C=m --CONFIG_INPUT_AD714X_SPI=m --CONFIG_INPUT_BMA150=m --CONFIG_INPUT_E3X0_BUTTON=m --CONFIG_INPUT_MC13783_PWRBUTTON=m --CONFIG_INPUT_MMA8450=y --CONFIG_INPUT_MPU3050=m --CONFIG_INPUT_GP2A=m --CONFIG_INPUT_GPIO_BEEPER=m --CONFIG_INPUT_GPIO_TILT_POLLED=m --CONFIG_INPUT_ATI_REMOTE2=m --CONFIG_INPUT_KEYSPAN_REMOTE=m --CONFIG_INPUT_KXTJ9=m --CONFIG_INPUT_KXTJ9_POLLED_MODE=y --CONFIG_INPUT_POWERMATE=m --CONFIG_INPUT_YEALINK=m --CONFIG_INPUT_CM109=m --CONFIG_INPUT_REGULATOR_HAPTIC=m --CONFIG_INPUT_UINPUT=m --CONFIG_INPUT_PCF8574=m --CONFIG_INPUT_PWM_BEEPER=m --CONFIG_INPUT_GPIO_ROTARY_ENCODER=m --CONFIG_INPUT_DA9052_ONKEY=m --CONFIG_INPUT_ADXL34X=m --CONFIG_INPUT_ADXL34X_I2C=m --CONFIG_INPUT_ADXL34X_SPI=m --CONFIG_INPUT_IMS_PCU=m --CONFIG_INPUT_CMA3000=m --CONFIG_INPUT_CMA3000_I2C=m --CONFIG_INPUT_SOC_BUTTON_ARRAY=m --CONFIG_INPUT_DRV260X_HAPTICS=m --CONFIG_INPUT_DRV2665_HAPTICS=m --CONFIG_INPUT_DRV2667_HAPTICS=m -- --# --# Hardware I/O ports --# --CONFIG_SERIO=m --CONFIG_SERIO_SERPORT=m --# CONFIG_SERIO_PCIPS2 is not set --CONFIG_SERIO_LIBPS2=m --CONFIG_SERIO_RAW=m --CONFIG_SERIO_ALTERA_PS2=m --# CONFIG_SERIO_PS2MULT is not set --# CONFIG_SERIO_ARC_PS2 is not set --# CONFIG_SERIO_APBPS2 is not set --# CONFIG_USERIO is not set --CONFIG_GAMEPORT=m --# CONFIG_GAMEPORT_NS558 is not set --# CONFIG_GAMEPORT_L4 is not set --# CONFIG_GAMEPORT_EMU10K1 is not set --# CONFIG_GAMEPORT_FM801 is not set -- --# --# Character devices --# --CONFIG_TTY=y --CONFIG_VT=y --CONFIG_CONSOLE_TRANSLATIONS=y --CONFIG_VT_CONSOLE=y --CONFIG_VT_CONSOLE_SLEEP=y --CONFIG_HW_CONSOLE=y --CONFIG_VT_HW_CONSOLE_BINDING=y --CONFIG_UNIX98_PTYS=y --CONFIG_DEVPTS_MULTIPLE_INSTANCES=y --CONFIG_LEGACY_PTYS=y --CONFIG_LEGACY_PTY_COUNT=256 --# CONFIG_SERIAL_NONSTANDARD is not set --# CONFIG_NOZOMI is not set --# CONFIG_N_GSM is not set --# CONFIG_TRACE_SINK is not set --CONFIG_DEVMEM=y --# CONFIG_DEVKMEM is not set -- --# --# Serial drivers --# --CONFIG_SERIAL_EARLYCON=y --CONFIG_SERIAL_8250=m --CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y --CONFIG_SERIAL_8250_DMA=y --CONFIG_SERIAL_8250_PCI=m --CONFIG_SERIAL_8250_NR_UARTS=4 --CONFIG_SERIAL_8250_RUNTIME_UARTS=4 --# CONFIG_SERIAL_8250_EXTENDED is not set --CONFIG_SERIAL_8250_DW=m --# CONFIG_SERIAL_8250_EM is not set --# CONFIG_SERIAL_8250_RT288X is not set --# CONFIG_SERIAL_8250_MID is not set -- --# --# Non-8250 serial port support --# --CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST=y --CONFIG_SERIAL_MAX3100=m --CONFIG_SERIAL_MAX310X=m --CONFIG_SERIAL_IMX=y --CONFIG_SERIAL_IMX_CONSOLE=y --# CONFIG_SERIAL_UARTLITE is not set --CONFIG_SERIAL_CORE=y --CONFIG_SERIAL_CORE_CONSOLE=y --# CONFIG_SERIAL_JSM is not set --# CONFIG_SERIAL_OF_PLATFORM is not set --# CONFIG_SERIAL_SCCNXP is not set --# CONFIG_SERIAL_SC16IS7XX is not set --CONFIG_SERIAL_BCM63XX=y --CONFIG_SERIAL_BCM63XX_CONSOLE=y --# CONFIG_SERIAL_ALTERA_JTAGUART is not set --# CONFIG_SERIAL_ALTERA_UART is not set --# CONFIG_SERIAL_IFX6X60 is not set --# CONFIG_SERIAL_XILINX_PS_UART is not set --CONFIG_SERIAL_ARC=y --CONFIG_SERIAL_ARC_CONSOLE=y --CONFIG_SERIAL_ARC_NR_PORTS=1 --# CONFIG_SERIAL_RP2 is not set --CONFIG_SERIAL_FSL_LPUART=y --CONFIG_SERIAL_FSL_LPUART_CONSOLE=y --# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set --# CONFIG_SERIAL_ST_ASC is not set --# CONFIG_SERIAL_STM32 is not set --CONFIG_TTY_PRINTK=m --CONFIG_HVC_DRIVER=y --CONFIG_HVC_DCC=y --# CONFIG_IPMI_HANDLER is not set --CONFIG_HW_RANDOM=y --CONFIG_HW_RANDOM_TIMERIOMEM=m --# CONFIG_NVRAM is not set --# CONFIG_R3964 is not set --# CONFIG_APPLICOM is not set --CONFIG_RAW_DRIVER=m --CONFIG_MAX_RAW_DEVS=256 --# CONFIG_TCG_TPM is not set --CONFIG_DEVPORT=y --# CONFIG_XILLYBUS is not set -- --# --# I2C support --# --CONFIG_I2C=y --CONFIG_I2C_BOARDINFO=y --CONFIG_I2C_COMPAT=y --CONFIG_I2C_CHARDEV=y --CONFIG_I2C_MUX=y -- --# --# Multiplexer I2C Chip support --# --CONFIG_I2C_ARB_GPIO_CHALLENGE=y --CONFIG_I2C_MUX_GPIO=y --CONFIG_I2C_MUX_PCA9541=y --CONFIG_I2C_MUX_PCA954x=y --CONFIG_I2C_MUX_PINCTRL=y --# CONFIG_I2C_MUX_REG is not set --CONFIG_I2C_HELPER_AUTO=y --CONFIG_I2C_ALGOBIT=y -- --# --# I2C Hardware Bus support --# -- --# --# PC SMBus host controller drivers --# --# CONFIG_I2C_ALI1535 is not set --# CONFIG_I2C_ALI1563 is not set --# CONFIG_I2C_ALI15X3 is not set --# CONFIG_I2C_AMD756 is not set --# CONFIG_I2C_AMD8111 is not set --# CONFIG_I2C_I801 is not set --# CONFIG_I2C_ISCH is not set --# CONFIG_I2C_PIIX4 is not set --# CONFIG_I2C_NFORCE2 is not set --# CONFIG_I2C_SIS5595 is not set --# CONFIG_I2C_SIS630 is not set --# CONFIG_I2C_SIS96X is not set --# CONFIG_I2C_VIA is not set --# CONFIG_I2C_VIAPRO is not set -- --# --# I2C system bus drivers (mostly embedded / system-on-chip) --# --# CONFIG_I2C_CBUS_GPIO is not set --CONFIG_I2C_DESIGNWARE_CORE=m --CONFIG_I2C_DESIGNWARE_PLATFORM=m --# CONFIG_I2C_DESIGNWARE_PCI is not set --# CONFIG_I2C_EMEV2 is not set --CONFIG_I2C_GPIO=y --CONFIG_I2C_IMX=y --CONFIG_I2C_OCORES=y --# CONFIG_I2C_PCA_PLATFORM is not set --# CONFIG_I2C_PXA_PCI is not set --# CONFIG_I2C_RK3X is not set --# CONFIG_I2C_SIMTEC is not set --# CONFIG_I2C_XILINX is not set -- --# --# External I2C/SMBus adapter drivers --# --# CONFIG_I2C_DIOLAN_U2C is not set --# CONFIG_I2C_PARPORT_LIGHT is not set --# CONFIG_I2C_ROBOTFUZZ_OSIF is not set --# CONFIG_I2C_TAOS_EVM is not set --# CONFIG_I2C_TINY_USB is not set -- --# --# Other I2C/SMBus bus drivers --# --# CONFIG_I2C_STUB is not set --CONFIG_I2C_SLAVE=y --CONFIG_I2C_SLAVE_EEPROM=m --# CONFIG_I2C_DEBUG_CORE is not set --# CONFIG_I2C_DEBUG_ALGO is not set --# CONFIG_I2C_DEBUG_BUS is not set --CONFIG_SPI=y --# CONFIG_SPI_DEBUG is not set --CONFIG_SPI_MASTER=y -- --# --# SPI Master Controller Drivers --# --# CONFIG_SPI_ALTERA is not set --CONFIG_SPI_BITBANG=m --# CONFIG_SPI_CADENCE is not set --CONFIG_SPI_GPIO=m --CONFIG_SPI_IMX=m --# CONFIG_SPI_FSL_SPI is not set --# CONFIG_SPI_OC_TINY is not set --# CONFIG_SPI_PXA2XX is not set --# CONFIG_SPI_PXA2XX_PCI is not set --# CONFIG_SPI_ROCKCHIP is not set --# CONFIG_SPI_SC18IS602 is not set --# CONFIG_SPI_XCOMM is not set --# CONFIG_SPI_XILINX is not set --# CONFIG_SPI_ZYNQMP_GQSPI is not set --# CONFIG_SPI_DESIGNWARE is not set -- --# --# SPI Protocol Masters --# --CONFIG_SPI_SPIDEV=y --# CONFIG_SPI_TLE62X0 is not set --# CONFIG_SPMI is not set --# CONFIG_HSI is not set -- --# --# PPS support --# --CONFIG_PPS=y --# CONFIG_PPS_DEBUG is not set --# CONFIG_NTP_PPS is not set -- --# --# PPS clients support --# --# CONFIG_PPS_CLIENT_KTIMER is not set --CONFIG_PPS_CLIENT_LDISC=m --CONFIG_PPS_CLIENT_GPIO=m -- --# --# PPS generators support --# -- --# --# PTP clock support --# --CONFIG_PTP_1588_CLOCK=y --CONFIG_PTP_1588_CLOCK_GIANFAR=y -- --# --# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. --# --CONFIG_PINCTRL=y -- --# --# Pin controllers --# --CONFIG_PINMUX=y --CONFIG_PINCONF=y --CONFIG_GENERIC_PINCONF=y --# CONFIG_DEBUG_PINCTRL is not set --# CONFIG_PINCTRL_AMD is not set --CONFIG_PINCTRL_SINGLE=y --CONFIG_PINCTRL_IMX=y --CONFIG_PINCTRL_IMX6Q=y --CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y --CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y --CONFIG_ARCH_REQUIRE_GPIOLIB=y --CONFIG_GPIOLIB=y --CONFIG_GPIO_DEVRES=y --CONFIG_OF_GPIO=y --CONFIG_GPIOLIB_IRQCHIP=y --# CONFIG_DEBUG_GPIO is not set --CONFIG_GPIO_SYSFS=y --CONFIG_GPIO_GENERIC=y -- --# --# Memory mapped GPIO drivers --# --CONFIG_GPIO_74XX_MMIO=y --# CONFIG_GPIO_ALTERA is not set --# CONFIG_GPIO_DWAPB is not set --# CONFIG_GPIO_EM is not set --CONFIG_GPIO_GENERIC_PLATFORM=y --# CONFIG_GPIO_GRGPIO is not set --CONFIG_GPIO_MXC=y --CONFIG_GPIO_SYSCON=y --# CONFIG_GPIO_VX855 is not set --# CONFIG_GPIO_XILINX is not set --# CONFIG_GPIO_ZEVIO is not set --# CONFIG_GPIO_ZX is not set -- --# --# I2C GPIO expanders --# --CONFIG_GPIO_ADP5588=m --CONFIG_GPIO_ADNP=m --# CONFIG_GPIO_MAX7300 is not set --# CONFIG_GPIO_MAX732X is not set --CONFIG_GPIO_PCA953X=y --CONFIG_GPIO_PCA953X_IRQ=y --CONFIG_GPIO_PCF857X=m --CONFIG_GPIO_SX150X=y -- --# --# MFD GPIO expanders --# --# CONFIG_GPIO_DA9052 is not set -- --# --# PCI GPIO expanders --# --# CONFIG_GPIO_AMD8111 is not set --# CONFIG_GPIO_ML_IOH is not set --# CONFIG_GPIO_RDC321X is not set -- --# --# SPI GPIO expanders --# --CONFIG_GPIO_74X164=y --# CONFIG_GPIO_MAX7301 is not set --CONFIG_GPIO_MC33880=y -- --# --# SPI or I2C GPIO expanders --# --CONFIG_GPIO_MCP23S08=y -- --# --# USB GPIO expanders --# --CONFIG_W1=m --CONFIG_W1_CON=y -- --# --# 1-wire Bus Masters --# --CONFIG_W1_MASTER_MATROX=m --CONFIG_W1_MASTER_DS2490=m --CONFIG_W1_MASTER_DS2482=m --CONFIG_W1_MASTER_MXC=m --CONFIG_W1_MASTER_DS1WM=m --CONFIG_W1_MASTER_GPIO=m -- --# --# 1-wire Slaves --# --CONFIG_W1_SLAVE_THERM=m --CONFIG_W1_SLAVE_SMEM=m --CONFIG_W1_SLAVE_DS2408=m --CONFIG_W1_SLAVE_DS2408_READBACK=y --CONFIG_W1_SLAVE_DS2413=m --CONFIG_W1_SLAVE_DS2406=m --CONFIG_W1_SLAVE_DS2423=m --CONFIG_W1_SLAVE_DS2431=m --CONFIG_W1_SLAVE_DS2433=m --CONFIG_W1_SLAVE_DS2433_CRC=y --CONFIG_W1_SLAVE_DS2760=m --CONFIG_W1_SLAVE_DS2780=m --CONFIG_W1_SLAVE_DS2781=m --CONFIG_W1_SLAVE_DS28E04=m --CONFIG_W1_SLAVE_BQ27000=m --CONFIG_POWER_SUPPLY=y --# CONFIG_POWER_SUPPLY_DEBUG is not set --# CONFIG_PDA_POWER is not set --# CONFIG_GENERIC_ADC_BATTERY is not set --CONFIG_TEST_POWER=m --# CONFIG_BATTERY_DS2760 is not set --# CONFIG_BATTERY_DS2780 is not set --# CONFIG_BATTERY_DS2781 is not set --# CONFIG_BATTERY_DS2782 is not set --# CONFIG_BATTERY_SBS is not set --# CONFIG_BATTERY_BQ27XXX is not set --# CONFIG_BATTERY_DA9052 is not set --# CONFIG_BATTERY_MAX17040 is not set --# CONFIG_BATTERY_MAX17042 is not set --# CONFIG_CHARGER_ISP1704 is not set --# CONFIG_CHARGER_MAX8903 is not set --# CONFIG_CHARGER_LP8727 is not set --CONFIG_CHARGER_GPIO=m --# CONFIG_CHARGER_MANAGER is not set --# CONFIG_CHARGER_BQ2415X is not set --# CONFIG_CHARGER_BQ24190 is not set --# CONFIG_CHARGER_BQ24257 is not set --# CONFIG_CHARGER_BQ24735 is not set --# CONFIG_CHARGER_BQ25890 is not set --# CONFIG_CHARGER_SMB347 is not set --# CONFIG_BATTERY_GAUGE_LTC2941 is not set --# CONFIG_CHARGER_RT9455 is not set --CONFIG_POWER_RESET=y --# CONFIG_POWER_RESET_BRCMSTB is not set --CONFIG_POWER_RESET_GPIO=y --CONFIG_POWER_RESET_GPIO_RESTART=y --CONFIG_POWER_RESET_IMX=y --CONFIG_POWER_RESET_LTC2952=y --CONFIG_POWER_RESET_RESTART=y --CONFIG_POWER_RESET_VERSATILE=y --# CONFIG_POWER_RESET_SNVS is not set --CONFIG_POWER_RESET_SYSCON=y --# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set --CONFIG_POWER_AVS=y --CONFIG_HWMON=y --# CONFIG_HWMON_VID is not set --# CONFIG_HWMON_DEBUG_CHIP is not set -- --# --# Native drivers --# --# CONFIG_SENSORS_AD7314 is not set --# CONFIG_SENSORS_AD7414 is not set --# CONFIG_SENSORS_AD7418 is not set --# CONFIG_SENSORS_ADM1021 is not set --# CONFIG_SENSORS_ADM1025 is not set --# CONFIG_SENSORS_ADM1026 is not set --# CONFIG_SENSORS_ADM1029 is not set --# CONFIG_SENSORS_ADM1031 is not set --# CONFIG_SENSORS_ADM9240 is not set --# CONFIG_SENSORS_ADT7310 is not set --# CONFIG_SENSORS_ADT7410 is not set --# CONFIG_SENSORS_ADT7411 is not set --# CONFIG_SENSORS_ADT7462 is not set --# CONFIG_SENSORS_ADT7470 is not set --# CONFIG_SENSORS_ADT7475 is not set --# CONFIG_SENSORS_ASC7621 is not set --# CONFIG_SENSORS_ATXP1 is not set --# CONFIG_SENSORS_DS620 is not set --# CONFIG_SENSORS_DS1621 is not set --# CONFIG_SENSORS_DA9052_ADC is not set --# CONFIG_SENSORS_I5K_AMB is not set --# CONFIG_SENSORS_F71805F is not set --# CONFIG_SENSORS_F71882FG is not set --# CONFIG_SENSORS_F75375S is not set --CONFIG_SENSORS_MC13783_ADC=y --# CONFIG_SENSORS_GL518SM is not set --# CONFIG_SENSORS_GL520SM is not set --# CONFIG_SENSORS_G760A is not set --# CONFIG_SENSORS_G762 is not set --# CONFIG_SENSORS_GPIO_FAN is not set --# CONFIG_SENSORS_HIH6130 is not set --# CONFIG_SENSORS_IIO_HWMON is not set --# CONFIG_SENSORS_IT87 is not set --# CONFIG_SENSORS_JC42 is not set --# CONFIG_SENSORS_POWR1220 is not set --# CONFIG_SENSORS_LINEAGE is not set --# CONFIG_SENSORS_LTC2945 is not set --# CONFIG_SENSORS_LTC4151 is not set --# CONFIG_SENSORS_LTC4215 is not set --# CONFIG_SENSORS_LTC4222 is not set --# CONFIG_SENSORS_LTC4245 is not set --# CONFIG_SENSORS_LTC4260 is not set --# CONFIG_SENSORS_LTC4261 is not set --CONFIG_SENSORS_MAX1111=y --CONFIG_SENSORS_MAX16065=y --CONFIG_SENSORS_MAX1619=y --CONFIG_SENSORS_MAX1668=y --# CONFIG_SENSORS_MAX197 is not set --# CONFIG_SENSORS_MAX6639 is not set --# CONFIG_SENSORS_MAX6642 is not set --# CONFIG_SENSORS_MAX6650 is not set --# CONFIG_SENSORS_MAX6697 is not set --# CONFIG_SENSORS_MAX31790 is not set --# CONFIG_SENSORS_HTU21 is not set --# CONFIG_SENSORS_MCP3021 is not set --# CONFIG_SENSORS_ADCXX is not set --# CONFIG_SENSORS_LM63 is not set --# CONFIG_SENSORS_LM70 is not set --# CONFIG_SENSORS_LM73 is not set --# CONFIG_SENSORS_LM75 is not set --# CONFIG_SENSORS_LM77 is not set --# CONFIG_SENSORS_LM78 is not set --# CONFIG_SENSORS_LM80 is not set --# CONFIG_SENSORS_LM83 is not set --# CONFIG_SENSORS_LM85 is not set --# CONFIG_SENSORS_LM87 is not set --# CONFIG_SENSORS_LM90 is not set --# CONFIG_SENSORS_LM92 is not set --# CONFIG_SENSORS_LM93 is not set --# CONFIG_SENSORS_LM95234 is not set --# CONFIG_SENSORS_LM95241 is not set --# CONFIG_SENSORS_LM95245 is not set --# CONFIG_SENSORS_PC87360 is not set --# CONFIG_SENSORS_PC87427 is not set --# CONFIG_SENSORS_NTC_THERMISTOR is not set --# CONFIG_SENSORS_NCT6683 is not set --# CONFIG_SENSORS_NCT6775 is not set --# CONFIG_SENSORS_NCT7802 is not set --# CONFIG_SENSORS_NCT7904 is not set --# CONFIG_SENSORS_PCF8591 is not set --# CONFIG_PMBUS is not set --CONFIG_SENSORS_PWM_FAN=y --# CONFIG_SENSORS_SHT15 is not set --# CONFIG_SENSORS_SHT21 is not set --# CONFIG_SENSORS_SHTC1 is not set --# CONFIG_SENSORS_SIS5595 is not set --# CONFIG_SENSORS_DME1737 is not set --# CONFIG_SENSORS_EMC1403 is not set --# CONFIG_SENSORS_EMC2103 is not set --# CONFIG_SENSORS_EMC6W201 is not set --# CONFIG_SENSORS_SMSC47M1 is not set --# CONFIG_SENSORS_SMSC47M192 is not set --# CONFIG_SENSORS_SMSC47B397 is not set --# CONFIG_SENSORS_SCH56XX_COMMON is not set --# CONFIG_SENSORS_SCH5627 is not set --# CONFIG_SENSORS_SCH5636 is not set --# CONFIG_SENSORS_SMM665 is not set --# CONFIG_SENSORS_ADC128D818 is not set --# CONFIG_SENSORS_ADS1015 is not set --# CONFIG_SENSORS_ADS7828 is not set --# CONFIG_SENSORS_ADS7871 is not set --# CONFIG_SENSORS_AMC6821 is not set --# CONFIG_SENSORS_INA209 is not set --# CONFIG_SENSORS_INA2XX is not set --# CONFIG_SENSORS_TC74 is not set --# CONFIG_SENSORS_THMC50 is not set --# CONFIG_SENSORS_TMP102 is not set --# CONFIG_SENSORS_TMP103 is not set --# CONFIG_SENSORS_TMP401 is not set --# CONFIG_SENSORS_TMP421 is not set --# CONFIG_SENSORS_VIA686A is not set --# CONFIG_SENSORS_VT1211 is not set --# CONFIG_SENSORS_VT8231 is not set --# CONFIG_SENSORS_W83781D is not set --# CONFIG_SENSORS_W83791D is not set --# CONFIG_SENSORS_W83792D is not set --# CONFIG_SENSORS_W83793 is not set --# CONFIG_SENSORS_W83795 is not set --# CONFIG_SENSORS_W83L785TS is not set --# CONFIG_SENSORS_W83L786NG is not set --# CONFIG_SENSORS_W83627HF is not set --# CONFIG_SENSORS_W83627EHF is not set --CONFIG_THERMAL=y --CONFIG_THERMAL_HWMON=y --CONFIG_THERMAL_OF=y --# CONFIG_THERMAL_WRITABLE_TRIPS is not set --CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y --# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set --# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set --# CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR is not set --CONFIG_THERMAL_GOV_FAIR_SHARE=y --CONFIG_THERMAL_GOV_STEP_WISE=y --# CONFIG_THERMAL_GOV_BANG_BANG is not set --CONFIG_THERMAL_GOV_USER_SPACE=y --# CONFIG_THERMAL_GOV_POWER_ALLOCATOR is not set --CONFIG_CPU_THERMAL=y --CONFIG_CLOCK_THERMAL=y --# CONFIG_DEVFREQ_THERMAL is not set --# CONFIG_THERMAL_EMULATION is not set --CONFIG_IMX_THERMAL=y --CONFIG_WATCHDOG=y --CONFIG_WATCHDOG_CORE=y --# CONFIG_WATCHDOG_NOWAYOUT is not set -- --# --# Watchdog Device Drivers --# --CONFIG_SOFT_WATCHDOG=m --# CONFIG_DA9052_WATCHDOG is not set --CONFIG_GPIO_WATCHDOG=m --# CONFIG_XILINX_WATCHDOG is not set --# CONFIG_CADENCE_WATCHDOG is not set --# CONFIG_DW_WATCHDOG is not set --# CONFIG_MAX63XX_WATCHDOG is not set --CONFIG_IMX2_WDT=y --# CONFIG_ALIM7101_WDT is not set --# CONFIG_I6300ESB_WDT is not set --# CONFIG_BCM7038_WDT is not set --# CONFIG_MEN_A21_WDT is not set -- --# --# PCI-based Watchdog Cards --# --# CONFIG_PCIPCWATCHDOG is not set --# CONFIG_WDTPCI is not set -- --# --# USB-based Watchdog Cards --# --# CONFIG_USBPCWATCHDOG is not set --CONFIG_SSB_POSSIBLE=y -- --# --# Sonics Silicon Backplane --# --CONFIG_SSB=y --CONFIG_SSB_SPROM=y --CONFIG_SSB_BLOCKIO=y --CONFIG_SSB_PCIHOST_POSSIBLE=y --CONFIG_SSB_PCIHOST=y --CONFIG_SSB_B43_PCI_BRIDGE=y --CONFIG_SSB_SDIOHOST_POSSIBLE=y --CONFIG_SSB_SDIOHOST=y --# CONFIG_SSB_HOST_SOC is not set --# CONFIG_SSB_SILENT is not set --# CONFIG_SSB_DEBUG is not set --CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y --CONFIG_SSB_DRIVER_PCICORE=y --# CONFIG_SSB_DRIVER_GPIO is not set --CONFIG_BCMA_POSSIBLE=y -- --# --# Broadcom specific AMBA --# --CONFIG_BCMA=m --CONFIG_BCMA_BLOCKIO=y --CONFIG_BCMA_HOST_PCI_POSSIBLE=y --# CONFIG_BCMA_HOST_PCI is not set --# CONFIG_BCMA_HOST_SOC is not set --# CONFIG_BCMA_DRIVER_PCI is not set --# CONFIG_BCMA_DRIVER_GMAC_CMN is not set --# CONFIG_BCMA_DRIVER_GPIO is not set --# CONFIG_BCMA_DEBUG is not set -- --# --# Multifunction device drivers --# --CONFIG_MFD_CORE=y --# CONFIG_MFD_AS3711 is not set --# CONFIG_MFD_AS3722 is not set --# CONFIG_PMIC_ADP5520 is not set --# CONFIG_MFD_AAT2870_CORE is not set --# CONFIG_MFD_ATMEL_FLEXCOM is not set --# CONFIG_MFD_ATMEL_HLCDC is not set --# CONFIG_MFD_BCM590XX is not set --# CONFIG_MFD_AXP20X is not set --# CONFIG_MFD_CROS_EC is not set --# CONFIG_MFD_ASIC3 is not set --# CONFIG_PMIC_DA903X is not set --CONFIG_PMIC_DA9052=y --CONFIG_MFD_DA9052_SPI=y --CONFIG_MFD_DA9052_I2C=y --# CONFIG_MFD_DA9055 is not set --# CONFIG_MFD_DA9062 is not set --# CONFIG_MFD_DA9063 is not set --# CONFIG_MFD_DA9150 is not set --CONFIG_MFD_MXC_HDMI=y --# CONFIG_MFD_DLN2 is not set --CONFIG_MFD_MC13XXX=y --CONFIG_MFD_MC13XXX_SPI=y --CONFIG_MFD_MC13XXX_I2C=y --# CONFIG_MFD_HI6421_PMIC is not set --# CONFIG_HTC_EGPIO is not set --# CONFIG_HTC_PASIC3 is not set --# CONFIG_HTC_I2CPLD is not set --# CONFIG_LPC_ICH is not set --# CONFIG_LPC_SCH is not set --# CONFIG_INTEL_SOC_PMIC is not set --# CONFIG_MFD_JANZ_CMODIO is not set --# CONFIG_MFD_KEMPLD is not set --# CONFIG_MFD_88PM800 is not set --# CONFIG_MFD_88PM805 is not set --# CONFIG_MFD_88PM860X is not set --# CONFIG_MFD_MAX14577 is not set --# CONFIG_MFD_MAX77686 is not set --# CONFIG_MFD_MAX77693 is not set --# CONFIG_MFD_MAX77843 is not set --# CONFIG_MFD_MAX8907 is not set --# CONFIG_MFD_MAX8925 is not set --# CONFIG_MFD_MAX8997 is not set --# CONFIG_MFD_MAX8998 is not set --# CONFIG_MFD_MT6397 is not set --# CONFIG_MFD_MENF21BMC is not set --# CONFIG_EZX_PCAP is not set --# CONFIG_MFD_VIPERBOARD is not set --# CONFIG_MFD_RETU is not set --# CONFIG_MFD_PCF50633 is not set --# CONFIG_UCB1400_CORE is not set --# CONFIG_MFD_PM8921_CORE is not set --# CONFIG_MFD_RDC321X is not set --# CONFIG_MFD_RTSX_PCI is not set --# CONFIG_MFD_RT5033 is not set --# CONFIG_MFD_RTSX_USB is not set --# CONFIG_MFD_RC5T583 is not set --# CONFIG_MFD_RK808 is not set --# CONFIG_MFD_RN5T618 is not set --# CONFIG_MFD_SEC_CORE is not set --CONFIG_MFD_SI476X_CORE=y --# CONFIG_MFD_SM501 is not set --# CONFIG_MFD_SKY81452 is not set --# CONFIG_MFD_SMSC is not set --# CONFIG_ABX500_CORE is not set --# CONFIG_MFD_STMPE is not set --CONFIG_MFD_SYSCON=y --# CONFIG_MFD_TI_AM335X_TSCADC is not set --# CONFIG_MFD_LP3943 is not set --# CONFIG_MFD_LP8788 is not set --# CONFIG_MFD_PALMAS is not set --# CONFIG_TPS6105X is not set --# CONFIG_TPS65010 is not set --# CONFIG_TPS6507X is not set --# CONFIG_MFD_TPS65090 is not set --# CONFIG_MFD_TPS65217 is not set --# CONFIG_MFD_TPS65218 is not set --# CONFIG_MFD_TPS6586X is not set --# CONFIG_MFD_TPS65910 is not set --# CONFIG_MFD_TPS65912 is not set --# CONFIG_MFD_TPS65912_I2C is not set --# CONFIG_MFD_TPS65912_SPI is not set --# CONFIG_MFD_TPS80031 is not set --# CONFIG_TWL4030_CORE is not set --# CONFIG_TWL6040_CORE is not set --CONFIG_MFD_WL1273_CORE=m --# CONFIG_MFD_LM3533 is not set --# CONFIG_MFD_TC3589X is not set --# CONFIG_MFD_TMIO is not set --# CONFIG_MFD_T7L66XB is not set --# CONFIG_MFD_TC6387XB is not set --# CONFIG_MFD_TC6393XB is not set --# CONFIG_MFD_VX855 is not set --# CONFIG_MFD_ARIZONA_I2C is not set --# CONFIG_MFD_ARIZONA_SPI is not set --# CONFIG_MFD_WM8400 is not set --# CONFIG_MFD_WM831X_I2C is not set --# CONFIG_MFD_WM831X_SPI is not set --# CONFIG_MFD_WM8350_I2C is not set --# CONFIG_MFD_WM8994 is not set --# CONFIG_MFD_TDA1997X is not set --CONFIG_REGULATOR=y --# CONFIG_REGULATOR_DEBUG is not set --CONFIG_REGULATOR_FIXED_VOLTAGE=y --CONFIG_REGULATOR_VIRTUAL_CONSUMER=y --CONFIG_REGULATOR_USERSPACE_CONSUMER=m --# CONFIG_REGULATOR_ACT8865 is not set --# CONFIG_REGULATOR_AD5398 is not set --CONFIG_REGULATOR_ANATOP=y --# CONFIG_REGULATOR_DA9052 is not set --# CONFIG_REGULATOR_DA9210 is not set --# CONFIG_REGULATOR_DA9211 is not set --# CONFIG_REGULATOR_FAN53555 is not set --CONFIG_REGULATOR_GPIO=y --# CONFIG_REGULATOR_ISL9305 is not set --# CONFIG_REGULATOR_ISL6271A is not set --# CONFIG_REGULATOR_LP3971 is not set --# CONFIG_REGULATOR_LP3972 is not set --# CONFIG_REGULATOR_LP872X is not set --# CONFIG_REGULATOR_LP8755 is not set --# CONFIG_REGULATOR_LTC3589 is not set --# CONFIG_REGULATOR_LTC3676 is not set --# CONFIG_REGULATOR_MAX1586 is not set --# CONFIG_REGULATOR_MAX8649 is not set --# CONFIG_REGULATOR_MAX8660 is not set --# CONFIG_REGULATOR_MAX8952 is not set --# CONFIG_REGULATOR_MAX8973 is not set --CONFIG_REGULATOR_MC13XXX_CORE=y --CONFIG_REGULATOR_MC13783=y --CONFIG_REGULATOR_MC13892=y --# CONFIG_REGULATOR_MT6311 is not set --CONFIG_REGULATOR_PFUZE100=y --CONFIG_REGULATOR_PWM=y --# CONFIG_REGULATOR_TPS51632 is not set --# CONFIG_REGULATOR_TPS62360 is not set --# CONFIG_REGULATOR_TPS65023 is not set --# CONFIG_REGULATOR_TPS6507X is not set --# CONFIG_REGULATOR_TPS6524X is not set --CONFIG_MEDIA_SUPPORT=y -- --# --# Multimedia core support --# --CONFIG_MEDIA_CAMERA_SUPPORT=y --CONFIG_MEDIA_ANALOG_TV_SUPPORT=y --CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y --CONFIG_MEDIA_RADIO_SUPPORT=y --CONFIG_MEDIA_SDR_SUPPORT=y --CONFIG_MEDIA_RC_SUPPORT=y --CONFIG_MEDIA_CONTROLLER=y --CONFIG_VIDEO_DEV=y --CONFIG_VIDEO_V4L2_SUBDEV_API=y --CONFIG_VIDEO_V4L2=y --# CONFIG_VIDEO_ADV_DEBUG is not set --# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set --CONFIG_VIDEO_TUNER=m --CONFIG_V4L2_MEM2MEM_DEV=m --CONFIG_VIDEO_V4L2_INT_DEVICE=m --CONFIG_VIDEOBUF_GEN=y --CONFIG_VIDEOBUF_DMA_SG=m --CONFIG_VIDEOBUF_VMALLOC=m --CONFIG_VIDEOBUF_DMA_CONTIG=y --CONFIG_VIDEOBUF_DVB=m --CONFIG_VIDEOBUF2_CORE=y --CONFIG_VIDEOBUF2_MEMOPS=m --CONFIG_VIDEOBUF2_DMA_CONTIG=m --CONFIG_VIDEOBUF2_VMALLOC=m --CONFIG_VIDEOBUF2_DMA_SG=m --CONFIG_VIDEOBUF2_DVB=m --CONFIG_DVB_CORE=y --CONFIG_DVB_NET=y --CONFIG_TTPCI_EEPROM=m --CONFIG_DVB_MAX_ADAPTERS=8 --# CONFIG_DVB_DYNAMIC_MINORS is not set -- --# --# Media drivers --# --CONFIG_RC_CORE=y --CONFIG_RC_MAP=m --CONFIG_RC_DECODERS=y --CONFIG_LIRC=m --CONFIG_IR_LIRC_CODEC=m --CONFIG_IR_NEC_DECODER=m --CONFIG_IR_RC5_DECODER=m --CONFIG_IR_RC6_DECODER=y --CONFIG_IR_JVC_DECODER=m --CONFIG_IR_SONY_DECODER=m --CONFIG_IR_SANYO_DECODER=m --CONFIG_IR_SHARP_DECODER=m --CONFIG_IR_MCE_KBD_DECODER=m --CONFIG_IR_XMP_DECODER=m --CONFIG_RC_DEVICES=y --CONFIG_RC_ATI_REMOTE=m --CONFIG_IR_HIX5HD2=m --CONFIG_IR_IMON=m --CONFIG_IR_MCEUSB=m --CONFIG_IR_REDRAT3=m --CONFIG_IR_STREAMZAP=m --CONFIG_IR_IGORPLUGUSB=m --CONFIG_IR_IGUANA=m --CONFIG_IR_TTUSBIR=m --CONFIG_RC_LOOPBACK=m --CONFIG_IR_GPIO_CIR=m --CONFIG_MEDIA_USB_SUPPORT=y -- --# --# Webcam devices --# --CONFIG_USB_VIDEO_CLASS=m --CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y --CONFIG_USB_GSPCA=m --CONFIG_USB_M5602=m --CONFIG_USB_STV06XX=m --CONFIG_USB_GL860=m --CONFIG_USB_GSPCA_BENQ=m --CONFIG_USB_GSPCA_CONEX=m --CONFIG_USB_GSPCA_CPIA1=m --CONFIG_USB_GSPCA_DTCS033=m --CONFIG_USB_GSPCA_ETOMS=m --CONFIG_USB_GSPCA_FINEPIX=m --CONFIG_USB_GSPCA_JEILINJ=m --CONFIG_USB_GSPCA_JL2005BCD=m --CONFIG_USB_GSPCA_KINECT=m --CONFIG_USB_GSPCA_KONICA=m --CONFIG_USB_GSPCA_MARS=m --CONFIG_USB_GSPCA_MR97310A=m --CONFIG_USB_GSPCA_NW80X=m --CONFIG_USB_GSPCA_OV519=m --CONFIG_USB_GSPCA_OV534=m --CONFIG_USB_GSPCA_OV534_9=m --CONFIG_USB_GSPCA_PAC207=m --CONFIG_USB_GSPCA_PAC7302=m --CONFIG_USB_GSPCA_PAC7311=m --CONFIG_USB_GSPCA_SE401=m --CONFIG_USB_GSPCA_SN9C2028=m --CONFIG_USB_GSPCA_SN9C20X=m --CONFIG_USB_GSPCA_SONIXB=m --CONFIG_USB_GSPCA_SONIXJ=m --CONFIG_USB_GSPCA_SPCA500=m --CONFIG_USB_GSPCA_SPCA501=m --CONFIG_USB_GSPCA_SPCA505=m --CONFIG_USB_GSPCA_SPCA506=m --CONFIG_USB_GSPCA_SPCA508=m --CONFIG_USB_GSPCA_SPCA561=m --CONFIG_USB_GSPCA_SPCA1528=m --CONFIG_USB_GSPCA_SQ905=m --CONFIG_USB_GSPCA_SQ905C=m --CONFIG_USB_GSPCA_SQ930X=m --CONFIG_USB_GSPCA_STK014=m --CONFIG_USB_GSPCA_STK1135=m --CONFIG_USB_GSPCA_STV0680=m --CONFIG_USB_GSPCA_SUNPLUS=m --CONFIG_USB_GSPCA_T613=m --CONFIG_USB_GSPCA_TOPRO=m --# CONFIG_USB_GSPCA_TOUPTEK is not set --CONFIG_USB_GSPCA_TV8532=m --CONFIG_USB_GSPCA_VC032X=m --CONFIG_USB_GSPCA_VICAM=m --CONFIG_USB_GSPCA_XIRLINK_CIT=m --CONFIG_USB_GSPCA_ZC3XX=m --CONFIG_USB_PWC=m --# CONFIG_USB_PWC_DEBUG is not set --CONFIG_USB_PWC_INPUT_EVDEV=y --CONFIG_VIDEO_CPIA2=m --CONFIG_USB_ZR364XX=m --CONFIG_USB_STKWEBCAM=m --CONFIG_USB_S2255=m --CONFIG_VIDEO_USBTV=m -- --# --# Analog TV USB devices --# --CONFIG_VIDEO_PVRUSB2=m --CONFIG_VIDEO_PVRUSB2_SYSFS=y --CONFIG_VIDEO_PVRUSB2_DVB=y --# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set --CONFIG_VIDEO_HDPVR=m --CONFIG_VIDEO_USBVISION=m --CONFIG_VIDEO_STK1160_COMMON=m --CONFIG_VIDEO_STK1160_AC97=y --CONFIG_VIDEO_STK1160=m --CONFIG_VIDEO_GO7007=m --CONFIG_VIDEO_GO7007_USB=m --CONFIG_VIDEO_GO7007_LOADER=m --CONFIG_VIDEO_GO7007_USB_S2250_BOARD=m -- --# --# Analog/digital TV USB devices --# --CONFIG_VIDEO_AU0828=m --CONFIG_VIDEO_AU0828_V4L2=y --CONFIG_VIDEO_AU0828_RC=y --CONFIG_VIDEO_CX231XX=m --CONFIG_VIDEO_CX231XX_RC=y --CONFIG_VIDEO_CX231XX_ALSA=m --CONFIG_VIDEO_CX231XX_DVB=m --CONFIG_VIDEO_TM6000=m --CONFIG_VIDEO_TM6000_ALSA=m --CONFIG_VIDEO_TM6000_DVB=m -- --# --# Digital TV USB devices --# --CONFIG_DVB_USB=m --# CONFIG_DVB_USB_DEBUG is not set --CONFIG_DVB_USB_A800=m --CONFIG_DVB_USB_DIBUSB_MB=m --CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y --CONFIG_DVB_USB_DIBUSB_MC=m --CONFIG_DVB_USB_DIB0700=m --CONFIG_DVB_USB_UMT_010=m --CONFIG_DVB_USB_CXUSB=m --CONFIG_DVB_USB_M920X=m --CONFIG_DVB_USB_DIGITV=m --CONFIG_DVB_USB_VP7045=m --CONFIG_DVB_USB_VP702X=m --CONFIG_DVB_USB_GP8PSK=m --CONFIG_DVB_USB_NOVA_T_USB2=m --CONFIG_DVB_USB_TTUSB2=m --CONFIG_DVB_USB_DTT200U=m --CONFIG_DVB_USB_OPERA1=m --CONFIG_DVB_USB_AF9005=m --CONFIG_DVB_USB_AF9005_REMOTE=m --CONFIG_DVB_USB_PCTV452E=m --CONFIG_DVB_USB_DW2102=m --CONFIG_DVB_USB_CINERGY_T2=m --CONFIG_DVB_USB_DTV5100=m --CONFIG_DVB_USB_FRIIO=m --CONFIG_DVB_USB_AZ6027=m --CONFIG_DVB_USB_TECHNISAT_USB2=m --CONFIG_DVB_USB_V2=m --CONFIG_DVB_USB_AF9015=m --CONFIG_DVB_USB_AF9035=m --CONFIG_DVB_USB_ANYSEE=m --CONFIG_DVB_USB_AU6610=m --CONFIG_DVB_USB_AZ6007=m --CONFIG_DVB_USB_CE6230=m --CONFIG_DVB_USB_EC168=m --CONFIG_DVB_USB_GL861=m --CONFIG_DVB_USB_LME2510=m --CONFIG_DVB_USB_MXL111SF=m --CONFIG_DVB_USB_RTL28XXU=m --CONFIG_DVB_USB_DVBSKY=m --CONFIG_DVB_TTUSB_BUDGET=m --CONFIG_DVB_TTUSB_DEC=m --CONFIG_SMS_USB_DRV=m --CONFIG_DVB_B2C2_FLEXCOP_USB=m --# CONFIG_DVB_B2C2_FLEXCOP_USB_DEBUG is not set --CONFIG_DVB_AS102=m -- --# --# Webcam, TV (analog/digital) USB devices --# --CONFIG_VIDEO_EM28XX=m --CONFIG_VIDEO_EM28XX_V4L2=m --CONFIG_VIDEO_EM28XX_ALSA=m --CONFIG_VIDEO_EM28XX_DVB=m --CONFIG_VIDEO_EM28XX_RC=m -- --# --# Software defined radio USB devices --# --CONFIG_USB_AIRSPY=m --CONFIG_USB_HACKRF=m --CONFIG_USB_MSI2500=m --CONFIG_MEDIA_PCI_SUPPORT=y -- --# --# Media capture support --# --CONFIG_VIDEO_SOLO6X10=m --CONFIG_VIDEO_TW68=m -- --# --# Media capture/analog TV support --# --CONFIG_VIDEO_IVTV=m --CONFIG_VIDEO_IVTV_ALSA=m --CONFIG_VIDEO_FB_IVTV=m --CONFIG_VIDEO_HEXIUM_GEMINI=m --CONFIG_VIDEO_HEXIUM_ORION=m --CONFIG_VIDEO_MXB=m --CONFIG_VIDEO_DT3155=m -- --# --# Media capture/analog/hybrid TV support --# --CONFIG_VIDEO_CX18=m --CONFIG_VIDEO_CX18_ALSA=m --CONFIG_VIDEO_CX23885=m --CONFIG_MEDIA_ALTERA_CI=m --CONFIG_VIDEO_CX25821=m --CONFIG_VIDEO_CX25821_ALSA=m --CONFIG_VIDEO_CX88=m --CONFIG_VIDEO_CX88_ALSA=m --CONFIG_VIDEO_CX88_BLACKBIRD=m --CONFIG_VIDEO_CX88_DVB=m --CONFIG_VIDEO_CX88_ENABLE_VP3054=y --CONFIG_VIDEO_CX88_VP3054=m --CONFIG_VIDEO_CX88_MPEG=m --CONFIG_VIDEO_BT848=m --CONFIG_DVB_BT8XX=m --CONFIG_VIDEO_SAA7134=m --CONFIG_VIDEO_SAA7134_ALSA=m --CONFIG_VIDEO_SAA7134_RC=y --CONFIG_VIDEO_SAA7134_DVB=m --CONFIG_VIDEO_SAA7134_GO7007=m --CONFIG_VIDEO_SAA7164=m -- --# --# Media digital TV PCI Adapters --# --CONFIG_DVB_AV7110_IR=y --CONFIG_DVB_AV7110=m --CONFIG_DVB_AV7110_OSD=y --CONFIG_DVB_BUDGET_CORE=m --CONFIG_DVB_BUDGET=m --CONFIG_DVB_BUDGET_CI=m --CONFIG_DVB_BUDGET_AV=m --CONFIG_DVB_BUDGET_PATCH=m --CONFIG_DVB_B2C2_FLEXCOP_PCI=m --# CONFIG_DVB_B2C2_FLEXCOP_PCI_DEBUG is not set --CONFIG_DVB_PLUTO2=m --CONFIG_DVB_DM1105=m --CONFIG_DVB_PT1=m --CONFIG_DVB_PT3=m --CONFIG_MANTIS_CORE=m --CONFIG_DVB_MANTIS=m --CONFIG_DVB_HOPPER=m --CONFIG_DVB_NGENE=m --CONFIG_DVB_DDBRIDGE=m --CONFIG_DVB_SMIPCIE=m --# CONFIG_DVB_NETUP_UNIDVB is not set --CONFIG_V4L_PLATFORM_DRIVERS=y --# CONFIG_VIDEO_CAFE_CCIC is not set --CONFIG_VIDEO_MXC_OUTPUT=y --CONFIG_VIDEO_MXC_CAPTURE=m -- --# --# MXC Camera/V4L2 PRP Features support --# --CONFIG_VIDEO_MXC_IPU_CAMERA=y --# CONFIG_VIDEO_MXC_CSI_CAMERA is not set --# CONFIG_MXC_TVIN_TDA1997X is not set --CONFIG_MXC_CAMERA_OV5640=m --CONFIG_MXC_CAMERA_OV5642=m --CONFIG_MXC_CAMERA_OV5640_MIPI=m --CONFIG_MXC_CAMERA_OV5647_MIPI=m --# CONFIG_MXC_HDMI_CSI2_TC358743 is not set --# CONFIG_MXC_TVIN_ADV7180 is not set --CONFIG_MXC_IPU_DEVICE_QUEUE_SDC=m --CONFIG_MXC_IPU_PRP_ENC=m --CONFIG_MXC_IPU_CSI_ENC=m --CONFIG_VIDEO_MXC_IPU_OUTPUT=y --CONFIG_VIDEO_MXC_PXP_V4L2=y --CONFIG_SOC_CAMERA=y --CONFIG_SOC_CAMERA_PLATFORM=y --# CONFIG_VIDEO_XILINX is not set --CONFIG_V4L_MEM2MEM_DRIVERS=y --# CONFIG_VIDEO_CODA is not set --CONFIG_VIDEO_MEM2MEM_DEINTERLACE=m --CONFIG_VIDEO_SH_VEU=m --# CONFIG_V4L_TEST_DRIVERS is not set --# CONFIG_DVB_PLATFORM_DRIVERS is not set -- --# --# Supported MMC/SDIO adapters --# --CONFIG_SMS_SDIO_DRV=m --CONFIG_RADIO_ADAPTERS=y --CONFIG_RADIO_TEA575X=m --CONFIG_RADIO_SI470X=y --CONFIG_USB_SI470X=m --CONFIG_I2C_SI470X=m --CONFIG_RADIO_SI4713=m --CONFIG_USB_SI4713=m --CONFIG_PLATFORM_SI4713=m --CONFIG_I2C_SI4713=m --CONFIG_RADIO_SI476X=m --CONFIG_USB_MR800=m --CONFIG_USB_DSBR=m --CONFIG_RADIO_MAXIRADIO=m --CONFIG_RADIO_SHARK=m --CONFIG_RADIO_SHARK2=m --CONFIG_USB_KEENE=m --CONFIG_USB_RAREMONO=m --CONFIG_USB_MA901=m --CONFIG_RADIO_TEA5764=m --CONFIG_RADIO_SAA7706H=m --CONFIG_RADIO_TEF6862=m --CONFIG_RADIO_WL1273=m -- --# --# Texas Instruments WL128x FM driver (ST based) --# --CONFIG_RADIO_WL128X=m --CONFIG_MEDIA_COMMON_OPTIONS=y -- --# --# common driver options --# --CONFIG_VIDEO_CX2341X=m --CONFIG_VIDEO_TVEEPROM=m --CONFIG_CYPRESS_FIRMWARE=m --CONFIG_DVB_B2C2_FLEXCOP=m --CONFIG_VIDEO_SAA7146=m --CONFIG_VIDEO_SAA7146_VV=m --CONFIG_SMS_SIANO_MDTV=m --CONFIG_SMS_SIANO_RC=y --# CONFIG_SMS_SIANO_DEBUGFS is not set -- --# --# Media ancillary drivers (tuners, sensors, i2c, frontends) --# --# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set --CONFIG_MEDIA_ATTACH=y --CONFIG_VIDEO_IR_I2C=m -- --# --# Encoders, decoders, sensors and other helper chips --# -- --# --# Audio decoders, processors and mixers --# --CONFIG_VIDEO_TVAUDIO=m --CONFIG_VIDEO_TDA7432=m --CONFIG_VIDEO_TDA9840=m --CONFIG_VIDEO_TEA6415C=m --CONFIG_VIDEO_TEA6420=m --CONFIG_VIDEO_MSP3400=m --CONFIG_VIDEO_CS5345=m --CONFIG_VIDEO_CS53L32A=m --CONFIG_VIDEO_TLV320AIC23B=m --CONFIG_VIDEO_UDA1342=m --CONFIG_VIDEO_WM8775=m --CONFIG_VIDEO_WM8739=m --CONFIG_VIDEO_VP27SMPX=m --CONFIG_VIDEO_SONY_BTF_MPX=m -- --# --# RDS decoders --# --CONFIG_VIDEO_SAA6588=m -- --# --# Video decoders --# --CONFIG_VIDEO_ADV7180=m --CONFIG_VIDEO_ADV7183=m --CONFIG_VIDEO_ADV7604=m --CONFIG_VIDEO_ADV7842=m --CONFIG_VIDEO_BT819=m --CONFIG_VIDEO_BT856=m --CONFIG_VIDEO_BT866=m --CONFIG_VIDEO_KS0127=m --CONFIG_VIDEO_ML86V7667=m --CONFIG_VIDEO_SAA7110=m --CONFIG_VIDEO_SAA711X=m --CONFIG_VIDEO_TC358743=m --CONFIG_VIDEO_TVP514X=m --CONFIG_VIDEO_TVP5150=m --CONFIG_VIDEO_TVP7002=m --CONFIG_VIDEO_TW2804=m --CONFIG_VIDEO_TW9903=m --CONFIG_VIDEO_TW9906=m --CONFIG_VIDEO_VPX3220=m -- --# --# Video and audio decoders --# --CONFIG_VIDEO_SAA717X=m --CONFIG_VIDEO_CX25840=m -- --# --# Video encoders --# --CONFIG_VIDEO_SAA7127=m --CONFIG_VIDEO_SAA7185=m --CONFIG_VIDEO_ADV7170=m --CONFIG_VIDEO_ADV7175=m --CONFIG_VIDEO_ADV7343=m --CONFIG_VIDEO_ADV7393=m --CONFIG_VIDEO_ADV7511=m --CONFIG_VIDEO_AD9389B=m --CONFIG_VIDEO_AK881X=m --CONFIG_VIDEO_THS8200=m -- --# --# Camera sensor devices --# --CONFIG_VIDEO_APTINA_PLL=m --CONFIG_VIDEO_SMIAPP_PLL=m --CONFIG_VIDEO_OV2659=m --CONFIG_VIDEO_OV7640=m --CONFIG_VIDEO_OV7670=m --CONFIG_VIDEO_OV9650=m --CONFIG_VIDEO_VS6624=m --CONFIG_VIDEO_MT9M032=m --CONFIG_VIDEO_MT9P031=m --CONFIG_VIDEO_MT9T001=m --CONFIG_VIDEO_MT9V011=m --CONFIG_VIDEO_MT9V032=m --CONFIG_VIDEO_SR030PC30=m --CONFIG_VIDEO_NOON010PC30=m --CONFIG_VIDEO_M5MOLS=m --CONFIG_VIDEO_S5K6AA=m --CONFIG_VIDEO_S5K6A3=m --CONFIG_VIDEO_S5K4ECGX=m --CONFIG_VIDEO_S5K5BAF=m --CONFIG_VIDEO_SMIAPP=m --CONFIG_VIDEO_S5C73M3=m -- --# --# Flash devices --# --CONFIG_VIDEO_ADP1653=m --CONFIG_VIDEO_AS3645A=m --CONFIG_VIDEO_LM3560=m --CONFIG_VIDEO_LM3646=m -- --# --# Video improvement chips --# --CONFIG_VIDEO_UPD64031A=m --CONFIG_VIDEO_UPD64083=m -- --# --# Audio/Video compression chips --# --CONFIG_VIDEO_SAA6752HS=m -- --# --# Miscellaneous helper chips --# --CONFIG_VIDEO_THS7303=m --CONFIG_VIDEO_M52790=m -- --# --# Sensors used on soc_camera driver --# -- --# --# soc_camera sensor drivers --# --CONFIG_SOC_CAMERA_IMX074=m --CONFIG_SOC_CAMERA_MT9M001=m --CONFIG_SOC_CAMERA_MT9M111=m --CONFIG_SOC_CAMERA_MT9T031=m --CONFIG_SOC_CAMERA_MT9T112=m --CONFIG_SOC_CAMERA_MT9V022=m --CONFIG_SOC_CAMERA_OV2640=m --CONFIG_SOC_CAMERA_OV5642=m --CONFIG_SOC_CAMERA_OV6650=m --CONFIG_SOC_CAMERA_OV772X=m --CONFIG_SOC_CAMERA_OV9640=m --CONFIG_SOC_CAMERA_OV9740=m --CONFIG_SOC_CAMERA_RJ54N1=m --CONFIG_SOC_CAMERA_TW9910=m --CONFIG_MEDIA_TUNER=y -- --# --# Customize TV tuners --# --CONFIG_MEDIA_TUNER_SIMPLE=m --CONFIG_MEDIA_TUNER_TDA8290=m --CONFIG_MEDIA_TUNER_TDA827X=m --CONFIG_MEDIA_TUNER_TDA18271=m --CONFIG_MEDIA_TUNER_TDA9887=m --CONFIG_MEDIA_TUNER_TEA5761=m --CONFIG_MEDIA_TUNER_TEA5767=m --CONFIG_MEDIA_TUNER_MSI001=m --CONFIG_MEDIA_TUNER_MT20XX=m --CONFIG_MEDIA_TUNER_MT2060=m --CONFIG_MEDIA_TUNER_MT2063=m --CONFIG_MEDIA_TUNER_MT2266=m --CONFIG_MEDIA_TUNER_MT2131=m --CONFIG_MEDIA_TUNER_QT1010=m --CONFIG_MEDIA_TUNER_XC2028=m --CONFIG_MEDIA_TUNER_XC5000=m --CONFIG_MEDIA_TUNER_XC4000=m --CONFIG_MEDIA_TUNER_MXL5005S=m --CONFIG_MEDIA_TUNER_MXL5007T=m --CONFIG_MEDIA_TUNER_MC44S803=m --CONFIG_MEDIA_TUNER_MAX2165=m --CONFIG_MEDIA_TUNER_TDA18218=m --CONFIG_MEDIA_TUNER_FC0011=m --CONFIG_MEDIA_TUNER_FC0012=m --CONFIG_MEDIA_TUNER_FC0013=m --CONFIG_MEDIA_TUNER_TDA18212=m --CONFIG_MEDIA_TUNER_E4000=m --CONFIG_MEDIA_TUNER_FC2580=m --CONFIG_MEDIA_TUNER_M88RS6000T=m --CONFIG_MEDIA_TUNER_TUA9001=m --CONFIG_MEDIA_TUNER_SI2157=m --CONFIG_MEDIA_TUNER_IT913X=m --CONFIG_MEDIA_TUNER_R820T=m --CONFIG_MEDIA_TUNER_MXL301RF=m --CONFIG_MEDIA_TUNER_QM1D1C0042=m -- --# --# Customise DVB Frontends --# -- --# --# Multistandard (satellite) frontends --# --CONFIG_DVB_STB0899=m --CONFIG_DVB_STB6100=m --CONFIG_DVB_STV090x=m --CONFIG_DVB_STV6110x=m --CONFIG_DVB_M88DS3103=m -- --# --# Multistandard (cable + terrestrial) frontends --# --CONFIG_DVB_DRXK=m --CONFIG_DVB_TDA18271C2DD=m --CONFIG_DVB_SI2165=m -- --# --# DVB-S (satellite) frontends --# --CONFIG_DVB_CX24110=m --CONFIG_DVB_CX24123=m --CONFIG_DVB_MT312=m --CONFIG_DVB_ZL10036=m --CONFIG_DVB_ZL10039=m --CONFIG_DVB_S5H1420=m --CONFIG_DVB_STV0288=m --CONFIG_DVB_STB6000=m --CONFIG_DVB_STV0299=m --CONFIG_DVB_STV6110=m --CONFIG_DVB_STV0900=m --CONFIG_DVB_TDA8083=m --CONFIG_DVB_TDA10086=m --CONFIG_DVB_TDA8261=m --CONFIG_DVB_VES1X93=m --CONFIG_DVB_TUNER_ITD1000=m --CONFIG_DVB_TUNER_CX24113=m --CONFIG_DVB_TDA826X=m --CONFIG_DVB_TUA6100=m --CONFIG_DVB_CX24116=m --CONFIG_DVB_CX24117=m --CONFIG_DVB_CX24120=m --CONFIG_DVB_SI21XX=m --CONFIG_DVB_TS2020=m --CONFIG_DVB_DS3000=m --CONFIG_DVB_MB86A16=m --CONFIG_DVB_TDA10071=m -- --# --# DVB-T (terrestrial) frontends --# --CONFIG_DVB_SP8870=m --CONFIG_DVB_SP887X=m --CONFIG_DVB_CX22700=m --CONFIG_DVB_CX22702=m --CONFIG_DVB_S5H1432=m --CONFIG_DVB_DRXD=m --CONFIG_DVB_L64781=m --CONFIG_DVB_TDA1004X=m --CONFIG_DVB_NXT6000=m --CONFIG_DVB_MT352=m --CONFIG_DVB_ZL10353=m --CONFIG_DVB_DIB3000MB=m --CONFIG_DVB_DIB3000MC=m --CONFIG_DVB_DIB7000M=m --CONFIG_DVB_DIB7000P=m --CONFIG_DVB_DIB9000=m --CONFIG_DVB_TDA10048=m --CONFIG_DVB_AF9013=m --CONFIG_DVB_EC100=m --CONFIG_DVB_HD29L2=m --CONFIG_DVB_STV0367=m --CONFIG_DVB_CXD2820R=m --CONFIG_DVB_CXD2841ER=m --CONFIG_DVB_RTL2830=m --CONFIG_DVB_RTL2832=m --CONFIG_DVB_RTL2832_SDR=m --CONFIG_DVB_SI2168=m --CONFIG_DVB_AS102_FE=m -- --# --# DVB-C (cable) frontends --# --CONFIG_DVB_VES1820=m --CONFIG_DVB_TDA10021=m --CONFIG_DVB_TDA10023=m --CONFIG_DVB_STV0297=m -- --# --# ATSC (North American/Korean Terrestrial/Cable DTV) frontends --# --CONFIG_DVB_NXT200X=m --CONFIG_DVB_OR51211=m --CONFIG_DVB_OR51132=m --CONFIG_DVB_BCM3510=m --CONFIG_DVB_LGDT330X=m --CONFIG_DVB_LGDT3305=m --CONFIG_DVB_LGDT3306A=m --CONFIG_DVB_LG2160=m --CONFIG_DVB_S5H1409=m --CONFIG_DVB_AU8522=m --CONFIG_DVB_AU8522_DTV=m --CONFIG_DVB_AU8522_V4L=m --CONFIG_DVB_S5H1411=m -- --# --# ISDB-T (terrestrial) frontends --# --CONFIG_DVB_S921=m --CONFIG_DVB_DIB8000=m --CONFIG_DVB_MB86A20S=m -- --# --# ISDB-S (satellite) & ISDB-T (terrestrial) frontends --# --CONFIG_DVB_TC90522=m -- --# --# Digital terrestrial only tuners/PLL --# --CONFIG_DVB_PLL=m --CONFIG_DVB_TUNER_DIB0070=m --CONFIG_DVB_TUNER_DIB0090=m -- --# --# SEC control devices for DVB-S --# --CONFIG_DVB_DRX39XYJ=m --CONFIG_DVB_LNBH25=m --CONFIG_DVB_LNBP21=m --CONFIG_DVB_LNBP22=m --CONFIG_DVB_ISL6405=m --CONFIG_DVB_ISL6421=m --CONFIG_DVB_ISL6423=m --CONFIG_DVB_A8293=m --CONFIG_DVB_SP2=m --CONFIG_DVB_LGS8GL5=m --CONFIG_DVB_LGS8GXX=m --CONFIG_DVB_ATBM8830=m --CONFIG_DVB_TDA665x=m --CONFIG_DVB_IX2505V=m --CONFIG_DVB_M88RS2000=m --CONFIG_DVB_AF9033=m --CONFIG_DVB_HORUS3A=m --CONFIG_DVB_ASCOT2E=m -- --# --# Tools to develop new frontends --# --CONFIG_DVB_DUMMY_FE=m -- --# --# Graphics support --# --CONFIG_VGA_ARB=y --CONFIG_VGA_ARB_MAX_GPUS=16 --# CONFIG_IMX_IPUV3_CORE is not set --CONFIG_DRM=y --# CONFIG_DRM_FBDEV_EMULATION is not set --# CONFIG_DRM_TDFX is not set --# CONFIG_DRM_R128 is not set --# CONFIG_DRM_RADEON is not set --# CONFIG_DRM_AMDGPU is not set --# CONFIG_DRM_NOUVEAU is not set --# CONFIG_DRM_MGA is not set --# CONFIG_DRM_VIA is not set --# CONFIG_DRM_SAVAGE is not set --# CONFIG_DRM_VGEM is not set --# CONFIG_DRM_EXYNOS is not set --# CONFIG_DRM_UDL is not set --# CONFIG_DRM_AST is not set --# CONFIG_DRM_MGAG200 is not set --# CONFIG_DRM_CIRRUS_QEMU is not set --# CONFIG_DRM_ARMADA is not set --# CONFIG_DRM_TILCDC is not set --# CONFIG_DRM_QXL is not set --# CONFIG_DRM_BOCHS is not set --# CONFIG_DRM_FSL_DCU is not set --CONFIG_DRM_BRIDGE=y -- --# --# Display Interface Bridges --# --# CONFIG_DRM_NXP_PTN3460 is not set --# CONFIG_DRM_PARADE_PS8622 is not set --# CONFIG_DRM_STI is not set --CONFIG_DRM_VIVANTE=m -- --# --# Frame buffer Devices --# --CONFIG_FB=y --CONFIG_FIRMWARE_EDID=y --CONFIG_FB_CMDLINE=y --# CONFIG_FB_DDC is not set --# CONFIG_FB_BOOT_VESA_SUPPORT is not set --CONFIG_FB_CFB_FILLRECT=y --CONFIG_FB_CFB_COPYAREA=y --CONFIG_FB_CFB_IMAGEBLIT=y --# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set --CONFIG_FB_SYS_FILLRECT=m --CONFIG_FB_SYS_COPYAREA=m --CONFIG_FB_SYS_IMAGEBLIT=m --# CONFIG_FB_FOREIGN_ENDIAN is not set --CONFIG_FB_SYS_FOPS=m --CONFIG_FB_DEFERRED_IO=y --# CONFIG_FB_SVGALIB is not set --# CONFIG_FB_MACMODES is not set --CONFIG_FB_BACKLIGHT=y --CONFIG_FB_MODE_HELPERS=y --# CONFIG_FB_TILEBLITTING is not set -- --# --# Frame buffer hardware drivers --# --# CONFIG_FB_CIRRUS is not set --# CONFIG_FB_PM2 is not set --# CONFIG_FB_IMX is not set --# CONFIG_FB_CYBER2000 is not set --# CONFIG_FB_ASILIANT is not set --# CONFIG_FB_IMSTT is not set --# CONFIG_FB_UVESA is not set --# CONFIG_FB_OPENCORES is not set --# CONFIG_FB_S1D13XXX is not set --# CONFIG_FB_NVIDIA is not set --# CONFIG_FB_RIVA is not set --# CONFIG_FB_I740 is not set --# CONFIG_FB_MATROX is not set --# CONFIG_FB_RADEON is not set --# CONFIG_FB_ATY128 is not set --# CONFIG_FB_ATY is not set --# CONFIG_FB_S3 is not set --# CONFIG_FB_SAVAGE is not set --# CONFIG_FB_SIS is not set --# CONFIG_FB_NEOMAGIC is not set --# CONFIG_FB_KYRO is not set --# CONFIG_FB_3DFX is not set --# CONFIG_FB_VOODOO1 is not set --# CONFIG_FB_VT8623 is not set --# CONFIG_FB_TRIDENT is not set --# CONFIG_FB_ARK is not set --# CONFIG_FB_PM3 is not set --# CONFIG_FB_CARMINE is not set --# CONFIG_FB_SMSCUFX is not set --CONFIG_FB_UDL=m --# CONFIG_FB_IBM_GXT4500 is not set --# CONFIG_FB_VIRTUAL is not set --# CONFIG_FB_METRONOME is not set --# CONFIG_FB_MB862XX is not set --# CONFIG_FB_BROADSHEET is not set --# CONFIG_FB_AUO_K190X is not set --# CONFIG_FB_MXS is not set --# CONFIG_FB_SIMPLE is not set --# CONFIG_FB_SSD1307 is not set --# CONFIG_FB_SM712 is not set --CONFIG_FB_MXC=y --CONFIG_FB_MXC_SYNC_PANEL=y --# CONFIG_FB_MXC_TVOUT_ADV739X is not set --CONFIG_FB_MXC_LDB=y --# CONFIG_FB_MXC_MIPI_DSI is not set --CONFIG_FB_MXC_HDMI=y --CONFIG_FB_MXC_DCIC=y --CONFIG_FB_MXC_EDID=y --# CONFIG_FB_MXC_EINK_PANEL is not set --CONFIG_BACKLIGHT_LCD_SUPPORT=y --CONFIG_LCD_CLASS_DEVICE=m --# CONFIG_LCD_L4F00242T03 is not set --# CONFIG_LCD_LMS283GF05 is not set --# CONFIG_LCD_LTV350QV is not set --# CONFIG_LCD_ILI922X is not set --# CONFIG_LCD_ILI9320 is not set --# CONFIG_LCD_TDO24M is not set --# CONFIG_LCD_VGG2432A4 is not set --CONFIG_LCD_PLATFORM=m --# CONFIG_LCD_S6E63M0 is not set --# CONFIG_LCD_LD9040 is not set --# CONFIG_LCD_AMS369FG06 is not set --# CONFIG_LCD_LMS501KF03 is not set --# CONFIG_LCD_HX8357 is not set --CONFIG_BACKLIGHT_CLASS_DEVICE=y --# CONFIG_BACKLIGHT_GENERIC is not set --CONFIG_BACKLIGHT_PWM=m --# CONFIG_BACKLIGHT_DA9052 is not set --# CONFIG_BACKLIGHT_PM8941_WLED is not set --# CONFIG_BACKLIGHT_ADP8860 is not set --# CONFIG_BACKLIGHT_ADP8870 is not set --# CONFIG_BACKLIGHT_LM3630A is not set --# CONFIG_BACKLIGHT_LM3639 is not set --# CONFIG_BACKLIGHT_LP855X is not set --# CONFIG_BACKLIGHT_GPIO is not set --# CONFIG_BACKLIGHT_LV5207LP is not set --# CONFIG_BACKLIGHT_BD6107 is not set --# CONFIG_VGASTATE is not set --CONFIG_VIDEOMODE_HELPERS=y --CONFIG_HDMI=y -- --# --# Console display driver support --# --CONFIG_DUMMY_CONSOLE=y --CONFIG_FRAMEBUFFER_CONSOLE=y --CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y --# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set --# CONFIG_LOGO is not set --CONFIG_SOUND=y --# CONFIG_SOUND_OSS_CORE is not set --CONFIG_SND=y --CONFIG_SND_TIMER=y --CONFIG_SND_PCM=y --CONFIG_SND_DMAENGINE_PCM=y --CONFIG_SND_HWDEP=m --CONFIG_SND_RAWMIDI=m --CONFIG_SND_JACK=y --# CONFIG_SND_SEQUENCER is not set --# CONFIG_SND_MIXER_OSS is not set --# CONFIG_SND_PCM_OSS is not set --CONFIG_SND_PCM_TIMER=y --CONFIG_SND_HRTIMER=y --# CONFIG_SND_DYNAMIC_MINORS is not set --# CONFIG_SND_SUPPORT_OLD_API is not set --CONFIG_SND_PROC_FS=y --# CONFIG_SND_VERBOSE_PROCFS is not set --# CONFIG_SND_VERBOSE_PRINTK is not set --# CONFIG_SND_DEBUG is not set --CONFIG_SND_VMASTER=y --# CONFIG_SND_RAWMIDI_SEQ is not set --# CONFIG_SND_OPL3_LIB_SEQ is not set --# CONFIG_SND_OPL4_LIB_SEQ is not set --# CONFIG_SND_SBAWE_SEQ is not set --# CONFIG_SND_EMU10K1_SEQ is not set --CONFIG_SND_MPU401_UART=m --CONFIG_SND_AC97_CODEC=m --CONFIG_SND_DRIVERS=y --CONFIG_SND_DUMMY=m --CONFIG_SND_ALOOP=m --CONFIG_SND_MTPAV=m --CONFIG_SND_SERIAL_U16550=m --CONFIG_SND_MPU401=m --CONFIG_SND_AC97_POWER_SAVE=y --CONFIG_SND_AC97_POWER_SAVE_DEFAULT=1 --# CONFIG_SND_PCI is not set -- --# --# HD-Audio --# --CONFIG_SND_HDA_PREALLOC_SIZE=64 --CONFIG_SND_ARM=y --CONFIG_SND_SPI=y --CONFIG_SND_USB=y --CONFIG_SND_USB_AUDIO=m --CONFIG_SND_USB_UA101=m --CONFIG_SND_USB_CAIAQ=m --CONFIG_SND_USB_CAIAQ_INPUT=y --CONFIG_SND_USB_6FIRE=m --CONFIG_SND_USB_HIFACE=m --CONFIG_SND_BCD2000=m --CONFIG_SND_USB_LINE6=m --CONFIG_SND_USB_POD=m --CONFIG_SND_USB_PODHD=m --CONFIG_SND_USB_TONEPORT=m --CONFIG_SND_USB_VARIAX=m --CONFIG_SND_SOC=y --CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y --# CONFIG_SND_ATMEL_SOC is not set --# CONFIG_SND_DESIGNWARE_I2S is not set -- --# --# SoC Audio for Freescale CPUs --# -- --# --# Common SoC Audio options for Freescale CPUs: --# --# CONFIG_SND_SOC_FSL_ASRC is not set --CONFIG_SND_SOC_FSL_SAI=y --CONFIG_SND_SOC_FSL_SSI=y --CONFIG_SND_SOC_FSL_SPDIF=y --CONFIG_SND_SOC_FSL_ESAI=y --CONFIG_SND_SOC_FSL_HDMI=y --CONFIG_SND_SOC_FSL_UTILS=y --CONFIG_SND_SOC_IMX_PCM_DMA=y --CONFIG_SND_SOC_IMX_HDMI_DMA=y --CONFIG_SND_SOC_IMX_AUDMUX=y --CONFIG_SND_IMX_SOC=y -- --# --# SoC Audio support for Freescale i.MX boards: --# --# CONFIG_SND_SOC_EUKREA_TLV320 is not set --# CONFIG_SND_SOC_IMX_WM8731 is not set --# CONFIG_SND_SOC_IMX_WM8962 is not set --# CONFIG_SND_SOC_IMX_ES8328 is not set --CONFIG_SND_SOC_IMX_SGTL5000=y --# CONFIG_SND_SOC_IMX_AC97_VT1613 is not set --CONFIG_SND_SOC_IMX_SPDIF=y --# CONFIG_SND_SOC_IMX_MC13783 is not set --CONFIG_SND_SOC_IMX_HDMI=y --CONFIG_SND_SOC_FSL_ASOC_CARD=m --# CONFIG_SND_SOC_IMX_TDA1997X is not set -- --# --# Allwinner SoC Audio support --# --# CONFIG_SND_SUN4I_CODEC is not set --# CONFIG_SND_SOC_XTFPGA_I2S is not set --CONFIG_SND_SOC_I2C_AND_SPI=y -- --# --# CODEC drivers --# --# CONFIG_SND_SOC_AC97_CODEC is not set --# CONFIG_SND_SOC_ADAU1701 is not set --# CONFIG_SND_SOC_AK4104 is not set --# CONFIG_SND_SOC_AK4554 is not set --# CONFIG_SND_SOC_AK4613 is not set --# CONFIG_SND_SOC_AK4642 is not set --# CONFIG_SND_SOC_AK5386 is not set --# CONFIG_SND_SOC_ALC5623 is not set --# CONFIG_SND_SOC_CS35L32 is not set --# CONFIG_SND_SOC_CS42L51_I2C is not set --# CONFIG_SND_SOC_CS42L52 is not set --# CONFIG_SND_SOC_CS42L56 is not set --# CONFIG_SND_SOC_CS42L73 is not set --# CONFIG_SND_SOC_CS4265 is not set --# CONFIG_SND_SOC_CS4270 is not set --# CONFIG_SND_SOC_CS4271_I2C is not set --# CONFIG_SND_SOC_CS4271_SPI is not set --# CONFIG_SND_SOC_CS42XX8_I2C is not set --# CONFIG_SND_SOC_CS4349 is not set --CONFIG_SND_SOC_HDMI_CODEC=y --# CONFIG_SND_SOC_ES8328 is not set --# CONFIG_SND_SOC_GTM601 is not set --# CONFIG_SND_SOC_PCM1681 is not set --# CONFIG_SND_SOC_PCM1792A is not set --# CONFIG_SND_SOC_PCM512x_I2C is not set --# CONFIG_SND_SOC_PCM512x_SPI is not set --# CONFIG_SND_SOC_RT5631 is not set --# CONFIG_SND_SOC_RT5677_SPI is not set --CONFIG_SND_SOC_SGTL5000=y --CONFIG_SND_SOC_SI476X=m --# CONFIG_SND_SOC_SIRF_AUDIO_CODEC is not set --CONFIG_SND_SOC_SPDIF=y --# CONFIG_SND_SOC_SSM2602_SPI is not set --# CONFIG_SND_SOC_SSM2602_I2C is not set --# CONFIG_SND_SOC_SSM4567 is not set --# CONFIG_SND_SOC_STA32X is not set --# CONFIG_SND_SOC_STA350 is not set --# CONFIG_SND_SOC_STI_SAS is not set --# CONFIG_SND_SOC_TAS2552 is not set --# CONFIG_SND_SOC_TAS5086 is not set --# CONFIG_SND_SOC_TAS571X is not set --# CONFIG_SND_SOC_TFA9879 is not set --# CONFIG_SND_SOC_TLV320AIC23_I2C is not set --# CONFIG_SND_SOC_TLV320AIC23_SPI is not set --# CONFIG_SND_SOC_TLV320AIC31XX is not set --# CONFIG_SND_SOC_TLV320AIC3X is not set --# CONFIG_SND_SOC_TS3A227E is not set --# CONFIG_SND_SOC_WM8510 is not set --# CONFIG_SND_SOC_WM8523 is not set --# CONFIG_SND_SOC_WM8580 is not set --# CONFIG_SND_SOC_WM8711 is not set --# CONFIG_SND_SOC_WM8728 is not set --# CONFIG_SND_SOC_WM8731 is not set --# CONFIG_SND_SOC_WM8737 is not set --# CONFIG_SND_SOC_WM8741 is not set --# CONFIG_SND_SOC_WM8750 is not set --# CONFIG_SND_SOC_WM8753 is not set --# CONFIG_SND_SOC_WM8770 is not set --# CONFIG_SND_SOC_WM8776 is not set --# CONFIG_SND_SOC_WM8804_I2C is not set --# CONFIG_SND_SOC_WM8804_SPI is not set --# CONFIG_SND_SOC_WM8903 is not set --CONFIG_SND_SOC_WM8962=m --# CONFIG_SND_SOC_WM8978 is not set --# CONFIG_SND_SOC_TPA6130A2 is not set --# CONFIG_SND_SIMPLE_CARD is not set --# CONFIG_SOUND_PRIME is not set --CONFIG_AC97_BUS=m -- --# --# HID support --# --CONFIG_HID=y --CONFIG_HID_BATTERY_STRENGTH=y --CONFIG_HIDRAW=y --CONFIG_UHID=m --CONFIG_HID_GENERIC=y -- --# --# Special HID drivers --# --CONFIG_HID_A4TECH=m --CONFIG_HID_ACRUX=m --CONFIG_HID_ACRUX_FF=y --CONFIG_HID_APPLE=m --CONFIG_HID_APPLEIR=m --CONFIG_HID_AUREAL=m --CONFIG_HID_BELKIN=m --CONFIG_HID_BETOP_FF=m --CONFIG_HID_CHERRY=m --CONFIG_HID_CHICONY=m --# CONFIG_HID_CORSAIR is not set --CONFIG_HID_PRODIKEYS=m --CONFIG_HID_CP2112=m --CONFIG_HID_CYPRESS=m --CONFIG_HID_DRAGONRISE=m --CONFIG_DRAGONRISE_FF=y --CONFIG_HID_EMS_FF=m --CONFIG_HID_ELECOM=m --CONFIG_HID_ELO=m --CONFIG_HID_EZKEY=m --# CONFIG_HID_GEMBIRD is not set --# CONFIG_HID_GFRM is not set --CONFIG_HID_HOLTEK=m --CONFIG_HOLTEK_FF=y --CONFIG_HID_GT683R=m --CONFIG_HID_KEYTOUCH=m --CONFIG_HID_KYE=m --CONFIG_HID_UCLOGIC=m --CONFIG_HID_WALTOP=m --CONFIG_HID_GYRATION=m --CONFIG_HID_ICADE=m --CONFIG_HID_TWINHAN=m --CONFIG_HID_KENSINGTON=m --CONFIG_HID_LCPOWER=m --CONFIG_HID_LENOVO=m --CONFIG_HID_LOGITECH=m --CONFIG_HID_LOGITECH_DJ=m --CONFIG_HID_LOGITECH_HIDPP=m --CONFIG_LOGITECH_FF=y --CONFIG_LOGIRUMBLEPAD2_FF=y --CONFIG_LOGIG940_FF=y --CONFIG_LOGIWHEELS_FF=y --CONFIG_HID_MAGICMOUSE=m --CONFIG_HID_MICROSOFT=m --CONFIG_HID_MONTEREY=m --CONFIG_HID_MULTITOUCH=m --CONFIG_HID_NTRIG=m --CONFIG_HID_ORTEK=m --CONFIG_HID_PANTHERLORD=m --CONFIG_PANTHERLORD_FF=y --CONFIG_HID_PENMOUNT=m --CONFIG_HID_PETALYNX=m --CONFIG_HID_PICOLCD=m --CONFIG_HID_PICOLCD_FB=y --CONFIG_HID_PICOLCD_BACKLIGHT=y --CONFIG_HID_PICOLCD_LCD=y --CONFIG_HID_PICOLCD_LEDS=y --CONFIG_HID_PICOLCD_CIR=y --CONFIG_HID_PLANTRONICS=m --CONFIG_HID_PRIMAX=m --CONFIG_HID_ROCCAT=m --CONFIG_HID_SAITEK=m --CONFIG_HID_SAMSUNG=m --CONFIG_HID_SONY=m --CONFIG_SONY_FF=y --CONFIG_HID_SPEEDLINK=m --CONFIG_HID_STEELSERIES=m --CONFIG_HID_SUNPLUS=m --CONFIG_HID_RMI=m --CONFIG_HID_GREENASIA=m --CONFIG_GREENASIA_FF=y --CONFIG_HID_SMARTJOYPLUS=m --CONFIG_SMARTJOYPLUS_FF=y --CONFIG_HID_TIVO=m --CONFIG_HID_TOPSEED=m --CONFIG_HID_THINGM=m --CONFIG_HID_THRUSTMASTER=m --CONFIG_THRUSTMASTER_FF=y --CONFIG_HID_WACOM=m --CONFIG_HID_WIIMOTE=m --CONFIG_HID_XINMO=m --CONFIG_HID_ZEROPLUS=m --CONFIG_ZEROPLUS_FF=y --CONFIG_HID_ZYDACRON=m --CONFIG_HID_SENSOR_HUB=m --CONFIG_HID_SENSOR_CUSTOM_SENSOR=m -- --# --# USB HID support --# --CONFIG_USB_HID=y --CONFIG_HID_PID=y --CONFIG_USB_HIDDEV=y -- --# --# I2C HID support --# --CONFIG_I2C_HID=m --CONFIG_USB_OHCI_LITTLE_ENDIAN=y --CONFIG_USB_SUPPORT=y --CONFIG_USB_COMMON=y --CONFIG_USB_ARCH_HAS_HCD=y --CONFIG_USB=y --# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set -- --# --# Miscellaneous USB options --# --CONFIG_USB_DEFAULT_PERSIST=y --# CONFIG_USB_DYNAMIC_MINORS is not set --CONFIG_USB_OTG=y --# CONFIG_USB_OTG_WHITELIST is not set --# CONFIG_USB_OTG_BLACKLIST_HUB is not set --CONFIG_USB_OTG_FSM=y --# CONFIG_USB_ULPI_BUS is not set --# CONFIG_USB_MON is not set --# CONFIG_USB_WUSB_CBAF is not set -- --# --# USB Host Controller Drivers --# --# CONFIG_USB_C67X00_HCD is not set --# CONFIG_USB_XHCI_HCD is not set --CONFIG_USB_EHCI_HCD=y --CONFIG_USB_EHCI_ROOT_HUB_TT=y --CONFIG_USB_EHCI_TT_NEWSCHED=y --CONFIG_USB_FSL_MPH_DR_OF=m --CONFIG_USB_EHCI_PCI=y --CONFIG_USB_EHCI_MXC=y --CONFIG_USB_EHCI_HCD_PLATFORM=y --# CONFIG_USB_OXU210HP_HCD is not set --# CONFIG_USB_ISP116X_HCD is not set --# CONFIG_USB_ISP1362_HCD is not set --# CONFIG_USB_FOTG210_HCD is not set --# CONFIG_USB_MAX3421_HCD is not set --# CONFIG_USB_OHCI_HCD is not set --# CONFIG_USB_UHCI_HCD is not set --# CONFIG_USB_SL811_HCD is not set --# CONFIG_USB_R8A66597_HCD is not set --# CONFIG_USB_IMX21_HCD is not set --# CONFIG_USB_HCD_BCMA is not set --# CONFIG_USB_HCD_SSB is not set --# CONFIG_USB_HCD_TEST_MODE is not set -- --# --# USB Device Class drivers --# --CONFIG_USB_ACM=m --CONFIG_USB_PRINTER=m --CONFIG_USB_WDM=m --# CONFIG_USB_TMC is not set -- --# --# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may --# -- --# --# also be needed; see USB_STORAGE Help for more info --# --CONFIG_USB_STORAGE=y --# CONFIG_USB_STORAGE_DEBUG is not set --CONFIG_USB_STORAGE_REALTEK=y --CONFIG_REALTEK_AUTOPM=y --CONFIG_USB_STORAGE_DATAFAB=y --CONFIG_USB_STORAGE_FREECOM=y --CONFIG_USB_STORAGE_ISD200=y --CONFIG_USB_STORAGE_USBAT=y --CONFIG_USB_STORAGE_SDDR09=y --CONFIG_USB_STORAGE_SDDR55=y --CONFIG_USB_STORAGE_JUMPSHOT=y --CONFIG_USB_STORAGE_ALAUDA=y --CONFIG_USB_STORAGE_ONETOUCH=y --CONFIG_USB_STORAGE_KARMA=m --CONFIG_USB_STORAGE_CYPRESS_ATACB=y --CONFIG_USB_STORAGE_ENE_UB6250=y --CONFIG_USB_UAS=y -- --# --# USB Imaging devices --# --# CONFIG_USB_MDC800 is not set --# CONFIG_USB_MICROTEK is not set --CONFIG_USBIP_CORE=m --CONFIG_USBIP_VHCI_HCD=m --CONFIG_USBIP_HOST=m --# CONFIG_USBIP_DEBUG is not set --CONFIG_USB_MUSB_HDRC=m --CONFIG_USB_MUSB_HOST=y --# CONFIG_USB_MUSB_GADGET is not set --# CONFIG_USB_MUSB_DUAL_ROLE is not set -- --# --# Platform Glue Layer --# -- --# --# MUSB DMA mode --# --CONFIG_MUSB_PIO_ONLY=y --CONFIG_USB_DWC3=m --# CONFIG_USB_DWC3_HOST is not set --# CONFIG_USB_DWC3_GADGET is not set --CONFIG_USB_DWC3_DUAL_ROLE=y -- --# --# Platform Glue Driver Support --# --CONFIG_USB_DWC3_PCI=m --CONFIG_USB_DWC2=m --# CONFIG_USB_DWC2_HOST is not set -- --# --# Gadget/Dual-role mode requires USB Gadget support to be enabled --# --# CONFIG_USB_DWC2_PERIPHERAL is not set --CONFIG_USB_DWC2_DUAL_ROLE=y --CONFIG_USB_DWC2_PCI=m --# CONFIG_USB_DWC2_DEBUG is not set --# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set --CONFIG_USB_CHIPIDEA=y --CONFIG_USB_CHIPIDEA_OF=y --CONFIG_USB_CHIPIDEA_PCI=y --# CONFIG_USB_CHIPIDEA_UDC is not set --CONFIG_USB_CHIPIDEA_HOST=y --# CONFIG_USB_CHIPIDEA_DEBUG is not set --# CONFIG_USB_ISP1760 is not set -- --# --# USB port drivers --# --CONFIG_USB_SERIAL=y --CONFIG_USB_SERIAL_CONSOLE=y --CONFIG_USB_SERIAL_GENERIC=y --CONFIG_USB_SERIAL_SIMPLE=m --CONFIG_USB_SERIAL_AIRCABLE=m --CONFIG_USB_SERIAL_ARK3116=m --CONFIG_USB_SERIAL_BELKIN=m --CONFIG_USB_SERIAL_CH341=m --CONFIG_USB_SERIAL_WHITEHEAT=m --CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m --CONFIG_USB_SERIAL_CP210X=m --CONFIG_USB_SERIAL_CYPRESS_M8=m --CONFIG_USB_SERIAL_EMPEG=m --CONFIG_USB_SERIAL_FTDI_SIO=m --CONFIG_USB_SERIAL_VISOR=m --CONFIG_USB_SERIAL_IPAQ=m --CONFIG_USB_SERIAL_IR=m --CONFIG_USB_SERIAL_EDGEPORT=m --CONFIG_USB_SERIAL_EDGEPORT_TI=m --CONFIG_USB_SERIAL_F81232=m --CONFIG_USB_SERIAL_GARMIN=m --CONFIG_USB_SERIAL_IPW=m --CONFIG_USB_SERIAL_IUU=m --CONFIG_USB_SERIAL_KEYSPAN_PDA=m --CONFIG_USB_SERIAL_KEYSPAN=m --CONFIG_USB_SERIAL_KEYSPAN_MPR=y --CONFIG_USB_SERIAL_KEYSPAN_USA28=y --CONFIG_USB_SERIAL_KEYSPAN_USA28X=y --CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y --CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y --CONFIG_USB_SERIAL_KEYSPAN_USA19=y --CONFIG_USB_SERIAL_KEYSPAN_USA18X=y --CONFIG_USB_SERIAL_KEYSPAN_USA19W=y --CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y --CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y --CONFIG_USB_SERIAL_KEYSPAN_USA49W=y --CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y --CONFIG_USB_SERIAL_KLSI=m --CONFIG_USB_SERIAL_KOBIL_SCT=m --CONFIG_USB_SERIAL_MCT_U232=m --CONFIG_USB_SERIAL_METRO=m --CONFIG_USB_SERIAL_MOS7720=m --CONFIG_USB_SERIAL_MOS7840=m --CONFIG_USB_SERIAL_MXUPORT=m --CONFIG_USB_SERIAL_NAVMAN=m --CONFIG_USB_SERIAL_PL2303=m --CONFIG_USB_SERIAL_OTI6858=m --CONFIG_USB_SERIAL_QCAUX=m --CONFIG_USB_SERIAL_QUALCOMM=m --CONFIG_USB_SERIAL_SPCP8X5=m --CONFIG_USB_SERIAL_SAFE=m --CONFIG_USB_SERIAL_SAFE_PADDED=y --CONFIG_USB_SERIAL_SIERRAWIRELESS=m --CONFIG_USB_SERIAL_SYMBOL=m --CONFIG_USB_SERIAL_TI=m --CONFIG_USB_SERIAL_CYBERJACK=m --CONFIG_USB_SERIAL_XIRCOM=m --CONFIG_USB_SERIAL_WWAN=m --CONFIG_USB_SERIAL_OPTION=m --CONFIG_USB_SERIAL_OMNINET=m --CONFIG_USB_SERIAL_OPTICON=m --CONFIG_USB_SERIAL_XSENS_MT=m --CONFIG_USB_SERIAL_WISHBONE=m --CONFIG_USB_SERIAL_SSU100=m --CONFIG_USB_SERIAL_QT2=m --CONFIG_USB_SERIAL_DEBUG=m -- --# --# USB Miscellaneous drivers --# --CONFIG_USB_EMI62=m --CONFIG_USB_EMI26=m --# CONFIG_USB_ADUTUX is not set --CONFIG_USB_SEVSEG=m --CONFIG_USB_RIO500=m --CONFIG_USB_LEGOTOWER=m --CONFIG_USB_LCD=m --CONFIG_USB_LED=m --CONFIG_USB_CYPRESS_CY7C63=m --CONFIG_USB_CYTHERM=m --CONFIG_USB_IDMOUSE=m --# CONFIG_USB_FTDI_ELAN is not set --CONFIG_USB_APPLEDISPLAY=m --CONFIG_USB_SISUSBVGA=m --CONFIG_USB_SISUSBVGA_CON=y --CONFIG_USB_LD=m --CONFIG_USB_TRANCEVIBRATOR=m --CONFIG_USB_IOWARRIOR=m --# CONFIG_USB_TEST is not set --# CONFIG_USB_EHSET_TEST_FIXTURE is not set --CONFIG_USB_ISIGHTFW=m --# CONFIG_USB_YUREX is not set --CONFIG_USB_EZUSB_FX2=m --CONFIG_USB_HSIC_USB3503=m --# CONFIG_USB_LINK_LAYER_TEST is not set --# CONFIG_USB_CHAOSKEY is not set -- --# --# USB Physical Layer drivers --# --CONFIG_USB_PHY=y --CONFIG_NOP_USB_XCEIV=y --CONFIG_AM335X_CONTROL_USB=y --CONFIG_AM335X_PHY_USB=y --CONFIG_USB_GPIO_VBUS=y --CONFIG_USB_ISP1301=y --CONFIG_USB_MXS_PHY=y --CONFIG_USB_ULPI=y --CONFIG_USB_ULPI_VIEWPORT=y --CONFIG_USB_GADGET=y --# CONFIG_USB_GADGET_DEBUG is not set --# CONFIG_USB_GADGET_DEBUG_FILES is not set --# CONFIG_USB_GADGET_DEBUG_FS is not set --CONFIG_USB_GADGET_VBUS_DRAW=2 --CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 -- --# --# USB Peripheral Controller --# --CONFIG_USB_FSL_USB2=m --# CONFIG_USB_FUSB300 is not set --# CONFIG_USB_FOTG210_UDC is not set --# CONFIG_USB_GR_UDC is not set --# CONFIG_USB_R8A66597 is not set --# CONFIG_USB_PXA27X is not set --# CONFIG_USB_MV_UDC is not set --# CONFIG_USB_MV_U3D is not set --# CONFIG_USB_M66592 is not set --# CONFIG_USB_BDC_UDC is not set --# CONFIG_USB_AMD5536UDC is not set --# CONFIG_USB_NET2272 is not set --# CONFIG_USB_NET2280 is not set --# CONFIG_USB_GOKU is not set --# CONFIG_USB_EG20T is not set --# CONFIG_USB_GADGET_XILINX is not set --# CONFIG_USB_DUMMY_HCD is not set --CONFIG_USB_LIBCOMPOSITE=m --CONFIG_USB_F_ACM=m --CONFIG_USB_F_SS_LB=m --CONFIG_USB_U_SERIAL=m --CONFIG_USB_U_ETHER=m --CONFIG_USB_F_SERIAL=m --CONFIG_USB_F_OBEX=m --CONFIG_USB_F_NCM=m --CONFIG_USB_F_ECM=m --CONFIG_USB_F_EEM=m --CONFIG_USB_F_SUBSET=m --CONFIG_USB_F_RNDIS=m --CONFIG_USB_F_MASS_STORAGE=m --CONFIG_USB_F_FS=m --CONFIG_USB_F_UAC1=m --CONFIG_USB_F_UAC2=m --CONFIG_USB_F_UVC=m --CONFIG_USB_F_MIDI=m --CONFIG_USB_F_HID=m --CONFIG_USB_F_PRINTER=m --CONFIG_USB_CONFIGFS=m --CONFIG_USB_CONFIGFS_SERIAL=y --CONFIG_USB_CONFIGFS_ACM=y --CONFIG_USB_CONFIGFS_OBEX=y --CONFIG_USB_CONFIGFS_NCM=y --CONFIG_USB_CONFIGFS_ECM=y --CONFIG_USB_CONFIGFS_ECM_SUBSET=y --CONFIG_USB_CONFIGFS_RNDIS=y --CONFIG_USB_CONFIGFS_EEM=y --CONFIG_USB_CONFIGFS_MASS_STORAGE=y --CONFIG_USB_CONFIGFS_F_LB_SS=y --CONFIG_USB_CONFIGFS_F_FS=y --CONFIG_USB_CONFIGFS_F_UAC1=y --CONFIG_USB_CONFIGFS_F_UAC2=y --CONFIG_USB_CONFIGFS_F_MIDI=y --CONFIG_USB_CONFIGFS_F_HID=y --CONFIG_USB_CONFIGFS_F_UVC=y --CONFIG_USB_CONFIGFS_F_PRINTER=y --CONFIG_USB_ZERO=m --# CONFIG_USB_ZERO_HNPTEST is not set --CONFIG_USB_AUDIO=m --# CONFIG_GADGET_UAC1 is not set --CONFIG_USB_ETH=m --CONFIG_USB_ETH_RNDIS=y --# CONFIG_USB_ETH_EEM is not set --CONFIG_USB_G_NCM=m --CONFIG_USB_GADGETFS=m --CONFIG_USB_FUNCTIONFS=m --# CONFIG_USB_FUNCTIONFS_ETH is not set --# CONFIG_USB_FUNCTIONFS_RNDIS is not set --CONFIG_USB_FUNCTIONFS_GENERIC=y --CONFIG_USB_MASS_STORAGE=m --CONFIG_USB_G_SERIAL=m --CONFIG_USB_MIDI_GADGET=m --CONFIG_USB_G_PRINTER=m --CONFIG_USB_CDC_COMPOSITE=m --CONFIG_USB_G_ACM_MS=m --CONFIG_USB_G_MULTI=m --CONFIG_USB_G_MULTI_RNDIS=y --# CONFIG_USB_G_MULTI_CDC is not set --CONFIG_USB_G_HID=m --# CONFIG_USB_G_DBGP is not set --CONFIG_USB_G_WEBCAM=m --CONFIG_USB_LED_TRIG=y --# CONFIG_UWB is not set --CONFIG_MMC=y --# CONFIG_MMC_DEBUG is not set -- --# --# MMC/SD/SDIO Card Drivers --# --CONFIG_MMC_BLOCK=y --CONFIG_MMC_BLOCK_MINORS=8 --CONFIG_MMC_BLOCK_BOUNCE=y --CONFIG_SDIO_UART=y --# CONFIG_MMC_TEST is not set -- --# --# MMC/SD/SDIO Host Controller Drivers --# --CONFIG_MMC_SDHCI=y --CONFIG_MMC_SDHCI_IO_ACCESSORS=y --# CONFIG_MMC_SDHCI_PCI is not set --CONFIG_MMC_SDHCI_PLTFM=y --CONFIG_MMC_SDHCI_OF_ARASAN=m --# CONFIG_MMC_SDHCI_OF_AT91 is not set --# CONFIG_MMC_SDHCI_OF_ESDHC is not set --CONFIG_MMC_SDHCI_ESDHC_IMX=y --# CONFIG_MMC_SDHCI_F_SDH30 is not set --# CONFIG_MMC_MXC is not set --CONFIG_MMC_TIFM_SD=m --CONFIG_MMC_CB710=m --# CONFIG_MMC_VIA_SDMMC is not set --# CONFIG_MMC_DW is not set --CONFIG_MMC_VUB300=m --CONFIG_MMC_USHC=y --CONFIG_MMC_USDHI6ROL0=m --CONFIG_MMC_TOSHIBA_PCI=m --# CONFIG_MMC_MTK is not set --# CONFIG_MEMSTICK is not set --CONFIG_NEW_LEDS=y --CONFIG_LEDS_CLASS=y --# CONFIG_LEDS_CLASS_FLASH is not set -- --# --# LED drivers --# --# CONFIG_LEDS_BCM6328 is not set --# CONFIG_LEDS_BCM6358 is not set --# CONFIG_LEDS_LM3530 is not set --# CONFIG_LEDS_LM3642 is not set --# CONFIG_LEDS_PCA9532 is not set --CONFIG_LEDS_GPIO=m --# CONFIG_LEDS_LP3944 is not set --# CONFIG_LEDS_LP5521 is not set --# CONFIG_LEDS_LP5523 is not set --# CONFIG_LEDS_LP5562 is not set --# CONFIG_LEDS_LP8501 is not set --# CONFIG_LEDS_LP8860 is not set --# CONFIG_LEDS_PCA955X is not set --# CONFIG_LEDS_PCA963X is not set --# CONFIG_LEDS_DA9052 is not set --# CONFIG_LEDS_DAC124S085 is not set --CONFIG_LEDS_PWM=y --CONFIG_LEDS_REGULATOR=m --# CONFIG_LEDS_BD2802 is not set --# CONFIG_LEDS_LT3593 is not set --# CONFIG_LEDS_MC13783 is not set --# CONFIG_LEDS_TCA6507 is not set --# CONFIG_LEDS_TLC591XX is not set --# CONFIG_LEDS_LM355x is not set -- --# --# LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM) --# --# CONFIG_LEDS_BLINKM is not set --# CONFIG_LEDS_SYSCON is not set -- --# --# LED Triggers --# --CONFIG_LEDS_TRIGGERS=y --CONFIG_LEDS_TRIGGER_TIMER=m --CONFIG_LEDS_TRIGGER_ONESHOT=m --CONFIG_LEDS_TRIGGER_HEARTBEAT=y --CONFIG_LEDS_TRIGGER_BACKLIGHT=m --CONFIG_LEDS_TRIGGER_CPU=y --CONFIG_LEDS_TRIGGER_GPIO=m --CONFIG_LEDS_TRIGGER_DEFAULT_ON=y -- --# --# iptables trigger is under Netfilter config (LED target) --# --CONFIG_LEDS_TRIGGER_TRANSIENT=m --CONFIG_LEDS_TRIGGER_CAMERA=m --# CONFIG_ACCESSIBILITY is not set --# CONFIG_INFINIBAND is not set --CONFIG_EDAC_ATOMIC_SCRUB=y --CONFIG_EDAC_SUPPORT=y --# CONFIG_EDAC is not set --CONFIG_RTC_LIB=y --CONFIG_RTC_CLASS=y --CONFIG_RTC_HCTOSYS=y --CONFIG_RTC_HCTOSYS_DEVICE="rtc0" --# CONFIG_RTC_SYSTOHC is not set --# CONFIG_RTC_DEBUG is not set -- --# --# RTC interfaces --# --CONFIG_RTC_INTF_SYSFS=y --CONFIG_RTC_INTF_PROC=y --CONFIG_RTC_INTF_DEV=y --CONFIG_RTC_INTF_DEV_UIE_EMUL=y --# CONFIG_RTC_DRV_TEST is not set -- --# --# I2C RTC drivers --# --# CONFIG_RTC_DRV_ABB5ZES3 is not set --# CONFIG_RTC_DRV_ABX80X is not set --# CONFIG_RTC_DRV_DS1307 is not set --# CONFIG_RTC_DRV_DS1374 is not set --# CONFIG_RTC_DRV_DS1672 is not set --# CONFIG_RTC_DRV_DS3232 is not set --# CONFIG_RTC_DRV_HYM8563 is not set --# CONFIG_RTC_DRV_MAX6900 is not set --# CONFIG_RTC_DRV_RS5C372 is not set --# CONFIG_RTC_DRV_ISL1208 is not set --# CONFIG_RTC_DRV_ISL12022 is not set --# CONFIG_RTC_DRV_ISL12057 is not set --# CONFIG_RTC_DRV_X1205 is not set --# CONFIG_RTC_DRV_PCF2127 is not set --CONFIG_RTC_DRV_PCF8523=y --# CONFIG_RTC_DRV_PCF8563 is not set --# CONFIG_RTC_DRV_PCF85063 is not set --# CONFIG_RTC_DRV_PCF8583 is not set --# CONFIG_RTC_DRV_M41T80 is not set --# CONFIG_RTC_DRV_BQ32K is not set --# CONFIG_RTC_DRV_S35390A is not set --# CONFIG_RTC_DRV_FM3130 is not set --# CONFIG_RTC_DRV_RX8581 is not set --# CONFIG_RTC_DRV_RX8025 is not set --# CONFIG_RTC_DRV_EM3027 is not set --# CONFIG_RTC_DRV_RV3029C2 is not set --# CONFIG_RTC_DRV_RV8803 is not set -- --# --# SPI RTC drivers --# --# CONFIG_RTC_DRV_M41T93 is not set --# CONFIG_RTC_DRV_M41T94 is not set --# CONFIG_RTC_DRV_DS1305 is not set --# CONFIG_RTC_DRV_DS1343 is not set --# CONFIG_RTC_DRV_DS1347 is not set --# CONFIG_RTC_DRV_DS1390 is not set --# CONFIG_RTC_DRV_MAX6902 is not set --# CONFIG_RTC_DRV_R9701 is not set --# CONFIG_RTC_DRV_RS5C348 is not set --# CONFIG_RTC_DRV_DS3234 is not set --# CONFIG_RTC_DRV_PCF2123 is not set --# CONFIG_RTC_DRV_RX4581 is not set --# CONFIG_RTC_DRV_MCP795 is not set -- --# --# Platform RTC drivers --# --CONFIG_RTC_DRV_CMOS=y --# CONFIG_RTC_DRV_DS1286 is not set --# CONFIG_RTC_DRV_DS1511 is not set --# CONFIG_RTC_DRV_DS1553 is not set --# CONFIG_RTC_DRV_DS1685_FAMILY is not set --# CONFIG_RTC_DRV_DS1742 is not set --# CONFIG_RTC_DRV_DS2404 is not set --# CONFIG_RTC_DRV_DA9052 is not set --# CONFIG_RTC_DRV_STK17TA8 is not set --# CONFIG_RTC_DRV_M48T86 is not set --# CONFIG_RTC_DRV_M48T35 is not set --# CONFIG_RTC_DRV_M48T59 is not set --# CONFIG_RTC_DRV_MSM6242 is not set --# CONFIG_RTC_DRV_BQ4802 is not set --# CONFIG_RTC_DRV_RP5C01 is not set --# CONFIG_RTC_DRV_V3020 is not set --# CONFIG_RTC_DRV_ZYNQMP is not set -- --# --# on-CPU RTC drivers --# --CONFIG_RTC_DRV_IMXDI=y --CONFIG_RTC_DRV_MC13XXX=y --CONFIG_RTC_DRV_MXC=y --CONFIG_RTC_DRV_SNVS=y -- --# --# HID Sensor RTC drivers --# --# CONFIG_RTC_DRV_HID_SENSOR_TIME is not set --CONFIG_DMADEVICES=y --# CONFIG_DMADEVICES_DEBUG is not set -- --# --# DMA Devices --# --CONFIG_DMA_ENGINE=y --CONFIG_DMA_VIRTUAL_CHANNELS=m --CONFIG_DMA_OF=y --CONFIG_FSL_EDMA=m --# CONFIG_IMX_DMA is not set --CONFIG_IMX_SDMA=y --# CONFIG_INTEL_IDMA64 is not set --CONFIG_MXS_DMA=y --# CONFIG_MX3_IPU is not set --CONFIG_MXC_PXP_V2=y --CONFIG_MXC_PXP_CLIENT_DEVICE=y --# CONFIG_NBPFAXI_DMA is not set --CONFIG_DW_DMAC_CORE=m --CONFIG_DW_DMAC=m --CONFIG_DW_DMAC_PCI=m -- --# --# DMA Clients --# --CONFIG_ASYNC_TX_DMA=y --# CONFIG_DMATEST is not set --# CONFIG_AUXDISPLAY is not set --# CONFIG_UIO is not set --# CONFIG_VIRT_DRIVERS is not set -- --# --# Virtio drivers --# --# CONFIG_VIRTIO_PCI is not set --# CONFIG_VIRTIO_MMIO is not set -- --# --# Microsoft Hyper-V guest support --# --CONFIG_STAGING=y --CONFIG_PRISM2_USB=m --CONFIG_COMEDI=m --# CONFIG_COMEDI_DEBUG is not set --CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB=2048 --CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB=20480 --# CONFIG_COMEDI_MISC_DRIVERS is not set --# CONFIG_COMEDI_ISA_DRIVERS is not set --# CONFIG_COMEDI_PCI_DRIVERS is not set --# CONFIG_COMEDI_USB_DRIVERS is not set --# CONFIG_COMEDI_8255_SA is not set --# CONFIG_COMEDI_KCOMEDILIB is not set --CONFIG_RTL8192U=m --CONFIG_RTLLIB=m --CONFIG_RTLLIB_CRYPTO_CCMP=m --CONFIG_RTLLIB_CRYPTO_TKIP=m --CONFIG_RTLLIB_CRYPTO_WEP=m --CONFIG_RTL8192E=m --CONFIG_R8712U=m --CONFIG_R8188EU=m --CONFIG_88EU_AP_MODE=y --CONFIG_R8723AU=m --CONFIG_8723AU_AP_MODE=y --CONFIG_8723AU_BT_COEXIST=y --CONFIG_RTS5208=m --# CONFIG_VT6655 is not set --# CONFIG_VT6656 is not set -- --# --# IIO staging drivers --# -- --# --# Accelerometers --# --# CONFIG_ADIS16201 is not set --# CONFIG_ADIS16203 is not set --# CONFIG_ADIS16204 is not set --# CONFIG_ADIS16209 is not set --# CONFIG_ADIS16220 is not set --# CONFIG_ADIS16240 is not set --# CONFIG_LIS3L02DQ is not set --# CONFIG_SCA3000 is not set -- --# --# Analog to digital converters --# --# CONFIG_AD7606 is not set --# CONFIG_AD7780 is not set --# CONFIG_AD7816 is not set --# CONFIG_AD7192 is not set --# CONFIG_AD7280 is not set -- --# --# Analog digital bi-direction converters --# --# CONFIG_ADT7316 is not set -- --# --# Capacitance to digital converters --# --# CONFIG_AD7150 is not set --# CONFIG_AD7152 is not set --# CONFIG_AD7746 is not set -- --# --# Direct Digital Synthesis --# --# CONFIG_AD9832 is not set --# CONFIG_AD9834 is not set -- --# --# Digital gyroscope sensors --# --# CONFIG_ADIS16060 is not set -- --# --# Network Analyzer, Impedance Converters --# --# CONFIG_AD5933 is not set -- --# --# Light sensors --# --# CONFIG_SENSORS_ISL29018 is not set --# CONFIG_SENSORS_ISL29028 is not set --# CONFIG_TSL2583 is not set --# CONFIG_TSL2x7x is not set -- --# --# Magnetometer sensors --# --# CONFIG_SENSORS_HMC5843_I2C is not set --# CONFIG_SENSORS_HMC5843_SPI is not set -- --# --# Active energy metering IC --# --# CONFIG_ADE7753 is not set --# CONFIG_ADE7754 is not set --# CONFIG_ADE7758 is not set --# CONFIG_ADE7759 is not set --# CONFIG_ADE7854 is not set -- --# --# Resolver to digital converters --# --# CONFIG_AD2S90 is not set --# CONFIG_AD2S1200 is not set --# CONFIG_AD2S1210 is not set -- --# --# Triggers - standalone --# --CONFIG_IIO_PERIODIC_RTC_TRIGGER=m --# CONFIG_IIO_SIMPLE_DUMMY is not set --# CONFIG_FB_SM750 is not set --# CONFIG_FB_XGI is not set -- --# --# Speakup console speech --# --CONFIG_SPEAKUP=m --CONFIG_SPEAKUP_SYNTH_ACNTSA=m --CONFIG_SPEAKUP_SYNTH_APOLLO=m --CONFIG_SPEAKUP_SYNTH_AUDPTR=m --CONFIG_SPEAKUP_SYNTH_BNS=m --CONFIG_SPEAKUP_SYNTH_DECTLK=m --CONFIG_SPEAKUP_SYNTH_DECEXT=m --CONFIG_SPEAKUP_SYNTH_LTLK=m --CONFIG_SPEAKUP_SYNTH_SOFT=m --CONFIG_SPEAKUP_SYNTH_SPKOUT=m --CONFIG_SPEAKUP_SYNTH_TXPRT=m --CONFIG_SPEAKUP_SYNTH_DUMMY=m --CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=m --CONFIG_STAGING_MEDIA=y --CONFIG_I2C_BCM2048=m --CONFIG_DVB_CXD2099=m --CONFIG_DVB_MN88472=m --CONFIG_DVB_MN88473=m --CONFIG_LIRC_STAGING=y --CONFIG_LIRC_BT829=m --CONFIG_LIRC_IMON=m --CONFIG_LIRC_SASEM=m --CONFIG_LIRC_SERIAL=m --CONFIG_LIRC_SERIAL_TRANSMITTER=y --CONFIG_LIRC_SIR=m --CONFIG_LIRC_ZILOG=m -- --# --# Android --# --# CONFIG_STAGING_BOARD is not set --CONFIG_WIMAX_GDM72XX=m --CONFIG_WIMAX_GDM72XX_QOS=y --CONFIG_WIMAX_GDM72XX_K_MODE=y --CONFIG_WIMAX_GDM72XX_WIMAX2=y --CONFIG_WIMAX_GDM72XX_USB=y --# CONFIG_WIMAX_GDM72XX_SDIO is not set --CONFIG_WIMAX_GDM72XX_USB_PM=y --CONFIG_LTE_GDM724X=m --CONFIG_MTD_SPINAND_MT29F=m --# CONFIG_MTD_SPINAND_ONDIEECC is not set --# CONFIG_LUSTRE_FS is not set --CONFIG_DGNC=m --CONFIG_DGAP=m --# CONFIG_GS_FPGABOOT is not set --# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set --CONFIG_FB_TFT=m --CONFIG_FB_TFT_AGM1264K_FL=m --CONFIG_FB_TFT_BD663474=m --CONFIG_FB_TFT_HX8340BN=m --CONFIG_FB_TFT_HX8347D=m --CONFIG_FB_TFT_HX8353D=m --CONFIG_FB_TFT_HX8357D=m --CONFIG_FB_TFT_ILI9163=m --CONFIG_FB_TFT_ILI9320=m --CONFIG_FB_TFT_ILI9325=m --CONFIG_FB_TFT_ILI9340=m --CONFIG_FB_TFT_ILI9341=m --CONFIG_FB_TFT_ILI9481=m --CONFIG_FB_TFT_ILI9486=m --CONFIG_FB_TFT_PCD8544=m --CONFIG_FB_TFT_RA8875=m --CONFIG_FB_TFT_S6D02A1=m --CONFIG_FB_TFT_S6D1121=m --CONFIG_FB_TFT_SSD1289=m --CONFIG_FB_TFT_SSD1306=m --CONFIG_FB_TFT_SSD1331=m --CONFIG_FB_TFT_SSD1351=m --CONFIG_FB_TFT_ST7735R=m --# CONFIG_FB_TFT_ST7789V is not set --CONFIG_FB_TFT_TINYLCD=m --CONFIG_FB_TFT_TLS8204=m --CONFIG_FB_TFT_UC1611=m --CONFIG_FB_TFT_UC1701=m --CONFIG_FB_TFT_UPD161704=m --CONFIG_FB_TFT_WATTEROTT=m --CONFIG_FB_FLEX=m --CONFIG_FB_TFT_FBTFT_DEVICE=m --# CONFIG_WILC1000_DRIVER is not set --# CONFIG_MOST is not set --# CONFIG_CHROME_PLATFORMS is not set --CONFIG_CLKDEV_LOOKUP=y --CONFIG_HAVE_CLK_PREPARE=y --CONFIG_COMMON_CLK=y -- --# --# Common Clock Framework --# --# CONFIG_COMMON_CLK_SI5351 is not set --# CONFIG_COMMON_CLK_SI514 is not set --# CONFIG_COMMON_CLK_SI570 is not set --# CONFIG_COMMON_CLK_CDCE925 is not set --# CONFIG_CLK_QORIQ is not set --# CONFIG_COMMON_CLK_PWM is not set --# CONFIG_COMMON_CLK_PXA is not set --# CONFIG_COMMON_CLK_CDCE706 is not set -- --# --# Hardware Spinlock drivers --# -- --# --# Clock Source drivers --# --CONFIG_CLKSRC_OF=y --CONFIG_CLKSRC_PROBE=y --CONFIG_CLKSRC_MMIO=y --# CONFIG_ARM_TIMER_SP804 is not set --# CONFIG_ATMEL_PIT is not set --# CONFIG_SH_TIMER_CMT is not set --# CONFIG_SH_TIMER_MTU2 is not set --# CONFIG_SH_TIMER_TMU is not set --# CONFIG_EM_TIMER_STI is not set --CONFIG_CLKSRC_IMX_GPT=y --# CONFIG_MAILBOX is not set --CONFIG_IOMMU_SUPPORT=y -- --# --# Generic IOMMU Pagetable Support --# --# CONFIG_IOMMU_IO_PGTABLE_LPAE is not set --# CONFIG_ARM_SMMU is not set -- --# --# Remoteproc drivers --# --# CONFIG_STE_MODEM_RPROC is not set -- --# --# Rpmsg drivers --# -- --# --# SOC (System On Chip) specific Drivers --# --# CONFIG_SOC_BRCMSTB is not set --# CONFIG_SUNXI_SRAM is not set --# CONFIG_SOC_TI is not set --CONFIG_PM_DEVFREQ=y -- --# --# DEVFREQ Governors --# --CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y --CONFIG_DEVFREQ_GOV_PERFORMANCE=y --CONFIG_DEVFREQ_GOV_POWERSAVE=y --CONFIG_DEVFREQ_GOV_USERSPACE=y -- --# --# DEVFREQ Drivers --# --CONFIG_PM_DEVFREQ_EVENT=y --CONFIG_EXTCON=y -- --# --# Extcon Device Drivers --# --CONFIG_EXTCON_ADC_JACK=m --CONFIG_EXTCON_GPIO=y --CONFIG_EXTCON_RT8973A=m --CONFIG_EXTCON_SM5502=m --CONFIG_EXTCON_USB_GPIO=y --# CONFIG_MEMORY is not set --CONFIG_IIO=m --CONFIG_IIO_BUFFER=y --# CONFIG_IIO_BUFFER_CB is not set --CONFIG_IIO_KFIFO_BUF=m --CONFIG_IIO_TRIGGERED_BUFFER=m --CONFIG_IIO_TRIGGER=y --CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 -- --# --# Accelerometers --# --# CONFIG_BMA180 is not set --# CONFIG_BMC150_ACCEL is not set --# CONFIG_HID_SENSOR_ACCEL_3D is not set --# CONFIG_IIO_ST_ACCEL_3AXIS is not set --# CONFIG_KXSD9 is not set --# CONFIG_KXCJK1013 is not set --# CONFIG_MMA8452 is not set --# CONFIG_MMA9551 is not set --# CONFIG_MMA9553 is not set --# CONFIG_MXC4005 is not set --# CONFIG_STK8312 is not set --# CONFIG_STK8BA50 is not set -- --# --# Analog to digital converters --# --# CONFIG_AD7266 is not set --# CONFIG_AD7291 is not set --# CONFIG_AD7298 is not set --# CONFIG_AD7476 is not set --# CONFIG_AD7791 is not set --# CONFIG_AD7793 is not set --# CONFIG_AD7887 is not set --# CONFIG_AD7923 is not set --# CONFIG_AD799X is not set --# CONFIG_CC10001_ADC is not set --# CONFIG_HI8435 is not set --# CONFIG_MAX1027 is not set --# CONFIG_MAX1363 is not set --# CONFIG_MCP320X is not set --# CONFIG_MCP3422 is not set --# CONFIG_NAU7802 is not set --# CONFIG_TI_ADC081C is not set --# CONFIG_TI_ADC128S052 is not set --# CONFIG_VF610_ADC is not set -- --# --# Amplifiers --# --# CONFIG_AD8366 is not set -- --# --# Chemical Sensors --# --# CONFIG_VZ89X is not set -- --# --# Hid Sensor IIO Common --# --CONFIG_HID_SENSOR_IIO_COMMON=m --CONFIG_HID_SENSOR_IIO_TRIGGER=m -- --# --# SSP Sensor Common --# --# CONFIG_IIO_SSP_SENSORHUB is not set -- --# --# Digital to analog converters --# --# CONFIG_AD5064 is not set --# CONFIG_AD5360 is not set --# CONFIG_AD5380 is not set --# CONFIG_AD5421 is not set --# CONFIG_AD5446 is not set --# CONFIG_AD5449 is not set --# CONFIG_AD5504 is not set --# CONFIG_AD5624R_SPI is not set --# CONFIG_AD5686 is not set --# CONFIG_AD5755 is not set --# CONFIG_AD5764 is not set --# CONFIG_AD5791 is not set --# CONFIG_AD7303 is not set --# CONFIG_M62332 is not set --# CONFIG_MAX517 is not set --# CONFIG_MAX5821 is not set --# CONFIG_MCP4725 is not set --# CONFIG_MCP4922 is not set -- --# --# Frequency Synthesizers DDS/PLL --# -- --# --# Clock Generator/Distribution --# --# CONFIG_AD9523 is not set -- --# --# Phase-Locked Loop (PLL) frequency synthesizers --# --# CONFIG_ADF4350 is not set -- --# --# Digital gyroscope sensors --# --# CONFIG_ADIS16080 is not set --# CONFIG_ADIS16130 is not set --# CONFIG_ADIS16136 is not set --# CONFIG_ADIS16260 is not set --# CONFIG_ADXRS450 is not set --# CONFIG_BMG160 is not set --CONFIG_HID_SENSOR_GYRO_3D=m --# CONFIG_IIO_ST_GYRO_3AXIS is not set --# CONFIG_ITG3200 is not set -- --# --# Humidity sensors --# --CONFIG_DHT11=m --# CONFIG_HDC100X is not set --# CONFIG_HTU21 is not set --# CONFIG_SI7005 is not set --# CONFIG_SI7020 is not set -- --# --# Inertial measurement units --# --# CONFIG_ADIS16400 is not set --# CONFIG_ADIS16480 is not set --# CONFIG_KMX61 is not set --# CONFIG_INV_MPU6050_IIO is not set -- --# --# Light sensors --# --# CONFIG_ADJD_S311 is not set --# CONFIG_AL3320A is not set --# CONFIG_APDS9300 is not set --# CONFIG_APDS9960 is not set --# CONFIG_BH1750 is not set --# CONFIG_CM32181 is not set --# CONFIG_CM3232 is not set --# CONFIG_CM3323 is not set --# CONFIG_CM36651 is not set --# CONFIG_GP2AP020A00F is not set --# CONFIG_ISL29125 is not set --# CONFIG_HID_SENSOR_ALS is not set --# CONFIG_HID_SENSOR_PROX is not set --# CONFIG_JSA1212 is not set --# CONFIG_RPR0521 is not set --# CONFIG_LTR501 is not set --# CONFIG_OPT3001 is not set --# CONFIG_PA12203001 is not set --# CONFIG_STK3310 is not set --# CONFIG_TCS3414 is not set --# CONFIG_TCS3472 is not set --# CONFIG_SENSORS_TSL2563 is not set --# CONFIG_TSL4531 is not set --# CONFIG_US5182D is not set --# CONFIG_VCNL4000 is not set -- --# --# Magnetometer sensors --# --# CONFIG_AK8975 is not set --# CONFIG_AK09911 is not set --# CONFIG_BMC150_MAGN is not set --# CONFIG_MAG3110 is not set --# CONFIG_HID_SENSOR_MAGNETOMETER_3D is not set --# CONFIG_MMC35240 is not set --# CONFIG_IIO_ST_MAGN_3AXIS is not set -- --# --# Inclinometer sensors --# --# CONFIG_HID_SENSOR_INCLINOMETER_3D is not set --# CONFIG_HID_SENSOR_DEVICE_ROTATION is not set -- --# --# Triggers - standalone --# --CONFIG_IIO_INTERRUPT_TRIGGER=m --CONFIG_IIO_SYSFS_TRIGGER=m -- --# --# Digital potentiometers --# --# CONFIG_MCP4531 is not set -- --# --# Pressure sensors --# --# CONFIG_BMP280 is not set --# CONFIG_HID_SENSOR_PRESS is not set --# CONFIG_MPL115 is not set --# CONFIG_MPL3115 is not set --# CONFIG_MS5611 is not set --# CONFIG_MS5637 is not set --# CONFIG_IIO_ST_PRESS is not set --# CONFIG_T5403 is not set -- --# --# Lightning sensors --# --# CONFIG_AS3935 is not set -- --# --# Proximity sensors --# --# CONFIG_LIDAR_LITE_V2 is not set --# CONFIG_SX9500 is not set -- --# --# Temperature sensors --# --# CONFIG_MLX90614 is not set --# CONFIG_TMP006 is not set --# CONFIG_TSYS01 is not set --# CONFIG_TSYS02D is not set --# CONFIG_NTB is not set --# CONFIG_VME_BUS is not set --CONFIG_PWM=y --CONFIG_PWM_SYSFS=y --CONFIG_PWM_FSL_FTM=y --CONFIG_PWM_IMX=y --CONFIG_PWM_PCA9685=y --CONFIG_IRQCHIP=y --CONFIG_ARM_GIC=y --# CONFIG_IPACK_BUS is not set --CONFIG_ARCH_HAS_RESET_CONTROLLER=y --CONFIG_RESET_CONTROLLER=y --# CONFIG_FMC is not set -- --# --# PHY Subsystem --# --CONFIG_GENERIC_PHY=y --# CONFIG_PHY_PXA_28NM_HSIC is not set --# CONFIG_PHY_PXA_28NM_USB2 is not set --# CONFIG_BCM_KONA_USB2_PHY is not set --# CONFIG_PHY_SAMSUNG_USB2 is not set --CONFIG_POWERCAP=y --# CONFIG_MCB is not set -- --# --# Performance monitor support --# --CONFIG_ARM_PMU=y --CONFIG_RAS=y --# CONFIG_THUNDERBOLT is not set -- --# --# Android --# --# CONFIG_ANDROID is not set --CONFIG_NVMEM=y --CONFIG_NVMEM_IMX_OCOTP=m --# CONFIG_STM is not set --# CONFIG_STM_DUMMY is not set --# CONFIG_STM_SOURCE_CONSOLE is not set --# CONFIG_INTEL_TH is not set -- --# --# FPGA Configuration Support --# --# CONFIG_FPGA is not set -- --# --# MXC support drivers --# --CONFIG_MXC_IPU=y -- --# --# Vivante GPU support --# --CONFIG_MXC_GPU_VIV=y --CONFIG_MXC_IPU_V3_FSL=y -- --# --# MXC VPU(Video Processing Unit) support --# --CONFIG_MXC_VPU=y --# CONFIG_MXC_VPU_DEBUG is not set --# CONFIG_MX6_VPU_352M is not set -- --# --# MXC HDMI CEC (Consumer Electronics Control) support --# --CONFIG_MXC_HDMI_CEC=y -- --# --# MXC MIPI Support --# --CONFIG_MXC_MIPI_CSI2=y -- --# --# MXC Media Local Bus Driver --# --CONFIG_MXC_MLB=y --CONFIG_MXC_MLB150=m -- --# --# Firmware Drivers --# --CONFIG_FIRMWARE_MEMMAP=y -- --# --# File systems --# --CONFIG_DCACHE_WORD_ACCESS=y --# CONFIG_EXT2_FS is not set --# CONFIG_EXT3_FS is not set --CONFIG_EXT4_FS=y --CONFIG_EXT4_USE_FOR_EXT2=y --CONFIG_EXT4_FS_POSIX_ACL=y --CONFIG_EXT4_FS_SECURITY=y --CONFIG_EXT4_ENCRYPTION=y --CONFIG_EXT4_FS_ENCRYPTION=y --# CONFIG_EXT4_DEBUG is not set --CONFIG_JBD2=y --# CONFIG_JBD2_DEBUG is not set --CONFIG_FS_MBCACHE=y --CONFIG_REISERFS_FS=m --# CONFIG_REISERFS_CHECK is not set --# CONFIG_REISERFS_PROC_INFO is not set --CONFIG_REISERFS_FS_XATTR=y --CONFIG_REISERFS_FS_POSIX_ACL=y --# CONFIG_REISERFS_FS_SECURITY is not set --CONFIG_JFS_FS=m --CONFIG_JFS_POSIX_ACL=y --CONFIG_JFS_SECURITY=y --# CONFIG_JFS_DEBUG is not set --# CONFIG_JFS_STATISTICS is not set --CONFIG_XFS_FS=m --CONFIG_XFS_QUOTA=y --CONFIG_XFS_POSIX_ACL=y --# CONFIG_XFS_RT is not set --# CONFIG_XFS_WARN is not set --# CONFIG_XFS_DEBUG is not set --# CONFIG_GFS2_FS is not set --# CONFIG_OCFS2_FS is not set --CONFIG_BTRFS_FS=y --CONFIG_BTRFS_FS_POSIX_ACL=y --# CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set --# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set --# CONFIG_BTRFS_DEBUG is not set --# CONFIG_BTRFS_ASSERT is not set --# CONFIG_NILFS2_FS is not set --CONFIG_F2FS_FS=m --CONFIG_F2FS_STAT_FS=y --CONFIG_F2FS_FS_XATTR=y --CONFIG_F2FS_FS_POSIX_ACL=y --# CONFIG_F2FS_FS_SECURITY is not set --# CONFIG_F2FS_CHECK_FS is not set --# CONFIG_F2FS_FS_ENCRYPTION is not set --# CONFIG_F2FS_IO_TRACE is not set --CONFIG_FS_POSIX_ACL=y --CONFIG_EXPORTFS=y --CONFIG_FILE_LOCKING=y --CONFIG_FSNOTIFY=y --CONFIG_DNOTIFY=y --CONFIG_INOTIFY_USER=y --CONFIG_FANOTIFY=y --CONFIG_QUOTA=y --# CONFIG_QUOTA_NETLINK_INTERFACE is not set --CONFIG_PRINT_QUOTA_WARNING=y --# CONFIG_QUOTA_DEBUG is not set --CONFIG_QUOTA_TREE=m --CONFIG_QFMT_V1=m --CONFIG_QFMT_V2=m --CONFIG_QUOTACTL=y --CONFIG_AUTOFS4_FS=y --CONFIG_FUSE_FS=y --CONFIG_CUSE=y --CONFIG_OVERLAY_FS=y -- --# --# Caches --# --CONFIG_FSCACHE=m --# CONFIG_FSCACHE_STATS is not set --# CONFIG_FSCACHE_HISTOGRAM is not set --# CONFIG_FSCACHE_DEBUG is not set --# CONFIG_FSCACHE_OBJECT_LIST is not set --CONFIG_CACHEFILES=m --# CONFIG_CACHEFILES_DEBUG is not set --# CONFIG_CACHEFILES_HISTOGRAM is not set -- --# --# CD-ROM/DVD Filesystems --# --CONFIG_ISO9660_FS=y --CONFIG_JOLIET=y --CONFIG_ZISOFS=y --CONFIG_UDF_FS=y --CONFIG_UDF_NLS=y -- --# --# DOS/FAT/NT Filesystems --# --CONFIG_FAT_FS=y --CONFIG_MSDOS_FS=y --CONFIG_VFAT_FS=y --CONFIG_FAT_DEFAULT_CODEPAGE=437 --CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" --CONFIG_NTFS_FS=m --# CONFIG_NTFS_DEBUG is not set --CONFIG_NTFS_RW=y -- --# --# Pseudo filesystems --# --CONFIG_PROC_FS=y --CONFIG_PROC_SYSCTL=y --CONFIG_PROC_PAGE_MONITOR=y --CONFIG_PROC_CHILDREN=y --CONFIG_KERNFS=y --CONFIG_SYSFS=y --CONFIG_TMPFS=y --CONFIG_TMPFS_POSIX_ACL=y --CONFIG_TMPFS_XATTR=y --# CONFIG_HUGETLB_PAGE is not set --CONFIG_CONFIGFS_FS=y --CONFIG_MISC_FILESYSTEMS=y --# CONFIG_ADFS_FS is not set --# CONFIG_AFFS_FS is not set --# CONFIG_ECRYPT_FS is not set --CONFIG_HFS_FS=m --CONFIG_HFSPLUS_FS=m --# CONFIG_HFSPLUS_FS_POSIX_ACL is not set --# CONFIG_BEFS_FS is not set --# CONFIG_BFS_FS is not set --# CONFIG_EFS_FS is not set --CONFIG_JFFS2_FS=m --CONFIG_JFFS2_FS_DEBUG=0 --CONFIG_JFFS2_FS_WRITEBUFFER=y --# CONFIG_JFFS2_FS_WBUF_VERIFY is not set --# CONFIG_JFFS2_SUMMARY is not set --# CONFIG_JFFS2_FS_XATTR is not set --# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set --CONFIG_JFFS2_ZLIB=y --# CONFIG_JFFS2_LZO is not set --CONFIG_JFFS2_RTIME=y --# CONFIG_JFFS2_RUBIN is not set --CONFIG_UBIFS_FS=m --# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set --CONFIG_UBIFS_FS_LZO=y --CONFIG_UBIFS_FS_ZLIB=y --# CONFIG_UBIFS_ATIME_SUPPORT is not set --CONFIG_LOGFS=m --# CONFIG_CRAMFS is not set --CONFIG_SQUASHFS=m --CONFIG_SQUASHFS_FILE_CACHE=y --# CONFIG_SQUASHFS_FILE_DIRECT is not set --CONFIG_SQUASHFS_DECOMP_SINGLE=y --# CONFIG_SQUASHFS_DECOMP_MULTI is not set --# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set --CONFIG_SQUASHFS_XATTR=y --CONFIG_SQUASHFS_ZLIB=y --# CONFIG_SQUASHFS_LZ4 is not set --# CONFIG_SQUASHFS_LZO is not set --# CONFIG_SQUASHFS_XZ is not set --# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set --# CONFIG_SQUASHFS_EMBEDDED is not set --CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 --# CONFIG_VXFS_FS is not set --# CONFIG_MINIX_FS is not set --# CONFIG_OMFS_FS is not set --# CONFIG_HPFS_FS is not set --# CONFIG_QNX4FS_FS is not set --# CONFIG_QNX6FS_FS is not set --CONFIG_ROMFS_FS=m --CONFIG_ROMFS_BACKED_BY_BLOCK=y --# CONFIG_ROMFS_BACKED_BY_MTD is not set --# CONFIG_ROMFS_BACKED_BY_BOTH is not set --CONFIG_ROMFS_ON_BLOCK=y --# CONFIG_PSTORE is not set --CONFIG_SYSV_FS=m --# CONFIG_UFS_FS is not set --CONFIG_NETWORK_FILESYSTEMS=y --CONFIG_NFS_FS=y --CONFIG_NFS_V2=y --CONFIG_NFS_V3=y --CONFIG_NFS_V3_ACL=y --CONFIG_NFS_V4=y --# CONFIG_NFS_SWAP is not set --CONFIG_NFS_V4_1=y --CONFIG_NFS_V4_2=y --CONFIG_PNFS_FILE_LAYOUT=y --CONFIG_PNFS_BLOCK=m --CONFIG_PNFS_FLEXFILE_LAYOUT=m --CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org" --CONFIG_NFS_V4_1_MIGRATION=y --CONFIG_ROOT_NFS=y --# CONFIG_NFS_USE_LEGACY_DNS is not set --CONFIG_NFS_USE_KERNEL_DNS=y --CONFIG_NFS_DEBUG=y --CONFIG_NFSD=m --CONFIG_NFSD_V2_ACL=y --CONFIG_NFSD_V3=y --CONFIG_NFSD_V3_ACL=y --CONFIG_NFSD_V4=y --# CONFIG_NFSD_PNFS is not set --# CONFIG_NFSD_FAULT_INJECTION is not set --CONFIG_GRACE_PERIOD=y --CONFIG_LOCKD=y --CONFIG_LOCKD_V4=y --CONFIG_NFS_ACL_SUPPORT=y --CONFIG_NFS_COMMON=y --CONFIG_SUNRPC=y --CONFIG_SUNRPC_GSS=y --CONFIG_SUNRPC_BACKCHANNEL=y --CONFIG_RPCSEC_GSS_KRB5=m --CONFIG_SUNRPC_DEBUG=y --# CONFIG_CEPH_FS is not set --CONFIG_CIFS=m --# CONFIG_CIFS_STATS is not set --CONFIG_CIFS_WEAK_PW_HASH=y --# CONFIG_CIFS_UPCALL is not set --CONFIG_CIFS_XATTR=y --CONFIG_CIFS_POSIX=y --CONFIG_CIFS_ACL=y --# CONFIG_CIFS_DEBUG is not set --CONFIG_CIFS_DFS_UPCALL=y --CONFIG_CIFS_SMB2=y --CONFIG_CIFS_SMB311=y --CONFIG_CIFS_FSCACHE=y --CONFIG_NCP_FS=m --# CONFIG_NCPFS_PACKET_SIGNING is not set --# CONFIG_NCPFS_IOCTL_LOCKING is not set --# CONFIG_NCPFS_STRONG is not set --# CONFIG_NCPFS_NFS_NS is not set --# CONFIG_NCPFS_OS2_NS is not set --# CONFIG_NCPFS_SMALLDOS is not set --# CONFIG_NCPFS_NLS is not set --# CONFIG_NCPFS_EXTRAS is not set --# CONFIG_CODA_FS is not set --# CONFIG_AFS_FS is not set --CONFIG_NLS=y --CONFIG_NLS_DEFAULT="utf8" --CONFIG_NLS_CODEPAGE_437=y --CONFIG_NLS_CODEPAGE_737=m --CONFIG_NLS_CODEPAGE_775=m --CONFIG_NLS_CODEPAGE_850=y --CONFIG_NLS_CODEPAGE_852=y --CONFIG_NLS_CODEPAGE_855=m --CONFIG_NLS_CODEPAGE_857=m --CONFIG_NLS_CODEPAGE_860=m --CONFIG_NLS_CODEPAGE_861=m --CONFIG_NLS_CODEPAGE_862=m --CONFIG_NLS_CODEPAGE_863=m --CONFIG_NLS_CODEPAGE_864=m --CONFIG_NLS_CODEPAGE_865=m --CONFIG_NLS_CODEPAGE_866=m --CONFIG_NLS_CODEPAGE_869=m --CONFIG_NLS_CODEPAGE_936=m --CONFIG_NLS_CODEPAGE_950=m --CONFIG_NLS_CODEPAGE_932=m --CONFIG_NLS_CODEPAGE_949=m --CONFIG_NLS_CODEPAGE_874=m --CONFIG_NLS_ISO8859_8=m --CONFIG_NLS_CODEPAGE_1250=y --CONFIG_NLS_CODEPAGE_1251=y --CONFIG_NLS_ASCII=y --CONFIG_NLS_ISO8859_1=y --CONFIG_NLS_ISO8859_2=y --CONFIG_NLS_ISO8859_3=m --CONFIG_NLS_ISO8859_4=m --CONFIG_NLS_ISO8859_5=m --CONFIG_NLS_ISO8859_6=m --CONFIG_NLS_ISO8859_7=m --CONFIG_NLS_ISO8859_9=m --CONFIG_NLS_ISO8859_13=m --CONFIG_NLS_ISO8859_14=m --CONFIG_NLS_ISO8859_15=y --CONFIG_NLS_KOI8_R=m --CONFIG_NLS_KOI8_U=m --CONFIG_NLS_MAC_ROMAN=m --CONFIG_NLS_MAC_CELTIC=m --CONFIG_NLS_MAC_CENTEURO=m --CONFIG_NLS_MAC_CROATIAN=m --CONFIG_NLS_MAC_CYRILLIC=m --CONFIG_NLS_MAC_GAELIC=m --CONFIG_NLS_MAC_GREEK=m --CONFIG_NLS_MAC_ICELAND=m --CONFIG_NLS_MAC_INUIT=m --CONFIG_NLS_MAC_ROMANIAN=m --CONFIG_NLS_MAC_TURKISH=m --CONFIG_NLS_UTF8=y --CONFIG_DLM=m --# CONFIG_DLM_DEBUG is not set -- --# --# Kernel hacking --# -- --# --# printk and dmesg options --# --CONFIG_PRINTK_TIME=y --CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 --# CONFIG_BOOT_PRINTK_DELAY is not set --CONFIG_DYNAMIC_DEBUG=y -- --# --# Compile-time checks and compiler options --# --# CONFIG_DEBUG_INFO is not set --CONFIG_ENABLE_WARN_DEPRECATED=y --CONFIG_ENABLE_MUST_CHECK=y --CONFIG_FRAME_WARN=1024 --CONFIG_STRIP_ASM_SYMS=y --# CONFIG_READABLE_ASM is not set --# CONFIG_UNUSED_SYMBOLS is not set --# CONFIG_PAGE_OWNER is not set --CONFIG_DEBUG_FS=y --# CONFIG_HEADERS_CHECK is not set --# CONFIG_DEBUG_SECTION_MISMATCH is not set --CONFIG_SECTION_MISMATCH_WARN_ONLY=y --CONFIG_FRAME_POINTER=y --# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set --CONFIG_MAGIC_SYSRQ=y --CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1 --CONFIG_DEBUG_KERNEL=y -- --# --# Memory Debugging --# --# CONFIG_PAGE_EXTENSION is not set --# CONFIG_DEBUG_PAGEALLOC is not set --# CONFIG_DEBUG_OBJECTS is not set --# CONFIG_SLUB_STATS is not set --CONFIG_HAVE_DEBUG_KMEMLEAK=y --# CONFIG_DEBUG_KMEMLEAK is not set --# CONFIG_DEBUG_STACK_USAGE is not set --# CONFIG_DEBUG_VM is not set --# CONFIG_DEBUG_MEMORY_INIT is not set --# CONFIG_DEBUG_PER_CPU_MAPS is not set --# CONFIG_DEBUG_HIGHMEM is not set --# CONFIG_DEBUG_SHIRQ is not set -- --# --# Debug Lockups and Hangs --# --# CONFIG_LOCKUP_DETECTOR is not set --# CONFIG_DETECT_HUNG_TASK is not set --CONFIG_PANIC_ON_OOPS=y --CONFIG_PANIC_ON_OOPS_VALUE=1 --CONFIG_PANIC_TIMEOUT=1 --# CONFIG_SCHED_DEBUG is not set --# CONFIG_SCHED_INFO is not set --# CONFIG_SCHEDSTATS is not set --# CONFIG_SCHED_STACK_END_CHECK is not set --# CONFIG_DEBUG_TIMEKEEPING is not set --CONFIG_TIMER_STATS=y --# CONFIG_DEBUG_PREEMPT is not set -- --# --# Lock Debugging (spinlocks, mutexes, etc...) --# --# CONFIG_DEBUG_RT_MUTEXES is not set --# CONFIG_DEBUG_SPINLOCK is not set --# CONFIG_DEBUG_MUTEXES is not set --# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set --# CONFIG_DEBUG_LOCK_ALLOC is not set --# CONFIG_PROVE_LOCKING is not set --# CONFIG_LOCK_STAT is not set --# CONFIG_DEBUG_ATOMIC_SLEEP is not set --# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set --# CONFIG_LOCK_TORTURE_TEST is not set --CONFIG_STACKTRACE=y --# CONFIG_DEBUG_KOBJECT is not set --# CONFIG_DEBUG_BUGVERBOSE is not set --# CONFIG_DEBUG_LIST is not set --# CONFIG_DEBUG_PI_LIST is not set --# CONFIG_DEBUG_SG is not set --# CONFIG_DEBUG_NOTIFIERS is not set --# CONFIG_DEBUG_CREDENTIALS is not set -- --# --# RCU Debugging --# --# CONFIG_PROVE_RCU is not set --# CONFIG_SPARSE_RCU_POINTER is not set --# CONFIG_TORTURE_TEST is not set --# CONFIG_RCU_TORTURE_TEST is not set --CONFIG_RCU_CPU_STALL_TIMEOUT=21 --# CONFIG_RCU_TRACE is not set --# CONFIG_RCU_EQS_DEBUG is not set --# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set --# CONFIG_NOTIFIER_ERROR_INJECTION is not set --# CONFIG_FAULT_INJECTION is not set --CONFIG_NOP_TRACER=y --CONFIG_HAVE_FUNCTION_TRACER=y --CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y --CONFIG_HAVE_DYNAMIC_FTRACE=y --CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y --CONFIG_HAVE_SYSCALL_TRACEPOINTS=y --CONFIG_HAVE_C_RECORDMCOUNT=y --CONFIG_TRACE_CLOCK=y --CONFIG_RING_BUFFER=y --CONFIG_EVENT_TRACING=y --CONFIG_CONTEXT_SWITCH_TRACER=y --CONFIG_TRACING=y --CONFIG_GENERIC_TRACER=y --CONFIG_TRACING_SUPPORT=y --CONFIG_FTRACE=y --CONFIG_FUNCTION_TRACER=y --CONFIG_FUNCTION_GRAPH_TRACER=y --# CONFIG_IRQSOFF_TRACER is not set --# CONFIG_PREEMPT_TRACER is not set --# CONFIG_SCHED_TRACER is not set --# CONFIG_MISSED_TIMER_OFFSETS_HIST is not set --# CONFIG_FTRACE_SYSCALLS is not set --# CONFIG_TRACER_SNAPSHOT is not set --CONFIG_BRANCH_PROFILE_NONE=y --# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set --# CONFIG_PROFILE_ALL_BRANCHES is not set --# CONFIG_STACK_TRACER is not set --# CONFIG_BLK_DEV_IO_TRACE is not set --# CONFIG_UPROBE_EVENT is not set --# CONFIG_PROBE_EVENTS is not set --CONFIG_DYNAMIC_FTRACE=y --# CONFIG_FUNCTION_PROFILER is not set --CONFIG_FTRACE_MCOUNT_RECORD=y --# CONFIG_FTRACE_STARTUP_TEST is not set --# CONFIG_TRACEPOINT_BENCHMARK is not set --# CONFIG_RING_BUFFER_BENCHMARK is not set --# CONFIG_RING_BUFFER_STARTUP_TEST is not set --# CONFIG_TRACE_ENUM_MAP_FILE is not set --# CONFIG_TRACING_EVENTS_GPIO is not set -- --# --# Runtime Testing --# --# CONFIG_LKDTM is not set --# CONFIG_TEST_LIST_SORT is not set --# CONFIG_BACKTRACE_SELF_TEST is not set --# CONFIG_RBTREE_TEST is not set --# CONFIG_INTERVAL_TREE_TEST is not set --# CONFIG_PERCPU_TEST is not set --# CONFIG_ATOMIC64_SELFTEST is not set --# CONFIG_ASYNC_RAID6_TEST is not set --# CONFIG_TEST_HEXDUMP is not set --# CONFIG_TEST_STRING_HELPERS is not set --# CONFIG_TEST_KSTRTOX is not set --# CONFIG_TEST_PRINTF is not set --# CONFIG_TEST_RHASHTABLE is not set --# CONFIG_DMA_API_DEBUG is not set --# CONFIG_TEST_LKM is not set --# CONFIG_TEST_USER_COPY is not set --# CONFIG_TEST_BPF is not set --# CONFIG_TEST_FIRMWARE is not set --# CONFIG_TEST_UDELAY is not set --# CONFIG_MEMTEST is not set --# CONFIG_TEST_STATIC_KEYS is not set --# CONFIG_SAMPLES is not set --CONFIG_HAVE_ARCH_KGDB=y --# CONFIG_KGDB is not set --# CONFIG_ARM_PTDUMP is not set --# CONFIG_STRICT_DEVMEM is not set --CONFIG_ARM_UNWIND=y --CONFIG_OLD_MCOUNT=y --# CONFIG_DEBUG_USER is not set --# CONFIG_DEBUG_LL is not set --CONFIG_DEBUG_IMX_UART_PORT=1 --CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" --# CONFIG_DEBUG_UART_8250 is not set --# CONFIG_DEBUG_UART_BCM63XX is not set --CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" --# CONFIG_PID_IN_CONTEXTIDR is not set --# CONFIG_DEBUG_SET_MODULE_RONX is not set --# CONFIG_CORESIGHT is not set -- --# --# Security options --# --CONFIG_KEYS=y --# CONFIG_PERSISTENT_KEYRINGS is not set --# CONFIG_BIG_KEYS is not set --CONFIG_ENCRYPTED_KEYS=y --# CONFIG_SECURITY_DMESG_RESTRICT is not set --# CONFIG_SECURITY is not set --# CONFIG_SECURITYFS is not set --CONFIG_DEFAULT_SECURITY_DAC=y --CONFIG_DEFAULT_SECURITY="" --CONFIG_XOR_BLOCKS=y --CONFIG_ASYNC_CORE=m --CONFIG_ASYNC_MEMCPY=m --CONFIG_ASYNC_XOR=m --CONFIG_ASYNC_PQ=m --CONFIG_ASYNC_RAID6_RECOV=m --CONFIG_CRYPTO=y -- --# --# Crypto core or helper --# --CONFIG_CRYPTO_ALGAPI=y --CONFIG_CRYPTO_ALGAPI2=y --CONFIG_CRYPTO_AEAD=y --CONFIG_CRYPTO_AEAD2=y --CONFIG_CRYPTO_BLKCIPHER=y --CONFIG_CRYPTO_BLKCIPHER2=y --CONFIG_CRYPTO_HASH=y --CONFIG_CRYPTO_HASH2=y --CONFIG_CRYPTO_RNG=y --CONFIG_CRYPTO_RNG2=y --CONFIG_CRYPTO_RNG_DEFAULT=y --CONFIG_CRYPTO_PCOMP=y --CONFIG_CRYPTO_PCOMP2=y --CONFIG_CRYPTO_AKCIPHER2=y --CONFIG_CRYPTO_AKCIPHER=m --CONFIG_CRYPTO_RSA=m --CONFIG_CRYPTO_CRYPTODEV=y --CONFIG_CRYPTO_MANAGER=y --CONFIG_CRYPTO_MANAGER2=y --CONFIG_CRYPTO_USER=y --CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y --CONFIG_CRYPTO_GF128MUL=y --CONFIG_CRYPTO_NULL=y --CONFIG_CRYPTO_NULL2=y --CONFIG_CRYPTO_PCRYPT=y --CONFIG_CRYPTO_WORKQUEUE=y --CONFIG_CRYPTO_CRYPTD=y --CONFIG_CRYPTO_MCRYPTD=m --CONFIG_CRYPTO_AUTHENC=y --# CONFIG_CRYPTO_TEST is not set --CONFIG_CRYPTO_ABLK_HELPER=m -- --# --# Authenticated Encryption with Associated Data --# --CONFIG_CRYPTO_CCM=y --CONFIG_CRYPTO_GCM=y --CONFIG_CRYPTO_CHACHA20POLY1305=m --CONFIG_CRYPTO_SEQIV=y --CONFIG_CRYPTO_ECHAINIV=m -- --# --# Block modes --# --CONFIG_CRYPTO_CBC=y --CONFIG_CRYPTO_CTR=y --CONFIG_CRYPTO_CTS=y --CONFIG_CRYPTO_ECB=y --CONFIG_CRYPTO_LRW=y --CONFIG_CRYPTO_PCBC=y --CONFIG_CRYPTO_XTS=y --CONFIG_CRYPTO_KEYWRAP=m -- --# --# Hash modes --# --CONFIG_CRYPTO_CMAC=y --CONFIG_CRYPTO_HMAC=y --CONFIG_CRYPTO_XCBC=y --CONFIG_CRYPTO_VMAC=y -- --# --# Digest --# --CONFIG_CRYPTO_CRC32C=y --CONFIG_CRYPTO_CRC32=y --CONFIG_CRYPTO_CRCT10DIF=y --CONFIG_CRYPTO_GHASH=y --CONFIG_CRYPTO_POLY1305=m --CONFIG_CRYPTO_MD4=y --CONFIG_CRYPTO_MD5=y --CONFIG_CRYPTO_MICHAEL_MIC=y --CONFIG_CRYPTO_RMD128=m --CONFIG_CRYPTO_RMD160=m --CONFIG_CRYPTO_RMD256=m --CONFIG_CRYPTO_RMD320=m --CONFIG_CRYPTO_SHA1=y --CONFIG_CRYPTO_SHA256=y --CONFIG_CRYPTO_SHA512=y --CONFIG_CRYPTO_TGR192=m --CONFIG_CRYPTO_WP512=m -- --# --# Ciphers --# --CONFIG_CRYPTO_AES=y --CONFIG_CRYPTO_ANUBIS=m --CONFIG_CRYPTO_ARC4=y --CONFIG_CRYPTO_BLOWFISH=m --CONFIG_CRYPTO_BLOWFISH_COMMON=m --CONFIG_CRYPTO_CAMELLIA=m --CONFIG_CRYPTO_CAST_COMMON=m --CONFIG_CRYPTO_CAST5=m --CONFIG_CRYPTO_CAST6=m --CONFIG_CRYPTO_DES=y --CONFIG_CRYPTO_FCRYPT=m --CONFIG_CRYPTO_KHAZAD=m --CONFIG_CRYPTO_SALSA20=m --CONFIG_CRYPTO_CHACHA20=m --CONFIG_CRYPTO_SEED=m --CONFIG_CRYPTO_SERPENT=m --CONFIG_CRYPTO_TEA=y --CONFIG_CRYPTO_TWOFISH=y --CONFIG_CRYPTO_TWOFISH_COMMON=y -- --# --# Compression --# --CONFIG_CRYPTO_DEFLATE=y --CONFIG_CRYPTO_ZLIB=y --CONFIG_CRYPTO_LZO=y --CONFIG_CRYPTO_842=y --CONFIG_CRYPTO_LZ4=y --CONFIG_CRYPTO_LZ4HC=y -- --# --# Random Number Generation --# --CONFIG_CRYPTO_ANSI_CPRNG=y --CONFIG_CRYPTO_DRBG_MENU=y --CONFIG_CRYPTO_DRBG_HMAC=y --# CONFIG_CRYPTO_DRBG_HASH is not set --# CONFIG_CRYPTO_DRBG_CTR is not set --CONFIG_CRYPTO_DRBG=y --CONFIG_CRYPTO_JITTERENTROPY=y --CONFIG_CRYPTO_USER_API=m --CONFIG_CRYPTO_USER_API_HASH=m --CONFIG_CRYPTO_USER_API_SKCIPHER=m --CONFIG_CRYPTO_USER_API_RNG=m --# CONFIG_CRYPTO_USER_API_AEAD is not set --CONFIG_CRYPTO_HASH_INFO=y --CONFIG_CRYPTO_HW=y --# CONFIG_CRYPTO_DEV_HIFN_795X is not set --CONFIG_CRYPTO_DEV_FSL_CAAM=y --CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y --CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9 --# CONFIG_CRYPTO_DEV_FSL_CAAM_INTC is not set --CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y --CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API=y --CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y --CONFIG_CRYPTO_DEV_FSL_CAAM_IMX=y --CONFIG_CRYPTO_DEV_FSL_CAAM_LE=y --# CONFIG_CRYPTO_DEV_FSL_CAAM_SM is not set --# CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO is not set --# CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG is not set --# CONFIG_CRYPTO_DEV_SAHARA is not set --# CONFIG_CRYPTO_DEV_MXS_DCP is not set --CONFIG_ASYMMETRIC_KEY_TYPE=m --CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m --CONFIG_PUBLIC_KEY_ALGO_RSA=m --CONFIG_X509_CERTIFICATE_PARSER=m --CONFIG_PKCS7_MESSAGE_PARSER=m --CONFIG_PKCS7_TEST_KEY=m -- --# --# Certificates for signature checking --# --CONFIG_SYSTEM_TRUSTED_KEYRING=y --CONFIG_SYSTEM_TRUSTED_KEYS="" --CONFIG_ARM_CRYPTO=y --CONFIG_CRYPTO_SHA1_ARM=m --CONFIG_CRYPTO_SHA1_ARM_NEON=m --CONFIG_CRYPTO_SHA1_ARM_CE=m --CONFIG_CRYPTO_SHA2_ARM_CE=m --CONFIG_CRYPTO_SHA256_ARM=y --CONFIG_CRYPTO_SHA512_ARM=m --CONFIG_CRYPTO_AES_ARM=m --CONFIG_CRYPTO_AES_ARM_BS=m --CONFIG_CRYPTO_AES_ARM_CE=m --CONFIG_CRYPTO_GHASH_ARM_CE=m --CONFIG_BINARY_PRINTF=y -- --# --# Library routines --# --CONFIG_RAID6_PQ=y --CONFIG_BITREVERSE=y --CONFIG_HAVE_ARCH_BITREVERSE=y --CONFIG_RATIONAL=y --CONFIG_GENERIC_STRNCPY_FROM_USER=y --CONFIG_GENERIC_STRNLEN_USER=y --CONFIG_GENERIC_NET_UTILS=y --CONFIG_GENERIC_PCI_IOMAP=y --CONFIG_GENERIC_IO=y --CONFIG_STMP_DEVICE=y --CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y --CONFIG_CRC_CCITT=y --CONFIG_CRC16=y --CONFIG_CRC_T10DIF=y --CONFIG_CRC_ITU_T=y --CONFIG_CRC32=y --# CONFIG_CRC32_SELFTEST is not set --CONFIG_CRC32_SLICEBY8=y --# CONFIG_CRC32_SLICEBY4 is not set --# CONFIG_CRC32_SARWATE is not set --# CONFIG_CRC32_BIT is not set --CONFIG_CRC7=y --CONFIG_LIBCRC32C=y --CONFIG_CRC8=m --# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set --# CONFIG_RANDOM32_SELFTEST is not set --CONFIG_842_COMPRESS=y --CONFIG_842_DECOMPRESS=y --CONFIG_ZLIB_INFLATE=y --CONFIG_ZLIB_DEFLATE=y --CONFIG_LZO_COMPRESS=y --CONFIG_LZO_DECOMPRESS=y --CONFIG_LZ4_COMPRESS=y --CONFIG_LZ4HC_COMPRESS=y --CONFIG_LZ4_DECOMPRESS=y --CONFIG_XZ_DEC=m --# CONFIG_XZ_DEC_X86 is not set --# CONFIG_XZ_DEC_POWERPC is not set --# CONFIG_XZ_DEC_IA64 is not set --CONFIG_XZ_DEC_ARM=y --CONFIG_XZ_DEC_ARMTHUMB=y --# CONFIG_XZ_DEC_SPARC is not set --CONFIG_XZ_DEC_BCJ=y --# CONFIG_XZ_DEC_TEST is not set --CONFIG_DECOMPRESS_GZIP=y --CONFIG_DECOMPRESS_LZO=y --CONFIG_GENERIC_ALLOCATOR=y --CONFIG_TEXTSEARCH=y --CONFIG_TEXTSEARCH_KMP=m --CONFIG_TEXTSEARCH_BM=m --CONFIG_TEXTSEARCH_FSM=m --CONFIG_BTREE=y --CONFIG_ASSOCIATIVE_ARRAY=y --CONFIG_HAS_IOMEM=y --CONFIG_HAS_IOPORT_MAP=y --CONFIG_HAS_DMA=y --CONFIG_CPU_RMAP=y --CONFIG_DQL=y --CONFIG_GLOB=y --# CONFIG_GLOB_SELFTEST is not set --CONFIG_NLATTR=y --CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y --CONFIG_CLZ_TAB=y --CONFIG_CORDIC=y --# CONFIG_DDR is not set --CONFIG_MPILIB=m --CONFIG_LIBFDT=y --CONFIG_OID_REGISTRY=y --CONFIG_FONT_SUPPORT=y --# CONFIG_FONTS is not set --CONFIG_FONT_8x8=y --CONFIG_FONT_8x16=y --# CONFIG_SG_SPLIT is not set --CONFIG_ARCH_HAS_SG_CHAIN=y --# CONFIG_VIRTUALIZATION is not set -diff --git a/arch/arm/configs/xbian_defconfig_imx6_mvebu b/arch/arm/configs/xbian_defconfig_imx6_mvebu -index 2bc59d8..83cda36 100644 ---- a/arch/arm/configs/xbian_defconfig_imx6_mvebu -+++ b/arch/arm/configs/xbian_defconfig_imx6_mvebu -@@ -1,6 +1,6 @@ - # - # Automatically generated file; DO NOT EDIT. --# Linux/arm 4.4.1 Kernel Configuration -+# Linux/arm 4.4.6 Kernel Configuration - # - CONFIG_ARM=y - CONFIG_ARM_HAS_SG_CHAIN=y -@@ -83,7 +83,7 @@ CONFIG_NO_HZ_COMMON=y - # CONFIG_HZ_PERIODIC is not set - CONFIG_NO_HZ_IDLE=y - # CONFIG_NO_HZ_FULL is not set --CONFIG_NO_HZ=y -+# CONFIG_NO_HZ is not set - CONFIG_HIGH_RES_TIMERS=y - - # -@@ -104,12 +104,12 @@ CONFIG_RCU_EXPERT=y - CONFIG_SRCU=y - # CONFIG_TASKS_RCU is not set - CONFIG_RCU_STALL_COMMON=y --CONFIG_RCU_FANOUT=16 --CONFIG_RCU_FANOUT_LEAF=8 -+CONFIG_RCU_FANOUT=8 -+CONFIG_RCU_FANOUT_LEAF=2 - # CONFIG_TREE_RCU_TRACE is not set - CONFIG_RCU_BOOST=y - CONFIG_RCU_KTHREAD_PRIO=1 --CONFIG_RCU_BOOST_DELAY=500 -+CONFIG_RCU_BOOST_DELAY=300 - CONFIG_RCU_NOCB_CPU=y - CONFIG_RCU_NOCB_CPU_NONE=y - # CONFIG_RCU_NOCB_CPU_ZERO is not set -@@ -166,7 +166,6 @@ CONFIG_MULTIUSER=y - CONFIG_SYSFS_SYSCALL=y - CONFIG_SYSCTL_SYSCALL=y - CONFIG_KALLSYMS=y --CONFIG_KALLSYMS_ALL=y - CONFIG_PRINTK=y - CONFIG_BUG=y - CONFIG_BASE_FULL=y -@@ -178,7 +177,7 @@ CONFIG_EVENTFD=y - # CONFIG_BPF_SYSCALL is not set - CONFIG_SHMEM=y - CONFIG_AIO=y --# CONFIG_ADVISE_SYSCALLS is not set -+CONFIG_ADVISE_SYSCALLS=y - CONFIG_USERFAULTFD=y - CONFIG_PCI_QUIRKS=y - CONFIG_MEMBARRIER=y -@@ -190,7 +189,6 @@ CONFIG_PERF_USE_VMALLOC=y - # Kernel Performance Events And Counters - # - CONFIG_PERF_EVENTS=y --# CONFIG_DEBUG_PERF_USE_VMALLOC is not set - # CONFIG_VM_EVENT_COUNTERS is not set - # CONFIG_SLUB_DEBUG is not set - CONFIG_COMPAT_BRK=y -@@ -248,8 +246,8 @@ CONFIG_MODULES=y - # CONFIG_MODULE_FORCE_LOAD is not set - CONFIG_MODULE_UNLOAD=y - # CONFIG_MODULE_FORCE_UNLOAD is not set --CONFIG_MODVERSIONS=y --CONFIG_MODULE_SRCVERSION_ALL=y -+# CONFIG_MODVERSIONS is not set -+# CONFIG_MODULE_SRCVERSION_ALL is not set - # CONFIG_MODULE_SIG is not set - # CONFIG_MODULE_COMPRESS is not set - CONFIG_MODULES_TREE_LOOKUP=y -@@ -490,7 +488,6 @@ CONFIG_PCI_DOMAINS=y - CONFIG_PCI_DOMAINS_GENERIC=y - CONFIG_PCI_SYSCALL=y - CONFIG_PCI_MSI=y --# CONFIG_PCI_DEBUG is not set - CONFIG_PCI_REALLOC_ENABLE_AUTO=y - CONFIG_PCI_STUB=y - CONFIG_PCI_ATS=y -@@ -587,14 +584,12 @@ CONFIG_MIGRATION=y - CONFIG_ZONE_DMA_FLAG=1 - CONFIG_BOUNCE=y - # CONFIG_KSM is not set --CONFIG_DEFAULT_MMAP_MIN_ADDR=16384 --CONFIG_CLEANCACHE=y --CONFIG_FRONTSWAP=y -+CONFIG_DEFAULT_MMAP_MIN_ADDR=8192 -+# CONFIG_CLEANCACHE is not set -+# CONFIG_FRONTSWAP is not set - CONFIG_CMA=y --# CONFIG_CMA_DEBUG is not set - # CONFIG_CMA_DEBUGFS is not set - CONFIG_CMA_AREAS=7 --# CONFIG_ZSWAP is not set - # CONFIG_ZPOOL is not set - # CONFIG_ZBUD is not set - # CONFIG_ZSMALLOC is not set -@@ -699,14 +694,18 @@ CONFIG_BINFMT_MISC=m - CONFIG_SUSPEND=y - CONFIG_SUSPEND_FREEZER=y - # CONFIG_SUSPEND_SKIP_SYNC is not set --# CONFIG_HIBERNATION is not set -+CONFIG_HIBERNATE_CALLBACKS=y -+CONFIG_HIBERNATION=y -+CONFIG_PM_STD_PARTITION="" - CONFIG_PM_SLEEP=y - CONFIG_PM_SLEEP_SMP=y - # CONFIG_PM_AUTOSLEEP is not set --# CONFIG_PM_WAKELOCKS is not set -+CONFIG_PM_WAKELOCKS=y -+CONFIG_PM_WAKELOCKS_LIMIT=100 -+CONFIG_PM_WAKELOCKS_GC=y - CONFIG_PM=y - # CONFIG_PM_DEBUG is not set --# CONFIG_APM_EMULATION is not set -+CONFIG_APM_EMULATION=y - CONFIG_PM_OPP=y - CONFIG_PM_CLK=y - CONFIG_PM_GENERIC_DOMAINS=y -@@ -777,7 +776,7 @@ CONFIG_INET_UDP_DIAG=m - CONFIG_TCP_CONG_ADVANCED=y - CONFIG_TCP_CONG_BIC=m - CONFIG_TCP_CONG_CUBIC=m --CONFIG_TCP_CONG_WESTWOOD=m -+CONFIG_TCP_CONG_WESTWOOD=y - CONFIG_TCP_CONG_HTCP=m - CONFIG_TCP_CONG_HSTCP=m - CONFIG_TCP_CONG_HYBLA=m -@@ -789,9 +788,10 @@ CONFIG_TCP_CONG_YEAH=y - CONFIG_TCP_CONG_ILLINOIS=m - CONFIG_TCP_CONG_DCTCP=m - # CONFIG_TCP_CONG_CDG is not set --CONFIG_DEFAULT_VEGAS=y -+# CONFIG_DEFAULT_VEGAS is not set -+CONFIG_DEFAULT_WESTWOOD=y - # CONFIG_DEFAULT_RENO is not set --CONFIG_DEFAULT_TCP_CONG="vegas" -+CONFIG_DEFAULT_TCP_CONG="westwood" - CONFIG_TCP_MD5SIG=y - CONFIG_IPV6=m - CONFIG_IPV6_ROUTER_PREF=y -@@ -821,7 +821,7 @@ CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y - CONFIG_IPV6_PIMSM_V2=y - # CONFIG_NETWORK_SECMARK is not set - CONFIG_NET_PTP_CLASSIFY=y --# CONFIG_NETWORK_PHY_TIMESTAMPING is not set -+CONFIG_NETWORK_PHY_TIMESTAMPING=y - CONFIG_NETFILTER=y - # CONFIG_NETFILTER_DEBUG is not set - CONFIG_NETFILTER_ADVANCED=y -@@ -1153,20 +1153,15 @@ CONFIG_INET_DCCP_DIAG=m - CONFIG_IP_DCCP_CCID3=y - # CONFIG_IP_DCCP_CCID3_DEBUG is not set - CONFIG_IP_DCCP_TFRC_LIB=y -- --# --# DCCP Kernel Hacking --# --# CONFIG_IP_DCCP_DEBUG is not set - CONFIG_IP_SCTP=m - # CONFIG_SCTP_DBG_OBJCNT is not set --CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5=y -+# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5 is not set - # CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA1 is not set --# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE is not set --CONFIG_SCTP_COOKIE_HMAC_MD5=y --CONFIG_SCTP_COOKIE_HMAC_SHA1=y -+CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE=y -+# CONFIG_SCTP_COOKIE_HMAC_MD5 is not set -+# CONFIG_SCTP_COOKIE_HMAC_SHA1 is not set - CONFIG_RDS=m --# CONFIG_RDS_TCP is not set -+CONFIG_RDS_TCP=m - # CONFIG_RDS_DEBUG is not set - CONFIG_TIPC=m - CONFIG_TIPC_MEDIA_UDP=y -@@ -1177,6 +1172,8 @@ CONFIG_L2TP_V3=y - CONFIG_L2TP_IP=m - CONFIG_L2TP_ETH=m - CONFIG_STP=m -+CONFIG_GARP=m -+CONFIG_MRP=m - CONFIG_BRIDGE=m - CONFIG_BRIDGE_IGMP_SNOOPING=y - CONFIG_BRIDGE_VLAN_FILTERING=y -@@ -1185,8 +1182,8 @@ CONFIG_NET_DSA=y - CONFIG_NET_DSA_HWMON=y - CONFIG_NET_DSA_TAG_EDSA=y - CONFIG_VLAN_8021Q=m --# CONFIG_VLAN_8021Q_GVRP is not set --# CONFIG_VLAN_8021Q_MVRP is not set -+CONFIG_VLAN_8021Q_GVRP=y -+CONFIG_VLAN_8021Q_MVRP=y - # CONFIG_DECNET is not set - CONFIG_LLC=m - CONFIG_LLC2=m -@@ -1197,7 +1194,7 @@ CONFIG_IPDDP=m - CONFIG_IPDDP_ENCAP=y - # CONFIG_X25 is not set - # CONFIG_LAPB is not set --# CONFIG_PHONET is not set -+CONFIG_PHONET=m - # CONFIG_6LOWPAN is not set - # CONFIG_IEEE802154 is not set - CONFIG_NET_SCHED=y -@@ -1286,7 +1283,7 @@ CONFIG_NET_MPLS_GSO=m - # CONFIG_MPLS_ROUTING is not set - # CONFIG_HSR is not set - CONFIG_NET_SWITCHDEV=y --# CONFIG_NET_L3_MASTER_DEV is not set -+CONFIG_NET_L3_MASTER_DEV=y - CONFIG_RPS=y - CONFIG_RFS_ACCEL=y - CONFIG_XPS=y -@@ -1403,7 +1400,6 @@ CONFIG_BT_CMTP=m - CONFIG_BT_HIDP=y - CONFIG_BT_HS=y - CONFIG_BT_LE=y --# CONFIG_BT_SELFTEST is not set - # CONFIG_BT_DEBUGFS is not set - - # -@@ -1523,8 +1519,6 @@ CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y - CONFIG_WANT_DEV_COREDUMP=y - CONFIG_ALLOW_DEV_COREDUMP=y - CONFIG_DEV_COREDUMP=y --# CONFIG_DEBUG_DRIVER is not set --# CONFIG_DEBUG_DEVRES is not set - # CONFIG_SYS_HYPERVISOR is not set - # CONFIG_GENERIC_CPU_DEVICES is not set - CONFIG_SOC_BUS=y -@@ -2043,9 +2037,9 @@ CONFIG_DM_VERITY=m - # CONFIG_FIREWIRE is not set - # CONFIG_FIREWIRE_NOSY is not set - CONFIG_NETDEVICES=y --CONFIG_MII=y -+CONFIG_MII=m - CONFIG_NET_CORE=y --CONFIG_BONDING=y -+CONFIG_BONDING=m - CONFIG_DUMMY=m - CONFIG_EQUALIZER=m - # CONFIG_NET_FC is not set -@@ -2070,6 +2064,7 @@ CONFIG_TUN=m - CONFIG_VETH=m - # CONFIG_VIRTIO_NET is not set - CONFIG_NLMON=m -+# CONFIG_NET_VRF is not set - # CONFIG_ARCNET is not set - - # -@@ -2096,7 +2091,7 @@ CONFIG_NET_DSA_MV88E6XXX=y - CONFIG_NET_DSA_MV88E6352=y - # CONFIG_NET_DSA_BCM_SF2 is not set - CONFIG_ETHERNET=y --CONFIG_MDIO=y -+CONFIG_MDIO=m - # CONFIG_NET_VENDOR_3COM is not set - # CONFIG_NET_VENDOR_ADAPTEC is not set - # CONFIG_NET_VENDOR_AGERE is not set -@@ -2105,11 +2100,11 @@ CONFIG_MDIO=y - # CONFIG_NET_VENDOR_AMD is not set - # CONFIG_NET_VENDOR_ARC is not set - CONFIG_NET_VENDOR_ATHEROS=y --CONFIG_ATL2=y --CONFIG_ATL1=y --CONFIG_ATL1E=y --CONFIG_ATL1C=y --CONFIG_ALX=y -+CONFIG_ATL2=m -+CONFIG_ATL1=m -+CONFIG_ATL1E=m -+CONFIG_ATL1C=m -+CONFIG_ALX=m - # CONFIG_NET_VENDOR_AURORA is not set - # CONFIG_NET_CADENCE is not set - # CONFIG_NET_VENDOR_BROADCOM is not set -@@ -2129,7 +2124,7 @@ CONFIG_ALX=y - CONFIG_NET_VENDOR_FREESCALE=y - CONFIG_FEC=y - CONFIG_FSL_PQ_MDIO=y --CONFIG_FSL_XGMAC_MDIO=y -+# CONFIG_FSL_XGMAC_MDIO is not set - CONFIG_GIANFAR=y - # CONFIG_NET_VENDOR_HISILICON is not set - # CONFIG_NET_VENDOR_HP is not set -@@ -2279,6 +2274,7 @@ CONFIG_USB_NET_KALMIA=m - CONFIG_USB_NET_QMI_WWAN=m - CONFIG_USB_HSO=m - CONFIG_USB_NET_INT51X1=m -+# CONFIG_USB_CDC_PHONET is not set - CONFIG_USB_IPHETH=m - CONFIG_USB_SIERRA_NET=m - CONFIG_USB_VL600=m -@@ -2471,24 +2467,9 @@ CONFIG_RT2X00_LIB_LEDS=y - # CONFIG_RT2X00_DEBUG is not set - CONFIG_WL_MEDIATEK=y - CONFIG_MT7601U=m --CONFIG_RTL_CARDS=m --CONFIG_RTL8192CE=m --CONFIG_RTL8192SE=m --CONFIG_RTL8192DE=m --CONFIG_RTL8723AE=m --CONFIG_RTL8723BE=m --CONFIG_RTL8188EE=m --CONFIG_RTL8192EE=m --CONFIG_RTL8821AE=m -+CONFIG_RTL8XXXU=m -+CONFIG_RTL8XXXU_UNTESTED=y - CONFIG_RTL8192CU=m --CONFIG_RTLWIFI=m --CONFIG_RTLWIFI_PCI=m --CONFIG_RTLWIFI_USB=m --CONFIG_RTLWIFI_DEBUG=y --CONFIG_RTL8192C_COMMON=m --CONFIG_RTL8723_COMMON=m --CONFIG_RTLBTCOEXIST=m --# CONFIG_RTL8XXXU is not set - CONFIG_WL_TI=y - CONFIG_WL1251=m - CONFIG_WL1251_SPI=m -@@ -2619,6 +2600,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 - CONFIG_INPUT_JOYDEV=m - CONFIG_INPUT_EVDEV=y - CONFIG_INPUT_EVBUG=m -+# CONFIG_INPUT_APMPOWER is not set - - # - # Input Device Drivers -@@ -3007,7 +2989,6 @@ CONFIG_I2C_SLAVE_EEPROM=m - # CONFIG_I2C_DEBUG_ALGO is not set - # CONFIG_I2C_DEBUG_BUS is not set - CONFIG_SPI=y --# CONFIG_SPI_DEBUG is not set - CONFIG_SPI_MASTER=y - - # -@@ -3016,8 +2997,8 @@ CONFIG_SPI_MASTER=y - # CONFIG_SPI_ALTERA is not set - CONFIG_SPI_BITBANG=y - # CONFIG_SPI_CADENCE is not set --CONFIG_SPI_GPIO=y --CONFIG_SPI_IMX=m -+# CONFIG_SPI_GPIO is not set -+CONFIG_SPI_IMX=y - # CONFIG_SPI_FSL_SPI is not set - # CONFIG_SPI_OC_TINY is not set - CONFIG_SPI_ORION=m -@@ -3043,13 +3024,14 @@ CONFIG_SPI_SPIDEV=y - # - CONFIG_PPS=y - # CONFIG_PPS_DEBUG is not set -+CONFIG_NTP_PPS=y - - # - # PPS clients support - # - # CONFIG_PPS_CLIENT_KTIMER is not set --CONFIG_PPS_CLIENT_LDISC=m --CONFIG_PPS_CLIENT_GPIO=m -+CONFIG_PPS_CLIENT_LDISC=y -+CONFIG_PPS_CLIENT_GPIO=y - - # - # PPS generators support -@@ -3060,10 +3042,7 @@ CONFIG_PPS_CLIENT_GPIO=m - # - CONFIG_PTP_1588_CLOCK=y - CONFIG_PTP_1588_CLOCK_GIANFAR=y -- --# --# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. --# -+# CONFIG_DP83640_PHY is not set - CONFIG_PINCTRL=y - - # -@@ -3072,7 +3051,6 @@ CONFIG_PINCTRL=y - CONFIG_PINMUX=y - CONFIG_PINCONF=y - CONFIG_GENERIC_PINCONF=y --# CONFIG_DEBUG_PINCTRL is not set - # CONFIG_PINCTRL_AMD is not set - CONFIG_PINCTRL_SINGLE=y - CONFIG_PINCTRL_IMX=y -@@ -3087,7 +3065,6 @@ CONFIG_GPIOLIB=y - CONFIG_GPIO_DEVRES=y - CONFIG_OF_GPIO=y - CONFIG_GPIOLIB_IRQCHIP=y --# CONFIG_DEBUG_GPIO is not set - CONFIG_GPIO_SYSFS=y - CONFIG_GPIO_GENERIC=y - -@@ -3101,6 +3078,7 @@ CONFIG_GPIO_74XX_MMIO=y - CONFIG_GPIO_GENERIC_PLATFORM=y - # CONFIG_GPIO_GRGPIO is not set - CONFIG_GPIO_MVEBU=y -+CONFIG_GPIO_MVEBU_PWM=y - CONFIG_GPIO_MXC=y - CONFIG_GPIO_SYSCON=y - # CONFIG_GPIO_VX855 is not set -@@ -3181,6 +3159,7 @@ CONFIG_W1_SLAVE_BQ27000=m - CONFIG_POWER_SUPPLY=y - # CONFIG_POWER_SUPPLY_DEBUG is not set - # CONFIG_PDA_POWER is not set -+# CONFIG_APM_POWER is not set - # CONFIG_GENERIC_ADC_BATTERY is not set - CONFIG_TEST_POWER=m - # CONFIG_BATTERY_88PM860X is not set -@@ -4830,7 +4809,7 @@ CONFIG_USB_XHCI_MVEBU=y - CONFIG_USB_EHCI_HCD=y - CONFIG_USB_EHCI_ROOT_HUB_TT=y - CONFIG_USB_EHCI_TT_NEWSCHED=y --CONFIG_USB_FSL_MPH_DR_OF=m -+CONFIG_USB_FSL_MPH_DR_OF=y - CONFIG_USB_EHCI_PCI=y - CONFIG_USB_EHCI_MXC=y - CONFIG_USB_EHCI_HCD_ORION=y -@@ -5044,7 +5023,6 @@ CONFIG_USB_ISP1301=y - CONFIG_USB_MXS_PHY=y - # CONFIG_USB_ULPI is not set - CONFIG_USB_GADGET=y --# CONFIG_USB_GADGET_DEBUG is not set - # CONFIG_USB_GADGET_DEBUG_FILES is not set - # CONFIG_USB_GADGET_DEBUG_FS is not set - CONFIG_USB_GADGET_VBUS_DRAW=2 -@@ -5053,7 +5031,7 @@ CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 - # - # USB Peripheral Controller - # --CONFIG_USB_FSL_USB2=m -+CONFIG_USB_FSL_USB2=y - # CONFIG_USB_FUSB300 is not set - # CONFIG_USB_FOTG210_UDC is not set - # CONFIG_USB_GR_UDC is not set -@@ -5099,6 +5077,7 @@ CONFIG_USB_CONFIGFS_ECM=y - CONFIG_USB_CONFIGFS_ECM_SUBSET=y - CONFIG_USB_CONFIGFS_RNDIS=y - CONFIG_USB_CONFIGFS_EEM=y -+# CONFIG_USB_CONFIGFS_PHONET is not set - CONFIG_USB_CONFIGFS_MASS_STORAGE=y - CONFIG_USB_CONFIGFS_F_LB_SS=y - CONFIG_USB_CONFIGFS_F_FS=y -@@ -5126,6 +5105,7 @@ CONFIG_USB_G_SERIAL=m - CONFIG_USB_MIDI_GADGET=m - CONFIG_USB_G_PRINTER=m - CONFIG_USB_CDC_COMPOSITE=m -+# CONFIG_USB_G_NOKIA is not set - CONFIG_USB_G_ACM_MS=m - CONFIG_USB_G_MULTI=m - CONFIG_USB_G_MULTI_RNDIS=y -@@ -5531,11 +5511,14 @@ CONFIG_DVB_MN88473=m - CONFIG_LIRC_STAGING=y - CONFIG_LIRC_BT829=m - CONFIG_LIRC_IMON=m -+CONFIG_LIRC_HB=m -+CONFIG_LIRC_XBOX=m - CONFIG_LIRC_SASEM=m - CONFIG_LIRC_SERIAL=m - CONFIG_LIRC_SERIAL_TRANSMITTER=y - CONFIG_LIRC_SIR=m - CONFIG_LIRC_ZILOG=m -+CONFIG_LIRC_ATIUSB=m - - # - # Android -@@ -6177,7 +6160,6 @@ CONFIG_NFSD_V3=y - CONFIG_NFSD_V3_ACL=y - CONFIG_NFSD_V4=y - # CONFIG_NFSD_PNFS is not set --# CONFIG_NFSD_FAULT_INJECTION is not set - CONFIG_GRACE_PERIOD=y - CONFIG_LOCKD=y - CONFIG_LOCKD_V4=y -@@ -6274,83 +6256,47 @@ CONFIG_DLM=m - # - CONFIG_PRINTK_TIME=y - CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 --# CONFIG_BOOT_PRINTK_DELAY is not set - CONFIG_DYNAMIC_DEBUG=y - - # - # Compile-time checks and compiler options - # --# CONFIG_DEBUG_INFO is not set - CONFIG_ENABLE_WARN_DEPRECATED=y - CONFIG_ENABLE_MUST_CHECK=y - CONFIG_FRAME_WARN=1024 - CONFIG_STRIP_ASM_SYMS=y --# CONFIG_READABLE_ASM is not set - # CONFIG_UNUSED_SYMBOLS is not set --# CONFIG_PAGE_OWNER is not set - CONFIG_DEBUG_FS=y - # CONFIG_HEADERS_CHECK is not set - # CONFIG_DEBUG_SECTION_MISMATCH is not set - CONFIG_SECTION_MISMATCH_WARN_ONLY=y - CONFIG_FRAME_POINTER=y --# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set - CONFIG_MAGIC_SYSRQ=y - CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1 --CONFIG_DEBUG_KERNEL=y -+# CONFIG_DEBUG_KERNEL is not set - - # - # Memory Debugging - # - # CONFIG_PAGE_EXTENSION is not set --# CONFIG_DEBUG_PAGEALLOC is not set --# CONFIG_DEBUG_OBJECTS is not set - # CONFIG_SLUB_STATS is not set - CONFIG_HAVE_DEBUG_KMEMLEAK=y --# CONFIG_DEBUG_KMEMLEAK is not set --# CONFIG_DEBUG_STACK_USAGE is not set --# CONFIG_DEBUG_VM is not set - # CONFIG_DEBUG_MEMORY_INIT is not set --# CONFIG_DEBUG_PER_CPU_MAPS is not set --# CONFIG_DEBUG_HIGHMEM is not set --# CONFIG_DEBUG_SHIRQ is not set - - # - # Debug Lockups and Hangs - # --# CONFIG_LOCKUP_DETECTOR is not set --# CONFIG_DETECT_HUNG_TASK is not set - CONFIG_PANIC_ON_OOPS=y - CONFIG_PANIC_ON_OOPS_VALUE=1 - CONFIG_PANIC_TIMEOUT=1 --# CONFIG_SCHED_DEBUG is not set - # CONFIG_SCHED_INFO is not set --# CONFIG_SCHEDSTATS is not set --# CONFIG_SCHED_STACK_END_CHECK is not set - # CONFIG_DEBUG_TIMEKEEPING is not set --CONFIG_TIMER_STATS=y --# CONFIG_DEBUG_PREEMPT is not set - - # - # Lock Debugging (spinlocks, mutexes, etc...) - # --# CONFIG_DEBUG_RT_MUTEXES is not set --# CONFIG_DEBUG_SPINLOCK is not set --# CONFIG_DEBUG_MUTEXES is not set --# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set --# CONFIG_DEBUG_LOCK_ALLOC is not set --# CONFIG_PROVE_LOCKING is not set --# CONFIG_LOCK_STAT is not set --# CONFIG_DEBUG_ATOMIC_SLEEP is not set --# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set --# CONFIG_LOCK_TORTURE_TEST is not set - CONFIG_STACKTRACE=y --# CONFIG_DEBUG_KOBJECT is not set --# CONFIG_DEBUG_BUGVERBOSE is not set --# CONFIG_DEBUG_LIST is not set --# CONFIG_DEBUG_PI_LIST is not set --# CONFIG_DEBUG_SG is not set --# CONFIG_DEBUG_NOTIFIERS is not set --# CONFIG_DEBUG_CREDENTIALS is not set -+CONFIG_DEBUG_BUGVERBOSE=y - - # - # RCU Debugging -@@ -6358,13 +6304,7 @@ CONFIG_STACKTRACE=y - # CONFIG_PROVE_RCU is not set - # CONFIG_SPARSE_RCU_POINTER is not set - # CONFIG_TORTURE_TEST is not set --# CONFIG_RCU_TORTURE_TEST is not set - CONFIG_RCU_CPU_STALL_TIMEOUT=21 --# CONFIG_RCU_TRACE is not set --# CONFIG_RCU_EQS_DEBUG is not set --# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set --# CONFIG_NOTIFIER_ERROR_INJECTION is not set --# CONFIG_FAULT_INJECTION is not set - CONFIG_NOP_TRACER=y - CONFIG_HAVE_FUNCTION_TRACER=y - CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -@@ -6409,11 +6349,6 @@ CONFIG_FTRACE_MCOUNT_RECORD=y - # Runtime Testing - # - # CONFIG_LKDTM is not set --# CONFIG_TEST_LIST_SORT is not set --# CONFIG_BACKTRACE_SELF_TEST is not set --# CONFIG_RBTREE_TEST is not set --# CONFIG_INTERVAL_TREE_TEST is not set --# CONFIG_PERCPU_TEST is not set - # CONFIG_ATOMIC64_SELFTEST is not set - # CONFIG_ASYNC_RAID6_TEST is not set - # CONFIG_TEST_HEXDUMP is not set -@@ -6431,17 +6366,13 @@ CONFIG_FTRACE_MCOUNT_RECORD=y - # CONFIG_TEST_STATIC_KEYS is not set - # CONFIG_SAMPLES is not set - CONFIG_HAVE_ARCH_KGDB=y --# CONFIG_KGDB is not set --# CONFIG_ARM_PTDUMP is not set - # CONFIG_STRICT_DEVMEM is not set - CONFIG_ARM_UNWIND=y - CONFIG_OLD_MCOUNT=y - # CONFIG_DEBUG_USER is not set --# CONFIG_DEBUG_LL is not set - CONFIG_DEBUG_IMX_UART_PORT=1 - CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" - # CONFIG_DEBUG_UART_8250 is not set --# CONFIG_DEBUG_UART_BCM63XX is not set - CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" - # CONFIG_PID_IN_CONTEXTIDR is not set - # CONFIG_DEBUG_SET_MODULE_RONX is not set - -From 833b5806b812ad66ada5331c86256c1d43e34505 Mon Sep 17 00:00:00 2001 -From: Troy Kisky -Date: Mon, 8 Jun 2015 09:49:47 -0700 -Subject: [PATCH 11/13] fec: Russell Kings corruption fix - -(cherry picked from commit 43e7d29fd2c0df374a95341146991cc449c016b7) -Signed-off-by: Matus Kral ---- - drivers/net/ethernet/freescale/fec_main.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c -index d9f1ab3..55bab37 100644 ---- a/drivers/net/ethernet/freescale/fec_main.c -+++ b/drivers/net/ethernet/freescale/fec_main.c -@@ -1237,8 +1237,7 @@ fec_enet_tx_queue(struct net_device *ndev, u16 queue_id) - skb = txq->tx_skbuff[index]; - bdnum++; - } -- if (skb_shinfo(skb)->nr_frags && -- (status = bdp_t->cbd_sc) & BD_ENET_TX_READY) -+ if ((status = bdp_t->cbd_sc) & BD_ENET_TX_READY) - break; - - for (i = 0; i < bdnum; i++) { - -From 1a8873f4490146dc03361d30e2d263b823579546 Mon Sep 17 00:00:00 2001 -From: Matus Kral -Date: Thu, 14 Apr 2016 03:12:49 +0200 -Subject: [PATCH 12/13] sdhci-esdhc-imx: add SDHCI_QUIRK2_TUNING_WORK_AROUND - for imx6q - ---- - drivers/mmc/host/sdhci-esdhc-imx.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c -index 5e23d78..83632d2 100644 ---- a/drivers/mmc/host/sdhci-esdhc-imx.c -+++ b/drivers/mmc/host/sdhci-esdhc-imx.c -@@ -136,6 +136,7 @@ - #define ESDHC_FLAG_HS200 BIT(8) - /* The IP supports HS400 mode */ - #define ESDHC_FLAG_HS400 BIT(9) -+#define ESDHC_FLAG_TUNING_WORK_AROUND BIT(10) - - /* A higher clock ferquency than this rate requires strobell dll control */ - #define ESDHC_STROBE_DLL_CLK_FREQ 100000000 -@@ -161,7 +162,8 @@ static struct esdhc_soc_data esdhc_imx53_data = { - }; - - static struct esdhc_soc_data usdhc_imx6q_data = { -- .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING, -+ .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING -+ | ESDHC_FLAG_TUNING_WORK_AROUND, - }; - - static struct esdhc_soc_data usdhc_imx6sl_data = { -@@ -1020,6 +1022,9 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev, - if (!IS_ERR_VALUE(mmc_gpio_get_cd(host->mmc))) - host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; - -+ if (imx_data->socdata->flags & ESDHC_FLAG_TUNING_WORK_AROUND) -+ host->quirks2 |= SDHCI_QUIRK2_TUNING_WORK_AROUND; -+ - return 0; - } - #else - -From ade5a7b4a7dec8272815ee4253c32427b1e9310c Mon Sep 17 00:00:00 2001 -From: Matus Kral -Date: Thu, 14 Apr 2016 03:14:31 +0200 -Subject: [PATCH 13/13] mxc_hdmi: edit after - 940144cad331dedf7a6f8b38cb28c16a1d11d03f - ---- - drivers/video/mxc/mxc_hdmi.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/video/mxc/mxc_hdmi.c b/drivers/video/mxc/mxc_hdmi.c -index df91138..5cc3c54 100644 ---- a/drivers/video/mxc/mxc_hdmi.c -+++ b/drivers/video/mxc/mxc_hdmi.c -@@ -2296,6 +2296,8 @@ static void mxc_hdmi_set_mode(struct mxc_hdmi *hdmi, int edid_status) - dev_dbg(&hdmi->pdev->dev, "%s: New video mode\n", __func__); - } - -+ hdmi_set_cable_state(1); -+ - console_lock(); - fb_blank(hdmi->fbi, FB_BLANK_UNBLANK); - console_unlock(); -@@ -2311,8 +2313,6 @@ static int mxc_hdmi_cable_connected(struct mxc_hdmi *hdmi) - - dev_dbg(&hdmi->pdev->dev, "%s\n", __func__); - -- hdmi_set_cable_state(1); -- - hdmi->hp_state = HDMI_HOTPLUG_CONNECTED_NO_EDID; - memcpy(edid_old, hdmi->edid, HDMI_EDID_LEN); - diff --git a/projects/imx6/patches/linux/4.4-xbian/linux-000-commits-d08b62d-ecef1c7.patch b/projects/imx6/patches/linux/4.4-xbian/linux-000-commits-d08b62d-ecef1c7.patch new file mode 100644 index 0000000000..c8769c0dc2 --- /dev/null +++ b/projects/imx6/patches/linux/4.4-xbian/linux-000-commits-d08b62d-ecef1c7.patch @@ -0,0 +1,44835 @@ +From ef79f02075013b262d2b10d468044a55d12354cf Mon Sep 17 00:00:00 2001 +From: Fugang Duan +Date: Fri, 10 Oct 2014 16:25:26 +0800 +Subject: [PATCH 001/384] ENGR00299323-10 net:fec: add enet AVB Ubuntu + Gstreamer demo support + +Support Gstreamer AVB demo support. + +ring1 -> ClassA, ring2 -> ClassB, ring0 -> Best Effort + +For QoS: ring1 > ring2 > ring0 +For bandwidth reverse: + 50% bandwidth -> ClassA + 33% bandwidth -> ClassB + 17% bandwidth -> Best effort queue + +In general, ClassA run audio, ClassB run video. +Since AVB demo use big bandwidth streaming, video cost more than +33Mbps bandwidth, and with Qos limitation: ClassA >= ClassB > Best effort, +so we have to change ring2 bandwidth equal to ring1 bandwidth (50%). +After validate on FPGA, AVB demo can work fine for audio and video. + +Signed-off-by: Fugang Duan +(cherry picked from commit 93d6579a7b3d2dafa721c835df5d5f7d30ed386e) +(cherry picked from commit 2f78438d70c847f0570ece98cd7933041e36f6bd) +Signed-off-by: Matus Kral +--- + drivers/net/ethernet/freescale/fec_main.c | 35 ++++++++++++++++++++++++++++++- + 1 file changed, 34 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c +index 969922a..d9f1ab3 100644 +--- a/drivers/net/ethernet/freescale/fec_main.c ++++ b/drivers/net/ethernet/freescale/fec_main.c +@@ -18,7 +18,7 @@ + * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be) + * Copyright (c) 2004-2006 Macq Electronique SA. + * +- * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. ++ * Copyright (C) 2010-2014 Freescale Semiconductor, Inc. + */ + + #include +@@ -70,6 +70,7 @@ static void fec_enet_itr_coal_init(struct net_device *ndev); + #define DRIVER_NAME "fec" + + #define FEC_ENET_GET_QUQUE(_x) ((_x == 0) ? 1 : ((_x == 1) ? 2 : 0)) ++static const u16 fec_enet_vlan_pri_to_queue[8] = {1, 1, 1, 1, 2, 2, 2, 2}; + + /* Pause frame feild and FIFO threshold */ + #define FEC_ENET_FCE (1 << 5) +@@ -3171,10 +3172,42 @@ static int fec_set_features(struct net_device *netdev, + return 0; + } + ++u16 fec_enet_get_raw_vlan_tci(struct sk_buff *skb) ++{ ++ struct vlan_ethhdr *vhdr; ++ unsigned short vlan_TCI = 0; ++ ++ if (skb->protocol == ntohs(ETH_P_ALL)) { ++ vhdr = (struct vlan_ethhdr *)(skb->data); ++ vlan_TCI = ntohs(vhdr->h_vlan_TCI); ++ } ++ ++ return vlan_TCI; ++} ++ ++u16 fec_enet_select_queue(struct net_device *ndev, struct sk_buff *skb, ++ void *accel_priv, select_queue_fallback_t fallback) ++{ ++ struct fec_enet_private *fep = netdev_priv(ndev); ++ const struct platform_device_id *id_entry = ++ platform_get_device_id(fep->pdev); ++ u16 vlan_tag; ++ ++ if (!(id_entry->driver_data & FEC_QUIRK_HAS_AVB)) ++ return skb_tx_hash(ndev, skb); ++ ++ vlan_tag = fec_enet_get_raw_vlan_tci(skb); ++ if (!vlan_tag) ++ return vlan_tag; ++ ++ return fec_enet_vlan_pri_to_queue[vlan_tag >> 13]; ++} ++ + static const struct net_device_ops fec_netdev_ops = { + .ndo_open = fec_enet_open, + .ndo_stop = fec_enet_close, + .ndo_start_xmit = fec_enet_start_xmit, ++ .ndo_select_queue = fec_enet_select_queue, + .ndo_set_rx_mode = set_multicast_list, + .ndo_change_mtu = eth_change_mtu, + .ndo_validate_addr = eth_validate_addr, +-- +2.7.1 + + +From 9414718f007bd48ebd6d1dfb5c8967975f7eef17 Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Sun, 3 Apr 2016 09:09:27 +0200 +Subject: [PATCH 002/384] apply Real-Time patch -rt13 + +--- + Documentation/kernel-parameters.txt | 9 + + Makefile | 3 + + arch/Kconfig | 1 + + arch/arm/kvm/arm.c | 12 +- + arch/arm/kvm/psci.c | 4 +- + arch/arm/mach-at91/Kconfig | 1 + + arch/arm/mach-at91/at91rm9200.c | 2 - + arch/arm/mach-at91/at91sam9.c | 2 - + arch/arm/mach-at91/generic.h | 13 +- + arch/arm/mach-at91/pm.c | 70 +++++- + arch/arm/mach-at91/sama5.c | 2 +- + arch/arm64/kernel/debug-monitors.c | 21 +- + arch/mips/kvm/mips.c | 8 +- + arch/powerpc/include/asm/kvm_host.h | 4 +- + arch/powerpc/kvm/book3s_hv.c | 22 +- + arch/s390/include/asm/kvm_host.h | 2 +- + arch/s390/kvm/interrupt.c | 4 +- + arch/x86/kernel/kvm.c | 37 +-- + arch/x86/kvm/lapic.c | 6 +- + block/blk-core.c | 4 +- + block/blk-mq.c | 4 +- + drivers/block/zram/zram_drv.c | 30 +-- + drivers/block/zram/zram_drv.h | 41 +++ + drivers/clk/at91/clk-generated.c | 95 ++++--- + drivers/clk/at91/clk-h32mx.c | 40 +-- + drivers/clk/at91/clk-main.c | 324 +++++++++++------------- + drivers/clk/at91/clk-master.c | 94 +++---- + drivers/clk/at91/clk-peripheral.c | 136 +++++----- + drivers/clk/at91/clk-pll.c | 150 +++++------ + drivers/clk/at91/clk-plldiv.c | 44 ++-- + drivers/clk/at91/clk-programmable.c | 96 +++---- + drivers/clk/at91/clk-slow.c | 34 +-- + drivers/clk/at91/clk-smd.c | 56 +++-- + drivers/clk/at91/clk-system.c | 96 +++---- + drivers/clk/at91/clk-usb.c | 123 ++++----- + drivers/clk/at91/clk-utmi.c | 80 ++---- + drivers/clk/at91/pmc.c | 426 +------------------------------- + drivers/clk/at91/pmc.h | 98 +------- + drivers/clocksource/tcb_clksrc.c | 33 ++- + drivers/clocksource/timer-atmel-pit.c | 8 +- + drivers/gpu/drm/i915/i915_irq.c | 2 + + drivers/gpu/drm/i915/intel_sprite.c | 11 +- + drivers/gpu/drm/radeon/radeon_display.c | 2 + + drivers/iommu/amd_iommu.c | 12 +- + drivers/tty/serial/sc16is7xx.c | 2 +- + drivers/usb/gadget/function/f_fs.c | 2 +- + drivers/usb/gadget/udc/atmel_usba_udc.c | 20 +- + drivers/usb/gadget/udc/atmel_usba_udc.h | 2 + + fs/btrfs/volumes.c | 1 - + fs/f2fs/f2fs.h | 4 +- + include/linux/blkdev.h | 2 +- + include/linux/clk/at91_pmc.h | 12 - + include/linux/completion.h | 8 +- + include/linux/ftrace.h | 12 + + include/linux/hrtimer.h | 2 +- + include/linux/kvm_host.h | 5 +- + include/linux/list_bl.h | 12 +- + include/linux/locallock.h | 6 +- + include/linux/sched.h | 2 - + include/linux/spinlock_rt.h | 25 +- + include/linux/suspend.h | 6 + + include/linux/swait.h | 173 +++++++++++++ + include/linux/wait-simple.h | 207 ---------------- + include/trace/events/hist.h | 1 + + include/trace/events/writeback.h | 121 ++++----- + kernel/cpu.c | 4 +- + kernel/events/core.c | 1 + + kernel/futex.c | 18 +- + kernel/irq/irqdesc.c | 21 +- + kernel/irq/manage.c | 2 +- + kernel/locking/lglock.c | 6 +- + kernel/locking/rt.c | 2 - + kernel/locking/rtmutex.c | 244 +++++++++++------- + kernel/power/hibernate.c | 7 + + kernel/power/suspend.c | 5 + + kernel/printk/printk.c | 116 ++++----- + kernel/rcu/rcutorture.c | 7 + + kernel/rcu/tree.c | 24 +- + kernel/rcu/tree.h | 15 +- + kernel/rcu/tree_plugin.h | 26 +- + kernel/sched/Makefile | 2 +- + kernel/sched/completion.c | 10 +- + kernel/sched/core.c | 21 +- + kernel/sched/swait.c | 143 +++++++++++ + kernel/sched/wait-simple.c | 115 --------- + kernel/sched/work-simple.c | 8 +- + kernel/softirq.c | 8 +- + kernel/stop_machine.c | 40 +-- + kernel/time/tick-broadcast-hrtimer.c | 1 + + kernel/trace/trace_irqsoff.c | 8 +- + lib/dump_stack.c | 4 +- + localversion-rt | 2 +- + mm/backing-dev.c | 4 +- + mm/zsmalloc.c | 4 +- + net/core/dev.c | 6 +- + virt/kvm/async_pf.c | 4 +- + virt/kvm/kvm_main.c | 17 +- + 97 files changed, 1679 insertions(+), 2103 deletions(-) + create mode 100644 include/linux/swait.h + delete mode 100644 include/linux/wait-simple.h + create mode 100644 kernel/sched/swait.c + delete mode 100644 kernel/sched/wait-simple.c + +diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt +index 742f69d..bcaf28e 100644 +--- a/Documentation/kernel-parameters.txt ++++ b/Documentation/kernel-parameters.txt +@@ -1629,6 +1629,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted. + ip= [IP_PNP] + See Documentation/filesystems/nfs/nfsroot.txt. + ++ irqaffinity= [SMP] Set the default irq affinity mask ++ Format: ++ ,..., ++ or ++ - ++ (must be a positive range in ascending order) ++ or a mixture ++ ,...,- ++ + irqfixup [HW] + When an interrupt is not handled search all handlers + for it. Intended to get systems with badly broken +diff --git a/Makefile b/Makefile +index 87d12b4..d95c4a4 100644 +--- a/Makefile ++++ b/Makefile +@@ -767,6 +767,9 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=strict-prototypes) + # Prohibit date/time macros, which would make the build non-deterministic + KBUILD_CFLAGS += $(call cc-option,-Werror=date-time) + ++# enforce correct pointer usage ++#KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types) ++ + # use the deterministic mode of AR if available + KBUILD_ARFLAGS := $(call ar-option,D) + +diff --git a/arch/Kconfig b/arch/Kconfig +index 81592b3..3b26d76 100644 +--- a/arch/Kconfig ++++ b/arch/Kconfig +@@ -53,6 +53,7 @@ config KPROBES + config JUMP_LABEL + bool "Optimize very unlikely/likely branches" + depends on HAVE_ARCH_JUMP_LABEL ++ depends on (!INTERRUPT_OFF_HIST && !PREEMPT_OFF_HIST && !WAKEUP_LATENCY_HIST && !MISSED_TIMER_OFFSETS_HIST) + help + This option enables a transparent branch optimization that + makes certain almost-always-true or almost-always-false branch +diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c +index 4f5c42a..bb43bc3 100644 +--- a/arch/arm/kvm/arm.c ++++ b/arch/arm/kvm/arm.c +@@ -498,16 +498,16 @@ static void kvm_arm_resume_guest(struct kvm *kvm) + struct kvm_vcpu *vcpu; + + kvm_for_each_vcpu(i, vcpu, kvm) { +- struct swait_head *wq = kvm_arch_vcpu_wq(vcpu); ++ struct swait_queue_head *wq = kvm_arch_vcpu_wq(vcpu); + + vcpu->arch.pause = false; +- swait_wake_interruptible(wq); ++ swake_up(wq); + } + } + + static void vcpu_sleep(struct kvm_vcpu *vcpu) + { +- struct swait_head *wq = kvm_arch_vcpu_wq(vcpu); ++ struct swait_queue_head *wq = kvm_arch_vcpu_wq(vcpu); + + swait_event_interruptible(*wq, ((!vcpu->arch.power_off) && + (!vcpu->arch.pause))); +@@ -568,7 +568,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) + * involves poking the GIC, which must be done in a + * non-preemptible context. + */ +- preempt_disable(); ++ migrate_disable(); + kvm_timer_flush_hwstate(vcpu); + kvm_vgic_flush_hwstate(vcpu); + +@@ -587,7 +587,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) + local_irq_enable(); + kvm_timer_sync_hwstate(vcpu); + kvm_vgic_sync_hwstate(vcpu); +- preempt_enable(); ++ migrate_enable(); + continue; + } + +@@ -641,7 +641,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) + + kvm_vgic_sync_hwstate(vcpu); + +- preempt_enable(); ++ migrate_enable(); + + ret = handle_exit(vcpu, run, ret); + } +diff --git a/arch/arm/kvm/psci.c b/arch/arm/kvm/psci.c +index 08148c4..c2b1315 100644 +--- a/arch/arm/kvm/psci.c ++++ b/arch/arm/kvm/psci.c +@@ -70,7 +70,7 @@ static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu) + { + struct kvm *kvm = source_vcpu->kvm; + struct kvm_vcpu *vcpu = NULL; +- struct swait_head *wq; ++ struct swait_queue_head *wq; + unsigned long cpu_id; + unsigned long context_id; + phys_addr_t target_pc; +@@ -119,7 +119,7 @@ static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu) + smp_mb(); /* Make sure the above is visible */ + + wq = kvm_arch_vcpu_wq(vcpu); +- swait_wake_interruptible(wq); ++ swake_up(wq); + + return PSCI_RET_SUCCESS; + } +diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig +index 28656c2..3f50130 100644 +--- a/arch/arm/mach-at91/Kconfig ++++ b/arch/arm/mach-at91/Kconfig +@@ -99,6 +99,7 @@ config HAVE_AT91_USB_CLK + config COMMON_CLK_AT91 + bool + select COMMON_CLK ++ select MFD_SYSCON + + config HAVE_AT91_SMD + bool +diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c +index c1a7c6c..63b4fa2 100644 +--- a/arch/arm/mach-at91/at91rm9200.c ++++ b/arch/arm/mach-at91/at91rm9200.c +@@ -12,7 +12,6 @@ + #include + + #include +-#include + + #include "generic.h" + #include "soc.h" +@@ -33,7 +32,6 @@ static void __init at91rm9200_dt_device_init(void) + + of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev); + +- arm_pm_idle = at91rm9200_idle; + at91rm9200_pm_init(); + } + +diff --git a/arch/arm/mach-at91/at91sam9.c b/arch/arm/mach-at91/at91sam9.c +index 7eb64f7..cada2a6 100644 +--- a/arch/arm/mach-at91/at91sam9.c ++++ b/arch/arm/mach-at91/at91sam9.c +@@ -62,8 +62,6 @@ static void __init at91sam9_common_init(void) + soc_dev = soc_device_to_device(soc); + + of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev); +- +- arm_pm_idle = at91sam9_idle; + } + + static void __init at91sam9_dt_device_init(void) +diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h +index b0fa7dc..28ca57a 100644 +--- a/arch/arm/mach-at91/generic.h ++++ b/arch/arm/mach-at91/generic.h +@@ -11,27 +11,18 @@ + #ifndef _AT91_GENERIC_H + #define _AT91_GENERIC_H + +-#include +-#include +- +- /* Map io */ +-extern void __init at91_map_io(void); +-extern void __init at91_alt_map_io(void); +- +-/* idle */ +-extern void at91rm9200_idle(void); +-extern void at91sam9_idle(void); +- + #ifdef CONFIG_PM + extern void __init at91rm9200_pm_init(void); + extern void __init at91sam9260_pm_init(void); + extern void __init at91sam9g45_pm_init(void); + extern void __init at91sam9x5_pm_init(void); ++extern void __init sama5_pm_init(void); + #else + static inline void __init at91rm9200_pm_init(void) { } + static inline void __init at91sam9260_pm_init(void) { } + static inline void __init at91sam9g45_pm_init(void) { } + static inline void __init at91sam9x5_pm_init(void) { } ++static inline void __init sama5_pm_init(void) { } + #endif + + #endif /* _AT91_GENERIC_H */ +diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c +index 23726fb3..f062701 100644 +--- a/arch/arm/mach-at91/pm.c ++++ b/arch/arm/mach-at91/pm.c +@@ -31,10 +31,13 @@ + #include + #include + #include ++#include + + #include "generic.h" + #include "pm.h" + ++static void __iomem *pmc; ++ + /* + * FIXME: this is needed to communicate between the pinctrl driver and + * the PM implementation in the machine. Possibly part of the PM +@@ -87,7 +90,7 @@ static int at91_pm_verify_clocks(void) + unsigned long scsr; + int i; + +- scsr = at91_pmc_read(AT91_PMC_SCSR); ++ scsr = readl(pmc + AT91_PMC_SCSR); + + /* USB must not be using PLLB */ + if ((scsr & at91_pm_data.uhp_udp_mask) != 0) { +@@ -101,8 +104,7 @@ static int at91_pm_verify_clocks(void) + + if ((scsr & (AT91_PMC_PCK0 << i)) == 0) + continue; +- +- css = at91_pmc_read(AT91_PMC_PCKR(i)) & AT91_PMC_CSS; ++ css = readl(pmc + AT91_PMC_PCKR(i)) & AT91_PMC_CSS; + if (css != AT91_PMC_CSS_SLOW) { + pr_err("AT91: PM - Suspend-to-RAM with PCK%d src %d\n", i, css); + return 0; +@@ -145,8 +147,8 @@ static void at91_pm_suspend(suspend_state_t state) + flush_cache_all(); + outer_disable(); + +- at91_suspend_sram_fn(at91_pmc_base, at91_ramc_base[0], +- at91_ramc_base[1], pm_data); ++ at91_suspend_sram_fn(pmc, at91_ramc_base[0], ++ at91_ramc_base[1], pm_data); + + outer_resume(); + } +@@ -353,6 +355,21 @@ static __init void at91_dt_ramc(void) + at91_pm_set_standby(standby); + } + ++void at91rm9200_idle(void) ++{ ++ /* ++ * Disable the processor clock. The processor will be automatically ++ * re-enabled by an interrupt or by a reset. ++ */ ++ writel(AT91_PMC_PCK, pmc + AT91_PMC_SCDR); ++} ++ ++void at91sam9_idle(void) ++{ ++ writel(AT91_PMC_PCK, pmc + AT91_PMC_SCDR); ++ cpu_do_idle(); ++} ++ + static void __init at91_pm_sram_init(void) + { + struct gen_pool *sram_pool; +@@ -399,13 +416,36 @@ static void __init at91_pm_sram_init(void) + &at91_pm_suspend_in_sram, at91_pm_suspend_in_sram_sz); + } + +-static void __init at91_pm_init(void) ++static const struct of_device_id atmel_pmc_ids[] __initconst = { ++ { .compatible = "atmel,at91rm9200-pmc" }, ++ { .compatible = "atmel,at91sam9260-pmc" }, ++ { .compatible = "atmel,at91sam9g45-pmc" }, ++ { .compatible = "atmel,at91sam9n12-pmc" }, ++ { .compatible = "atmel,at91sam9x5-pmc" }, ++ { .compatible = "atmel,sama5d3-pmc" }, ++ { .compatible = "atmel,sama5d2-pmc" }, ++ { /* sentinel */ }, ++}; ++ ++static void __init at91_pm_init(void (*pm_idle)(void)) + { +- at91_pm_sram_init(); ++ struct device_node *pmc_np; + + if (at91_cpuidle_device.dev.platform_data) + platform_device_register(&at91_cpuidle_device); + ++ pmc_np = of_find_matching_node(NULL, atmel_pmc_ids); ++ pmc = of_iomap(pmc_np, 0); ++ if (!pmc) { ++ pr_err("AT91: PM not supported, PMC not found\n"); ++ return; ++ } ++ ++ if (pm_idle) ++ arm_pm_idle = pm_idle; ++ ++ at91_pm_sram_init(); ++ + if (at91_suspend_sram_fn) + suspend_set_ops(&at91_pm_ops); + else +@@ -424,7 +464,7 @@ void __init at91rm9200_pm_init(void) + at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP; + at91_pm_data.memctrl = AT91_MEMCTRL_MC; + +- at91_pm_init(); ++ at91_pm_init(at91rm9200_idle); + } + + void __init at91sam9260_pm_init(void) +@@ -432,7 +472,7 @@ void __init at91sam9260_pm_init(void) + at91_dt_ramc(); + at91_pm_data.memctrl = AT91_MEMCTRL_SDRAMC; + at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP; +- return at91_pm_init(); ++ at91_pm_init(at91sam9_idle); + } + + void __init at91sam9g45_pm_init(void) +@@ -440,7 +480,7 @@ void __init at91sam9g45_pm_init(void) + at91_dt_ramc(); + at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP; + at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR; +- return at91_pm_init(); ++ at91_pm_init(at91sam9_idle); + } + + void __init at91sam9x5_pm_init(void) +@@ -448,5 +488,13 @@ void __init at91sam9x5_pm_init(void) + at91_dt_ramc(); + at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP; + at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR; +- return at91_pm_init(); ++ at91_pm_init(at91sam9_idle); ++} ++ ++void __init sama5_pm_init(void) ++{ ++ at91_dt_ramc(); ++ at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP; ++ at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR; ++ at91_pm_init(NULL); + } +diff --git a/arch/arm/mach-at91/sama5.c b/arch/arm/mach-at91/sama5.c +index d9cf679..df8fdf1 100644 +--- a/arch/arm/mach-at91/sama5.c ++++ b/arch/arm/mach-at91/sama5.c +@@ -51,7 +51,7 @@ static void __init sama5_dt_device_init(void) + soc_dev = soc_device_to_device(soc); + + of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev); +- at91sam9x5_pm_init(); ++ sama5_pm_init(); + } + + static const char *const sama5_dt_board_compat[] __initconst = { +diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c +index 8aee3ae..c1492ba 100644 +--- a/arch/arm64/kernel/debug-monitors.c ++++ b/arch/arm64/kernel/debug-monitors.c +@@ -186,20 +186,21 @@ static void clear_regs_spsr_ss(struct pt_regs *regs) + + /* EL1 Single Step Handler hooks */ + static LIST_HEAD(step_hook); +-static DEFINE_RWLOCK(step_hook_lock); ++static DEFINE_SPINLOCK(step_hook_lock); + + void register_step_hook(struct step_hook *hook) + { +- write_lock(&step_hook_lock); +- list_add(&hook->node, &step_hook); +- write_unlock(&step_hook_lock); ++ spin_lock(&step_hook_lock); ++ list_add_rcu(&hook->node, &step_hook); ++ spin_unlock(&step_hook_lock); + } + + void unregister_step_hook(struct step_hook *hook) + { +- write_lock(&step_hook_lock); +- list_del(&hook->node); +- write_unlock(&step_hook_lock); ++ spin_lock(&step_hook_lock); ++ list_del_rcu(&hook->node); ++ spin_unlock(&step_hook_lock); ++ synchronize_rcu(); + } + + /* +@@ -213,15 +214,15 @@ static int call_step_hook(struct pt_regs *regs, unsigned int esr) + struct step_hook *hook; + int retval = DBG_HOOK_ERROR; + +- read_lock(&step_hook_lock); ++ rcu_read_lock(); + +- list_for_each_entry(hook, &step_hook, node) { ++ list_for_each_entry_rcu(hook, &step_hook, node) { + retval = hook->fn(regs, esr); + if (retval == DBG_HOOK_HANDLED) + break; + } + +- read_unlock(&step_hook_lock); ++ rcu_read_unlock(); + + return retval; + } +diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c +index 2683d04..8a11329 100644 +--- a/arch/mips/kvm/mips.c ++++ b/arch/mips/kvm/mips.c +@@ -445,8 +445,8 @@ int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, + + dvcpu->arch.wait = 0; + +- if (waitqueue_active(&dvcpu->wq)) +- wake_up_interruptible(&dvcpu->wq); ++ if (swait_active(&dvcpu->wq)) ++ swake_up(&dvcpu->wq); + + return 0; + } +@@ -1174,8 +1174,8 @@ static void kvm_mips_comparecount_func(unsigned long data) + kvm_mips_callbacks->queue_timer_int(vcpu); + + vcpu->arch.wait = 0; +- if (waitqueue_active(&vcpu->wq)) +- wake_up_interruptible(&vcpu->wq); ++ if (swait_active(&vcpu->wq)) ++ swake_up(&vcpu->wq); + } + + /* low level hrtimer wake routine */ +diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h +index b439518..f8673ff 100644 +--- a/arch/powerpc/include/asm/kvm_host.h ++++ b/arch/powerpc/include/asm/kvm_host.h +@@ -286,7 +286,7 @@ struct kvmppc_vcore { + struct list_head runnable_threads; + struct list_head preempt_list; + spinlock_t lock; +- struct swait_head wq; ++ struct swait_queue_head wq; + spinlock_t stoltb_lock; /* protects stolen_tb and preempt_tb */ + u64 stolen_tb; + u64 preempt_tb; +@@ -626,7 +626,7 @@ struct kvm_vcpu_arch { + u8 prodded; + u32 last_inst; + +- struct swait_head *wqp; ++ struct swait_queue_head *wqp; + struct kvmppc_vcore *vcore; + int ret; + int trap; +diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c +index 32be32b..df34a64 100644 +--- a/arch/powerpc/kvm/book3s_hv.c ++++ b/arch/powerpc/kvm/book3s_hv.c +@@ -114,11 +114,11 @@ static bool kvmppc_ipi_thread(int cpu) + static void kvmppc_fast_vcpu_kick_hv(struct kvm_vcpu *vcpu) + { + int cpu; +- struct swait_head *wqp; ++ struct swait_queue_head *wqp; + + wqp = kvm_arch_vcpu_wq(vcpu); +- if (swaitqueue_active(wqp)) { +- swait_wake_interruptible(wqp); ++ if (swait_active(wqp)) { ++ swake_up(wqp); + ++vcpu->stat.halt_wakeup; + } + +@@ -707,8 +707,8 @@ int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu) + tvcpu->arch.prodded = 1; + smp_mb(); + if (vcpu->arch.ceded) { +- if (swaitqueue_active(&vcpu->wq)) { +- swait_wake_interruptible(&vcpu->wq); ++ if (swait_active(&vcpu->wq)) { ++ swake_up(&vcpu->wq); + vcpu->stat.halt_wakeup++; + } + } +@@ -1447,7 +1447,7 @@ static struct kvmppc_vcore *kvmppc_vcore_create(struct kvm *kvm, int core) + INIT_LIST_HEAD(&vcore->runnable_threads); + spin_lock_init(&vcore->lock); + spin_lock_init(&vcore->stoltb_lock); +- init_swait_head(&vcore->wq); ++ init_swait_queue_head(&vcore->wq); + vcore->preempt_tb = TB_NIL; + vcore->lpcr = kvm->arch.lpcr; + vcore->first_vcpuid = core * threads_per_subcore; +@@ -2519,9 +2519,9 @@ static void kvmppc_vcore_blocked(struct kvmppc_vcore *vc) + { + struct kvm_vcpu *vcpu; + int do_sleep = 1; +- DEFINE_SWAITER(wait); ++ DECLARE_SWAITQUEUE(wait); + +- swait_prepare(&vc->wq, &wait, TASK_INTERRUPTIBLE); ++ prepare_to_swait(&vc->wq, &wait, TASK_INTERRUPTIBLE); + + /* + * Check one last time for pending exceptions and ceded state after +@@ -2535,7 +2535,7 @@ static void kvmppc_vcore_blocked(struct kvmppc_vcore *vc) + } + + if (!do_sleep) { +- swait_finish(&vc->wq, &wait); ++ finish_swait(&vc->wq, &wait); + return; + } + +@@ -2543,7 +2543,7 @@ static void kvmppc_vcore_blocked(struct kvmppc_vcore *vc) + trace_kvmppc_vcore_blocked(vc, 0); + spin_unlock(&vc->lock); + schedule(); +- swait_finish(&vc->wq, &wait); ++ finish_swait(&vc->wq, &wait); + spin_lock(&vc->lock); + vc->vcore_state = VCORE_INACTIVE; + trace_kvmppc_vcore_blocked(vc, 1); +@@ -2599,7 +2599,7 @@ static int kvmppc_run_vcpu(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) + kvmppc_start_thread(vcpu, vc); + trace_kvm_guest_enter(vcpu); + } else if (vc->vcore_state == VCORE_SLEEPING) { +- swait_wake(&vc->wq); ++ swake_up(&vc->wq); + } + + } +diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h +index 2a84c76..bbdc539 100644 +--- a/arch/s390/include/asm/kvm_host.h ++++ b/arch/s390/include/asm/kvm_host.h +@@ -427,7 +427,7 @@ struct kvm_s390_irq_payload { + struct kvm_s390_local_interrupt { + spinlock_t lock; + struct kvm_s390_float_interrupt *float_int; +- struct swait_head *wq; ++ struct swait_queue_head *wq; + atomic_t *cpuflags; + DECLARE_BITMAP(sigp_emerg_pending, KVM_MAX_VCPUS); + struct kvm_s390_irq_payload irq; +diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c +index 8b4516b..cc862c4 100644 +--- a/arch/s390/kvm/interrupt.c ++++ b/arch/s390/kvm/interrupt.c +@@ -868,13 +868,13 @@ no_timer: + + void kvm_s390_vcpu_wakeup(struct kvm_vcpu *vcpu) + { +- if (swaitqueue_active(&vcpu->wq)) { ++ if (swait_active(&vcpu->wq)) { + /* + * The vcpu gave up the cpu voluntarily, mark it as a good + * yield-candidate. + */ + vcpu->preempted = true; +- swait_wake_interruptible(&vcpu->wq); ++ swake_up(&vcpu->wq); + vcpu->stat.halt_wakeup++; + } + } +diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c +index 47190bd..8079508 100644 +--- a/arch/x86/kernel/kvm.c ++++ b/arch/x86/kernel/kvm.c +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -91,14 +92,14 @@ static void kvm_io_delay(void) + + struct kvm_task_sleep_node { + struct hlist_node link; +- wait_queue_head_t wq; ++ struct swait_queue_head wq; + u32 token; + int cpu; + bool halted; + }; + + static struct kvm_task_sleep_head { +- spinlock_t lock; ++ raw_spinlock_t lock; + struct hlist_head list; + } async_pf_sleepers[KVM_TASK_SLEEP_HASHSIZE]; + +@@ -122,17 +123,17 @@ void kvm_async_pf_task_wait(u32 token) + u32 key = hash_32(token, KVM_TASK_SLEEP_HASHBITS); + struct kvm_task_sleep_head *b = &async_pf_sleepers[key]; + struct kvm_task_sleep_node n, *e; +- DEFINE_WAIT(wait); ++ DECLARE_SWAITQUEUE(wait); + + rcu_irq_enter(); + +- spin_lock(&b->lock); ++ raw_spin_lock(&b->lock); + e = _find_apf_task(b, token); + if (e) { + /* dummy entry exist -> wake up was delivered ahead of PF */ + hlist_del(&e->link); + kfree(e); +- spin_unlock(&b->lock); ++ raw_spin_unlock(&b->lock); + + rcu_irq_exit(); + return; +@@ -141,13 +142,13 @@ void kvm_async_pf_task_wait(u32 token) + n.token = token; + n.cpu = smp_processor_id(); + n.halted = is_idle_task(current) || preempt_count() > 1; +- init_waitqueue_head(&n.wq); ++ init_swait_queue_head(&n.wq); + hlist_add_head(&n.link, &b->list); +- spin_unlock(&b->lock); ++ raw_spin_unlock(&b->lock); + + for (;;) { + if (!n.halted) +- prepare_to_wait(&n.wq, &wait, TASK_UNINTERRUPTIBLE); ++ prepare_to_swait(&n.wq, &wait, TASK_UNINTERRUPTIBLE); + if (hlist_unhashed(&n.link)) + break; + +@@ -166,7 +167,7 @@ void kvm_async_pf_task_wait(u32 token) + } + } + if (!n.halted) +- finish_wait(&n.wq, &wait); ++ finish_swait(&n.wq, &wait); + + rcu_irq_exit(); + return; +@@ -178,8 +179,8 @@ static void apf_task_wake_one(struct kvm_task_sleep_node *n) + hlist_del_init(&n->link); + if (n->halted) + smp_send_reschedule(n->cpu); +- else if (waitqueue_active(&n->wq)) +- wake_up(&n->wq); ++ else if (swait_active(&n->wq)) ++ swake_up(&n->wq); + } + + static void apf_task_wake_all(void) +@@ -189,14 +190,14 @@ static void apf_task_wake_all(void) + for (i = 0; i < KVM_TASK_SLEEP_HASHSIZE; i++) { + struct hlist_node *p, *next; + struct kvm_task_sleep_head *b = &async_pf_sleepers[i]; +- spin_lock(&b->lock); ++ raw_spin_lock(&b->lock); + hlist_for_each_safe(p, next, &b->list) { + struct kvm_task_sleep_node *n = + hlist_entry(p, typeof(*n), link); + if (n->cpu == smp_processor_id()) + apf_task_wake_one(n); + } +- spin_unlock(&b->lock); ++ raw_spin_unlock(&b->lock); + } + } + +@@ -212,7 +213,7 @@ void kvm_async_pf_task_wake(u32 token) + } + + again: +- spin_lock(&b->lock); ++ raw_spin_lock(&b->lock); + n = _find_apf_task(b, token); + if (!n) { + /* +@@ -225,17 +226,17 @@ again: + * Allocation failed! Busy wait while other cpu + * handles async PF. + */ +- spin_unlock(&b->lock); ++ raw_spin_unlock(&b->lock); + cpu_relax(); + goto again; + } + n->token = token; + n->cpu = smp_processor_id(); +- init_waitqueue_head(&n->wq); ++ init_swait_queue_head(&n->wq); + hlist_add_head(&n->link, &b->list); + } else + apf_task_wake_one(n); +- spin_unlock(&b->lock); ++ raw_spin_unlock(&b->lock); + return; + } + EXPORT_SYMBOL_GPL(kvm_async_pf_task_wake); +@@ -486,7 +487,7 @@ void __init kvm_guest_init(void) + paravirt_ops_setup(); + register_reboot_notifier(&kvm_pv_reboot_nb); + for (i = 0; i < KVM_TASK_SLEEP_HASHSIZE; i++) +- spin_lock_init(&async_pf_sleepers[i].lock); ++ raw_spin_lock_init(&async_pf_sleepers[i].lock); + if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF)) + x86_init.irqs.trap_init = kvm_apf_trap_init; + +diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c +index 906a1ec..20d9e9f 100644 +--- a/arch/x86/kvm/lapic.c ++++ b/arch/x86/kvm/lapic.c +@@ -1195,7 +1195,7 @@ static void apic_update_lvtt(struct kvm_lapic *apic) + static void apic_timer_expired(struct kvm_lapic *apic) + { + struct kvm_vcpu *vcpu = apic->vcpu; +- struct swait_head *q = &vcpu->wq; ++ struct swait_queue_head *q = &vcpu->wq; + struct kvm_timer *ktimer = &apic->lapic_timer; + + if (atomic_read(&apic->lapic_timer.pending)) +@@ -1204,8 +1204,8 @@ static void apic_timer_expired(struct kvm_lapic *apic) + atomic_inc(&apic->lapic_timer.pending); + kvm_set_pending_timer(vcpu); + +- if (swaitqueue_active(q)) +- swait_wake_interruptible(q); ++ if (swait_active(q)) ++ swake_up(q); + + if (apic_lvtt_tscdeadline(apic)) + ktimer->expired_tscdeadline = ktimer->tscdeadline; +diff --git a/block/blk-core.c b/block/blk-core.c +index 4c8cefd..2f7afb9 100644 +--- a/block/blk-core.c ++++ b/block/blk-core.c +@@ -680,7 +680,7 @@ static void blk_queue_usage_counter_release(struct percpu_ref *ref) + struct request_queue *q = + container_of(ref, struct request_queue, q_usage_counter); + +- swait_wake_all(&q->mq_freeze_wq); ++ swake_up_all(&q->mq_freeze_wq); + } + + struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) +@@ -742,7 +742,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) + q->bypass_depth = 1; + __set_bit(QUEUE_FLAG_BYPASS, &q->queue_flags); + +- init_swait_head(&q->mq_freeze_wq); ++ init_swait_queue_head(&q->mq_freeze_wq); + + /* + * Init percpu_ref in atomic mode so that it's faster to shutdown. +diff --git a/block/blk-mq.c b/block/blk-mq.c +index 3c70813..7cdf19e 100644 +--- a/block/blk-mq.c ++++ b/block/blk-mq.c +@@ -130,7 +130,7 @@ void blk_mq_unfreeze_queue(struct request_queue *q) + WARN_ON_ONCE(freeze_depth < 0); + if (!freeze_depth) { + percpu_ref_reinit(&q->q_usage_counter); +- swait_wake_all(&q->mq_freeze_wq); ++ swake_up_all(&q->mq_freeze_wq); + } + } + EXPORT_SYMBOL_GPL(blk_mq_unfreeze_queue); +@@ -149,7 +149,7 @@ void blk_mq_wake_waiters(struct request_queue *q) + * dying, we need to ensure that processes currently waiting on + * the queue are notified as well. + */ +- swait_wake_all(&q->mq_freeze_wq); ++ swake_up_all(&q->mq_freeze_wq); + } + + bool blk_mq_can_queue(struct blk_mq_hw_ctx *hctx) +diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c +index 370c2f7..65e0b37 100644 +--- a/drivers/block/zram/zram_drv.c ++++ b/drivers/block/zram/zram_drv.c +@@ -520,6 +520,8 @@ static struct zram_meta *zram_meta_alloc(char *pool_name, u64 disksize) + goto out_error; + } + ++ zram_meta_init_table_locks(meta, disksize); ++ + return meta; + + out_error: +@@ -568,12 +570,12 @@ static int zram_decompress_page(struct zram *zram, char *mem, u32 index) + unsigned long handle; + size_t size; + +- bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value); ++ zram_lock_table(&meta->table[index]); + handle = meta->table[index].handle; + size = zram_get_obj_size(meta, index); + + if (!handle || zram_test_flag(meta, index, ZRAM_ZERO)) { +- bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value); ++ zram_unlock_table(&meta->table[index]); + clear_page(mem); + return 0; + } +@@ -584,7 +586,7 @@ static int zram_decompress_page(struct zram *zram, char *mem, u32 index) + else + ret = zcomp_decompress(zram->comp, cmem, size, mem); + zs_unmap_object(meta->mem_pool, handle); +- bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value); ++ zram_unlock_table(&meta->table[index]); + + /* Should NEVER happen. Return bio error if it does. */ + if (unlikely(ret)) { +@@ -604,14 +606,14 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec, + struct zram_meta *meta = zram->meta; + page = bvec->bv_page; + +- bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value); ++ zram_lock_table(&meta->table[index]); + if (unlikely(!meta->table[index].handle) || + zram_test_flag(meta, index, ZRAM_ZERO)) { +- bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value); ++ zram_unlock_table(&meta->table[index]); + handle_zero_page(bvec); + return 0; + } +- bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value); ++ zram_unlock_table(&meta->table[index]); + + if (is_partial_io(bvec)) + /* Use a temporary buffer to decompress the page */ +@@ -689,10 +691,10 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index, + if (user_mem) + kunmap_atomic(user_mem); + /* Free memory associated with this sector now. */ +- bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value); ++ zram_lock_table(&meta->table[index]); + zram_free_page(zram, index); + zram_set_flag(meta, index, ZRAM_ZERO); +- bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value); ++ zram_unlock_table(&meta->table[index]); + + atomic64_inc(&zram->stats.zero_pages); + ret = 0; +@@ -752,12 +754,12 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index, + * Free memory associated with this sector + * before overwriting unused sectors. + */ +- bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value); ++ zram_lock_table(&meta->table[index]); + zram_free_page(zram, index); + + meta->table[index].handle = handle; + zram_set_obj_size(meta, index, clen); +- bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value); ++ zram_unlock_table(&meta->table[index]); + + /* Update stats */ + atomic64_add(clen, &zram->stats.compr_data_size); +@@ -800,9 +802,9 @@ static void zram_bio_discard(struct zram *zram, u32 index, + } + + while (n >= PAGE_SIZE) { +- bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value); ++ zram_lock_table(&meta->table[index]); + zram_free_page(zram, index); +- bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value); ++ zram_unlock_table(&meta->table[index]); + atomic64_inc(&zram->stats.notify_free); + index++; + n -= PAGE_SIZE; +@@ -928,9 +930,9 @@ static void zram_slot_free_notify(struct block_device *bdev, + zram = bdev->bd_disk->private_data; + meta = zram->meta; + +- bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value); ++ zram_lock_table(&meta->table[index]); + zram_free_page(zram, index); +- bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value); ++ zram_unlock_table(&meta->table[index]); + atomic64_inc(&zram->stats.notify_free); + } + +diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h +index 8e92339..1e4a3c6 100644 +--- a/drivers/block/zram/zram_drv.h ++++ b/drivers/block/zram/zram_drv.h +@@ -72,6 +72,9 @@ enum zram_pageflags { + struct zram_table_entry { + unsigned long handle; + unsigned long value; ++#ifdef CONFIG_PREEMPT_RT_BASE ++ spinlock_t lock; ++#endif + }; + + struct zram_stats { +@@ -119,4 +122,42 @@ struct zram { + */ + bool claim; /* Protected by bdev->bd_mutex */ + }; ++ ++#ifndef CONFIG_PREEMPT_RT_BASE ++static inline void zram_lock_table(struct zram_table_entry *table) ++{ ++ bit_spin_lock(ZRAM_ACCESS, &table->value); ++} ++ ++static inline void zram_unlock_table(struct zram_table_entry *table) ++{ ++ bit_spin_unlock(ZRAM_ACCESS, &table->value); ++} ++ ++static inline void zram_meta_init_locks(struct zram_meta *meta, u64 disksize) { } ++#else /* CONFIG_PREEMPT_RT_BASE */ ++static inline void zram_lock_table(struct zram_table_entry *table) ++{ ++ spin_lock(&table->lock); ++ __set_bit(ZRAM_ACCESS, &table->value); ++} ++ ++static inline void zram_unlock_table(struct zram_table_entry *table) ++{ ++ __clear_bit(ZRAM_ACCESS, &table->value); ++ spin_unlock(&table->lock); ++} ++ ++static inline void zram_meta_init_table_locks(struct zram_meta *meta, u64 disksize) ++{ ++ size_t num_pages = disksize >> PAGE_SHIFT; ++ size_t index; ++ ++ for (index = 0; index < num_pages; index++) { ++ spinlock_t *lock = &meta->table[index].lock; ++ spin_lock_init(lock); ++ } ++} ++#endif /* CONFIG_PREEMPT_RT_BASE */ ++ + #endif +diff --git a/drivers/clk/at91/clk-generated.c b/drivers/clk/at91/clk-generated.c +index abc8094..4ad3298 100644 +--- a/drivers/clk/at91/clk-generated.c ++++ b/drivers/clk/at91/clk-generated.c +@@ -15,8 +15,8 @@ + #include + #include + #include +-#include +-#include ++#include ++#include + + #include "pmc.h" + +@@ -28,8 +28,9 @@ + + struct clk_generated { + struct clk_hw hw; +- struct at91_pmc *pmc; ++ struct regmap *regmap; + struct clk_range range; ++ spinlock_t *lock; + u32 id; + u32 gckdiv; + u8 parent_id; +@@ -41,49 +42,52 @@ struct clk_generated { + static int clk_generated_enable(struct clk_hw *hw) + { + struct clk_generated *gck = to_clk_generated(hw); +- struct at91_pmc *pmc = gck->pmc; +- u32 tmp; ++ unsigned long flags; + + pr_debug("GCLK: %s, gckdiv = %d, parent id = %d\n", + __func__, gck->gckdiv, gck->parent_id); + +- pmc_lock(pmc); +- pmc_write(pmc, AT91_PMC_PCR, (gck->id & AT91_PMC_PCR_PID_MASK)); +- tmp = pmc_read(pmc, AT91_PMC_PCR) & +- ~(AT91_PMC_PCR_GCKDIV_MASK | AT91_PMC_PCR_GCKCSS_MASK); +- pmc_write(pmc, AT91_PMC_PCR, tmp | AT91_PMC_PCR_GCKCSS(gck->parent_id) +- | AT91_PMC_PCR_CMD +- | AT91_PMC_PCR_GCKDIV(gck->gckdiv) +- | AT91_PMC_PCR_GCKEN); +- pmc_unlock(pmc); ++ spin_lock_irqsave(gck->lock, flags); ++ regmap_write(gck->regmap, AT91_PMC_PCR, ++ (gck->id & AT91_PMC_PCR_PID_MASK)); ++ regmap_update_bits(gck->regmap, AT91_PMC_PCR, ++ AT91_PMC_PCR_GCKDIV_MASK | AT91_PMC_PCR_GCKCSS_MASK | ++ AT91_PMC_PCR_CMD | AT91_PMC_PCR_GCKEN, ++ AT91_PMC_PCR_GCKCSS(gck->parent_id) | ++ AT91_PMC_PCR_CMD | ++ AT91_PMC_PCR_GCKDIV(gck->gckdiv) | ++ AT91_PMC_PCR_GCKEN); ++ spin_unlock_irqrestore(gck->lock, flags); + return 0; + } + + static void clk_generated_disable(struct clk_hw *hw) + { + struct clk_generated *gck = to_clk_generated(hw); +- struct at91_pmc *pmc = gck->pmc; +- u32 tmp; +- +- pmc_lock(pmc); +- pmc_write(pmc, AT91_PMC_PCR, (gck->id & AT91_PMC_PCR_PID_MASK)); +- tmp = pmc_read(pmc, AT91_PMC_PCR) & ~AT91_PMC_PCR_GCKEN; +- pmc_write(pmc, AT91_PMC_PCR, tmp | AT91_PMC_PCR_CMD); +- pmc_unlock(pmc); ++ unsigned long flags; ++ ++ spin_lock_irqsave(gck->lock, flags); ++ regmap_write(gck->regmap, AT91_PMC_PCR, ++ (gck->id & AT91_PMC_PCR_PID_MASK)); ++ regmap_update_bits(gck->regmap, AT91_PMC_PCR, ++ AT91_PMC_PCR_CMD | AT91_PMC_PCR_GCKEN, ++ AT91_PMC_PCR_CMD); ++ spin_unlock_irqrestore(gck->lock, flags); + } + + static int clk_generated_is_enabled(struct clk_hw *hw) + { + struct clk_generated *gck = to_clk_generated(hw); +- struct at91_pmc *pmc = gck->pmc; +- int ret; ++ unsigned long flags; ++ unsigned int status; + +- pmc_lock(pmc); +- pmc_write(pmc, AT91_PMC_PCR, (gck->id & AT91_PMC_PCR_PID_MASK)); +- ret = !!(pmc_read(pmc, AT91_PMC_PCR) & AT91_PMC_PCR_GCKEN); +- pmc_unlock(pmc); ++ spin_lock_irqsave(gck->lock, flags); ++ regmap_write(gck->regmap, AT91_PMC_PCR, ++ (gck->id & AT91_PMC_PCR_PID_MASK)); ++ regmap_read(gck->regmap, AT91_PMC_PCR, &status); ++ spin_unlock_irqrestore(gck->lock, flags); + +- return ret; ++ return status & AT91_PMC_PCR_GCKEN ? 1 : 0; + } + + static unsigned long +@@ -214,13 +218,14 @@ static const struct clk_ops generated_ops = { + */ + static void clk_generated_startup(struct clk_generated *gck) + { +- struct at91_pmc *pmc = gck->pmc; + u32 tmp; ++ unsigned long flags; + +- pmc_lock(pmc); +- pmc_write(pmc, AT91_PMC_PCR, (gck->id & AT91_PMC_PCR_PID_MASK)); +- tmp = pmc_read(pmc, AT91_PMC_PCR); +- pmc_unlock(pmc); ++ spin_lock_irqsave(gck->lock, flags); ++ regmap_write(gck->regmap, AT91_PMC_PCR, ++ (gck->id & AT91_PMC_PCR_PID_MASK)); ++ regmap_read(gck->regmap, AT91_PMC_PCR, &tmp); ++ spin_unlock_irqrestore(gck->lock, flags); + + gck->parent_id = (tmp & AT91_PMC_PCR_GCKCSS_MASK) + >> AT91_PMC_PCR_GCKCSS_OFFSET; +@@ -229,8 +234,8 @@ static void clk_generated_startup(struct clk_generated *gck) + } + + static struct clk * __init +-at91_clk_register_generated(struct at91_pmc *pmc, const char *name, +- const char **parent_names, u8 num_parents, ++at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, const char ++ *name, const char **parent_names, u8 num_parents, + u8 id, const struct clk_range *range) + { + struct clk_generated *gck; +@@ -249,7 +254,8 @@ at91_clk_register_generated(struct at91_pmc *pmc, const char *name, + + gck->id = id; + gck->hw.init = &init; +- gck->pmc = pmc; ++ gck->regmap = regmap; ++ gck->lock = lock; + gck->range = *range; + + clk = clk_register(NULL, &gck->hw); +@@ -261,8 +267,7 @@ at91_clk_register_generated(struct at91_pmc *pmc, const char *name, + return clk; + } + +-void __init of_sama5d2_clk_generated_setup(struct device_node *np, +- struct at91_pmc *pmc) ++void __init of_sama5d2_clk_generated_setup(struct device_node *np) + { + int num; + u32 id; +@@ -272,6 +277,7 @@ void __init of_sama5d2_clk_generated_setup(struct device_node *np, + const char *parent_names[GENERATED_SOURCE_MAX]; + struct device_node *gcknp; + struct clk_range range = CLK_RANGE(0, 0); ++ struct regmap *regmap; + + num_parents = of_clk_get_parent_count(np); + if (num_parents <= 0 || num_parents > GENERATED_SOURCE_MAX) +@@ -283,6 +289,10 @@ void __init of_sama5d2_clk_generated_setup(struct device_node *np, + if (!num || num > PERIPHERAL_MAX) + return; + ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) ++ return; ++ + for_each_child_of_node(np, gcknp) { + if (of_property_read_u32(gcknp, "reg", &id)) + continue; +@@ -296,11 +306,14 @@ void __init of_sama5d2_clk_generated_setup(struct device_node *np, + of_at91_get_clk_range(gcknp, "atmel,clk-output-range", + &range); + +- clk = at91_clk_register_generated(pmc, name, parent_names, +- num_parents, id, &range); ++ clk = at91_clk_register_generated(regmap, &pmc_pcr_lock, name, ++ parent_names, num_parents, ++ id, &range); + if (IS_ERR(clk)) + continue; + + of_clk_add_provider(gcknp, of_clk_src_simple_get, clk); + } + } ++CLK_OF_DECLARE(of_sama5d2_clk_generated_setup, "atmel,sama5d2-clk-generated", ++ of_sama5d2_clk_generated_setup); +diff --git a/drivers/clk/at91/clk-h32mx.c b/drivers/clk/at91/clk-h32mx.c +index 61566bc..819f584 100644 +--- a/drivers/clk/at91/clk-h32mx.c ++++ b/drivers/clk/at91/clk-h32mx.c +@@ -15,15 +15,9 @@ + #include + #include + #include +-#include + #include +-#include +-#include +-#include +-#include +-#include +-#include +-#include ++#include ++#include + + #include "pmc.h" + +@@ -31,7 +25,7 @@ + + struct clk_sama5d4_h32mx { + struct clk_hw hw; +- struct at91_pmc *pmc; ++ struct regmap *regmap; + }; + + #define to_clk_sama5d4_h32mx(hw) container_of(hw, struct clk_sama5d4_h32mx, hw) +@@ -40,8 +34,10 @@ static unsigned long clk_sama5d4_h32mx_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) + { + struct clk_sama5d4_h32mx *h32mxclk = to_clk_sama5d4_h32mx(hw); ++ unsigned int mckr; + +- if (pmc_read(h32mxclk->pmc, AT91_PMC_MCKR) & AT91_PMC_H32MXDIV) ++ regmap_read(h32mxclk->regmap, AT91_PMC_MCKR, &mckr); ++ if (mckr & AT91_PMC_H32MXDIV) + return parent_rate / 2; + + if (parent_rate > H32MX_MAX_FREQ) +@@ -70,18 +66,16 @@ static int clk_sama5d4_h32mx_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) + { + struct clk_sama5d4_h32mx *h32mxclk = to_clk_sama5d4_h32mx(hw); +- struct at91_pmc *pmc = h32mxclk->pmc; +- u32 tmp; ++ u32 mckr = 0; + + if (parent_rate != rate && (parent_rate / 2) != rate) + return -EINVAL; + +- pmc_lock(pmc); +- tmp = pmc_read(pmc, AT91_PMC_MCKR) & ~AT91_PMC_H32MXDIV; + if ((parent_rate / 2) == rate) +- tmp |= AT91_PMC_H32MXDIV; +- pmc_write(pmc, AT91_PMC_MCKR, tmp); +- pmc_unlock(pmc); ++ mckr = AT91_PMC_H32MXDIV; ++ ++ regmap_update_bits(h32mxclk->regmap, AT91_PMC_MCKR, ++ AT91_PMC_H32MXDIV, mckr); + + return 0; + } +@@ -92,14 +86,18 @@ static const struct clk_ops h32mx_ops = { + .set_rate = clk_sama5d4_h32mx_set_rate, + }; + +-void __init of_sama5d4_clk_h32mx_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_sama5d4_clk_h32mx_setup(struct device_node *np) + { + struct clk_sama5d4_h32mx *h32mxclk; + struct clk_init_data init; + const char *parent_name; ++ struct regmap *regmap; + struct clk *clk; + ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) ++ return; ++ + h32mxclk = kzalloc(sizeof(*h32mxclk), GFP_KERNEL); + if (!h32mxclk) + return; +@@ -113,7 +111,7 @@ void __init of_sama5d4_clk_h32mx_setup(struct device_node *np, + init.flags = CLK_SET_RATE_GATE; + + h32mxclk->hw.init = &init; +- h32mxclk->pmc = pmc; ++ h32mxclk->regmap = regmap; + + clk = clk_register(NULL, &h32mxclk->hw); + if (!clk) { +@@ -123,3 +121,5 @@ void __init of_sama5d4_clk_h32mx_setup(struct device_node *np, + + of_clk_add_provider(np, of_clk_src_simple_get, clk); + } ++CLK_OF_DECLARE(of_sama5d4_clk_h32mx_setup, "atmel,sama5d4-clk-h32mx", ++ of_sama5d4_clk_h32mx_setup); +diff --git a/drivers/clk/at91/clk-main.c b/drivers/clk/at91/clk-main.c +index fd7247d..4bfc94d 100644 +--- a/drivers/clk/at91/clk-main.c ++++ b/drivers/clk/at91/clk-main.c +@@ -13,13 +13,8 @@ + #include + #include + #include +-#include +-#include +-#include +-#include +-#include +-#include +-#include ++#include ++#include + + #include "pmc.h" + +@@ -34,18 +29,14 @@ + + struct clk_main_osc { + struct clk_hw hw; +- struct at91_pmc *pmc; +- unsigned int irq; +- wait_queue_head_t wait; ++ struct regmap *regmap; + }; + + #define to_clk_main_osc(hw) container_of(hw, struct clk_main_osc, hw) + + struct clk_main_rc_osc { + struct clk_hw hw; +- struct at91_pmc *pmc; +- unsigned int irq; +- wait_queue_head_t wait; ++ struct regmap *regmap; + unsigned long frequency; + unsigned long accuracy; + }; +@@ -54,51 +45,47 @@ struct clk_main_rc_osc { + + struct clk_rm9200_main { + struct clk_hw hw; +- struct at91_pmc *pmc; ++ struct regmap *regmap; + }; + + #define to_clk_rm9200_main(hw) container_of(hw, struct clk_rm9200_main, hw) + + struct clk_sam9x5_main { + struct clk_hw hw; +- struct at91_pmc *pmc; +- unsigned int irq; +- wait_queue_head_t wait; ++ struct regmap *regmap; + u8 parent; + }; + + #define to_clk_sam9x5_main(hw) container_of(hw, struct clk_sam9x5_main, hw) + +-static irqreturn_t clk_main_osc_irq_handler(int irq, void *dev_id) ++static inline bool clk_main_osc_ready(struct regmap *regmap) + { +- struct clk_main_osc *osc = dev_id; ++ unsigned int status; + +- wake_up(&osc->wait); +- disable_irq_nosync(osc->irq); ++ regmap_read(regmap, AT91_PMC_SR, &status); + +- return IRQ_HANDLED; ++ return status & AT91_PMC_MOSCS; + } + + static int clk_main_osc_prepare(struct clk_hw *hw) + { + struct clk_main_osc *osc = to_clk_main_osc(hw); +- struct at91_pmc *pmc = osc->pmc; ++ struct regmap *regmap = osc->regmap; + u32 tmp; + +- tmp = pmc_read(pmc, AT91_CKGR_MOR) & ~MOR_KEY_MASK; ++ regmap_read(regmap, AT91_CKGR_MOR, &tmp); ++ tmp &= ~MOR_KEY_MASK; ++ + if (tmp & AT91_PMC_OSCBYPASS) + return 0; + + if (!(tmp & AT91_PMC_MOSCEN)) { + tmp |= AT91_PMC_MOSCEN | AT91_PMC_KEY; +- pmc_write(pmc, AT91_CKGR_MOR, tmp); ++ regmap_write(regmap, AT91_CKGR_MOR, tmp); + } + +- while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCS)) { +- enable_irq(osc->irq); +- wait_event(osc->wait, +- pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCS); +- } ++ while (!clk_main_osc_ready(regmap)) ++ cpu_relax(); + + return 0; + } +@@ -106,9 +93,10 @@ static int clk_main_osc_prepare(struct clk_hw *hw) + static void clk_main_osc_unprepare(struct clk_hw *hw) + { + struct clk_main_osc *osc = to_clk_main_osc(hw); +- struct at91_pmc *pmc = osc->pmc; +- u32 tmp = pmc_read(pmc, AT91_CKGR_MOR); ++ struct regmap *regmap = osc->regmap; ++ u32 tmp; + ++ regmap_read(regmap, AT91_CKGR_MOR, &tmp); + if (tmp & AT91_PMC_OSCBYPASS) + return; + +@@ -116,20 +104,22 @@ static void clk_main_osc_unprepare(struct clk_hw *hw) + return; + + tmp &= ~(AT91_PMC_KEY | AT91_PMC_MOSCEN); +- pmc_write(pmc, AT91_CKGR_MOR, tmp | AT91_PMC_KEY); ++ regmap_write(regmap, AT91_CKGR_MOR, tmp | AT91_PMC_KEY); + } + + static int clk_main_osc_is_prepared(struct clk_hw *hw) + { + struct clk_main_osc *osc = to_clk_main_osc(hw); +- struct at91_pmc *pmc = osc->pmc; +- u32 tmp = pmc_read(pmc, AT91_CKGR_MOR); ++ struct regmap *regmap = osc->regmap; ++ u32 tmp, status; + ++ regmap_read(regmap, AT91_CKGR_MOR, &tmp); + if (tmp & AT91_PMC_OSCBYPASS) + return 1; + +- return !!((pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCS) && +- (pmc_read(pmc, AT91_CKGR_MOR) & AT91_PMC_MOSCEN)); ++ regmap_read(regmap, AT91_PMC_SR, &status); ++ ++ return (status & AT91_PMC_MOSCS) && (tmp & AT91_PMC_MOSCEN); + } + + static const struct clk_ops main_osc_ops = { +@@ -139,18 +129,16 @@ static const struct clk_ops main_osc_ops = { + }; + + static struct clk * __init +-at91_clk_register_main_osc(struct at91_pmc *pmc, +- unsigned int irq, ++at91_clk_register_main_osc(struct regmap *regmap, + const char *name, + const char *parent_name, + bool bypass) + { +- int ret; + struct clk_main_osc *osc; + struct clk *clk = NULL; + struct clk_init_data init; + +- if (!pmc || !irq || !name || !parent_name) ++ if (!name || !parent_name) + return ERR_PTR(-EINVAL); + + osc = kzalloc(sizeof(*osc), GFP_KERNEL); +@@ -164,85 +152,70 @@ at91_clk_register_main_osc(struct at91_pmc *pmc, + init.flags = CLK_IGNORE_UNUSED; + + osc->hw.init = &init; +- osc->pmc = pmc; +- osc->irq = irq; +- +- init_waitqueue_head(&osc->wait); +- irq_set_status_flags(osc->irq, IRQ_NOAUTOEN); +- ret = request_irq(osc->irq, clk_main_osc_irq_handler, +- IRQF_TRIGGER_HIGH, name, osc); +- if (ret) { +- kfree(osc); +- return ERR_PTR(ret); +- } ++ osc->regmap = regmap; + + if (bypass) +- pmc_write(pmc, AT91_CKGR_MOR, +- (pmc_read(pmc, AT91_CKGR_MOR) & +- ~(MOR_KEY_MASK | AT91_PMC_MOSCEN)) | +- AT91_PMC_OSCBYPASS | AT91_PMC_KEY); ++ regmap_update_bits(regmap, ++ AT91_CKGR_MOR, MOR_KEY_MASK | ++ AT91_PMC_MOSCEN, ++ AT91_PMC_OSCBYPASS | AT91_PMC_KEY); + + clk = clk_register(NULL, &osc->hw); +- if (IS_ERR(clk)) { +- free_irq(irq, osc); ++ if (IS_ERR(clk)) + kfree(osc); +- } + + return clk; + } + +-void __init of_at91rm9200_clk_main_osc_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91rm9200_clk_main_osc_setup(struct device_node *np) + { + struct clk *clk; +- unsigned int irq; + const char *name = np->name; + const char *parent_name; ++ struct regmap *regmap; + bool bypass; + + of_property_read_string(np, "clock-output-names", &name); + bypass = of_property_read_bool(np, "atmel,osc-bypass"); + parent_name = of_clk_get_parent_name(np, 0); + +- irq = irq_of_parse_and_map(np, 0); +- if (!irq) ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) + return; + +- clk = at91_clk_register_main_osc(pmc, irq, name, parent_name, bypass); ++ clk = at91_clk_register_main_osc(regmap, name, parent_name, bypass); + if (IS_ERR(clk)) + return; + + of_clk_add_provider(np, of_clk_src_simple_get, clk); + } ++CLK_OF_DECLARE(at91rm9200_clk_main_osc, "atmel,at91rm9200-clk-main-osc", ++ of_at91rm9200_clk_main_osc_setup); + +-static irqreturn_t clk_main_rc_osc_irq_handler(int irq, void *dev_id) ++static bool clk_main_rc_osc_ready(struct regmap *regmap) + { +- struct clk_main_rc_osc *osc = dev_id; ++ unsigned int status; + +- wake_up(&osc->wait); +- disable_irq_nosync(osc->irq); ++ regmap_read(regmap, AT91_PMC_SR, &status); + +- return IRQ_HANDLED; ++ return status & AT91_PMC_MOSCRCS; + } + + static int clk_main_rc_osc_prepare(struct clk_hw *hw) + { + struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw); +- struct at91_pmc *pmc = osc->pmc; +- u32 tmp; ++ struct regmap *regmap = osc->regmap; ++ unsigned int mor; + +- tmp = pmc_read(pmc, AT91_CKGR_MOR) & ~MOR_KEY_MASK; ++ regmap_read(regmap, AT91_CKGR_MOR, &mor); + +- if (!(tmp & AT91_PMC_MOSCRCEN)) { +- tmp |= AT91_PMC_MOSCRCEN | AT91_PMC_KEY; +- pmc_write(pmc, AT91_CKGR_MOR, tmp); +- } ++ if (!(mor & AT91_PMC_MOSCRCEN)) ++ regmap_update_bits(regmap, AT91_CKGR_MOR, ++ MOR_KEY_MASK | AT91_PMC_MOSCRCEN, ++ AT91_PMC_MOSCRCEN | AT91_PMC_KEY); + +- while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCRCS)) { +- enable_irq(osc->irq); +- wait_event(osc->wait, +- pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCRCS); +- } ++ while (!clk_main_rc_osc_ready(regmap)) ++ cpu_relax(); + + return 0; + } +@@ -250,23 +223,28 @@ static int clk_main_rc_osc_prepare(struct clk_hw *hw) + static void clk_main_rc_osc_unprepare(struct clk_hw *hw) + { + struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw); +- struct at91_pmc *pmc = osc->pmc; +- u32 tmp = pmc_read(pmc, AT91_CKGR_MOR); ++ struct regmap *regmap = osc->regmap; ++ unsigned int mor; ++ ++ regmap_read(regmap, AT91_CKGR_MOR, &mor); + +- if (!(tmp & AT91_PMC_MOSCRCEN)) ++ if (!(mor & AT91_PMC_MOSCRCEN)) + return; + +- tmp &= ~(MOR_KEY_MASK | AT91_PMC_MOSCRCEN); +- pmc_write(pmc, AT91_CKGR_MOR, tmp | AT91_PMC_KEY); ++ regmap_update_bits(regmap, AT91_CKGR_MOR, ++ MOR_KEY_MASK | AT91_PMC_MOSCRCEN, AT91_PMC_KEY); + } + + static int clk_main_rc_osc_is_prepared(struct clk_hw *hw) + { + struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw); +- struct at91_pmc *pmc = osc->pmc; ++ struct regmap *regmap = osc->regmap; ++ unsigned int mor, status; + +- return !!((pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCRCS) && +- (pmc_read(pmc, AT91_CKGR_MOR) & AT91_PMC_MOSCRCEN)); ++ regmap_read(regmap, AT91_CKGR_MOR, &mor); ++ regmap_read(regmap, AT91_PMC_SR, &status); ++ ++ return (mor & AT91_PMC_MOSCRCEN) && (status & AT91_PMC_MOSCRCS); + } + + static unsigned long clk_main_rc_osc_recalc_rate(struct clk_hw *hw, +@@ -294,17 +272,15 @@ static const struct clk_ops main_rc_osc_ops = { + }; + + static struct clk * __init +-at91_clk_register_main_rc_osc(struct at91_pmc *pmc, +- unsigned int irq, ++at91_clk_register_main_rc_osc(struct regmap *regmap, + const char *name, + u32 frequency, u32 accuracy) + { +- int ret; + struct clk_main_rc_osc *osc; + struct clk *clk = NULL; + struct clk_init_data init; + +- if (!pmc || !irq || !name || !frequency) ++ if (!name || !frequency) + return ERR_PTR(-EINVAL); + + osc = kzalloc(sizeof(*osc), GFP_KERNEL); +@@ -318,63 +294,53 @@ at91_clk_register_main_rc_osc(struct at91_pmc *pmc, + init.flags = CLK_IS_ROOT | CLK_IGNORE_UNUSED; + + osc->hw.init = &init; +- osc->pmc = pmc; +- osc->irq = irq; ++ osc->regmap = regmap; + osc->frequency = frequency; + osc->accuracy = accuracy; + +- init_waitqueue_head(&osc->wait); +- irq_set_status_flags(osc->irq, IRQ_NOAUTOEN); +- ret = request_irq(osc->irq, clk_main_rc_osc_irq_handler, +- IRQF_TRIGGER_HIGH, name, osc); +- if (ret) +- return ERR_PTR(ret); +- + clk = clk_register(NULL, &osc->hw); +- if (IS_ERR(clk)) { +- free_irq(irq, osc); ++ if (IS_ERR(clk)) + kfree(osc); +- } + + return clk; + } + +-void __init of_at91sam9x5_clk_main_rc_osc_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91sam9x5_clk_main_rc_osc_setup(struct device_node *np) + { + struct clk *clk; +- unsigned int irq; + u32 frequency = 0; + u32 accuracy = 0; + const char *name = np->name; ++ struct regmap *regmap; + + of_property_read_string(np, "clock-output-names", &name); + of_property_read_u32(np, "clock-frequency", &frequency); + of_property_read_u32(np, "clock-accuracy", &accuracy); + +- irq = irq_of_parse_and_map(np, 0); +- if (!irq) ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) + return; + +- clk = at91_clk_register_main_rc_osc(pmc, irq, name, frequency, +- accuracy); ++ clk = at91_clk_register_main_rc_osc(regmap, name, frequency, accuracy); + if (IS_ERR(clk)) + return; + + of_clk_add_provider(np, of_clk_src_simple_get, clk); + } ++CLK_OF_DECLARE(at91sam9x5_clk_main_rc_osc, "atmel,at91sam9x5-clk-main-rc-osc", ++ of_at91sam9x5_clk_main_rc_osc_setup); + + +-static int clk_main_probe_frequency(struct at91_pmc *pmc) ++static int clk_main_probe_frequency(struct regmap *regmap) + { + unsigned long prep_time, timeout; +- u32 tmp; ++ unsigned int mcfr; + + timeout = jiffies + usecs_to_jiffies(MAINFRDY_TIMEOUT); + do { + prep_time = jiffies; +- tmp = pmc_read(pmc, AT91_CKGR_MCFR); +- if (tmp & AT91_PMC_MAINRDY) ++ regmap_read(regmap, AT91_CKGR_MCFR, &mcfr); ++ if (mcfr & AT91_PMC_MAINRDY) + return 0; + usleep_range(MAINF_LOOP_MIN_WAIT, MAINF_LOOP_MAX_WAIT); + } while (time_before(prep_time, timeout)); +@@ -382,34 +348,37 @@ static int clk_main_probe_frequency(struct at91_pmc *pmc) + return -ETIMEDOUT; + } + +-static unsigned long clk_main_recalc_rate(struct at91_pmc *pmc, ++static unsigned long clk_main_recalc_rate(struct regmap *regmap, + unsigned long parent_rate) + { +- u32 tmp; ++ unsigned int mcfr; + + if (parent_rate) + return parent_rate; + + pr_warn("Main crystal frequency not set, using approximate value\n"); +- tmp = pmc_read(pmc, AT91_CKGR_MCFR); +- if (!(tmp & AT91_PMC_MAINRDY)) ++ regmap_read(regmap, AT91_CKGR_MCFR, &mcfr); ++ if (!(mcfr & AT91_PMC_MAINRDY)) + return 0; + +- return ((tmp & AT91_PMC_MAINF) * SLOW_CLOCK_FREQ) / MAINF_DIV; ++ return ((mcfr & AT91_PMC_MAINF) * SLOW_CLOCK_FREQ) / MAINF_DIV; + } + + static int clk_rm9200_main_prepare(struct clk_hw *hw) + { + struct clk_rm9200_main *clkmain = to_clk_rm9200_main(hw); + +- return clk_main_probe_frequency(clkmain->pmc); ++ return clk_main_probe_frequency(clkmain->regmap); + } + + static int clk_rm9200_main_is_prepared(struct clk_hw *hw) + { + struct clk_rm9200_main *clkmain = to_clk_rm9200_main(hw); ++ unsigned int status; ++ ++ regmap_read(clkmain->regmap, AT91_CKGR_MCFR, &status); + +- return !!(pmc_read(clkmain->pmc, AT91_CKGR_MCFR) & AT91_PMC_MAINRDY); ++ return status & AT91_PMC_MAINRDY ? 1 : 0; + } + + static unsigned long clk_rm9200_main_recalc_rate(struct clk_hw *hw, +@@ -417,7 +386,7 @@ static unsigned long clk_rm9200_main_recalc_rate(struct clk_hw *hw, + { + struct clk_rm9200_main *clkmain = to_clk_rm9200_main(hw); + +- return clk_main_recalc_rate(clkmain->pmc, parent_rate); ++ return clk_main_recalc_rate(clkmain->regmap, parent_rate); + } + + static const struct clk_ops rm9200_main_ops = { +@@ -427,7 +396,7 @@ static const struct clk_ops rm9200_main_ops = { + }; + + static struct clk * __init +-at91_clk_register_rm9200_main(struct at91_pmc *pmc, ++at91_clk_register_rm9200_main(struct regmap *regmap, + const char *name, + const char *parent_name) + { +@@ -435,7 +404,7 @@ at91_clk_register_rm9200_main(struct at91_pmc *pmc, + struct clk *clk = NULL; + struct clk_init_data init; + +- if (!pmc || !name) ++ if (!name) + return ERR_PTR(-EINVAL); + + if (!parent_name) +@@ -452,7 +421,7 @@ at91_clk_register_rm9200_main(struct at91_pmc *pmc, + init.flags = 0; + + clkmain->hw.init = &init; +- clkmain->pmc = pmc; ++ clkmain->regmap = regmap; + + clk = clk_register(NULL, &clkmain->hw); + if (IS_ERR(clk)) +@@ -461,52 +430,54 @@ at91_clk_register_rm9200_main(struct at91_pmc *pmc, + return clk; + } + +-void __init of_at91rm9200_clk_main_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91rm9200_clk_main_setup(struct device_node *np) + { + struct clk *clk; + const char *parent_name; + const char *name = np->name; ++ struct regmap *regmap; + + parent_name = of_clk_get_parent_name(np, 0); + of_property_read_string(np, "clock-output-names", &name); + +- clk = at91_clk_register_rm9200_main(pmc, name, parent_name); ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) ++ return; ++ ++ clk = at91_clk_register_rm9200_main(regmap, name, parent_name); + if (IS_ERR(clk)) + return; + + of_clk_add_provider(np, of_clk_src_simple_get, clk); + } ++CLK_OF_DECLARE(at91rm9200_clk_main, "atmel,at91rm9200-clk-main", ++ of_at91rm9200_clk_main_setup); + +-static irqreturn_t clk_sam9x5_main_irq_handler(int irq, void *dev_id) ++static inline bool clk_sam9x5_main_ready(struct regmap *regmap) + { +- struct clk_sam9x5_main *clkmain = dev_id; ++ unsigned int status; + +- wake_up(&clkmain->wait); +- disable_irq_nosync(clkmain->irq); ++ regmap_read(regmap, AT91_PMC_SR, &status); + +- return IRQ_HANDLED; ++ return status & AT91_PMC_MOSCSELS ? 1 : 0; + } + + static int clk_sam9x5_main_prepare(struct clk_hw *hw) + { + struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw); +- struct at91_pmc *pmc = clkmain->pmc; ++ struct regmap *regmap = clkmain->regmap; + +- while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS)) { +- enable_irq(clkmain->irq); +- wait_event(clkmain->wait, +- pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS); +- } ++ while (!clk_sam9x5_main_ready(regmap)) ++ cpu_relax(); + +- return clk_main_probe_frequency(pmc); ++ return clk_main_probe_frequency(regmap); + } + + static int clk_sam9x5_main_is_prepared(struct clk_hw *hw) + { + struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw); + +- return !!(pmc_read(clkmain->pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS); ++ return clk_sam9x5_main_ready(clkmain->regmap); + } + + static unsigned long clk_sam9x5_main_recalc_rate(struct clk_hw *hw, +@@ -514,30 +485,28 @@ static unsigned long clk_sam9x5_main_recalc_rate(struct clk_hw *hw, + { + struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw); + +- return clk_main_recalc_rate(clkmain->pmc, parent_rate); ++ return clk_main_recalc_rate(clkmain->regmap, parent_rate); + } + + static int clk_sam9x5_main_set_parent(struct clk_hw *hw, u8 index) + { + struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw); +- struct at91_pmc *pmc = clkmain->pmc; +- u32 tmp; ++ struct regmap *regmap = clkmain->regmap; ++ unsigned int tmp; + + if (index > 1) + return -EINVAL; + +- tmp = pmc_read(pmc, AT91_CKGR_MOR) & ~MOR_KEY_MASK; ++ regmap_read(regmap, AT91_CKGR_MOR, &tmp); ++ tmp &= ~MOR_KEY_MASK; + + if (index && !(tmp & AT91_PMC_MOSCSEL)) +- pmc_write(pmc, AT91_CKGR_MOR, tmp | AT91_PMC_MOSCSEL); ++ regmap_write(regmap, AT91_CKGR_MOR, tmp | AT91_PMC_MOSCSEL); + else if (!index && (tmp & AT91_PMC_MOSCSEL)) +- pmc_write(pmc, AT91_CKGR_MOR, tmp & ~AT91_PMC_MOSCSEL); ++ regmap_write(regmap, AT91_CKGR_MOR, tmp & ~AT91_PMC_MOSCSEL); + +- while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS)) { +- enable_irq(clkmain->irq); +- wait_event(clkmain->wait, +- pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS); +- } ++ while (!clk_sam9x5_main_ready(regmap)) ++ cpu_relax(); + + return 0; + } +@@ -545,8 +514,11 @@ static int clk_sam9x5_main_set_parent(struct clk_hw *hw, u8 index) + static u8 clk_sam9x5_main_get_parent(struct clk_hw *hw) + { + struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw); ++ unsigned int status; ++ ++ regmap_read(clkmain->regmap, AT91_CKGR_MOR, &status); + +- return !!(pmc_read(clkmain->pmc, AT91_CKGR_MOR) & AT91_PMC_MOSCEN); ++ return status & AT91_PMC_MOSCEN ? 1 : 0; + } + + static const struct clk_ops sam9x5_main_ops = { +@@ -558,18 +530,17 @@ static const struct clk_ops sam9x5_main_ops = { + }; + + static struct clk * __init +-at91_clk_register_sam9x5_main(struct at91_pmc *pmc, +- unsigned int irq, ++at91_clk_register_sam9x5_main(struct regmap *regmap, + const char *name, + const char **parent_names, + int num_parents) + { +- int ret; + struct clk_sam9x5_main *clkmain; + struct clk *clk = NULL; + struct clk_init_data init; ++ unsigned int status; + +- if (!pmc || !irq || !name) ++ if (!name) + return ERR_PTR(-EINVAL); + + if (!parent_names || !num_parents) +@@ -586,51 +557,42 @@ at91_clk_register_sam9x5_main(struct at91_pmc *pmc, + init.flags = CLK_SET_PARENT_GATE; + + clkmain->hw.init = &init; +- clkmain->pmc = pmc; +- clkmain->irq = irq; +- clkmain->parent = !!(pmc_read(clkmain->pmc, AT91_CKGR_MOR) & +- AT91_PMC_MOSCEN); +- init_waitqueue_head(&clkmain->wait); +- irq_set_status_flags(clkmain->irq, IRQ_NOAUTOEN); +- ret = request_irq(clkmain->irq, clk_sam9x5_main_irq_handler, +- IRQF_TRIGGER_HIGH, name, clkmain); +- if (ret) +- return ERR_PTR(ret); ++ clkmain->regmap = regmap; ++ regmap_read(clkmain->regmap, AT91_CKGR_MOR, &status); ++ clkmain->parent = status & AT91_PMC_MOSCEN ? 1 : 0; + + clk = clk_register(NULL, &clkmain->hw); +- if (IS_ERR(clk)) { +- free_irq(clkmain->irq, clkmain); ++ if (IS_ERR(clk)) + kfree(clkmain); +- } + + return clk; + } + +-void __init of_at91sam9x5_clk_main_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91sam9x5_clk_main_setup(struct device_node *np) + { + struct clk *clk; + const char *parent_names[2]; + int num_parents; +- unsigned int irq; + const char *name = np->name; ++ struct regmap *regmap; + + num_parents = of_clk_get_parent_count(np); + if (num_parents <= 0 || num_parents > 2) + return; + + of_clk_parent_fill(np, parent_names, num_parents); ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) ++ return; + + of_property_read_string(np, "clock-output-names", &name); + +- irq = irq_of_parse_and_map(np, 0); +- if (!irq) +- return; +- +- clk = at91_clk_register_sam9x5_main(pmc, irq, name, parent_names, ++ clk = at91_clk_register_sam9x5_main(regmap, name, parent_names, + num_parents); + if (IS_ERR(clk)) + return; + + of_clk_add_provider(np, of_clk_src_simple_get, clk); + } ++CLK_OF_DECLARE(at91sam9x5_clk_main, "atmel,at91sam9x5-clk-main", ++ of_at91sam9x5_clk_main_setup); +diff --git a/drivers/clk/at91/clk-master.c b/drivers/clk/at91/clk-master.c +index 620ea32..7d4a186 100644 +--- a/drivers/clk/at91/clk-master.c ++++ b/drivers/clk/at91/clk-master.c +@@ -12,13 +12,8 @@ + #include + #include + #include +-#include +-#include +-#include +-#include +-#include +-#include +-#include ++#include ++#include + + #include "pmc.h" + +@@ -44,32 +39,26 @@ struct clk_master_layout { + + struct clk_master { + struct clk_hw hw; +- struct at91_pmc *pmc; +- unsigned int irq; +- wait_queue_head_t wait; ++ struct regmap *regmap; + const struct clk_master_layout *layout; + const struct clk_master_characteristics *characteristics; + }; + +-static irqreturn_t clk_master_irq_handler(int irq, void *dev_id) ++static inline bool clk_master_ready(struct regmap *regmap) + { +- struct clk_master *master = (struct clk_master *)dev_id; ++ unsigned int status; + +- wake_up(&master->wait); +- disable_irq_nosync(master->irq); ++ regmap_read(regmap, AT91_PMC_SR, &status); + +- return IRQ_HANDLED; ++ return status & AT91_PMC_MCKRDY ? 1 : 0; + } ++ + static int clk_master_prepare(struct clk_hw *hw) + { + struct clk_master *master = to_clk_master(hw); +- struct at91_pmc *pmc = master->pmc; + +- while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MCKRDY)) { +- enable_irq(master->irq); +- wait_event(master->wait, +- pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MCKRDY); +- } ++ while (!clk_master_ready(master->regmap)) ++ cpu_relax(); + + return 0; + } +@@ -78,7 +67,7 @@ static int clk_master_is_prepared(struct clk_hw *hw) + { + struct clk_master *master = to_clk_master(hw); + +- return !!(pmc_read(master->pmc, AT91_PMC_SR) & AT91_PMC_MCKRDY); ++ return clk_master_ready(master->regmap); + } + + static unsigned long clk_master_recalc_rate(struct clk_hw *hw, +@@ -88,18 +77,16 @@ static unsigned long clk_master_recalc_rate(struct clk_hw *hw, + u8 div; + unsigned long rate = parent_rate; + struct clk_master *master = to_clk_master(hw); +- struct at91_pmc *pmc = master->pmc; + const struct clk_master_layout *layout = master->layout; + const struct clk_master_characteristics *characteristics = + master->characteristics; +- u32 tmp; ++ unsigned int mckr; + +- pmc_lock(pmc); +- tmp = pmc_read(pmc, AT91_PMC_MCKR) & layout->mask; +- pmc_unlock(pmc); ++ regmap_read(master->regmap, AT91_PMC_MCKR, &mckr); ++ mckr &= layout->mask; + +- pres = (tmp >> layout->pres_shift) & MASTER_PRES_MASK; +- div = (tmp >> MASTER_DIV_SHIFT) & MASTER_DIV_MASK; ++ pres = (mckr >> layout->pres_shift) & MASTER_PRES_MASK; ++ div = (mckr >> MASTER_DIV_SHIFT) & MASTER_DIV_MASK; + + if (characteristics->have_div3_pres && pres == MASTER_PRES_MAX) + rate /= 3; +@@ -119,9 +106,11 @@ static unsigned long clk_master_recalc_rate(struct clk_hw *hw, + static u8 clk_master_get_parent(struct clk_hw *hw) + { + struct clk_master *master = to_clk_master(hw); +- struct at91_pmc *pmc = master->pmc; ++ unsigned int mckr; + +- return pmc_read(pmc, AT91_PMC_MCKR) & AT91_PMC_CSS; ++ regmap_read(master->regmap, AT91_PMC_MCKR, &mckr); ++ ++ return mckr & AT91_PMC_CSS; + } + + static const struct clk_ops master_ops = { +@@ -132,18 +121,17 @@ static const struct clk_ops master_ops = { + }; + + static struct clk * __init +-at91_clk_register_master(struct at91_pmc *pmc, unsigned int irq, ++at91_clk_register_master(struct regmap *regmap, + const char *name, int num_parents, + const char **parent_names, + const struct clk_master_layout *layout, + const struct clk_master_characteristics *characteristics) + { +- int ret; + struct clk_master *master; + struct clk *clk = NULL; + struct clk_init_data init; + +- if (!pmc || !irq || !name || !num_parents || !parent_names) ++ if (!name || !num_parents || !parent_names) + return ERR_PTR(-EINVAL); + + master = kzalloc(sizeof(*master), GFP_KERNEL); +@@ -159,20 +147,10 @@ at91_clk_register_master(struct at91_pmc *pmc, unsigned int irq, + master->hw.init = &init; + master->layout = layout; + master->characteristics = characteristics; +- master->pmc = pmc; +- master->irq = irq; +- init_waitqueue_head(&master->wait); +- irq_set_status_flags(master->irq, IRQ_NOAUTOEN); +- ret = request_irq(master->irq, clk_master_irq_handler, +- IRQF_TRIGGER_HIGH, "clk-master", master); +- if (ret) { +- kfree(master); +- return ERR_PTR(ret); +- } ++ master->regmap = regmap; + + clk = clk_register(NULL, &master->hw); + if (IS_ERR(clk)) { +- free_irq(master->irq, master); + kfree(master); + } + +@@ -217,15 +195,15 @@ out_free_characteristics: + } + + static void __init +-of_at91_clk_master_setup(struct device_node *np, struct at91_pmc *pmc, ++of_at91_clk_master_setup(struct device_node *np, + const struct clk_master_layout *layout) + { + struct clk *clk; + int num_parents; +- unsigned int irq; + const char *parent_names[MASTER_SOURCE_MAX]; + const char *name = np->name; + struct clk_master_characteristics *characteristics; ++ struct regmap *regmap; + + num_parents = of_clk_get_parent_count(np); + if (num_parents <= 0 || num_parents > MASTER_SOURCE_MAX) +@@ -239,11 +217,11 @@ of_at91_clk_master_setup(struct device_node *np, struct at91_pmc *pmc, + if (!characteristics) + return; + +- irq = irq_of_parse_and_map(np, 0); +- if (!irq) +- goto out_free_characteristics; ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) ++ return; + +- clk = at91_clk_register_master(pmc, irq, name, num_parents, ++ clk = at91_clk_register_master(regmap, name, num_parents, + parent_names, layout, + characteristics); + if (IS_ERR(clk)) +@@ -256,14 +234,16 @@ out_free_characteristics: + kfree(characteristics); + } + +-void __init of_at91rm9200_clk_master_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91rm9200_clk_master_setup(struct device_node *np) + { +- of_at91_clk_master_setup(np, pmc, &at91rm9200_master_layout); ++ of_at91_clk_master_setup(np, &at91rm9200_master_layout); + } ++CLK_OF_DECLARE(at91rm9200_clk_master, "atmel,at91rm9200-clk-master", ++ of_at91rm9200_clk_master_setup); + +-void __init of_at91sam9x5_clk_master_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91sam9x5_clk_master_setup(struct device_node *np) + { +- of_at91_clk_master_setup(np, pmc, &at91sam9x5_master_layout); ++ of_at91_clk_master_setup(np, &at91sam9x5_master_layout); + } ++CLK_OF_DECLARE(at91sam9x5_clk_master, "atmel,at91sam9x5-clk-master", ++ of_at91sam9x5_clk_master_setup); +diff --git a/drivers/clk/at91/clk-peripheral.c b/drivers/clk/at91/clk-peripheral.c +index 58f3b56..d69cd2a 100644 +--- a/drivers/clk/at91/clk-peripheral.c ++++ b/drivers/clk/at91/clk-peripheral.c +@@ -12,11 +12,13 @@ + #include + #include + #include +-#include +-#include ++#include ++#include + + #include "pmc.h" + ++DEFINE_SPINLOCK(pmc_pcr_lock); ++ + #define PERIPHERAL_MAX 64 + + #define PERIPHERAL_AT91RM9200 0 +@@ -33,7 +35,7 @@ + + struct clk_peripheral { + struct clk_hw hw; +- struct at91_pmc *pmc; ++ struct regmap *regmap; + u32 id; + }; + +@@ -41,8 +43,9 @@ struct clk_peripheral { + + struct clk_sam9x5_peripheral { + struct clk_hw hw; +- struct at91_pmc *pmc; ++ struct regmap *regmap; + struct clk_range range; ++ spinlock_t *lock; + u32 id; + u32 div; + bool auto_div; +@@ -54,7 +57,6 @@ struct clk_sam9x5_peripheral { + static int clk_peripheral_enable(struct clk_hw *hw) + { + struct clk_peripheral *periph = to_clk_peripheral(hw); +- struct at91_pmc *pmc = periph->pmc; + int offset = AT91_PMC_PCER; + u32 id = periph->id; + +@@ -62,14 +64,14 @@ static int clk_peripheral_enable(struct clk_hw *hw) + return 0; + if (id > PERIPHERAL_ID_MAX) + offset = AT91_PMC_PCER1; +- pmc_write(pmc, offset, PERIPHERAL_MASK(id)); ++ regmap_write(periph->regmap, offset, PERIPHERAL_MASK(id)); ++ + return 0; + } + + static void clk_peripheral_disable(struct clk_hw *hw) + { + struct clk_peripheral *periph = to_clk_peripheral(hw); +- struct at91_pmc *pmc = periph->pmc; + int offset = AT91_PMC_PCDR; + u32 id = periph->id; + +@@ -77,21 +79,23 @@ static void clk_peripheral_disable(struct clk_hw *hw) + return; + if (id > PERIPHERAL_ID_MAX) + offset = AT91_PMC_PCDR1; +- pmc_write(pmc, offset, PERIPHERAL_MASK(id)); ++ regmap_write(periph->regmap, offset, PERIPHERAL_MASK(id)); + } + + static int clk_peripheral_is_enabled(struct clk_hw *hw) + { + struct clk_peripheral *periph = to_clk_peripheral(hw); +- struct at91_pmc *pmc = periph->pmc; + int offset = AT91_PMC_PCSR; ++ unsigned int status; + u32 id = periph->id; + + if (id < PERIPHERAL_ID_MIN) + return 1; + if (id > PERIPHERAL_ID_MAX) + offset = AT91_PMC_PCSR1; +- return !!(pmc_read(pmc, offset) & PERIPHERAL_MASK(id)); ++ regmap_read(periph->regmap, offset, &status); ++ ++ return status & PERIPHERAL_MASK(id) ? 1 : 0; + } + + static const struct clk_ops peripheral_ops = { +@@ -101,14 +105,14 @@ static const struct clk_ops peripheral_ops = { + }; + + static struct clk * __init +-at91_clk_register_peripheral(struct at91_pmc *pmc, const char *name, ++at91_clk_register_peripheral(struct regmap *regmap, const char *name, + const char *parent_name, u32 id) + { + struct clk_peripheral *periph; + struct clk *clk = NULL; + struct clk_init_data init; + +- if (!pmc || !name || !parent_name || id > PERIPHERAL_ID_MAX) ++ if (!name || !parent_name || id > PERIPHERAL_ID_MAX) + return ERR_PTR(-EINVAL); + + periph = kzalloc(sizeof(*periph), GFP_KERNEL); +@@ -123,7 +127,7 @@ at91_clk_register_peripheral(struct at91_pmc *pmc, const char *name, + + periph->id = id; + periph->hw.init = &init; +- periph->pmc = pmc; ++ periph->regmap = regmap; + + clk = clk_register(NULL, &periph->hw); + if (IS_ERR(clk)) +@@ -160,53 +164,58 @@ static void clk_sam9x5_peripheral_autodiv(struct clk_sam9x5_peripheral *periph) + static int clk_sam9x5_peripheral_enable(struct clk_hw *hw) + { + struct clk_sam9x5_peripheral *periph = to_clk_sam9x5_peripheral(hw); +- struct at91_pmc *pmc = periph->pmc; +- u32 tmp; ++ unsigned long flags; + + if (periph->id < PERIPHERAL_ID_MIN) + return 0; + +- pmc_lock(pmc); +- pmc_write(pmc, AT91_PMC_PCR, (periph->id & AT91_PMC_PCR_PID_MASK)); +- tmp = pmc_read(pmc, AT91_PMC_PCR) & ~AT91_PMC_PCR_DIV_MASK; +- pmc_write(pmc, AT91_PMC_PCR, tmp | AT91_PMC_PCR_DIV(periph->div) +- | AT91_PMC_PCR_CMD +- | AT91_PMC_PCR_EN); +- pmc_unlock(pmc); ++ spin_lock_irqsave(periph->lock, flags); ++ regmap_write(periph->regmap, AT91_PMC_PCR, ++ (periph->id & AT91_PMC_PCR_PID_MASK)); ++ regmap_update_bits(periph->regmap, AT91_PMC_PCR, ++ AT91_PMC_PCR_DIV_MASK | AT91_PMC_PCR_CMD | ++ AT91_PMC_PCR_EN, ++ AT91_PMC_PCR_DIV(periph->div) | ++ AT91_PMC_PCR_CMD | ++ AT91_PMC_PCR_EN); ++ spin_unlock_irqrestore(periph->lock, flags); ++ + return 0; + } + + static void clk_sam9x5_peripheral_disable(struct clk_hw *hw) + { + struct clk_sam9x5_peripheral *periph = to_clk_sam9x5_peripheral(hw); +- struct at91_pmc *pmc = periph->pmc; +- u32 tmp; ++ unsigned long flags; + + if (periph->id < PERIPHERAL_ID_MIN) + return; + +- pmc_lock(pmc); +- pmc_write(pmc, AT91_PMC_PCR, (periph->id & AT91_PMC_PCR_PID_MASK)); +- tmp = pmc_read(pmc, AT91_PMC_PCR) & ~AT91_PMC_PCR_EN; +- pmc_write(pmc, AT91_PMC_PCR, tmp | AT91_PMC_PCR_CMD); +- pmc_unlock(pmc); ++ spin_lock_irqsave(periph->lock, flags); ++ regmap_write(periph->regmap, AT91_PMC_PCR, ++ (periph->id & AT91_PMC_PCR_PID_MASK)); ++ regmap_update_bits(periph->regmap, AT91_PMC_PCR, ++ AT91_PMC_PCR_EN | AT91_PMC_PCR_CMD, ++ AT91_PMC_PCR_CMD); ++ spin_unlock_irqrestore(periph->lock, flags); + } + + static int clk_sam9x5_peripheral_is_enabled(struct clk_hw *hw) + { + struct clk_sam9x5_peripheral *periph = to_clk_sam9x5_peripheral(hw); +- struct at91_pmc *pmc = periph->pmc; +- int ret; ++ unsigned long flags; ++ unsigned int status; + + if (periph->id < PERIPHERAL_ID_MIN) + return 1; + +- pmc_lock(pmc); +- pmc_write(pmc, AT91_PMC_PCR, (periph->id & AT91_PMC_PCR_PID_MASK)); +- ret = !!(pmc_read(pmc, AT91_PMC_PCR) & AT91_PMC_PCR_EN); +- pmc_unlock(pmc); ++ spin_lock_irqsave(periph->lock, flags); ++ regmap_write(periph->regmap, AT91_PMC_PCR, ++ (periph->id & AT91_PMC_PCR_PID_MASK)); ++ regmap_read(periph->regmap, AT91_PMC_PCR, &status); ++ spin_unlock_irqrestore(periph->lock, flags); + +- return ret; ++ return status & AT91_PMC_PCR_EN ? 1 : 0; + } + + static unsigned long +@@ -214,19 +223,20 @@ clk_sam9x5_peripheral_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) + { + struct clk_sam9x5_peripheral *periph = to_clk_sam9x5_peripheral(hw); +- struct at91_pmc *pmc = periph->pmc; +- u32 tmp; ++ unsigned long flags; ++ unsigned int status; + + if (periph->id < PERIPHERAL_ID_MIN) + return parent_rate; + +- pmc_lock(pmc); +- pmc_write(pmc, AT91_PMC_PCR, (periph->id & AT91_PMC_PCR_PID_MASK)); +- tmp = pmc_read(pmc, AT91_PMC_PCR); +- pmc_unlock(pmc); ++ spin_lock_irqsave(periph->lock, flags); ++ regmap_write(periph->regmap, AT91_PMC_PCR, ++ (periph->id & AT91_PMC_PCR_PID_MASK)); ++ regmap_read(periph->regmap, AT91_PMC_PCR, &status); ++ spin_unlock_irqrestore(periph->lock, flags); + +- if (tmp & AT91_PMC_PCR_EN) { +- periph->div = PERIPHERAL_RSHIFT(tmp); ++ if (status & AT91_PMC_PCR_EN) { ++ periph->div = PERIPHERAL_RSHIFT(status); + periph->auto_div = false; + } else { + clk_sam9x5_peripheral_autodiv(periph); +@@ -318,15 +328,15 @@ static const struct clk_ops sam9x5_peripheral_ops = { + }; + + static struct clk * __init +-at91_clk_register_sam9x5_peripheral(struct at91_pmc *pmc, const char *name, +- const char *parent_name, u32 id, +- const struct clk_range *range) ++at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock, ++ const char *name, const char *parent_name, ++ u32 id, const struct clk_range *range) + { + struct clk_sam9x5_peripheral *periph; + struct clk *clk = NULL; + struct clk_init_data init; + +- if (!pmc || !name || !parent_name) ++ if (!name || !parent_name) + return ERR_PTR(-EINVAL); + + periph = kzalloc(sizeof(*periph), GFP_KERNEL); +@@ -342,7 +352,8 @@ at91_clk_register_sam9x5_peripheral(struct at91_pmc *pmc, const char *name, + periph->id = id; + periph->hw.init = &init; + periph->div = 0; +- periph->pmc = pmc; ++ periph->regmap = regmap; ++ periph->lock = lock; + periph->auto_div = true; + periph->range = *range; + +@@ -356,7 +367,7 @@ at91_clk_register_sam9x5_peripheral(struct at91_pmc *pmc, const char *name, + } + + static void __init +-of_at91_clk_periph_setup(struct device_node *np, struct at91_pmc *pmc, u8 type) ++of_at91_clk_periph_setup(struct device_node *np, u8 type) + { + int num; + u32 id; +@@ -364,6 +375,7 @@ of_at91_clk_periph_setup(struct device_node *np, struct at91_pmc *pmc, u8 type) + const char *parent_name; + const char *name; + struct device_node *periphclknp; ++ struct regmap *regmap; + + parent_name = of_clk_get_parent_name(np, 0); + if (!parent_name) +@@ -373,6 +385,10 @@ of_at91_clk_periph_setup(struct device_node *np, struct at91_pmc *pmc, u8 type) + if (!num || num > PERIPHERAL_MAX) + return; + ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) ++ return; ++ + for_each_child_of_node(np, periphclknp) { + if (of_property_read_u32(periphclknp, "reg", &id)) + continue; +@@ -384,7 +400,7 @@ of_at91_clk_periph_setup(struct device_node *np, struct at91_pmc *pmc, u8 type) + name = periphclknp->name; + + if (type == PERIPHERAL_AT91RM9200) { +- clk = at91_clk_register_peripheral(pmc, name, ++ clk = at91_clk_register_peripheral(regmap, name, + parent_name, id); + } else { + struct clk_range range = CLK_RANGE(0, 0); +@@ -393,7 +409,9 @@ of_at91_clk_periph_setup(struct device_node *np, struct at91_pmc *pmc, u8 type) + "atmel,clk-output-range", + &range); + +- clk = at91_clk_register_sam9x5_peripheral(pmc, name, ++ clk = at91_clk_register_sam9x5_peripheral(regmap, ++ &pmc_pcr_lock, ++ name, + parent_name, + id, &range); + } +@@ -405,14 +423,16 @@ of_at91_clk_periph_setup(struct device_node *np, struct at91_pmc *pmc, u8 type) + } + } + +-void __init of_at91rm9200_clk_periph_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91rm9200_clk_periph_setup(struct device_node *np) + { +- of_at91_clk_periph_setup(np, pmc, PERIPHERAL_AT91RM9200); ++ of_at91_clk_periph_setup(np, PERIPHERAL_AT91RM9200); + } ++CLK_OF_DECLARE(at91rm9200_clk_periph, "atmel,at91rm9200-clk-peripheral", ++ of_at91rm9200_clk_periph_setup); + +-void __init of_at91sam9x5_clk_periph_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91sam9x5_clk_periph_setup(struct device_node *np) + { +- of_at91_clk_periph_setup(np, pmc, PERIPHERAL_AT91SAM9X5); ++ of_at91_clk_periph_setup(np, PERIPHERAL_AT91SAM9X5); + } ++CLK_OF_DECLARE(at91sam9x5_clk_periph, "atmel,at91sam9x5-clk-peripheral", ++ of_at91sam9x5_clk_periph_setup); +diff --git a/drivers/clk/at91/clk-pll.c b/drivers/clk/at91/clk-pll.c +index 18b60f4..fb2e0b5 100644 +--- a/drivers/clk/at91/clk-pll.c ++++ b/drivers/clk/at91/clk-pll.c +@@ -12,14 +12,8 @@ + #include + #include + #include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include ++#include ++#include + + #include "pmc.h" + +@@ -58,9 +52,7 @@ struct clk_pll_layout { + + struct clk_pll { + struct clk_hw hw; +- struct at91_pmc *pmc; +- unsigned int irq; +- wait_queue_head_t wait; ++ struct regmap *regmap; + u8 id; + u8 div; + u8 range; +@@ -69,20 +61,19 @@ struct clk_pll { + const struct clk_pll_characteristics *characteristics; + }; + +-static irqreturn_t clk_pll_irq_handler(int irq, void *dev_id) ++static inline bool clk_pll_ready(struct regmap *regmap, int id) + { +- struct clk_pll *pll = (struct clk_pll *)dev_id; ++ unsigned int status; + +- wake_up(&pll->wait); +- disable_irq_nosync(pll->irq); ++ regmap_read(regmap, AT91_PMC_SR, &status); + +- return IRQ_HANDLED; ++ return status & PLL_STATUS_MASK(id) ? 1 : 0; + } + + static int clk_pll_prepare(struct clk_hw *hw) + { + struct clk_pll *pll = to_clk_pll(hw); +- struct at91_pmc *pmc = pll->pmc; ++ struct regmap *regmap = pll->regmap; + const struct clk_pll_layout *layout = pll->layout; + const struct clk_pll_characteristics *characteristics = + pll->characteristics; +@@ -90,39 +81,34 @@ static int clk_pll_prepare(struct clk_hw *hw) + u32 mask = PLL_STATUS_MASK(id); + int offset = PLL_REG(id); + u8 out = 0; +- u32 pllr, icpr; ++ unsigned int pllr; ++ unsigned int status; + u8 div; + u16 mul; + +- pllr = pmc_read(pmc, offset); ++ regmap_read(regmap, offset, &pllr); + div = PLL_DIV(pllr); + mul = PLL_MUL(pllr, layout); + +- if ((pmc_read(pmc, AT91_PMC_SR) & mask) && ++ regmap_read(regmap, AT91_PMC_SR, &status); ++ if ((status & mask) && + (div == pll->div && mul == pll->mul)) + return 0; + + if (characteristics->out) + out = characteristics->out[pll->range]; +- if (characteristics->icpll) { +- icpr = pmc_read(pmc, AT91_PMC_PLLICPR) & ~PLL_ICPR_MASK(id); +- icpr |= (characteristics->icpll[pll->range] << +- PLL_ICPR_SHIFT(id)); +- pmc_write(pmc, AT91_PMC_PLLICPR, icpr); +- } + +- pllr &= ~layout->pllr_mask; +- pllr |= layout->pllr_mask & +- (pll->div | (PLL_MAX_COUNT << PLL_COUNT_SHIFT) | +- (out << PLL_OUT_SHIFT) | +- ((pll->mul & layout->mul_mask) << layout->mul_shift)); +- pmc_write(pmc, offset, pllr); +- +- while (!(pmc_read(pmc, AT91_PMC_SR) & mask)) { +- enable_irq(pll->irq); +- wait_event(pll->wait, +- pmc_read(pmc, AT91_PMC_SR) & mask); +- } ++ if (characteristics->icpll) ++ regmap_update_bits(regmap, AT91_PMC_PLLICPR, PLL_ICPR_MASK(id), ++ characteristics->icpll[pll->range] << PLL_ICPR_SHIFT(id)); ++ ++ regmap_update_bits(regmap, offset, layout->pllr_mask, ++ pll->div | (PLL_MAX_COUNT << PLL_COUNT_SHIFT) | ++ (out << PLL_OUT_SHIFT) | ++ ((pll->mul & layout->mul_mask) << layout->mul_shift)); ++ ++ while (!clk_pll_ready(regmap, pll->id)) ++ cpu_relax(); + + return 0; + } +@@ -130,32 +116,35 @@ static int clk_pll_prepare(struct clk_hw *hw) + static int clk_pll_is_prepared(struct clk_hw *hw) + { + struct clk_pll *pll = to_clk_pll(hw); +- struct at91_pmc *pmc = pll->pmc; + +- return !!(pmc_read(pmc, AT91_PMC_SR) & +- PLL_STATUS_MASK(pll->id)); ++ return clk_pll_ready(pll->regmap, pll->id); + } + + static void clk_pll_unprepare(struct clk_hw *hw) + { + struct clk_pll *pll = to_clk_pll(hw); +- struct at91_pmc *pmc = pll->pmc; +- const struct clk_pll_layout *layout = pll->layout; +- int offset = PLL_REG(pll->id); +- u32 tmp = pmc_read(pmc, offset) & ~(layout->pllr_mask); ++ unsigned int mask = pll->layout->pllr_mask; + +- pmc_write(pmc, offset, tmp); ++ regmap_update_bits(pll->regmap, PLL_REG(pll->id), mask, ~mask); + } + + static unsigned long clk_pll_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) + { + struct clk_pll *pll = to_clk_pll(hw); ++ unsigned int pllr; ++ u16 mul; ++ u8 div; + +- if (!pll->div || !pll->mul) ++ regmap_read(pll->regmap, PLL_REG(pll->id), &pllr); ++ ++ div = PLL_DIV(pllr); ++ mul = PLL_MUL(pllr, pll->layout); ++ ++ if (!div || !mul) + return 0; + +- return (parent_rate / pll->div) * (pll->mul + 1); ++ return (parent_rate / div) * (mul + 1); + } + + static long clk_pll_get_best_div_mul(struct clk_pll *pll, unsigned long rate, +@@ -308,7 +297,7 @@ static const struct clk_ops pll_ops = { + }; + + static struct clk * __init +-at91_clk_register_pll(struct at91_pmc *pmc, unsigned int irq, const char *name, ++at91_clk_register_pll(struct regmap *regmap, const char *name, + const char *parent_name, u8 id, + const struct clk_pll_layout *layout, + const struct clk_pll_characteristics *characteristics) +@@ -316,9 +305,8 @@ at91_clk_register_pll(struct at91_pmc *pmc, unsigned int irq, const char *name, + struct clk_pll *pll; + struct clk *clk = NULL; + struct clk_init_data init; +- int ret; + int offset = PLL_REG(id); +- u32 tmp; ++ unsigned int pllr; + + if (id > PLL_MAX_ID) + return ERR_PTR(-EINVAL); +@@ -337,23 +325,13 @@ at91_clk_register_pll(struct at91_pmc *pmc, unsigned int irq, const char *name, + pll->hw.init = &init; + pll->layout = layout; + pll->characteristics = characteristics; +- pll->pmc = pmc; +- pll->irq = irq; +- tmp = pmc_read(pmc, offset) & layout->pllr_mask; +- pll->div = PLL_DIV(tmp); +- pll->mul = PLL_MUL(tmp, layout); +- init_waitqueue_head(&pll->wait); +- irq_set_status_flags(pll->irq, IRQ_NOAUTOEN); +- ret = request_irq(pll->irq, clk_pll_irq_handler, IRQF_TRIGGER_HIGH, +- id ? "clk-pllb" : "clk-plla", pll); +- if (ret) { +- kfree(pll); +- return ERR_PTR(ret); +- } ++ pll->regmap = regmap; ++ regmap_read(regmap, offset, &pllr); ++ pll->div = PLL_DIV(pllr); ++ pll->mul = PLL_MUL(pllr, layout); + + clk = clk_register(NULL, &pll->hw); + if (IS_ERR(clk)) { +- free_irq(pll->irq, pll); + kfree(pll); + } + +@@ -483,12 +461,12 @@ out_free_characteristics: + } + + static void __init +-of_at91_clk_pll_setup(struct device_node *np, struct at91_pmc *pmc, ++of_at91_clk_pll_setup(struct device_node *np, + const struct clk_pll_layout *layout) + { + u32 id; +- unsigned int irq; + struct clk *clk; ++ struct regmap *regmap; + const char *parent_name; + const char *name = np->name; + struct clk_pll_characteristics *characteristics; +@@ -500,15 +478,15 @@ of_at91_clk_pll_setup(struct device_node *np, struct at91_pmc *pmc, + + of_property_read_string(np, "clock-output-names", &name); + +- characteristics = of_at91_clk_pll_get_characteristics(np); +- if (!characteristics) ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) + return; + +- irq = irq_of_parse_and_map(np, 0); +- if (!irq) ++ characteristics = of_at91_clk_pll_get_characteristics(np); ++ if (!characteristics) + return; + +- clk = at91_clk_register_pll(pmc, irq, name, parent_name, id, layout, ++ clk = at91_clk_register_pll(regmap, name, parent_name, id, layout, + characteristics); + if (IS_ERR(clk)) + goto out_free_characteristics; +@@ -520,26 +498,30 @@ out_free_characteristics: + kfree(characteristics); + } + +-void __init of_at91rm9200_clk_pll_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91rm9200_clk_pll_setup(struct device_node *np) + { +- of_at91_clk_pll_setup(np, pmc, &at91rm9200_pll_layout); ++ of_at91_clk_pll_setup(np, &at91rm9200_pll_layout); + } ++CLK_OF_DECLARE(at91rm9200_clk_pll, "atmel,at91rm9200-clk-pll", ++ of_at91rm9200_clk_pll_setup); + +-void __init of_at91sam9g45_clk_pll_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91sam9g45_clk_pll_setup(struct device_node *np) + { +- of_at91_clk_pll_setup(np, pmc, &at91sam9g45_pll_layout); ++ of_at91_clk_pll_setup(np, &at91sam9g45_pll_layout); + } ++CLK_OF_DECLARE(at91sam9g45_clk_pll, "atmel,at91sam9g45-clk-pll", ++ of_at91sam9g45_clk_pll_setup); + +-void __init of_at91sam9g20_clk_pllb_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91sam9g20_clk_pllb_setup(struct device_node *np) + { +- of_at91_clk_pll_setup(np, pmc, &at91sam9g20_pllb_layout); ++ of_at91_clk_pll_setup(np, &at91sam9g20_pllb_layout); + } ++CLK_OF_DECLARE(at91sam9g20_clk_pllb, "atmel,at91sam9g20-clk-pllb", ++ of_at91sam9g20_clk_pllb_setup); + +-void __init of_sama5d3_clk_pll_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_sama5d3_clk_pll_setup(struct device_node *np) + { +- of_at91_clk_pll_setup(np, pmc, &sama5d3_pll_layout); ++ of_at91_clk_pll_setup(np, &sama5d3_pll_layout); + } ++CLK_OF_DECLARE(sama5d3_clk_pll, "atmel,sama5d3-clk-pll", ++ of_sama5d3_clk_pll_setup); +diff --git a/drivers/clk/at91/clk-plldiv.c b/drivers/clk/at91/clk-plldiv.c +index ea22656..2bed264 100644 +--- a/drivers/clk/at91/clk-plldiv.c ++++ b/drivers/clk/at91/clk-plldiv.c +@@ -12,8 +12,8 @@ + #include + #include + #include +-#include +-#include ++#include ++#include + + #include "pmc.h" + +@@ -21,16 +21,18 @@ + + struct clk_plldiv { + struct clk_hw hw; +- struct at91_pmc *pmc; ++ struct regmap *regmap; + }; + + static unsigned long clk_plldiv_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) + { + struct clk_plldiv *plldiv = to_clk_plldiv(hw); +- struct at91_pmc *pmc = plldiv->pmc; ++ unsigned int mckr; + +- if (pmc_read(pmc, AT91_PMC_MCKR) & AT91_PMC_PLLADIV2) ++ regmap_read(plldiv->regmap, AT91_PMC_MCKR, &mckr); ++ ++ if (mckr & AT91_PMC_PLLADIV2) + return parent_rate / 2; + + return parent_rate; +@@ -57,18 +59,12 @@ static int clk_plldiv_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) + { + struct clk_plldiv *plldiv = to_clk_plldiv(hw); +- struct at91_pmc *pmc = plldiv->pmc; +- u32 tmp; + +- if (parent_rate != rate && (parent_rate / 2) != rate) ++ if ((parent_rate != rate) && (parent_rate / 2 != rate)) + return -EINVAL; + +- pmc_lock(pmc); +- tmp = pmc_read(pmc, AT91_PMC_MCKR) & ~AT91_PMC_PLLADIV2; +- if ((parent_rate / 2) == rate) +- tmp |= AT91_PMC_PLLADIV2; +- pmc_write(pmc, AT91_PMC_MCKR, tmp); +- pmc_unlock(pmc); ++ regmap_update_bits(plldiv->regmap, AT91_PMC_MCKR, AT91_PMC_PLLADIV2, ++ parent_rate != rate ? AT91_PMC_PLLADIV2 : 0); + + return 0; + } +@@ -80,7 +76,7 @@ static const struct clk_ops plldiv_ops = { + }; + + static struct clk * __init +-at91_clk_register_plldiv(struct at91_pmc *pmc, const char *name, ++at91_clk_register_plldiv(struct regmap *regmap, const char *name, + const char *parent_name) + { + struct clk_plldiv *plldiv; +@@ -98,7 +94,7 @@ at91_clk_register_plldiv(struct at91_pmc *pmc, const char *name, + init.flags = CLK_SET_RATE_GATE; + + plldiv->hw.init = &init; +- plldiv->pmc = pmc; ++ plldiv->regmap = regmap; + + clk = clk_register(NULL, &plldiv->hw); + +@@ -109,27 +105,27 @@ at91_clk_register_plldiv(struct at91_pmc *pmc, const char *name, + } + + static void __init +-of_at91_clk_plldiv_setup(struct device_node *np, struct at91_pmc *pmc) ++of_at91sam9x5_clk_plldiv_setup(struct device_node *np) + { + struct clk *clk; + const char *parent_name; + const char *name = np->name; ++ struct regmap *regmap; + + parent_name = of_clk_get_parent_name(np, 0); + + of_property_read_string(np, "clock-output-names", &name); + +- clk = at91_clk_register_plldiv(pmc, name, parent_name); ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) ++ return; + ++ clk = at91_clk_register_plldiv(regmap, name, parent_name); + if (IS_ERR(clk)) + return; + + of_clk_add_provider(np, of_clk_src_simple_get, clk); + return; + } +- +-void __init of_at91sam9x5_clk_plldiv_setup(struct device_node *np, +- struct at91_pmc *pmc) +-{ +- of_at91_clk_plldiv_setup(np, pmc); +-} ++CLK_OF_DECLARE(at91sam9x5_clk_plldiv, "atmel,at91sam9x5-clk-plldiv", ++ of_at91sam9x5_clk_plldiv_setup); +diff --git a/drivers/clk/at91/clk-programmable.c b/drivers/clk/at91/clk-programmable.c +index 14b270b..bc0be62 100644 +--- a/drivers/clk/at91/clk-programmable.c ++++ b/drivers/clk/at91/clk-programmable.c +@@ -12,10 +12,8 @@ + #include + #include + #include +-#include +-#include +-#include +-#include ++#include ++#include + + #include "pmc.h" + +@@ -24,6 +22,7 @@ + + #define PROG_STATUS_MASK(id) (1 << ((id) + 8)) + #define PROG_PRES_MASK 0x7 ++#define PROG_PRES(layout, pckr) ((pckr >> layout->pres_shift) & PROG_PRES_MASK) + #define PROG_MAX_RM9200_CSS 3 + + struct clk_programmable_layout { +@@ -34,7 +33,7 @@ struct clk_programmable_layout { + + struct clk_programmable { + struct clk_hw hw; +- struct at91_pmc *pmc; ++ struct regmap *regmap; + u8 id; + const struct clk_programmable_layout *layout; + }; +@@ -44,14 +43,12 @@ struct clk_programmable { + static unsigned long clk_programmable_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) + { +- u32 pres; + struct clk_programmable *prog = to_clk_programmable(hw); +- struct at91_pmc *pmc = prog->pmc; +- const struct clk_programmable_layout *layout = prog->layout; ++ unsigned int pckr; ++ ++ regmap_read(prog->regmap, AT91_PMC_PCKR(prog->id), &pckr); + +- pres = (pmc_read(pmc, AT91_PMC_PCKR(prog->id)) >> layout->pres_shift) & +- PROG_PRES_MASK; +- return parent_rate >> pres; ++ return parent_rate >> PROG_PRES(prog->layout, pckr); + } + + static int clk_programmable_determine_rate(struct clk_hw *hw, +@@ -101,36 +98,36 @@ static int clk_programmable_set_parent(struct clk_hw *hw, u8 index) + { + struct clk_programmable *prog = to_clk_programmable(hw); + const struct clk_programmable_layout *layout = prog->layout; +- struct at91_pmc *pmc = prog->pmc; +- u32 tmp = pmc_read(pmc, AT91_PMC_PCKR(prog->id)) & ~layout->css_mask; ++ unsigned int mask = layout->css_mask; ++ unsigned int pckr = 0; + + if (layout->have_slck_mck) +- tmp &= AT91_PMC_CSSMCK_MCK; ++ mask |= AT91_PMC_CSSMCK_MCK; + + if (index > layout->css_mask) { +- if (index > PROG_MAX_RM9200_CSS && layout->have_slck_mck) { +- tmp |= AT91_PMC_CSSMCK_MCK; +- return 0; +- } else { ++ if (index > PROG_MAX_RM9200_CSS && !layout->have_slck_mck) + return -EINVAL; +- } ++ ++ pckr |= AT91_PMC_CSSMCK_MCK; + } + +- pmc_write(pmc, AT91_PMC_PCKR(prog->id), tmp | index); ++ regmap_update_bits(prog->regmap, AT91_PMC_PCKR(prog->id), mask, pckr); ++ + return 0; + } + + static u8 clk_programmable_get_parent(struct clk_hw *hw) + { +- u32 tmp; +- u8 ret; + struct clk_programmable *prog = to_clk_programmable(hw); +- struct at91_pmc *pmc = prog->pmc; + const struct clk_programmable_layout *layout = prog->layout; ++ unsigned int pckr; ++ u8 ret; ++ ++ regmap_read(prog->regmap, AT91_PMC_PCKR(prog->id), &pckr); ++ ++ ret = pckr & layout->css_mask; + +- tmp = pmc_read(pmc, AT91_PMC_PCKR(prog->id)); +- ret = tmp & layout->css_mask; +- if (layout->have_slck_mck && (tmp & AT91_PMC_CSSMCK_MCK) && !ret) ++ if (layout->have_slck_mck && (pckr & AT91_PMC_CSSMCK_MCK) && !ret) + ret = PROG_MAX_RM9200_CSS + 1; + + return ret; +@@ -140,26 +137,27 @@ static int clk_programmable_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) + { + struct clk_programmable *prog = to_clk_programmable(hw); +- struct at91_pmc *pmc = prog->pmc; + const struct clk_programmable_layout *layout = prog->layout; + unsigned long div = parent_rate / rate; ++ unsigned int pckr; + int shift = 0; +- u32 tmp = pmc_read(pmc, AT91_PMC_PCKR(prog->id)) & +- ~(PROG_PRES_MASK << layout->pres_shift); ++ ++ regmap_read(prog->regmap, AT91_PMC_PCKR(prog->id), &pckr); + + if (!div) + return -EINVAL; + + shift = fls(div) - 1; + +- if (div != (1<= PROG_PRES_MASK) + return -EINVAL; + +- pmc_write(pmc, AT91_PMC_PCKR(prog->id), +- tmp | (shift << layout->pres_shift)); ++ regmap_update_bits(prog->regmap, AT91_PMC_PCKR(prog->id), ++ PROG_PRES_MASK << layout->pres_shift, ++ shift << layout->pres_shift); + + return 0; + } +@@ -173,7 +171,7 @@ static const struct clk_ops programmable_ops = { + }; + + static struct clk * __init +-at91_clk_register_programmable(struct at91_pmc *pmc, ++at91_clk_register_programmable(struct regmap *regmap, + const char *name, const char **parent_names, + u8 num_parents, u8 id, + const struct clk_programmable_layout *layout) +@@ -198,7 +196,7 @@ at91_clk_register_programmable(struct at91_pmc *pmc, + prog->id = id; + prog->layout = layout; + prog->hw.init = &init; +- prog->pmc = pmc; ++ prog->regmap = regmap; + + clk = clk_register(NULL, &prog->hw); + if (IS_ERR(clk)) +@@ -226,7 +224,7 @@ static const struct clk_programmable_layout at91sam9x5_programmable_layout = { + }; + + static void __init +-of_at91_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc, ++of_at91_clk_prog_setup(struct device_node *np, + const struct clk_programmable_layout *layout) + { + int num; +@@ -236,6 +234,7 @@ of_at91_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc, + const char *parent_names[PROG_SOURCE_MAX]; + const char *name; + struct device_node *progclknp; ++ struct regmap *regmap; + + num_parents = of_clk_get_parent_count(np); + if (num_parents <= 0 || num_parents > PROG_SOURCE_MAX) +@@ -247,6 +246,10 @@ of_at91_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc, + if (!num || num > (PROG_ID_MAX + 1)) + return; + ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) ++ return; ++ + for_each_child_of_node(np, progclknp) { + if (of_property_read_u32(progclknp, "reg", &id)) + continue; +@@ -254,7 +257,7 @@ of_at91_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc, + if (of_property_read_string(np, "clock-output-names", &name)) + name = progclknp->name; + +- clk = at91_clk_register_programmable(pmc, name, ++ clk = at91_clk_register_programmable(regmap, name, + parent_names, num_parents, + id, layout); + if (IS_ERR(clk)) +@@ -265,20 +268,23 @@ of_at91_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc, + } + + +-void __init of_at91rm9200_clk_prog_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91rm9200_clk_prog_setup(struct device_node *np) + { +- of_at91_clk_prog_setup(np, pmc, &at91rm9200_programmable_layout); ++ of_at91_clk_prog_setup(np, &at91rm9200_programmable_layout); + } ++CLK_OF_DECLARE(at91rm9200_clk_prog, "atmel,at91rm9200-clk-programmable", ++ of_at91rm9200_clk_prog_setup); + +-void __init of_at91sam9g45_clk_prog_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91sam9g45_clk_prog_setup(struct device_node *np) + { +- of_at91_clk_prog_setup(np, pmc, &at91sam9g45_programmable_layout); ++ of_at91_clk_prog_setup(np, &at91sam9g45_programmable_layout); + } ++CLK_OF_DECLARE(at91sam9g45_clk_prog, "atmel,at91sam9g45-clk-programmable", ++ of_at91sam9g45_clk_prog_setup); + +-void __init of_at91sam9x5_clk_prog_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91sam9x5_clk_prog_setup(struct device_node *np) + { +- of_at91_clk_prog_setup(np, pmc, &at91sam9x5_programmable_layout); ++ of_at91_clk_prog_setup(np, &at91sam9x5_programmable_layout); + } ++CLK_OF_DECLARE(at91sam9x5_clk_prog, "atmel,at91sam9x5-clk-programmable", ++ of_at91sam9x5_clk_prog_setup); +diff --git a/drivers/clk/at91/clk-slow.c b/drivers/clk/at91/clk-slow.c +index d0d5076..221c096 100644 +--- a/drivers/clk/at91/clk-slow.c ++++ b/drivers/clk/at91/clk-slow.c +@@ -13,17 +13,11 @@ + #include + #include + #include +-#include + #include + #include + #include +-#include +-#include +-#include +-#include +-#include +-#include +-#include ++#include ++#include + + #include "pmc.h" + #include "sckc.h" +@@ -59,7 +53,7 @@ struct clk_slow_rc_osc { + + struct clk_sam9260_slow { + struct clk_hw hw; +- struct at91_pmc *pmc; ++ struct regmap *regmap; + }; + + #define to_clk_sam9260_slow(hw) container_of(hw, struct clk_sam9260_slow, hw) +@@ -393,8 +387,11 @@ void __init of_at91sam9x5_clk_slow_setup(struct device_node *np, + static u8 clk_sam9260_slow_get_parent(struct clk_hw *hw) + { + struct clk_sam9260_slow *slowck = to_clk_sam9260_slow(hw); ++ unsigned int status; + +- return !!(pmc_read(slowck->pmc, AT91_PMC_SR) & AT91_PMC_OSCSEL); ++ regmap_read(slowck->regmap, AT91_PMC_SR, &status); ++ ++ return status & AT91_PMC_OSCSEL ? 1 : 0; + } + + static const struct clk_ops sam9260_slow_ops = { +@@ -402,7 +399,7 @@ static const struct clk_ops sam9260_slow_ops = { + }; + + static struct clk * __init +-at91_clk_register_sam9260_slow(struct at91_pmc *pmc, ++at91_clk_register_sam9260_slow(struct regmap *regmap, + const char *name, + const char **parent_names, + int num_parents) +@@ -411,7 +408,7 @@ at91_clk_register_sam9260_slow(struct at91_pmc *pmc, + struct clk *clk = NULL; + struct clk_init_data init; + +- if (!pmc || !name) ++ if (!name) + return ERR_PTR(-EINVAL); + + if (!parent_names || !num_parents) +@@ -428,7 +425,7 @@ at91_clk_register_sam9260_slow(struct at91_pmc *pmc, + init.flags = 0; + + slowck->hw.init = &init; +- slowck->pmc = pmc; ++ slowck->regmap = regmap; + + clk = clk_register(NULL, &slowck->hw); + if (IS_ERR(clk)) +@@ -439,29 +436,34 @@ at91_clk_register_sam9260_slow(struct at91_pmc *pmc, + return clk; + } + +-void __init of_at91sam9260_clk_slow_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91sam9260_clk_slow_setup(struct device_node *np) + { + struct clk *clk; + const char *parent_names[2]; + int num_parents; + const char *name = np->name; ++ struct regmap *regmap; + + num_parents = of_clk_get_parent_count(np); + if (num_parents != 2) + return; + + of_clk_parent_fill(np, parent_names, num_parents); ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) ++ return; + + of_property_read_string(np, "clock-output-names", &name); + +- clk = at91_clk_register_sam9260_slow(pmc, name, parent_names, ++ clk = at91_clk_register_sam9260_slow(regmap, name, parent_names, + num_parents); + if (IS_ERR(clk)) + return; + + of_clk_add_provider(np, of_clk_src_simple_get, clk); + } ++CLK_OF_DECLARE(at91sam9260_clk_slow, "atmel,at91sam9260-clk-slow", ++ of_at91sam9260_clk_slow_setup); + + /* + * FIXME: All slow clk users are not properly claiming it (get + prepare + +diff --git a/drivers/clk/at91/clk-smd.c b/drivers/clk/at91/clk-smd.c +index a7f8501..e6948a5 100644 +--- a/drivers/clk/at91/clk-smd.c ++++ b/drivers/clk/at91/clk-smd.c +@@ -12,8 +12,8 @@ + #include + #include + #include +-#include +-#include ++#include ++#include + + #include "pmc.h" + +@@ -24,7 +24,7 @@ + + struct at91sam9x5_clk_smd { + struct clk_hw hw; +- struct at91_pmc *pmc; ++ struct regmap *regmap; + }; + + #define to_at91sam9x5_clk_smd(hw) \ +@@ -33,13 +33,13 @@ struct at91sam9x5_clk_smd { + static unsigned long at91sam9x5_clk_smd_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) + { +- u32 tmp; +- u8 smddiv; + struct at91sam9x5_clk_smd *smd = to_at91sam9x5_clk_smd(hw); +- struct at91_pmc *pmc = smd->pmc; ++ unsigned int smdr; ++ u8 smddiv; ++ ++ regmap_read(smd->regmap, AT91_PMC_SMD, &smdr); ++ smddiv = (smdr & AT91_PMC_SMD_DIV) >> SMD_DIV_SHIFT; + +- tmp = pmc_read(pmc, AT91_PMC_SMD); +- smddiv = (tmp & AT91_PMC_SMD_DIV) >> SMD_DIV_SHIFT; + return parent_rate / (smddiv + 1); + } + +@@ -67,40 +67,38 @@ static long at91sam9x5_clk_smd_round_rate(struct clk_hw *hw, unsigned long rate, + + static int at91sam9x5_clk_smd_set_parent(struct clk_hw *hw, u8 index) + { +- u32 tmp; + struct at91sam9x5_clk_smd *smd = to_at91sam9x5_clk_smd(hw); +- struct at91_pmc *pmc = smd->pmc; + + if (index > 1) + return -EINVAL; +- tmp = pmc_read(pmc, AT91_PMC_SMD) & ~AT91_PMC_SMDS; +- if (index) +- tmp |= AT91_PMC_SMDS; +- pmc_write(pmc, AT91_PMC_SMD, tmp); ++ ++ regmap_update_bits(smd->regmap, AT91_PMC_SMD, AT91_PMC_SMDS, ++ index ? AT91_PMC_SMDS : 0); ++ + return 0; + } + + static u8 at91sam9x5_clk_smd_get_parent(struct clk_hw *hw) + { + struct at91sam9x5_clk_smd *smd = to_at91sam9x5_clk_smd(hw); +- struct at91_pmc *pmc = smd->pmc; ++ unsigned int smdr; + +- return pmc_read(pmc, AT91_PMC_SMD) & AT91_PMC_SMDS; ++ regmap_read(smd->regmap, AT91_PMC_SMD, &smdr); ++ ++ return smdr & AT91_PMC_SMDS; + } + + static int at91sam9x5_clk_smd_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) + { +- u32 tmp; + struct at91sam9x5_clk_smd *smd = to_at91sam9x5_clk_smd(hw); +- struct at91_pmc *pmc = smd->pmc; + unsigned long div = parent_rate / rate; + + if (parent_rate % rate || div < 1 || div > (SMD_MAX_DIV + 1)) + return -EINVAL; +- tmp = pmc_read(pmc, AT91_PMC_SMD) & ~AT91_PMC_SMD_DIV; +- tmp |= (div - 1) << SMD_DIV_SHIFT; +- pmc_write(pmc, AT91_PMC_SMD, tmp); ++ ++ regmap_update_bits(smd->regmap, AT91_PMC_SMD, AT91_PMC_SMD_DIV, ++ (div - 1) << SMD_DIV_SHIFT); + + return 0; + } +@@ -114,7 +112,7 @@ static const struct clk_ops at91sam9x5_smd_ops = { + }; + + static struct clk * __init +-at91sam9x5_clk_register_smd(struct at91_pmc *pmc, const char *name, ++at91sam9x5_clk_register_smd(struct regmap *regmap, const char *name, + const char **parent_names, u8 num_parents) + { + struct at91sam9x5_clk_smd *smd; +@@ -132,7 +130,7 @@ at91sam9x5_clk_register_smd(struct at91_pmc *pmc, const char *name, + init.flags = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE; + + smd->hw.init = &init; +- smd->pmc = pmc; ++ smd->regmap = regmap; + + clk = clk_register(NULL, &smd->hw); + if (IS_ERR(clk)) +@@ -141,13 +139,13 @@ at91sam9x5_clk_register_smd(struct at91_pmc *pmc, const char *name, + return clk; + } + +-void __init of_at91sam9x5_clk_smd_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91sam9x5_clk_smd_setup(struct device_node *np) + { + struct clk *clk; + int num_parents; + const char *parent_names[SMD_SOURCE_MAX]; + const char *name = np->name; ++ struct regmap *regmap; + + num_parents = of_clk_get_parent_count(np); + if (num_parents <= 0 || num_parents > SMD_SOURCE_MAX) +@@ -157,10 +155,16 @@ void __init of_at91sam9x5_clk_smd_setup(struct device_node *np, + + of_property_read_string(np, "clock-output-names", &name); + +- clk = at91sam9x5_clk_register_smd(pmc, name, parent_names, ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) ++ return; ++ ++ clk = at91sam9x5_clk_register_smd(regmap, name, parent_names, + num_parents); + if (IS_ERR(clk)) + return; + + of_clk_add_provider(np, of_clk_src_simple_get, clk); + } ++CLK_OF_DECLARE(at91sam9x5_clk_smd, "atmel,at91sam9x5-clk-smd", ++ of_at91sam9x5_clk_smd_setup); +diff --git a/drivers/clk/at91/clk-system.c b/drivers/clk/at91/clk-system.c +index 3f53143..8f35d81 100644 +--- a/drivers/clk/at91/clk-system.c ++++ b/drivers/clk/at91/clk-system.c +@@ -12,13 +12,8 @@ + #include + #include + #include +-#include +-#include +-#include +-#include +-#include +-#include +-#include ++#include ++#include + + #include "pmc.h" + +@@ -29,9 +24,7 @@ + #define to_clk_system(hw) container_of(hw, struct clk_system, hw) + struct clk_system { + struct clk_hw hw; +- struct at91_pmc *pmc; +- unsigned int irq; +- wait_queue_head_t wait; ++ struct regmap *regmap; + u8 id; + }; + +@@ -39,58 +32,54 @@ static inline int is_pck(int id) + { + return (id >= 8) && (id <= 15); + } +-static irqreturn_t clk_system_irq_handler(int irq, void *dev_id) ++ ++static inline bool clk_system_ready(struct regmap *regmap, int id) + { +- struct clk_system *sys = (struct clk_system *)dev_id; ++ unsigned int status; + +- wake_up(&sys->wait); +- disable_irq_nosync(sys->irq); ++ regmap_read(regmap, AT91_PMC_SR, &status); + +- return IRQ_HANDLED; ++ return status & (1 << id) ? 1 : 0; + } + + static int clk_system_prepare(struct clk_hw *hw) + { + struct clk_system *sys = to_clk_system(hw); +- struct at91_pmc *pmc = sys->pmc; +- u32 mask = 1 << sys->id; + +- pmc_write(pmc, AT91_PMC_SCER, mask); ++ regmap_write(sys->regmap, AT91_PMC_SCER, 1 << sys->id); + + if (!is_pck(sys->id)) + return 0; + +- while (!(pmc_read(pmc, AT91_PMC_SR) & mask)) { +- if (sys->irq) { +- enable_irq(sys->irq); +- wait_event(sys->wait, +- pmc_read(pmc, AT91_PMC_SR) & mask); +- } else +- cpu_relax(); +- } ++ while (!clk_system_ready(sys->regmap, sys->id)) ++ cpu_relax(); ++ + return 0; + } + + static void clk_system_unprepare(struct clk_hw *hw) + { + struct clk_system *sys = to_clk_system(hw); +- struct at91_pmc *pmc = sys->pmc; + +- pmc_write(pmc, AT91_PMC_SCDR, 1 << sys->id); ++ regmap_write(sys->regmap, AT91_PMC_SCDR, 1 << sys->id); + } + + static int clk_system_is_prepared(struct clk_hw *hw) + { + struct clk_system *sys = to_clk_system(hw); +- struct at91_pmc *pmc = sys->pmc; ++ unsigned int status; ++ ++ regmap_read(sys->regmap, AT91_PMC_SCSR, &status); + +- if (!(pmc_read(pmc, AT91_PMC_SCSR) & (1 << sys->id))) ++ if (!(status & (1 << sys->id))) + return 0; + + if (!is_pck(sys->id)) + return 1; + +- return !!(pmc_read(pmc, AT91_PMC_SR) & (1 << sys->id)); ++ regmap_read(sys->regmap, AT91_PMC_SR, &status); ++ ++ return status & (1 << sys->id) ? 1 : 0; + } + + static const struct clk_ops system_ops = { +@@ -100,13 +89,12 @@ static const struct clk_ops system_ops = { + }; + + static struct clk * __init +-at91_clk_register_system(struct at91_pmc *pmc, const char *name, +- const char *parent_name, u8 id, int irq) ++at91_clk_register_system(struct regmap *regmap, const char *name, ++ const char *parent_name, u8 id) + { + struct clk_system *sys; + struct clk *clk = NULL; + struct clk_init_data init; +- int ret; + + if (!parent_name || id > SYSTEM_MAX_ID) + return ERR_PTR(-EINVAL); +@@ -123,44 +111,33 @@ at91_clk_register_system(struct at91_pmc *pmc, const char *name, + + sys->id = id; + sys->hw.init = &init; +- sys->pmc = pmc; +- sys->irq = irq; +- if (irq) { +- init_waitqueue_head(&sys->wait); +- irq_set_status_flags(sys->irq, IRQ_NOAUTOEN); +- ret = request_irq(sys->irq, clk_system_irq_handler, +- IRQF_TRIGGER_HIGH, name, sys); +- if (ret) { +- kfree(sys); +- return ERR_PTR(ret); +- } +- } ++ sys->regmap = regmap; + + clk = clk_register(NULL, &sys->hw); +- if (IS_ERR(clk)) { +- if (irq) +- free_irq(sys->irq, sys); ++ if (IS_ERR(clk)) + kfree(sys); +- } + + return clk; + } + +-static void __init +-of_at91_clk_sys_setup(struct device_node *np, struct at91_pmc *pmc) ++static void __init of_at91rm9200_clk_sys_setup(struct device_node *np) + { + int num; +- int irq = 0; + u32 id; + struct clk *clk; + const char *name; + struct device_node *sysclknp; + const char *parent_name; ++ struct regmap *regmap; + + num = of_get_child_count(np); + if (num > (SYSTEM_MAX_ID + 1)) + return; + ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) ++ return; ++ + for_each_child_of_node(np, sysclknp) { + if (of_property_read_u32(sysclknp, "reg", &id)) + continue; +@@ -168,21 +145,14 @@ of_at91_clk_sys_setup(struct device_node *np, struct at91_pmc *pmc) + if (of_property_read_string(np, "clock-output-names", &name)) + name = sysclknp->name; + +- if (is_pck(id)) +- irq = irq_of_parse_and_map(sysclknp, 0); +- + parent_name = of_clk_get_parent_name(sysclknp, 0); + +- clk = at91_clk_register_system(pmc, name, parent_name, id, irq); ++ clk = at91_clk_register_system(regmap, name, parent_name, id); + if (IS_ERR(clk)) + continue; + + of_clk_add_provider(sysclknp, of_clk_src_simple_get, clk); + } + } +- +-void __init of_at91rm9200_clk_sys_setup(struct device_node *np, +- struct at91_pmc *pmc) +-{ +- of_at91_clk_sys_setup(np, pmc); +-} ++CLK_OF_DECLARE(at91rm9200_clk_sys, "atmel,at91rm9200-clk-system", ++ of_at91rm9200_clk_sys_setup); +diff --git a/drivers/clk/at91/clk-usb.c b/drivers/clk/at91/clk-usb.c +index 8ab8502..650ca45 100644 +--- a/drivers/clk/at91/clk-usb.c ++++ b/drivers/clk/at91/clk-usb.c +@@ -12,8 +12,8 @@ + #include + #include + #include +-#include +-#include ++#include ++#include + + #include "pmc.h" + +@@ -27,7 +27,7 @@ + + struct at91sam9x5_clk_usb { + struct clk_hw hw; +- struct at91_pmc *pmc; ++ struct regmap *regmap; + }; + + #define to_at91sam9x5_clk_usb(hw) \ +@@ -35,7 +35,7 @@ struct at91sam9x5_clk_usb { + + struct at91rm9200_clk_usb { + struct clk_hw hw; +- struct at91_pmc *pmc; ++ struct regmap *regmap; + u32 divisors[4]; + }; + +@@ -45,13 +45,12 @@ struct at91rm9200_clk_usb { + static unsigned long at91sam9x5_clk_usb_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) + { +- u32 tmp; +- u8 usbdiv; + struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); +- struct at91_pmc *pmc = usb->pmc; ++ unsigned int usbr; ++ u8 usbdiv; + +- tmp = pmc_read(pmc, AT91_PMC_USB); +- usbdiv = (tmp & AT91_PMC_OHCIUSBDIV) >> SAM9X5_USB_DIV_SHIFT; ++ regmap_read(usb->regmap, AT91_PMC_USB, &usbr); ++ usbdiv = (usbr & AT91_PMC_OHCIUSBDIV) >> SAM9X5_USB_DIV_SHIFT; + + return DIV_ROUND_CLOSEST(parent_rate, (usbdiv + 1)); + } +@@ -109,33 +108,31 @@ static int at91sam9x5_clk_usb_determine_rate(struct clk_hw *hw, + + static int at91sam9x5_clk_usb_set_parent(struct clk_hw *hw, u8 index) + { +- u32 tmp; + struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); +- struct at91_pmc *pmc = usb->pmc; + + if (index > 1) + return -EINVAL; +- tmp = pmc_read(pmc, AT91_PMC_USB) & ~AT91_PMC_USBS; +- if (index) +- tmp |= AT91_PMC_USBS; +- pmc_write(pmc, AT91_PMC_USB, tmp); ++ ++ regmap_update_bits(usb->regmap, AT91_PMC_USB, AT91_PMC_USBS, ++ index ? AT91_PMC_USBS : 0); ++ + return 0; + } + + static u8 at91sam9x5_clk_usb_get_parent(struct clk_hw *hw) + { + struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); +- struct at91_pmc *pmc = usb->pmc; ++ unsigned int usbr; + +- return pmc_read(pmc, AT91_PMC_USB) & AT91_PMC_USBS; ++ regmap_read(usb->regmap, AT91_PMC_USB, &usbr); ++ ++ return usbr & AT91_PMC_USBS; + } + + static int at91sam9x5_clk_usb_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) + { +- u32 tmp; + struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); +- struct at91_pmc *pmc = usb->pmc; + unsigned long div; + + if (!rate) +@@ -145,9 +142,8 @@ static int at91sam9x5_clk_usb_set_rate(struct clk_hw *hw, unsigned long rate, + if (div > SAM9X5_USB_MAX_DIV + 1 || !div) + return -EINVAL; + +- tmp = pmc_read(pmc, AT91_PMC_USB) & ~AT91_PMC_OHCIUSBDIV; +- tmp |= (div - 1) << SAM9X5_USB_DIV_SHIFT; +- pmc_write(pmc, AT91_PMC_USB, tmp); ++ regmap_update_bits(usb->regmap, AT91_PMC_USB, AT91_PMC_OHCIUSBDIV, ++ (div - 1) << SAM9X5_USB_DIV_SHIFT); + + return 0; + } +@@ -163,28 +159,28 @@ static const struct clk_ops at91sam9x5_usb_ops = { + static int at91sam9n12_clk_usb_enable(struct clk_hw *hw) + { + struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); +- struct at91_pmc *pmc = usb->pmc; + +- pmc_write(pmc, AT91_PMC_USB, +- pmc_read(pmc, AT91_PMC_USB) | AT91_PMC_USBS); ++ regmap_update_bits(usb->regmap, AT91_PMC_USB, AT91_PMC_USBS, ++ AT91_PMC_USBS); ++ + return 0; + } + + static void at91sam9n12_clk_usb_disable(struct clk_hw *hw) + { + struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); +- struct at91_pmc *pmc = usb->pmc; + +- pmc_write(pmc, AT91_PMC_USB, +- pmc_read(pmc, AT91_PMC_USB) & ~AT91_PMC_USBS); ++ regmap_update_bits(usb->regmap, AT91_PMC_USB, AT91_PMC_USBS, 0); + } + + static int at91sam9n12_clk_usb_is_enabled(struct clk_hw *hw) + { + struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw); +- struct at91_pmc *pmc = usb->pmc; ++ unsigned int usbr; + +- return !!(pmc_read(pmc, AT91_PMC_USB) & AT91_PMC_USBS); ++ regmap_read(usb->regmap, AT91_PMC_USB, &usbr); ++ ++ return usbr & AT91_PMC_USBS; + } + + static const struct clk_ops at91sam9n12_usb_ops = { +@@ -197,7 +193,7 @@ static const struct clk_ops at91sam9n12_usb_ops = { + }; + + static struct clk * __init +-at91sam9x5_clk_register_usb(struct at91_pmc *pmc, const char *name, ++at91sam9x5_clk_register_usb(struct regmap *regmap, const char *name, + const char **parent_names, u8 num_parents) + { + struct at91sam9x5_clk_usb *usb; +@@ -216,7 +212,7 @@ at91sam9x5_clk_register_usb(struct at91_pmc *pmc, const char *name, + CLK_SET_RATE_PARENT; + + usb->hw.init = &init; +- usb->pmc = pmc; ++ usb->regmap = regmap; + + clk = clk_register(NULL, &usb->hw); + if (IS_ERR(clk)) +@@ -226,7 +222,7 @@ at91sam9x5_clk_register_usb(struct at91_pmc *pmc, const char *name, + } + + static struct clk * __init +-at91sam9n12_clk_register_usb(struct at91_pmc *pmc, const char *name, ++at91sam9n12_clk_register_usb(struct regmap *regmap, const char *name, + const char *parent_name) + { + struct at91sam9x5_clk_usb *usb; +@@ -244,7 +240,7 @@ at91sam9n12_clk_register_usb(struct at91_pmc *pmc, const char *name, + init.flags = CLK_SET_RATE_GATE | CLK_SET_RATE_PARENT; + + usb->hw.init = &init; +- usb->pmc = pmc; ++ usb->regmap = regmap; + + clk = clk_register(NULL, &usb->hw); + if (IS_ERR(clk)) +@@ -257,12 +253,12 @@ static unsigned long at91rm9200_clk_usb_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) + { + struct at91rm9200_clk_usb *usb = to_at91rm9200_clk_usb(hw); +- struct at91_pmc *pmc = usb->pmc; +- u32 tmp; ++ unsigned int pllbr; + u8 usbdiv; + +- tmp = pmc_read(pmc, AT91_CKGR_PLLBR); +- usbdiv = (tmp & AT91_PMC_USBDIV) >> RM9200_USB_DIV_SHIFT; ++ regmap_read(usb->regmap, AT91_CKGR_PLLBR, &pllbr); ++ ++ usbdiv = (pllbr & AT91_PMC_USBDIV) >> RM9200_USB_DIV_SHIFT; + if (usb->divisors[usbdiv]) + return parent_rate / usb->divisors[usbdiv]; + +@@ -310,10 +306,8 @@ static long at91rm9200_clk_usb_round_rate(struct clk_hw *hw, unsigned long rate, + static int at91rm9200_clk_usb_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) + { +- u32 tmp; + int i; + struct at91rm9200_clk_usb *usb = to_at91rm9200_clk_usb(hw); +- struct at91_pmc *pmc = usb->pmc; + unsigned long div; + + if (!rate) +@@ -323,10 +317,10 @@ static int at91rm9200_clk_usb_set_rate(struct clk_hw *hw, unsigned long rate, + + for (i = 0; i < RM9200_USB_DIV_TAB_SIZE; i++) { + if (usb->divisors[i] == div) { +- tmp = pmc_read(pmc, AT91_CKGR_PLLBR) & +- ~AT91_PMC_USBDIV; +- tmp |= i << RM9200_USB_DIV_SHIFT; +- pmc_write(pmc, AT91_CKGR_PLLBR, tmp); ++ regmap_update_bits(usb->regmap, AT91_CKGR_PLLBR, ++ AT91_PMC_USBDIV, ++ i << RM9200_USB_DIV_SHIFT); ++ + return 0; + } + } +@@ -341,7 +335,7 @@ static const struct clk_ops at91rm9200_usb_ops = { + }; + + static struct clk * __init +-at91rm9200_clk_register_usb(struct at91_pmc *pmc, const char *name, ++at91rm9200_clk_register_usb(struct regmap *regmap, const char *name, + const char *parent_name, const u32 *divisors) + { + struct at91rm9200_clk_usb *usb; +@@ -359,7 +353,7 @@ at91rm9200_clk_register_usb(struct at91_pmc *pmc, const char *name, + init.flags = CLK_SET_RATE_PARENT; + + usb->hw.init = &init; +- usb->pmc = pmc; ++ usb->regmap = regmap; + memcpy(usb->divisors, divisors, sizeof(usb->divisors)); + + clk = clk_register(NULL, &usb->hw); +@@ -369,13 +363,13 @@ at91rm9200_clk_register_usb(struct at91_pmc *pmc, const char *name, + return clk; + } + +-void __init of_at91sam9x5_clk_usb_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91sam9x5_clk_usb_setup(struct device_node *np) + { + struct clk *clk; + int num_parents; + const char *parent_names[USB_SOURCE_MAX]; + const char *name = np->name; ++ struct regmap *regmap; + + num_parents = of_clk_get_parent_count(np); + if (num_parents <= 0 || num_parents > USB_SOURCE_MAX) +@@ -385,19 +379,26 @@ void __init of_at91sam9x5_clk_usb_setup(struct device_node *np, + + of_property_read_string(np, "clock-output-names", &name); + +- clk = at91sam9x5_clk_register_usb(pmc, name, parent_names, num_parents); ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) ++ return; ++ ++ clk = at91sam9x5_clk_register_usb(regmap, name, parent_names, ++ num_parents); + if (IS_ERR(clk)) + return; + + of_clk_add_provider(np, of_clk_src_simple_get, clk); + } ++CLK_OF_DECLARE(at91sam9x5_clk_usb, "atmel,at91sam9x5-clk-usb", ++ of_at91sam9x5_clk_usb_setup); + +-void __init of_at91sam9n12_clk_usb_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91sam9n12_clk_usb_setup(struct device_node *np) + { + struct clk *clk; + const char *parent_name; + const char *name = np->name; ++ struct regmap *regmap; + + parent_name = of_clk_get_parent_name(np, 0); + if (!parent_name) +@@ -405,20 +406,26 @@ void __init of_at91sam9n12_clk_usb_setup(struct device_node *np, + + of_property_read_string(np, "clock-output-names", &name); + +- clk = at91sam9n12_clk_register_usb(pmc, name, parent_name); ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) ++ return; ++ ++ clk = at91sam9n12_clk_register_usb(regmap, name, parent_name); + if (IS_ERR(clk)) + return; + + of_clk_add_provider(np, of_clk_src_simple_get, clk); + } ++CLK_OF_DECLARE(at91sam9n12_clk_usb, "atmel,at91sam9n12-clk-usb", ++ of_at91sam9n12_clk_usb_setup); + +-void __init of_at91rm9200_clk_usb_setup(struct device_node *np, +- struct at91_pmc *pmc) ++static void __init of_at91rm9200_clk_usb_setup(struct device_node *np) + { + struct clk *clk; + const char *parent_name; + const char *name = np->name; + u32 divisors[4] = {0, 0, 0, 0}; ++ struct regmap *regmap; + + parent_name = of_clk_get_parent_name(np, 0); + if (!parent_name) +@@ -430,9 +437,15 @@ void __init of_at91rm9200_clk_usb_setup(struct device_node *np, + + of_property_read_string(np, "clock-output-names", &name); + +- clk = at91rm9200_clk_register_usb(pmc, name, parent_name, divisors); ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) ++ return; ++ ++ clk = at91rm9200_clk_register_usb(regmap, name, parent_name, divisors); + if (IS_ERR(clk)) + return; + + of_clk_add_provider(np, of_clk_src_simple_get, clk); + } ++CLK_OF_DECLARE(at91rm9200_clk_usb, "atmel,at91rm9200-clk-usb", ++ of_at91rm9200_clk_usb_setup); +diff --git a/drivers/clk/at91/clk-utmi.c b/drivers/clk/at91/clk-utmi.c +index ca561e9..61fcf39 100644 +--- a/drivers/clk/at91/clk-utmi.c ++++ b/drivers/clk/at91/clk-utmi.c +@@ -11,14 +11,9 @@ + #include + #include + #include +-#include +-#include + #include +-#include +-#include +-#include +-#include +-#include ++#include ++#include + + #include "pmc.h" + +@@ -26,37 +21,30 @@ + + struct clk_utmi { + struct clk_hw hw; +- struct at91_pmc *pmc; +- unsigned int irq; +- wait_queue_head_t wait; ++ struct regmap *regmap; + }; + + #define to_clk_utmi(hw) container_of(hw, struct clk_utmi, hw) + +-static irqreturn_t clk_utmi_irq_handler(int irq, void *dev_id) ++static inline bool clk_utmi_ready(struct regmap *regmap) + { +- struct clk_utmi *utmi = (struct clk_utmi *)dev_id; ++ unsigned int status; + +- wake_up(&utmi->wait); +- disable_irq_nosync(utmi->irq); ++ regmap_read(regmap, AT91_PMC_SR, &status); + +- return IRQ_HANDLED; ++ return status & AT91_PMC_LOCKU; + } + + static int clk_utmi_prepare(struct clk_hw *hw) + { + struct clk_utmi *utmi = to_clk_utmi(hw); +- struct at91_pmc *pmc = utmi->pmc; +- u32 tmp = pmc_read(pmc, AT91_CKGR_UCKR) | AT91_PMC_UPLLEN | +- AT91_PMC_UPLLCOUNT | AT91_PMC_BIASEN; ++ unsigned int uckr = AT91_PMC_UPLLEN | AT91_PMC_UPLLCOUNT | ++ AT91_PMC_BIASEN; + +- pmc_write(pmc, AT91_CKGR_UCKR, tmp); ++ regmap_update_bits(utmi->regmap, AT91_CKGR_UCKR, uckr, uckr); + +- while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_LOCKU)) { +- enable_irq(utmi->irq); +- wait_event(utmi->wait, +- pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_LOCKU); +- } ++ while (!clk_utmi_ready(utmi->regmap)) ++ cpu_relax(); + + return 0; + } +@@ -64,18 +52,15 @@ static int clk_utmi_prepare(struct clk_hw *hw) + static int clk_utmi_is_prepared(struct clk_hw *hw) + { + struct clk_utmi *utmi = to_clk_utmi(hw); +- struct at91_pmc *pmc = utmi->pmc; + +- return !!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_LOCKU); ++ return clk_utmi_ready(utmi->regmap); + } + + static void clk_utmi_unprepare(struct clk_hw *hw) + { + struct clk_utmi *utmi = to_clk_utmi(hw); +- struct at91_pmc *pmc = utmi->pmc; +- u32 tmp = pmc_read(pmc, AT91_CKGR_UCKR) & ~AT91_PMC_UPLLEN; + +- pmc_write(pmc, AT91_CKGR_UCKR, tmp); ++ regmap_update_bits(utmi->regmap, AT91_CKGR_UCKR, AT91_PMC_UPLLEN, 0); + } + + static unsigned long clk_utmi_recalc_rate(struct clk_hw *hw, +@@ -93,10 +78,9 @@ static const struct clk_ops utmi_ops = { + }; + + static struct clk * __init +-at91_clk_register_utmi(struct at91_pmc *pmc, unsigned int irq, ++at91_clk_register_utmi(struct regmap *regmap, + const char *name, const char *parent_name) + { +- int ret; + struct clk_utmi *utmi; + struct clk *clk = NULL; + struct clk_init_data init; +@@ -112,52 +96,36 @@ at91_clk_register_utmi(struct at91_pmc *pmc, unsigned int irq, + init.flags = CLK_SET_RATE_GATE; + + utmi->hw.init = &init; +- utmi->pmc = pmc; +- utmi->irq = irq; +- init_waitqueue_head(&utmi->wait); +- irq_set_status_flags(utmi->irq, IRQ_NOAUTOEN); +- ret = request_irq(utmi->irq, clk_utmi_irq_handler, +- IRQF_TRIGGER_HIGH, "clk-utmi", utmi); +- if (ret) { +- kfree(utmi); +- return ERR_PTR(ret); +- } ++ utmi->regmap = regmap; + + clk = clk_register(NULL, &utmi->hw); +- if (IS_ERR(clk)) { +- free_irq(utmi->irq, utmi); ++ if (IS_ERR(clk)) + kfree(utmi); +- } + + return clk; + } + +-static void __init +-of_at91_clk_utmi_setup(struct device_node *np, struct at91_pmc *pmc) ++static void __init of_at91sam9x5_clk_utmi_setup(struct device_node *np) + { +- unsigned int irq; + struct clk *clk; + const char *parent_name; + const char *name = np->name; ++ struct regmap *regmap; + + parent_name = of_clk_get_parent_name(np, 0); + + of_property_read_string(np, "clock-output-names", &name); + +- irq = irq_of_parse_and_map(np, 0); +- if (!irq) ++ regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(regmap)) + return; + +- clk = at91_clk_register_utmi(pmc, irq, name, parent_name); ++ clk = at91_clk_register_utmi(regmap, name, parent_name); + if (IS_ERR(clk)) + return; + + of_clk_add_provider(np, of_clk_src_simple_get, clk); + return; + } +- +-void __init of_at91sam9x5_clk_utmi_setup(struct device_node *np, +- struct at91_pmc *pmc) +-{ +- of_at91_clk_utmi_setup(np, pmc); +-} ++CLK_OF_DECLARE(at91sam9x5_clk_utmi, "atmel,at91sam9x5-clk-utmi", ++ of_at91sam9x5_clk_utmi_setup); +diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c +index 8476b57..526df5b 100644 +--- a/drivers/clk/at91/pmc.c ++++ b/drivers/clk/at91/pmc.c +@@ -12,36 +12,13 @@ + #include + #include + #include +-#include +-#include +-#include +-#include +-#include +-#include +-#include ++#include ++#include + + #include + + #include "pmc.h" + +-void __iomem *at91_pmc_base; +-EXPORT_SYMBOL_GPL(at91_pmc_base); +- +-void at91rm9200_idle(void) +-{ +- /* +- * Disable the processor clock. The processor will be automatically +- * re-enabled by an interrupt or by a reset. +- */ +- at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK); +-} +- +-void at91sam9_idle(void) +-{ +- at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK); +- cpu_do_idle(); +-} +- + int of_at91_get_clk_range(struct device_node *np, const char *propname, + struct clk_range *range) + { +@@ -64,402 +41,3 @@ int of_at91_get_clk_range(struct device_node *np, const char *propname, + return 0; + } + EXPORT_SYMBOL_GPL(of_at91_get_clk_range); +- +-static void pmc_irq_mask(struct irq_data *d) +-{ +- struct at91_pmc *pmc = irq_data_get_irq_chip_data(d); +- +- pmc_write(pmc, AT91_PMC_IDR, 1 << d->hwirq); +-} +- +-static void pmc_irq_unmask(struct irq_data *d) +-{ +- struct at91_pmc *pmc = irq_data_get_irq_chip_data(d); +- +- pmc_write(pmc, AT91_PMC_IER, 1 << d->hwirq); +-} +- +-static int pmc_irq_set_type(struct irq_data *d, unsigned type) +-{ +- if (type != IRQ_TYPE_LEVEL_HIGH) { +- pr_warn("PMC: type not supported (support only IRQ_TYPE_LEVEL_HIGH type)\n"); +- return -EINVAL; +- } +- +- return 0; +-} +- +-static void pmc_irq_suspend(struct irq_data *d) +-{ +- struct at91_pmc *pmc = irq_data_get_irq_chip_data(d); +- +- pmc->imr = pmc_read(pmc, AT91_PMC_IMR); +- pmc_write(pmc, AT91_PMC_IDR, pmc->imr); +-} +- +-static void pmc_irq_resume(struct irq_data *d) +-{ +- struct at91_pmc *pmc = irq_data_get_irq_chip_data(d); +- +- pmc_write(pmc, AT91_PMC_IER, pmc->imr); +-} +- +-static struct irq_chip pmc_irq = { +- .name = "PMC", +- .irq_disable = pmc_irq_mask, +- .irq_mask = pmc_irq_mask, +- .irq_unmask = pmc_irq_unmask, +- .irq_set_type = pmc_irq_set_type, +- .irq_suspend = pmc_irq_suspend, +- .irq_resume = pmc_irq_resume, +-}; +- +-static struct lock_class_key pmc_lock_class; +- +-static int pmc_irq_map(struct irq_domain *h, unsigned int virq, +- irq_hw_number_t hw) +-{ +- struct at91_pmc *pmc = h->host_data; +- +- irq_set_lockdep_class(virq, &pmc_lock_class); +- +- irq_set_chip_and_handler(virq, &pmc_irq, +- handle_level_irq); +- irq_set_chip_data(virq, pmc); +- +- return 0; +-} +- +-static int pmc_irq_domain_xlate(struct irq_domain *d, +- struct device_node *ctrlr, +- const u32 *intspec, unsigned int intsize, +- irq_hw_number_t *out_hwirq, +- unsigned int *out_type) +-{ +- struct at91_pmc *pmc = d->host_data; +- const struct at91_pmc_caps *caps = pmc->caps; +- +- if (WARN_ON(intsize < 1)) +- return -EINVAL; +- +- *out_hwirq = intspec[0]; +- +- if (!(caps->available_irqs & (1 << *out_hwirq))) +- return -EINVAL; +- +- *out_type = IRQ_TYPE_LEVEL_HIGH; +- +- return 0; +-} +- +-static const struct irq_domain_ops pmc_irq_ops = { +- .map = pmc_irq_map, +- .xlate = pmc_irq_domain_xlate, +-}; +- +-static irqreturn_t pmc_irq_handler(int irq, void *data) +-{ +- struct at91_pmc *pmc = (struct at91_pmc *)data; +- unsigned long sr; +- int n; +- +- sr = pmc_read(pmc, AT91_PMC_SR) & pmc_read(pmc, AT91_PMC_IMR); +- if (!sr) +- return IRQ_NONE; +- +- for_each_set_bit(n, &sr, BITS_PER_LONG) +- generic_handle_irq(irq_find_mapping(pmc->irqdomain, n)); +- +- return IRQ_HANDLED; +-} +- +-static const struct at91_pmc_caps at91rm9200_caps = { +- .available_irqs = AT91_PMC_MOSCS | AT91_PMC_LOCKA | AT91_PMC_LOCKB | +- AT91_PMC_MCKRDY | AT91_PMC_PCK0RDY | +- AT91_PMC_PCK1RDY | AT91_PMC_PCK2RDY | +- AT91_PMC_PCK3RDY, +-}; +- +-static const struct at91_pmc_caps at91sam9260_caps = { +- .available_irqs = AT91_PMC_MOSCS | AT91_PMC_LOCKA | AT91_PMC_LOCKB | +- AT91_PMC_MCKRDY | AT91_PMC_PCK0RDY | +- AT91_PMC_PCK1RDY, +-}; +- +-static const struct at91_pmc_caps at91sam9g45_caps = { +- .available_irqs = AT91_PMC_MOSCS | AT91_PMC_LOCKA | AT91_PMC_MCKRDY | +- AT91_PMC_LOCKU | AT91_PMC_PCK0RDY | +- AT91_PMC_PCK1RDY, +-}; +- +-static const struct at91_pmc_caps at91sam9n12_caps = { +- .available_irqs = AT91_PMC_MOSCS | AT91_PMC_LOCKA | AT91_PMC_LOCKB | +- AT91_PMC_MCKRDY | AT91_PMC_PCK0RDY | +- AT91_PMC_PCK1RDY | AT91_PMC_MOSCSELS | +- AT91_PMC_MOSCRCS | AT91_PMC_CFDEV, +-}; +- +-static const struct at91_pmc_caps at91sam9x5_caps = { +- .available_irqs = AT91_PMC_MOSCS | AT91_PMC_LOCKA | AT91_PMC_MCKRDY | +- AT91_PMC_LOCKU | AT91_PMC_PCK0RDY | +- AT91_PMC_PCK1RDY | AT91_PMC_MOSCSELS | +- AT91_PMC_MOSCRCS | AT91_PMC_CFDEV, +-}; +- +-static const struct at91_pmc_caps sama5d2_caps = { +- .available_irqs = AT91_PMC_MOSCS | AT91_PMC_LOCKA | AT91_PMC_MCKRDY | +- AT91_PMC_LOCKU | AT91_PMC_PCK0RDY | +- AT91_PMC_PCK1RDY | AT91_PMC_PCK2RDY | +- AT91_PMC_MOSCSELS | AT91_PMC_MOSCRCS | +- AT91_PMC_CFDEV | AT91_PMC_GCKRDY, +-}; +- +-static const struct at91_pmc_caps sama5d3_caps = { +- .available_irqs = AT91_PMC_MOSCS | AT91_PMC_LOCKA | AT91_PMC_MCKRDY | +- AT91_PMC_LOCKU | AT91_PMC_PCK0RDY | +- AT91_PMC_PCK1RDY | AT91_PMC_PCK2RDY | +- AT91_PMC_MOSCSELS | AT91_PMC_MOSCRCS | +- AT91_PMC_CFDEV, +-}; +- +-static struct at91_pmc *__init at91_pmc_init(struct device_node *np, +- void __iomem *regbase, int virq, +- const struct at91_pmc_caps *caps) +-{ +- struct at91_pmc *pmc; +- +- if (!regbase || !virq || !caps) +- return NULL; +- +- at91_pmc_base = regbase; +- +- pmc = kzalloc(sizeof(*pmc), GFP_KERNEL); +- if (!pmc) +- return NULL; +- +- spin_lock_init(&pmc->lock); +- pmc->regbase = regbase; +- pmc->virq = virq; +- pmc->caps = caps; +- +- pmc->irqdomain = irq_domain_add_linear(np, 32, &pmc_irq_ops, pmc); +- +- if (!pmc->irqdomain) +- goto out_free_pmc; +- +- pmc_write(pmc, AT91_PMC_IDR, 0xffffffff); +- if (request_irq(pmc->virq, pmc_irq_handler, +- IRQF_SHARED | IRQF_COND_SUSPEND, "pmc", pmc)) +- goto out_remove_irqdomain; +- +- return pmc; +- +-out_remove_irqdomain: +- irq_domain_remove(pmc->irqdomain); +-out_free_pmc: +- kfree(pmc); +- +- return NULL; +-} +- +-static const struct of_device_id pmc_clk_ids[] __initconst = { +- /* Slow oscillator */ +- { +- .compatible = "atmel,at91sam9260-clk-slow", +- .data = of_at91sam9260_clk_slow_setup, +- }, +- /* Main clock */ +- { +- .compatible = "atmel,at91rm9200-clk-main-osc", +- .data = of_at91rm9200_clk_main_osc_setup, +- }, +- { +- .compatible = "atmel,at91sam9x5-clk-main-rc-osc", +- .data = of_at91sam9x5_clk_main_rc_osc_setup, +- }, +- { +- .compatible = "atmel,at91rm9200-clk-main", +- .data = of_at91rm9200_clk_main_setup, +- }, +- { +- .compatible = "atmel,at91sam9x5-clk-main", +- .data = of_at91sam9x5_clk_main_setup, +- }, +- /* PLL clocks */ +- { +- .compatible = "atmel,at91rm9200-clk-pll", +- .data = of_at91rm9200_clk_pll_setup, +- }, +- { +- .compatible = "atmel,at91sam9g45-clk-pll", +- .data = of_at91sam9g45_clk_pll_setup, +- }, +- { +- .compatible = "atmel,at91sam9g20-clk-pllb", +- .data = of_at91sam9g20_clk_pllb_setup, +- }, +- { +- .compatible = "atmel,sama5d3-clk-pll", +- .data = of_sama5d3_clk_pll_setup, +- }, +- { +- .compatible = "atmel,at91sam9x5-clk-plldiv", +- .data = of_at91sam9x5_clk_plldiv_setup, +- }, +- /* Master clock */ +- { +- .compatible = "atmel,at91rm9200-clk-master", +- .data = of_at91rm9200_clk_master_setup, +- }, +- { +- .compatible = "atmel,at91sam9x5-clk-master", +- .data = of_at91sam9x5_clk_master_setup, +- }, +- /* System clocks */ +- { +- .compatible = "atmel,at91rm9200-clk-system", +- .data = of_at91rm9200_clk_sys_setup, +- }, +- /* Peripheral clocks */ +- { +- .compatible = "atmel,at91rm9200-clk-peripheral", +- .data = of_at91rm9200_clk_periph_setup, +- }, +- { +- .compatible = "atmel,at91sam9x5-clk-peripheral", +- .data = of_at91sam9x5_clk_periph_setup, +- }, +- /* Programmable clocks */ +- { +- .compatible = "atmel,at91rm9200-clk-programmable", +- .data = of_at91rm9200_clk_prog_setup, +- }, +- { +- .compatible = "atmel,at91sam9g45-clk-programmable", +- .data = of_at91sam9g45_clk_prog_setup, +- }, +- { +- .compatible = "atmel,at91sam9x5-clk-programmable", +- .data = of_at91sam9x5_clk_prog_setup, +- }, +- /* UTMI clock */ +-#if defined(CONFIG_HAVE_AT91_UTMI) +- { +- .compatible = "atmel,at91sam9x5-clk-utmi", +- .data = of_at91sam9x5_clk_utmi_setup, +- }, +-#endif +- /* USB clock */ +-#if defined(CONFIG_HAVE_AT91_USB_CLK) +- { +- .compatible = "atmel,at91rm9200-clk-usb", +- .data = of_at91rm9200_clk_usb_setup, +- }, +- { +- .compatible = "atmel,at91sam9x5-clk-usb", +- .data = of_at91sam9x5_clk_usb_setup, +- }, +- { +- .compatible = "atmel,at91sam9n12-clk-usb", +- .data = of_at91sam9n12_clk_usb_setup, +- }, +-#endif +- /* SMD clock */ +-#if defined(CONFIG_HAVE_AT91_SMD) +- { +- .compatible = "atmel,at91sam9x5-clk-smd", +- .data = of_at91sam9x5_clk_smd_setup, +- }, +-#endif +-#if defined(CONFIG_HAVE_AT91_H32MX) +- { +- .compatible = "atmel,sama5d4-clk-h32mx", +- .data = of_sama5d4_clk_h32mx_setup, +- }, +-#endif +-#if defined(CONFIG_HAVE_AT91_GENERATED_CLK) +- { +- .compatible = "atmel,sama5d2-clk-generated", +- .data = of_sama5d2_clk_generated_setup, +- }, +-#endif +- { /*sentinel*/ } +-}; +- +-static void __init of_at91_pmc_setup(struct device_node *np, +- const struct at91_pmc_caps *caps) +-{ +- struct at91_pmc *pmc; +- struct device_node *childnp; +- void (*clk_setup)(struct device_node *, struct at91_pmc *); +- const struct of_device_id *clk_id; +- void __iomem *regbase = of_iomap(np, 0); +- int virq; +- +- if (!regbase) +- return; +- +- virq = irq_of_parse_and_map(np, 0); +- if (!virq) +- return; +- +- pmc = at91_pmc_init(np, regbase, virq, caps); +- if (!pmc) +- return; +- for_each_child_of_node(np, childnp) { +- clk_id = of_match_node(pmc_clk_ids, childnp); +- if (!clk_id) +- continue; +- clk_setup = clk_id->data; +- clk_setup(childnp, pmc); +- } +-} +- +-static void __init of_at91rm9200_pmc_setup(struct device_node *np) +-{ +- of_at91_pmc_setup(np, &at91rm9200_caps); +-} +-CLK_OF_DECLARE(at91rm9200_clk_pmc, "atmel,at91rm9200-pmc", +- of_at91rm9200_pmc_setup); +- +-static void __init of_at91sam9260_pmc_setup(struct device_node *np) +-{ +- of_at91_pmc_setup(np, &at91sam9260_caps); +-} +-CLK_OF_DECLARE(at91sam9260_clk_pmc, "atmel,at91sam9260-pmc", +- of_at91sam9260_pmc_setup); +- +-static void __init of_at91sam9g45_pmc_setup(struct device_node *np) +-{ +- of_at91_pmc_setup(np, &at91sam9g45_caps); +-} +-CLK_OF_DECLARE(at91sam9g45_clk_pmc, "atmel,at91sam9g45-pmc", +- of_at91sam9g45_pmc_setup); +- +-static void __init of_at91sam9n12_pmc_setup(struct device_node *np) +-{ +- of_at91_pmc_setup(np, &at91sam9n12_caps); +-} +-CLK_OF_DECLARE(at91sam9n12_clk_pmc, "atmel,at91sam9n12-pmc", +- of_at91sam9n12_pmc_setup); +- +-static void __init of_at91sam9x5_pmc_setup(struct device_node *np) +-{ +- of_at91_pmc_setup(np, &at91sam9x5_caps); +-} +-CLK_OF_DECLARE(at91sam9x5_clk_pmc, "atmel,at91sam9x5-pmc", +- of_at91sam9x5_pmc_setup); +- +-static void __init of_sama5d2_pmc_setup(struct device_node *np) +-{ +- of_at91_pmc_setup(np, &sama5d2_caps); +-} +-CLK_OF_DECLARE(sama5d2_clk_pmc, "atmel,sama5d2-pmc", +- of_sama5d2_pmc_setup); +- +-static void __init of_sama5d3_pmc_setup(struct device_node *np) +-{ +- of_at91_pmc_setup(np, &sama5d3_caps); +-} +-CLK_OF_DECLARE(sama5d3_clk_pmc, "atmel,sama5d3-pmc", +- of_sama5d3_pmc_setup); +diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h +index f657392..5771fff 100644 +--- a/drivers/clk/at91/pmc.h ++++ b/drivers/clk/at91/pmc.h +@@ -14,8 +14,11 @@ + + #include + #include ++#include + #include + ++extern spinlock_t pmc_pcr_lock; ++ + struct clk_range { + unsigned long min; + unsigned long max; +@@ -23,102 +26,7 @@ struct clk_range { + + #define CLK_RANGE(MIN, MAX) {.min = MIN, .max = MAX,} + +-struct at91_pmc_caps { +- u32 available_irqs; +-}; +- +-struct at91_pmc { +- void __iomem *regbase; +- int virq; +- spinlock_t lock; +- const struct at91_pmc_caps *caps; +- struct irq_domain *irqdomain; +- u32 imr; +-}; +- +-static inline void pmc_lock(struct at91_pmc *pmc) +-{ +- spin_lock(&pmc->lock); +-} +- +-static inline void pmc_unlock(struct at91_pmc *pmc) +-{ +- spin_unlock(&pmc->lock); +-} +- +-static inline u32 pmc_read(struct at91_pmc *pmc, int offset) +-{ +- return readl(pmc->regbase + offset); +-} +- +-static inline void pmc_write(struct at91_pmc *pmc, int offset, u32 value) +-{ +- writel(value, pmc->regbase + offset); +-} +- + int of_at91_get_clk_range(struct device_node *np, const char *propname, + struct clk_range *range); + +-void of_at91sam9260_clk_slow_setup(struct device_node *np, +- struct at91_pmc *pmc); +- +-void of_at91rm9200_clk_main_osc_setup(struct device_node *np, +- struct at91_pmc *pmc); +-void of_at91sam9x5_clk_main_rc_osc_setup(struct device_node *np, +- struct at91_pmc *pmc); +-void of_at91rm9200_clk_main_setup(struct device_node *np, +- struct at91_pmc *pmc); +-void of_at91sam9x5_clk_main_setup(struct device_node *np, +- struct at91_pmc *pmc); +- +-void of_at91rm9200_clk_pll_setup(struct device_node *np, +- struct at91_pmc *pmc); +-void of_at91sam9g45_clk_pll_setup(struct device_node *np, +- struct at91_pmc *pmc); +-void of_at91sam9g20_clk_pllb_setup(struct device_node *np, +- struct at91_pmc *pmc); +-void of_sama5d3_clk_pll_setup(struct device_node *np, +- struct at91_pmc *pmc); +-void of_at91sam9x5_clk_plldiv_setup(struct device_node *np, +- struct at91_pmc *pmc); +- +-void of_at91rm9200_clk_master_setup(struct device_node *np, +- struct at91_pmc *pmc); +-void of_at91sam9x5_clk_master_setup(struct device_node *np, +- struct at91_pmc *pmc); +- +-void of_at91rm9200_clk_sys_setup(struct device_node *np, +- struct at91_pmc *pmc); +- +-void of_at91rm9200_clk_periph_setup(struct device_node *np, +- struct at91_pmc *pmc); +-void of_at91sam9x5_clk_periph_setup(struct device_node *np, +- struct at91_pmc *pmc); +- +-void of_at91rm9200_clk_prog_setup(struct device_node *np, +- struct at91_pmc *pmc); +-void of_at91sam9g45_clk_prog_setup(struct device_node *np, +- struct at91_pmc *pmc); +-void of_at91sam9x5_clk_prog_setup(struct device_node *np, +- struct at91_pmc *pmc); +- +-void of_at91sam9x5_clk_utmi_setup(struct device_node *np, +- struct at91_pmc *pmc); +- +-void of_at91rm9200_clk_usb_setup(struct device_node *np, +- struct at91_pmc *pmc); +-void of_at91sam9x5_clk_usb_setup(struct device_node *np, +- struct at91_pmc *pmc); +-void of_at91sam9n12_clk_usb_setup(struct device_node *np, +- struct at91_pmc *pmc); +- +-void of_at91sam9x5_clk_smd_setup(struct device_node *np, +- struct at91_pmc *pmc); +- +-void of_sama5d4_clk_h32mx_setup(struct device_node *np, +- struct at91_pmc *pmc); +- +-void of_sama5d2_clk_generated_setup(struct device_node *np, +- struct at91_pmc *pmc); +- + #endif /* __PMC_H_ */ +diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c +index 7524941..5b6f57f 100644 +--- a/drivers/clocksource/tcb_clksrc.c ++++ b/drivers/clocksource/tcb_clksrc.c +@@ -73,6 +73,7 @@ static struct clocksource clksrc = { + struct tc_clkevt_device { + struct clock_event_device clkevt; + struct clk *clk; ++ bool clk_enabled; + u32 freq; + void __iomem *regs; + }; +@@ -84,6 +85,24 @@ static struct tc_clkevt_device *to_tc_clkevt(struct clock_event_device *clkevt) + + static u32 timer_clock; + ++static void tc_clk_disable(struct clock_event_device *d) ++{ ++ struct tc_clkevt_device *tcd = to_tc_clkevt(d); ++ ++ clk_disable(tcd->clk); ++ tcd->clk_enabled = false; ++} ++ ++static void tc_clk_enable(struct clock_event_device *d) ++{ ++ struct tc_clkevt_device *tcd = to_tc_clkevt(d); ++ ++ if (tcd->clk_enabled) ++ return; ++ clk_enable(tcd->clk); ++ tcd->clk_enabled = true; ++} ++ + static int tc_shutdown(struct clock_event_device *d) + { + struct tc_clkevt_device *tcd = to_tc_clkevt(d); +@@ -91,8 +110,14 @@ static int tc_shutdown(struct clock_event_device *d) + + __raw_writel(0xff, regs + ATMEL_TC_REG(2, IDR)); + __raw_writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR)); ++ return 0; ++} ++ ++static int tc_shutdown_clk_off(struct clock_event_device *d) ++{ ++ tc_shutdown(d); + if (!clockevent_state_detached(d)) +- clk_disable(tcd->clk); ++ tc_clk_disable(d); + + return 0; + } +@@ -105,7 +130,7 @@ static int tc_set_oneshot(struct clock_event_device *d) + if (clockevent_state_oneshot(d) || clockevent_state_periodic(d)) + tc_shutdown(d); + +- clk_enable(tcd->clk); ++ tc_clk_enable(d); + + /* count up to RC, then irq and stop */ + __raw_writel(timer_clock | ATMEL_TC_CPCSTOP | ATMEL_TC_WAVE | +@@ -127,7 +152,7 @@ static int tc_set_periodic(struct clock_event_device *d) + /* By not making the gentime core emulate periodic mode on top + * of oneshot, we get lower overhead and improved accuracy. + */ +- clk_enable(tcd->clk); ++ tc_clk_enable(d); + + /* count up to RC, then irq and restart */ + __raw_writel(timer_clock | ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO, +@@ -165,7 +190,7 @@ static struct tc_clkevt_device clkevt = { + .rating = 200, + #endif + .set_next_event = tc_next_event, +- .set_state_shutdown = tc_shutdown, ++ .set_state_shutdown = tc_shutdown_clk_off, + .set_state_periodic = tc_set_periodic, + .set_state_oneshot = tc_set_oneshot, + }, +diff --git a/drivers/clocksource/timer-atmel-pit.c b/drivers/clocksource/timer-atmel-pit.c +index a7abdb6..7a40f7e 100644 +--- a/drivers/clocksource/timer-atmel-pit.c ++++ b/drivers/clocksource/timer-atmel-pit.c +@@ -46,6 +46,7 @@ struct pit_data { + u32 cycle; + u32 cnt; + unsigned int irq; ++ bool irq_requested; + struct clk *mck; + }; + +@@ -96,7 +97,10 @@ static int pit_clkevt_shutdown(struct clock_event_device *dev) + + /* disable irq, leaving the clocksource active */ + pit_write(data->base, AT91_PIT_MR, (data->cycle - 1) | AT91_PIT_PITEN); +- free_irq(data->irq, data); ++ if (data->irq_requested) { ++ free_irq(data->irq, data); ++ data->irq_requested = false; ++ } + return 0; + } + +@@ -115,6 +119,8 @@ static int pit_clkevt_set_periodic(struct clock_event_device *dev) + if (ret) + panic(pr_fmt("Unable to setup IRQ\n")); + ++ data->irq_requested = true; ++ + /* update clocksource counter */ + data->cnt += data->cycle * PIT_PICNT(pit_read(data->base, AT91_PIT_PIVR)); + pit_write(data->base, AT91_PIT_MR, +diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c +index 0f42a27..80a1db0 100644 +--- a/drivers/gpu/drm/i915/i915_irq.c ++++ b/drivers/gpu/drm/i915/i915_irq.c +@@ -812,6 +812,7 @@ static int i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, + spin_lock_irqsave(&dev_priv->uncore.lock, irqflags); + + /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ ++ preempt_disable_rt(); + + /* Get optional system timestamp before query. */ + if (stime) +@@ -863,6 +864,7 @@ static int i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, + *etime = ktime_get(); + + /* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */ ++ preempt_enable_rt(); + + spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags); + +diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c +index 56dc132..8771d66 100644 +--- a/drivers/gpu/drm/i915/intel_sprite.c ++++ b/drivers/gpu/drm/i915/intel_sprite.c +@@ -38,6 +38,7 @@ + #include "intel_drv.h" + #include + #include "i915_drv.h" ++#include + + static bool + format_is_yuv(uint32_t format) +@@ -64,6 +65,8 @@ static int usecs_to_scanlines(const struct drm_display_mode *adjusted_mode, + 1000 * adjusted_mode->crtc_htotal); + } + ++static DEFINE_LOCAL_IRQ_LOCK(pipe_update_lock); ++ + /** + * intel_pipe_update_start() - start update of a set of display registers + * @crtc: the crtc of which the registers are going to be updated +@@ -96,7 +99,7 @@ void intel_pipe_update_start(struct intel_crtc *crtc) + min = vblank_start - usecs_to_scanlines(adjusted_mode, 100); + max = vblank_start - 1; + +- local_irq_disable(); ++ local_lock_irq(pipe_update_lock); + + if (min <= 0 || max <= 0) + return; +@@ -126,11 +129,11 @@ void intel_pipe_update_start(struct intel_crtc *crtc) + break; + } + +- local_irq_enable(); ++ local_unlock_irq(pipe_update_lock); + + timeout = schedule_timeout(timeout); + +- local_irq_disable(); ++ local_lock_irq(pipe_update_lock); + } + + finish_wait(wq, &wait); +@@ -164,7 +167,7 @@ void intel_pipe_update_end(struct intel_crtc *crtc) + + trace_i915_pipe_update_end(crtc, end_vbl_count, scanline_end); + +- local_irq_enable(); ++ local_unlock_irq(pipe_update_lock); + + if (crtc->debug.start_vbl_count && + crtc->debug.start_vbl_count != end_vbl_count) { +diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c +index 3645b22..642854b 100644 +--- a/drivers/gpu/drm/radeon/radeon_display.c ++++ b/drivers/gpu/drm/radeon/radeon_display.c +@@ -1862,6 +1862,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, + struct radeon_device *rdev = dev->dev_private; + + /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ ++ preempt_disable_rt(); + + /* Get optional system timestamp before query. */ + if (stime) +@@ -1954,6 +1955,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, + *etime = ktime_get(); + + /* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */ ++ preempt_enable_rt(); + + /* Decode into vertical and horizontal scanout position. */ + *vpos = position & 0x1fff; +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c +index fc836f5..f417aafe 100644 +--- a/drivers/iommu/amd_iommu.c ++++ b/drivers/iommu/amd_iommu.c +@@ -1952,10 +1952,10 @@ static int __attach_device(struct iommu_dev_data *dev_data, + int ret; + + /* +- * Must be called with IRQs disabled. Warn here to detect early +- * when its not. ++ * Must be called with IRQs disabled on a non RT kernel. Warn here to ++ * detect early when its not. + */ +- WARN_ON(!irqs_disabled()); ++ WARN_ON_NONRT(!irqs_disabled()); + + /* lock domain */ + spin_lock(&domain->lock); +@@ -2118,10 +2118,10 @@ static void __detach_device(struct iommu_dev_data *dev_data) + struct protection_domain *domain; + + /* +- * Must be called with IRQs disabled. Warn here to detect early +- * when its not. ++ * Must be called with IRQs disabled on a non RT kernel. Warn here to ++ * detect early when its not. + */ +- WARN_ON(!irqs_disabled()); ++ WARN_ON_NONRT(!irqs_disabled()); + + if (WARN_ON(!dev_data->domain)) + return; +diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c +index edb5305..7d5ee8a 100644 +--- a/drivers/tty/serial/sc16is7xx.c ++++ b/drivers/tty/serial/sc16is7xx.c +@@ -1230,7 +1230,7 @@ static int sc16is7xx_probe(struct device *dev, + + /* Setup interrupt */ + ret = devm_request_irq(dev, irq, sc16is7xx_irq, +- IRQF_ONESHOT | flags, dev_name(dev), s); ++ flags, dev_name(dev), s); + if (!ret) + return 0; + +diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c +index 3ba63db..4d47528 100644 +--- a/drivers/usb/gadget/function/f_fs.c ++++ b/drivers/usb/gadget/function/f_fs.c +@@ -1405,7 +1405,7 @@ static void ffs_data_put(struct ffs_data *ffs) + pr_info("%s(): freeing\n", __func__); + ffs_data_clear(ffs); + BUG_ON(waitqueue_active(&ffs->ev.waitq) || +- swaitqueue_active(&ffs->ep0req_completion.wait)); ++ swait_active(&ffs->ep0req_completion.wait)); + kfree(ffs->dev_name); + kfree(ffs); + } +diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c +index f92f5af..f9bba26 100644 +--- a/drivers/usb/gadget/udc/atmel_usba_udc.c ++++ b/drivers/usb/gadget/udc/atmel_usba_udc.c +@@ -17,7 +17,9 @@ + #include + #include + #include ++#include + #include ++#include + #include + #include + #include +@@ -1888,20 +1890,15 @@ static int atmel_usba_stop(struct usb_gadget *gadget) + #ifdef CONFIG_OF + static void at91sam9rl_toggle_bias(struct usba_udc *udc, int is_on) + { +- unsigned int uckr = at91_pmc_read(AT91_CKGR_UCKR); +- +- if (is_on) +- at91_pmc_write(AT91_CKGR_UCKR, uckr | AT91_PMC_BIASEN); +- else +- at91_pmc_write(AT91_CKGR_UCKR, uckr & ~(AT91_PMC_BIASEN)); ++ regmap_update_bits(udc->pmc, AT91_CKGR_UCKR, AT91_PMC_BIASEN, ++ is_on ? AT91_PMC_BIASEN : 0); + } + + static void at91sam9g45_pulse_bias(struct usba_udc *udc) + { +- unsigned int uckr = at91_pmc_read(AT91_CKGR_UCKR); +- +- at91_pmc_write(AT91_CKGR_UCKR, uckr & ~(AT91_PMC_BIASEN)); +- at91_pmc_write(AT91_CKGR_UCKR, uckr | AT91_PMC_BIASEN); ++ regmap_update_bits(udc->pmc, AT91_CKGR_UCKR, AT91_PMC_BIASEN, 0); ++ regmap_update_bits(udc->pmc, AT91_CKGR_UCKR, AT91_PMC_BIASEN, ++ AT91_PMC_BIASEN); + } + + static const struct usba_udc_errata at91sam9rl_errata = { +@@ -1938,6 +1935,9 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, + return ERR_PTR(-EINVAL); + + udc->errata = match->data; ++ udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9g45-pmc"); ++ if (udc->errata && IS_ERR(udc->pmc)) ++ return ERR_CAST(udc->pmc); + + udc->num_ep = 0; + +diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.h b/drivers/usb/gadget/udc/atmel_usba_udc.h +index ea448a3..3e1c9d5 100644 +--- a/drivers/usb/gadget/udc/atmel_usba_udc.h ++++ b/drivers/usb/gadget/udc/atmel_usba_udc.h +@@ -354,6 +354,8 @@ struct usba_udc { + struct dentry *debugfs_root; + struct dentry *debugfs_regs; + #endif ++ ++ struct regmap *pmc; + }; + + static inline struct usba_ep *to_usba_ep(struct usb_ep *ep) +diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c +index 9c62a6f..9e08447 100644 +--- a/fs/btrfs/volumes.c ++++ b/fs/btrfs/volumes.c +@@ -232,7 +232,6 @@ static struct btrfs_device *__alloc_device(void) + spin_lock_init(&dev->reada_lock); + atomic_set(&dev->reada_in_flight, 0); + atomic_set(&dev->dev_stats_ccnt, 0); +- btrfs_device_data_ordered_init(dev); + INIT_RADIX_TREE(&dev->reada_zones, GFP_NOFS & ~__GFP_DIRECT_RECLAIM); + INIT_RADIX_TREE(&dev->reada_extents, GFP_NOFS & ~__GFP_DIRECT_RECLAIM); + +diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h +index 9db5500..5951c49 100644 +--- a/fs/f2fs/f2fs.h ++++ b/fs/f2fs/f2fs.h +@@ -24,7 +24,6 @@ + + #ifdef CONFIG_F2FS_CHECK_FS + #define f2fs_bug_on(sbi, condition) BUG_ON(condition) +-#define f2fs_down_write(x, y) down_write_nest_lock(x, y) + #else + #define f2fs_bug_on(sbi, condition) \ + do { \ +@@ -33,7 +32,6 @@ + set_sbi_flag(sbi, SBI_NEED_FSCK); \ + } \ + } while (0) +-#define f2fs_down_write(x, y) down_write(x) + #endif + + /* +@@ -959,7 +957,7 @@ static inline void f2fs_unlock_op(struct f2fs_sb_info *sbi) + + static inline void f2fs_lock_all(struct f2fs_sb_info *sbi) + { +- f2fs_down_write(&sbi->cp_rwsem, &sbi->cp_mutex); ++ down_write(&sbi->cp_rwsem); + } + + static inline void f2fs_unlock_all(struct f2fs_sb_info *sbi) +diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h +index fff4ec1..a8f18e0 100644 +--- a/include/linux/blkdev.h ++++ b/include/linux/blkdev.h +@@ -456,7 +456,7 @@ struct request_queue { + struct throtl_data *td; + #endif + struct rcu_head rcu_head; +- struct swait_head mq_freeze_wq; ++ struct swait_queue_head mq_freeze_wq; + struct percpu_ref q_usage_counter; + struct list_head all_q_node; + +diff --git a/include/linux/clk/at91_pmc.h b/include/linux/clk/at91_pmc.h +index 1e69322..17f413b 100644 +--- a/include/linux/clk/at91_pmc.h ++++ b/include/linux/clk/at91_pmc.h +@@ -16,18 +16,6 @@ + #ifndef AT91_PMC_H + #define AT91_PMC_H + +-#ifndef __ASSEMBLY__ +-extern void __iomem *at91_pmc_base; +- +-#define at91_pmc_read(field) \ +- readl_relaxed(at91_pmc_base + field) +- +-#define at91_pmc_write(field, value) \ +- writel_relaxed(value, at91_pmc_base + field) +-#else +-.extern at91_pmc_base +-#endif +- + #define AT91_PMC_SCER 0x00 /* System Clock Enable Register */ + #define AT91_PMC_SCDR 0x04 /* System Clock Disable Register */ + +diff --git a/include/linux/completion.h b/include/linux/completion.h +index 3fe8d14..3bca159 100644 +--- a/include/linux/completion.h ++++ b/include/linux/completion.h +@@ -7,7 +7,7 @@ + * Atomic wait-for-completion handler data structures. + * See kernel/sched/completion.c for details. + */ +-#include ++#include + + /* + * struct completion - structure used to maintain state for a "completion" +@@ -23,11 +23,11 @@ + */ + struct completion { + unsigned int done; +- struct swait_head wait; ++ struct swait_queue_head wait; + }; + + #define COMPLETION_INITIALIZER(work) \ +- { 0, SWAIT_HEAD_INITIALIZER((work).wait) } ++ { 0, __SWAIT_QUEUE_HEAD_INITIALIZER((work).wait) } + + #define COMPLETION_INITIALIZER_ONSTACK(work) \ + ({ init_completion(&work); work; }) +@@ -72,7 +72,7 @@ struct completion { + static inline void init_completion(struct completion *x) + { + x->done = 0; +- init_swait_head(&x->wait); ++ init_swait_queue_head(&x->wait); + } + + /** +diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h +index 60048c5..f2cd676 100644 +--- a/include/linux/ftrace.h ++++ b/include/linux/ftrace.h +@@ -694,6 +694,18 @@ static inline void __ftrace_enabled_restore(int enabled) + #define CALLER_ADDR5 ((unsigned long)ftrace_return_address(5)) + #define CALLER_ADDR6 ((unsigned long)ftrace_return_address(6)) + ++static inline unsigned long get_lock_parent_ip(void) ++{ ++ unsigned long addr = CALLER_ADDR0; ++ ++ if (!in_lock_functions(addr)) ++ return addr; ++ addr = CALLER_ADDR1; ++ if (!in_lock_functions(addr)) ++ return addr; ++ return CALLER_ADDR2; ++} ++ + #ifdef CONFIG_IRQSOFF_TRACER + extern void time_hardirqs_on(unsigned long a0, unsigned long a1); + extern void time_hardirqs_off(unsigned long a0, unsigned long a1); +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index f606864..8fbcdfa 100644 +--- a/include/linux/hrtimer.h ++++ b/include/linux/hrtimer.h +@@ -91,7 +91,7 @@ enum hrtimer_restart { + * @irqsafe: timer can run in hardirq context + * @praecox: timer expiry time if expired at the time of programming + * @is_rel: Set if the timer was armed relative +- * @start_pid: timer statistics field to store the pid of the task which ++ * @start_pid: timer statistics field to store the pid of the task which + * started the timer + * @start_site: timer statistics field to store the site where the timer + * was started +diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h +index d856ccd..c690acc 100644 +--- a/include/linux/kvm_host.h ++++ b/include/linux/kvm_host.h +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include + + #include +@@ -243,7 +244,7 @@ struct kvm_vcpu { + int fpu_active; + int guest_fpu_loaded, guest_xcr0_loaded; + unsigned char fpu_counter; +- struct swait_head wq; ++ struct swait_queue_head wq; + struct pid *pid; + int sigset_active; + sigset_t sigset; +@@ -794,7 +795,7 @@ static inline bool kvm_arch_has_assigned_device(struct kvm *kvm) + } + #endif + +-static inline struct swait_head *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu) ++static inline struct swait_queue_head *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu) + { + #ifdef __KVM_HAVE_ARCH_WQP + return vcpu->arch.wqp; +diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h +index 44f0b55..89ffaa7 100644 +--- a/include/linux/list_bl.h ++++ b/include/linux/list_bl.h +@@ -42,13 +42,15 @@ struct hlist_bl_node { + struct hlist_bl_node *next, **pprev; + }; + +-static inline void INIT_HLIST_BL_HEAD(struct hlist_bl_head *h) +-{ +- h->first = NULL; + #ifdef CONFIG_PREEMPT_RT_BASE +- raw_spin_lock_init(&h->lock); ++#define INIT_HLIST_BL_HEAD(h) \ ++do { \ ++ (h)->first = NULL; \ ++ raw_spin_lock_init(&(h)->lock); \ ++} while (0) ++#else ++#define INIT_HLIST_BL_HEAD(h) (h)->first = NULL + #endif +-} + + static inline void INIT_HLIST_BL_NODE(struct hlist_bl_node *h) + { +diff --git a/include/linux/locallock.h b/include/linux/locallock.h +index 339ba00..6fe5928 100644 +--- a/include/linux/locallock.h ++++ b/include/linux/locallock.h +@@ -43,9 +43,9 @@ struct local_irq_lock { + * for CONFIG_PREEMPT_BASE map to the normal spin_* calls. + */ + #ifdef CONFIG_PREEMPT_RT_FULL +-# define spin_lock_local(lock) rt_spin_lock(lock) +-# define spin_trylock_local(lock) rt_spin_trylock(lock) +-# define spin_unlock_local(lock) rt_spin_unlock(lock) ++# define spin_lock_local(lock) rt_spin_lock__no_mg(lock) ++# define spin_trylock_local(lock) rt_spin_trylock__no_mg(lock) ++# define spin_unlock_local(lock) rt_spin_unlock__no_mg(lock) + #else + # define spin_lock_local(lock) spin_lock(lock) + # define spin_trylock_local(lock) spin_trylock(lock) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index b6a2358..58c5ec8 100644 +--- a/include/linux/sched.h ++++ b/include/linux/sched.h +@@ -183,8 +183,6 @@ extern void update_cpu_load_nohz(void); + static inline void update_cpu_load_nohz(void) { } + #endif + +-extern unsigned long get_parent_ip(unsigned long addr); +- + extern void dump_cpu_task(int cpu); + + struct seq_file; +diff --git a/include/linux/spinlock_rt.h b/include/linux/spinlock_rt.h +index f757096..3b28255 100644 +--- a/include/linux/spinlock_rt.h ++++ b/include/linux/spinlock_rt.h +@@ -18,6 +18,10 @@ do { \ + __rt_spin_lock_init(slock, #slock, &__key); \ + } while (0) + ++void __lockfunc rt_spin_lock__no_mg(spinlock_t *lock); ++void __lockfunc rt_spin_unlock__no_mg(spinlock_t *lock); ++int __lockfunc rt_spin_trylock__no_mg(spinlock_t *lock); ++ + extern void __lockfunc rt_spin_lock(spinlock_t *lock); + extern unsigned long __lockfunc rt_spin_lock_trace_flags(spinlock_t *lock); + extern void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass); +@@ -32,20 +36,16 @@ extern int atomic_dec_and_spin_lock(atomic_t *atomic, spinlock_t *lock); + * lockdep-less calls, for derived types like rwlock: + * (for trylock they can use rt_mutex_trylock() directly. + */ ++extern void __lockfunc __rt_spin_lock__no_mg(struct rt_mutex *lock); + extern void __lockfunc __rt_spin_lock(struct rt_mutex *lock); + extern void __lockfunc __rt_spin_unlock(struct rt_mutex *lock); + extern int __lockfunc __rt_spin_trylock(struct rt_mutex *lock); + +-#define spin_lock(lock) \ +- do { \ +- migrate_disable(); \ +- rt_spin_lock(lock); \ +- } while (0) ++#define spin_lock(lock) rt_spin_lock(lock) + + #define spin_lock_bh(lock) \ + do { \ + local_bh_disable(); \ +- migrate_disable(); \ + rt_spin_lock(lock); \ + } while (0) + +@@ -56,24 +56,19 @@ extern int __lockfunc __rt_spin_trylock(struct rt_mutex *lock); + #define spin_trylock(lock) \ + ({ \ + int __locked; \ +- migrate_disable(); \ + __locked = spin_do_trylock(lock); \ +- if (!__locked) \ +- migrate_enable(); \ + __locked; \ + }) + + #ifdef CONFIG_LOCKDEP + # define spin_lock_nested(lock, subclass) \ + do { \ +- migrate_disable(); \ + rt_spin_lock_nested(lock, subclass); \ + } while (0) + + #define spin_lock_bh_nested(lock, subclass) \ + do { \ + local_bh_disable(); \ +- migrate_disable(); \ + rt_spin_lock_nested(lock, subclass); \ + } while (0) + +@@ -81,7 +76,6 @@ extern int __lockfunc __rt_spin_trylock(struct rt_mutex *lock); + do { \ + typecheck(unsigned long, flags); \ + flags = 0; \ +- migrate_disable(); \ + rt_spin_lock_nested(lock, subclass); \ + } while (0) + #else +@@ -117,16 +111,11 @@ static inline unsigned long spin_lock_trace_flags(spinlock_t *lock) + /* FIXME: we need rt_spin_lock_nest_lock */ + #define spin_lock_nest_lock(lock, nest_lock) spin_lock_nested(lock, 0) + +-#define spin_unlock(lock) \ +- do { \ +- rt_spin_unlock(lock); \ +- migrate_enable(); \ +- } while (0) ++#define spin_unlock(lock) rt_spin_unlock(lock) + + #define spin_unlock_bh(lock) \ + do { \ + rt_spin_unlock(lock); \ +- migrate_enable(); \ + local_bh_enable(); \ + } while (0) + +diff --git a/include/linux/suspend.h b/include/linux/suspend.h +index 8b6ec7e..9b77d4c 100644 +--- a/include/linux/suspend.h ++++ b/include/linux/suspend.h +@@ -194,6 +194,12 @@ struct platform_freeze_ops { + void (*end)(void); + }; + ++#if defined(CONFIG_SUSPEND) || defined(CONFIG_HIBERNATION) ++extern bool pm_in_action; ++#else ++# define pm_in_action false ++#endif ++ + #ifdef CONFIG_SUSPEND + /** + * suspend_set_ops - set platform dependent suspend operations +diff --git a/include/linux/swait.h b/include/linux/swait.h +new file mode 100644 +index 0000000..83f004a +--- /dev/null ++++ b/include/linux/swait.h +@@ -0,0 +1,173 @@ ++#ifndef _LINUX_SWAIT_H ++#define _LINUX_SWAIT_H ++ ++#include ++#include ++#include ++#include ++ ++/* ++ * Simple wait queues ++ * ++ * While these are very similar to the other/complex wait queues (wait.h) the ++ * most important difference is that the simple waitqueue allows for ++ * deterministic behaviour -- IOW it has strictly bounded IRQ and lock hold ++ * times. ++ * ++ * In order to make this so, we had to drop a fair number of features of the ++ * other waitqueue code; notably: ++ * ++ * - mixing INTERRUPTIBLE and UNINTERRUPTIBLE sleeps on the same waitqueue; ++ * all wakeups are TASK_NORMAL in order to avoid O(n) lookups for the right ++ * sleeper state. ++ * ++ * - the exclusive mode; because this requires preserving the list order ++ * and this is hard. ++ * ++ * - custom wake functions; because you cannot give any guarantees about ++ * random code. ++ * ++ * As a side effect of this; the data structures are slimmer. ++ * ++ * One would recommend using this wait queue where possible. ++ */ ++ ++struct task_struct; ++ ++struct swait_queue_head { ++ raw_spinlock_t lock; ++ struct list_head task_list; ++}; ++ ++struct swait_queue { ++ struct task_struct *task; ++ struct list_head task_list; ++}; ++ ++#define __SWAITQUEUE_INITIALIZER(name) { \ ++ .task = current, \ ++ .task_list = LIST_HEAD_INIT((name).task_list), \ ++} ++ ++#define DECLARE_SWAITQUEUE(name) \ ++ struct swait_queue name = __SWAITQUEUE_INITIALIZER(name) ++ ++#define __SWAIT_QUEUE_HEAD_INITIALIZER(name) { \ ++ .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \ ++ .task_list = LIST_HEAD_INIT((name).task_list), \ ++} ++ ++#define DECLARE_SWAIT_QUEUE_HEAD(name) \ ++ struct swait_queue_head name = __SWAIT_QUEUE_HEAD_INITIALIZER(name) ++ ++extern void __init_swait_queue_head(struct swait_queue_head *q, const char *name, ++ struct lock_class_key *key); ++ ++#define init_swait_queue_head(q) \ ++ do { \ ++ static struct lock_class_key __key; \ ++ __init_swait_queue_head((q), #q, &__key); \ ++ } while (0) ++ ++#ifdef CONFIG_LOCKDEP ++# define __SWAIT_QUEUE_HEAD_INIT_ONSTACK(name) \ ++ ({ init_swait_queue_head(&name); name; }) ++# define DECLARE_SWAIT_QUEUE_HEAD_ONSTACK(name) \ ++ struct swait_queue_head name = __SWAIT_QUEUE_HEAD_INIT_ONSTACK(name) ++#else ++# define DECLARE_SWAIT_QUEUE_HEAD_ONSTACK(name) \ ++ DECLARE_SWAIT_QUEUE_HEAD(name) ++#endif ++ ++static inline int swait_active(struct swait_queue_head *q) ++{ ++ return !list_empty(&q->task_list); ++} ++ ++extern void swake_up(struct swait_queue_head *q); ++extern void swake_up_all(struct swait_queue_head *q); ++extern void swake_up_locked(struct swait_queue_head *q); ++extern void swake_up_all_locked(struct swait_queue_head *q); ++ ++extern void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait); ++extern void prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait, int state); ++extern long prepare_to_swait_event(struct swait_queue_head *q, struct swait_queue *wait, int state); ++ ++extern void __finish_swait(struct swait_queue_head *q, struct swait_queue *wait); ++extern void finish_swait(struct swait_queue_head *q, struct swait_queue *wait); ++ ++/* as per ___wait_event() but for swait, therefore "exclusive == 0" */ ++#define ___swait_event(wq, condition, state, ret, cmd) \ ++({ \ ++ struct swait_queue __wait; \ ++ long __ret = ret; \ ++ \ ++ INIT_LIST_HEAD(&__wait.task_list); \ ++ for (;;) { \ ++ long __int = prepare_to_swait_event(&wq, &__wait, state);\ ++ \ ++ if (condition) \ ++ break; \ ++ \ ++ if (___wait_is_interruptible(state) && __int) { \ ++ __ret = __int; \ ++ break; \ ++ } \ ++ \ ++ cmd; \ ++ } \ ++ finish_swait(&wq, &__wait); \ ++ __ret; \ ++}) ++ ++#define __swait_event(wq, condition) \ ++ (void)___swait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, \ ++ schedule()) ++ ++#define swait_event(wq, condition) \ ++do { \ ++ if (condition) \ ++ break; \ ++ __swait_event(wq, condition); \ ++} while (0) ++ ++#define __swait_event_timeout(wq, condition, timeout) \ ++ ___swait_event(wq, ___wait_cond_timeout(condition), \ ++ TASK_UNINTERRUPTIBLE, timeout, \ ++ __ret = schedule_timeout(__ret)) ++ ++#define swait_event_timeout(wq, condition, timeout) \ ++({ \ ++ long __ret = timeout; \ ++ if (!___wait_cond_timeout(condition)) \ ++ __ret = __swait_event_timeout(wq, condition, timeout); \ ++ __ret; \ ++}) ++ ++#define __swait_event_interruptible(wq, condition) \ ++ ___swait_event(wq, condition, TASK_INTERRUPTIBLE, 0, \ ++ schedule()) ++ ++#define swait_event_interruptible(wq, condition) \ ++({ \ ++ int __ret = 0; \ ++ if (!(condition)) \ ++ __ret = __swait_event_interruptible(wq, condition); \ ++ __ret; \ ++}) ++ ++#define __swait_event_interruptible_timeout(wq, condition, timeout) \ ++ ___swait_event(wq, ___wait_cond_timeout(condition), \ ++ TASK_INTERRUPTIBLE, timeout, \ ++ __ret = schedule_timeout(__ret)) ++ ++#define swait_event_interruptible_timeout(wq, condition, timeout) \ ++({ \ ++ long __ret = timeout; \ ++ if (!___wait_cond_timeout(condition)) \ ++ __ret = __swait_event_interruptible_timeout(wq, \ ++ condition, timeout); \ ++ __ret; \ ++}) ++ ++#endif /* _LINUX_SWAIT_H */ +diff --git a/include/linux/wait-simple.h b/include/linux/wait-simple.h +deleted file mode 100644 +index f86bca2..0000000 +--- a/include/linux/wait-simple.h ++++ /dev/null +@@ -1,207 +0,0 @@ +-#ifndef _LINUX_WAIT_SIMPLE_H +-#define _LINUX_WAIT_SIMPLE_H +- +-#include +-#include +- +-#include +- +-struct swaiter { +- struct task_struct *task; +- struct list_head node; +-}; +- +-#define DEFINE_SWAITER(name) \ +- struct swaiter name = { \ +- .task = current, \ +- .node = LIST_HEAD_INIT((name).node), \ +- } +- +-struct swait_head { +- raw_spinlock_t lock; +- struct list_head list; +-}; +- +-#define SWAIT_HEAD_INITIALIZER(name) { \ +- .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \ +- .list = LIST_HEAD_INIT((name).list), \ +- } +- +-#define DEFINE_SWAIT_HEAD(name) \ +- struct swait_head name = SWAIT_HEAD_INITIALIZER(name) +- +-extern void __init_swait_head(struct swait_head *h, struct lock_class_key *key); +- +-#define init_swait_head(swh) \ +- do { \ +- static struct lock_class_key __key; \ +- \ +- __init_swait_head((swh), &__key); \ +- } while (0) +- +-/* +- * Waiter functions +- */ +-extern void swait_prepare_locked(struct swait_head *head, struct swaiter *w); +-extern void swait_prepare(struct swait_head *head, struct swaiter *w, int state); +-extern void swait_finish_locked(struct swait_head *head, struct swaiter *w); +-extern void swait_finish(struct swait_head *head, struct swaiter *w); +- +-/* Check whether a head has waiters enqueued */ +-static inline bool swaitqueue_active(struct swait_head *h) +-{ +- /* Make sure the condition is visible before checking list_empty() */ +- smp_mb(); +- return !list_empty(&h->list); +-} +- +-/* +- * Wakeup functions +- */ +-extern unsigned int __swait_wake(struct swait_head *head, unsigned int state, unsigned int num); +-extern unsigned int __swait_wake_locked(struct swait_head *head, unsigned int state, unsigned int num); +- +-#define swait_wake(head) __swait_wake(head, TASK_NORMAL, 1) +-#define swait_wake_interruptible(head) __swait_wake(head, TASK_INTERRUPTIBLE, 1) +-#define swait_wake_all(head) __swait_wake(head, TASK_NORMAL, 0) +-#define swait_wake_all_interruptible(head) __swait_wake(head, TASK_INTERRUPTIBLE, 0) +- +-/* +- * Event API +- */ +-#define __swait_event(wq, condition) \ +-do { \ +- DEFINE_SWAITER(__wait); \ +- \ +- for (;;) { \ +- swait_prepare(&wq, &__wait, TASK_UNINTERRUPTIBLE); \ +- if (condition) \ +- break; \ +- schedule(); \ +- } \ +- swait_finish(&wq, &__wait); \ +-} while (0) +- +-/** +- * swait_event - sleep until a condition gets true +- * @wq: the waitqueue to wait on +- * @condition: a C expression for the event to wait for +- * +- * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the +- * @condition evaluates to true. The @condition is checked each time +- * the waitqueue @wq is woken up. +- * +- * wake_up() has to be called after changing any variable that could +- * change the result of the wait condition. +- */ +-#define swait_event(wq, condition) \ +-do { \ +- if (condition) \ +- break; \ +- __swait_event(wq, condition); \ +-} while (0) +- +-#define __swait_event_interruptible(wq, condition, ret) \ +-do { \ +- DEFINE_SWAITER(__wait); \ +- \ +- for (;;) { \ +- swait_prepare(&wq, &__wait, TASK_INTERRUPTIBLE); \ +- if (condition) \ +- break; \ +- if (signal_pending(current)) { \ +- ret = -ERESTARTSYS; \ +- break; \ +- } \ +- schedule(); \ +- } \ +- swait_finish(&wq, &__wait); \ +-} while (0) +- +-#define __swait_event_interruptible_timeout(wq, condition, ret) \ +-do { \ +- DEFINE_SWAITER(__wait); \ +- \ +- for (;;) { \ +- swait_prepare(&wq, &__wait, TASK_INTERRUPTIBLE); \ +- if (condition) \ +- break; \ +- if (signal_pending(current)) { \ +- ret = -ERESTARTSYS; \ +- break; \ +- } \ +- ret = schedule_timeout(ret); \ +- if (!ret) \ +- break; \ +- } \ +- swait_finish(&wq, &__wait); \ +-} while (0) +- +-/** +- * swait_event_interruptible - sleep until a condition gets true +- * @wq: the waitqueue to wait on +- * @condition: a C expression for the event to wait for +- * +- * The process is put to sleep (TASK_INTERRUPTIBLE) until the +- * @condition evaluates to true. The @condition is checked each time +- * the waitqueue @wq is woken up. +- * +- * wake_up() has to be called after changing any variable that could +- * change the result of the wait condition. +- */ +-#define swait_event_interruptible(wq, condition) \ +-({ \ +- int __ret = 0; \ +- if (!(condition)) \ +- __swait_event_interruptible(wq, condition, __ret); \ +- __ret; \ +-}) +- +-#define swait_event_interruptible_timeout(wq, condition, timeout) \ +-({ \ +- int __ret = timeout; \ +- if (!(condition)) \ +- __swait_event_interruptible_timeout(wq, condition, __ret); \ +- __ret; \ +-}) +- +-#define __swait_event_timeout(wq, condition, ret) \ +-do { \ +- DEFINE_SWAITER(__wait); \ +- \ +- for (;;) { \ +- swait_prepare(&wq, &__wait, TASK_UNINTERRUPTIBLE); \ +- if (condition) \ +- break; \ +- ret = schedule_timeout(ret); \ +- if (!ret) \ +- break; \ +- } \ +- swait_finish(&wq, &__wait); \ +-} while (0) +- +-/** +- * swait_event_timeout - sleep until a condition gets true or a timeout elapses +- * @wq: the waitqueue to wait on +- * @condition: a C expression for the event to wait for +- * @timeout: timeout, in jiffies +- * +- * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the +- * @condition evaluates to true. The @condition is checked each time +- * the waitqueue @wq is woken up. +- * +- * wake_up() has to be called after changing any variable that could +- * change the result of the wait condition. +- * +- * The function returns 0 if the @timeout elapsed, and the remaining +- * jiffies if the condition evaluated to true before the timeout elapsed. +- */ +-#define swait_event_timeout(wq, condition, timeout) \ +-({ \ +- long __ret = timeout; \ +- if (!(condition)) \ +- __swait_event_timeout(wq, condition, __ret); \ +- __ret; \ +-}) +- +-#endif +diff --git a/include/trace/events/hist.h b/include/trace/events/hist.h +index 6122e42..f7710de 100644 +--- a/include/trace/events/hist.h ++++ b/include/trace/events/hist.h +@@ -9,6 +9,7 @@ + + #if !defined(CONFIG_PREEMPT_OFF_HIST) && !defined(CONFIG_INTERRUPT_OFF_HIST) + #define trace_preemptirqsoff_hist(a, b) ++#define trace_preemptirqsoff_hist_rcuidle(a, b) + #else + TRACE_EVENT(preemptirqsoff_hist, + +diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h +index fff846b..73614ce 100644 +--- a/include/trace/events/writeback.h ++++ b/include/trace/events/writeback.h +@@ -134,58 +134,28 @@ DEFINE_EVENT(writeback_dirty_inode_template, writeback_dirty_inode, + #ifdef CREATE_TRACE_POINTS + #ifdef CONFIG_CGROUP_WRITEBACK + +-static inline size_t __trace_wb_cgroup_size(struct bdi_writeback *wb) ++static inline unsigned int __trace_wb_assign_cgroup(struct bdi_writeback *wb) + { +- return kernfs_path_len(wb->memcg_css->cgroup->kn) + 1; ++ return wb->memcg_css->cgroup->kn->ino; + } + +-static inline void __trace_wb_assign_cgroup(char *buf, struct bdi_writeback *wb) +-{ +- struct cgroup *cgrp = wb->memcg_css->cgroup; +- char *path; +- +- path = cgroup_path(cgrp, buf, kernfs_path_len(cgrp->kn) + 1); +- WARN_ON_ONCE(path != buf); +-} +- +-static inline size_t __trace_wbc_cgroup_size(struct writeback_control *wbc) +-{ +- if (wbc->wb) +- return __trace_wb_cgroup_size(wbc->wb); +- else +- return 2; +-} +- +-static inline void __trace_wbc_assign_cgroup(char *buf, +- struct writeback_control *wbc) ++static inline unsigned int __trace_wbc_assign_cgroup(struct writeback_control *wbc) + { + if (wbc->wb) +- __trace_wb_assign_cgroup(buf, wbc->wb); ++ return __trace_wb_assign_cgroup(wbc->wb); + else +- strcpy(buf, "/"); ++ return -1U; + } +- + #else /* CONFIG_CGROUP_WRITEBACK */ + +-static inline size_t __trace_wb_cgroup_size(struct bdi_writeback *wb) +-{ +- return 2; +-} +- +-static inline void __trace_wb_assign_cgroup(char *buf, struct bdi_writeback *wb) +-{ +- strcpy(buf, "/"); +-} +- +-static inline size_t __trace_wbc_cgroup_size(struct writeback_control *wbc) ++static inline unsigned int __trace_wb_assign_cgroup(struct bdi_writeback *wb) + { +- return 2; ++ return -1U; + } + +-static inline void __trace_wbc_assign_cgroup(char *buf, +- struct writeback_control *wbc) ++static inline unsigned int __trace_wbc_assign_cgroup(struct writeback_control *wbc) + { +- strcpy(buf, "/"); ++ return -1U; + } + + #endif /* CONFIG_CGROUP_WRITEBACK */ +@@ -201,7 +171,7 @@ DECLARE_EVENT_CLASS(writeback_write_inode_template, + __array(char, name, 32) + __field(unsigned long, ino) + __field(int, sync_mode) +- __dynamic_array(char, cgroup, __trace_wbc_cgroup_size(wbc)) ++ __field(unsigned int, cgroup_ino) + ), + + TP_fast_assign( +@@ -209,14 +179,14 @@ DECLARE_EVENT_CLASS(writeback_write_inode_template, + dev_name(inode_to_bdi(inode)->dev), 32); + __entry->ino = inode->i_ino; + __entry->sync_mode = wbc->sync_mode; +- __trace_wbc_assign_cgroup(__get_str(cgroup), wbc); ++ __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc); + ), + +- TP_printk("bdi %s: ino=%lu sync_mode=%d cgroup=%s", ++ TP_printk("bdi %s: ino=%lu sync_mode=%d cgroup_ino=%u", + __entry->name, + __entry->ino, + __entry->sync_mode, +- __get_str(cgroup) ++ __entry->cgroup_ino + ) + ); + +@@ -246,7 +216,7 @@ DECLARE_EVENT_CLASS(writeback_work_class, + __field(int, range_cyclic) + __field(int, for_background) + __field(int, reason) +- __dynamic_array(char, cgroup, __trace_wb_cgroup_size(wb)) ++ __field(unsigned int, cgroup_ino) + ), + TP_fast_assign( + strncpy(__entry->name, +@@ -258,10 +228,10 @@ DECLARE_EVENT_CLASS(writeback_work_class, + __entry->range_cyclic = work->range_cyclic; + __entry->for_background = work->for_background; + __entry->reason = work->reason; +- __trace_wb_assign_cgroup(__get_str(cgroup), wb); ++ __entry->cgroup_ino = __trace_wb_assign_cgroup(wb); + ), + TP_printk("bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d " +- "kupdate=%d range_cyclic=%d background=%d reason=%s cgroup=%s", ++ "kupdate=%d range_cyclic=%d background=%d reason=%s cgroup_ino=%u", + __entry->name, + MAJOR(__entry->sb_dev), MINOR(__entry->sb_dev), + __entry->nr_pages, +@@ -270,7 +240,7 @@ DECLARE_EVENT_CLASS(writeback_work_class, + __entry->range_cyclic, + __entry->for_background, + __print_symbolic(__entry->reason, WB_WORK_REASON), +- __get_str(cgroup) ++ __entry->cgroup_ino + ) + ); + #define DEFINE_WRITEBACK_WORK_EVENT(name) \ +@@ -300,15 +270,15 @@ DECLARE_EVENT_CLASS(writeback_class, + TP_ARGS(wb), + TP_STRUCT__entry( + __array(char, name, 32) +- __dynamic_array(char, cgroup, __trace_wb_cgroup_size(wb)) ++ __field(unsigned int, cgroup_ino) + ), + TP_fast_assign( + strncpy(__entry->name, dev_name(wb->bdi->dev), 32); +- __trace_wb_assign_cgroup(__get_str(cgroup), wb); ++ __entry->cgroup_ino = __trace_wb_assign_cgroup(wb); + ), +- TP_printk("bdi %s: cgroup=%s", ++ TP_printk("bdi %s: cgroup_ino=%u", + __entry->name, +- __get_str(cgroup) ++ __entry->cgroup_ino + ) + ); + #define DEFINE_WRITEBACK_EVENT(name) \ +@@ -347,7 +317,7 @@ DECLARE_EVENT_CLASS(wbc_class, + __field(int, range_cyclic) + __field(long, range_start) + __field(long, range_end) +- __dynamic_array(char, cgroup, __trace_wbc_cgroup_size(wbc)) ++ __field(unsigned int, cgroup_ino) + ), + + TP_fast_assign( +@@ -361,12 +331,12 @@ DECLARE_EVENT_CLASS(wbc_class, + __entry->range_cyclic = wbc->range_cyclic; + __entry->range_start = (long)wbc->range_start; + __entry->range_end = (long)wbc->range_end; +- __trace_wbc_assign_cgroup(__get_str(cgroup), wbc); ++ __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc); + ), + + TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d " + "bgrd=%d reclm=%d cyclic=%d " +- "start=0x%lx end=0x%lx cgroup=%s", ++ "start=0x%lx end=0x%lx cgroup_ino=%u", + __entry->name, + __entry->nr_to_write, + __entry->pages_skipped, +@@ -377,7 +347,7 @@ DECLARE_EVENT_CLASS(wbc_class, + __entry->range_cyclic, + __entry->range_start, + __entry->range_end, +- __get_str(cgroup) ++ __entry->cgroup_ino + ) + ) + +@@ -398,7 +368,7 @@ TRACE_EVENT(writeback_queue_io, + __field(long, age) + __field(int, moved) + __field(int, reason) +- __dynamic_array(char, cgroup, __trace_wb_cgroup_size(wb)) ++ __field(unsigned int, cgroup_ino) + ), + TP_fast_assign( + unsigned long *older_than_this = work->older_than_this; +@@ -408,15 +378,15 @@ TRACE_EVENT(writeback_queue_io, + (jiffies - *older_than_this) * 1000 / HZ : -1; + __entry->moved = moved; + __entry->reason = work->reason; +- __trace_wb_assign_cgroup(__get_str(cgroup), wb); ++ __entry->cgroup_ino = __trace_wb_assign_cgroup(wb); + ), +- TP_printk("bdi %s: older=%lu age=%ld enqueue=%d reason=%s cgroup=%s", ++ TP_printk("bdi %s: older=%lu age=%ld enqueue=%d reason=%s cgroup_ino=%u", + __entry->name, + __entry->older, /* older_than_this in jiffies */ + __entry->age, /* older_than_this in relative milliseconds */ + __entry->moved, + __print_symbolic(__entry->reason, WB_WORK_REASON), +- __get_str(cgroup) ++ __entry->cgroup_ino + ) + ); + +@@ -484,7 +454,7 @@ TRACE_EVENT(bdi_dirty_ratelimit, + __field(unsigned long, dirty_ratelimit) + __field(unsigned long, task_ratelimit) + __field(unsigned long, balanced_dirty_ratelimit) +- __dynamic_array(char, cgroup, __trace_wb_cgroup_size(wb)) ++ __field(unsigned int, cgroup_ino) + ), + + TP_fast_assign( +@@ -496,13 +466,13 @@ TRACE_EVENT(bdi_dirty_ratelimit, + __entry->task_ratelimit = KBps(task_ratelimit); + __entry->balanced_dirty_ratelimit = + KBps(wb->balanced_dirty_ratelimit); +- __trace_wb_assign_cgroup(__get_str(cgroup), wb); ++ __entry->cgroup_ino = __trace_wb_assign_cgroup(wb); + ), + + TP_printk("bdi %s: " + "write_bw=%lu awrite_bw=%lu dirty_rate=%lu " + "dirty_ratelimit=%lu task_ratelimit=%lu " +- "balanced_dirty_ratelimit=%lu cgroup=%s", ++ "balanced_dirty_ratelimit=%lu cgroup_ino=%u", + __entry->bdi, + __entry->write_bw, /* write bandwidth */ + __entry->avg_write_bw, /* avg write bandwidth */ +@@ -510,7 +480,7 @@ TRACE_EVENT(bdi_dirty_ratelimit, + __entry->dirty_ratelimit, /* base ratelimit */ + __entry->task_ratelimit, /* ratelimit with position control */ + __entry->balanced_dirty_ratelimit, /* the balanced ratelimit */ +- __get_str(cgroup) ++ __entry->cgroup_ino + ) + ); + +@@ -548,7 +518,7 @@ TRACE_EVENT(balance_dirty_pages, + __field( long, pause) + __field(unsigned long, period) + __field( long, think) +- __dynamic_array(char, cgroup, __trace_wb_cgroup_size(wb)) ++ __field(unsigned int, cgroup_ino) + ), + + TP_fast_assign( +@@ -571,7 +541,7 @@ TRACE_EVENT(balance_dirty_pages, + __entry->period = period * 1000 / HZ; + __entry->pause = pause * 1000 / HZ; + __entry->paused = (jiffies - start_time) * 1000 / HZ; +- __trace_wb_assign_cgroup(__get_str(cgroup), wb); ++ __entry->cgroup_ino = __trace_wb_assign_cgroup(wb); + ), + + +@@ -580,7 +550,7 @@ TRACE_EVENT(balance_dirty_pages, + "bdi_setpoint=%lu bdi_dirty=%lu " + "dirty_ratelimit=%lu task_ratelimit=%lu " + "dirtied=%u dirtied_pause=%u " +- "paused=%lu pause=%ld period=%lu think=%ld cgroup=%s", ++ "paused=%lu pause=%ld period=%lu think=%ld cgroup_ino=%u", + __entry->bdi, + __entry->limit, + __entry->setpoint, +@@ -595,7 +565,7 @@ TRACE_EVENT(balance_dirty_pages, + __entry->pause, /* ms */ + __entry->period, /* ms */ + __entry->think, /* ms */ +- __get_str(cgroup) ++ __entry->cgroup_ino + ) + ); + +@@ -609,8 +579,7 @@ TRACE_EVENT(writeback_sb_inodes_requeue, + __field(unsigned long, ino) + __field(unsigned long, state) + __field(unsigned long, dirtied_when) +- __dynamic_array(char, cgroup, +- __trace_wb_cgroup_size(inode_to_wb(inode))) ++ __field(unsigned int, cgroup_ino) + ), + + TP_fast_assign( +@@ -619,16 +588,16 @@ TRACE_EVENT(writeback_sb_inodes_requeue, + __entry->ino = inode->i_ino; + __entry->state = inode->i_state; + __entry->dirtied_when = inode->dirtied_when; +- __trace_wb_assign_cgroup(__get_str(cgroup), inode_to_wb(inode)); ++ __entry->cgroup_ino = __trace_wb_assign_cgroup(inode_to_wb(inode)); + ), + +- TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu cgroup=%s", ++ TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu cgroup_ino=%u", + __entry->name, + __entry->ino, + show_inode_state(__entry->state), + __entry->dirtied_when, + (jiffies - __entry->dirtied_when) / HZ, +- __get_str(cgroup) ++ __entry->cgroup_ino + ) + ); + +@@ -684,7 +653,7 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template, + __field(unsigned long, writeback_index) + __field(long, nr_to_write) + __field(unsigned long, wrote) +- __dynamic_array(char, cgroup, __trace_wbc_cgroup_size(wbc)) ++ __field(unsigned int, cgroup_ino) + ), + + TP_fast_assign( +@@ -696,11 +665,11 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template, + __entry->writeback_index = inode->i_mapping->writeback_index; + __entry->nr_to_write = nr_to_write; + __entry->wrote = nr_to_write - wbc->nr_to_write; +- __trace_wbc_assign_cgroup(__get_str(cgroup), wbc); ++ __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc); + ), + + TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu " +- "index=%lu to_write=%ld wrote=%lu cgroup=%s", ++ "index=%lu to_write=%ld wrote=%lu cgroup_ino=%u", + __entry->name, + __entry->ino, + show_inode_state(__entry->state), +@@ -709,7 +678,7 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template, + __entry->writeback_index, + __entry->nr_to_write, + __entry->wrote, +- __get_str(cgroup) ++ __entry->cgroup_ino + ) + ); + +diff --git a/kernel/cpu.c b/kernel/cpu.c +index 51aafc2..8edd3c7 100644 +--- a/kernel/cpu.c ++++ b/kernel/cpu.c +@@ -127,8 +127,8 @@ struct hotplug_pcp { + }; + + #ifdef CONFIG_PREEMPT_RT_FULL +-# define hotplug_lock(hp) rt_spin_lock(&(hp)->lock) +-# define hotplug_unlock(hp) rt_spin_unlock(&(hp)->lock) ++# define hotplug_lock(hp) rt_spin_lock__no_mg(&(hp)->lock) ++# define hotplug_unlock(hp) rt_spin_unlock__no_mg(&(hp)->lock) + #else + # define hotplug_lock(hp) mutex_lock(&(hp)->mutex) + # define hotplug_unlock(hp) mutex_unlock(&(hp)->mutex) +diff --git a/kernel/events/core.c b/kernel/events/core.c +index 33c8aa8..760f41d 100644 +--- a/kernel/events/core.c ++++ b/kernel/events/core.c +@@ -802,6 +802,7 @@ static void __perf_mux_hrtimer_init(struct perf_cpu_context *cpuctx, int cpu) + raw_spin_lock_init(&cpuctx->hrtimer_lock); + hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED); + timer->function = perf_mux_hrtimer_handler; ++ timer->irqsafe = 1; + } + + static int perf_mux_hrtimer_restart(struct perf_cpu_context *cpuctx) +diff --git a/kernel/futex.c b/kernel/futex.c +index a34e5ee..02bb869 100644 +--- a/kernel/futex.c ++++ b/kernel/futex.c +@@ -1226,7 +1226,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this, + if (pi_state->owner != current) + return -EINVAL; + +- raw_spin_lock(&pi_state->pi_mutex.wait_lock); ++ raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); + new_owner = rt_mutex_next_owner(&pi_state->pi_mutex); + + /* +@@ -1252,22 +1252,22 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this, + else if (curval != uval) + ret = -EINVAL; + if (ret) { +- raw_spin_unlock(&pi_state->pi_mutex.wait_lock); ++ raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); + return ret; + } + +- raw_spin_lock_irq(&pi_state->owner->pi_lock); ++ raw_spin_lock(&pi_state->owner->pi_lock); + WARN_ON(list_empty(&pi_state->list)); + list_del_init(&pi_state->list); +- raw_spin_unlock_irq(&pi_state->owner->pi_lock); ++ raw_spin_unlock(&pi_state->owner->pi_lock); + +- raw_spin_lock_irq(&new_owner->pi_lock); ++ raw_spin_lock(&new_owner->pi_lock); + WARN_ON(!list_empty(&pi_state->list)); + list_add(&pi_state->list, &new_owner->pi_state_list); + pi_state->owner = new_owner; +- raw_spin_unlock_irq(&new_owner->pi_lock); ++ raw_spin_unlock(&new_owner->pi_lock); + +- raw_spin_unlock(&pi_state->pi_mutex.wait_lock); ++ raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); + + deboost = rt_mutex_futex_unlock(&pi_state->pi_mutex, &wake_q, + &wake_sleeper_q); +@@ -2144,11 +2144,11 @@ static int fixup_owner(u32 __user *uaddr, struct futex_q *q, int locked) + * we returned due to timeout or signal without taking the + * rt_mutex. Too late. + */ +- raw_spin_lock(&q->pi_state->pi_mutex.wait_lock); ++ raw_spin_lock_irq(&q->pi_state->pi_mutex.wait_lock); + owner = rt_mutex_owner(&q->pi_state->pi_mutex); + if (!owner) + owner = rt_mutex_next_owner(&q->pi_state->pi_mutex); +- raw_spin_unlock(&q->pi_state->pi_mutex.wait_lock); ++ raw_spin_unlock_irq(&q->pi_state->pi_mutex.wait_lock); + ret = fixup_pi_state_owner(uaddr, q, owner); + goto out; + } +diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c +index 239e2ae..0b73349 100644 +--- a/kernel/irq/irqdesc.c ++++ b/kernel/irq/irqdesc.c +@@ -24,10 +24,27 @@ + static struct lock_class_key irq_desc_lock_class; + + #if defined(CONFIG_SMP) ++static int __init irq_affinity_setup(char *str) ++{ ++ zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT); ++ cpulist_parse(str, irq_default_affinity); ++ /* ++ * Set at least the boot cpu. We don't want to end up with ++ * bugreports caused by random comandline masks ++ */ ++ cpumask_set_cpu(smp_processor_id(), irq_default_affinity); ++ return 1; ++} ++__setup("irqaffinity=", irq_affinity_setup); ++ + static void __init init_irq_default_affinity(void) + { +- alloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT); +- cpumask_setall(irq_default_affinity); ++#ifdef CONFIG_CPUMASK_OFFSTACK ++ if (!irq_default_affinity) ++ zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT); ++#endif ++ if (cpumask_empty(irq_default_affinity)) ++ cpumask_setall(irq_default_affinity); + } + #else + static void __init init_irq_default_affinity(void) +diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c +index ba2a42a..8e89554 100644 +--- a/kernel/irq/manage.c ++++ b/kernel/irq/manage.c +@@ -2060,7 +2060,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state); + * This call sets the internal irqchip state of an interrupt, + * depending on the value of @which. + * +- * This function should be called with preemption disabled if the ++ * This function should be called with migration disabled if the + * interrupt controller has per-cpu registers. + */ + int irq_set_irqchip_state(unsigned int irq, enum irqchip_irq_state which, +diff --git a/kernel/locking/lglock.c b/kernel/locking/lglock.c +index d8be4fc..57e0ea7 100644 +--- a/kernel/locking/lglock.c ++++ b/kernel/locking/lglock.c +@@ -10,7 +10,7 @@ + # define lg_do_unlock(l) arch_spin_unlock(l) + #else + # define lg_lock_ptr struct rt_mutex +-# define lg_do_lock(l) __rt_spin_lock(l) ++# define lg_do_lock(l) __rt_spin_lock__no_mg(l) + # define lg_do_unlock(l) __rt_spin_unlock(l) + #endif + /* +@@ -86,7 +86,7 @@ void lg_double_lock(struct lglock *lg, int cpu1, int cpu2) + if (cpu2 < cpu1) + swap(cpu1, cpu2); + +- preempt_disable(); ++ preempt_disable_nort(); + lock_acquire_shared(&lg->lock_dep_map, 0, 0, NULL, _RET_IP_); + lg_do_lock(per_cpu_ptr(lg->lock, cpu1)); + lg_do_lock(per_cpu_ptr(lg->lock, cpu2)); +@@ -97,7 +97,7 @@ void lg_double_unlock(struct lglock *lg, int cpu1, int cpu2) + lock_release(&lg->lock_dep_map, 1, _RET_IP_); + lg_do_unlock(per_cpu_ptr(lg->lock, cpu1)); + lg_do_unlock(per_cpu_ptr(lg->lock, cpu2)); +- preempt_enable(); ++ preempt_enable_nort(); + } + + void lg_global_lock(struct lglock *lg) +diff --git a/kernel/locking/rt.c b/kernel/locking/rt.c +index 1bbbcad5..d4ab61c 100644 +--- a/kernel/locking/rt.c ++++ b/kernel/locking/rt.c +@@ -235,7 +235,6 @@ EXPORT_SYMBOL(rt_read_trylock); + void __lockfunc rt_write_lock(rwlock_t *rwlock) + { + rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_); +- migrate_disable(); + __rt_spin_lock(&rwlock->lock); + } + EXPORT_SYMBOL(rt_write_lock); +@@ -249,7 +248,6 @@ void __lockfunc rt_read_lock(rwlock_t *rwlock) + * recursive read locks succeed when current owns the lock + */ + if (rt_mutex_owner(lock) != current) { +- migrate_disable(); + rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_); + __rt_spin_lock(lock); + } +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index e1ddae3..6697100 100644 +--- a/kernel/locking/rtmutex.c ++++ b/kernel/locking/rtmutex.c +@@ -111,13 +111,14 @@ static inline void mark_rt_mutex_waiters(struct rt_mutex *lock) + * 2) Drop lock->wait_lock + * 3) Try to unlock the lock with cmpxchg + */ +-static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock) ++static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock, ++ unsigned long flags) + __releases(lock->wait_lock) + { + struct task_struct *owner = rt_mutex_owner(lock); + + clear_rt_mutex_waiters(lock); +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + /* + * If a new waiter comes in between the unlock and the cmpxchg + * we have two situations: +@@ -159,11 +160,12 @@ static inline void mark_rt_mutex_waiters(struct rt_mutex *lock) + /* + * Simple slow path only version: lock->owner is protected by lock->wait_lock. + */ +-static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock) ++static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock, ++ unsigned long flags) + __releases(lock->wait_lock) + { + lock->owner = NULL; +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + return true; + } + #endif +@@ -454,7 +456,6 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, + int ret = 0, depth = 0; + struct rt_mutex *lock; + bool detect_deadlock; +- unsigned long flags; + bool requeue = true; + + detect_deadlock = rt_mutex_cond_detect_deadlock(orig_waiter, chwalk); +@@ -497,7 +498,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, + /* + * [1] Task cannot go away as we did a get_task() before ! + */ +- raw_spin_lock_irqsave(&task->pi_lock, flags); ++ raw_spin_lock_irq(&task->pi_lock); + + /* + * [2] Get the waiter on which @task is blocked on. +@@ -581,7 +582,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, + * operations. + */ + if (!raw_spin_trylock(&lock->wait_lock)) { +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); ++ raw_spin_unlock_irq(&task->pi_lock); + cpu_relax(); + goto retry; + } +@@ -612,7 +613,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, + /* + * No requeue[7] here. Just release @task [8] + */ +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); ++ raw_spin_unlock(&task->pi_lock); + put_task_struct(task); + + /* +@@ -620,14 +621,14 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, + * If there is no owner of the lock, end of chain. + */ + if (!rt_mutex_owner(lock)) { +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + return 0; + } + + /* [10] Grab the next task, i.e. owner of @lock */ + task = rt_mutex_owner(lock); + get_task_struct(task); +- raw_spin_lock_irqsave(&task->pi_lock, flags); ++ raw_spin_lock(&task->pi_lock); + + /* + * No requeue [11] here. We just do deadlock detection. +@@ -642,8 +643,8 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, + top_waiter = rt_mutex_top_waiter(lock); + + /* [13] Drop locks */ +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock(&task->pi_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + + /* If owner is not blocked, end of chain. */ + if (!next_lock) +@@ -664,7 +665,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, + rt_mutex_enqueue(lock, waiter); + + /* [8] Release the task */ +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); ++ raw_spin_unlock(&task->pi_lock); + put_task_struct(task); + + /* +@@ -685,14 +686,14 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, + lock_top_waiter = rt_mutex_top_waiter(lock); + if (prerequeue_top_waiter != lock_top_waiter) + rt_mutex_wake_waiter(lock_top_waiter); +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + return 0; + } + + /* [10] Grab the next task, i.e. the owner of @lock */ + task = rt_mutex_owner(lock); + get_task_struct(task); +- raw_spin_lock_irqsave(&task->pi_lock, flags); ++ raw_spin_lock(&task->pi_lock); + + /* [11] requeue the pi waiters if necessary */ + if (waiter == rt_mutex_top_waiter(lock)) { +@@ -746,8 +747,8 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, + top_waiter = rt_mutex_top_waiter(lock); + + /* [13] Drop the locks */ +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock(&task->pi_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + + /* + * Make the actual exit decisions [12], based on the stored +@@ -770,7 +771,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, + goto again; + + out_unlock_pi: +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); ++ raw_spin_unlock_irq(&task->pi_lock); + out_put_task: + put_task_struct(task); + +@@ -799,7 +800,7 @@ static inline int lock_is_stealable(struct task_struct *task, + /* + * Try to take an rt-mutex + * +- * Must be called with lock->wait_lock held. ++ * Must be called with lock->wait_lock held and interrupts disabled + * + * @lock: The lock to be acquired. + * @task: The task which wants to acquire the lock +@@ -810,8 +811,6 @@ static int __try_to_take_rt_mutex(struct rt_mutex *lock, + struct task_struct *task, + struct rt_mutex_waiter *waiter, int mode) + { +- unsigned long flags; +- + /* + * Before testing whether we can acquire @lock, we set the + * RT_MUTEX_HAS_WAITERS bit in @lock->owner. This forces all +@@ -894,7 +893,7 @@ static int __try_to_take_rt_mutex(struct rt_mutex *lock, + * case, but conditionals are more expensive than a redundant + * store. + */ +- raw_spin_lock_irqsave(&task->pi_lock, flags); ++ raw_spin_lock(&task->pi_lock); + task->pi_blocked_on = NULL; + /* + * Finish the lock acquisition. @task is the new owner. If +@@ -903,7 +902,7 @@ static int __try_to_take_rt_mutex(struct rt_mutex *lock, + */ + if (rt_mutex_has_waiters(lock)) + rt_mutex_enqueue_pi(task, rt_mutex_top_waiter(lock)); +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); ++ raw_spin_unlock(&task->pi_lock); + + takeit: + /* We got the lock. */ +@@ -925,14 +924,19 @@ takeit: + * preemptible spin_lock functions: + */ + static inline void rt_spin_lock_fastlock(struct rt_mutex *lock, +- void (*slowfn)(struct rt_mutex *lock)) ++ void (*slowfn)(struct rt_mutex *lock, ++ bool mg_off), ++ bool do_mig_dis) + { + might_sleep_no_state_check(); + ++ if (do_mig_dis) ++ migrate_disable(); ++ + if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) + rt_mutex_deadlock_account_lock(lock, current); + else +- slowfn(lock); ++ slowfn(lock, do_mig_dis); + } + + static inline void rt_spin_lock_fastunlock(struct rt_mutex *lock, +@@ -979,9 +983,6 @@ static int adaptive_wait(struct rt_mutex *lock, + } + #endif + +-# define pi_lock(lock) raw_spin_lock_irq(lock) +-# define pi_unlock(lock) raw_spin_unlock_irq(lock) +- + static int task_blocks_on_rt_mutex(struct rt_mutex *lock, + struct rt_mutex_waiter *waiter, + struct task_struct *task, +@@ -993,18 +994,20 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, + * We store the current state under p->pi_lock in p->saved_state and + * the try_to_wake_up() code handles this accordingly. + */ +-static void noinline __sched rt_spin_lock_slowlock(struct rt_mutex *lock) ++static void noinline __sched rt_spin_lock_slowlock(struct rt_mutex *lock, ++ bool mg_off) + { + struct task_struct *lock_owner, *self = current; + struct rt_mutex_waiter waiter, *top_waiter; ++ unsigned long flags; + int ret; + + rt_mutex_init_waiter(&waiter, true); + +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irqsave(&lock->wait_lock, flags); + + if (__try_to_take_rt_mutex(lock, self, NULL, STEAL_LATERAL)) { +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + return; + } + +@@ -1016,10 +1019,10 @@ static void noinline __sched rt_spin_lock_slowlock(struct rt_mutex *lock) + * as well. We are serialized via pi_lock against wakeups. See + * try_to_wake_up(). + */ +- pi_lock(&self->pi_lock); ++ raw_spin_lock(&self->pi_lock); + self->saved_state = self->state; + __set_current_state_no_track(TASK_UNINTERRUPTIBLE); +- pi_unlock(&self->pi_lock); ++ raw_spin_unlock(&self->pi_lock); + + ret = task_blocks_on_rt_mutex(lock, &waiter, self, RT_MUTEX_MIN_CHAINWALK); + BUG_ON(ret); +@@ -1032,18 +1035,23 @@ static void noinline __sched rt_spin_lock_slowlock(struct rt_mutex *lock) + top_waiter = rt_mutex_top_waiter(lock); + lock_owner = rt_mutex_owner(lock); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + + debug_rt_mutex_print_deadlock(&waiter); + +- if (top_waiter != &waiter || adaptive_wait(lock, lock_owner)) ++ if (top_waiter != &waiter || adaptive_wait(lock, lock_owner)) { ++ if (mg_off) ++ migrate_enable(); + schedule(); ++ if (mg_off) ++ migrate_disable(); ++ } + +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irqsave(&lock->wait_lock, flags); + +- pi_lock(&self->pi_lock); ++ raw_spin_lock(&self->pi_lock); + __set_current_state_no_track(TASK_UNINTERRUPTIBLE); +- pi_unlock(&self->pi_lock); ++ raw_spin_unlock(&self->pi_lock); + } + + /* +@@ -1053,10 +1061,10 @@ static void noinline __sched rt_spin_lock_slowlock(struct rt_mutex *lock) + * happened while we were blocked. Clear saved_state so + * try_to_wakeup() does not get confused. + */ +- pi_lock(&self->pi_lock); ++ raw_spin_lock(&self->pi_lock); + __set_current_state_no_track(self->saved_state); + self->saved_state = TASK_RUNNING; +- pi_unlock(&self->pi_lock); ++ raw_spin_unlock(&self->pi_lock); + + /* + * try_to_take_rt_mutex() sets the waiter bit +@@ -1067,7 +1075,7 @@ static void noinline __sched rt_spin_lock_slowlock(struct rt_mutex *lock) + BUG_ON(rt_mutex_has_waiters(lock) && &waiter == rt_mutex_top_waiter(lock)); + BUG_ON(!RB_EMPTY_NODE(&waiter.tree_entry)); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + + debug_rt_mutex_free_waiter(&waiter); + } +@@ -1080,10 +1088,11 @@ static void mark_wakeup_next_waiter(struct wake_q_head *wake_q, + */ + static void noinline __sched rt_spin_lock_slowunlock(struct rt_mutex *lock) + { ++ unsigned long flags; + WAKE_Q(wake_q); + WAKE_Q(wake_sleeper_q); + +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irqsave(&lock->wait_lock, flags); + + debug_rt_mutex_unlock(lock); + +@@ -1091,13 +1100,13 @@ static void noinline __sched rt_spin_lock_slowunlock(struct rt_mutex *lock) + + if (!rt_mutex_has_waiters(lock)) { + lock->owner = NULL; +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + return; + } + + mark_wakeup_next_waiter(&wake_q, &wake_sleeper_q, lock); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + wake_up_q(&wake_q); + wake_up_q_sleeper(&wake_sleeper_q); + +@@ -1105,33 +1114,55 @@ static void noinline __sched rt_spin_lock_slowunlock(struct rt_mutex *lock) + rt_mutex_adjust_prio(current); + } + ++void __lockfunc rt_spin_lock__no_mg(spinlock_t *lock) ++{ ++ rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock, false); ++ spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); ++} ++EXPORT_SYMBOL(rt_spin_lock__no_mg); ++ + void __lockfunc rt_spin_lock(spinlock_t *lock) + { +- rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); ++ rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock, true); + spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); + } + EXPORT_SYMBOL(rt_spin_lock); + + void __lockfunc __rt_spin_lock(struct rt_mutex *lock) + { +- rt_spin_lock_fastlock(lock, rt_spin_lock_slowlock); ++ rt_spin_lock_fastlock(lock, rt_spin_lock_slowlock, true); + } + EXPORT_SYMBOL(__rt_spin_lock); + ++void __lockfunc __rt_spin_lock__no_mg(struct rt_mutex *lock) ++{ ++ rt_spin_lock_fastlock(lock, rt_spin_lock_slowlock, false); ++} ++EXPORT_SYMBOL(__rt_spin_lock__no_mg); ++ + #ifdef CONFIG_DEBUG_LOCK_ALLOC + void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass) + { +- rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); + spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); ++ rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock, true); + } + EXPORT_SYMBOL(rt_spin_lock_nested); + #endif + ++void __lockfunc rt_spin_unlock__no_mg(spinlock_t *lock) ++{ ++ /* NOTE: we always pass in '1' for nested, for simplicity */ ++ spin_release(&lock->dep_map, 1, _RET_IP_); ++ rt_spin_lock_fastunlock(&lock->lock, rt_spin_lock_slowunlock); ++} ++EXPORT_SYMBOL(rt_spin_unlock__no_mg); ++ + void __lockfunc rt_spin_unlock(spinlock_t *lock) + { + /* NOTE: we always pass in '1' for nested, for simplicity */ + spin_release(&lock->dep_map, 1, _RET_IP_); + rt_spin_lock_fastunlock(&lock->lock, rt_spin_lock_slowunlock); ++ migrate_enable(); + } + EXPORT_SYMBOL(rt_spin_unlock); + +@@ -1158,12 +1189,27 @@ int __lockfunc __rt_spin_trylock(struct rt_mutex *lock) + return rt_mutex_trylock(lock); + } + ++int __lockfunc rt_spin_trylock__no_mg(spinlock_t *lock) ++{ ++ int ret; ++ ++ ret = rt_mutex_trylock(&lock->lock); ++ if (ret) ++ spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); ++ return ret; ++} ++EXPORT_SYMBOL(rt_spin_trylock__no_mg); ++ + int __lockfunc rt_spin_trylock(spinlock_t *lock) + { +- int ret = rt_mutex_trylock(&lock->lock); ++ int ret; + ++ migrate_disable(); ++ ret = rt_mutex_trylock(&lock->lock); + if (ret) + spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); ++ else ++ migrate_enable(); + return ret; + } + EXPORT_SYMBOL(rt_spin_trylock); +@@ -1202,12 +1248,10 @@ int atomic_dec_and_spin_lock(atomic_t *atomic, spinlock_t *lock) + /* Subtract 1 from counter unless that drops it to 0 (ie. it was 1) */ + if (atomic_add_unless(atomic, -1, 1)) + return 0; +- migrate_disable(); + rt_spin_lock(lock); + if (atomic_dec_and_test(atomic)) + return 1; + rt_spin_unlock(lock); +- migrate_enable(); + return 0; + } + EXPORT_SYMBOL(atomic_dec_and_spin_lock); +@@ -1273,7 +1317,7 @@ try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, + * + * Prepare waiter and propagate pi chain + * +- * This must be called with lock->wait_lock held. ++ * This must be called with lock->wait_lock held and interrupts disabled + */ + static int task_blocks_on_rt_mutex(struct rt_mutex *lock, + struct rt_mutex_waiter *waiter, +@@ -1284,7 +1328,6 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, + struct rt_mutex_waiter *top_waiter = waiter; + struct rt_mutex *next_lock; + int chain_walk = 0, res; +- unsigned long flags; + + /* + * Early deadlock detection. We really don't want the task to +@@ -1298,7 +1341,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, + if (owner == task) + return -EDEADLK; + +- raw_spin_lock_irqsave(&task->pi_lock, flags); ++ raw_spin_lock(&task->pi_lock); + + /* + * In the case of futex requeue PI, this will be a proxy +@@ -1310,7 +1353,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, + * the task if PI_WAKEUP_INPROGRESS is set. + */ + if (task != current && task->pi_blocked_on == PI_WAKEUP_INPROGRESS) { +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); ++ raw_spin_unlock(&task->pi_lock); + return -EAGAIN; + } + +@@ -1328,12 +1371,12 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, + + task->pi_blocked_on = waiter; + +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); ++ raw_spin_unlock(&task->pi_lock); + + if (!owner) + return 0; + +- raw_spin_lock_irqsave(&owner->pi_lock, flags); ++ raw_spin_lock(&owner->pi_lock); + if (waiter == rt_mutex_top_waiter(lock)) { + rt_mutex_dequeue_pi(owner, top_waiter); + rt_mutex_enqueue_pi(owner, waiter); +@@ -1348,7 +1391,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, + /* Store the lock on which owner is blocked or NULL */ + next_lock = task_blocked_on_lock(owner); + +- raw_spin_unlock_irqrestore(&owner->pi_lock, flags); ++ raw_spin_unlock(&owner->pi_lock); + /* + * Even if full deadlock detection is on, if the owner is not + * blocked itself, we can avoid finding this out in the chain +@@ -1364,12 +1407,12 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, + */ + get_task_struct(owner); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + + res = rt_mutex_adjust_prio_chain(owner, chwalk, lock, + next_lock, waiter, task); + +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irq(&lock->wait_lock); + + return res; + } +@@ -1378,16 +1421,15 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, + * Remove the top waiter from the current tasks pi waiter tree and + * queue it up. + * +- * Called with lock->wait_lock held. ++ * Called with lock->wait_lock held and interrupts disabled. + */ + static void mark_wakeup_next_waiter(struct wake_q_head *wake_q, + struct wake_q_head *wake_sleeper_q, + struct rt_mutex *lock) + { + struct rt_mutex_waiter *waiter; +- unsigned long flags; + +- raw_spin_lock_irqsave(¤t->pi_lock, flags); ++ raw_spin_lock(¤t->pi_lock); + + waiter = rt_mutex_top_waiter(lock); + +@@ -1409,7 +1451,7 @@ static void mark_wakeup_next_waiter(struct wake_q_head *wake_q, + */ + lock->owner = (void *) RT_MUTEX_HAS_WAITERS; + +- raw_spin_unlock_irqrestore(¤t->pi_lock, flags); ++ raw_spin_unlock(¤t->pi_lock); + + if (waiter->savestate) + wake_q_add(wake_sleeper_q, waiter->task); +@@ -1420,7 +1462,7 @@ static void mark_wakeup_next_waiter(struct wake_q_head *wake_q, + /* + * Remove a waiter from a lock and give up + * +- * Must be called with lock->wait_lock held and ++ * Must be called with lock->wait_lock held and interrupts disabled. I must + * have just failed to try_to_take_rt_mutex(). + */ + static void remove_waiter(struct rt_mutex *lock, +@@ -1429,12 +1471,11 @@ static void remove_waiter(struct rt_mutex *lock, + bool is_top_waiter = (waiter == rt_mutex_top_waiter(lock)); + struct task_struct *owner = rt_mutex_owner(lock); + struct rt_mutex *next_lock = NULL; +- unsigned long flags; + +- raw_spin_lock_irqsave(¤t->pi_lock, flags); ++ raw_spin_lock(¤t->pi_lock); + rt_mutex_dequeue(lock, waiter); + current->pi_blocked_on = NULL; +- raw_spin_unlock_irqrestore(¤t->pi_lock, flags); ++ raw_spin_unlock(¤t->pi_lock); + + /* + * Only update priority if the waiter was the highest priority +@@ -1443,7 +1484,7 @@ static void remove_waiter(struct rt_mutex *lock, + if (!owner || !is_top_waiter) + return; + +- raw_spin_lock_irqsave(&owner->pi_lock, flags); ++ raw_spin_lock(&owner->pi_lock); + + rt_mutex_dequeue_pi(owner, waiter); + +@@ -1456,7 +1497,7 @@ static void remove_waiter(struct rt_mutex *lock, + if (rt_mutex_real_waiter(owner->pi_blocked_on)) + next_lock = task_blocked_on_lock(owner); + +- raw_spin_unlock_irqrestore(&owner->pi_lock, flags); ++ raw_spin_unlock(&owner->pi_lock); + + /* + * Don't walk the chain, if the owner task is not blocked +@@ -1468,12 +1509,12 @@ static void remove_waiter(struct rt_mutex *lock, + /* gets dropped in rt_mutex_adjust_prio_chain()! */ + get_task_struct(owner); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + + rt_mutex_adjust_prio_chain(owner, RT_MUTEX_MIN_CHAINWALK, lock, + next_lock, NULL, current); + +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irq(&lock->wait_lock); + } + + /* +@@ -1509,11 +1550,11 @@ void rt_mutex_adjust_pi(struct task_struct *task) + * __rt_mutex_slowlock() - Perform the wait-wake-try-to-take loop + * @lock: the rt_mutex to take + * @state: the state the task should block in (TASK_INTERRUPTIBLE +- * or TASK_UNINTERRUPTIBLE) ++ * or TASK_UNINTERRUPTIBLE) + * @timeout: the pre-initialized and started timer, or NULL for none + * @waiter: the pre-initialized rt_mutex_waiter + * +- * lock->wait_lock must be held by the caller. ++ * Must be called with lock->wait_lock held and interrupts disabled + */ + static int __sched + __rt_mutex_slowlock(struct rt_mutex *lock, int state, +@@ -1548,13 +1589,13 @@ __rt_mutex_slowlock(struct rt_mutex *lock, int state, + break; + } + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + + debug_rt_mutex_print_deadlock(waiter); + + schedule(); + +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irq(&lock->wait_lock); + set_current_state(state); + } + +@@ -1668,17 +1709,26 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, + struct ww_acquire_ctx *ww_ctx) + { + struct rt_mutex_waiter waiter; ++ unsigned long flags; + int ret = 0; + + rt_mutex_init_waiter(&waiter, false); + +- raw_spin_lock(&lock->wait_lock); ++ /* ++ * Technically we could use raw_spin_[un]lock_irq() here, but this can ++ * be called in early boot if the cmpxchg() fast path is disabled ++ * (debug, no architecture support). In this case we will acquire the ++ * rtmutex with lock->wait_lock held. But we cannot unconditionally ++ * enable interrupts in that early boot case. So we need to use the ++ * irqsave/restore variants. ++ */ ++ raw_spin_lock_irqsave(&lock->wait_lock, flags); + + /* Try to acquire the lock again: */ + if (try_to_take_rt_mutex(lock, current, NULL)) { + if (ww_ctx) + ww_mutex_account_lock(lock, ww_ctx); +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + return 0; + } + +@@ -1717,7 +1767,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, + */ + fixup_rt_mutex_waiters(lock); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + + /* Remove pending timer: */ + if (unlikely(timeout)) +@@ -1733,6 +1783,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, + */ + static inline int rt_mutex_slowtrylock(struct rt_mutex *lock) + { ++ unsigned long flags; + int ret; + + /* +@@ -1744,10 +1795,10 @@ static inline int rt_mutex_slowtrylock(struct rt_mutex *lock) + return 0; + + /* +- * The mutex has currently no owner. Lock the wait lock and +- * try to acquire the lock. ++ * The mutex has currently no owner. Lock the wait lock and try to ++ * acquire the lock. We use irqsave here to support early boot calls. + */ +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irqsave(&lock->wait_lock, flags); + + ret = try_to_take_rt_mutex(lock, current, NULL); + +@@ -1757,7 +1808,7 @@ static inline int rt_mutex_slowtrylock(struct rt_mutex *lock) + */ + fixup_rt_mutex_waiters(lock); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + + return ret; + } +@@ -1770,7 +1821,10 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, + struct wake_q_head *wake_q, + struct wake_q_head *wake_sleeper_q) + { +- raw_spin_lock(&lock->wait_lock); ++ unsigned long flags; ++ ++ /* irqsave required to support early boot calls */ ++ raw_spin_lock_irqsave(&lock->wait_lock, flags); + + debug_rt_mutex_unlock(lock); + +@@ -1809,10 +1863,10 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, + */ + while (!rt_mutex_has_waiters(lock)) { + /* Drops lock->wait_lock ! */ +- if (unlock_rt_mutex_safe(lock) == true) ++ if (unlock_rt_mutex_safe(lock, flags) == true) + return false; + /* Relock the rtmutex and try again */ +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irqsave(&lock->wait_lock, flags); + } + + /* +@@ -1823,7 +1877,7 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, + */ + mark_wakeup_next_waiter(wake_q, wake_sleeper_q, lock); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + + /* check PI boosting */ + return true; +@@ -2135,10 +2189,10 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock, + { + int ret; + +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irq(&lock->wait_lock); + + if (try_to_take_rt_mutex(lock, task, NULL)) { +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + return 1; + } + +@@ -2161,14 +2215,14 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock, + * PI_REQUEUE_INPROGRESS, so that if the task is waking up + * it will know that we are in the process of requeuing it. + */ +- raw_spin_lock_irq(&task->pi_lock); ++ raw_spin_lock(&task->pi_lock); + if (task->pi_blocked_on) { +- raw_spin_unlock_irq(&task->pi_lock); +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock(&task->pi_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + return -EAGAIN; + } + task->pi_blocked_on = PI_REQUEUE_INPROGRESS; +- raw_spin_unlock_irq(&task->pi_lock); ++ raw_spin_unlock(&task->pi_lock); + #endif + + /* We enforce deadlock detection for futexes */ +@@ -2188,7 +2242,7 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock, + if (ret && rt_mutex_has_waiters(lock)) + remove_waiter(lock, waiter); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + + debug_rt_mutex_print_deadlock(waiter); + +@@ -2236,7 +2290,7 @@ int rt_mutex_finish_proxy_lock(struct rt_mutex *lock, + { + int ret; + +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irq(&lock->wait_lock); + + set_current_state(TASK_INTERRUPTIBLE); + +@@ -2252,7 +2306,7 @@ int rt_mutex_finish_proxy_lock(struct rt_mutex *lock, + */ + fixup_rt_mutex_waiters(lock); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + + return ret; + } +diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c +index bfd9e09..fbb23f9 100644 +--- a/kernel/power/hibernate.c ++++ b/kernel/power/hibernate.c +@@ -648,6 +648,10 @@ static void power_down(void) + cpu_relax(); + } + ++#ifndef CONFIG_SUSPEND ++bool pm_in_action; ++#endif ++ + /** + * hibernate - Carry out system hibernation, including saving the image. + */ +@@ -660,6 +664,8 @@ int hibernate(void) + return -EPERM; + } + ++ pm_in_action = true; ++ + lock_system_sleep(); + /* The snapshot device should not be opened while we're running */ + if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { +@@ -725,6 +731,7 @@ int hibernate(void) + atomic_inc(&snapshot_device_available); + Unlock: + unlock_system_sleep(); ++ pm_in_action = false; + return error; + } + +diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c +index 80ebc07..393bc34 100644 +--- a/kernel/power/suspend.c ++++ b/kernel/power/suspend.c +@@ -522,6 +522,8 @@ static int enter_state(suspend_state_t state) + return error; + } + ++bool pm_in_action; ++ + /** + * pm_suspend - Externally visible function for suspending the system. + * @state: System sleep state to enter. +@@ -536,6 +538,8 @@ int pm_suspend(suspend_state_t state) + if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX) + return -EINVAL; + ++ pm_in_action = true; ++ + error = enter_state(state); + if (error) { + suspend_stats.fail++; +@@ -543,6 +547,7 @@ int pm_suspend(suspend_state_t state) + } else { + suspend_stats.success++; + } ++ pm_in_action = false; + return error; + } + EXPORT_SYMBOL(pm_suspend); +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index 69fbfde..f75e4b0 100644 +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -241,6 +241,65 @@ struct printk_log { + */ + static DEFINE_RAW_SPINLOCK(logbuf_lock); + ++#ifdef CONFIG_EARLY_PRINTK ++struct console *early_console; ++ ++static void early_vprintk(const char *fmt, va_list ap) ++{ ++ if (early_console) { ++ char buf[512]; ++ int n = vscnprintf(buf, sizeof(buf), fmt, ap); ++ ++ early_console->write(early_console, buf, n); ++ } ++} ++ ++asmlinkage void early_printk(const char *fmt, ...) ++{ ++ va_list ap; ++ ++ va_start(ap, fmt); ++ early_vprintk(fmt, ap); ++ va_end(ap); ++} ++ ++/* ++ * This is independent of any log levels - a global ++ * kill switch that turns off all of printk. ++ * ++ * Used by the NMI watchdog if early-printk is enabled. ++ */ ++static bool __read_mostly printk_killswitch; ++ ++static int __init force_early_printk_setup(char *str) ++{ ++ printk_killswitch = true; ++ return 0; ++} ++early_param("force_early_printk", force_early_printk_setup); ++ ++void printk_kill(void) ++{ ++ printk_killswitch = true; ++} ++ ++#ifdef CONFIG_PRINTK ++static int forced_early_printk(const char *fmt, va_list ap) ++{ ++ if (!printk_killswitch) ++ return 0; ++ early_vprintk(fmt, ap); ++ return 1; ++} ++#endif ++ ++#else ++static inline int forced_early_printk(const char *fmt, va_list ap) ++{ ++ return 0; ++} ++#endif ++ + #ifdef CONFIG_PRINTK + DECLARE_WAIT_QUEUE_HEAD(log_wait); + /* the next printk record to read by syslog(READ) or /proc/kmsg */ +@@ -1692,62 +1751,6 @@ static size_t cont_print_text(char *text, size_t size) + return textlen; + } + +-#ifdef CONFIG_EARLY_PRINTK +-struct console *early_console; +- +-static void early_vprintk(const char *fmt, va_list ap) +-{ +- if (early_console) { +- char buf[512]; +- int n = vscnprintf(buf, sizeof(buf), fmt, ap); +- +- early_console->write(early_console, buf, n); +- } +-} +- +-asmlinkage void early_printk(const char *fmt, ...) +-{ +- va_list ap; +- +- va_start(ap, fmt); +- early_vprintk(fmt, ap); +- va_end(ap); +-} +- +-/* +- * This is independent of any log levels - a global +- * kill switch that turns off all of printk. +- * +- * Used by the NMI watchdog if early-printk is enabled. +- */ +-static bool __read_mostly printk_killswitch; +- +-static int __init force_early_printk_setup(char *str) +-{ +- printk_killswitch = true; +- return 0; +-} +-early_param("force_early_printk", force_early_printk_setup); +- +-void printk_kill(void) +-{ +- printk_killswitch = true; +-} +- +-static int forced_early_printk(const char *fmt, va_list ap) +-{ +- if (!printk_killswitch) +- return 0; +- early_vprintk(fmt, ap); +- return 1; +-} +-#else +-static inline int forced_early_printk(const char *fmt, va_list ap) +-{ +- return 0; +-} +-#endif +- + asmlinkage int vprintk_emit(int facility, int level, + const char *dict, size_t dictlen, + const char *fmt, va_list args) +@@ -2410,7 +2413,6 @@ skip: + start_critical_timings(); + local_irq_restore(flags); + #endif +- + if (do_cond_resched) + cond_resched(); + } +diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c +index d89328e..5bb3364 100644 +--- a/kernel/rcu/rcutorture.c ++++ b/kernel/rcu/rcutorture.c +@@ -390,6 +390,7 @@ static struct rcu_torture_ops rcu_ops = { + .name = "rcu" + }; + ++#ifndef CONFIG_PREEMPT_RT_FULL + /* + * Definitions for rcu_bh torture testing. + */ +@@ -429,6 +430,12 @@ static struct rcu_torture_ops rcu_bh_ops = { + .name = "rcu_bh" + }; + ++#else ++static struct rcu_torture_ops rcu_bh_ops = { ++ .ttype = INVALID_RCU_FLAVOR, ++}; ++#endif ++ + /* + * Don't even think about trying any of these in real life!!! + * The names includes "busted", and they really means it! +diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c +index 5359091..d862a20 100644 +--- a/kernel/rcu/tree.c ++++ b/kernel/rcu/tree.c +@@ -454,11 +454,13 @@ EXPORT_SYMBOL_GPL(rcu_batches_started_sched); + /* + * Return the number of RCU BH batches started thus far for debug & stats. + */ ++#ifndef CONFIG_PREEMPT_RT_FULL + unsigned long rcu_batches_started_bh(void) + { + return rcu_bh_state.gpnum; + } + EXPORT_SYMBOL_GPL(rcu_batches_started_bh); ++#endif + + /* + * Return the number of RCU batches completed thus far for debug & stats. +@@ -563,9 +565,11 @@ void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags, + case RCU_FLAVOR: + rsp = rcu_state_p; + break; ++#ifndef CONFIG_PREEMPT_RT_FULL + case RCU_BH_FLAVOR: + rsp = &rcu_bh_state; + break; ++#endif + case RCU_SCHED_FLAVOR: + rsp = &rcu_sched_state; + break; +@@ -1617,7 +1621,6 @@ static int rcu_future_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp) + int needmore; + struct rcu_data *rdp = this_cpu_ptr(rsp->rda); + +- rcu_nocb_gp_cleanup(rsp, rnp); + rnp->need_future_gp[c & 0x1] = 0; + needmore = rnp->need_future_gp[(c + 1) & 0x1]; + trace_rcu_future_gp(rnp, rdp, c, +@@ -1638,7 +1641,7 @@ static void rcu_gp_kthread_wake(struct rcu_state *rsp) + !READ_ONCE(rsp->gp_flags) || + !rsp->gp_kthread) + return; +- swait_wake(&rsp->gp_wq); ++ swake_up(&rsp->gp_wq); + } + + /* +@@ -2018,6 +2021,7 @@ static void rcu_gp_cleanup(struct rcu_state *rsp) + int nocb = 0; + struct rcu_data *rdp; + struct rcu_node *rnp = rcu_get_root(rsp); ++ struct swait_queue_head *sq; + + WRITE_ONCE(rsp->gp_activity, jiffies); + raw_spin_lock_irq(&rnp->lock); +@@ -2056,7 +2060,9 @@ static void rcu_gp_cleanup(struct rcu_state *rsp) + needgp = __note_gp_changes(rsp, rnp, rdp) || needgp; + /* smp_mb() provided by prior unlock-lock pair. */ + nocb += rcu_future_gp_cleanup(rsp, rnp); ++ sq = rcu_nocb_gp_get(rnp); + raw_spin_unlock_irq(&rnp->lock); ++ rcu_nocb_gp_cleanup(sq); + cond_resched_rcu_qs(); + WRITE_ONCE(rsp->gp_activity, jiffies); + rcu_gp_slow(rsp, gp_cleanup_delay); +@@ -2257,7 +2263,7 @@ static void rcu_report_qs_rsp(struct rcu_state *rsp, unsigned long flags) + WARN_ON_ONCE(!rcu_gp_in_progress(rsp)); + WRITE_ONCE(rsp->gp_flags, READ_ONCE(rsp->gp_flags) | RCU_GP_FLAG_FQS); + raw_spin_unlock_irqrestore(&rcu_get_root(rsp)->lock, flags); +- rcu_gp_kthread_wake(rsp); ++ swake_up(&rsp->gp_wq); /* Memory barrier implied by swake_up() path. */ + } + + /* +@@ -2918,7 +2924,7 @@ static void force_quiescent_state(struct rcu_state *rsp) + } + WRITE_ONCE(rsp->gp_flags, READ_ONCE(rsp->gp_flags) | RCU_GP_FLAG_FQS); + raw_spin_unlock_irqrestore(&rnp_old->lock, flags); +- rcu_gp_kthread_wake(rsp); ++ swake_up(&rsp->gp_wq); /* Memory barrier implied by swake_up() path. */ + } + + /* +@@ -3641,7 +3647,7 @@ static void __rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp, + raw_spin_unlock_irqrestore(&rnp->lock, flags); + if (wake) { + smp_mb(); /* EGP done before wake_up(). */ +- swait_wake(&rsp->expedited_wq); ++ swake_up(&rsp->expedited_wq); + } + break; + } +@@ -3898,7 +3904,7 @@ static void synchronize_sched_expedited_wait(struct rcu_state *rsp) + jiffies_start = jiffies; + + for (;;) { +- ret = swait_event_interruptible_timeout( ++ ret = swait_event_timeout( + rsp->expedited_wq, + sync_rcu_preempt_exp_done(rnp_root), + jiffies_stall); +@@ -4574,8 +4580,8 @@ static void __init rcu_init_one(struct rcu_state *rsp, + } + } + +- init_swait_head(&rsp->gp_wq); +- init_swait_head(&rsp->expedited_wq); ++ init_swait_queue_head(&rsp->gp_wq); ++ init_swait_queue_head(&rsp->expedited_wq); + rnp = rsp->level[rcu_num_lvls - 1]; + for_each_possible_cpu(i) { + while (i > rnp->grphi) +@@ -4695,7 +4701,9 @@ void __init rcu_init(void) + + rcu_bootup_announce(); + rcu_init_geometry(); ++#ifndef CONFIG_PREEMPT_RT_FULL + rcu_init_one(&rcu_bh_state, &rcu_bh_data); ++#endif + rcu_init_one(&rcu_sched_state, &rcu_sched_data); + if (dump_tree) + rcu_dump_rcu_node_tree(&rcu_sched_state); +diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h +index 588509d..c75834d 100644 +--- a/kernel/rcu/tree.h ++++ b/kernel/rcu/tree.h +@@ -27,8 +27,8 @@ + #include + #include + #include ++#include + #include +-#include + + /* + * Define shape of hierarchy based on NR_CPUS, CONFIG_RCU_FANOUT, and +@@ -242,7 +242,7 @@ struct rcu_node { + /* Refused to boost: not sure why, though. */ + /* This can happen due to race conditions. */ + #ifdef CONFIG_RCU_NOCB_CPU +- struct swait_head nocb_gp_wq[2]; ++ struct swait_queue_head nocb_gp_wq[2]; + /* Place for rcu_nocb_kthread() to wait GP. */ + #endif /* #ifdef CONFIG_RCU_NOCB_CPU */ + int need_future_gp[2]; +@@ -394,7 +394,7 @@ struct rcu_data { + atomic_long_t nocb_q_count_lazy; /* invocation (all stages). */ + struct rcu_head *nocb_follower_head; /* CBs ready to invoke. */ + struct rcu_head **nocb_follower_tail; +- struct swait_head nocb_wq; /* For nocb kthreads to sleep on. */ ++ struct swait_queue_head nocb_wq; /* For nocb kthreads to sleep on. */ + struct task_struct *nocb_kthread; + int nocb_defer_wakeup; /* Defer wakeup of nocb_kthread. */ + +@@ -473,7 +473,7 @@ struct rcu_state { + unsigned long gpnum; /* Current gp number. */ + unsigned long completed; /* # of last completed gp. */ + struct task_struct *gp_kthread; /* Task for grace periods. */ +- struct swait_head gp_wq; /* Where GP task waits. */ ++ struct swait_queue_head gp_wq; /* Where GP task waits. */ + short gp_flags; /* Commands for GP task. */ + short gp_state; /* GP kthread sleep state. */ + +@@ -505,7 +505,7 @@ struct rcu_state { + atomic_long_t expedited_workdone3; /* # done by others #3. */ + atomic_long_t expedited_normal; /* # fallbacks to normal. */ + atomic_t expedited_need_qs; /* # CPUs left to check in. */ +- struct swait_head expedited_wq; /* Wait for check-ins. */ ++ struct swait_queue_head expedited_wq; /* Wait for check-ins. */ + int ncpus_snap; /* # CPUs seen last time. */ + + unsigned long jiffies_force_qs; /* Time at which to invoke */ +@@ -557,7 +557,9 @@ extern struct list_head rcu_struct_flavors; + */ + extern struct rcu_state rcu_sched_state; + ++#ifndef CONFIG_PREEMPT_RT_FULL + extern struct rcu_state rcu_bh_state; ++#endif + + #ifdef CONFIG_PREEMPT_RCU + extern struct rcu_state rcu_preempt_state; +@@ -605,7 +607,8 @@ static void zero_cpu_stall_ticks(struct rcu_data *rdp); + static void increment_cpu_stall_ticks(void); + static bool rcu_nocb_cpu_needs_barrier(struct rcu_state *rsp, int cpu); + static void rcu_nocb_gp_set(struct rcu_node *rnp, int nrq); +-static void rcu_nocb_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp); ++static struct swait_queue_head *rcu_nocb_gp_get(struct rcu_node *rnp); ++static void rcu_nocb_gp_cleanup(struct swait_queue_head *sq); + static void rcu_init_one_nocb(struct rcu_node *rnp); + static bool __call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *rhp, + bool lazy, unsigned long flags); +diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h +index 0d2f27f2..8e119cf 100644 +--- a/kernel/rcu/tree_plugin.h ++++ b/kernel/rcu/tree_plugin.h +@@ -1717,9 +1717,9 @@ early_param("rcu_nocb_poll", parse_rcu_nocb_poll); + * Wake up any no-CBs CPUs' kthreads that were waiting on the just-ended + * grace period. + */ +-static void rcu_nocb_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp) ++static void rcu_nocb_gp_cleanup(struct swait_queue_head *sq) + { +- swait_wake_all(&rnp->nocb_gp_wq[rnp->completed & 0x1]); ++ swake_up_all(sq); + } + + /* +@@ -1735,10 +1735,15 @@ static void rcu_nocb_gp_set(struct rcu_node *rnp, int nrq) + rnp->need_future_gp[(rnp->completed + 1) & 0x1] += nrq; + } + ++static struct swait_queue_head *rcu_nocb_gp_get(struct rcu_node *rnp) ++{ ++ return &rnp->nocb_gp_wq[rnp->completed & 0x1]; ++} ++ + static void rcu_init_one_nocb(struct rcu_node *rnp) + { +- init_swait_head(&rnp->nocb_gp_wq[0]); +- init_swait_head(&rnp->nocb_gp_wq[1]); ++ init_swait_queue_head(&rnp->nocb_gp_wq[0]); ++ init_swait_queue_head(&rnp->nocb_gp_wq[1]); + } + + #ifndef CONFIG_RCU_NOCB_CPU_ALL +@@ -1763,7 +1768,7 @@ static void wake_nocb_leader(struct rcu_data *rdp, bool force) + if (READ_ONCE(rdp_leader->nocb_leader_sleep) || force) { + /* Prior smp_mb__after_atomic() orders against prior enqueue. */ + WRITE_ONCE(rdp_leader->nocb_leader_sleep, false); +- swait_wake(&rdp_leader->nocb_wq); ++ swake_up(&rdp_leader->nocb_wq); + } + } + +@@ -2079,7 +2084,7 @@ wait_again: + * List was empty, wake up the follower. + * Memory barriers supplied by atomic_long_add(). + */ +- swait_wake(&rdp->nocb_wq); ++ swake_up(&rdp->nocb_wq); + } + } + +@@ -2259,7 +2264,7 @@ void __init rcu_init_nohz(void) + static void __init rcu_boot_init_nocb_percpu_data(struct rcu_data *rdp) + { + rdp->nocb_tail = &rdp->nocb_head; +- init_swait_head(&rdp->nocb_wq); ++ init_swait_queue_head(&rdp->nocb_wq); + rdp->nocb_follower_tail = &rdp->nocb_follower_head; + } + +@@ -2409,7 +2414,7 @@ static bool rcu_nocb_cpu_needs_barrier(struct rcu_state *rsp, int cpu) + return false; + } + +-static void rcu_nocb_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp) ++static void rcu_nocb_gp_cleanup(struct swait_queue_head *sq) + { + } + +@@ -2417,6 +2422,11 @@ static void rcu_nocb_gp_set(struct rcu_node *rnp, int nrq) + { + } + ++static struct swait_queue_head *rcu_nocb_gp_get(struct rcu_node *rnp) ++{ ++ return NULL; ++} ++ + static void rcu_init_one_nocb(struct rcu_node *rnp) + { + } +diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile +index a22fdb6..debedbe 100644 +--- a/kernel/sched/Makefile ++++ b/kernel/sched/Makefile +@@ -13,7 +13,7 @@ endif + + obj-y += core.o loadavg.o clock.o cputime.o + obj-y += idle_task.o fair.o rt.o deadline.o stop_task.o +-obj-y += wait.o wait-simple.o work-simple.o completion.o idle.o ++obj-y += wait.o swait.o work-simple.o completion.o idle.o + obj-$(CONFIG_SMP) += cpupri.o cpudeadline.o + obj-$(CONFIG_SCHED_AUTOGROUP) += auto_group.o + obj-$(CONFIG_SCHEDSTATS) += stats.o +diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c +index 45ebcff..b62cf64 100644 +--- a/kernel/sched/completion.c ++++ b/kernel/sched/completion.c +@@ -32,7 +32,7 @@ void complete(struct completion *x) + + raw_spin_lock_irqsave(&x->wait.lock, flags); + x->done++; +- __swait_wake_locked(&x->wait, TASK_NORMAL, 1); ++ swake_up_locked(&x->wait); + raw_spin_unlock_irqrestore(&x->wait.lock, flags); + } + EXPORT_SYMBOL(complete); +@@ -52,7 +52,7 @@ void complete_all(struct completion *x) + + raw_spin_lock_irqsave(&x->wait.lock, flags); + x->done += UINT_MAX/2; +- __swait_wake_locked(&x->wait, TASK_NORMAL, 0); ++ swake_up_all_locked(&x->wait); + raw_spin_unlock_irqrestore(&x->wait.lock, flags); + } + EXPORT_SYMBOL(complete_all); +@@ -62,9 +62,9 @@ do_wait_for_common(struct completion *x, + long (*action)(long), long timeout, int state) + { + if (!x->done) { +- DEFINE_SWAITER(wait); ++ DECLARE_SWAITQUEUE(wait); + +- swait_prepare_locked(&x->wait, &wait); ++ __prepare_to_swait(&x->wait, &wait); + do { + if (signal_pending_state(state, current)) { + timeout = -ERESTARTSYS; +@@ -75,7 +75,7 @@ do_wait_for_common(struct completion *x, + timeout = action(timeout); + raw_spin_lock_irq(&x->wait.lock); + } while (!x->done && timeout); +- swait_finish_locked(&x->wait, &wait); ++ __finish_swait(&x->wait, &wait); + if (!x->done) + return timeout; + } +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index b2959ea..94827a5 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -3039,16 +3039,6 @@ u64 scheduler_tick_max_deferment(void) + } + #endif + +-notrace unsigned long get_parent_ip(unsigned long addr) +-{ +- if (in_lock_functions(addr)) { +- addr = CALLER_ADDR2; +- if (in_lock_functions(addr)) +- addr = CALLER_ADDR3; +- } +- return addr; +-} +- + #if defined(CONFIG_PREEMPT) && (defined(CONFIG_DEBUG_PREEMPT) || \ + defined(CONFIG_PREEMPT_TRACER)) + +@@ -3070,7 +3060,7 @@ void preempt_count_add(int val) + PREEMPT_MASK - 10); + #endif + if (preempt_count() == val) { +- unsigned long ip = get_parent_ip(CALLER_ADDR1); ++ unsigned long ip = get_lock_parent_ip(); + #ifdef CONFIG_DEBUG_PREEMPT + current->preempt_disable_ip = ip; + #endif +@@ -3097,7 +3087,7 @@ void preempt_count_sub(int val) + #endif + + if (preempt_count() == val) +- trace_preempt_on(CALLER_ADDR0, get_parent_ip(CALLER_ADDR1)); ++ trace_preempt_on(CALLER_ADDR0, get_lock_parent_ip()); + __preempt_count_sub(val); + } + EXPORT_SYMBOL(preempt_count_sub); +@@ -3157,7 +3147,7 @@ void migrate_disable(void) + { + struct task_struct *p = current; + +- if (in_atomic()) { ++ if (in_atomic() || irqs_disabled()) { + #ifdef CONFIG_SCHED_DEBUG + p->migrate_disable_atomic++; + #endif +@@ -3180,7 +3170,6 @@ void migrate_disable(void) + preempt_lazy_disable(); + pin_current_cpu(); + p->migrate_disable = 1; +- p->nr_cpus_allowed = 1; + preempt_enable(); + } + EXPORT_SYMBOL(migrate_disable); +@@ -3189,7 +3178,7 @@ void migrate_enable(void) + { + struct task_struct *p = current; + +- if (in_atomic()) { ++ if (in_atomic() || irqs_disabled()) { + #ifdef CONFIG_SCHED_DEBUG + p->migrate_disable_atomic--; + #endif +@@ -3470,7 +3459,7 @@ static void __sched notrace preempt_schedule_common(void) + * set by a RT task. Oterwise we try to avoid beeing scheduled out as long as + * preempt_lazy_count counter >0. + */ +-static int preemptible_lazy(void) ++static __always_inline int preemptible_lazy(void) + { + if (test_thread_flag(TIF_NEED_RESCHED)) + return 1; +diff --git a/kernel/sched/swait.c b/kernel/sched/swait.c +new file mode 100644 +index 0000000..205fe36 +--- /dev/null ++++ b/kernel/sched/swait.c +@@ -0,0 +1,143 @@ ++#include ++#include ++#include ++ ++void __init_swait_queue_head(struct swait_queue_head *q, const char *name, ++ struct lock_class_key *key) ++{ ++ raw_spin_lock_init(&q->lock); ++ lockdep_set_class_and_name(&q->lock, key, name); ++ INIT_LIST_HEAD(&q->task_list); ++} ++EXPORT_SYMBOL(__init_swait_queue_head); ++ ++/* ++ * The thing about the wake_up_state() return value; I think we can ignore it. ++ * ++ * If for some reason it would return 0, that means the previously waiting ++ * task is already running, so it will observe condition true (or has already). ++ */ ++void swake_up_locked(struct swait_queue_head *q) ++{ ++ struct swait_queue *curr; ++ ++ if (list_empty(&q->task_list)) ++ return; ++ ++ curr = list_first_entry(&q->task_list, typeof(*curr), task_list); ++ wake_up_process(curr->task); ++ list_del_init(&curr->task_list); ++} ++EXPORT_SYMBOL(swake_up_locked); ++ ++void swake_up_all_locked(struct swait_queue_head *q) ++{ ++ struct swait_queue *curr; ++ int wakes = 0; ++ ++ while (!list_empty(&q->task_list)) { ++ ++ curr = list_first_entry(&q->task_list, typeof(*curr), ++ task_list); ++ wake_up_process(curr->task); ++ list_del_init(&curr->task_list); ++ wakes++; ++ } ++ if (pm_in_action) ++ return; ++ WARN(wakes > 2, "complate_all() with %d waiters\n", wakes); ++} ++EXPORT_SYMBOL(swake_up_all_locked); ++ ++void swake_up(struct swait_queue_head *q) ++{ ++ unsigned long flags; ++ ++ if (!swait_active(q)) ++ return; ++ ++ raw_spin_lock_irqsave(&q->lock, flags); ++ swake_up_locked(q); ++ raw_spin_unlock_irqrestore(&q->lock, flags); ++} ++EXPORT_SYMBOL(swake_up); ++ ++/* ++ * Does not allow usage from IRQ disabled, since we must be able to ++ * release IRQs to guarantee bounded hold time. ++ */ ++void swake_up_all(struct swait_queue_head *q) ++{ ++ struct swait_queue *curr; ++ LIST_HEAD(tmp); ++ ++ if (!swait_active(q)) ++ return; ++ ++ raw_spin_lock_irq(&q->lock); ++ list_splice_init(&q->task_list, &tmp); ++ while (!list_empty(&tmp)) { ++ curr = list_first_entry(&tmp, typeof(*curr), task_list); ++ ++ wake_up_state(curr->task, TASK_NORMAL); ++ list_del_init(&curr->task_list); ++ ++ if (list_empty(&tmp)) ++ break; ++ ++ raw_spin_unlock_irq(&q->lock); ++ raw_spin_lock_irq(&q->lock); ++ } ++ raw_spin_unlock_irq(&q->lock); ++} ++EXPORT_SYMBOL(swake_up_all); ++ ++void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait) ++{ ++ wait->task = current; ++ if (list_empty(&wait->task_list)) ++ list_add(&wait->task_list, &q->task_list); ++} ++ ++void prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait, int state) ++{ ++ unsigned long flags; ++ ++ raw_spin_lock_irqsave(&q->lock, flags); ++ __prepare_to_swait(q, wait); ++ set_current_state(state); ++ raw_spin_unlock_irqrestore(&q->lock, flags); ++} ++EXPORT_SYMBOL(prepare_to_swait); ++ ++long prepare_to_swait_event(struct swait_queue_head *q, struct swait_queue *wait, int state) ++{ ++ if (signal_pending_state(state, current)) ++ return -ERESTARTSYS; ++ ++ prepare_to_swait(q, wait, state); ++ ++ return 0; ++} ++EXPORT_SYMBOL(prepare_to_swait_event); ++ ++void __finish_swait(struct swait_queue_head *q, struct swait_queue *wait) ++{ ++ __set_current_state(TASK_RUNNING); ++ if (!list_empty(&wait->task_list)) ++ list_del_init(&wait->task_list); ++} ++ ++void finish_swait(struct swait_queue_head *q, struct swait_queue *wait) ++{ ++ unsigned long flags; ++ ++ __set_current_state(TASK_RUNNING); ++ ++ if (!list_empty_careful(&wait->task_list)) { ++ raw_spin_lock_irqsave(&q->lock, flags); ++ list_del_init(&wait->task_list); ++ raw_spin_unlock_irqrestore(&q->lock, flags); ++ } ++} ++EXPORT_SYMBOL(finish_swait); +diff --git a/kernel/sched/wait-simple.c b/kernel/sched/wait-simple.c +deleted file mode 100644 +index 7dfa86d..0000000 +--- a/kernel/sched/wait-simple.c ++++ /dev/null +@@ -1,115 +0,0 @@ +-/* +- * Simple waitqueues without fancy flags and callbacks +- * +- * (C) 2011 Thomas Gleixner +- * +- * Based on kernel/wait.c +- * +- * For licencing details see kernel-base/COPYING +- */ +-#include +-#include +-#include +-#include +- +-/* Adds w to head->list. Must be called with head->lock locked. */ +-static inline void __swait_enqueue(struct swait_head *head, struct swaiter *w) +-{ +- list_add(&w->node, &head->list); +- /* We can't let the condition leak before the setting of head */ +- smp_mb(); +-} +- +-/* Removes w from head->list. Must be called with head->lock locked. */ +-static inline void __swait_dequeue(struct swaiter *w) +-{ +- list_del_init(&w->node); +-} +- +-void __init_swait_head(struct swait_head *head, struct lock_class_key *key) +-{ +- raw_spin_lock_init(&head->lock); +- lockdep_set_class(&head->lock, key); +- INIT_LIST_HEAD(&head->list); +-} +-EXPORT_SYMBOL(__init_swait_head); +- +-void swait_prepare_locked(struct swait_head *head, struct swaiter *w) +-{ +- w->task = current; +- if (list_empty(&w->node)) +- __swait_enqueue(head, w); +-} +- +-void swait_prepare(struct swait_head *head, struct swaiter *w, int state) +-{ +- unsigned long flags; +- +- raw_spin_lock_irqsave(&head->lock, flags); +- swait_prepare_locked(head, w); +- __set_current_state(state); +- raw_spin_unlock_irqrestore(&head->lock, flags); +-} +-EXPORT_SYMBOL(swait_prepare); +- +-void swait_finish_locked(struct swait_head *head, struct swaiter *w) +-{ +- __set_current_state(TASK_RUNNING); +- if (w->task) +- __swait_dequeue(w); +-} +- +-void swait_finish(struct swait_head *head, struct swaiter *w) +-{ +- unsigned long flags; +- +- __set_current_state(TASK_RUNNING); +- if (w->task) { +- raw_spin_lock_irqsave(&head->lock, flags); +- __swait_dequeue(w); +- raw_spin_unlock_irqrestore(&head->lock, flags); +- } +-} +-EXPORT_SYMBOL(swait_finish); +- +-unsigned int +-__swait_wake_locked(struct swait_head *head, unsigned int state, unsigned int num) +-{ +- struct swaiter *curr, *next; +- int woken = 0; +- +- list_for_each_entry_safe(curr, next, &head->list, node) { +- if (wake_up_state(curr->task, state)) { +- __swait_dequeue(curr); +- /* +- * The waiting task can free the waiter as +- * soon as curr->task = NULL is written, +- * without taking any locks. A memory barrier +- * is required here to prevent the following +- * store to curr->task from getting ahead of +- * the dequeue operation. +- */ +- smp_wmb(); +- curr->task = NULL; +- if (++woken == num) +- break; +- } +- } +- return woken; +-} +- +-unsigned int +-__swait_wake(struct swait_head *head, unsigned int state, unsigned int num) +-{ +- unsigned long flags; +- int woken; +- +- if (!swaitqueue_active(head)) +- return 0; +- +- raw_spin_lock_irqsave(&head->lock, flags); +- woken = __swait_wake_locked(head, state, num); +- raw_spin_unlock_irqrestore(&head->lock, flags); +- return woken; +-} +-EXPORT_SYMBOL(__swait_wake); +diff --git a/kernel/sched/work-simple.c b/kernel/sched/work-simple.c +index e57a052..9ffe405 100644 +--- a/kernel/sched/work-simple.c ++++ b/kernel/sched/work-simple.c +@@ -5,7 +5,7 @@ + * PREEMPT_RT_FULL safe. The callbacks are executed in kthread context. + */ + +-#include ++#include + #include + #include + #include +@@ -19,7 +19,7 @@ static struct sworker *glob_worker; + + struct sworker { + struct list_head events; +- struct swait_head wq; ++ struct swait_queue_head wq; + + raw_spinlock_t lock; + +@@ -80,7 +80,7 @@ static struct sworker *swork_create(void) + + INIT_LIST_HEAD(&worker->events); + raw_spin_lock_init(&worker->lock); +- init_swait_head(&worker->wq); ++ init_swait_queue_head(&worker->wq); + + worker->task = kthread_run(swork_kthread, worker, "kswork"); + if (IS_ERR(worker->task)) { +@@ -117,7 +117,7 @@ bool swork_queue(struct swork_event *sev) + list_add_tail(&sev->item, &glob_worker->events); + raw_spin_unlock_irqrestore(&glob_worker->lock, flags); + +- swait_wake(&glob_worker->wq); ++ swake_up(&glob_worker->wq); + return true; + } + EXPORT_SYMBOL_GPL(swork_queue); +diff --git a/kernel/softirq.c b/kernel/softirq.c +index d1e999e..cb9c1d5 100644 +--- a/kernel/softirq.c ++++ b/kernel/softirq.c +@@ -287,9 +287,9 @@ void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) + + if (preempt_count() == cnt) { + #ifdef CONFIG_DEBUG_PREEMPT +- current->preempt_disable_ip = get_parent_ip(CALLER_ADDR1); ++ current->preempt_disable_ip = get_lock_parent_ip(); + #endif +- trace_preempt_off(CALLER_ADDR0, get_parent_ip(CALLER_ADDR1)); ++ trace_preempt_off(CALLER_ADDR0, get_lock_parent_ip()); + } + } + EXPORT_SYMBOL(__local_bh_disable_ip); +@@ -563,8 +563,10 @@ static void do_current_softirqs(void) + do_single_softirq(i); + } + softirq_clr_runner(i); +- unlock_softirq(i); + WARN_ON(current->softirq_nestcnt != 1); ++ local_irq_enable(); ++ unlock_softirq(i); ++ local_irq_disable(); + } + } + +diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c +index 2c5acc8..f84d3b4 100644 +--- a/kernel/stop_machine.c ++++ b/kernel/stop_machine.c +@@ -30,7 +30,7 @@ struct cpu_stop_done { + atomic_t nr_todo; /* nr left to execute */ + bool executed; /* actually executed? */ + int ret; /* collected return value */ +- struct task_struct *waiter; /* woken when nr_todo reaches 0 */ ++ struct completion completion; /* fired if nr_todo reaches 0 */ + }; + + /* the actual stopper, one per every possible cpu, enabled on online cpus */ +@@ -59,7 +59,7 @@ static void cpu_stop_init_done(struct cpu_stop_done *done, unsigned int nr_todo) + { + memset(done, 0, sizeof(*done)); + atomic_set(&done->nr_todo, nr_todo); +- done->waiter = current; ++ init_completion(&done->completion); + } + + /* signal completion unless @done is NULL */ +@@ -68,10 +68,8 @@ static void cpu_stop_signal_done(struct cpu_stop_done *done, bool executed) + if (done) { + if (executed) + done->executed = true; +- if (atomic_dec_and_test(&done->nr_todo)) { +- wake_up_process(done->waiter); +- done->waiter = NULL; +- } ++ if (atomic_dec_and_test(&done->nr_todo)) ++ complete(&done->completion); + } + } + +@@ -96,22 +94,6 @@ static void cpu_stop_queue_work(unsigned int cpu, struct cpu_stop_work *work) + raw_spin_unlock_irqrestore(&stopper->lock, flags); + } + +-static void wait_for_stop_done(struct cpu_stop_done *done) +-{ +- set_current_state(TASK_UNINTERRUPTIBLE); +- while (atomic_read(&done->nr_todo)) { +- schedule(); +- set_current_state(TASK_UNINTERRUPTIBLE); +- } +- /* +- * We need to wait until cpu_stop_signal_done() has cleared +- * done->waiter. +- */ +- while (done->waiter) +- cpu_relax(); +- set_current_state(TASK_RUNNING); +-} +- + /** + * stop_one_cpu - stop a cpu + * @cpu: cpu to stop +@@ -143,7 +125,7 @@ int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg) + + cpu_stop_init_done(&done, 1); + cpu_stop_queue_work(cpu, &work); +- wait_for_stop_done(&done); ++ wait_for_completion(&done.completion); + return done.executed ? done.ret : -ENOENT; + } + +@@ -302,7 +284,7 @@ int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void * + + preempt_enable_nort(); + +- wait_for_stop_done(&done); ++ wait_for_completion(&done.completion); + + return done.executed ? done.ret : -ENOENT; + } +@@ -364,7 +346,7 @@ static int __stop_cpus(const struct cpumask *cpumask, + + cpu_stop_init_done(&done, cpumask_weight(cpumask)); + queue_stop_cpus_work(cpumask, fn, arg, &done, false); +- wait_for_stop_done(&done); ++ wait_for_completion(&done.completion); + return done.executed ? done.ret : -ENOENT; + } + +@@ -495,13 +477,7 @@ repeat: + kallsyms_lookup((unsigned long)fn, NULL, NULL, NULL, + ksym_buf), arg); + +- /* +- * Make sure that the wakeup and setting done->waiter +- * to NULL is atomic. +- */ +- local_irq_disable(); + cpu_stop_signal_done(done, true); +- local_irq_enable(); + goto repeat; + } + } +@@ -663,7 +639,7 @@ int stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data, + ret = multi_cpu_stop(&msdata); + + /* Busy wait for completion. */ +- while (atomic_read(&done.nr_todo)) ++ while (!completion_done(&done.completion)) + cpu_relax(); + + mutex_unlock(&stop_cpus_mutex); +diff --git a/kernel/time/tick-broadcast-hrtimer.c b/kernel/time/tick-broadcast-hrtimer.c +index 53d7184..1b4ac33 100644 +--- a/kernel/time/tick-broadcast-hrtimer.c ++++ b/kernel/time/tick-broadcast-hrtimer.c +@@ -106,5 +106,6 @@ void tick_setup_hrtimer_broadcast(void) + { + hrtimer_init(&bctimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); + bctimer.function = bc_handler; ++ bctimer.irqsafe = true; + clockevents_register_device(&ce_broadcast_hrtimer); + } +diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c +index 36e584f..069942c 100644 +--- a/kernel/trace/trace_irqsoff.c ++++ b/kernel/trace/trace_irqsoff.c +@@ -421,13 +421,13 @@ void start_critical_timings(void) + { + if (preempt_trace() || irq_trace()) + start_critical_timing(CALLER_ADDR0, CALLER_ADDR1); +- trace_preemptirqsoff_hist(TRACE_START, 1); ++ trace_preemptirqsoff_hist_rcuidle(TRACE_START, 1); + } + EXPORT_SYMBOL_GPL(start_critical_timings); + + void stop_critical_timings(void) + { +- trace_preemptirqsoff_hist(TRACE_STOP, 0); ++ trace_preemptirqsoff_hist_rcuidle(TRACE_STOP, 0); + if (preempt_trace() || irq_trace()) + stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1); + } +@@ -437,7 +437,7 @@ EXPORT_SYMBOL_GPL(stop_critical_timings); + #ifdef CONFIG_PROVE_LOCKING + void time_hardirqs_on(unsigned long a0, unsigned long a1) + { +- trace_preemptirqsoff_hist(IRQS_ON, 0); ++ trace_preemptirqsoff_hist_rcuidle(IRQS_ON, 0); + if (!preempt_trace() && irq_trace()) + stop_critical_timing(a0, a1); + } +@@ -446,7 +446,7 @@ void time_hardirqs_off(unsigned long a0, unsigned long a1) + { + if (!preempt_trace() && irq_trace()) + start_critical_timing(a0, a1); +- trace_preemptirqsoff_hist(IRQS_OFF, 1); ++ trace_preemptirqsoff_hist_rcuidle(IRQS_OFF, 1); + } + + #else /* !CONFIG_PROVE_LOCKING */ +diff --git a/lib/dump_stack.c b/lib/dump_stack.c +index 7ccbc6f..6745c62 100644 +--- a/lib/dump_stack.c ++++ b/lib/dump_stack.c +@@ -33,7 +33,7 @@ asmlinkage __visible void dump_stack(void) + * Permit this cpu to perform nested stack dumps while serialising + * against other CPUs + */ +- migrate_disable(); ++ preempt_disable(); + + retry: + cpu = smp_processor_id(); +@@ -52,7 +52,7 @@ retry: + if (!was_locked) + atomic_set(&dump_lock, -1); + +- migrate_enable(); ++ preempt_enable(); + } + #else + asmlinkage __visible void dump_stack(void) +diff --git a/localversion-rt b/localversion-rt +index 5c84f62..76db1e9 100644 +--- a/localversion-rt ++++ b/localversion-rt +@@ -1 +1 @@ +-+rt3 +++rt13 +diff --git a/mm/backing-dev.c b/mm/backing-dev.c +index cbe6f0b..6871838 100644 +--- a/mm/backing-dev.c ++++ b/mm/backing-dev.c +@@ -457,9 +457,9 @@ void wb_congested_put(struct bdi_writeback_congested *congested) + { + unsigned long flags; + +- local_irq_save(flags); ++ local_irq_save_nort(flags); + if (!atomic_dec_and_lock(&congested->refcnt, &cgwb_lock)) { +- local_irq_restore(flags); ++ local_irq_restore_nort(flags); + return; + } + +diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c +index fc08399..18cc59f 100644 +--- a/mm/zsmalloc.c ++++ b/mm/zsmalloc.c +@@ -1289,7 +1289,7 @@ void *zs_map_object(struct zs_pool *pool, unsigned long handle, + class = pool->size_class[class_idx]; + off = obj_idx_to_offset(page, obj_idx, class->size); + +- area = &get_cpu_var(zs_map_area); ++ area = per_cpu_ptr(&zs_map_area, get_cpu_light()); + area->vm_mm = mm; + if (off + class->size <= PAGE_SIZE) { + /* this object is contained entirely within a page */ +@@ -1342,7 +1342,7 @@ void zs_unmap_object(struct zs_pool *pool, unsigned long handle) + + __zs_unmap_object(area, pages, off, class->size); + } +- put_cpu_var(zs_map_area); ++ put_cpu_light(); + unpin_tag(handle); + } + EXPORT_SYMBOL_GPL(zs_unmap_object); +diff --git a/net/core/dev.c b/net/core/dev.c +index 5ec7abf..0e17592 100644 +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -2891,7 +2891,11 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q, + * This permits __QDISC___STATE_RUNNING owner to get the lock more + * often and dequeue packets faster. + */ ++#ifdef CONFIG_PREEMPT_RT_FULL ++ contended = true; ++#else + contended = qdisc_is_running(q); ++#endif + if (unlikely(contended)) + spin_lock(&q->busylock); + +@@ -2983,7 +2987,7 @@ static inline void xmit_rec_inc(void) + __this_cpu_inc(xmit_recursion); + } + +-static inline int xmit_rec_dec(void) ++static inline void xmit_rec_dec(void) + { + __this_cpu_dec(xmit_recursion); + } +diff --git a/virt/kvm/async_pf.c b/virt/kvm/async_pf.c +index 57d9436..9378d09 100644 +--- a/virt/kvm/async_pf.c ++++ b/virt/kvm/async_pf.c +@@ -98,8 +98,8 @@ static void async_pf_execute(struct work_struct *work) + * This memory barrier pairs with prepare_to_wait's set_current_state() + */ + smp_mb(); +- if (swaitqueue_active(&vcpu->wq)) +- swait_wake_interruptible(&vcpu->wq); ++ if (swait_active(&vcpu->wq)) ++ swake_up(&vcpu->wq); + + mmput(mm); + kvm_put_kvm(vcpu->kvm); +diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c +index a076690..eeed326 100644 +--- a/virt/kvm/kvm_main.c ++++ b/virt/kvm/kvm_main.c +@@ -226,8 +226,7 @@ int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id) + vcpu->kvm = kvm; + vcpu->vcpu_id = id; + vcpu->pid = NULL; +- vcpu->halt_poll_ns = 0; +- init_swait_head(&vcpu->wq); ++ init_swait_queue_head(&vcpu->wq); + kvm_async_pf_vcpu_init(vcpu); + + vcpu->pre_pcpu = -1; +@@ -2002,7 +2001,7 @@ static int kvm_vcpu_check_block(struct kvm_vcpu *vcpu) + void kvm_vcpu_block(struct kvm_vcpu *vcpu) + { + ktime_t start, cur; +- DEFINE_SWAITER(wait); ++ DECLARE_SWAITQUEUE(wait); + bool waited = false; + u64 block_ns; + +@@ -2027,7 +2026,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu) + kvm_arch_vcpu_blocking(vcpu); + + for (;;) { +- swait_prepare(&vcpu->wq, &wait, TASK_INTERRUPTIBLE); ++ prepare_to_swait(&vcpu->wq, &wait, TASK_INTERRUPTIBLE); + + if (kvm_vcpu_check_block(vcpu) < 0) + break; +@@ -2036,7 +2035,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu) + schedule(); + } + +- swait_finish(&vcpu->wq, &wait); ++ finish_swait(&vcpu->wq, &wait); + cur = ktime_get(); + + kvm_arch_vcpu_unblocking(vcpu); +@@ -2068,11 +2067,11 @@ void kvm_vcpu_kick(struct kvm_vcpu *vcpu) + { + int me; + int cpu = vcpu->cpu; +- struct swait_head *wqp; ++ struct swait_queue_head *wqp; + + wqp = kvm_arch_vcpu_wq(vcpu); +- if (swaitqueue_active(wqp)) { +- swait_wake_interruptible(wqp); ++ if (swait_active(wqp)) { ++ swake_up(wqp); + ++vcpu->stat.halt_wakeup; + } + +@@ -2173,7 +2172,7 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me) + continue; + if (vcpu == me) + continue; +- if (swaitqueue_active(&vcpu->wq) && !kvm_arch_vcpu_runnable(vcpu)) ++ if (swait_active(&vcpu->wq) && !kvm_arch_vcpu_runnable(vcpu)) + continue; + if (!kvm_vcpu_eligible_for_directed_yield(vcpu)) + continue; +-- +2.7.1 + + +From 9803c5393443bd83aa58d930d127d974fc989dd9 Mon Sep 17 00:00:00 2001 +From: Jon Nettleton +Date: Tue, 11 Aug 2015 13:36:09 +0200 +Subject: [PATCH 003/384] gpu: galcore: Don't abuse the dma_* apis + +There is no reason we can't pass the device to the dma_* api's, +so do it. This does not follow the traditional vivante syntax +but it is more correct for in kernel drivers. + +(cherry picked from commit 3010fb04e38c5952d156afb1290e69a44c3017b8) +Signed-off-by: Matus Kral +--- + drivers/gpu/galcore/gc_hal_kernel_device.c | 3 +++ + drivers/gpu/galcore/gc_hal_kernel_device.h | 3 +++ + drivers/gpu/galcore/gc_hal_kernel_os.c | 20 ++++++++++---------- + drivers/gpu/galcore/gc_hal_kernel_probe.c | 5 +++-- + 4 files changed, 19 insertions(+), 12 deletions(-) + +diff --git a/drivers/gpu/galcore/gc_hal_kernel_device.c b/drivers/gpu/galcore/gc_hal_kernel_device.c +index e99d29f..42a0b24 100644 +--- a/drivers/gpu/galcore/gc_hal_kernel_device.c ++++ b/drivers/gpu/galcore/gc_hal_kernel_device.c +@@ -683,6 +683,7 @@ gckGALDEVICE_Construct( + IN gctINT PowerManagement, + IN gctINT GpuProfiler, + IN gcsDEVICE_CONSTRUCT_ARGS * Args, ++ IN struct device *dev, + OUT gckGALDEVICE *Device + ) + { +@@ -729,6 +730,8 @@ gckGALDEVICE_Construct( + + device->platform = Args->platform; + ++ device->dev = dev; ++ + gcmkONERROR(_DebugfsInit(device)); + + if (gckDEBUGFS_CreateNode( +diff --git a/drivers/gpu/galcore/gc_hal_kernel_device.h b/drivers/gpu/galcore/gc_hal_kernel_device.h +index c94d67c..4d66a6a 100644 +--- a/drivers/gpu/galcore/gc_hal_kernel_device.h ++++ b/drivers/gpu/galcore/gc_hal_kernel_device.h +@@ -30,6 +30,8 @@ + + typedef struct _gckGALDEVICE + { ++ struct device *dev; ++ + /* Objects. */ + gckOS os; + gckKERNEL kernels[gcdMAX_GPU_COUNT]; +@@ -175,6 +177,7 @@ gceSTATUS gckGALDEVICE_Construct( + IN gctINT PowerManagement, + IN gctINT GpuProfiler, + IN gcsDEVICE_CONSTRUCT_ARGS * Args, ++ IN struct device *dev, + OUT gckGALDEVICE *Device + ); + +diff --git a/drivers/gpu/galcore/gc_hal_kernel_os.c b/drivers/gpu/galcore/gc_hal_kernel_os.c +index e05262b..0457574 100644 +--- a/drivers/gpu/galcore/gc_hal_kernel_os.c ++++ b/drivers/gpu/galcore/gc_hal_kernel_os.c +@@ -1092,7 +1092,7 @@ gckOS_MapMemory( + } + + #ifndef NO_DMA_COHERENT +- if (dma_mmap_writecombine(gcvNULL, ++ if (dma_mmap_writecombine(Os->device->dev, + mdlMap->vma, + mdl->addr, + mdl->dmaHandle, +@@ -1411,9 +1411,9 @@ gckOS_AllocateNonPagedMemory( + + #ifndef NO_DMA_COHERENT + #ifdef CONFIG_ARM64 +- addr = dma_alloc_coherent(gcvNULL, ++ addr = dma_alloc_coherent(Os->device->dev, + #else +- addr = dma_alloc_writecombine(gcvNULL, ++ addr = dma_alloc_writecombine(Os->device->dev, + #endif + mdl->numPages * PAGE_SIZE, + &mdl->dmaHandle, +@@ -1442,7 +1442,7 @@ gckOS_AllocateNonPagedMemory( + #if !defined(CONFIG_PPC) + /* Cache invalidate. */ + dma_sync_single_for_device( +- gcvNULL, ++ Os->device->dev, + page_to_phys(page), + bytes, + DMA_FROM_DEVICE); +@@ -1523,7 +1523,7 @@ gckOS_AllocateNonPagedMemory( + } + + #ifndef NO_DMA_COHERENT +- if (dma_mmap_coherent(gcvNULL, ++ if (dma_mmap_coherent(Os->device->dev, + mdlMap->vma, + mdl->addr, + mdl->dmaHandle, +@@ -1681,9 +1681,9 @@ gceSTATUS gckOS_FreeNonPagedMemory( + + #ifndef NO_DMA_COHERENT + #ifdef CONFIG_ARM64 +- dma_free_coherent(gcvNULL, ++ dma_free_coherent(Os->device->dev, + #else +- dma_free_writecombine(gcvNULL, ++ dma_free_writecombine(Os->device->dev, + #endif + mdl->numPages * PAGE_SIZE, + mdl->addr, +@@ -5383,7 +5383,7 @@ gckOS_CacheClean( + } + + dma_sync_single_for_device( +- gcvNULL, ++ Os->device->dev, + (dma_addr_t)Physical, + Bytes, + DMA_TO_DEVICE); +@@ -5457,7 +5457,7 @@ gckOS_CacheInvalidate( + } + + dma_sync_single_for_device( +- gcvNULL, ++ Os->device->dev, + (dma_addr_t)Physical, + Bytes, + DMA_FROM_DEVICE); +@@ -5533,7 +5533,7 @@ gckOS_CacheFlush( + if (Physical != gcvINVALID_ADDRESS) + { + dma_sync_single_for_device( +- gcvNULL, ++ Os->device->dev, + (dma_addr_t)Physical, + Bytes, + DMA_BIDIRECTIONAL); +diff --git a/drivers/gpu/galcore/gc_hal_kernel_probe.c b/drivers/gpu/galcore/gc_hal_kernel_probe.c +index 10098c3..9c904bd 100644 +--- a/drivers/gpu/galcore/gc_hal_kernel_probe.c ++++ b/drivers/gpu/galcore/gc_hal_kernel_probe.c +@@ -758,7 +758,7 @@ OnError: + } + + +-static int drv_init(void) ++static int drv_init(struct platform_device *pdev) + { + int ret; + int result = -EINVAL; +@@ -812,6 +812,7 @@ static int drv_init(void) + powerManagement, + gpuProfiler, + &args, ++ &pdev->dev, + &device + ); + +@@ -975,7 +976,7 @@ static int gpu_probe(struct platform_device *pdev) + _UpdateModuleParam(&moduleParam); + } + +- ret = drv_init(); ++ ret = drv_init(pdev); + + if (!ret) + { +-- +2.7.1 + + +From 7e860e397cc51b951fdcb2b6b3d47714aaf6f68e Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Sun, 3 Apr 2016 13:29:34 +0200 +Subject: [PATCH 004/384] gpu: galcore: -rt13 updates + +--- + drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c +index 1685e57..ef8a9d2 100644 +--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c ++++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c +@@ -7730,8 +7730,8 @@ gckOS_WaitSignal( + : Wait * HZ / 1000; + #endif + +- DEFINE_SWAITER(wait); +- swait_prepare_locked(&signal->obj.wait, &wait); ++ DECLARE_SWAITQUEUE(wait); ++ __prepare_to_swait(&signal->obj.wait, &wait); + + while (gcvTRUE) + { +@@ -7809,7 +7809,7 @@ gckOS_WaitSignal( + } + } + +- swait_finish_locked(&signal->obj.wait, &wait); ++ __finish_swait(&signal->obj.wait, &wait); + + #if gcdDETECT_TIMEOUT + if (complained) +-- +2.7.1 + + +From 4c7dbd2c18fc32a267f99556f70c4b71c6e9d7e9 Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Sun, 3 Apr 2016 13:32:02 +0200 +Subject: [PATCH 005/384] mxc_hdmi: remove blank_state() and abort_stream() + handling + +--- + drivers/video/mxc/mxc_hdmi.c | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/drivers/video/mxc/mxc_hdmi.c b/drivers/video/mxc/mxc_hdmi.c +index 5587165..df91138 100644 +--- a/drivers/video/mxc/mxc_hdmi.c ++++ b/drivers/video/mxc/mxc_hdmi.c +@@ -1904,7 +1904,6 @@ static void mxc_hdmi_phy_disable(struct mxc_hdmi *hdmi) + if (!hdmi->phy_enabled) + return; + +- mxc_hdmi_abort_stream(); + hdmi_disable_overflow_interrupts(); + + /* Setting PHY to reset status */ +@@ -2489,7 +2488,6 @@ static void hotplug_worker(struct work_struct *work) + } else if (!(hdmi_phy_pol0 & hdmi->plug_mask)) { + /* Plugout event */ + dev_dbg(&hdmi->pdev->dev, "EVENT=plugout\n"); +- mxc_hdmi_abort_stream(); + mxc_hdmi_cable_disconnected(hdmi); + #if defined(CONFIG_MXC_HDMI_CEC) + mxc_hdmi_cec_handle(0x0); +@@ -2812,13 +2810,10 @@ static int mxc_hdmi_fb_event(struct notifier_block *nb, + + if (hdmi->hp_state > HDMI_HOTPLUG_DISCONNECTED) + mxc_hdmi_setup(hdmi, val); +- hdmi_set_blank_state(1); + + } else if (*((int *)event->data) != hdmi->blank) { + dev_dbg(&hdmi->pdev->dev, + "event=FB_EVENT_BLANK - BLANK\n"); +- mxc_hdmi_abort_stream(); +- hdmi_set_blank_state(0); + + mxc_hdmi_phy_disable(hdmi); + +-- +2.7.1 + + +From 3172002dcda016c15a14abf69eff7a21f0dcd0d2 Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Mon, 4 Apr 2016 01:43:46 +0200 +Subject: [PATCH 006/384] clk: cosmetics, reorder + +--- + drivers/clk/imx/clk-imx6q.c | 23 +++++++++++++---------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c +index d3366be..ceb8703 100644 +--- a/drivers/clk/imx/clk-imx6q.c ++++ b/drivers/clk/imx/clk-imx6q.c +@@ -507,6 +507,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) + clk_data.clk_num = ARRAY_SIZE(clk); + of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); + ++ clk_register_clkdev(clk[IMX6QDL_CLK_GPT_3M], "gpt_3m", "imx-gpt.0"); + clk_register_clkdev(clk[IMX6QDL_CLK_ENET_REF], "enet_ref", NULL); + + if ((imx_get_soc_revision() != IMX_CHIP_REVISION_1_0) || +@@ -515,6 +516,10 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) + imx_clk_set_parent(clk[IMX6QDL_CLK_LDB_DI1_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]); + } + ++ imx_clk_set_rate(clk[IMX6QDL_CLK_PLL3_PFD1_540M], 540000000); ++ if (clk_on_imx6dl()) ++ imx_clk_set_parent(clk[IMX6QDL_CLK_IPU1_SEL], clk[IMX6QDL_CLK_PLL3_PFD1_540M]); ++ + imx_clk_set_parent(clk[IMX6QDL_CLK_IPU1_DI0_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]); + imx_clk_set_parent(clk[IMX6QDL_CLK_IPU1_DI1_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]); + imx_clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI0_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]); +@@ -524,8 +529,6 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) + imx_clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI0_SEL], clk[IMX6QDL_CLK_IPU2_DI0_PRE]); + imx_clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI1_SEL], clk[IMX6QDL_CLK_IPU2_DI1_PRE]); + +- imx_clk_set_rate(clk[IMX6QDL_CLK_PLL3_PFD1_540M], 540000000); +- imx_clk_set_parent(clk[IMX6QDL_CLK_IPU1_SEL], clk[IMX6QDL_CLK_PLL3_PFD1_540M]); + imx_clk_set_parent(clk[IMX6QDL_CLK_AXI_ALT_SEL], clk[IMX6QDL_CLK_PLL3_PFD1_540M]); + imx_clk_set_parent(clk[IMX6QDL_CLK_AXI_SEL], clk[IMX6QDL_CLK_AXI_ALT_SEL]); + /* set epdc/pxp axi clock to 200Mhz */ +@@ -543,6 +546,14 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) + */ + imx_clk_set_parent(clk[IMX6QDL_CLK_ENFC_SEL], clk[IMX6QDL_CLK_PLL2_PFD2_396M]); + ++ for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) ++ imx_clk_prepare_enable(clk[clks_init_on[i]]); ++ ++ if (IS_ENABLED(CONFIG_USB_MXS_PHY)) { ++ imx_clk_prepare_enable(clk[IMX6QDL_CLK_USBPHY1_GATE]); ++ imx_clk_prepare_enable(clk[IMX6QDL_CLK_USBPHY2_GATE]); ++ } ++ + /* gpu clock initilazation */ + /* + * On mx6dl, 2d core clock sources(sel, podf) is from 3d +@@ -588,14 +599,6 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) + + imx_register_uart_clocks(uart_clks); + +- for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) +- imx_clk_prepare_enable(clk[clks_init_on[i]]); +- +- if (IS_ENABLED(CONFIG_USB_MXS_PHY)) { +- imx_clk_prepare_enable(clk[IMX6QDL_CLK_USBPHY1_GATE]); +- imx_clk_prepare_enable(clk[IMX6QDL_CLK_USBPHY2_GATE]); +- } +- + imx_clk_set_parent(clk[IMX6QDL_CLK_VPU_AXI_SEL], clk[IMX6QDL_CLK_PLL2_PFD0_352M]); + + if (clk_on_imx6dl()) +-- +2.7.1 + + +From 7ab99c6f2493f5b7c18db5c1448fbebef67fac74 Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Mon, 4 Apr 2016 03:16:05 +0200 +Subject: [PATCH 007/384] add mxc_v4l2.h to linux-libc-dev headers + +--- + include/uapi/linux/Kbuild | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild +index 18c9229..ba55082 100644 +--- a/include/uapi/linux/Kbuild ++++ b/include/uapi/linux/Kbuild +@@ -274,6 +274,7 @@ header-y += msg.h + header-y += mtio.h + header-y += mxcfb.h + header-y += mxc_dcic.h ++header-y += mxc_v4l2.h + header-y += ipu.h + header-y += nbd.h + header-y += ncp_fs.h +-- +2.7.1 + + +From 63d3885534cfe5518ba1cf8e7a1253a7552ea315 Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Mon, 4 Apr 2016 03:17:07 +0200 +Subject: [PATCH 008/384] ipu_device: do not overlap stripes + +--- + drivers/mxc/ipu3/ipu_device.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/drivers/mxc/ipu3/ipu_device.c b/drivers/mxc/ipu3/ipu_device.c +index e34e1ba..306639d 100644 +--- a/drivers/mxc/ipu3/ipu_device.c ++++ b/drivers/mxc/ipu3/ipu_device.c +@@ -485,6 +485,7 @@ cs_t colorspaceofpixel(int fmt) + } + EXPORT_SYMBOL_GPL(colorspaceofpixel); + ++inline + int need_csc(int ifmt, int ofmt) + { + cs_t ics, ocs; +@@ -501,26 +502,31 @@ int need_csc(int ifmt, int ofmt) + } + EXPORT_SYMBOL_GPL(need_csc); + ++inline + static int soc_max_in_width(u32 is_vdoa) + { + return is_vdoa ? 8192 : 4096; + } + ++inline + static int soc_max_vdi_in_width(void) + { + return IPU_MAX_VDI_IN_WIDTH; + } ++inline + static int soc_max_in_height(void) + { + return 4096; + } + ++inline + static int soc_max_out_width(void) + { + /* mx51/mx53/mx6q is 1024*/ + return 1024; + } + ++inline + static int soc_max_out_height(void) + { + /* mx51/mx53/mx6q is 1024*/ +@@ -859,7 +865,7 @@ static int update_split_setting(struct ipu_task_entry *t, bool vdi_split) + ret = ipu_calc_stripes_sizes(iw, + ow, + max_width, +- (((unsigned long long)1) << 32), /* 32bit for fractional*/ ++ 0,/*no overlap*/ /* 32bit for fractional*/ + 1, /* equal stripes */ + t->input.format, + t->output.format, +@@ -907,7 +913,7 @@ static int update_split_setting(struct ipu_task_entry *t, bool vdi_split) + ret = ipu_calc_stripes_sizes(ih, + oh, + soc_max_out_height(), +- (((unsigned long long)1) << 32), /* 32bit for fractional*/ ++ 0,/*no overlap*/ /* 32bit for fractional*/ + 0x1 | 0x2, /* equal stripes and vertical */ + t->input.format, + t->output.format, +-- +2.7.1 + + +From 4b44b311bbe23a9a4ca491fda43d2fd088fadd08 Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Mon, 4 Apr 2016 03:43:49 +0200 +Subject: [PATCH 009/384] Revert "printk: do cond_resched() between lines while + outputting to consoles" + +This reverts commit a623f87a72de35096a9eae7cc7764d0c9533c2e9. + +Conflicts: + kernel/printk/printk.c +--- + include/linux/console.h | 1 - + kernel/panic.c | 3 ++- + kernel/printk/printk.c | 34 +--------------------------------- + 3 files changed, 3 insertions(+), 35 deletions(-) + +diff --git a/include/linux/console.h b/include/linux/console.h +index ea731af..bd19434 100644 +--- a/include/linux/console.h ++++ b/include/linux/console.h +@@ -150,7 +150,6 @@ extern int console_trylock(void); + extern void console_unlock(void); + extern void console_conditional_schedule(void); + extern void console_unblank(void); +-extern void console_flush_on_panic(void); + extern struct tty_driver *console_device(int *); + extern void console_stop(struct console *); + extern void console_start(struct console *); +diff --git a/kernel/panic.c b/kernel/panic.c +index 50d4ae2..d74f25d 100644 +--- a/kernel/panic.c ++++ b/kernel/panic.c +@@ -157,7 +157,8 @@ void panic(const char *fmt, ...) + * panic() is not being callled from OOPS. + */ + debug_locks_off(); +- console_flush_on_panic(); ++ console_trylock(); ++ console_unlock(); + + if (!panic_blink) + panic_blink = no_blink; +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index f75e4b0..88995de 100644 +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -2319,24 +2319,13 @@ void console_unlock(void) + static u64 seen_seq; + unsigned long flags; + bool wake_klogd = false; +- bool do_cond_resched, retry; ++ bool retry; + + if (console_suspended) { + up_console_sem(); + return; + } + +- /* +- * Console drivers are called under logbuf_lock, so +- * @console_may_schedule should be cleared before; however, we may +- * end up dumping a lot of lines, for example, if called from +- * console registration path, and should invoke cond_resched() +- * between lines if allowable. Not doing so can cause a very long +- * scheduling stall on a slow console leading to RCU stall and +- * softlockup warnings which exacerbate the issue with more +- * messages practically incapacitating the system. +- */ +- do_cond_resched = console_may_schedule; + console_may_schedule = 0; + + /* flush buffered message fragment immediately to console */ +@@ -2413,8 +2402,6 @@ skip: + start_critical_timings(); + local_irq_restore(flags); + #endif +- if (do_cond_resched) +- cond_resched(); + } + console_locked = 0; + +@@ -2482,25 +2469,6 @@ void console_unblank(void) + console_unlock(); + } + +-/** +- * console_flush_on_panic - flush console content on panic +- * +- * Immediately output all pending messages no matter what. +- */ +-void console_flush_on_panic(void) +-{ +- /* +- * If someone else is holding the console lock, trylock will fail +- * and may_schedule may be set. Ignore and proceed to unlock so +- * that messages are flushed out. As this can be called from any +- * context and we don't want to get preempted while flushing, +- * ensure may_schedule is cleared. +- */ +- console_trylock(); +- console_may_schedule = 0; +- console_unlock(); +-} +- + /* + * Return the console tty driver structure and its associated index + */ +-- +2.7.1 + + +From 971d3dfe5bb0db330b769f8c869d2d23fab9c9b2 Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Tue, 5 Apr 2016 10:37:31 +0200 +Subject: [PATCH 010/384] default configs update for xbian_defconfig_imx6_mvebu + +--- + arch/arm/configs/xbian_defconfig_imx6 | 6550 --------------------------- + arch/arm/configs/xbian_defconfig_imx6_mvebu | 199 +- + 2 files changed, 65 insertions(+), 6684 deletions(-) + delete mode 100644 arch/arm/configs/xbian_defconfig_imx6 + +diff --git a/arch/arm/configs/xbian_defconfig_imx6 b/arch/arm/configs/xbian_defconfig_imx6 +deleted file mode 100644 +index 20d0117..0000000 +--- a/arch/arm/configs/xbian_defconfig_imx6 ++++ /dev/null +@@ -1,6550 +0,0 @@ +-# +-# Automatically generated file; DO NOT EDIT. +-# Linux/arm 4.4.1 Kernel Configuration +-# +-CONFIG_ARM=y +-CONFIG_ARM_HAS_SG_CHAIN=y +-CONFIG_MIGHT_HAVE_PCI=y +-CONFIG_SYS_SUPPORTS_APM_EMULATION=y +-CONFIG_HAVE_PROC_CPU=y +-CONFIG_STACKTRACE_SUPPORT=y +-CONFIG_LOCKDEP_SUPPORT=y +-CONFIG_TRACE_IRQFLAGS_SUPPORT=y +-CONFIG_RWSEM_XCHGADD_ALGORITHM=y +-CONFIG_FIX_EARLYCON_MEM=y +-CONFIG_GENERIC_HWEIGHT=y +-CONFIG_GENERIC_CALIBRATE_DELAY=y +-CONFIG_ZONE_DMA=y +-CONFIG_NEED_DMA_MAP_STATE=y +-CONFIG_ARCH_SUPPORTS_UPROBES=y +-CONFIG_VECTORS_BASE=0xffff0000 +-CONFIG_ARM_PATCH_PHYS_VIRT=y +-CONFIG_GENERIC_BUG=y +-CONFIG_PGTABLE_LEVELS=2 +-CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +-CONFIG_IRQ_WORK=y +-CONFIG_BUILDTIME_EXTABLE_SORT=y +- +-# +-# General setup +-# +-CONFIG_INIT_ENV_ARG_LIMIT=32 +-CONFIG_CROSS_COMPILE="" +-# CONFIG_COMPILE_TEST is not set +-CONFIG_LOCALVERSION="" +-# CONFIG_LOCALVERSION_AUTO is not set +-CONFIG_HAVE_KERNEL_GZIP=y +-CONFIG_HAVE_KERNEL_LZMA=y +-CONFIG_HAVE_KERNEL_XZ=y +-CONFIG_HAVE_KERNEL_LZO=y +-CONFIG_HAVE_KERNEL_LZ4=y +-CONFIG_KERNEL_GZIP=y +-# CONFIG_KERNEL_LZMA is not set +-# CONFIG_KERNEL_XZ is not set +-# CONFIG_KERNEL_LZO is not set +-# CONFIG_KERNEL_LZ4 is not set +-CONFIG_DEFAULT_HOSTNAME="xbian" +-CONFIG_SWAP=y +-CONFIG_SYSVIPC=y +-CONFIG_SYSVIPC_SYSCTL=y +-CONFIG_POSIX_MQUEUE=y +-CONFIG_POSIX_MQUEUE_SYSCTL=y +-CONFIG_CROSS_MEMORY_ATTACH=y +-CONFIG_FHANDLE=y +-# CONFIG_USELIB is not set +-# CONFIG_AUDIT is not set +-CONFIG_HAVE_ARCH_AUDITSYSCALL=y +- +-# +-# IRQ subsystem +-# +-CONFIG_GENERIC_IRQ_PROBE=y +-CONFIG_GENERIC_IRQ_SHOW=y +-CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +-CONFIG_HARDIRQS_SW_RESEND=y +-CONFIG_GENERIC_IRQ_CHIP=y +-CONFIG_IRQ_DOMAIN=y +-CONFIG_IRQ_DOMAIN_HIERARCHY=y +-CONFIG_HANDLE_DOMAIN_IRQ=y +-# CONFIG_IRQ_DOMAIN_DEBUG is not set +-CONFIG_IRQ_FORCED_THREADING=y +-CONFIG_SPARSE_IRQ=y +-CONFIG_GENERIC_TIME_VSYSCALL=y +-CONFIG_GENERIC_CLOCKEVENTS=y +-CONFIG_ARCH_HAS_TICK_BROADCAST=y +-CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +- +-# +-# Timers subsystem +-# +-CONFIG_TICK_ONESHOT=y +-CONFIG_NO_HZ_COMMON=y +-# CONFIG_HZ_PERIODIC is not set +-CONFIG_NO_HZ_IDLE=y +-# CONFIG_NO_HZ_FULL is not set +-# CONFIG_NO_HZ is not set +-CONFIG_HIGH_RES_TIMERS=y +- +-# +-# CPU/Task time and stats accounting +-# +-# CONFIG_TICK_CPU_ACCOUNTING is not set +-# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set +-CONFIG_IRQ_TIME_ACCOUNTING=y +-CONFIG_BSD_PROCESS_ACCT=y +-CONFIG_BSD_PROCESS_ACCT_V3=y +-# CONFIG_TASKSTATS is not set +- +-# +-# RCU Subsystem +-# +-CONFIG_PREEMPT_RCU=y +-# CONFIG_RCU_EXPERT is not set +-CONFIG_SRCU=y +-# CONFIG_TASKS_RCU is not set +-CONFIG_RCU_STALL_COMMON=y +-# CONFIG_TREE_RCU_TRACE is not set +-# CONFIG_RCU_EXPEDITE_BOOT is not set +-CONFIG_BUILD_BIN2C=y +-CONFIG_IKCONFIG=y +-CONFIG_IKCONFIG_PROC=y +-CONFIG_LOG_BUF_SHIFT=16 +-CONFIG_LOG_CPU_MAX_BUF_SHIFT=13 +-CONFIG_GENERIC_SCHED_CLOCK=y +-CONFIG_CGROUPS=y +-# CONFIG_CGROUP_DEBUG is not set +-# CONFIG_CGROUP_FREEZER is not set +-# CONFIG_CGROUP_PIDS is not set +-# CONFIG_CGROUP_DEVICE is not set +-# CONFIG_CPUSETS is not set +-CONFIG_CGROUP_CPUACCT=y +-# CONFIG_MEMCG is not set +-# CONFIG_CGROUP_PERF is not set +-CONFIG_CGROUP_SCHED=y +-CONFIG_FAIR_GROUP_SCHED=y +-CONFIG_CFS_BANDWIDTH=y +-CONFIG_RT_GROUP_SCHED=y +-CONFIG_BLK_CGROUP=y +-# CONFIG_DEBUG_BLK_CGROUP is not set +-# CONFIG_CHECKPOINT_RESTORE is not set +-CONFIG_NAMESPACES=y +-CONFIG_UTS_NS=y +-CONFIG_IPC_NS=y +-CONFIG_USER_NS=y +-CONFIG_PID_NS=y +-CONFIG_NET_NS=y +-# CONFIG_SCHED_AUTOGROUP is not set +-# CONFIG_SYSFS_DEPRECATED is not set +-CONFIG_RELAY=y +-CONFIG_BLK_DEV_INITRD=y +-CONFIG_INITRAMFS_SOURCE="" +-CONFIG_RD_GZIP=y +-# CONFIG_RD_BZIP2 is not set +-# CONFIG_RD_LZMA is not set +-# CONFIG_RD_XZ is not set +-CONFIG_RD_LZO=y +-# CONFIG_RD_LZ4 is not set +-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +-CONFIG_SYSCTL=y +-CONFIG_ANON_INODES=y +-CONFIG_HAVE_UID16=y +-CONFIG_BPF=y +-CONFIG_EXPERT=y +-# CONFIG_UID16 is not set +-CONFIG_MULTIUSER=y +-# CONFIG_SGETMASK_SYSCALL is not set +-CONFIG_SYSFS_SYSCALL=y +-CONFIG_SYSCTL_SYSCALL=y +-CONFIG_KALLSYMS=y +-CONFIG_KALLSYMS_ALL=y +-CONFIG_PRINTK=y +-CONFIG_BUG=y +-CONFIG_BASE_FULL=y +-CONFIG_FUTEX=y +-CONFIG_EPOLL=y +-CONFIG_SIGNALFD=y +-CONFIG_TIMERFD=y +-CONFIG_EVENTFD=y +-# CONFIG_BPF_SYSCALL is not set +-CONFIG_SHMEM=y +-CONFIG_AIO=y +-# CONFIG_ADVISE_SYSCALLS is not set +-CONFIG_USERFAULTFD=y +-CONFIG_PCI_QUIRKS=y +-CONFIG_MEMBARRIER=y +-CONFIG_EMBEDDED=y +-CONFIG_HAVE_PERF_EVENTS=y +-CONFIG_PERF_USE_VMALLOC=y +- +-# +-# Kernel Performance Events And Counters +-# +-CONFIG_PERF_EVENTS=y +-# CONFIG_DEBUG_PERF_USE_VMALLOC is not set +-# CONFIG_VM_EVENT_COUNTERS is not set +-# CONFIG_SLUB_DEBUG is not set +-# CONFIG_COMPAT_BRK is not set +-# CONFIG_SLAB is not set +-CONFIG_SLUB=y +-# CONFIG_SLOB is not set +-# CONFIG_SLUB_CPU_PARTIAL is not set +-# CONFIG_SYSTEM_DATA_VERIFICATION is not set +-# CONFIG_PROFILING is not set +-CONFIG_TRACEPOINTS=y +-CONFIG_KEXEC_CORE=y +-CONFIG_HAVE_OPROFILE=y +-# CONFIG_KPROBES is not set +-# CONFIG_JUMP_LABEL is not set +-# CONFIG_UPROBES is not set +-# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +-CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +-CONFIG_ARCH_USE_BUILTIN_BSWAP=y +-CONFIG_HAVE_KPROBES=y +-CONFIG_HAVE_KRETPROBES=y +-CONFIG_HAVE_OPTPROBES=y +-CONFIG_HAVE_ARCH_TRACEHOOK=y +-CONFIG_HAVE_DMA_ATTRS=y +-CONFIG_HAVE_DMA_CONTIGUOUS=y +-CONFIG_GENERIC_SMP_IDLE_THREAD=y +-CONFIG_GENERIC_IDLE_POLL_SETUP=y +-CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +-CONFIG_HAVE_CLK=y +-CONFIG_HAVE_DMA_API_DEBUG=y +-CONFIG_HAVE_HW_BREAKPOINT=y +-CONFIG_HAVE_PERF_REGS=y +-CONFIG_HAVE_PERF_USER_STACK_DUMP=y +-CONFIG_HAVE_ARCH_JUMP_LABEL=y +-CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +-CONFIG_HAVE_CC_STACKPROTECTOR=y +-# CONFIG_CC_STACKPROTECTOR is not set +-CONFIG_CC_STACKPROTECTOR_NONE=y +-# CONFIG_CC_STACKPROTECTOR_REGULAR is not set +-# CONFIG_CC_STACKPROTECTOR_STRONG is not set +-CONFIG_HAVE_CONTEXT_TRACKING=y +-CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +-CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +-CONFIG_MODULES_USE_ELF_REL=y +-CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +-CONFIG_CLONE_BACKWARDS=y +-CONFIG_OLD_SIGSUSPEND3=y +-CONFIG_OLD_SIGACTION=y +- +-# +-# GCOV-based kernel profiling +-# +-# CONFIG_GCOV_KERNEL is not set +-CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +-CONFIG_HAVE_GENERIC_DMA_COHERENT=y +-CONFIG_RT_MUTEXES=y +-CONFIG_BASE_SMALL=0 +-CONFIG_MODULES=y +-# CONFIG_MODULE_FORCE_LOAD is not set +-CONFIG_MODULE_UNLOAD=y +-# CONFIG_MODULE_FORCE_UNLOAD is not set +-CONFIG_MODVERSIONS=y +-CONFIG_MODULE_SRCVERSION_ALL=y +-# CONFIG_MODULE_SIG is not set +-# CONFIG_MODULE_COMPRESS is not set +-CONFIG_MODULES_TREE_LOOKUP=y +-CONFIG_BLOCK=y +-CONFIG_LBDAF=y +-CONFIG_BLK_DEV_BSG=y +-CONFIG_BLK_DEV_BSGLIB=y +-CONFIG_BLK_DEV_INTEGRITY=y +-# CONFIG_BLK_DEV_THROTTLING is not set +-# CONFIG_BLK_CMDLINE_PARSER is not set +- +-# +-# Partition Types +-# +-CONFIG_PARTITION_ADVANCED=y +-# CONFIG_ACORN_PARTITION is not set +-# CONFIG_AIX_PARTITION is not set +-# CONFIG_OSF_PARTITION is not set +-# CONFIG_AMIGA_PARTITION is not set +-# CONFIG_ATARI_PARTITION is not set +-CONFIG_MAC_PARTITION=y +-CONFIG_MSDOS_PARTITION=y +-CONFIG_BSD_DISKLABEL=y +-CONFIG_MINIX_SUBPARTITION=y +-CONFIG_SOLARIS_X86_PARTITION=y +-CONFIG_UNIXWARE_DISKLABEL=y +-CONFIG_LDM_PARTITION=y +-# CONFIG_LDM_DEBUG is not set +-# CONFIG_SGI_PARTITION is not set +-# CONFIG_ULTRIX_PARTITION is not set +-CONFIG_SUN_PARTITION=y +-CONFIG_KARMA_PARTITION=y +-CONFIG_EFI_PARTITION=y +-# CONFIG_SYSV68_PARTITION is not set +-# CONFIG_CMDLINE_PARTITION is not set +- +-# +-# IO Schedulers +-# +-CONFIG_IOSCHED_NOOP=y +-CONFIG_IOSCHED_DEADLINE=y +-CONFIG_IOSCHED_CFQ=y +-# CONFIG_CFQ_GROUP_IOSCHED is not set +-CONFIG_IOSCHED_BFQ=y +-# CONFIG_CGROUP_BFQIO is not set +-# CONFIG_DEFAULT_DEADLINE is not set +-# CONFIG_DEFAULT_CFQ is not set +-CONFIG_DEFAULT_BFQ=y +-# CONFIG_DEFAULT_NOOP is not set +-CONFIG_DEFAULT_IOSCHED="bfq" +-CONFIG_PADATA=y +-CONFIG_ASN1=m +-CONFIG_UNINLINE_SPIN_UNLOCK=y +-CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +-CONFIG_MUTEX_SPIN_ON_OWNER=y +-CONFIG_RWSEM_SPIN_ON_OWNER=y +-CONFIG_LOCK_SPIN_ON_OWNER=y +-CONFIG_FREEZER=y +- +-# +-# System Type +-# +-CONFIG_MMU=y +-CONFIG_ARCH_MULTIPLATFORM=y +-# CONFIG_ARCH_REALVIEW is not set +-# CONFIG_ARCH_VERSATILE is not set +-# CONFIG_ARCH_CLPS711X is not set +-# CONFIG_ARCH_GEMINI is not set +-# CONFIG_ARCH_EBSA110 is not set +-# CONFIG_ARCH_EP93XX is not set +-# CONFIG_ARCH_FOOTBRIDGE is not set +-# CONFIG_ARCH_NETX is not set +-# CONFIG_ARCH_IOP13XX is not set +-# CONFIG_ARCH_IOP32X is not set +-# CONFIG_ARCH_IOP33X is not set +-# CONFIG_ARCH_IXP4XX is not set +-# CONFIG_ARCH_DOVE is not set +-# CONFIG_ARCH_MV78XX0 is not set +-# CONFIG_ARCH_ORION5X is not set +-# CONFIG_ARCH_MMP is not set +-# CONFIG_ARCH_KS8695 is not set +-# CONFIG_ARCH_W90X900 is not set +-# CONFIG_ARCH_LPC32XX is not set +-# CONFIG_ARCH_PXA is not set +-# CONFIG_ARCH_RPC is not set +-# CONFIG_ARCH_SA1100 is not set +-# CONFIG_ARCH_S3C24XX is not set +-# CONFIG_ARCH_S3C64XX is not set +-# CONFIG_ARCH_DAVINCI is not set +-# CONFIG_ARCH_OMAP1 is not set +- +-# +-# Multiple platform selection +-# +- +-# +-# CPU Core family selection +-# +-# CONFIG_ARCH_MULTI_V6 is not set +-CONFIG_ARCH_MULTI_V7=y +-CONFIG_ARCH_MULTI_V6_V7=y +-# CONFIG_ARCH_MULTI_CPU_AUTO is not set +-# CONFIG_ARCH_VIRT is not set +-# CONFIG_ARCH_MVEBU is not set +-# CONFIG_ARCH_ALPINE is not set +-# CONFIG_ARCH_AT91 is not set +-# CONFIG_ARCH_BCM is not set +-# CONFIG_ARCH_BERLIN is not set +-# CONFIG_ARCH_DIGICOLOR is not set +-# CONFIG_ARCH_HIGHBANK is not set +-# CONFIG_ARCH_HISI is not set +-# CONFIG_ARCH_KEYSTONE is not set +-# CONFIG_ARCH_MESON is not set +-CONFIG_ARCH_MXC=y +-CONFIG_HAVE_IMX_ANATOP=y +-CONFIG_HAVE_IMX_GPC=y +-CONFIG_HAVE_IMX_MMDC=y +-CONFIG_HAVE_IMX_SRC=y +- +-# +-# Device tree only +-# +- +-# +-# Cortex-A platforms +-# +-# CONFIG_SOC_IMX50 is not set +-# CONFIG_SOC_IMX51 is not set +-# CONFIG_SOC_IMX53 is not set +-CONFIG_SOC_IMX6=y +-CONFIG_SOC_IMX6Q=y +-# CONFIG_SOC_IMX6SL is not set +-# CONFIG_SOC_IMX6SX is not set +-# CONFIG_SOC_IMX6UL is not set +-# CONFIG_SOC_IMX7D is not set +-# CONFIG_SOC_LS1021A is not set +- +-# +-# Cortex-A/Cortex-M asymmetric multiprocessing platforms +-# +-# CONFIG_SOC_VF610 is not set +-# CONFIG_ARCH_MEDIATEK is not set +- +-# +-# TI OMAP/AM/DM/DRA Family +-# +-# CONFIG_ARCH_OMAP3 is not set +-# CONFIG_ARCH_OMAP4 is not set +-# CONFIG_SOC_OMAP5 is not set +-# CONFIG_SOC_AM33XX is not set +-# CONFIG_SOC_AM43XX is not set +-# CONFIG_SOC_DRA7XX is not set +-# CONFIG_ARCH_QCOM is not set +-# CONFIG_ARCH_ROCKCHIP is not set +-# CONFIG_ARCH_SOCFPGA is not set +-# CONFIG_PLAT_SPEAR is not set +-# CONFIG_ARCH_STI is not set +-# CONFIG_ARCH_S5PV210 is not set +-# CONFIG_ARCH_EXYNOS is not set +-# CONFIG_ARCH_SHMOBILE_MULTI is not set +-# CONFIG_ARCH_SUNXI is not set +-# CONFIG_ARCH_SIRF is not set +-# CONFIG_ARCH_TEGRA is not set +-# CONFIG_ARCH_UNIPHIER is not set +-# CONFIG_ARCH_U8500 is not set +-# CONFIG_ARCH_VEXPRESS is not set +-# CONFIG_ARCH_WM8850 is not set +-# CONFIG_ARCH_ZX is not set +-# CONFIG_ARCH_ZYNQ is not set +- +-# +-# Processor Type +-# +-CONFIG_CPU_V7=y +-CONFIG_CPU_32v6K=y +-CONFIG_CPU_32v7=y +-CONFIG_CPU_ABRT_EV7=y +-CONFIG_CPU_PABRT_V7=y +-CONFIG_CPU_CACHE_V7=y +-CONFIG_CPU_CACHE_VIPT=y +-CONFIG_CPU_COPY_V6=y +-CONFIG_CPU_TLB_V7=y +-CONFIG_CPU_HAS_ASID=y +-CONFIG_CPU_CP15=y +-CONFIG_CPU_CP15_MMU=y +- +-# +-# Processor Features +-# +-# CONFIG_ARM_LPAE is not set +-# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set +-CONFIG_ARM_THUMB=y +-# CONFIG_ARM_THUMBEE is not set +-CONFIG_ARM_VIRT_EXT=y +-CONFIG_SWP_EMULATE=y +-# CONFIG_CPU_ICACHE_DISABLE is not set +-# CONFIG_CPU_BPREDICT_DISABLE is not set +-CONFIG_KUSER_HELPERS=y +-CONFIG_VDSO=y +-CONFIG_OUTER_CACHE=y +-CONFIG_OUTER_CACHE_SYNC=y +-CONFIG_MIGHT_HAVE_CACHE_L2X0=y +-CONFIG_CACHE_L2X0=y +-# CONFIG_PL310_ERRATA_588369 is not set +-# CONFIG_PL310_ERRATA_727915 is not set +-# CONFIG_PL310_ERRATA_753970 is not set +-CONFIG_PL310_ERRATA_769419=y +-CONFIG_ARM_L1_CACHE_SHIFT_6=y +-CONFIG_ARM_L1_CACHE_SHIFT=6 +-CONFIG_ARM_DMA_MEM_BUFFERABLE=y +-CONFIG_ARM_HEAVY_MB=y +-# CONFIG_ARM_KERNMEM_PERMS is not set +-CONFIG_MULTI_IRQ_HANDLER=y +-# CONFIG_ARM_ERRATA_430973 is not set +-# CONFIG_ARM_ERRATA_643719 is not set +-# CONFIG_ARM_ERRATA_720789 is not set +-CONFIG_ARM_ERRATA_754322=y +-# CONFIG_ARM_ERRATA_754327 is not set +-CONFIG_ARM_ERRATA_764369=y +-CONFIG_ARM_ERRATA_775420=y +-# CONFIG_ARM_ERRATA_798181 is not set +-# CONFIG_ARM_ERRATA_773022 is not set +- +-# +-# Bus support +-# +-CONFIG_PCI=y +-CONFIG_PCI_DOMAINS=y +-CONFIG_PCI_DOMAINS_GENERIC=y +-CONFIG_PCI_SYSCALL=y +-# CONFIG_PCI_MSI is not set +-# CONFIG_PCI_DEBUG is not set +-# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set +-# CONFIG_PCI_STUB is not set +-# CONFIG_PCI_IOV is not set +-# CONFIG_PCI_PRI is not set +-# CONFIG_PCI_PASID is not set +- +-# +-# PCI host controller drivers +-# +-CONFIG_PCIE_DW=y +-CONFIG_PCI_IMX6=y +-# CONFIG_PCI_HOST_GENERIC is not set +-# CONFIG_PCI_LAYERSCAPE is not set +-# CONFIG_PCIE_IPROC is not set +-# CONFIG_PCIE_ALTERA is not set +-CONFIG_PCIEPORTBUS=y +-CONFIG_PCIEAER=y +-# CONFIG_PCIE_ECRC is not set +-# CONFIG_PCIEAER_INJECT is not set +-CONFIG_PCIEASPM=y +-# CONFIG_PCIEASPM_DEBUG is not set +-CONFIG_PCIEASPM_DEFAULT=y +-# CONFIG_PCIEASPM_POWERSAVE is not set +-# CONFIG_PCIEASPM_PERFORMANCE is not set +-CONFIG_PCIE_PME=y +-# CONFIG_PCCARD is not set +- +-# +-# Kernel Features +-# +-CONFIG_HAVE_SMP=y +-CONFIG_SMP=y +-CONFIG_SMP_ON_UP=y +-CONFIG_ARM_CPU_TOPOLOGY=y +-# CONFIG_SCHED_MC is not set +-# CONFIG_SCHED_SMT is not set +-CONFIG_HAVE_ARM_SCU=y +-# CONFIG_HAVE_ARM_ARCH_TIMER is not set +-CONFIG_HAVE_ARM_TWD=y +-# CONFIG_MCPM is not set +-# CONFIG_BIG_LITTLE is not set +-# CONFIG_VMSPLIT_3G is not set +-# CONFIG_VMSPLIT_3G_OPT is not set +-CONFIG_VMSPLIT_2G=y +-# CONFIG_VMSPLIT_1G is not set +-CONFIG_PAGE_OFFSET=0x80000000 +-CONFIG_NR_CPUS=4 +-CONFIG_HOTPLUG_CPU=y +-# CONFIG_ARM_PSCI is not set +-CONFIG_ARCH_NR_GPIO=0 +-CONFIG_PREEMPT=y +-CONFIG_HAVE_PREEMPT_LAZY=y +-# CONFIG_PREEMPT_NONE is not set +-# CONFIG_PREEMPT_VOLUNTARY is not set +-CONFIG_PREEMPT__LL=y +-# CONFIG_PREEMPT_RTB is not set +-# CONFIG_PREEMPT_RT_FULL is not set +-CONFIG_PREEMPT_COUNT=y +-CONFIG_HZ_FIXED=0 +-# CONFIG_HZ_100 is not set +-# CONFIG_HZ_200 is not set +-# CONFIG_HZ_250 is not set +-CONFIG_HZ_300=y +-# CONFIG_HZ_500 is not set +-# CONFIG_HZ_1000 is not set +-CONFIG_HZ=300 +-CONFIG_SCHED_HRTICK=y +-# CONFIG_THUMB2_KERNEL is not set +-CONFIG_AEABI=y +-# CONFIG_OABI_COMPAT is not set +-# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set +-# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set +-CONFIG_HAVE_ARCH_PFN_VALID=y +-CONFIG_HIGHMEM=y +-# CONFIG_HIGHPTE is not set +-# CONFIG_CPU_SW_DOMAIN_PAN is not set +-CONFIG_HW_PERF_EVENTS=y +-CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +-# CONFIG_ARM_MODULE_PLTS is not set +-CONFIG_FLATMEM=y +-CONFIG_FLAT_NODE_MEM_MAP=y +-CONFIG_HAVE_MEMBLOCK=y +-CONFIG_NO_BOOTMEM=y +-CONFIG_MEMORY_ISOLATION=y +-# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +-CONFIG_SPLIT_PTLOCK_CPUS=4 +-CONFIG_COMPACTION=y +-CONFIG_MIGRATION=y +-# CONFIG_PHYS_ADDR_T_64BIT is not set +-CONFIG_ZONE_DMA_FLAG=1 +-CONFIG_BOUNCE=y +-# CONFIG_KSM is not set +-CONFIG_DEFAULT_MMAP_MIN_ADDR=16384 +-CONFIG_CLEANCACHE=y +-CONFIG_FRONTSWAP=y +-CONFIG_CMA=y +-# CONFIG_CMA_DEBUG is not set +-# CONFIG_CMA_DEBUGFS is not set +-CONFIG_CMA_AREAS=7 +-# CONFIG_ZSWAP is not set +-# CONFIG_ZPOOL is not set +-# CONFIG_ZBUD is not set +-# CONFIG_ZSMALLOC is not set +-# CONFIG_IDLE_PAGE_TRACKING is not set +-CONFIG_FRAME_VECTOR=y +-CONFIG_FORCE_MAX_ZONEORDER=14 +-CONFIG_ALIGNMENT_TRAP=y +-# CONFIG_UACCESS_WITH_MEMCPY is not set +-# CONFIG_SECCOMP is not set +-CONFIG_SWIOTLB=y +-CONFIG_IOMMU_HELPER=y +-# CONFIG_XEN is not set +- +-# +-# Boot options +-# +-CONFIG_USE_OF=y +-CONFIG_ATAGS=y +-# CONFIG_DEPRECATED_PARAM_STRUCT is not set +-CONFIG_ZBOOT_ROM_TEXT=0 +-CONFIG_ZBOOT_ROM_BSS=0 +-# CONFIG_ARM_APPENDED_DTB is not set +-CONFIG_CMDLINE="console=ttymxc0,115200 rw root=/dev/mmcblk0p2 rootwait" +-CONFIG_CMDLINE_FROM_BOOTLOADER=y +-# CONFIG_CMDLINE_EXTEND is not set +-# CONFIG_CMDLINE_FORCE is not set +-CONFIG_KEXEC=y +-CONFIG_ATAGS_PROC=y +-# CONFIG_CRASH_DUMP is not set +-CONFIG_AUTO_ZRELADDR=y +- +-# +-# CPU Power Management +-# +- +-# +-# CPU Frequency scaling +-# +-CONFIG_CPU_FREQ=y +-CONFIG_CPU_FREQ_GOV_COMMON=y +-CONFIG_CPU_FREQ_STAT=y +-CONFIG_CPU_FREQ_STAT_DETAILS=y +-CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +-# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set +-# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +-# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +-# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set +-CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +-CONFIG_CPU_FREQ_GOV_POWERSAVE=y +-CONFIG_CPU_FREQ_GOV_USERSPACE=y +-CONFIG_CPU_FREQ_GOV_ONDEMAND=y +-CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y +- +-# +-# CPU frequency scaling drivers +-# +-# CONFIG_CPUFREQ_DT is not set +-# CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set +-CONFIG_ARM_IMX6Q_CPUFREQ=y +-# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set +-# CONFIG_QORIQ_CPUFREQ is not set +- +-# +-# CPU Idle +-# +-CONFIG_CPU_IDLE=y +-# CONFIG_CPU_IDLE_GOV_LADDER is not set +-CONFIG_CPU_IDLE_GOV_MENU=y +-CONFIG_DT_IDLE_STATES=y +- +-# +-# ARM CPU Idle Drivers +-# +-CONFIG_ARM_CPUIDLE=y +-# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set +- +-# +-# Floating point emulation +-# +- +-# +-# At least one emulation must be selected +-# +-CONFIG_VFP=y +-CONFIG_VFPv3=y +-CONFIG_NEON=y +-CONFIG_KERNEL_MODE_NEON=y +- +-# +-# Userspace binary formats +-# +-CONFIG_BINFMT_ELF=y +-CONFIG_BINFMT_SCRIPT=y +-# CONFIG_HAVE_AOUT is not set +-CONFIG_BINFMT_MISC=m +-# CONFIG_COREDUMP is not set +- +-# +-# Power management options +-# +-CONFIG_SUSPEND=y +-CONFIG_SUSPEND_FREEZER=y +-# CONFIG_SUSPEND_SKIP_SYNC is not set +-# CONFIG_HIBERNATION is not set +-CONFIG_PM_SLEEP=y +-CONFIG_PM_SLEEP_SMP=y +-# CONFIG_PM_AUTOSLEEP is not set +-# CONFIG_PM_WAKELOCKS is not set +-CONFIG_PM=y +-# CONFIG_PM_DEBUG is not set +-# CONFIG_APM_EMULATION is not set +-CONFIG_PM_OPP=y +-CONFIG_PM_CLK=y +-CONFIG_PM_GENERIC_DOMAINS=y +-# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set +-CONFIG_PM_GENERIC_DOMAINS_SLEEP=y +-CONFIG_PM_GENERIC_DOMAINS_OF=y +-CONFIG_CPU_PM=y +-CONFIG_ARCH_SUSPEND_POSSIBLE=y +-CONFIG_ARM_CPU_SUSPEND=y +-CONFIG_ARCH_HIBERNATION_POSSIBLE=y +-CONFIG_NET=y +-CONFIG_NET_INGRESS=y +- +-# +-# Networking options +-# +-CONFIG_PACKET=y +-CONFIG_PACKET_DIAG=y +-CONFIG_UNIX=y +-CONFIG_UNIX_DIAG=y +-CONFIG_XFRM=y +-CONFIG_XFRM_ALGO=y +-CONFIG_XFRM_USER=y +-CONFIG_XFRM_SUB_POLICY=y +-CONFIG_XFRM_MIGRATE=y +-CONFIG_XFRM_STATISTICS=y +-CONFIG_XFRM_IPCOMP=m +-CONFIG_NET_KEY=y +-CONFIG_NET_KEY_MIGRATE=y +-CONFIG_INET=y +-CONFIG_IP_MULTICAST=y +-CONFIG_IP_ADVANCED_ROUTER=y +-# CONFIG_IP_FIB_TRIE_STATS is not set +-CONFIG_IP_MULTIPLE_TABLES=y +-CONFIG_IP_ROUTE_MULTIPATH=y +-CONFIG_IP_ROUTE_VERBOSE=y +-CONFIG_IP_ROUTE_CLASSID=y +-CONFIG_IP_PNP=y +-CONFIG_IP_PNP_DHCP=y +-CONFIG_IP_PNP_BOOTP=y +-# CONFIG_IP_PNP_RARP is not set +-CONFIG_NET_IPIP=m +-CONFIG_NET_IPGRE_DEMUX=m +-CONFIG_NET_IP_TUNNEL=m +-CONFIG_NET_IPGRE=m +-CONFIG_NET_IPGRE_BROADCAST=y +-CONFIG_IP_MROUTE=y +-CONFIG_IP_MROUTE_MULTIPLE_TABLES=y +-CONFIG_IP_PIMSM_V1=y +-CONFIG_IP_PIMSM_V2=y +-CONFIG_SYN_COOKIES=y +-CONFIG_NET_IPVTI=m +-CONFIG_NET_UDP_TUNNEL=m +-# CONFIG_NET_FOU is not set +-# CONFIG_NET_FOU_IP_TUNNELS is not set +-CONFIG_INET_AH=m +-CONFIG_INET_ESP=m +-CONFIG_INET_IPCOMP=m +-CONFIG_INET_XFRM_TUNNEL=m +-CONFIG_INET_TUNNEL=m +-CONFIG_INET_XFRM_MODE_TRANSPORT=m +-CONFIG_INET_XFRM_MODE_TUNNEL=m +-CONFIG_INET_XFRM_MODE_BEET=m +-CONFIG_INET_LRO=m +-CONFIG_INET_DIAG=y +-CONFIG_INET_TCP_DIAG=y +-CONFIG_INET_UDP_DIAG=m +-CONFIG_TCP_CONG_ADVANCED=y +-CONFIG_TCP_CONG_BIC=m +-CONFIG_TCP_CONG_CUBIC=m +-CONFIG_TCP_CONG_WESTWOOD=m +-CONFIG_TCP_CONG_HTCP=m +-CONFIG_TCP_CONG_HSTCP=m +-CONFIG_TCP_CONG_HYBLA=m +-CONFIG_TCP_CONG_VEGAS=y +-CONFIG_TCP_CONG_SCALABLE=m +-CONFIG_TCP_CONG_LP=m +-CONFIG_TCP_CONG_VENO=m +-CONFIG_TCP_CONG_YEAH=y +-CONFIG_TCP_CONG_ILLINOIS=m +-CONFIG_TCP_CONG_DCTCP=m +-# CONFIG_TCP_CONG_CDG is not set +-CONFIG_DEFAULT_VEGAS=y +-# CONFIG_DEFAULT_RENO is not set +-CONFIG_DEFAULT_TCP_CONG="vegas" +-CONFIG_TCP_MD5SIG=y +-CONFIG_IPV6=m +-CONFIG_IPV6_ROUTER_PREF=y +-CONFIG_IPV6_ROUTE_INFO=y +-CONFIG_IPV6_OPTIMISTIC_DAD=y +-CONFIG_INET6_AH=m +-CONFIG_INET6_ESP=m +-CONFIG_INET6_IPCOMP=m +-CONFIG_IPV6_MIP6=m +-CONFIG_IPV6_ILA=m +-CONFIG_INET6_XFRM_TUNNEL=m +-CONFIG_INET6_TUNNEL=m +-CONFIG_INET6_XFRM_MODE_TRANSPORT=m +-CONFIG_INET6_XFRM_MODE_TUNNEL=m +-CONFIG_INET6_XFRM_MODE_BEET=m +-CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m +-CONFIG_IPV6_VTI=m +-CONFIG_IPV6_SIT=m +-CONFIG_IPV6_SIT_6RD=y +-CONFIG_IPV6_NDISC_NODETYPE=y +-CONFIG_IPV6_TUNNEL=m +-CONFIG_IPV6_GRE=m +-CONFIG_IPV6_MULTIPLE_TABLES=y +-CONFIG_IPV6_SUBTREES=y +-CONFIG_IPV6_MROUTE=y +-CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y +-CONFIG_IPV6_PIMSM_V2=y +-CONFIG_NETWORK_SECMARK=y +-CONFIG_NET_PTP_CLASSIFY=y +-# CONFIG_NETWORK_PHY_TIMESTAMPING is not set +-CONFIG_NETFILTER=y +-# CONFIG_NETFILTER_DEBUG is not set +-CONFIG_NETFILTER_ADVANCED=y +-CONFIG_BRIDGE_NETFILTER=m +- +-# +-# Core Netfilter Configuration +-# +-CONFIG_NETFILTER_INGRESS=y +-CONFIG_NETFILTER_NETLINK=m +-CONFIG_NETFILTER_NETLINK_ACCT=m +-CONFIG_NETFILTER_NETLINK_QUEUE=m +-CONFIG_NETFILTER_NETLINK_LOG=m +-CONFIG_NF_CONNTRACK=m +-CONFIG_NF_LOG_COMMON=m +-CONFIG_NF_CONNTRACK_MARK=y +-CONFIG_NF_CONNTRACK_SECMARK=y +-CONFIG_NF_CONNTRACK_ZONES=y +-CONFIG_NF_CONNTRACK_PROCFS=y +-CONFIG_NF_CONNTRACK_EVENTS=y +-CONFIG_NF_CONNTRACK_TIMEOUT=y +-CONFIG_NF_CONNTRACK_TIMESTAMP=y +-CONFIG_NF_CONNTRACK_LABELS=y +-CONFIG_NF_CT_PROTO_DCCP=m +-CONFIG_NF_CT_PROTO_GRE=m +-CONFIG_NF_CT_PROTO_SCTP=m +-CONFIG_NF_CT_PROTO_UDPLITE=m +-CONFIG_NF_CONNTRACK_AMANDA=m +-CONFIG_NF_CONNTRACK_FTP=m +-CONFIG_NF_CONNTRACK_H323=m +-CONFIG_NF_CONNTRACK_IRC=m +-CONFIG_NF_CONNTRACK_BROADCAST=m +-CONFIG_NF_CONNTRACK_NETBIOS_NS=m +-CONFIG_NF_CONNTRACK_SNMP=m +-CONFIG_NF_CONNTRACK_PPTP=m +-CONFIG_NF_CONNTRACK_SANE=m +-CONFIG_NF_CONNTRACK_SIP=m +-CONFIG_NF_CONNTRACK_TFTP=m +-CONFIG_NF_CT_NETLINK=m +-CONFIG_NF_CT_NETLINK_TIMEOUT=m +-# CONFIG_NETFILTER_NETLINK_GLUE_CT is not set +-CONFIG_NF_NAT=m +-CONFIG_NF_NAT_NEEDED=y +-CONFIG_NF_NAT_PROTO_DCCP=m +-CONFIG_NF_NAT_PROTO_UDPLITE=m +-CONFIG_NF_NAT_PROTO_SCTP=m +-CONFIG_NF_NAT_AMANDA=m +-CONFIG_NF_NAT_FTP=m +-CONFIG_NF_NAT_IRC=m +-CONFIG_NF_NAT_SIP=m +-CONFIG_NF_NAT_TFTP=m +-CONFIG_NF_NAT_REDIRECT=m +-CONFIG_NETFILTER_SYNPROXY=m +-CONFIG_NF_TABLES=m +-CONFIG_NF_TABLES_INET=m +-CONFIG_NF_TABLES_NETDEV=m +-CONFIG_NFT_EXTHDR=m +-CONFIG_NFT_META=m +-CONFIG_NFT_CT=m +-CONFIG_NFT_RBTREE=m +-CONFIG_NFT_HASH=m +-CONFIG_NFT_COUNTER=m +-CONFIG_NFT_LOG=m +-CONFIG_NFT_LIMIT=m +-CONFIG_NFT_MASQ=m +-CONFIG_NFT_REDIR=m +-CONFIG_NFT_NAT=m +-CONFIG_NFT_QUEUE=m +-CONFIG_NFT_REJECT=m +-CONFIG_NFT_REJECT_INET=m +-CONFIG_NFT_COMPAT=m +-CONFIG_NETFILTER_XTABLES=m +- +-# +-# Xtables combined modules +-# +-CONFIG_NETFILTER_XT_MARK=m +-CONFIG_NETFILTER_XT_CONNMARK=m +-CONFIG_NETFILTER_XT_SET=m +- +-# +-# Xtables targets +-# +-CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m +-CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +-CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +-CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m +-CONFIG_NETFILTER_XT_TARGET_CT=m +-CONFIG_NETFILTER_XT_TARGET_DSCP=m +-CONFIG_NETFILTER_XT_TARGET_HL=m +-CONFIG_NETFILTER_XT_TARGET_HMARK=m +-CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m +-CONFIG_NETFILTER_XT_TARGET_LED=m +-CONFIG_NETFILTER_XT_TARGET_LOG=m +-CONFIG_NETFILTER_XT_TARGET_MARK=m +-CONFIG_NETFILTER_XT_NAT=m +-CONFIG_NETFILTER_XT_TARGET_NETMAP=m +-CONFIG_NETFILTER_XT_TARGET_NFLOG=m +-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +-CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +-CONFIG_NETFILTER_XT_TARGET_RATEEST=m +-CONFIG_NETFILTER_XT_TARGET_REDIRECT=m +-CONFIG_NETFILTER_XT_TARGET_TEE=m +-CONFIG_NETFILTER_XT_TARGET_TPROXY=m +-CONFIG_NETFILTER_XT_TARGET_TRACE=m +-CONFIG_NETFILTER_XT_TARGET_SECMARK=m +-CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +-CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m +- +-# +-# Xtables matches +-# +-CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m +-CONFIG_NETFILTER_XT_MATCH_BPF=m +-CONFIG_NETFILTER_XT_MATCH_CGROUP=m +-CONFIG_NETFILTER_XT_MATCH_CLUSTER=m +-CONFIG_NETFILTER_XT_MATCH_COMMENT=m +-CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +-CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m +-CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +-CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +-CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +-CONFIG_NETFILTER_XT_MATCH_CPU=m +-CONFIG_NETFILTER_XT_MATCH_DCCP=m +-CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m +-CONFIG_NETFILTER_XT_MATCH_DSCP=m +-CONFIG_NETFILTER_XT_MATCH_ECN=m +-CONFIG_NETFILTER_XT_MATCH_ESP=m +-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m +-CONFIG_NETFILTER_XT_MATCH_HELPER=m +-CONFIG_NETFILTER_XT_MATCH_HL=m +-CONFIG_NETFILTER_XT_MATCH_IPCOMP=m +-CONFIG_NETFILTER_XT_MATCH_IPRANGE=m +-CONFIG_NETFILTER_XT_MATCH_IPVS=m +-CONFIG_NETFILTER_XT_MATCH_L2TP=m +-CONFIG_NETFILTER_XT_MATCH_LENGTH=m +-CONFIG_NETFILTER_XT_MATCH_LIMIT=m +-CONFIG_NETFILTER_XT_MATCH_MAC=m +-CONFIG_NETFILTER_XT_MATCH_MARK=m +-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +-CONFIG_NETFILTER_XT_MATCH_NFACCT=m +-CONFIG_NETFILTER_XT_MATCH_OSF=m +-CONFIG_NETFILTER_XT_MATCH_OWNER=m +-CONFIG_NETFILTER_XT_MATCH_POLICY=m +-CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m +-CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +-CONFIG_NETFILTER_XT_MATCH_QUOTA=m +-CONFIG_NETFILTER_XT_MATCH_RATEEST=m +-CONFIG_NETFILTER_XT_MATCH_REALM=m +-CONFIG_NETFILTER_XT_MATCH_RECENT=m +-CONFIG_NETFILTER_XT_MATCH_SCTP=m +-CONFIG_NETFILTER_XT_MATCH_SOCKET=m +-CONFIG_NETFILTER_XT_MATCH_STATE=m +-CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +-CONFIG_NETFILTER_XT_MATCH_STRING=m +-CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +-CONFIG_NETFILTER_XT_MATCH_TIME=m +-CONFIG_NETFILTER_XT_MATCH_U32=m +-CONFIG_IP_SET=m +-CONFIG_IP_SET_MAX=256 +-CONFIG_IP_SET_BITMAP_IP=m +-CONFIG_IP_SET_BITMAP_IPMAC=m +-CONFIG_IP_SET_BITMAP_PORT=m +-CONFIG_IP_SET_HASH_IP=m +-CONFIG_IP_SET_HASH_IPMARK=m +-CONFIG_IP_SET_HASH_IPPORT=m +-CONFIG_IP_SET_HASH_IPPORTIP=m +-CONFIG_IP_SET_HASH_IPPORTNET=m +-CONFIG_IP_SET_HASH_MAC=m +-CONFIG_IP_SET_HASH_NETPORTNET=m +-CONFIG_IP_SET_HASH_NET=m +-CONFIG_IP_SET_HASH_NETNET=m +-CONFIG_IP_SET_HASH_NETPORT=m +-CONFIG_IP_SET_HASH_NETIFACE=m +-CONFIG_IP_SET_LIST_SET=m +-CONFIG_IP_VS=m +-CONFIG_IP_VS_IPV6=y +-# CONFIG_IP_VS_DEBUG is not set +-CONFIG_IP_VS_TAB_BITS=12 +- +-# +-# IPVS transport protocol load balancing support +-# +-CONFIG_IP_VS_PROTO_TCP=y +-CONFIG_IP_VS_PROTO_UDP=y +-CONFIG_IP_VS_PROTO_AH_ESP=y +-CONFIG_IP_VS_PROTO_ESP=y +-CONFIG_IP_VS_PROTO_AH=y +-CONFIG_IP_VS_PROTO_SCTP=y +- +-# +-# IPVS scheduler +-# +-CONFIG_IP_VS_RR=m +-CONFIG_IP_VS_WRR=m +-CONFIG_IP_VS_LC=m +-CONFIG_IP_VS_WLC=m +-CONFIG_IP_VS_FO=m +-CONFIG_IP_VS_OVF=m +-CONFIG_IP_VS_LBLC=m +-CONFIG_IP_VS_LBLCR=m +-CONFIG_IP_VS_DH=m +-CONFIG_IP_VS_SH=m +-CONFIG_IP_VS_SED=m +-CONFIG_IP_VS_NQ=m +- +-# +-# IPVS SH scheduler +-# +-CONFIG_IP_VS_SH_TAB_BITS=8 +- +-# +-# IPVS application helper +-# +-CONFIG_IP_VS_FTP=m +-CONFIG_IP_VS_NFCT=y +-CONFIG_IP_VS_PE_SIP=m +- +-# +-# IP: Netfilter Configuration +-# +-CONFIG_NF_DEFRAG_IPV4=m +-CONFIG_NF_CONNTRACK_IPV4=m +-CONFIG_NF_CONNTRACK_PROC_COMPAT=y +-CONFIG_NF_TABLES_IPV4=m +-CONFIG_NFT_CHAIN_ROUTE_IPV4=m +-CONFIG_NFT_REJECT_IPV4=m +-CONFIG_NFT_DUP_IPV4=m +-CONFIG_NF_TABLES_ARP=m +-CONFIG_NF_DUP_IPV4=m +-CONFIG_NF_LOG_ARP=m +-CONFIG_NF_LOG_IPV4=m +-CONFIG_NF_REJECT_IPV4=m +-CONFIG_NF_NAT_IPV4=m +-CONFIG_NFT_CHAIN_NAT_IPV4=m +-CONFIG_NF_NAT_MASQUERADE_IPV4=m +-CONFIG_NFT_MASQ_IPV4=m +-CONFIG_NFT_REDIR_IPV4=m +-CONFIG_NF_NAT_SNMP_BASIC=m +-CONFIG_NF_NAT_PROTO_GRE=m +-CONFIG_NF_NAT_PPTP=m +-CONFIG_NF_NAT_H323=m +-CONFIG_IP_NF_IPTABLES=m +-CONFIG_IP_NF_MATCH_AH=m +-CONFIG_IP_NF_MATCH_ECN=m +-CONFIG_IP_NF_MATCH_RPFILTER=m +-CONFIG_IP_NF_MATCH_TTL=m +-CONFIG_IP_NF_FILTER=m +-CONFIG_IP_NF_TARGET_REJECT=m +-CONFIG_IP_NF_TARGET_SYNPROXY=m +-CONFIG_IP_NF_NAT=m +-CONFIG_IP_NF_TARGET_MASQUERADE=m +-CONFIG_IP_NF_TARGET_NETMAP=m +-CONFIG_IP_NF_TARGET_REDIRECT=m +-CONFIG_IP_NF_MANGLE=m +-CONFIG_IP_NF_TARGET_CLUSTERIP=m +-CONFIG_IP_NF_TARGET_ECN=m +-CONFIG_IP_NF_TARGET_TTL=m +-CONFIG_IP_NF_RAW=m +-CONFIG_IP_NF_ARPTABLES=m +-CONFIG_IP_NF_ARPFILTER=m +-CONFIG_IP_NF_ARP_MANGLE=m +- +-# +-# IPv6: Netfilter Configuration +-# +-CONFIG_NF_DEFRAG_IPV6=m +-CONFIG_NF_CONNTRACK_IPV6=m +-CONFIG_NF_TABLES_IPV6=m +-CONFIG_NFT_CHAIN_ROUTE_IPV6=m +-CONFIG_NFT_REJECT_IPV6=m +-CONFIG_NFT_DUP_IPV6=m +-CONFIG_NF_DUP_IPV6=m +-CONFIG_NF_REJECT_IPV6=m +-CONFIG_NF_LOG_IPV6=m +-CONFIG_NF_NAT_IPV6=m +-CONFIG_NFT_CHAIN_NAT_IPV6=m +-CONFIG_NF_NAT_MASQUERADE_IPV6=m +-CONFIG_NFT_MASQ_IPV6=m +-CONFIG_NFT_REDIR_IPV6=m +-CONFIG_IP6_NF_IPTABLES=m +-CONFIG_IP6_NF_MATCH_AH=m +-CONFIG_IP6_NF_MATCH_EUI64=m +-CONFIG_IP6_NF_MATCH_FRAG=m +-CONFIG_IP6_NF_MATCH_OPTS=m +-CONFIG_IP6_NF_MATCH_HL=m +-CONFIG_IP6_NF_MATCH_IPV6HEADER=m +-CONFIG_IP6_NF_MATCH_MH=m +-CONFIG_IP6_NF_MATCH_RPFILTER=m +-CONFIG_IP6_NF_MATCH_RT=m +-CONFIG_IP6_NF_TARGET_HL=m +-CONFIG_IP6_NF_FILTER=m +-CONFIG_IP6_NF_TARGET_REJECT=m +-CONFIG_IP6_NF_TARGET_SYNPROXY=m +-CONFIG_IP6_NF_MANGLE=m +-CONFIG_IP6_NF_RAW=m +-CONFIG_IP6_NF_NAT=m +-CONFIG_IP6_NF_TARGET_MASQUERADE=m +-CONFIG_IP6_NF_TARGET_NPT=m +-CONFIG_NF_TABLES_BRIDGE=m +-CONFIG_NFT_BRIDGE_META=m +-CONFIG_NFT_BRIDGE_REJECT=m +-CONFIG_NF_LOG_BRIDGE=m +-CONFIG_BRIDGE_NF_EBTABLES=m +-CONFIG_BRIDGE_EBT_BROUTE=m +-CONFIG_BRIDGE_EBT_T_FILTER=m +-CONFIG_BRIDGE_EBT_T_NAT=m +-CONFIG_BRIDGE_EBT_802_3=m +-CONFIG_BRIDGE_EBT_AMONG=m +-CONFIG_BRIDGE_EBT_ARP=m +-CONFIG_BRIDGE_EBT_IP=m +-CONFIG_BRIDGE_EBT_IP6=m +-CONFIG_BRIDGE_EBT_LIMIT=m +-CONFIG_BRIDGE_EBT_MARK=m +-CONFIG_BRIDGE_EBT_PKTTYPE=m +-CONFIG_BRIDGE_EBT_STP=m +-CONFIG_BRIDGE_EBT_VLAN=m +-CONFIG_BRIDGE_EBT_ARPREPLY=m +-CONFIG_BRIDGE_EBT_DNAT=m +-CONFIG_BRIDGE_EBT_MARK_T=m +-CONFIG_BRIDGE_EBT_REDIRECT=m +-CONFIG_BRIDGE_EBT_SNAT=m +-CONFIG_BRIDGE_EBT_LOG=m +-CONFIG_BRIDGE_EBT_NFLOG=m +-CONFIG_IP_DCCP=m +-CONFIG_INET_DCCP_DIAG=m +- +-# +-# DCCP CCIDs Configuration +-# +-# CONFIG_IP_DCCP_CCID2_DEBUG is not set +-CONFIG_IP_DCCP_CCID3=y +-# CONFIG_IP_DCCP_CCID3_DEBUG is not set +-CONFIG_IP_DCCP_TFRC_LIB=y +- +-# +-# DCCP Kernel Hacking +-# +-# CONFIG_IP_DCCP_DEBUG is not set +-CONFIG_IP_SCTP=m +-CONFIG_SCTP_DBG_OBJCNT=y +-CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5=y +-# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA1 is not set +-# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE is not set +-CONFIG_SCTP_COOKIE_HMAC_MD5=y +-CONFIG_SCTP_COOKIE_HMAC_SHA1=y +-CONFIG_RDS=m +-# CONFIG_RDS_TCP is not set +-# CONFIG_RDS_DEBUG is not set +-CONFIG_TIPC=m +-CONFIG_TIPC_MEDIA_UDP=y +-# CONFIG_ATM is not set +-CONFIG_L2TP=m +-# CONFIG_L2TP_DEBUGFS is not set +-CONFIG_L2TP_V3=y +-CONFIG_L2TP_IP=m +-CONFIG_L2TP_ETH=m +-CONFIG_STP=m +-CONFIG_BRIDGE=m +-CONFIG_BRIDGE_IGMP_SNOOPING=y +-CONFIG_BRIDGE_VLAN_FILTERING=y +-CONFIG_HAVE_NET_DSA=y +-CONFIG_VLAN_8021Q=m +-# CONFIG_VLAN_8021Q_GVRP is not set +-# CONFIG_VLAN_8021Q_MVRP is not set +-# CONFIG_DECNET is not set +-CONFIG_LLC=m +-CONFIG_LLC2=m +-# CONFIG_IPX is not set +-CONFIG_ATALK=m +-CONFIG_DEV_APPLETALK=m +-CONFIG_IPDDP=m +-CONFIG_IPDDP_ENCAP=y +-# CONFIG_X25 is not set +-# CONFIG_LAPB is not set +-# CONFIG_PHONET is not set +-# CONFIG_6LOWPAN is not set +-# CONFIG_IEEE802154 is not set +-CONFIG_NET_SCHED=y +- +-# +-# Queueing/Scheduling +-# +-CONFIG_NET_SCH_CBQ=y +-CONFIG_NET_SCH_HTB=y +-CONFIG_NET_SCH_HFSC=m +-CONFIG_NET_SCH_PRIO=y +-CONFIG_NET_SCH_MULTIQ=m +-CONFIG_NET_SCH_RED=m +-CONFIG_NET_SCH_SFB=m +-CONFIG_NET_SCH_SFQ=y +-CONFIG_NET_SCH_TEQL=m +-CONFIG_NET_SCH_TBF=m +-CONFIG_NET_SCH_GRED=m +-CONFIG_NET_SCH_DSMARK=m +-CONFIG_NET_SCH_NETEM=m +-CONFIG_NET_SCH_DRR=m +-CONFIG_NET_SCH_MQPRIO=m +-CONFIG_NET_SCH_CHOKE=m +-CONFIG_NET_SCH_QFQ=y +-CONFIG_NET_SCH_CODEL=m +-CONFIG_NET_SCH_FQ_CODEL=m +-CONFIG_NET_SCH_FQ=m +-CONFIG_NET_SCH_HHF=m +-CONFIG_NET_SCH_PIE=m +-CONFIG_NET_SCH_INGRESS=m +-CONFIG_NET_SCH_PLUG=m +- +-# +-# Classification +-# +-CONFIG_NET_CLS=y +-CONFIG_NET_CLS_BASIC=m +-CONFIG_NET_CLS_TCINDEX=m +-CONFIG_NET_CLS_ROUTE4=m +-CONFIG_NET_CLS_FW=m +-CONFIG_NET_CLS_U32=m +-CONFIG_CLS_U32_PERF=y +-CONFIG_CLS_U32_MARK=y +-CONFIG_NET_CLS_RSVP=m +-CONFIG_NET_CLS_RSVP6=m +-CONFIG_NET_CLS_FLOW=m +-CONFIG_NET_CLS_CGROUP=m +-CONFIG_NET_CLS_BPF=m +-CONFIG_NET_CLS_FLOWER=m +-CONFIG_NET_EMATCH=y +-CONFIG_NET_EMATCH_STACK=32 +-CONFIG_NET_EMATCH_CMP=m +-CONFIG_NET_EMATCH_NBYTE=m +-CONFIG_NET_EMATCH_U32=m +-CONFIG_NET_EMATCH_META=m +-CONFIG_NET_EMATCH_TEXT=m +-CONFIG_NET_EMATCH_CANID=m +-CONFIG_NET_EMATCH_IPSET=m +-CONFIG_NET_CLS_ACT=y +-CONFIG_NET_ACT_POLICE=m +-CONFIG_NET_ACT_GACT=m +-CONFIG_GACT_PROB=y +-CONFIG_NET_ACT_MIRRED=m +-CONFIG_NET_ACT_IPT=m +-CONFIG_NET_ACT_NAT=m +-CONFIG_NET_ACT_PEDIT=m +-CONFIG_NET_ACT_SIMP=m +-CONFIG_NET_ACT_SKBEDIT=m +-CONFIG_NET_ACT_CSUM=m +-CONFIG_NET_ACT_VLAN=m +-CONFIG_NET_ACT_BPF=m +-CONFIG_NET_ACT_CONNMARK=m +-CONFIG_NET_CLS_IND=y +-CONFIG_NET_SCH_FIFO=y +-# CONFIG_DCB is not set +-CONFIG_DNS_RESOLVER=y +-# CONFIG_BATMAN_ADV is not set +-CONFIG_OPENVSWITCH=m +-CONFIG_OPENVSWITCH_GRE=m +-CONFIG_OPENVSWITCH_VXLAN=m +-CONFIG_VSOCKETS=m +-CONFIG_NETLINK_MMAP=y +-CONFIG_NETLINK_DIAG=m +-CONFIG_MPLS=y +-CONFIG_NET_MPLS_GSO=m +-# CONFIG_MPLS_ROUTING is not set +-# CONFIG_HSR is not set +-# CONFIG_NET_SWITCHDEV is not set +-# CONFIG_NET_L3_MASTER_DEV is not set +-CONFIG_RPS=y +-CONFIG_RFS_ACCEL=y +-CONFIG_XPS=y +-CONFIG_CGROUP_NET_PRIO=y +-CONFIG_CGROUP_NET_CLASSID=y +-CONFIG_NET_RX_BUSY_POLL=y +-CONFIG_BQL=y +-# CONFIG_BPF_JIT is not set +-CONFIG_NET_FLOW_LIMIT=y +- +-# +-# Network testing +-# +-# CONFIG_NET_PKTGEN is not set +-# CONFIG_NET_DROP_MONITOR is not set +-# CONFIG_HAMRADIO is not set +-CONFIG_CAN=m +-CONFIG_CAN_RAW=m +-CONFIG_CAN_BCM=m +-CONFIG_CAN_GW=m +- +-# +-# CAN Device Drivers +-# +-# CONFIG_CAN_VCAN is not set +-# CONFIG_CAN_SLCAN is not set +-CONFIG_CAN_DEV=m +-CONFIG_CAN_CALC_BITTIMING=y +-# CONFIG_CAN_LEDS is not set +-# CONFIG_CAN_TI_HECC is not set +-CONFIG_CAN_FLEXCAN=m +-# CONFIG_CAN_GRCAN is not set +-# CONFIG_CAN_RCAR is not set +-# CONFIG_CAN_SJA1000 is not set +-# CONFIG_CAN_C_CAN is not set +-# CONFIG_CAN_M_CAN is not set +-# CONFIG_CAN_CC770 is not set +- +-# +-# CAN SPI interfaces +-# +-# CONFIG_CAN_MCP251X is not set +- +-# +-# CAN USB interfaces +-# +-CONFIG_CAN_EMS_USB=m +-CONFIG_CAN_ESD_USB2=m +-CONFIG_CAN_GS_USB=m +-CONFIG_CAN_KVASER_USB=m +-CONFIG_CAN_PEAK_USB=m +-CONFIG_CAN_8DEV_USB=m +-# CONFIG_CAN_SOFTING is not set +-# CONFIG_CAN_DEBUG_DEVICES is not set +-CONFIG_IRDA=m +- +-# +-# IrDA protocols +-# +-CONFIG_IRLAN=m +-CONFIG_IRNET=m +-CONFIG_IRCOMM=m +-CONFIG_IRDA_ULTRA=y +- +-# +-# IrDA options +-# +-# CONFIG_IRDA_CACHE_LAST_LSAP is not set +-CONFIG_IRDA_FAST_RR=y +-# CONFIG_IRDA_DEBUG is not set +- +-# +-# Infrared-port device drivers +-# +- +-# +-# SIR device drivers +-# +-CONFIG_IRTTY_SIR=m +- +-# +-# Dongle support +-# +-CONFIG_DONGLE=y +-CONFIG_ESI_DONGLE=m +-CONFIG_ACTISYS_DONGLE=m +-CONFIG_TEKRAM_DONGLE=m +-CONFIG_TOIM3232_DONGLE=m +-CONFIG_LITELINK_DONGLE=m +-CONFIG_MA600_DONGLE=m +-CONFIG_GIRBIL_DONGLE=m +-CONFIG_MCP2120_DONGLE=m +-CONFIG_OLD_BELKIN_DONGLE=m +-CONFIG_ACT200L_DONGLE=m +-CONFIG_KINGSUN_DONGLE=m +-CONFIG_KSDAZZLE_DONGLE=m +-CONFIG_KS959_DONGLE=m +- +-# +-# FIR device drivers +-# +-CONFIG_USB_IRDA=m +-CONFIG_SIGMATEL_FIR=m +-CONFIG_VLSI_FIR=m +-CONFIG_MCS_FIR=m +-CONFIG_BT=y +-CONFIG_BT_BREDR=y +-CONFIG_BT_RFCOMM=m +-CONFIG_BT_RFCOMM_TTY=y +-CONFIG_BT_BNEP=m +-CONFIG_BT_BNEP_MC_FILTER=y +-CONFIG_BT_BNEP_PROTO_FILTER=y +-CONFIG_BT_CMTP=m +-CONFIG_BT_HIDP=y +-CONFIG_BT_HS=y +-CONFIG_BT_LE=y +-# CONFIG_BT_SELFTEST is not set +-# CONFIG_BT_DEBUGFS is not set +- +-# +-# Bluetooth device drivers +-# +-CONFIG_BT_INTEL=y +-CONFIG_BT_BCM=y +-CONFIG_BT_RTL=m +-CONFIG_BT_QCA=y +-CONFIG_BT_HCIBTUSB=m +-CONFIG_BT_HCIBTUSB_BCM=y +-CONFIG_BT_HCIBTUSB_RTL=y +-# CONFIG_BT_HCIBTSDIO is not set +-CONFIG_BT_HCIUART=y +-CONFIG_BT_HCIUART_H4=y +-CONFIG_BT_HCIUART_BCSP=y +-CONFIG_BT_HCIUART_ATH3K=y +-CONFIG_BT_HCIUART_LL=y +-CONFIG_BT_HCIUART_3WIRE=y +-CONFIG_BT_HCIUART_INTEL=y +-CONFIG_BT_HCIUART_BCM=y +-CONFIG_BT_HCIUART_QCA=y +-CONFIG_BT_HCIBCM203X=m +-CONFIG_BT_HCIBPA10X=m +-CONFIG_BT_HCIBFUSB=m +-CONFIG_BT_HCIVHCI=m +-CONFIG_BT_MRVL=m +-CONFIG_BT_MRVL_SDIO=m +-CONFIG_BT_ATH3K=m +-CONFIG_BT_WILINK=m +-CONFIG_AF_RXRPC=m +-# CONFIG_AF_RXRPC_DEBUG is not set +-# CONFIG_RXKAD is not set +-CONFIG_FIB_RULES=y +-CONFIG_WIRELESS=y +-CONFIG_WIRELESS_EXT=y +-CONFIG_WEXT_CORE=y +-CONFIG_WEXT_PROC=y +-CONFIG_WEXT_SPY=y +-CONFIG_WEXT_PRIV=y +-CONFIG_CFG80211=m +-# CONFIG_NL80211_TESTMODE is not set +-# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set +-# CONFIG_CFG80211_REG_DEBUG is not set +-# CONFIG_CFG80211_CERTIFICATION_ONUS is not set +-# CONFIG_CFG80211_DEFAULT_PS is not set +-# CONFIG_CFG80211_DEBUGFS is not set +-# CONFIG_CFG80211_INTERNAL_REGDB is not set +-CONFIG_CFG80211_CRDA_SUPPORT=y +-CONFIG_CFG80211_WEXT=y +-CONFIG_CFG80211_WEXT_EXPORT=y +-CONFIG_LIB80211=m +-CONFIG_LIB80211_CRYPT_WEP=m +-CONFIG_LIB80211_CRYPT_CCMP=m +-CONFIG_LIB80211_CRYPT_TKIP=m +-# CONFIG_LIB80211_DEBUG is not set +-CONFIG_MAC80211=m +-CONFIG_MAC80211_HAS_RC=y +-CONFIG_MAC80211_RC_MINSTREL=y +-CONFIG_MAC80211_RC_MINSTREL_HT=y +-CONFIG_MAC80211_RC_MINSTREL_VHT=y +-CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y +-CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" +-CONFIG_MAC80211_MESH=y +-CONFIG_MAC80211_LEDS=y +-# CONFIG_MAC80211_DEBUGFS is not set +-# CONFIG_MAC80211_MESSAGE_TRACING is not set +-# CONFIG_MAC80211_DEBUG_MENU is not set +-CONFIG_MAC80211_STA_HASH_MAX_SIZE=0 +-# CONFIG_WIMAX is not set +-CONFIG_RFKILL=y +-CONFIG_RFKILL_LEDS=y +-CONFIG_RFKILL_INPUT=y +-CONFIG_RFKILL_REGULATOR=y +-CONFIG_RFKILL_GPIO=y +-# CONFIG_NET_9P is not set +-CONFIG_CAIF=m +-# CONFIG_CAIF_DEBUG is not set +-CONFIG_CAIF_NETDEV=m +-CONFIG_CAIF_USB=m +-CONFIG_CEPH_LIB=m +-# CONFIG_CEPH_LIB_PRETTYDEBUG is not set +-CONFIG_CEPH_LIB_USE_DNS_RESOLVER=y +-CONFIG_NFC=m +-# CONFIG_NFC_DIGITAL is not set +-# CONFIG_NFC_NCI is not set +-# CONFIG_NFC_HCI is not set +- +-# +-# Near Field Communication (NFC) devices +-# +-# CONFIG_NFC_PN533 is not set +-# CONFIG_NFC_SIM is not set +-CONFIG_LWTUNNEL=y +-CONFIG_HAVE_BPF_JIT=y +- +-# +-# Device Drivers +-# +- +-# +-# Generic Driver Options +-# +-CONFIG_UEVENT_HELPER=y +-CONFIG_UEVENT_HELPER_PATH="" +-CONFIG_DEVTMPFS=y +-CONFIG_DEVTMPFS_MOUNT=y +-# CONFIG_STANDALONE is not set +-# CONFIG_PREVENT_FIRMWARE_BUILD is not set +-CONFIG_FW_LOADER=y +-CONFIG_FIRMWARE_IN_KERNEL=y +-CONFIG_EXTRA_FIRMWARE="" +-CONFIG_FW_LOADER_USER_HELPER=y +-CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y +-CONFIG_WANT_DEV_COREDUMP=y +-CONFIG_ALLOW_DEV_COREDUMP=y +-CONFIG_DEV_COREDUMP=y +-# CONFIG_DEBUG_DRIVER is not set +-# CONFIG_DEBUG_DEVRES is not set +-# CONFIG_SYS_HYPERVISOR is not set +-# CONFIG_GENERIC_CPU_DEVICES is not set +-CONFIG_SOC_BUS=y +-CONFIG_REGMAP=y +-CONFIG_REGMAP_I2C=y +-CONFIG_REGMAP_SPI=y +-CONFIG_REGMAP_MMIO=y +-CONFIG_REGMAP_IRQ=y +-CONFIG_DMA_SHARED_BUFFER=y +-# CONFIG_FENCE_TRACE is not set +-CONFIG_DMA_CMA=y +- +-# +-# Default contiguous memory area size: +-# +-CONFIG_CMA_SIZE_MBYTES=288 +-CONFIG_CMA_SIZE_SEL_MBYTES=y +-# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set +-# CONFIG_CMA_SIZE_SEL_MIN is not set +-# CONFIG_CMA_SIZE_SEL_MAX is not set +-CONFIG_CMA_ALIGNMENT=8 +- +-# +-# Bus devices +-# +-# CONFIG_ARM_CCI400_PMU is not set +-# CONFIG_ARM_CCI500_PMU is not set +-# CONFIG_ARM_CCN is not set +-# CONFIG_BRCMSTB_GISB_ARB is not set +-CONFIG_IMX_WEIM=y +-# CONFIG_VEXPRESS_CONFIG is not set +-CONFIG_CONNECTOR=y +-CONFIG_PROC_EVENTS=y +-CONFIG_MTD=y +-# CONFIG_MTD_TESTS is not set +-# CONFIG_MTD_REDBOOT_PARTS is not set +-CONFIG_MTD_CMDLINE_PARTS=y +-# CONFIG_MTD_AFS_PARTS is not set +-CONFIG_MTD_OF_PARTS=y +-# CONFIG_MTD_AR7_PARTS is not set +- +-# +-# User Modules And Translation Layers +-# +-CONFIG_MTD_BLKDEVS=y +-CONFIG_MTD_BLOCK=y +-# CONFIG_FTL is not set +-# CONFIG_NFTL is not set +-# CONFIG_INFTL is not set +-# CONFIG_RFD_FTL is not set +-# CONFIG_SSFDC is not set +-# CONFIG_SM_FTL is not set +-# CONFIG_MTD_OOPS is not set +-# CONFIG_MTD_SWAP is not set +-# CONFIG_MTD_PARTITIONED_MASTER is not set +- +-# +-# RAM/ROM/Flash chip drivers +-# +-CONFIG_MTD_CFI=y +-CONFIG_MTD_JEDECPROBE=y +-CONFIG_MTD_GEN_PROBE=y +-# CONFIG_MTD_CFI_ADV_OPTIONS is not set +-CONFIG_MTD_MAP_BANK_WIDTH_1=y +-CONFIG_MTD_MAP_BANK_WIDTH_2=y +-CONFIG_MTD_MAP_BANK_WIDTH_4=y +-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +-CONFIG_MTD_CFI_I1=y +-CONFIG_MTD_CFI_I2=y +-# CONFIG_MTD_CFI_I4 is not set +-# CONFIG_MTD_CFI_I8 is not set +-CONFIG_MTD_CFI_INTELEXT=y +-CONFIG_MTD_CFI_AMDSTD=y +-CONFIG_MTD_CFI_STAA=y +-CONFIG_MTD_CFI_UTIL=y +-# CONFIG_MTD_RAM is not set +-# CONFIG_MTD_ROM is not set +-# CONFIG_MTD_ABSENT is not set +- +-# +-# Mapping drivers for chip access +-# +-# CONFIG_MTD_COMPLEX_MAPPINGS is not set +-# CONFIG_MTD_PHYSMAP is not set +-CONFIG_MTD_PHYSMAP_OF=y +-# CONFIG_MTD_IMPA7 is not set +-# CONFIG_MTD_INTEL_VR_NOR is not set +-# CONFIG_MTD_PLATRAM is not set +- +-# +-# Self-contained MTD device drivers +-# +-# CONFIG_MTD_PMC551 is not set +-CONFIG_MTD_DATAFLASH=y +-# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set +-# CONFIG_MTD_DATAFLASH_OTP is not set +-# CONFIG_MTD_M25P80 is not set +-CONFIG_MTD_SST25L=y +-# CONFIG_MTD_SLRAM is not set +-# CONFIG_MTD_PHRAM is not set +-# CONFIG_MTD_MTDRAM is not set +-# CONFIG_MTD_BLOCK2MTD is not set +- +-# +-# Disk-On-Chip Device Drivers +-# +-# CONFIG_MTD_DOCG3 is not set +-CONFIG_MTD_NAND_ECC=y +-# CONFIG_MTD_NAND_ECC_SMC is not set +-CONFIG_MTD_NAND=y +-# CONFIG_MTD_NAND_ECC_BCH is not set +-# CONFIG_MTD_SM_COMMON is not set +-# CONFIG_MTD_NAND_DENALI_PCI is not set +-# CONFIG_MTD_NAND_DENALI_DT is not set +-# CONFIG_MTD_NAND_GPIO is not set +-# CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set +-CONFIG_MTD_NAND_IDS=y +-# CONFIG_MTD_NAND_RICOH is not set +-# CONFIG_MTD_NAND_DISKONCHIP is not set +-# CONFIG_MTD_NAND_DOCG4 is not set +-# CONFIG_MTD_NAND_CAFE is not set +-# CONFIG_MTD_NAND_NANDSIM is not set +-# CONFIG_MTD_NAND_GPMI_NAND is not set +-# CONFIG_MTD_NAND_BRCMNAND is not set +-# CONFIG_MTD_NAND_PLATFORM is not set +-CONFIG_MTD_NAND_MXC=y +-# CONFIG_MTD_NAND_HISI504 is not set +-# CONFIG_MTD_ONENAND is not set +- +-# +-# LPDDR & LPDDR2 PCM memory drivers +-# +-# CONFIG_MTD_LPDDR is not set +-# CONFIG_MTD_LPDDR2_NVM is not set +-CONFIG_MTD_SPI_NOR=m +-CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +-CONFIG_SPI_FSL_QUADSPI=m +-CONFIG_MTD_UBI=y +-CONFIG_MTD_UBI_WL_THRESHOLD=4096 +-CONFIG_MTD_UBI_BEB_LIMIT=20 +-# CONFIG_MTD_UBI_FASTMAP is not set +-# CONFIG_MTD_UBI_GLUEBI is not set +-# CONFIG_MTD_UBI_BLOCK is not set +-CONFIG_DTC=y +-CONFIG_OF=y +-# CONFIG_OF_UNITTEST is not set +-CONFIG_OF_FLATTREE=y +-CONFIG_OF_EARLY_FLATTREE=y +-CONFIG_OF_ADDRESS=y +-CONFIG_OF_ADDRESS_PCI=y +-CONFIG_OF_IRQ=y +-CONFIG_OF_NET=y +-CONFIG_OF_MDIO=y +-CONFIG_OF_PCI=y +-CONFIG_OF_PCI_IRQ=y +-CONFIG_OF_MTD=y +-CONFIG_OF_RESERVED_MEM=y +-# CONFIG_OF_OVERLAY is not set +-CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +-# CONFIG_PARPORT is not set +-CONFIG_BLK_DEV=y +-# CONFIG_BLK_DEV_NULL_BLK is not set +-# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set +-# CONFIG_BLK_CPQ_CISS_DA is not set +-# CONFIG_BLK_DEV_DAC960 is not set +-# CONFIG_BLK_DEV_UMEM is not set +-# CONFIG_BLK_DEV_COW_COMMON is not set +-CONFIG_BLK_DEV_LOOP=m +-CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 +-CONFIG_BLK_DEV_CRYPTOLOOP=m +-# CONFIG_BLK_DEV_DRBD is not set +-# CONFIG_BLK_DEV_NBD is not set +-# CONFIG_BLK_DEV_SX8 is not set +-CONFIG_BLK_DEV_RAM=m +-CONFIG_BLK_DEV_RAM_COUNT=16 +-CONFIG_BLK_DEV_RAM_SIZE=65536 +-CONFIG_CDROM_PKTCDVD=m +-CONFIG_CDROM_PKTCDVD_BUFFERS=8 +-# CONFIG_CDROM_PKTCDVD_WCACHE is not set +-# CONFIG_ATA_OVER_ETH is not set +-CONFIG_MG_DISK=y +-CONFIG_MG_DISK_RES=0 +-# CONFIG_BLK_DEV_RBD is not set +-# CONFIG_BLK_DEV_RSXX is not set +-# CONFIG_BLK_DEV_NVME is not set +- +-# +-# Misc devices +-# +-# CONFIG_SENSORS_LIS3LV02D is not set +-# CONFIG_AD525X_DPOT is not set +-# CONFIG_DUMMY_IRQ is not set +-CONFIG_HWLAT_DETECTOR=m +-# CONFIG_PHANTOM is not set +-# CONFIG_SGI_IOC4 is not set +-CONFIG_TIFM_CORE=y +-CONFIG_TIFM_7XX1=y +-# CONFIG_ICS932S401 is not set +-CONFIG_ENCLOSURE_SERVICES=y +-# CONFIG_HP_ILO is not set +-# CONFIG_APDS9802ALS is not set +-# CONFIG_ISL29003 is not set +-# CONFIG_ISL29020 is not set +-# CONFIG_SENSORS_TSL2550 is not set +-# CONFIG_SENSORS_BH1780 is not set +-# CONFIG_SENSORS_BH1770 is not set +-# CONFIG_SENSORS_APDS990X is not set +-# CONFIG_HMC6352 is not set +-# CONFIG_DS1682 is not set +-# CONFIG_TI_DAC7512 is not set +-# CONFIG_BMP085_I2C is not set +-# CONFIG_BMP085_SPI is not set +-# CONFIG_USB_SWITCH_FSA9480 is not set +-# CONFIG_LATTICE_ECP3_CONFIG is not set +-CONFIG_SRAM=y +-# CONFIG_C2PORT is not set +- +-# +-# EEPROM support +-# +-CONFIG_EEPROM_AT24=y +-CONFIG_EEPROM_AT25=y +-# CONFIG_EEPROM_LEGACY is not set +-CONFIG_EEPROM_MAX6875=y +-CONFIG_EEPROM_93CX6=m +-# CONFIG_EEPROM_93XX46 is not set +-CONFIG_CB710_CORE=y +-# CONFIG_CB710_DEBUG is not set +-CONFIG_CB710_DEBUG_ASSUMPTIONS=y +- +-# +-# Texas Instruments shared transport line discipline +-# +-CONFIG_TI_ST=m +-# CONFIG_SENSORS_LIS3_SPI is not set +-# CONFIG_SENSORS_LIS3_I2C is not set +- +-# +-# Altera FPGA firmware download module +-# +-CONFIG_ALTERA_STAPL=m +- +-# +-# Intel MIC Bus Driver +-# +- +-# +-# SCIF Bus Driver +-# +- +-# +-# Intel MIC Host Driver +-# +- +-# +-# Intel MIC Card Driver +-# +- +-# +-# SCIF Driver +-# +- +-# +-# Intel MIC Coprocessor State Management (COSM) Drivers +-# +-CONFIG_ECHO=m +-# CONFIG_CXL_BASE is not set +-# CONFIG_CXL_KERNEL_API is not set +-# CONFIG_CXL_EEH is not set +-CONFIG_HAVE_IDE=y +-# CONFIG_IDE is not set +- +-# +-# SCSI device support +-# +-CONFIG_SCSI_MOD=y +-# CONFIG_RAID_ATTRS is not set +-CONFIG_SCSI=y +-CONFIG_SCSI_DMA=y +-CONFIG_SCSI_NETLINK=y +-# CONFIG_SCSI_MQ_DEFAULT is not set +-CONFIG_SCSI_PROC_FS=y +- +-# +-# SCSI support type (disk, tape, CD-ROM) +-# +-CONFIG_BLK_DEV_SD=y +-# CONFIG_CHR_DEV_ST is not set +-# CONFIG_CHR_DEV_OSST is not set +-CONFIG_BLK_DEV_SR=y +-CONFIG_BLK_DEV_SR_VENDOR=y +-CONFIG_CHR_DEV_SG=y +-CONFIG_CHR_DEV_SCH=y +-CONFIG_SCSI_ENCLOSURE=y +-# CONFIG_SCSI_CONSTANTS is not set +-CONFIG_SCSI_LOGGING=y +-CONFIG_SCSI_SCAN_ASYNC=y +- +-# +-# SCSI Transports +-# +-# CONFIG_SCSI_SPI_ATTRS is not set +-CONFIG_SCSI_FC_ATTRS=m +-CONFIG_SCSI_ISCSI_ATTRS=m +-# CONFIG_SCSI_SAS_ATTRS is not set +-# CONFIG_SCSI_SAS_LIBSAS is not set +-# CONFIG_SCSI_SRP_ATTRS is not set +-CONFIG_SCSI_LOWLEVEL=y +-CONFIG_ISCSI_TCP=m +-CONFIG_ISCSI_BOOT_SYSFS=m +-# CONFIG_SCSI_CXGB3_ISCSI is not set +-# CONFIG_SCSI_CXGB4_ISCSI is not set +-# CONFIG_SCSI_BNX2_ISCSI is not set +-# CONFIG_SCSI_BNX2X_FCOE is not set +-# CONFIG_BE2ISCSI is not set +-# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +-# CONFIG_SCSI_HPSA is not set +-# CONFIG_SCSI_3W_9XXX is not set +-# CONFIG_SCSI_3W_SAS is not set +-# CONFIG_SCSI_ACARD is not set +-# CONFIG_SCSI_AACRAID is not set +-# CONFIG_SCSI_AIC7XXX is not set +-# CONFIG_SCSI_AIC79XX is not set +-# CONFIG_SCSI_AIC94XX is not set +-# CONFIG_SCSI_MVSAS is not set +-# CONFIG_SCSI_MVUMI is not set +-# CONFIG_SCSI_ADVANSYS is not set +-# CONFIG_SCSI_ARCMSR is not set +-# CONFIG_SCSI_ESAS2R is not set +-# CONFIG_MEGARAID_NEWGEN is not set +-# CONFIG_MEGARAID_LEGACY is not set +-# CONFIG_MEGARAID_SAS is not set +-# CONFIG_SCSI_MPT3SAS is not set +-# CONFIG_SCSI_MPT2SAS is not set +-CONFIG_SCSI_UFSHCD=m +-# CONFIG_SCSI_UFSHCD_PCI is not set +-CONFIG_SCSI_UFSHCD_PLATFORM=m +-# CONFIG_SCSI_HPTIOP is not set +-CONFIG_LIBFC=m +-CONFIG_LIBFCOE=m +-# CONFIG_FCOE is not set +-# CONFIG_SCSI_SNIC is not set +-# CONFIG_SCSI_DMX3191D is not set +-# CONFIG_SCSI_FUTURE_DOMAIN is not set +-# CONFIG_SCSI_IPS is not set +-# CONFIG_SCSI_INITIO is not set +-# CONFIG_SCSI_INIA100 is not set +-# CONFIG_SCSI_STEX is not set +-# CONFIG_SCSI_SYM53C8XX_2 is not set +-# CONFIG_SCSI_IPR is not set +-# CONFIG_SCSI_QLOGIC_1280 is not set +-# CONFIG_SCSI_QLA_FC is not set +-# CONFIG_SCSI_QLA_ISCSI is not set +-# CONFIG_SCSI_LPFC is not set +-# CONFIG_SCSI_DC395x is not set +-# CONFIG_SCSI_AM53C974 is not set +-# CONFIG_SCSI_NSP32 is not set +-# CONFIG_SCSI_WD719X is not set +-# CONFIG_SCSI_DEBUG is not set +-# CONFIG_SCSI_PMCRAID is not set +-# CONFIG_SCSI_PM8001 is not set +-# CONFIG_SCSI_BFA_FC is not set +-# CONFIG_SCSI_CHELSIO_FCOE is not set +-# CONFIG_SCSI_DH is not set +-CONFIG_SCSI_OSD_INITIATOR=m +-# CONFIG_SCSI_OSD_ULD is not set +-CONFIG_SCSI_OSD_DPRINT_SENSE=1 +-# CONFIG_SCSI_OSD_DEBUG is not set +-CONFIG_ATA=y +-# CONFIG_ATA_NONSTANDARD is not set +-# CONFIG_ATA_VERBOSE_ERROR is not set +-CONFIG_SATA_PMP=y +- +-# +-# Controllers with non-SFF native interface +-# +-CONFIG_SATA_AHCI=y +-CONFIG_SATA_AHCI_PLATFORM=y +-CONFIG_AHCI_IMX=y +-# CONFIG_AHCI_CEVA is not set +-# CONFIG_AHCI_QORIQ is not set +-# CONFIG_SATA_INIC162X is not set +-# CONFIG_SATA_ACARD_AHCI is not set +-# CONFIG_SATA_SIL24 is not set +-CONFIG_ATA_SFF=y +- +-# +-# SFF controllers with custom DMA interface +-# +-# CONFIG_PDC_ADMA is not set +-# CONFIG_SATA_QSTOR is not set +-# CONFIG_SATA_SX4 is not set +-CONFIG_ATA_BMDMA=y +- +-# +-# SATA SFF controllers with BMDMA +-# +-# CONFIG_ATA_PIIX is not set +-# CONFIG_SATA_MV is not set +-# CONFIG_SATA_NV is not set +-# CONFIG_SATA_PROMISE is not set +-# CONFIG_SATA_SIL is not set +-# CONFIG_SATA_SIS is not set +-# CONFIG_SATA_SVW is not set +-# CONFIG_SATA_ULI is not set +-# CONFIG_SATA_VIA is not set +-# CONFIG_SATA_VITESSE is not set +- +-# +-# PATA SFF controllers with BMDMA +-# +-# CONFIG_PATA_ALI is not set +-# CONFIG_PATA_AMD is not set +-# CONFIG_PATA_ARTOP is not set +-# CONFIG_PATA_ATIIXP is not set +-# CONFIG_PATA_ATP867X is not set +-# CONFIG_PATA_CMD64X is not set +-# CONFIG_PATA_CYPRESS is not set +-# CONFIG_PATA_EFAR is not set +-# CONFIG_PATA_HPT366 is not set +-# CONFIG_PATA_HPT37X is not set +-# CONFIG_PATA_HPT3X2N is not set +-# CONFIG_PATA_HPT3X3 is not set +-CONFIG_PATA_IMX=y +-# CONFIG_PATA_IT8213 is not set +-# CONFIG_PATA_IT821X is not set +-# CONFIG_PATA_JMICRON is not set +-# CONFIG_PATA_MARVELL is not set +-# CONFIG_PATA_NETCELL is not set +-# CONFIG_PATA_NINJA32 is not set +-# CONFIG_PATA_NS87415 is not set +-# CONFIG_PATA_OLDPIIX is not set +-# CONFIG_PATA_OPTIDMA is not set +-# CONFIG_PATA_PDC2027X is not set +-# CONFIG_PATA_PDC_OLD is not set +-# CONFIG_PATA_RADISYS is not set +-# CONFIG_PATA_RDC is not set +-# CONFIG_PATA_SCH is not set +-# CONFIG_PATA_SERVERWORKS is not set +-# CONFIG_PATA_SIL680 is not set +-# CONFIG_PATA_SIS is not set +-# CONFIG_PATA_TOSHIBA is not set +-# CONFIG_PATA_TRIFLEX is not set +-# CONFIG_PATA_VIA is not set +-# CONFIG_PATA_WINBOND is not set +- +-# +-# PIO-only SFF controllers +-# +-# CONFIG_PATA_CMD640_PCI is not set +-# CONFIG_PATA_MPIIX is not set +-# CONFIG_PATA_NS87410 is not set +-# CONFIG_PATA_OPTI is not set +-# CONFIG_PATA_PLATFORM is not set +-# CONFIG_PATA_RZ1000 is not set +- +-# +-# Generic fallback / legacy drivers +-# +-# CONFIG_ATA_GENERIC is not set +-# CONFIG_PATA_LEGACY is not set +-CONFIG_MD=y +-CONFIG_BLK_DEV_MD=y +-CONFIG_MD_AUTODETECT=y +-CONFIG_MD_LINEAR=y +-CONFIG_MD_RAID0=y +-CONFIG_MD_RAID1=y +-CONFIG_MD_RAID10=y +-CONFIG_MD_RAID456=m +-CONFIG_MD_MULTIPATH=m +-CONFIG_MD_FAULTY=m +-# CONFIG_MD_CLUSTER is not set +-CONFIG_BCACHE=m +-# CONFIG_BCACHE_DEBUG is not set +-# CONFIG_BCACHE_CLOSURES_DEBUG is not set +-CONFIG_BLK_DEV_DM_BUILTIN=y +-CONFIG_BLK_DEV_DM=m +-# CONFIG_DM_MQ_DEFAULT is not set +-# CONFIG_DM_DEBUG is not set +-CONFIG_DM_BUFIO=m +-CONFIG_DM_BIO_PRISON=m +-CONFIG_DM_PERSISTENT_DATA=m +-# CONFIG_DM_DEBUG_BLOCK_STACK_TRACING is not set +-CONFIG_DM_CRYPT=m +-CONFIG_DM_SNAPSHOT=m +-CONFIG_DM_THIN_PROVISIONING=m +-CONFIG_DM_CACHE=m +-CONFIG_DM_CACHE_MQ=m +-CONFIG_DM_CACHE_SMQ=m +-CONFIG_DM_CACHE_CLEANER=m +-# CONFIG_DM_ERA is not set +-CONFIG_DM_MIRROR=m +-CONFIG_DM_LOG_USERSPACE=m +-CONFIG_DM_RAID=m +-CONFIG_DM_ZERO=m +-CONFIG_DM_MULTIPATH=m +-CONFIG_DM_MULTIPATH_QL=m +-CONFIG_DM_MULTIPATH_ST=m +-CONFIG_DM_DELAY=m +-CONFIG_DM_UEVENT=y +-CONFIG_DM_FLAKEY=m +-CONFIG_DM_VERITY=m +-# CONFIG_DM_SWITCH is not set +-# CONFIG_DM_LOG_WRITES is not set +-# CONFIG_TARGET_CORE is not set +-# CONFIG_FUSION is not set +- +-# +-# IEEE 1394 (FireWire) support +-# +-# CONFIG_FIREWIRE is not set +-# CONFIG_FIREWIRE_NOSY is not set +-CONFIG_NETDEVICES=y +-CONFIG_MII=y +-CONFIG_NET_CORE=y +-CONFIG_BONDING=m +-CONFIG_DUMMY=m +-# CONFIG_EQUALIZER is not set +-# CONFIG_NET_FC is not set +-# CONFIG_IFB is not set +-CONFIG_NET_TEAM=m +-CONFIG_NET_TEAM_MODE_BROADCAST=m +-CONFIG_NET_TEAM_MODE_ROUNDROBIN=m +-CONFIG_NET_TEAM_MODE_RANDOM=m +-CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m +-CONFIG_NET_TEAM_MODE_LOADBALANCE=m +-CONFIG_MACVLAN=m +-CONFIG_MACVTAP=m +-CONFIG_IPVLAN=m +-CONFIG_VXLAN=m +-# CONFIG_GENEVE is not set +-CONFIG_NETCONSOLE=m +-CONFIG_NETCONSOLE_DYNAMIC=y +-CONFIG_NETPOLL=y +-CONFIG_NET_POLL_CONTROLLER=y +-CONFIG_TUN=m +-# CONFIG_TUN_VNET_CROSS_LE is not set +-CONFIG_VETH=m +-CONFIG_NLMON=m +-# CONFIG_ARCNET is not set +- +-# +-# CAIF transport drivers +-# +-# CONFIG_CAIF_TTY is not set +-# CONFIG_CAIF_SPI_SLAVE is not set +-# CONFIG_CAIF_HSI is not set +-# CONFIG_CAIF_VIRTIO is not set +- +-# +-# Distributed Switch Architecture drivers +-# +-# CONFIG_NET_DSA_MV88E6XXX is not set +-# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set +-CONFIG_ETHERNET=y +-CONFIG_MDIO=y +-# CONFIG_NET_VENDOR_3COM is not set +-# CONFIG_NET_VENDOR_ADAPTEC is not set +-# CONFIG_NET_VENDOR_AGERE is not set +-# CONFIG_NET_VENDOR_ALTEON is not set +-# CONFIG_ALTERA_TSE is not set +-# CONFIG_NET_VENDOR_AMD is not set +-# CONFIG_NET_VENDOR_ARC is not set +-CONFIG_NET_VENDOR_ATHEROS=y +-CONFIG_ATL2=y +-CONFIG_ATL1=y +-CONFIG_ATL1E=y +-CONFIG_ATL1C=y +-CONFIG_ALX=y +-# CONFIG_NET_VENDOR_AURORA is not set +-# CONFIG_NET_CADENCE is not set +-# CONFIG_NET_VENDOR_BROADCOM is not set +-# CONFIG_NET_VENDOR_BROCADE is not set +-# CONFIG_NET_VENDOR_CAVIUM is not set +-# CONFIG_NET_VENDOR_CHELSIO is not set +-# CONFIG_NET_VENDOR_CIRRUS is not set +-# CONFIG_NET_VENDOR_CISCO is not set +-# CONFIG_DM9000 is not set +-# CONFIG_DNET is not set +-# CONFIG_NET_VENDOR_DEC is not set +-# CONFIG_NET_VENDOR_DLINK is not set +-# CONFIG_NET_VENDOR_EMULEX is not set +-# CONFIG_NET_VENDOR_EZCHIP is not set +-# CONFIG_NET_VENDOR_EXAR is not set +-# CONFIG_NET_VENDOR_FARADAY is not set +-CONFIG_NET_VENDOR_FREESCALE=y +-CONFIG_FEC=y +-CONFIG_FSL_PQ_MDIO=y +-CONFIG_FSL_XGMAC_MDIO=y +-CONFIG_GIANFAR=y +-# CONFIG_NET_VENDOR_HISILICON is not set +-# CONFIG_NET_VENDOR_HP is not set +-# CONFIG_NET_VENDOR_INTEL is not set +-# CONFIG_JME is not set +-# CONFIG_NET_VENDOR_MARVELL is not set +-# CONFIG_NET_VENDOR_MELLANOX is not set +-# CONFIG_NET_VENDOR_MICREL is not set +-# CONFIG_NET_VENDOR_MICROCHIP is not set +-# CONFIG_NET_VENDOR_MYRI is not set +-# CONFIG_FEALNX is not set +-# CONFIG_NET_VENDOR_NATSEMI is not set +-# CONFIG_NET_VENDOR_NVIDIA is not set +-# CONFIG_NET_VENDOR_OKI is not set +-# CONFIG_ETHOC is not set +-# CONFIG_NET_PACKET_ENGINE is not set +-# CONFIG_NET_VENDOR_QLOGIC is not set +-# CONFIG_NET_VENDOR_QUALCOMM is not set +-# CONFIG_NET_VENDOR_REALTEK is not set +-# CONFIG_NET_VENDOR_RENESAS is not set +-# CONFIG_NET_VENDOR_RDC is not set +-# CONFIG_NET_VENDOR_ROCKER is not set +-# CONFIG_NET_VENDOR_SAMSUNG is not set +-# CONFIG_NET_VENDOR_SEEQ is not set +-# CONFIG_NET_VENDOR_SILAN is not set +-# CONFIG_NET_VENDOR_SIS is not set +-# CONFIG_SFC is not set +-# CONFIG_NET_VENDOR_SMSC is not set +-# CONFIG_NET_VENDOR_STMICRO is not set +-# CONFIG_NET_VENDOR_SUN is not set +-# CONFIG_NET_VENDOR_SYNOPSYS is not set +-# CONFIG_NET_VENDOR_TEHUTI is not set +-# CONFIG_NET_VENDOR_TI is not set +-# CONFIG_NET_VENDOR_VIA is not set +-# CONFIG_NET_VENDOR_WIZNET is not set +-# CONFIG_FDDI is not set +-# CONFIG_HIPPI is not set +-CONFIG_PHYLIB=y +- +-# +-# MII PHY device drivers +-# +-# CONFIG_AQUANTIA_PHY is not set +-CONFIG_AT803X_PHY=y +-# CONFIG_AMD_PHY is not set +-# CONFIG_MARVELL_PHY is not set +-# CONFIG_DAVICOM_PHY is not set +-# CONFIG_QSEMI_PHY is not set +-# CONFIG_LXT_PHY is not set +-# CONFIG_CICADA_PHY is not set +-# CONFIG_VITESSE_PHY is not set +-# CONFIG_TERANETICS_PHY is not set +-# CONFIG_SMSC_PHY is not set +-# CONFIG_BROADCOM_PHY is not set +-# CONFIG_BCM7XXX_PHY is not set +-# CONFIG_BCM87XX_PHY is not set +-# CONFIG_ICPLUS_PHY is not set +-# CONFIG_REALTEK_PHY is not set +-# CONFIG_NATIONAL_PHY is not set +-# CONFIG_STE10XP is not set +-# CONFIG_LSI_ET1011C_PHY is not set +-# CONFIG_MICREL_PHY is not set +-# CONFIG_DP83848_PHY is not set +-# CONFIG_DP83867_PHY is not set +-CONFIG_MICROCHIP_PHY=m +-CONFIG_FIXED_PHY=y +-CONFIG_MDIO_BITBANG=y +-CONFIG_MDIO_GPIO=y +-CONFIG_MDIO_BUS_MUX=y +-CONFIG_MDIO_BUS_MUX_GPIO=y +-CONFIG_MDIO_BUS_MUX_MMIOREG=y +-CONFIG_MDIO_BCM_UNIMAC=y +-# CONFIG_MICREL_KS8995MA is not set +-CONFIG_PPP=m +-CONFIG_PPP_BSDCOMP=m +-CONFIG_PPP_DEFLATE=m +-CONFIG_PPP_FILTER=y +-CONFIG_PPP_MPPE=m +-CONFIG_PPP_MULTILINK=y +-CONFIG_PPPOE=m +-CONFIG_PPTP=m +-CONFIG_PPPOL2TP=m +-CONFIG_PPP_ASYNC=m +-CONFIG_PPP_SYNC_TTY=m +-CONFIG_SLIP=m +-CONFIG_SLHC=m +-CONFIG_SLIP_COMPRESSED=y +-CONFIG_SLIP_SMART=y +-CONFIG_SLIP_MODE_SLIP6=y +-CONFIG_USB_NET_DRIVERS=y +-CONFIG_USB_CATC=m +-CONFIG_USB_KAWETH=m +-CONFIG_USB_PEGASUS=m +-CONFIG_USB_RTL8150=m +-CONFIG_USB_RTL8152=m +-CONFIG_USB_LAN78XX=m +-CONFIG_USB_USBNET=m +-CONFIG_USB_NET_AX8817X=m +-CONFIG_USB_NET_AX88179_178A=m +-CONFIG_USB_NET_CDCETHER=m +-CONFIG_USB_NET_CDC_EEM=m +-CONFIG_USB_NET_CDC_NCM=m +-CONFIG_USB_NET_HUAWEI_CDC_NCM=m +-CONFIG_USB_NET_CDC_MBIM=m +-CONFIG_USB_NET_DM9601=m +-CONFIG_USB_NET_SR9700=m +-CONFIG_USB_NET_SR9800=m +-CONFIG_USB_NET_SMSC75XX=m +-CONFIG_USB_NET_SMSC95XX=m +-CONFIG_USB_NET_GL620A=m +-CONFIG_USB_NET_NET1080=m +-CONFIG_USB_NET_PLUSB=m +-CONFIG_USB_NET_MCS7830=m +-CONFIG_USB_NET_RNDIS_HOST=m +-CONFIG_USB_NET_CDC_SUBSET=m +-CONFIG_USB_ALI_M5632=y +-CONFIG_USB_AN2720=y +-CONFIG_USB_BELKIN=y +-CONFIG_USB_ARMLINUX=y +-CONFIG_USB_EPSON2888=y +-CONFIG_USB_KC2190=y +-CONFIG_USB_NET_ZAURUS=m +-CONFIG_USB_NET_CX82310_ETH=m +-CONFIG_USB_NET_KALMIA=m +-CONFIG_USB_NET_QMI_WWAN=m +-CONFIG_USB_HSO=m +-CONFIG_USB_NET_INT51X1=m +-CONFIG_USB_IPHETH=m +-CONFIG_USB_SIERRA_NET=m +-CONFIG_USB_VL600=m +-CONFIG_USB_NET_CH9200=m +-CONFIG_WLAN=y +-CONFIG_LIBERTAS_THINFIRM=m +-# CONFIG_LIBERTAS_THINFIRM_DEBUG is not set +-CONFIG_LIBERTAS_THINFIRM_USB=m +-CONFIG_ATMEL=m +-CONFIG_PCI_ATMEL=m +-CONFIG_AT76C50X_USB=m +-CONFIG_PRISM54=m +-CONFIG_USB_ZD1201=m +-CONFIG_USB_NET_RNDIS_WLAN=m +-CONFIG_ADM8211=m +-CONFIG_RTL8180=m +-CONFIG_RTL8187=m +-CONFIG_RTL8187_LEDS=y +-CONFIG_MAC80211_HWSIM=m +-CONFIG_MWL8K=m +-CONFIG_ATH_COMMON=m +-CONFIG_ATH_CARDS=m +-# CONFIG_ATH_DEBUG is not set +-CONFIG_ATH5K=m +-# CONFIG_ATH5K_DEBUG is not set +-# CONFIG_ATH5K_TRACER is not set +-CONFIG_ATH5K_PCI=y +-CONFIG_ATH9K_HW=m +-CONFIG_ATH9K_COMMON=m +-CONFIG_ATH9K_BTCOEX_SUPPORT=y +-CONFIG_ATH9K=m +-CONFIG_ATH9K_PCI=y +-CONFIG_ATH9K_AHB=y +-# CONFIG_ATH9K_DEBUGFS is not set +-# CONFIG_ATH9K_DYNACK is not set +-CONFIG_ATH9K_WOW=y +-CONFIG_ATH9K_RFKILL=y +-CONFIG_ATH9K_CHANNEL_CONTEXT=y +-CONFIG_ATH9K_PCOEM=y +-CONFIG_ATH9K_HTC=m +-# CONFIG_ATH9K_HTC_DEBUGFS is not set +-CONFIG_CARL9170=m +-CONFIG_CARL9170_LEDS=y +-CONFIG_CARL9170_WPC=y +-CONFIG_CARL9170_HWRNG=y +-CONFIG_ATH6KL=m +-CONFIG_ATH6KL_SDIO=m +-CONFIG_ATH6KL_USB=m +-# CONFIG_ATH6KL_DEBUG is not set +-# CONFIG_ATH6KL_TRACING is not set +-CONFIG_AR5523=m +-CONFIG_WIL6210=m +-CONFIG_WIL6210_ISR_COR=y +-CONFIG_WIL6210_TRACING=y +-CONFIG_ATH10K=m +-CONFIG_ATH10K_PCI=m +-# CONFIG_ATH10K_DEBUG is not set +-# CONFIG_ATH10K_DEBUGFS is not set +-# CONFIG_ATH10K_TRACING is not set +-CONFIG_WCN36XX=m +-# CONFIG_WCN36XX_DEBUGFS is not set +-CONFIG_B43=m +-CONFIG_B43_BCMA=y +-CONFIG_B43_SSB=y +-CONFIG_B43_BUSES_BCMA_AND_SSB=y +-# CONFIG_B43_BUSES_BCMA is not set +-# CONFIG_B43_BUSES_SSB is not set +-CONFIG_B43_PCI_AUTOSELECT=y +-CONFIG_B43_PCICORE_AUTOSELECT=y +-CONFIG_B43_SDIO=y +-CONFIG_B43_BCMA_PIO=y +-CONFIG_B43_PIO=y +-CONFIG_B43_PHY_G=y +-CONFIG_B43_PHY_N=y +-CONFIG_B43_PHY_LP=y +-CONFIG_B43_PHY_HT=y +-CONFIG_B43_LEDS=y +-CONFIG_B43_HWRNG=y +-# CONFIG_B43_DEBUG is not set +-CONFIG_B43LEGACY=m +-CONFIG_B43LEGACY_PCI_AUTOSELECT=y +-CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y +-CONFIG_B43LEGACY_LEDS=y +-CONFIG_B43LEGACY_HWRNG=y +-# CONFIG_B43LEGACY_DEBUG is not set +-CONFIG_B43LEGACY_DMA=y +-CONFIG_B43LEGACY_PIO=y +-CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y +-# CONFIG_B43LEGACY_DMA_MODE is not set +-# CONFIG_B43LEGACY_PIO_MODE is not set +-CONFIG_BRCMUTIL=m +-CONFIG_BRCMSMAC=m +-CONFIG_BRCMFMAC=m +-CONFIG_BRCMFMAC_PROTO_BCDC=y +-CONFIG_BRCMFMAC_PROTO_MSGBUF=y +-CONFIG_BRCMFMAC_SDIO=y +-CONFIG_BRCMFMAC_USB=y +-CONFIG_BRCMFMAC_PCIE=y +-# CONFIG_BRCM_TRACING is not set +-# CONFIG_BRCMDBG is not set +-CONFIG_HOSTAP=m +-CONFIG_HOSTAP_FIRMWARE=y +-CONFIG_HOSTAP_FIRMWARE_NVRAM=y +-CONFIG_HOSTAP_PLX=m +-CONFIG_HOSTAP_PCI=m +-CONFIG_IPW2100=m +-CONFIG_IPW2100_MONITOR=y +-# CONFIG_IPW2100_DEBUG is not set +-CONFIG_IPW2200=m +-CONFIG_IPW2200_MONITOR=y +-CONFIG_IPW2200_RADIOTAP=y +-CONFIG_IPW2200_PROMISCUOUS=y +-CONFIG_IPW2200_QOS=y +-CONFIG_IPW2200_DEBUG=y +-CONFIG_LIBIPW=m +-# CONFIG_LIBIPW_DEBUG is not set +-CONFIG_IWLWIFI=m +-CONFIG_IWLWIFI_LEDS=y +-CONFIG_IWLDVM=m +-CONFIG_IWLMVM=m +-CONFIG_IWLWIFI_OPMODE_MODULAR=y +-CONFIG_IWLWIFI_BCAST_FILTERING=y +-CONFIG_IWLWIFI_UAPSD=y +- +-# +-# Debugging Options +-# +-# CONFIG_IWLWIFI_DEBUG is not set +-CONFIG_IWLWIFI_DEVICE_TRACING=y +-CONFIG_IWLEGACY=m +-CONFIG_IWL4965=m +-CONFIG_IWL3945=m +- +-# +-# iwl3945 / iwl4965 Debugging Options +-# +-# CONFIG_IWLEGACY_DEBUG is not set +-CONFIG_LIBERTAS=m +-CONFIG_LIBERTAS_USB=m +-CONFIG_LIBERTAS_SDIO=m +-CONFIG_LIBERTAS_SPI=m +-# CONFIG_LIBERTAS_DEBUG is not set +-CONFIG_LIBERTAS_MESH=y +-CONFIG_HERMES=m +-CONFIG_HERMES_PRISM=y +-CONFIG_HERMES_CACHE_FW_ON_INIT=y +-CONFIG_PLX_HERMES=m +-CONFIG_TMD_HERMES=m +-CONFIG_NORTEL_HERMES=m +-CONFIG_PCI_HERMES=m +-CONFIG_ORINOCO_USB=m +-CONFIG_P54_COMMON=m +-CONFIG_P54_USB=m +-CONFIG_P54_PCI=m +-CONFIG_P54_SPI=m +-CONFIG_P54_SPI_DEFAULT_EEPROM=y +-CONFIG_P54_LEDS=y +-CONFIG_RT2X00=m +-CONFIG_RT2400PCI=m +-CONFIG_RT2500PCI=m +-CONFIG_RT61PCI=m +-CONFIG_RT2800PCI=m +-CONFIG_RT2800PCI_RT33XX=y +-CONFIG_RT2800PCI_RT35XX=y +-CONFIG_RT2800PCI_RT53XX=y +-CONFIG_RT2800PCI_RT3290=y +-CONFIG_RT2500USB=m +-CONFIG_RT73USB=m +-CONFIG_RT2800USB=m +-CONFIG_RT2800USB_RT33XX=y +-CONFIG_RT2800USB_RT35XX=y +-CONFIG_RT2800USB_RT3573=y +-CONFIG_RT2800USB_RT53XX=y +-CONFIG_RT2800USB_RT55XX=y +-CONFIG_RT2800USB_UNKNOWN=y +-CONFIG_RT2800_LIB=m +-CONFIG_RT2800_LIB_MMIO=m +-CONFIG_RT2X00_LIB_MMIO=m +-CONFIG_RT2X00_LIB_PCI=m +-CONFIG_RT2X00_LIB_USB=m +-CONFIG_RT2X00_LIB=m +-CONFIG_RT2X00_LIB_FIRMWARE=y +-CONFIG_RT2X00_LIB_CRYPTO=y +-CONFIG_RT2X00_LIB_LEDS=y +-# CONFIG_RT2X00_DEBUG is not set +-CONFIG_WL_MEDIATEK=y +-CONFIG_MT7601U=m +-CONFIG_RTL_CARDS=m +-CONFIG_RTL8192CE=m +-CONFIG_RTL8192SE=m +-CONFIG_RTL8192DE=m +-CONFIG_RTL8723AE=m +-CONFIG_RTL8723BE=m +-CONFIG_RTL8188EE=m +-CONFIG_RTL8192EE=m +-CONFIG_RTL8821AE=m +-CONFIG_RTL8192CU=m +-CONFIG_RTLWIFI=m +-CONFIG_RTLWIFI_PCI=m +-CONFIG_RTLWIFI_USB=m +-CONFIG_RTLWIFI_DEBUG=y +-CONFIG_RTL8192C_COMMON=m +-CONFIG_RTL8723_COMMON=m +-CONFIG_RTLBTCOEXIST=m +-# CONFIG_RTL8XXXU is not set +-CONFIG_WL_TI=y +-CONFIG_WL1251=m +-CONFIG_WL1251_SPI=m +-CONFIG_WL1251_SDIO=m +-CONFIG_WL12XX=m +-CONFIG_WL18XX=m +-CONFIG_WLCORE=m +-CONFIG_WLCORE_SPI=m +-CONFIG_WLCORE_SDIO=m +-CONFIG_WILINK_PLATFORM_DATA=y +-CONFIG_ZD1211RW=m +-# CONFIG_ZD1211RW_DEBUG is not set +-CONFIG_MWIFIEX=m +-CONFIG_MWIFIEX_SDIO=m +-CONFIG_MWIFIEX_PCIE=m +-CONFIG_MWIFIEX_USB=m +-CONFIG_CW1200=m +-CONFIG_CW1200_WLAN_SDIO=m +-CONFIG_CW1200_WLAN_SPI=m +-CONFIG_RSI_91X=m +-CONFIG_RSI_DEBUGFS=y +-CONFIG_RSI_SDIO=m +-CONFIG_RSI_USB=m +- +-# +-# Enable WiMAX (Networking options) to see the WiMAX drivers +-# +-CONFIG_WAN=y +-CONFIG_HDLC=m +-CONFIG_HDLC_RAW=m +-CONFIG_HDLC_RAW_ETH=m +-CONFIG_HDLC_CISCO=m +-CONFIG_HDLC_FR=m +-CONFIG_HDLC_PPP=m +- +-# +-# X.25/LAPB support is disabled +-# +-# CONFIG_PCI200SYN is not set +-CONFIG_WANXL=m +-# CONFIG_WANXL_BUILD_FIRMWARE is not set +-CONFIG_PC300TOO=m +-CONFIG_FARSYNC=m +-CONFIG_DSCC4=m +-# CONFIG_DSCC4_PCISYNC is not set +-# CONFIG_DSCC4_PCI_RST is not set +-# CONFIG_DLCI is not set +-# CONFIG_VMXNET3 is not set +-CONFIG_ISDN=y +-CONFIG_ISDN_I4L=m +-# CONFIG_ISDN_PPP is not set +-# CONFIG_ISDN_AUDIO is not set +- +-# +-# ISDN feature submodules +-# +-# CONFIG_ISDN_DIVERSION is not set +- +-# +-# ISDN4Linux hardware drivers +-# +- +-# +-# Passive cards +-# +-# CONFIG_ISDN_DRV_HISAX is not set +- +-# +-# Active cards +-# +-CONFIG_ISDN_CAPI=m +-CONFIG_CAPI_TRACE=y +-# CONFIG_ISDN_CAPI_CAPI20 is not set +-# CONFIG_ISDN_CAPI_CAPIDRV is not set +- +-# +-# CAPI hardware drivers +-# +-# CONFIG_CAPI_AVM is not set +-# CONFIG_CAPI_EICON is not set +-CONFIG_ISDN_DRV_GIGASET=m +-CONFIG_GIGASET_CAPI=y +-# CONFIG_GIGASET_I4L is not set +-# CONFIG_GIGASET_DUMMYLL is not set +-# CONFIG_GIGASET_BASE is not set +-# CONFIG_GIGASET_M105 is not set +-# CONFIG_GIGASET_M101 is not set +-# CONFIG_GIGASET_DEBUG is not set +-CONFIG_HYSDN=m +-CONFIG_HYSDN_CAPI=y +-CONFIG_MISDN=m +-CONFIG_MISDN_DSP=m +-CONFIG_MISDN_L1OIP=m +- +-# +-# mISDN hardware drivers +-# +-CONFIG_MISDN_HFCPCI=m +-CONFIG_MISDN_HFCMULTI=m +-CONFIG_MISDN_HFCUSB=m +-CONFIG_MISDN_AVMFRITZ=m +-CONFIG_MISDN_SPEEDFAX=m +-CONFIG_MISDN_INFINEON=m +-CONFIG_MISDN_W6692=m +-CONFIG_MISDN_NETJET=m +-CONFIG_MISDN_IPAC=m +-CONFIG_MISDN_ISAR=m +-CONFIG_ISDN_HDLC=m +-# CONFIG_NVM is not set +- +-# +-# Input device support +-# +-CONFIG_INPUT=y +-CONFIG_INPUT_LEDS=m +-CONFIG_INPUT_FF_MEMLESS=m +-CONFIG_INPUT_POLLDEV=y +-CONFIG_INPUT_SPARSEKMAP=m +-CONFIG_INPUT_MATRIXKMAP=y +- +-# +-# Userland interfaces +-# +-CONFIG_INPUT_MOUSEDEV=m +-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set +-CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +-CONFIG_INPUT_JOYDEV=m +-CONFIG_INPUT_EVDEV=y +-CONFIG_INPUT_EVBUG=m +- +-# +-# Input Device Drivers +-# +-CONFIG_INPUT_KEYBOARD=y +-# CONFIG_KEYBOARD_ADP5588 is not set +-# CONFIG_KEYBOARD_ADP5589 is not set +-# CONFIG_KEYBOARD_ATKBD is not set +-# CONFIG_KEYBOARD_QT1070 is not set +-# CONFIG_KEYBOARD_QT2160 is not set +-# CONFIG_KEYBOARD_LKKBD is not set +-CONFIG_KEYBOARD_GPIO=y +-CONFIG_KEYBOARD_GPIO_POLLED=y +-CONFIG_KEYBOARD_TCA6416=m +-CONFIG_KEYBOARD_TCA8418=m +-CONFIG_KEYBOARD_MATRIX=m +-# CONFIG_KEYBOARD_LM8323 is not set +-# CONFIG_KEYBOARD_LM8333 is not set +-# CONFIG_KEYBOARD_MAX7359 is not set +-# CONFIG_KEYBOARD_MCS is not set +-# CONFIG_KEYBOARD_MPR121 is not set +-CONFIG_KEYBOARD_IMX=y +-# CONFIG_KEYBOARD_NEWTON is not set +-# CONFIG_KEYBOARD_OPENCORES is not set +-# CONFIG_KEYBOARD_SAMSUNG is not set +-# CONFIG_KEYBOARD_STOWAWAY is not set +-# CONFIG_KEYBOARD_SUNKBD is not set +-# CONFIG_KEYBOARD_OMAP4 is not set +-CONFIG_KEYBOARD_XTKBD=m +-# CONFIG_KEYBOARD_CAP11XX is not set +-# CONFIG_KEYBOARD_BCM is not set +-CONFIG_INPUT_MOUSE=y +-CONFIG_MOUSE_PS2=m +-CONFIG_MOUSE_PS2_ALPS=y +-CONFIG_MOUSE_PS2_LOGIPS2PP=y +-CONFIG_MOUSE_PS2_SYNAPTICS=y +-CONFIG_MOUSE_PS2_CYPRESS=y +-CONFIG_MOUSE_PS2_TRACKPOINT=y +-CONFIG_MOUSE_PS2_ELANTECH=y +-# CONFIG_MOUSE_PS2_SENTELIC is not set +-# CONFIG_MOUSE_PS2_TOUCHKIT is not set +-CONFIG_MOUSE_PS2_FOCALTECH=y +-CONFIG_MOUSE_SERIAL=m +-CONFIG_MOUSE_APPLETOUCH=m +-CONFIG_MOUSE_BCM5974=m +-CONFIG_MOUSE_CYAPA=m +-CONFIG_MOUSE_ELAN_I2C=m +-CONFIG_MOUSE_ELAN_I2C_I2C=y +-# CONFIG_MOUSE_ELAN_I2C_SMBUS is not set +-CONFIG_MOUSE_VSXXXAA=m +-CONFIG_MOUSE_GPIO=m +-CONFIG_MOUSE_SYNAPTICS_I2C=m +-CONFIG_MOUSE_SYNAPTICS_USB=m +-CONFIG_INPUT_JOYSTICK=y +-CONFIG_JOYSTICK_ANALOG=m +-CONFIG_JOYSTICK_A3D=m +-CONFIG_JOYSTICK_ADI=m +-CONFIG_JOYSTICK_COBRA=m +-CONFIG_JOYSTICK_GF2K=m +-CONFIG_JOYSTICK_GRIP=m +-CONFIG_JOYSTICK_GRIP_MP=m +-CONFIG_JOYSTICK_GUILLEMOT=m +-CONFIG_JOYSTICK_INTERACT=m +-CONFIG_JOYSTICK_SIDEWINDER=m +-CONFIG_JOYSTICK_TMDC=m +-CONFIG_JOYSTICK_IFORCE=m +-CONFIG_JOYSTICK_IFORCE_USB=y +-CONFIG_JOYSTICK_IFORCE_232=y +-CONFIG_JOYSTICK_WARRIOR=m +-CONFIG_JOYSTICK_MAGELLAN=m +-CONFIG_JOYSTICK_SPACEORB=m +-CONFIG_JOYSTICK_SPACEBALL=m +-CONFIG_JOYSTICK_STINGER=m +-CONFIG_JOYSTICK_TWIDJOY=m +-CONFIG_JOYSTICK_ZHENHUA=m +-CONFIG_JOYSTICK_AS5011=m +-CONFIG_JOYSTICK_JOYDUMP=m +-CONFIG_JOYSTICK_XPAD=m +-CONFIG_JOYSTICK_XPAD_FF=y +-CONFIG_JOYSTICK_XPAD_LEDS=y +-# CONFIG_INPUT_TABLET is not set +-CONFIG_INPUT_TOUCHSCREEN=y +-CONFIG_TOUCHSCREEN_PROPERTIES=y +-CONFIG_TOUCHSCREEN_ADS7846=m +-CONFIG_TOUCHSCREEN_AD7877=m +-CONFIG_TOUCHSCREEN_AD7879=m +-CONFIG_TOUCHSCREEN_AD7879_I2C=m +-CONFIG_TOUCHSCREEN_AD7879_SPI=m +-CONFIG_TOUCHSCREEN_AR1021_I2C=m +-CONFIG_TOUCHSCREEN_ATMEL_MXT=m +-CONFIG_TOUCHSCREEN_AUO_PIXCIR=m +-CONFIG_TOUCHSCREEN_BU21013=m +-CONFIG_TOUCHSCREEN_CHIPONE_ICN8318=m +-CONFIG_TOUCHSCREEN_CY8CTMG110=m +-CONFIG_TOUCHSCREEN_CYTTSP_CORE=m +-CONFIG_TOUCHSCREEN_CYTTSP_I2C=m +-CONFIG_TOUCHSCREEN_CYTTSP_SPI=m +-CONFIG_TOUCHSCREEN_CYTTSP4_CORE=m +-CONFIG_TOUCHSCREEN_CYTTSP4_I2C=m +-CONFIG_TOUCHSCREEN_CYTTSP4_SPI=m +-CONFIG_TOUCHSCREEN_DA9052=m +-CONFIG_TOUCHSCREEN_DYNAPRO=m +-CONFIG_TOUCHSCREEN_HAMPSHIRE=m +-CONFIG_TOUCHSCREEN_EETI=m +-CONFIG_TOUCHSCREEN_EGALAX=m +-CONFIG_TOUCHSCREEN_FT6236=m +-CONFIG_TOUCHSCREEN_FUJITSU=m +-CONFIG_TOUCHSCREEN_GOODIX=m +-CONFIG_TOUCHSCREEN_ILI210X=m +-CONFIG_TOUCHSCREEN_GUNZE=m +-CONFIG_TOUCHSCREEN_ELAN=m +-CONFIG_TOUCHSCREEN_ELO=m +-CONFIG_TOUCHSCREEN_WACOM_W8001=m +-CONFIG_TOUCHSCREEN_WACOM_I2C=m +-CONFIG_TOUCHSCREEN_MAX11801=m +-CONFIG_TOUCHSCREEN_MCS5000=m +-CONFIG_TOUCHSCREEN_MMS114=m +-CONFIG_TOUCHSCREEN_MTOUCH=m +-CONFIG_TOUCHSCREEN_IMX6UL_TSC=m +-CONFIG_TOUCHSCREEN_INEXIO=m +-CONFIG_TOUCHSCREEN_MK712=m +-CONFIG_TOUCHSCREEN_PENMOUNT=m +-CONFIG_TOUCHSCREEN_EDT_FT5X06=m +-CONFIG_TOUCHSCREEN_TOUCHRIGHT=m +-CONFIG_TOUCHSCREEN_TOUCHWIN=m +-CONFIG_TOUCHSCREEN_PIXCIR=m +-CONFIG_TOUCHSCREEN_WDT87XX_I2C=m +-CONFIG_TOUCHSCREEN_WM97XX=m +-CONFIG_TOUCHSCREEN_WM9705=y +-CONFIG_TOUCHSCREEN_WM9712=y +-CONFIG_TOUCHSCREEN_WM9713=y +-CONFIG_TOUCHSCREEN_USB_COMPOSITE=m +-CONFIG_TOUCHSCREEN_MC13783=m +-CONFIG_TOUCHSCREEN_USB_EGALAX=y +-CONFIG_TOUCHSCREEN_USB_PANJIT=y +-CONFIG_TOUCHSCREEN_USB_3M=y +-CONFIG_TOUCHSCREEN_USB_ITM=y +-CONFIG_TOUCHSCREEN_USB_ETURBO=y +-CONFIG_TOUCHSCREEN_USB_GUNZE=y +-CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y +-CONFIG_TOUCHSCREEN_USB_IRTOUCH=y +-CONFIG_TOUCHSCREEN_USB_IDEALTEK=y +-CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y +-CONFIG_TOUCHSCREEN_USB_GOTOP=y +-CONFIG_TOUCHSCREEN_USB_JASTEC=y +-CONFIG_TOUCHSCREEN_USB_ELO=y +-CONFIG_TOUCHSCREEN_USB_E2I=y +-CONFIG_TOUCHSCREEN_USB_ZYTRONIC=y +-CONFIG_TOUCHSCREEN_USB_ETT_TC45USB=y +-CONFIG_TOUCHSCREEN_USB_NEXIO=y +-CONFIG_TOUCHSCREEN_USB_EASYTOUCH=y +-CONFIG_TOUCHSCREEN_TOUCHIT213=m +-CONFIG_TOUCHSCREEN_TSC_SERIO=m +-CONFIG_TOUCHSCREEN_TSC200X_CORE=m +-CONFIG_TOUCHSCREEN_TSC2004=m +-CONFIG_TOUCHSCREEN_TSC2005=m +-CONFIG_TOUCHSCREEN_TSC2007=m +-CONFIG_TOUCHSCREEN_ST1232=m +-CONFIG_TOUCHSCREEN_SUR40=m +-CONFIG_TOUCHSCREEN_SX8654=m +-CONFIG_TOUCHSCREEN_TPS6507X=m +-CONFIG_TOUCHSCREEN_ZFORCE=m +-CONFIG_TOUCHSCREEN_ROHM_BU21023=m +-CONFIG_INPUT_MISC=y +-CONFIG_INPUT_AD714X=m +-CONFIG_INPUT_AD714X_I2C=m +-CONFIG_INPUT_AD714X_SPI=m +-CONFIG_INPUT_BMA150=m +-CONFIG_INPUT_E3X0_BUTTON=m +-CONFIG_INPUT_MC13783_PWRBUTTON=m +-CONFIG_INPUT_MMA8450=y +-CONFIG_INPUT_MPU3050=m +-CONFIG_INPUT_GP2A=m +-CONFIG_INPUT_GPIO_BEEPER=m +-CONFIG_INPUT_GPIO_TILT_POLLED=m +-CONFIG_INPUT_ATI_REMOTE2=m +-CONFIG_INPUT_KEYSPAN_REMOTE=m +-CONFIG_INPUT_KXTJ9=m +-CONFIG_INPUT_KXTJ9_POLLED_MODE=y +-CONFIG_INPUT_POWERMATE=m +-CONFIG_INPUT_YEALINK=m +-CONFIG_INPUT_CM109=m +-CONFIG_INPUT_REGULATOR_HAPTIC=m +-CONFIG_INPUT_UINPUT=m +-CONFIG_INPUT_PCF8574=m +-CONFIG_INPUT_PWM_BEEPER=m +-CONFIG_INPUT_GPIO_ROTARY_ENCODER=m +-CONFIG_INPUT_DA9052_ONKEY=m +-CONFIG_INPUT_ADXL34X=m +-CONFIG_INPUT_ADXL34X_I2C=m +-CONFIG_INPUT_ADXL34X_SPI=m +-CONFIG_INPUT_IMS_PCU=m +-CONFIG_INPUT_CMA3000=m +-CONFIG_INPUT_CMA3000_I2C=m +-CONFIG_INPUT_SOC_BUTTON_ARRAY=m +-CONFIG_INPUT_DRV260X_HAPTICS=m +-CONFIG_INPUT_DRV2665_HAPTICS=m +-CONFIG_INPUT_DRV2667_HAPTICS=m +- +-# +-# Hardware I/O ports +-# +-CONFIG_SERIO=m +-CONFIG_SERIO_SERPORT=m +-# CONFIG_SERIO_PCIPS2 is not set +-CONFIG_SERIO_LIBPS2=m +-CONFIG_SERIO_RAW=m +-CONFIG_SERIO_ALTERA_PS2=m +-# CONFIG_SERIO_PS2MULT is not set +-# CONFIG_SERIO_ARC_PS2 is not set +-# CONFIG_SERIO_APBPS2 is not set +-# CONFIG_USERIO is not set +-CONFIG_GAMEPORT=m +-# CONFIG_GAMEPORT_NS558 is not set +-# CONFIG_GAMEPORT_L4 is not set +-# CONFIG_GAMEPORT_EMU10K1 is not set +-# CONFIG_GAMEPORT_FM801 is not set +- +-# +-# Character devices +-# +-CONFIG_TTY=y +-CONFIG_VT=y +-CONFIG_CONSOLE_TRANSLATIONS=y +-CONFIG_VT_CONSOLE=y +-CONFIG_VT_CONSOLE_SLEEP=y +-CONFIG_HW_CONSOLE=y +-CONFIG_VT_HW_CONSOLE_BINDING=y +-CONFIG_UNIX98_PTYS=y +-CONFIG_DEVPTS_MULTIPLE_INSTANCES=y +-CONFIG_LEGACY_PTYS=y +-CONFIG_LEGACY_PTY_COUNT=256 +-# CONFIG_SERIAL_NONSTANDARD is not set +-# CONFIG_NOZOMI is not set +-# CONFIG_N_GSM is not set +-# CONFIG_TRACE_SINK is not set +-CONFIG_DEVMEM=y +-# CONFIG_DEVKMEM is not set +- +-# +-# Serial drivers +-# +-CONFIG_SERIAL_EARLYCON=y +-CONFIG_SERIAL_8250=m +-CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y +-CONFIG_SERIAL_8250_DMA=y +-CONFIG_SERIAL_8250_PCI=m +-CONFIG_SERIAL_8250_NR_UARTS=4 +-CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +-# CONFIG_SERIAL_8250_EXTENDED is not set +-CONFIG_SERIAL_8250_DW=m +-# CONFIG_SERIAL_8250_EM is not set +-# CONFIG_SERIAL_8250_RT288X is not set +-# CONFIG_SERIAL_8250_MID is not set +- +-# +-# Non-8250 serial port support +-# +-CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST=y +-CONFIG_SERIAL_MAX3100=m +-CONFIG_SERIAL_MAX310X=m +-CONFIG_SERIAL_IMX=y +-CONFIG_SERIAL_IMX_CONSOLE=y +-# CONFIG_SERIAL_UARTLITE is not set +-CONFIG_SERIAL_CORE=y +-CONFIG_SERIAL_CORE_CONSOLE=y +-# CONFIG_SERIAL_JSM is not set +-# CONFIG_SERIAL_OF_PLATFORM is not set +-# CONFIG_SERIAL_SCCNXP is not set +-# CONFIG_SERIAL_SC16IS7XX is not set +-CONFIG_SERIAL_BCM63XX=y +-CONFIG_SERIAL_BCM63XX_CONSOLE=y +-# CONFIG_SERIAL_ALTERA_JTAGUART is not set +-# CONFIG_SERIAL_ALTERA_UART is not set +-# CONFIG_SERIAL_IFX6X60 is not set +-# CONFIG_SERIAL_XILINX_PS_UART is not set +-CONFIG_SERIAL_ARC=y +-CONFIG_SERIAL_ARC_CONSOLE=y +-CONFIG_SERIAL_ARC_NR_PORTS=1 +-# CONFIG_SERIAL_RP2 is not set +-CONFIG_SERIAL_FSL_LPUART=y +-CONFIG_SERIAL_FSL_LPUART_CONSOLE=y +-# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set +-# CONFIG_SERIAL_ST_ASC is not set +-# CONFIG_SERIAL_STM32 is not set +-CONFIG_TTY_PRINTK=m +-CONFIG_HVC_DRIVER=y +-CONFIG_HVC_DCC=y +-# CONFIG_IPMI_HANDLER is not set +-CONFIG_HW_RANDOM=y +-CONFIG_HW_RANDOM_TIMERIOMEM=m +-# CONFIG_NVRAM is not set +-# CONFIG_R3964 is not set +-# CONFIG_APPLICOM is not set +-CONFIG_RAW_DRIVER=m +-CONFIG_MAX_RAW_DEVS=256 +-# CONFIG_TCG_TPM is not set +-CONFIG_DEVPORT=y +-# CONFIG_XILLYBUS is not set +- +-# +-# I2C support +-# +-CONFIG_I2C=y +-CONFIG_I2C_BOARDINFO=y +-CONFIG_I2C_COMPAT=y +-CONFIG_I2C_CHARDEV=y +-CONFIG_I2C_MUX=y +- +-# +-# Multiplexer I2C Chip support +-# +-CONFIG_I2C_ARB_GPIO_CHALLENGE=y +-CONFIG_I2C_MUX_GPIO=y +-CONFIG_I2C_MUX_PCA9541=y +-CONFIG_I2C_MUX_PCA954x=y +-CONFIG_I2C_MUX_PINCTRL=y +-# CONFIG_I2C_MUX_REG is not set +-CONFIG_I2C_HELPER_AUTO=y +-CONFIG_I2C_ALGOBIT=y +- +-# +-# I2C Hardware Bus support +-# +- +-# +-# PC SMBus host controller drivers +-# +-# CONFIG_I2C_ALI1535 is not set +-# CONFIG_I2C_ALI1563 is not set +-# CONFIG_I2C_ALI15X3 is not set +-# CONFIG_I2C_AMD756 is not set +-# CONFIG_I2C_AMD8111 is not set +-# CONFIG_I2C_I801 is not set +-# CONFIG_I2C_ISCH is not set +-# CONFIG_I2C_PIIX4 is not set +-# CONFIG_I2C_NFORCE2 is not set +-# CONFIG_I2C_SIS5595 is not set +-# CONFIG_I2C_SIS630 is not set +-# CONFIG_I2C_SIS96X is not set +-# CONFIG_I2C_VIA is not set +-# CONFIG_I2C_VIAPRO is not set +- +-# +-# I2C system bus drivers (mostly embedded / system-on-chip) +-# +-# CONFIG_I2C_CBUS_GPIO is not set +-CONFIG_I2C_DESIGNWARE_CORE=m +-CONFIG_I2C_DESIGNWARE_PLATFORM=m +-# CONFIG_I2C_DESIGNWARE_PCI is not set +-# CONFIG_I2C_EMEV2 is not set +-CONFIG_I2C_GPIO=y +-CONFIG_I2C_IMX=y +-CONFIG_I2C_OCORES=y +-# CONFIG_I2C_PCA_PLATFORM is not set +-# CONFIG_I2C_PXA_PCI is not set +-# CONFIG_I2C_RK3X is not set +-# CONFIG_I2C_SIMTEC is not set +-# CONFIG_I2C_XILINX is not set +- +-# +-# External I2C/SMBus adapter drivers +-# +-# CONFIG_I2C_DIOLAN_U2C is not set +-# CONFIG_I2C_PARPORT_LIGHT is not set +-# CONFIG_I2C_ROBOTFUZZ_OSIF is not set +-# CONFIG_I2C_TAOS_EVM is not set +-# CONFIG_I2C_TINY_USB is not set +- +-# +-# Other I2C/SMBus bus drivers +-# +-# CONFIG_I2C_STUB is not set +-CONFIG_I2C_SLAVE=y +-CONFIG_I2C_SLAVE_EEPROM=m +-# CONFIG_I2C_DEBUG_CORE is not set +-# CONFIG_I2C_DEBUG_ALGO is not set +-# CONFIG_I2C_DEBUG_BUS is not set +-CONFIG_SPI=y +-# CONFIG_SPI_DEBUG is not set +-CONFIG_SPI_MASTER=y +- +-# +-# SPI Master Controller Drivers +-# +-# CONFIG_SPI_ALTERA is not set +-CONFIG_SPI_BITBANG=m +-# CONFIG_SPI_CADENCE is not set +-CONFIG_SPI_GPIO=m +-CONFIG_SPI_IMX=m +-# CONFIG_SPI_FSL_SPI is not set +-# CONFIG_SPI_OC_TINY is not set +-# CONFIG_SPI_PXA2XX is not set +-# CONFIG_SPI_PXA2XX_PCI is not set +-# CONFIG_SPI_ROCKCHIP is not set +-# CONFIG_SPI_SC18IS602 is not set +-# CONFIG_SPI_XCOMM is not set +-# CONFIG_SPI_XILINX is not set +-# CONFIG_SPI_ZYNQMP_GQSPI is not set +-# CONFIG_SPI_DESIGNWARE is not set +- +-# +-# SPI Protocol Masters +-# +-CONFIG_SPI_SPIDEV=y +-# CONFIG_SPI_TLE62X0 is not set +-# CONFIG_SPMI is not set +-# CONFIG_HSI is not set +- +-# +-# PPS support +-# +-CONFIG_PPS=y +-# CONFIG_PPS_DEBUG is not set +-# CONFIG_NTP_PPS is not set +- +-# +-# PPS clients support +-# +-# CONFIG_PPS_CLIENT_KTIMER is not set +-CONFIG_PPS_CLIENT_LDISC=m +-CONFIG_PPS_CLIENT_GPIO=m +- +-# +-# PPS generators support +-# +- +-# +-# PTP clock support +-# +-CONFIG_PTP_1588_CLOCK=y +-CONFIG_PTP_1588_CLOCK_GIANFAR=y +- +-# +-# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. +-# +-CONFIG_PINCTRL=y +- +-# +-# Pin controllers +-# +-CONFIG_PINMUX=y +-CONFIG_PINCONF=y +-CONFIG_GENERIC_PINCONF=y +-# CONFIG_DEBUG_PINCTRL is not set +-# CONFIG_PINCTRL_AMD is not set +-CONFIG_PINCTRL_SINGLE=y +-CONFIG_PINCTRL_IMX=y +-CONFIG_PINCTRL_IMX6Q=y +-CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y +-CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y +-CONFIG_ARCH_REQUIRE_GPIOLIB=y +-CONFIG_GPIOLIB=y +-CONFIG_GPIO_DEVRES=y +-CONFIG_OF_GPIO=y +-CONFIG_GPIOLIB_IRQCHIP=y +-# CONFIG_DEBUG_GPIO is not set +-CONFIG_GPIO_SYSFS=y +-CONFIG_GPIO_GENERIC=y +- +-# +-# Memory mapped GPIO drivers +-# +-CONFIG_GPIO_74XX_MMIO=y +-# CONFIG_GPIO_ALTERA is not set +-# CONFIG_GPIO_DWAPB is not set +-# CONFIG_GPIO_EM is not set +-CONFIG_GPIO_GENERIC_PLATFORM=y +-# CONFIG_GPIO_GRGPIO is not set +-CONFIG_GPIO_MXC=y +-CONFIG_GPIO_SYSCON=y +-# CONFIG_GPIO_VX855 is not set +-# CONFIG_GPIO_XILINX is not set +-# CONFIG_GPIO_ZEVIO is not set +-# CONFIG_GPIO_ZX is not set +- +-# +-# I2C GPIO expanders +-# +-CONFIG_GPIO_ADP5588=m +-CONFIG_GPIO_ADNP=m +-# CONFIG_GPIO_MAX7300 is not set +-# CONFIG_GPIO_MAX732X is not set +-CONFIG_GPIO_PCA953X=y +-CONFIG_GPIO_PCA953X_IRQ=y +-CONFIG_GPIO_PCF857X=m +-CONFIG_GPIO_SX150X=y +- +-# +-# MFD GPIO expanders +-# +-# CONFIG_GPIO_DA9052 is not set +- +-# +-# PCI GPIO expanders +-# +-# CONFIG_GPIO_AMD8111 is not set +-# CONFIG_GPIO_ML_IOH is not set +-# CONFIG_GPIO_RDC321X is not set +- +-# +-# SPI GPIO expanders +-# +-CONFIG_GPIO_74X164=y +-# CONFIG_GPIO_MAX7301 is not set +-CONFIG_GPIO_MC33880=y +- +-# +-# SPI or I2C GPIO expanders +-# +-CONFIG_GPIO_MCP23S08=y +- +-# +-# USB GPIO expanders +-# +-CONFIG_W1=m +-CONFIG_W1_CON=y +- +-# +-# 1-wire Bus Masters +-# +-CONFIG_W1_MASTER_MATROX=m +-CONFIG_W1_MASTER_DS2490=m +-CONFIG_W1_MASTER_DS2482=m +-CONFIG_W1_MASTER_MXC=m +-CONFIG_W1_MASTER_DS1WM=m +-CONFIG_W1_MASTER_GPIO=m +- +-# +-# 1-wire Slaves +-# +-CONFIG_W1_SLAVE_THERM=m +-CONFIG_W1_SLAVE_SMEM=m +-CONFIG_W1_SLAVE_DS2408=m +-CONFIG_W1_SLAVE_DS2408_READBACK=y +-CONFIG_W1_SLAVE_DS2413=m +-CONFIG_W1_SLAVE_DS2406=m +-CONFIG_W1_SLAVE_DS2423=m +-CONFIG_W1_SLAVE_DS2431=m +-CONFIG_W1_SLAVE_DS2433=m +-CONFIG_W1_SLAVE_DS2433_CRC=y +-CONFIG_W1_SLAVE_DS2760=m +-CONFIG_W1_SLAVE_DS2780=m +-CONFIG_W1_SLAVE_DS2781=m +-CONFIG_W1_SLAVE_DS28E04=m +-CONFIG_W1_SLAVE_BQ27000=m +-CONFIG_POWER_SUPPLY=y +-# CONFIG_POWER_SUPPLY_DEBUG is not set +-# CONFIG_PDA_POWER is not set +-# CONFIG_GENERIC_ADC_BATTERY is not set +-CONFIG_TEST_POWER=m +-# CONFIG_BATTERY_DS2760 is not set +-# CONFIG_BATTERY_DS2780 is not set +-# CONFIG_BATTERY_DS2781 is not set +-# CONFIG_BATTERY_DS2782 is not set +-# CONFIG_BATTERY_SBS is not set +-# CONFIG_BATTERY_BQ27XXX is not set +-# CONFIG_BATTERY_DA9052 is not set +-# CONFIG_BATTERY_MAX17040 is not set +-# CONFIG_BATTERY_MAX17042 is not set +-# CONFIG_CHARGER_ISP1704 is not set +-# CONFIG_CHARGER_MAX8903 is not set +-# CONFIG_CHARGER_LP8727 is not set +-CONFIG_CHARGER_GPIO=m +-# CONFIG_CHARGER_MANAGER is not set +-# CONFIG_CHARGER_BQ2415X is not set +-# CONFIG_CHARGER_BQ24190 is not set +-# CONFIG_CHARGER_BQ24257 is not set +-# CONFIG_CHARGER_BQ24735 is not set +-# CONFIG_CHARGER_BQ25890 is not set +-# CONFIG_CHARGER_SMB347 is not set +-# CONFIG_BATTERY_GAUGE_LTC2941 is not set +-# CONFIG_CHARGER_RT9455 is not set +-CONFIG_POWER_RESET=y +-# CONFIG_POWER_RESET_BRCMSTB is not set +-CONFIG_POWER_RESET_GPIO=y +-CONFIG_POWER_RESET_GPIO_RESTART=y +-CONFIG_POWER_RESET_IMX=y +-CONFIG_POWER_RESET_LTC2952=y +-CONFIG_POWER_RESET_RESTART=y +-CONFIG_POWER_RESET_VERSATILE=y +-# CONFIG_POWER_RESET_SNVS is not set +-CONFIG_POWER_RESET_SYSCON=y +-# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set +-CONFIG_POWER_AVS=y +-CONFIG_HWMON=y +-# CONFIG_HWMON_VID is not set +-# CONFIG_HWMON_DEBUG_CHIP is not set +- +-# +-# Native drivers +-# +-# CONFIG_SENSORS_AD7314 is not set +-# CONFIG_SENSORS_AD7414 is not set +-# CONFIG_SENSORS_AD7418 is not set +-# CONFIG_SENSORS_ADM1021 is not set +-# CONFIG_SENSORS_ADM1025 is not set +-# CONFIG_SENSORS_ADM1026 is not set +-# CONFIG_SENSORS_ADM1029 is not set +-# CONFIG_SENSORS_ADM1031 is not set +-# CONFIG_SENSORS_ADM9240 is not set +-# CONFIG_SENSORS_ADT7310 is not set +-# CONFIG_SENSORS_ADT7410 is not set +-# CONFIG_SENSORS_ADT7411 is not set +-# CONFIG_SENSORS_ADT7462 is not set +-# CONFIG_SENSORS_ADT7470 is not set +-# CONFIG_SENSORS_ADT7475 is not set +-# CONFIG_SENSORS_ASC7621 is not set +-# CONFIG_SENSORS_ATXP1 is not set +-# CONFIG_SENSORS_DS620 is not set +-# CONFIG_SENSORS_DS1621 is not set +-# CONFIG_SENSORS_DA9052_ADC is not set +-# CONFIG_SENSORS_I5K_AMB is not set +-# CONFIG_SENSORS_F71805F is not set +-# CONFIG_SENSORS_F71882FG is not set +-# CONFIG_SENSORS_F75375S is not set +-CONFIG_SENSORS_MC13783_ADC=y +-# CONFIG_SENSORS_GL518SM is not set +-# CONFIG_SENSORS_GL520SM is not set +-# CONFIG_SENSORS_G760A is not set +-# CONFIG_SENSORS_G762 is not set +-# CONFIG_SENSORS_GPIO_FAN is not set +-# CONFIG_SENSORS_HIH6130 is not set +-# CONFIG_SENSORS_IIO_HWMON is not set +-# CONFIG_SENSORS_IT87 is not set +-# CONFIG_SENSORS_JC42 is not set +-# CONFIG_SENSORS_POWR1220 is not set +-# CONFIG_SENSORS_LINEAGE is not set +-# CONFIG_SENSORS_LTC2945 is not set +-# CONFIG_SENSORS_LTC4151 is not set +-# CONFIG_SENSORS_LTC4215 is not set +-# CONFIG_SENSORS_LTC4222 is not set +-# CONFIG_SENSORS_LTC4245 is not set +-# CONFIG_SENSORS_LTC4260 is not set +-# CONFIG_SENSORS_LTC4261 is not set +-CONFIG_SENSORS_MAX1111=y +-CONFIG_SENSORS_MAX16065=y +-CONFIG_SENSORS_MAX1619=y +-CONFIG_SENSORS_MAX1668=y +-# CONFIG_SENSORS_MAX197 is not set +-# CONFIG_SENSORS_MAX6639 is not set +-# CONFIG_SENSORS_MAX6642 is not set +-# CONFIG_SENSORS_MAX6650 is not set +-# CONFIG_SENSORS_MAX6697 is not set +-# CONFIG_SENSORS_MAX31790 is not set +-# CONFIG_SENSORS_HTU21 is not set +-# CONFIG_SENSORS_MCP3021 is not set +-# CONFIG_SENSORS_ADCXX is not set +-# CONFIG_SENSORS_LM63 is not set +-# CONFIG_SENSORS_LM70 is not set +-# CONFIG_SENSORS_LM73 is not set +-# CONFIG_SENSORS_LM75 is not set +-# CONFIG_SENSORS_LM77 is not set +-# CONFIG_SENSORS_LM78 is not set +-# CONFIG_SENSORS_LM80 is not set +-# CONFIG_SENSORS_LM83 is not set +-# CONFIG_SENSORS_LM85 is not set +-# CONFIG_SENSORS_LM87 is not set +-# CONFIG_SENSORS_LM90 is not set +-# CONFIG_SENSORS_LM92 is not set +-# CONFIG_SENSORS_LM93 is not set +-# CONFIG_SENSORS_LM95234 is not set +-# CONFIG_SENSORS_LM95241 is not set +-# CONFIG_SENSORS_LM95245 is not set +-# CONFIG_SENSORS_PC87360 is not set +-# CONFIG_SENSORS_PC87427 is not set +-# CONFIG_SENSORS_NTC_THERMISTOR is not set +-# CONFIG_SENSORS_NCT6683 is not set +-# CONFIG_SENSORS_NCT6775 is not set +-# CONFIG_SENSORS_NCT7802 is not set +-# CONFIG_SENSORS_NCT7904 is not set +-# CONFIG_SENSORS_PCF8591 is not set +-# CONFIG_PMBUS is not set +-CONFIG_SENSORS_PWM_FAN=y +-# CONFIG_SENSORS_SHT15 is not set +-# CONFIG_SENSORS_SHT21 is not set +-# CONFIG_SENSORS_SHTC1 is not set +-# CONFIG_SENSORS_SIS5595 is not set +-# CONFIG_SENSORS_DME1737 is not set +-# CONFIG_SENSORS_EMC1403 is not set +-# CONFIG_SENSORS_EMC2103 is not set +-# CONFIG_SENSORS_EMC6W201 is not set +-# CONFIG_SENSORS_SMSC47M1 is not set +-# CONFIG_SENSORS_SMSC47M192 is not set +-# CONFIG_SENSORS_SMSC47B397 is not set +-# CONFIG_SENSORS_SCH56XX_COMMON is not set +-# CONFIG_SENSORS_SCH5627 is not set +-# CONFIG_SENSORS_SCH5636 is not set +-# CONFIG_SENSORS_SMM665 is not set +-# CONFIG_SENSORS_ADC128D818 is not set +-# CONFIG_SENSORS_ADS1015 is not set +-# CONFIG_SENSORS_ADS7828 is not set +-# CONFIG_SENSORS_ADS7871 is not set +-# CONFIG_SENSORS_AMC6821 is not set +-# CONFIG_SENSORS_INA209 is not set +-# CONFIG_SENSORS_INA2XX is not set +-# CONFIG_SENSORS_TC74 is not set +-# CONFIG_SENSORS_THMC50 is not set +-# CONFIG_SENSORS_TMP102 is not set +-# CONFIG_SENSORS_TMP103 is not set +-# CONFIG_SENSORS_TMP401 is not set +-# CONFIG_SENSORS_TMP421 is not set +-# CONFIG_SENSORS_VIA686A is not set +-# CONFIG_SENSORS_VT1211 is not set +-# CONFIG_SENSORS_VT8231 is not set +-# CONFIG_SENSORS_W83781D is not set +-# CONFIG_SENSORS_W83791D is not set +-# CONFIG_SENSORS_W83792D is not set +-# CONFIG_SENSORS_W83793 is not set +-# CONFIG_SENSORS_W83795 is not set +-# CONFIG_SENSORS_W83L785TS is not set +-# CONFIG_SENSORS_W83L786NG is not set +-# CONFIG_SENSORS_W83627HF is not set +-# CONFIG_SENSORS_W83627EHF is not set +-CONFIG_THERMAL=y +-CONFIG_THERMAL_HWMON=y +-CONFIG_THERMAL_OF=y +-# CONFIG_THERMAL_WRITABLE_TRIPS is not set +-CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +-# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set +-# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set +-# CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR is not set +-CONFIG_THERMAL_GOV_FAIR_SHARE=y +-CONFIG_THERMAL_GOV_STEP_WISE=y +-# CONFIG_THERMAL_GOV_BANG_BANG is not set +-CONFIG_THERMAL_GOV_USER_SPACE=y +-# CONFIG_THERMAL_GOV_POWER_ALLOCATOR is not set +-CONFIG_CPU_THERMAL=y +-CONFIG_CLOCK_THERMAL=y +-# CONFIG_DEVFREQ_THERMAL is not set +-# CONFIG_THERMAL_EMULATION is not set +-CONFIG_IMX_THERMAL=y +-CONFIG_WATCHDOG=y +-CONFIG_WATCHDOG_CORE=y +-# CONFIG_WATCHDOG_NOWAYOUT is not set +- +-# +-# Watchdog Device Drivers +-# +-CONFIG_SOFT_WATCHDOG=m +-# CONFIG_DA9052_WATCHDOG is not set +-CONFIG_GPIO_WATCHDOG=m +-# CONFIG_XILINX_WATCHDOG is not set +-# CONFIG_CADENCE_WATCHDOG is not set +-# CONFIG_DW_WATCHDOG is not set +-# CONFIG_MAX63XX_WATCHDOG is not set +-CONFIG_IMX2_WDT=y +-# CONFIG_ALIM7101_WDT is not set +-# CONFIG_I6300ESB_WDT is not set +-# CONFIG_BCM7038_WDT is not set +-# CONFIG_MEN_A21_WDT is not set +- +-# +-# PCI-based Watchdog Cards +-# +-# CONFIG_PCIPCWATCHDOG is not set +-# CONFIG_WDTPCI is not set +- +-# +-# USB-based Watchdog Cards +-# +-# CONFIG_USBPCWATCHDOG is not set +-CONFIG_SSB_POSSIBLE=y +- +-# +-# Sonics Silicon Backplane +-# +-CONFIG_SSB=y +-CONFIG_SSB_SPROM=y +-CONFIG_SSB_BLOCKIO=y +-CONFIG_SSB_PCIHOST_POSSIBLE=y +-CONFIG_SSB_PCIHOST=y +-CONFIG_SSB_B43_PCI_BRIDGE=y +-CONFIG_SSB_SDIOHOST_POSSIBLE=y +-CONFIG_SSB_SDIOHOST=y +-# CONFIG_SSB_HOST_SOC is not set +-# CONFIG_SSB_SILENT is not set +-# CONFIG_SSB_DEBUG is not set +-CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y +-CONFIG_SSB_DRIVER_PCICORE=y +-# CONFIG_SSB_DRIVER_GPIO is not set +-CONFIG_BCMA_POSSIBLE=y +- +-# +-# Broadcom specific AMBA +-# +-CONFIG_BCMA=m +-CONFIG_BCMA_BLOCKIO=y +-CONFIG_BCMA_HOST_PCI_POSSIBLE=y +-# CONFIG_BCMA_HOST_PCI is not set +-# CONFIG_BCMA_HOST_SOC is not set +-# CONFIG_BCMA_DRIVER_PCI is not set +-# CONFIG_BCMA_DRIVER_GMAC_CMN is not set +-# CONFIG_BCMA_DRIVER_GPIO is not set +-# CONFIG_BCMA_DEBUG is not set +- +-# +-# Multifunction device drivers +-# +-CONFIG_MFD_CORE=y +-# CONFIG_MFD_AS3711 is not set +-# CONFIG_MFD_AS3722 is not set +-# CONFIG_PMIC_ADP5520 is not set +-# CONFIG_MFD_AAT2870_CORE is not set +-# CONFIG_MFD_ATMEL_FLEXCOM is not set +-# CONFIG_MFD_ATMEL_HLCDC is not set +-# CONFIG_MFD_BCM590XX is not set +-# CONFIG_MFD_AXP20X is not set +-# CONFIG_MFD_CROS_EC is not set +-# CONFIG_MFD_ASIC3 is not set +-# CONFIG_PMIC_DA903X is not set +-CONFIG_PMIC_DA9052=y +-CONFIG_MFD_DA9052_SPI=y +-CONFIG_MFD_DA9052_I2C=y +-# CONFIG_MFD_DA9055 is not set +-# CONFIG_MFD_DA9062 is not set +-# CONFIG_MFD_DA9063 is not set +-# CONFIG_MFD_DA9150 is not set +-CONFIG_MFD_MXC_HDMI=y +-# CONFIG_MFD_DLN2 is not set +-CONFIG_MFD_MC13XXX=y +-CONFIG_MFD_MC13XXX_SPI=y +-CONFIG_MFD_MC13XXX_I2C=y +-# CONFIG_MFD_HI6421_PMIC is not set +-# CONFIG_HTC_EGPIO is not set +-# CONFIG_HTC_PASIC3 is not set +-# CONFIG_HTC_I2CPLD is not set +-# CONFIG_LPC_ICH is not set +-# CONFIG_LPC_SCH is not set +-# CONFIG_INTEL_SOC_PMIC is not set +-# CONFIG_MFD_JANZ_CMODIO is not set +-# CONFIG_MFD_KEMPLD is not set +-# CONFIG_MFD_88PM800 is not set +-# CONFIG_MFD_88PM805 is not set +-# CONFIG_MFD_88PM860X is not set +-# CONFIG_MFD_MAX14577 is not set +-# CONFIG_MFD_MAX77686 is not set +-# CONFIG_MFD_MAX77693 is not set +-# CONFIG_MFD_MAX77843 is not set +-# CONFIG_MFD_MAX8907 is not set +-# CONFIG_MFD_MAX8925 is not set +-# CONFIG_MFD_MAX8997 is not set +-# CONFIG_MFD_MAX8998 is not set +-# CONFIG_MFD_MT6397 is not set +-# CONFIG_MFD_MENF21BMC is not set +-# CONFIG_EZX_PCAP is not set +-# CONFIG_MFD_VIPERBOARD is not set +-# CONFIG_MFD_RETU is not set +-# CONFIG_MFD_PCF50633 is not set +-# CONFIG_UCB1400_CORE is not set +-# CONFIG_MFD_PM8921_CORE is not set +-# CONFIG_MFD_RDC321X is not set +-# CONFIG_MFD_RTSX_PCI is not set +-# CONFIG_MFD_RT5033 is not set +-# CONFIG_MFD_RTSX_USB is not set +-# CONFIG_MFD_RC5T583 is not set +-# CONFIG_MFD_RK808 is not set +-# CONFIG_MFD_RN5T618 is not set +-# CONFIG_MFD_SEC_CORE is not set +-CONFIG_MFD_SI476X_CORE=y +-# CONFIG_MFD_SM501 is not set +-# CONFIG_MFD_SKY81452 is not set +-# CONFIG_MFD_SMSC is not set +-# CONFIG_ABX500_CORE is not set +-# CONFIG_MFD_STMPE is not set +-CONFIG_MFD_SYSCON=y +-# CONFIG_MFD_TI_AM335X_TSCADC is not set +-# CONFIG_MFD_LP3943 is not set +-# CONFIG_MFD_LP8788 is not set +-# CONFIG_MFD_PALMAS is not set +-# CONFIG_TPS6105X is not set +-# CONFIG_TPS65010 is not set +-# CONFIG_TPS6507X is not set +-# CONFIG_MFD_TPS65090 is not set +-# CONFIG_MFD_TPS65217 is not set +-# CONFIG_MFD_TPS65218 is not set +-# CONFIG_MFD_TPS6586X is not set +-# CONFIG_MFD_TPS65910 is not set +-# CONFIG_MFD_TPS65912 is not set +-# CONFIG_MFD_TPS65912_I2C is not set +-# CONFIG_MFD_TPS65912_SPI is not set +-# CONFIG_MFD_TPS80031 is not set +-# CONFIG_TWL4030_CORE is not set +-# CONFIG_TWL6040_CORE is not set +-CONFIG_MFD_WL1273_CORE=m +-# CONFIG_MFD_LM3533 is not set +-# CONFIG_MFD_TC3589X is not set +-# CONFIG_MFD_TMIO is not set +-# CONFIG_MFD_T7L66XB is not set +-# CONFIG_MFD_TC6387XB is not set +-# CONFIG_MFD_TC6393XB is not set +-# CONFIG_MFD_VX855 is not set +-# CONFIG_MFD_ARIZONA_I2C is not set +-# CONFIG_MFD_ARIZONA_SPI is not set +-# CONFIG_MFD_WM8400 is not set +-# CONFIG_MFD_WM831X_I2C is not set +-# CONFIG_MFD_WM831X_SPI is not set +-# CONFIG_MFD_WM8350_I2C is not set +-# CONFIG_MFD_WM8994 is not set +-# CONFIG_MFD_TDA1997X is not set +-CONFIG_REGULATOR=y +-# CONFIG_REGULATOR_DEBUG is not set +-CONFIG_REGULATOR_FIXED_VOLTAGE=y +-CONFIG_REGULATOR_VIRTUAL_CONSUMER=y +-CONFIG_REGULATOR_USERSPACE_CONSUMER=m +-# CONFIG_REGULATOR_ACT8865 is not set +-# CONFIG_REGULATOR_AD5398 is not set +-CONFIG_REGULATOR_ANATOP=y +-# CONFIG_REGULATOR_DA9052 is not set +-# CONFIG_REGULATOR_DA9210 is not set +-# CONFIG_REGULATOR_DA9211 is not set +-# CONFIG_REGULATOR_FAN53555 is not set +-CONFIG_REGULATOR_GPIO=y +-# CONFIG_REGULATOR_ISL9305 is not set +-# CONFIG_REGULATOR_ISL6271A is not set +-# CONFIG_REGULATOR_LP3971 is not set +-# CONFIG_REGULATOR_LP3972 is not set +-# CONFIG_REGULATOR_LP872X is not set +-# CONFIG_REGULATOR_LP8755 is not set +-# CONFIG_REGULATOR_LTC3589 is not set +-# CONFIG_REGULATOR_LTC3676 is not set +-# CONFIG_REGULATOR_MAX1586 is not set +-# CONFIG_REGULATOR_MAX8649 is not set +-# CONFIG_REGULATOR_MAX8660 is not set +-# CONFIG_REGULATOR_MAX8952 is not set +-# CONFIG_REGULATOR_MAX8973 is not set +-CONFIG_REGULATOR_MC13XXX_CORE=y +-CONFIG_REGULATOR_MC13783=y +-CONFIG_REGULATOR_MC13892=y +-# CONFIG_REGULATOR_MT6311 is not set +-CONFIG_REGULATOR_PFUZE100=y +-CONFIG_REGULATOR_PWM=y +-# CONFIG_REGULATOR_TPS51632 is not set +-# CONFIG_REGULATOR_TPS62360 is not set +-# CONFIG_REGULATOR_TPS65023 is not set +-# CONFIG_REGULATOR_TPS6507X is not set +-# CONFIG_REGULATOR_TPS6524X is not set +-CONFIG_MEDIA_SUPPORT=y +- +-# +-# Multimedia core support +-# +-CONFIG_MEDIA_CAMERA_SUPPORT=y +-CONFIG_MEDIA_ANALOG_TV_SUPPORT=y +-CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y +-CONFIG_MEDIA_RADIO_SUPPORT=y +-CONFIG_MEDIA_SDR_SUPPORT=y +-CONFIG_MEDIA_RC_SUPPORT=y +-CONFIG_MEDIA_CONTROLLER=y +-CONFIG_VIDEO_DEV=y +-CONFIG_VIDEO_V4L2_SUBDEV_API=y +-CONFIG_VIDEO_V4L2=y +-# CONFIG_VIDEO_ADV_DEBUG is not set +-# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set +-CONFIG_VIDEO_TUNER=m +-CONFIG_V4L2_MEM2MEM_DEV=m +-CONFIG_VIDEO_V4L2_INT_DEVICE=m +-CONFIG_VIDEOBUF_GEN=y +-CONFIG_VIDEOBUF_DMA_SG=m +-CONFIG_VIDEOBUF_VMALLOC=m +-CONFIG_VIDEOBUF_DMA_CONTIG=y +-CONFIG_VIDEOBUF_DVB=m +-CONFIG_VIDEOBUF2_CORE=y +-CONFIG_VIDEOBUF2_MEMOPS=m +-CONFIG_VIDEOBUF2_DMA_CONTIG=m +-CONFIG_VIDEOBUF2_VMALLOC=m +-CONFIG_VIDEOBUF2_DMA_SG=m +-CONFIG_VIDEOBUF2_DVB=m +-CONFIG_DVB_CORE=y +-CONFIG_DVB_NET=y +-CONFIG_TTPCI_EEPROM=m +-CONFIG_DVB_MAX_ADAPTERS=8 +-# CONFIG_DVB_DYNAMIC_MINORS is not set +- +-# +-# Media drivers +-# +-CONFIG_RC_CORE=y +-CONFIG_RC_MAP=m +-CONFIG_RC_DECODERS=y +-CONFIG_LIRC=m +-CONFIG_IR_LIRC_CODEC=m +-CONFIG_IR_NEC_DECODER=m +-CONFIG_IR_RC5_DECODER=m +-CONFIG_IR_RC6_DECODER=y +-CONFIG_IR_JVC_DECODER=m +-CONFIG_IR_SONY_DECODER=m +-CONFIG_IR_SANYO_DECODER=m +-CONFIG_IR_SHARP_DECODER=m +-CONFIG_IR_MCE_KBD_DECODER=m +-CONFIG_IR_XMP_DECODER=m +-CONFIG_RC_DEVICES=y +-CONFIG_RC_ATI_REMOTE=m +-CONFIG_IR_HIX5HD2=m +-CONFIG_IR_IMON=m +-CONFIG_IR_MCEUSB=m +-CONFIG_IR_REDRAT3=m +-CONFIG_IR_STREAMZAP=m +-CONFIG_IR_IGORPLUGUSB=m +-CONFIG_IR_IGUANA=m +-CONFIG_IR_TTUSBIR=m +-CONFIG_RC_LOOPBACK=m +-CONFIG_IR_GPIO_CIR=m +-CONFIG_MEDIA_USB_SUPPORT=y +- +-# +-# Webcam devices +-# +-CONFIG_USB_VIDEO_CLASS=m +-CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y +-CONFIG_USB_GSPCA=m +-CONFIG_USB_M5602=m +-CONFIG_USB_STV06XX=m +-CONFIG_USB_GL860=m +-CONFIG_USB_GSPCA_BENQ=m +-CONFIG_USB_GSPCA_CONEX=m +-CONFIG_USB_GSPCA_CPIA1=m +-CONFIG_USB_GSPCA_DTCS033=m +-CONFIG_USB_GSPCA_ETOMS=m +-CONFIG_USB_GSPCA_FINEPIX=m +-CONFIG_USB_GSPCA_JEILINJ=m +-CONFIG_USB_GSPCA_JL2005BCD=m +-CONFIG_USB_GSPCA_KINECT=m +-CONFIG_USB_GSPCA_KONICA=m +-CONFIG_USB_GSPCA_MARS=m +-CONFIG_USB_GSPCA_MR97310A=m +-CONFIG_USB_GSPCA_NW80X=m +-CONFIG_USB_GSPCA_OV519=m +-CONFIG_USB_GSPCA_OV534=m +-CONFIG_USB_GSPCA_OV534_9=m +-CONFIG_USB_GSPCA_PAC207=m +-CONFIG_USB_GSPCA_PAC7302=m +-CONFIG_USB_GSPCA_PAC7311=m +-CONFIG_USB_GSPCA_SE401=m +-CONFIG_USB_GSPCA_SN9C2028=m +-CONFIG_USB_GSPCA_SN9C20X=m +-CONFIG_USB_GSPCA_SONIXB=m +-CONFIG_USB_GSPCA_SONIXJ=m +-CONFIG_USB_GSPCA_SPCA500=m +-CONFIG_USB_GSPCA_SPCA501=m +-CONFIG_USB_GSPCA_SPCA505=m +-CONFIG_USB_GSPCA_SPCA506=m +-CONFIG_USB_GSPCA_SPCA508=m +-CONFIG_USB_GSPCA_SPCA561=m +-CONFIG_USB_GSPCA_SPCA1528=m +-CONFIG_USB_GSPCA_SQ905=m +-CONFIG_USB_GSPCA_SQ905C=m +-CONFIG_USB_GSPCA_SQ930X=m +-CONFIG_USB_GSPCA_STK014=m +-CONFIG_USB_GSPCA_STK1135=m +-CONFIG_USB_GSPCA_STV0680=m +-CONFIG_USB_GSPCA_SUNPLUS=m +-CONFIG_USB_GSPCA_T613=m +-CONFIG_USB_GSPCA_TOPRO=m +-# CONFIG_USB_GSPCA_TOUPTEK is not set +-CONFIG_USB_GSPCA_TV8532=m +-CONFIG_USB_GSPCA_VC032X=m +-CONFIG_USB_GSPCA_VICAM=m +-CONFIG_USB_GSPCA_XIRLINK_CIT=m +-CONFIG_USB_GSPCA_ZC3XX=m +-CONFIG_USB_PWC=m +-# CONFIG_USB_PWC_DEBUG is not set +-CONFIG_USB_PWC_INPUT_EVDEV=y +-CONFIG_VIDEO_CPIA2=m +-CONFIG_USB_ZR364XX=m +-CONFIG_USB_STKWEBCAM=m +-CONFIG_USB_S2255=m +-CONFIG_VIDEO_USBTV=m +- +-# +-# Analog TV USB devices +-# +-CONFIG_VIDEO_PVRUSB2=m +-CONFIG_VIDEO_PVRUSB2_SYSFS=y +-CONFIG_VIDEO_PVRUSB2_DVB=y +-# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set +-CONFIG_VIDEO_HDPVR=m +-CONFIG_VIDEO_USBVISION=m +-CONFIG_VIDEO_STK1160_COMMON=m +-CONFIG_VIDEO_STK1160_AC97=y +-CONFIG_VIDEO_STK1160=m +-CONFIG_VIDEO_GO7007=m +-CONFIG_VIDEO_GO7007_USB=m +-CONFIG_VIDEO_GO7007_LOADER=m +-CONFIG_VIDEO_GO7007_USB_S2250_BOARD=m +- +-# +-# Analog/digital TV USB devices +-# +-CONFIG_VIDEO_AU0828=m +-CONFIG_VIDEO_AU0828_V4L2=y +-CONFIG_VIDEO_AU0828_RC=y +-CONFIG_VIDEO_CX231XX=m +-CONFIG_VIDEO_CX231XX_RC=y +-CONFIG_VIDEO_CX231XX_ALSA=m +-CONFIG_VIDEO_CX231XX_DVB=m +-CONFIG_VIDEO_TM6000=m +-CONFIG_VIDEO_TM6000_ALSA=m +-CONFIG_VIDEO_TM6000_DVB=m +- +-# +-# Digital TV USB devices +-# +-CONFIG_DVB_USB=m +-# CONFIG_DVB_USB_DEBUG is not set +-CONFIG_DVB_USB_A800=m +-CONFIG_DVB_USB_DIBUSB_MB=m +-CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +-CONFIG_DVB_USB_DIBUSB_MC=m +-CONFIG_DVB_USB_DIB0700=m +-CONFIG_DVB_USB_UMT_010=m +-CONFIG_DVB_USB_CXUSB=m +-CONFIG_DVB_USB_M920X=m +-CONFIG_DVB_USB_DIGITV=m +-CONFIG_DVB_USB_VP7045=m +-CONFIG_DVB_USB_VP702X=m +-CONFIG_DVB_USB_GP8PSK=m +-CONFIG_DVB_USB_NOVA_T_USB2=m +-CONFIG_DVB_USB_TTUSB2=m +-CONFIG_DVB_USB_DTT200U=m +-CONFIG_DVB_USB_OPERA1=m +-CONFIG_DVB_USB_AF9005=m +-CONFIG_DVB_USB_AF9005_REMOTE=m +-CONFIG_DVB_USB_PCTV452E=m +-CONFIG_DVB_USB_DW2102=m +-CONFIG_DVB_USB_CINERGY_T2=m +-CONFIG_DVB_USB_DTV5100=m +-CONFIG_DVB_USB_FRIIO=m +-CONFIG_DVB_USB_AZ6027=m +-CONFIG_DVB_USB_TECHNISAT_USB2=m +-CONFIG_DVB_USB_V2=m +-CONFIG_DVB_USB_AF9015=m +-CONFIG_DVB_USB_AF9035=m +-CONFIG_DVB_USB_ANYSEE=m +-CONFIG_DVB_USB_AU6610=m +-CONFIG_DVB_USB_AZ6007=m +-CONFIG_DVB_USB_CE6230=m +-CONFIG_DVB_USB_EC168=m +-CONFIG_DVB_USB_GL861=m +-CONFIG_DVB_USB_LME2510=m +-CONFIG_DVB_USB_MXL111SF=m +-CONFIG_DVB_USB_RTL28XXU=m +-CONFIG_DVB_USB_DVBSKY=m +-CONFIG_DVB_TTUSB_BUDGET=m +-CONFIG_DVB_TTUSB_DEC=m +-CONFIG_SMS_USB_DRV=m +-CONFIG_DVB_B2C2_FLEXCOP_USB=m +-# CONFIG_DVB_B2C2_FLEXCOP_USB_DEBUG is not set +-CONFIG_DVB_AS102=m +- +-# +-# Webcam, TV (analog/digital) USB devices +-# +-CONFIG_VIDEO_EM28XX=m +-CONFIG_VIDEO_EM28XX_V4L2=m +-CONFIG_VIDEO_EM28XX_ALSA=m +-CONFIG_VIDEO_EM28XX_DVB=m +-CONFIG_VIDEO_EM28XX_RC=m +- +-# +-# Software defined radio USB devices +-# +-CONFIG_USB_AIRSPY=m +-CONFIG_USB_HACKRF=m +-CONFIG_USB_MSI2500=m +-CONFIG_MEDIA_PCI_SUPPORT=y +- +-# +-# Media capture support +-# +-CONFIG_VIDEO_SOLO6X10=m +-CONFIG_VIDEO_TW68=m +- +-# +-# Media capture/analog TV support +-# +-CONFIG_VIDEO_IVTV=m +-CONFIG_VIDEO_IVTV_ALSA=m +-CONFIG_VIDEO_FB_IVTV=m +-CONFIG_VIDEO_HEXIUM_GEMINI=m +-CONFIG_VIDEO_HEXIUM_ORION=m +-CONFIG_VIDEO_MXB=m +-CONFIG_VIDEO_DT3155=m +- +-# +-# Media capture/analog/hybrid TV support +-# +-CONFIG_VIDEO_CX18=m +-CONFIG_VIDEO_CX18_ALSA=m +-CONFIG_VIDEO_CX23885=m +-CONFIG_MEDIA_ALTERA_CI=m +-CONFIG_VIDEO_CX25821=m +-CONFIG_VIDEO_CX25821_ALSA=m +-CONFIG_VIDEO_CX88=m +-CONFIG_VIDEO_CX88_ALSA=m +-CONFIG_VIDEO_CX88_BLACKBIRD=m +-CONFIG_VIDEO_CX88_DVB=m +-CONFIG_VIDEO_CX88_ENABLE_VP3054=y +-CONFIG_VIDEO_CX88_VP3054=m +-CONFIG_VIDEO_CX88_MPEG=m +-CONFIG_VIDEO_BT848=m +-CONFIG_DVB_BT8XX=m +-CONFIG_VIDEO_SAA7134=m +-CONFIG_VIDEO_SAA7134_ALSA=m +-CONFIG_VIDEO_SAA7134_RC=y +-CONFIG_VIDEO_SAA7134_DVB=m +-CONFIG_VIDEO_SAA7134_GO7007=m +-CONFIG_VIDEO_SAA7164=m +- +-# +-# Media digital TV PCI Adapters +-# +-CONFIG_DVB_AV7110_IR=y +-CONFIG_DVB_AV7110=m +-CONFIG_DVB_AV7110_OSD=y +-CONFIG_DVB_BUDGET_CORE=m +-CONFIG_DVB_BUDGET=m +-CONFIG_DVB_BUDGET_CI=m +-CONFIG_DVB_BUDGET_AV=m +-CONFIG_DVB_BUDGET_PATCH=m +-CONFIG_DVB_B2C2_FLEXCOP_PCI=m +-# CONFIG_DVB_B2C2_FLEXCOP_PCI_DEBUG is not set +-CONFIG_DVB_PLUTO2=m +-CONFIG_DVB_DM1105=m +-CONFIG_DVB_PT1=m +-CONFIG_DVB_PT3=m +-CONFIG_MANTIS_CORE=m +-CONFIG_DVB_MANTIS=m +-CONFIG_DVB_HOPPER=m +-CONFIG_DVB_NGENE=m +-CONFIG_DVB_DDBRIDGE=m +-CONFIG_DVB_SMIPCIE=m +-# CONFIG_DVB_NETUP_UNIDVB is not set +-CONFIG_V4L_PLATFORM_DRIVERS=y +-# CONFIG_VIDEO_CAFE_CCIC is not set +-CONFIG_VIDEO_MXC_OUTPUT=y +-CONFIG_VIDEO_MXC_CAPTURE=m +- +-# +-# MXC Camera/V4L2 PRP Features support +-# +-CONFIG_VIDEO_MXC_IPU_CAMERA=y +-# CONFIG_VIDEO_MXC_CSI_CAMERA is not set +-# CONFIG_MXC_TVIN_TDA1997X is not set +-CONFIG_MXC_CAMERA_OV5640=m +-CONFIG_MXC_CAMERA_OV5642=m +-CONFIG_MXC_CAMERA_OV5640_MIPI=m +-CONFIG_MXC_CAMERA_OV5647_MIPI=m +-# CONFIG_MXC_HDMI_CSI2_TC358743 is not set +-# CONFIG_MXC_TVIN_ADV7180 is not set +-CONFIG_MXC_IPU_DEVICE_QUEUE_SDC=m +-CONFIG_MXC_IPU_PRP_ENC=m +-CONFIG_MXC_IPU_CSI_ENC=m +-CONFIG_VIDEO_MXC_IPU_OUTPUT=y +-CONFIG_VIDEO_MXC_PXP_V4L2=y +-CONFIG_SOC_CAMERA=y +-CONFIG_SOC_CAMERA_PLATFORM=y +-# CONFIG_VIDEO_XILINX is not set +-CONFIG_V4L_MEM2MEM_DRIVERS=y +-# CONFIG_VIDEO_CODA is not set +-CONFIG_VIDEO_MEM2MEM_DEINTERLACE=m +-CONFIG_VIDEO_SH_VEU=m +-# CONFIG_V4L_TEST_DRIVERS is not set +-# CONFIG_DVB_PLATFORM_DRIVERS is not set +- +-# +-# Supported MMC/SDIO adapters +-# +-CONFIG_SMS_SDIO_DRV=m +-CONFIG_RADIO_ADAPTERS=y +-CONFIG_RADIO_TEA575X=m +-CONFIG_RADIO_SI470X=y +-CONFIG_USB_SI470X=m +-CONFIG_I2C_SI470X=m +-CONFIG_RADIO_SI4713=m +-CONFIG_USB_SI4713=m +-CONFIG_PLATFORM_SI4713=m +-CONFIG_I2C_SI4713=m +-CONFIG_RADIO_SI476X=m +-CONFIG_USB_MR800=m +-CONFIG_USB_DSBR=m +-CONFIG_RADIO_MAXIRADIO=m +-CONFIG_RADIO_SHARK=m +-CONFIG_RADIO_SHARK2=m +-CONFIG_USB_KEENE=m +-CONFIG_USB_RAREMONO=m +-CONFIG_USB_MA901=m +-CONFIG_RADIO_TEA5764=m +-CONFIG_RADIO_SAA7706H=m +-CONFIG_RADIO_TEF6862=m +-CONFIG_RADIO_WL1273=m +- +-# +-# Texas Instruments WL128x FM driver (ST based) +-# +-CONFIG_RADIO_WL128X=m +-CONFIG_MEDIA_COMMON_OPTIONS=y +- +-# +-# common driver options +-# +-CONFIG_VIDEO_CX2341X=m +-CONFIG_VIDEO_TVEEPROM=m +-CONFIG_CYPRESS_FIRMWARE=m +-CONFIG_DVB_B2C2_FLEXCOP=m +-CONFIG_VIDEO_SAA7146=m +-CONFIG_VIDEO_SAA7146_VV=m +-CONFIG_SMS_SIANO_MDTV=m +-CONFIG_SMS_SIANO_RC=y +-# CONFIG_SMS_SIANO_DEBUGFS is not set +- +-# +-# Media ancillary drivers (tuners, sensors, i2c, frontends) +-# +-# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set +-CONFIG_MEDIA_ATTACH=y +-CONFIG_VIDEO_IR_I2C=m +- +-# +-# Encoders, decoders, sensors and other helper chips +-# +- +-# +-# Audio decoders, processors and mixers +-# +-CONFIG_VIDEO_TVAUDIO=m +-CONFIG_VIDEO_TDA7432=m +-CONFIG_VIDEO_TDA9840=m +-CONFIG_VIDEO_TEA6415C=m +-CONFIG_VIDEO_TEA6420=m +-CONFIG_VIDEO_MSP3400=m +-CONFIG_VIDEO_CS5345=m +-CONFIG_VIDEO_CS53L32A=m +-CONFIG_VIDEO_TLV320AIC23B=m +-CONFIG_VIDEO_UDA1342=m +-CONFIG_VIDEO_WM8775=m +-CONFIG_VIDEO_WM8739=m +-CONFIG_VIDEO_VP27SMPX=m +-CONFIG_VIDEO_SONY_BTF_MPX=m +- +-# +-# RDS decoders +-# +-CONFIG_VIDEO_SAA6588=m +- +-# +-# Video decoders +-# +-CONFIG_VIDEO_ADV7180=m +-CONFIG_VIDEO_ADV7183=m +-CONFIG_VIDEO_ADV7604=m +-CONFIG_VIDEO_ADV7842=m +-CONFIG_VIDEO_BT819=m +-CONFIG_VIDEO_BT856=m +-CONFIG_VIDEO_BT866=m +-CONFIG_VIDEO_KS0127=m +-CONFIG_VIDEO_ML86V7667=m +-CONFIG_VIDEO_SAA7110=m +-CONFIG_VIDEO_SAA711X=m +-CONFIG_VIDEO_TC358743=m +-CONFIG_VIDEO_TVP514X=m +-CONFIG_VIDEO_TVP5150=m +-CONFIG_VIDEO_TVP7002=m +-CONFIG_VIDEO_TW2804=m +-CONFIG_VIDEO_TW9903=m +-CONFIG_VIDEO_TW9906=m +-CONFIG_VIDEO_VPX3220=m +- +-# +-# Video and audio decoders +-# +-CONFIG_VIDEO_SAA717X=m +-CONFIG_VIDEO_CX25840=m +- +-# +-# Video encoders +-# +-CONFIG_VIDEO_SAA7127=m +-CONFIG_VIDEO_SAA7185=m +-CONFIG_VIDEO_ADV7170=m +-CONFIG_VIDEO_ADV7175=m +-CONFIG_VIDEO_ADV7343=m +-CONFIG_VIDEO_ADV7393=m +-CONFIG_VIDEO_ADV7511=m +-CONFIG_VIDEO_AD9389B=m +-CONFIG_VIDEO_AK881X=m +-CONFIG_VIDEO_THS8200=m +- +-# +-# Camera sensor devices +-# +-CONFIG_VIDEO_APTINA_PLL=m +-CONFIG_VIDEO_SMIAPP_PLL=m +-CONFIG_VIDEO_OV2659=m +-CONFIG_VIDEO_OV7640=m +-CONFIG_VIDEO_OV7670=m +-CONFIG_VIDEO_OV9650=m +-CONFIG_VIDEO_VS6624=m +-CONFIG_VIDEO_MT9M032=m +-CONFIG_VIDEO_MT9P031=m +-CONFIG_VIDEO_MT9T001=m +-CONFIG_VIDEO_MT9V011=m +-CONFIG_VIDEO_MT9V032=m +-CONFIG_VIDEO_SR030PC30=m +-CONFIG_VIDEO_NOON010PC30=m +-CONFIG_VIDEO_M5MOLS=m +-CONFIG_VIDEO_S5K6AA=m +-CONFIG_VIDEO_S5K6A3=m +-CONFIG_VIDEO_S5K4ECGX=m +-CONFIG_VIDEO_S5K5BAF=m +-CONFIG_VIDEO_SMIAPP=m +-CONFIG_VIDEO_S5C73M3=m +- +-# +-# Flash devices +-# +-CONFIG_VIDEO_ADP1653=m +-CONFIG_VIDEO_AS3645A=m +-CONFIG_VIDEO_LM3560=m +-CONFIG_VIDEO_LM3646=m +- +-# +-# Video improvement chips +-# +-CONFIG_VIDEO_UPD64031A=m +-CONFIG_VIDEO_UPD64083=m +- +-# +-# Audio/Video compression chips +-# +-CONFIG_VIDEO_SAA6752HS=m +- +-# +-# Miscellaneous helper chips +-# +-CONFIG_VIDEO_THS7303=m +-CONFIG_VIDEO_M52790=m +- +-# +-# Sensors used on soc_camera driver +-# +- +-# +-# soc_camera sensor drivers +-# +-CONFIG_SOC_CAMERA_IMX074=m +-CONFIG_SOC_CAMERA_MT9M001=m +-CONFIG_SOC_CAMERA_MT9M111=m +-CONFIG_SOC_CAMERA_MT9T031=m +-CONFIG_SOC_CAMERA_MT9T112=m +-CONFIG_SOC_CAMERA_MT9V022=m +-CONFIG_SOC_CAMERA_OV2640=m +-CONFIG_SOC_CAMERA_OV5642=m +-CONFIG_SOC_CAMERA_OV6650=m +-CONFIG_SOC_CAMERA_OV772X=m +-CONFIG_SOC_CAMERA_OV9640=m +-CONFIG_SOC_CAMERA_OV9740=m +-CONFIG_SOC_CAMERA_RJ54N1=m +-CONFIG_SOC_CAMERA_TW9910=m +-CONFIG_MEDIA_TUNER=y +- +-# +-# Customize TV tuners +-# +-CONFIG_MEDIA_TUNER_SIMPLE=m +-CONFIG_MEDIA_TUNER_TDA8290=m +-CONFIG_MEDIA_TUNER_TDA827X=m +-CONFIG_MEDIA_TUNER_TDA18271=m +-CONFIG_MEDIA_TUNER_TDA9887=m +-CONFIG_MEDIA_TUNER_TEA5761=m +-CONFIG_MEDIA_TUNER_TEA5767=m +-CONFIG_MEDIA_TUNER_MSI001=m +-CONFIG_MEDIA_TUNER_MT20XX=m +-CONFIG_MEDIA_TUNER_MT2060=m +-CONFIG_MEDIA_TUNER_MT2063=m +-CONFIG_MEDIA_TUNER_MT2266=m +-CONFIG_MEDIA_TUNER_MT2131=m +-CONFIG_MEDIA_TUNER_QT1010=m +-CONFIG_MEDIA_TUNER_XC2028=m +-CONFIG_MEDIA_TUNER_XC5000=m +-CONFIG_MEDIA_TUNER_XC4000=m +-CONFIG_MEDIA_TUNER_MXL5005S=m +-CONFIG_MEDIA_TUNER_MXL5007T=m +-CONFIG_MEDIA_TUNER_MC44S803=m +-CONFIG_MEDIA_TUNER_MAX2165=m +-CONFIG_MEDIA_TUNER_TDA18218=m +-CONFIG_MEDIA_TUNER_FC0011=m +-CONFIG_MEDIA_TUNER_FC0012=m +-CONFIG_MEDIA_TUNER_FC0013=m +-CONFIG_MEDIA_TUNER_TDA18212=m +-CONFIG_MEDIA_TUNER_E4000=m +-CONFIG_MEDIA_TUNER_FC2580=m +-CONFIG_MEDIA_TUNER_M88RS6000T=m +-CONFIG_MEDIA_TUNER_TUA9001=m +-CONFIG_MEDIA_TUNER_SI2157=m +-CONFIG_MEDIA_TUNER_IT913X=m +-CONFIG_MEDIA_TUNER_R820T=m +-CONFIG_MEDIA_TUNER_MXL301RF=m +-CONFIG_MEDIA_TUNER_QM1D1C0042=m +- +-# +-# Customise DVB Frontends +-# +- +-# +-# Multistandard (satellite) frontends +-# +-CONFIG_DVB_STB0899=m +-CONFIG_DVB_STB6100=m +-CONFIG_DVB_STV090x=m +-CONFIG_DVB_STV6110x=m +-CONFIG_DVB_M88DS3103=m +- +-# +-# Multistandard (cable + terrestrial) frontends +-# +-CONFIG_DVB_DRXK=m +-CONFIG_DVB_TDA18271C2DD=m +-CONFIG_DVB_SI2165=m +- +-# +-# DVB-S (satellite) frontends +-# +-CONFIG_DVB_CX24110=m +-CONFIG_DVB_CX24123=m +-CONFIG_DVB_MT312=m +-CONFIG_DVB_ZL10036=m +-CONFIG_DVB_ZL10039=m +-CONFIG_DVB_S5H1420=m +-CONFIG_DVB_STV0288=m +-CONFIG_DVB_STB6000=m +-CONFIG_DVB_STV0299=m +-CONFIG_DVB_STV6110=m +-CONFIG_DVB_STV0900=m +-CONFIG_DVB_TDA8083=m +-CONFIG_DVB_TDA10086=m +-CONFIG_DVB_TDA8261=m +-CONFIG_DVB_VES1X93=m +-CONFIG_DVB_TUNER_ITD1000=m +-CONFIG_DVB_TUNER_CX24113=m +-CONFIG_DVB_TDA826X=m +-CONFIG_DVB_TUA6100=m +-CONFIG_DVB_CX24116=m +-CONFIG_DVB_CX24117=m +-CONFIG_DVB_CX24120=m +-CONFIG_DVB_SI21XX=m +-CONFIG_DVB_TS2020=m +-CONFIG_DVB_DS3000=m +-CONFIG_DVB_MB86A16=m +-CONFIG_DVB_TDA10071=m +- +-# +-# DVB-T (terrestrial) frontends +-# +-CONFIG_DVB_SP8870=m +-CONFIG_DVB_SP887X=m +-CONFIG_DVB_CX22700=m +-CONFIG_DVB_CX22702=m +-CONFIG_DVB_S5H1432=m +-CONFIG_DVB_DRXD=m +-CONFIG_DVB_L64781=m +-CONFIG_DVB_TDA1004X=m +-CONFIG_DVB_NXT6000=m +-CONFIG_DVB_MT352=m +-CONFIG_DVB_ZL10353=m +-CONFIG_DVB_DIB3000MB=m +-CONFIG_DVB_DIB3000MC=m +-CONFIG_DVB_DIB7000M=m +-CONFIG_DVB_DIB7000P=m +-CONFIG_DVB_DIB9000=m +-CONFIG_DVB_TDA10048=m +-CONFIG_DVB_AF9013=m +-CONFIG_DVB_EC100=m +-CONFIG_DVB_HD29L2=m +-CONFIG_DVB_STV0367=m +-CONFIG_DVB_CXD2820R=m +-CONFIG_DVB_CXD2841ER=m +-CONFIG_DVB_RTL2830=m +-CONFIG_DVB_RTL2832=m +-CONFIG_DVB_RTL2832_SDR=m +-CONFIG_DVB_SI2168=m +-CONFIG_DVB_AS102_FE=m +- +-# +-# DVB-C (cable) frontends +-# +-CONFIG_DVB_VES1820=m +-CONFIG_DVB_TDA10021=m +-CONFIG_DVB_TDA10023=m +-CONFIG_DVB_STV0297=m +- +-# +-# ATSC (North American/Korean Terrestrial/Cable DTV) frontends +-# +-CONFIG_DVB_NXT200X=m +-CONFIG_DVB_OR51211=m +-CONFIG_DVB_OR51132=m +-CONFIG_DVB_BCM3510=m +-CONFIG_DVB_LGDT330X=m +-CONFIG_DVB_LGDT3305=m +-CONFIG_DVB_LGDT3306A=m +-CONFIG_DVB_LG2160=m +-CONFIG_DVB_S5H1409=m +-CONFIG_DVB_AU8522=m +-CONFIG_DVB_AU8522_DTV=m +-CONFIG_DVB_AU8522_V4L=m +-CONFIG_DVB_S5H1411=m +- +-# +-# ISDB-T (terrestrial) frontends +-# +-CONFIG_DVB_S921=m +-CONFIG_DVB_DIB8000=m +-CONFIG_DVB_MB86A20S=m +- +-# +-# ISDB-S (satellite) & ISDB-T (terrestrial) frontends +-# +-CONFIG_DVB_TC90522=m +- +-# +-# Digital terrestrial only tuners/PLL +-# +-CONFIG_DVB_PLL=m +-CONFIG_DVB_TUNER_DIB0070=m +-CONFIG_DVB_TUNER_DIB0090=m +- +-# +-# SEC control devices for DVB-S +-# +-CONFIG_DVB_DRX39XYJ=m +-CONFIG_DVB_LNBH25=m +-CONFIG_DVB_LNBP21=m +-CONFIG_DVB_LNBP22=m +-CONFIG_DVB_ISL6405=m +-CONFIG_DVB_ISL6421=m +-CONFIG_DVB_ISL6423=m +-CONFIG_DVB_A8293=m +-CONFIG_DVB_SP2=m +-CONFIG_DVB_LGS8GL5=m +-CONFIG_DVB_LGS8GXX=m +-CONFIG_DVB_ATBM8830=m +-CONFIG_DVB_TDA665x=m +-CONFIG_DVB_IX2505V=m +-CONFIG_DVB_M88RS2000=m +-CONFIG_DVB_AF9033=m +-CONFIG_DVB_HORUS3A=m +-CONFIG_DVB_ASCOT2E=m +- +-# +-# Tools to develop new frontends +-# +-CONFIG_DVB_DUMMY_FE=m +- +-# +-# Graphics support +-# +-CONFIG_VGA_ARB=y +-CONFIG_VGA_ARB_MAX_GPUS=16 +-# CONFIG_IMX_IPUV3_CORE is not set +-CONFIG_DRM=y +-# CONFIG_DRM_FBDEV_EMULATION is not set +-# CONFIG_DRM_TDFX is not set +-# CONFIG_DRM_R128 is not set +-# CONFIG_DRM_RADEON is not set +-# CONFIG_DRM_AMDGPU is not set +-# CONFIG_DRM_NOUVEAU is not set +-# CONFIG_DRM_MGA is not set +-# CONFIG_DRM_VIA is not set +-# CONFIG_DRM_SAVAGE is not set +-# CONFIG_DRM_VGEM is not set +-# CONFIG_DRM_EXYNOS is not set +-# CONFIG_DRM_UDL is not set +-# CONFIG_DRM_AST is not set +-# CONFIG_DRM_MGAG200 is not set +-# CONFIG_DRM_CIRRUS_QEMU is not set +-# CONFIG_DRM_ARMADA is not set +-# CONFIG_DRM_TILCDC is not set +-# CONFIG_DRM_QXL is not set +-# CONFIG_DRM_BOCHS is not set +-# CONFIG_DRM_FSL_DCU is not set +-CONFIG_DRM_BRIDGE=y +- +-# +-# Display Interface Bridges +-# +-# CONFIG_DRM_NXP_PTN3460 is not set +-# CONFIG_DRM_PARADE_PS8622 is not set +-# CONFIG_DRM_STI is not set +-CONFIG_DRM_VIVANTE=m +- +-# +-# Frame buffer Devices +-# +-CONFIG_FB=y +-CONFIG_FIRMWARE_EDID=y +-CONFIG_FB_CMDLINE=y +-# CONFIG_FB_DDC is not set +-# CONFIG_FB_BOOT_VESA_SUPPORT is not set +-CONFIG_FB_CFB_FILLRECT=y +-CONFIG_FB_CFB_COPYAREA=y +-CONFIG_FB_CFB_IMAGEBLIT=y +-# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +-CONFIG_FB_SYS_FILLRECT=m +-CONFIG_FB_SYS_COPYAREA=m +-CONFIG_FB_SYS_IMAGEBLIT=m +-# CONFIG_FB_FOREIGN_ENDIAN is not set +-CONFIG_FB_SYS_FOPS=m +-CONFIG_FB_DEFERRED_IO=y +-# CONFIG_FB_SVGALIB is not set +-# CONFIG_FB_MACMODES is not set +-CONFIG_FB_BACKLIGHT=y +-CONFIG_FB_MODE_HELPERS=y +-# CONFIG_FB_TILEBLITTING is not set +- +-# +-# Frame buffer hardware drivers +-# +-# CONFIG_FB_CIRRUS is not set +-# CONFIG_FB_PM2 is not set +-# CONFIG_FB_IMX is not set +-# CONFIG_FB_CYBER2000 is not set +-# CONFIG_FB_ASILIANT is not set +-# CONFIG_FB_IMSTT is not set +-# CONFIG_FB_UVESA is not set +-# CONFIG_FB_OPENCORES is not set +-# CONFIG_FB_S1D13XXX is not set +-# CONFIG_FB_NVIDIA is not set +-# CONFIG_FB_RIVA is not set +-# CONFIG_FB_I740 is not set +-# CONFIG_FB_MATROX is not set +-# CONFIG_FB_RADEON is not set +-# CONFIG_FB_ATY128 is not set +-# CONFIG_FB_ATY is not set +-# CONFIG_FB_S3 is not set +-# CONFIG_FB_SAVAGE is not set +-# CONFIG_FB_SIS is not set +-# CONFIG_FB_NEOMAGIC is not set +-# CONFIG_FB_KYRO is not set +-# CONFIG_FB_3DFX is not set +-# CONFIG_FB_VOODOO1 is not set +-# CONFIG_FB_VT8623 is not set +-# CONFIG_FB_TRIDENT is not set +-# CONFIG_FB_ARK is not set +-# CONFIG_FB_PM3 is not set +-# CONFIG_FB_CARMINE is not set +-# CONFIG_FB_SMSCUFX is not set +-CONFIG_FB_UDL=m +-# CONFIG_FB_IBM_GXT4500 is not set +-# CONFIG_FB_VIRTUAL is not set +-# CONFIG_FB_METRONOME is not set +-# CONFIG_FB_MB862XX is not set +-# CONFIG_FB_BROADSHEET is not set +-# CONFIG_FB_AUO_K190X is not set +-# CONFIG_FB_MXS is not set +-# CONFIG_FB_SIMPLE is not set +-# CONFIG_FB_SSD1307 is not set +-# CONFIG_FB_SM712 is not set +-CONFIG_FB_MXC=y +-CONFIG_FB_MXC_SYNC_PANEL=y +-# CONFIG_FB_MXC_TVOUT_ADV739X is not set +-CONFIG_FB_MXC_LDB=y +-# CONFIG_FB_MXC_MIPI_DSI is not set +-CONFIG_FB_MXC_HDMI=y +-CONFIG_FB_MXC_DCIC=y +-CONFIG_FB_MXC_EDID=y +-# CONFIG_FB_MXC_EINK_PANEL is not set +-CONFIG_BACKLIGHT_LCD_SUPPORT=y +-CONFIG_LCD_CLASS_DEVICE=m +-# CONFIG_LCD_L4F00242T03 is not set +-# CONFIG_LCD_LMS283GF05 is not set +-# CONFIG_LCD_LTV350QV is not set +-# CONFIG_LCD_ILI922X is not set +-# CONFIG_LCD_ILI9320 is not set +-# CONFIG_LCD_TDO24M is not set +-# CONFIG_LCD_VGG2432A4 is not set +-CONFIG_LCD_PLATFORM=m +-# CONFIG_LCD_S6E63M0 is not set +-# CONFIG_LCD_LD9040 is not set +-# CONFIG_LCD_AMS369FG06 is not set +-# CONFIG_LCD_LMS501KF03 is not set +-# CONFIG_LCD_HX8357 is not set +-CONFIG_BACKLIGHT_CLASS_DEVICE=y +-# CONFIG_BACKLIGHT_GENERIC is not set +-CONFIG_BACKLIGHT_PWM=m +-# CONFIG_BACKLIGHT_DA9052 is not set +-# CONFIG_BACKLIGHT_PM8941_WLED is not set +-# CONFIG_BACKLIGHT_ADP8860 is not set +-# CONFIG_BACKLIGHT_ADP8870 is not set +-# CONFIG_BACKLIGHT_LM3630A is not set +-# CONFIG_BACKLIGHT_LM3639 is not set +-# CONFIG_BACKLIGHT_LP855X is not set +-# CONFIG_BACKLIGHT_GPIO is not set +-# CONFIG_BACKLIGHT_LV5207LP is not set +-# CONFIG_BACKLIGHT_BD6107 is not set +-# CONFIG_VGASTATE is not set +-CONFIG_VIDEOMODE_HELPERS=y +-CONFIG_HDMI=y +- +-# +-# Console display driver support +-# +-CONFIG_DUMMY_CONSOLE=y +-CONFIG_FRAMEBUFFER_CONSOLE=y +-CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y +-# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +-# CONFIG_LOGO is not set +-CONFIG_SOUND=y +-# CONFIG_SOUND_OSS_CORE is not set +-CONFIG_SND=y +-CONFIG_SND_TIMER=y +-CONFIG_SND_PCM=y +-CONFIG_SND_DMAENGINE_PCM=y +-CONFIG_SND_HWDEP=m +-CONFIG_SND_RAWMIDI=m +-CONFIG_SND_JACK=y +-# CONFIG_SND_SEQUENCER is not set +-# CONFIG_SND_MIXER_OSS is not set +-# CONFIG_SND_PCM_OSS is not set +-CONFIG_SND_PCM_TIMER=y +-CONFIG_SND_HRTIMER=y +-# CONFIG_SND_DYNAMIC_MINORS is not set +-# CONFIG_SND_SUPPORT_OLD_API is not set +-CONFIG_SND_PROC_FS=y +-# CONFIG_SND_VERBOSE_PROCFS is not set +-# CONFIG_SND_VERBOSE_PRINTK is not set +-# CONFIG_SND_DEBUG is not set +-CONFIG_SND_VMASTER=y +-# CONFIG_SND_RAWMIDI_SEQ is not set +-# CONFIG_SND_OPL3_LIB_SEQ is not set +-# CONFIG_SND_OPL4_LIB_SEQ is not set +-# CONFIG_SND_SBAWE_SEQ is not set +-# CONFIG_SND_EMU10K1_SEQ is not set +-CONFIG_SND_MPU401_UART=m +-CONFIG_SND_AC97_CODEC=m +-CONFIG_SND_DRIVERS=y +-CONFIG_SND_DUMMY=m +-CONFIG_SND_ALOOP=m +-CONFIG_SND_MTPAV=m +-CONFIG_SND_SERIAL_U16550=m +-CONFIG_SND_MPU401=m +-CONFIG_SND_AC97_POWER_SAVE=y +-CONFIG_SND_AC97_POWER_SAVE_DEFAULT=1 +-# CONFIG_SND_PCI is not set +- +-# +-# HD-Audio +-# +-CONFIG_SND_HDA_PREALLOC_SIZE=64 +-CONFIG_SND_ARM=y +-CONFIG_SND_SPI=y +-CONFIG_SND_USB=y +-CONFIG_SND_USB_AUDIO=m +-CONFIG_SND_USB_UA101=m +-CONFIG_SND_USB_CAIAQ=m +-CONFIG_SND_USB_CAIAQ_INPUT=y +-CONFIG_SND_USB_6FIRE=m +-CONFIG_SND_USB_HIFACE=m +-CONFIG_SND_BCD2000=m +-CONFIG_SND_USB_LINE6=m +-CONFIG_SND_USB_POD=m +-CONFIG_SND_USB_PODHD=m +-CONFIG_SND_USB_TONEPORT=m +-CONFIG_SND_USB_VARIAX=m +-CONFIG_SND_SOC=y +-CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y +-# CONFIG_SND_ATMEL_SOC is not set +-# CONFIG_SND_DESIGNWARE_I2S is not set +- +-# +-# SoC Audio for Freescale CPUs +-# +- +-# +-# Common SoC Audio options for Freescale CPUs: +-# +-# CONFIG_SND_SOC_FSL_ASRC is not set +-CONFIG_SND_SOC_FSL_SAI=y +-CONFIG_SND_SOC_FSL_SSI=y +-CONFIG_SND_SOC_FSL_SPDIF=y +-CONFIG_SND_SOC_FSL_ESAI=y +-CONFIG_SND_SOC_FSL_HDMI=y +-CONFIG_SND_SOC_FSL_UTILS=y +-CONFIG_SND_SOC_IMX_PCM_DMA=y +-CONFIG_SND_SOC_IMX_HDMI_DMA=y +-CONFIG_SND_SOC_IMX_AUDMUX=y +-CONFIG_SND_IMX_SOC=y +- +-# +-# SoC Audio support for Freescale i.MX boards: +-# +-# CONFIG_SND_SOC_EUKREA_TLV320 is not set +-# CONFIG_SND_SOC_IMX_WM8731 is not set +-# CONFIG_SND_SOC_IMX_WM8962 is not set +-# CONFIG_SND_SOC_IMX_ES8328 is not set +-CONFIG_SND_SOC_IMX_SGTL5000=y +-# CONFIG_SND_SOC_IMX_AC97_VT1613 is not set +-CONFIG_SND_SOC_IMX_SPDIF=y +-# CONFIG_SND_SOC_IMX_MC13783 is not set +-CONFIG_SND_SOC_IMX_HDMI=y +-CONFIG_SND_SOC_FSL_ASOC_CARD=m +-# CONFIG_SND_SOC_IMX_TDA1997X is not set +- +-# +-# Allwinner SoC Audio support +-# +-# CONFIG_SND_SUN4I_CODEC is not set +-# CONFIG_SND_SOC_XTFPGA_I2S is not set +-CONFIG_SND_SOC_I2C_AND_SPI=y +- +-# +-# CODEC drivers +-# +-# CONFIG_SND_SOC_AC97_CODEC is not set +-# CONFIG_SND_SOC_ADAU1701 is not set +-# CONFIG_SND_SOC_AK4104 is not set +-# CONFIG_SND_SOC_AK4554 is not set +-# CONFIG_SND_SOC_AK4613 is not set +-# CONFIG_SND_SOC_AK4642 is not set +-# CONFIG_SND_SOC_AK5386 is not set +-# CONFIG_SND_SOC_ALC5623 is not set +-# CONFIG_SND_SOC_CS35L32 is not set +-# CONFIG_SND_SOC_CS42L51_I2C is not set +-# CONFIG_SND_SOC_CS42L52 is not set +-# CONFIG_SND_SOC_CS42L56 is not set +-# CONFIG_SND_SOC_CS42L73 is not set +-# CONFIG_SND_SOC_CS4265 is not set +-# CONFIG_SND_SOC_CS4270 is not set +-# CONFIG_SND_SOC_CS4271_I2C is not set +-# CONFIG_SND_SOC_CS4271_SPI is not set +-# CONFIG_SND_SOC_CS42XX8_I2C is not set +-# CONFIG_SND_SOC_CS4349 is not set +-CONFIG_SND_SOC_HDMI_CODEC=y +-# CONFIG_SND_SOC_ES8328 is not set +-# CONFIG_SND_SOC_GTM601 is not set +-# CONFIG_SND_SOC_PCM1681 is not set +-# CONFIG_SND_SOC_PCM1792A is not set +-# CONFIG_SND_SOC_PCM512x_I2C is not set +-# CONFIG_SND_SOC_PCM512x_SPI is not set +-# CONFIG_SND_SOC_RT5631 is not set +-# CONFIG_SND_SOC_RT5677_SPI is not set +-CONFIG_SND_SOC_SGTL5000=y +-CONFIG_SND_SOC_SI476X=m +-# CONFIG_SND_SOC_SIRF_AUDIO_CODEC is not set +-CONFIG_SND_SOC_SPDIF=y +-# CONFIG_SND_SOC_SSM2602_SPI is not set +-# CONFIG_SND_SOC_SSM2602_I2C is not set +-# CONFIG_SND_SOC_SSM4567 is not set +-# CONFIG_SND_SOC_STA32X is not set +-# CONFIG_SND_SOC_STA350 is not set +-# CONFIG_SND_SOC_STI_SAS is not set +-# CONFIG_SND_SOC_TAS2552 is not set +-# CONFIG_SND_SOC_TAS5086 is not set +-# CONFIG_SND_SOC_TAS571X is not set +-# CONFIG_SND_SOC_TFA9879 is not set +-# CONFIG_SND_SOC_TLV320AIC23_I2C is not set +-# CONFIG_SND_SOC_TLV320AIC23_SPI is not set +-# CONFIG_SND_SOC_TLV320AIC31XX is not set +-# CONFIG_SND_SOC_TLV320AIC3X is not set +-# CONFIG_SND_SOC_TS3A227E is not set +-# CONFIG_SND_SOC_WM8510 is not set +-# CONFIG_SND_SOC_WM8523 is not set +-# CONFIG_SND_SOC_WM8580 is not set +-# CONFIG_SND_SOC_WM8711 is not set +-# CONFIG_SND_SOC_WM8728 is not set +-# CONFIG_SND_SOC_WM8731 is not set +-# CONFIG_SND_SOC_WM8737 is not set +-# CONFIG_SND_SOC_WM8741 is not set +-# CONFIG_SND_SOC_WM8750 is not set +-# CONFIG_SND_SOC_WM8753 is not set +-# CONFIG_SND_SOC_WM8770 is not set +-# CONFIG_SND_SOC_WM8776 is not set +-# CONFIG_SND_SOC_WM8804_I2C is not set +-# CONFIG_SND_SOC_WM8804_SPI is not set +-# CONFIG_SND_SOC_WM8903 is not set +-CONFIG_SND_SOC_WM8962=m +-# CONFIG_SND_SOC_WM8978 is not set +-# CONFIG_SND_SOC_TPA6130A2 is not set +-# CONFIG_SND_SIMPLE_CARD is not set +-# CONFIG_SOUND_PRIME is not set +-CONFIG_AC97_BUS=m +- +-# +-# HID support +-# +-CONFIG_HID=y +-CONFIG_HID_BATTERY_STRENGTH=y +-CONFIG_HIDRAW=y +-CONFIG_UHID=m +-CONFIG_HID_GENERIC=y +- +-# +-# Special HID drivers +-# +-CONFIG_HID_A4TECH=m +-CONFIG_HID_ACRUX=m +-CONFIG_HID_ACRUX_FF=y +-CONFIG_HID_APPLE=m +-CONFIG_HID_APPLEIR=m +-CONFIG_HID_AUREAL=m +-CONFIG_HID_BELKIN=m +-CONFIG_HID_BETOP_FF=m +-CONFIG_HID_CHERRY=m +-CONFIG_HID_CHICONY=m +-# CONFIG_HID_CORSAIR is not set +-CONFIG_HID_PRODIKEYS=m +-CONFIG_HID_CP2112=m +-CONFIG_HID_CYPRESS=m +-CONFIG_HID_DRAGONRISE=m +-CONFIG_DRAGONRISE_FF=y +-CONFIG_HID_EMS_FF=m +-CONFIG_HID_ELECOM=m +-CONFIG_HID_ELO=m +-CONFIG_HID_EZKEY=m +-# CONFIG_HID_GEMBIRD is not set +-# CONFIG_HID_GFRM is not set +-CONFIG_HID_HOLTEK=m +-CONFIG_HOLTEK_FF=y +-CONFIG_HID_GT683R=m +-CONFIG_HID_KEYTOUCH=m +-CONFIG_HID_KYE=m +-CONFIG_HID_UCLOGIC=m +-CONFIG_HID_WALTOP=m +-CONFIG_HID_GYRATION=m +-CONFIG_HID_ICADE=m +-CONFIG_HID_TWINHAN=m +-CONFIG_HID_KENSINGTON=m +-CONFIG_HID_LCPOWER=m +-CONFIG_HID_LENOVO=m +-CONFIG_HID_LOGITECH=m +-CONFIG_HID_LOGITECH_DJ=m +-CONFIG_HID_LOGITECH_HIDPP=m +-CONFIG_LOGITECH_FF=y +-CONFIG_LOGIRUMBLEPAD2_FF=y +-CONFIG_LOGIG940_FF=y +-CONFIG_LOGIWHEELS_FF=y +-CONFIG_HID_MAGICMOUSE=m +-CONFIG_HID_MICROSOFT=m +-CONFIG_HID_MONTEREY=m +-CONFIG_HID_MULTITOUCH=m +-CONFIG_HID_NTRIG=m +-CONFIG_HID_ORTEK=m +-CONFIG_HID_PANTHERLORD=m +-CONFIG_PANTHERLORD_FF=y +-CONFIG_HID_PENMOUNT=m +-CONFIG_HID_PETALYNX=m +-CONFIG_HID_PICOLCD=m +-CONFIG_HID_PICOLCD_FB=y +-CONFIG_HID_PICOLCD_BACKLIGHT=y +-CONFIG_HID_PICOLCD_LCD=y +-CONFIG_HID_PICOLCD_LEDS=y +-CONFIG_HID_PICOLCD_CIR=y +-CONFIG_HID_PLANTRONICS=m +-CONFIG_HID_PRIMAX=m +-CONFIG_HID_ROCCAT=m +-CONFIG_HID_SAITEK=m +-CONFIG_HID_SAMSUNG=m +-CONFIG_HID_SONY=m +-CONFIG_SONY_FF=y +-CONFIG_HID_SPEEDLINK=m +-CONFIG_HID_STEELSERIES=m +-CONFIG_HID_SUNPLUS=m +-CONFIG_HID_RMI=m +-CONFIG_HID_GREENASIA=m +-CONFIG_GREENASIA_FF=y +-CONFIG_HID_SMARTJOYPLUS=m +-CONFIG_SMARTJOYPLUS_FF=y +-CONFIG_HID_TIVO=m +-CONFIG_HID_TOPSEED=m +-CONFIG_HID_THINGM=m +-CONFIG_HID_THRUSTMASTER=m +-CONFIG_THRUSTMASTER_FF=y +-CONFIG_HID_WACOM=m +-CONFIG_HID_WIIMOTE=m +-CONFIG_HID_XINMO=m +-CONFIG_HID_ZEROPLUS=m +-CONFIG_ZEROPLUS_FF=y +-CONFIG_HID_ZYDACRON=m +-CONFIG_HID_SENSOR_HUB=m +-CONFIG_HID_SENSOR_CUSTOM_SENSOR=m +- +-# +-# USB HID support +-# +-CONFIG_USB_HID=y +-CONFIG_HID_PID=y +-CONFIG_USB_HIDDEV=y +- +-# +-# I2C HID support +-# +-CONFIG_I2C_HID=m +-CONFIG_USB_OHCI_LITTLE_ENDIAN=y +-CONFIG_USB_SUPPORT=y +-CONFIG_USB_COMMON=y +-CONFIG_USB_ARCH_HAS_HCD=y +-CONFIG_USB=y +-# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set +- +-# +-# Miscellaneous USB options +-# +-CONFIG_USB_DEFAULT_PERSIST=y +-# CONFIG_USB_DYNAMIC_MINORS is not set +-CONFIG_USB_OTG=y +-# CONFIG_USB_OTG_WHITELIST is not set +-# CONFIG_USB_OTG_BLACKLIST_HUB is not set +-CONFIG_USB_OTG_FSM=y +-# CONFIG_USB_ULPI_BUS is not set +-# CONFIG_USB_MON is not set +-# CONFIG_USB_WUSB_CBAF is not set +- +-# +-# USB Host Controller Drivers +-# +-# CONFIG_USB_C67X00_HCD is not set +-# CONFIG_USB_XHCI_HCD is not set +-CONFIG_USB_EHCI_HCD=y +-CONFIG_USB_EHCI_ROOT_HUB_TT=y +-CONFIG_USB_EHCI_TT_NEWSCHED=y +-CONFIG_USB_FSL_MPH_DR_OF=m +-CONFIG_USB_EHCI_PCI=y +-CONFIG_USB_EHCI_MXC=y +-CONFIG_USB_EHCI_HCD_PLATFORM=y +-# CONFIG_USB_OXU210HP_HCD is not set +-# CONFIG_USB_ISP116X_HCD is not set +-# CONFIG_USB_ISP1362_HCD is not set +-# CONFIG_USB_FOTG210_HCD is not set +-# CONFIG_USB_MAX3421_HCD is not set +-# CONFIG_USB_OHCI_HCD is not set +-# CONFIG_USB_UHCI_HCD is not set +-# CONFIG_USB_SL811_HCD is not set +-# CONFIG_USB_R8A66597_HCD is not set +-# CONFIG_USB_IMX21_HCD is not set +-# CONFIG_USB_HCD_BCMA is not set +-# CONFIG_USB_HCD_SSB is not set +-# CONFIG_USB_HCD_TEST_MODE is not set +- +-# +-# USB Device Class drivers +-# +-CONFIG_USB_ACM=m +-CONFIG_USB_PRINTER=m +-CONFIG_USB_WDM=m +-# CONFIG_USB_TMC is not set +- +-# +-# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may +-# +- +-# +-# also be needed; see USB_STORAGE Help for more info +-# +-CONFIG_USB_STORAGE=y +-# CONFIG_USB_STORAGE_DEBUG is not set +-CONFIG_USB_STORAGE_REALTEK=y +-CONFIG_REALTEK_AUTOPM=y +-CONFIG_USB_STORAGE_DATAFAB=y +-CONFIG_USB_STORAGE_FREECOM=y +-CONFIG_USB_STORAGE_ISD200=y +-CONFIG_USB_STORAGE_USBAT=y +-CONFIG_USB_STORAGE_SDDR09=y +-CONFIG_USB_STORAGE_SDDR55=y +-CONFIG_USB_STORAGE_JUMPSHOT=y +-CONFIG_USB_STORAGE_ALAUDA=y +-CONFIG_USB_STORAGE_ONETOUCH=y +-CONFIG_USB_STORAGE_KARMA=m +-CONFIG_USB_STORAGE_CYPRESS_ATACB=y +-CONFIG_USB_STORAGE_ENE_UB6250=y +-CONFIG_USB_UAS=y +- +-# +-# USB Imaging devices +-# +-# CONFIG_USB_MDC800 is not set +-# CONFIG_USB_MICROTEK is not set +-CONFIG_USBIP_CORE=m +-CONFIG_USBIP_VHCI_HCD=m +-CONFIG_USBIP_HOST=m +-# CONFIG_USBIP_DEBUG is not set +-CONFIG_USB_MUSB_HDRC=m +-CONFIG_USB_MUSB_HOST=y +-# CONFIG_USB_MUSB_GADGET is not set +-# CONFIG_USB_MUSB_DUAL_ROLE is not set +- +-# +-# Platform Glue Layer +-# +- +-# +-# MUSB DMA mode +-# +-CONFIG_MUSB_PIO_ONLY=y +-CONFIG_USB_DWC3=m +-# CONFIG_USB_DWC3_HOST is not set +-# CONFIG_USB_DWC3_GADGET is not set +-CONFIG_USB_DWC3_DUAL_ROLE=y +- +-# +-# Platform Glue Driver Support +-# +-CONFIG_USB_DWC3_PCI=m +-CONFIG_USB_DWC2=m +-# CONFIG_USB_DWC2_HOST is not set +- +-# +-# Gadget/Dual-role mode requires USB Gadget support to be enabled +-# +-# CONFIG_USB_DWC2_PERIPHERAL is not set +-CONFIG_USB_DWC2_DUAL_ROLE=y +-CONFIG_USB_DWC2_PCI=m +-# CONFIG_USB_DWC2_DEBUG is not set +-# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set +-CONFIG_USB_CHIPIDEA=y +-CONFIG_USB_CHIPIDEA_OF=y +-CONFIG_USB_CHIPIDEA_PCI=y +-# CONFIG_USB_CHIPIDEA_UDC is not set +-CONFIG_USB_CHIPIDEA_HOST=y +-# CONFIG_USB_CHIPIDEA_DEBUG is not set +-# CONFIG_USB_ISP1760 is not set +- +-# +-# USB port drivers +-# +-CONFIG_USB_SERIAL=y +-CONFIG_USB_SERIAL_CONSOLE=y +-CONFIG_USB_SERIAL_GENERIC=y +-CONFIG_USB_SERIAL_SIMPLE=m +-CONFIG_USB_SERIAL_AIRCABLE=m +-CONFIG_USB_SERIAL_ARK3116=m +-CONFIG_USB_SERIAL_BELKIN=m +-CONFIG_USB_SERIAL_CH341=m +-CONFIG_USB_SERIAL_WHITEHEAT=m +-CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +-CONFIG_USB_SERIAL_CP210X=m +-CONFIG_USB_SERIAL_CYPRESS_M8=m +-CONFIG_USB_SERIAL_EMPEG=m +-CONFIG_USB_SERIAL_FTDI_SIO=m +-CONFIG_USB_SERIAL_VISOR=m +-CONFIG_USB_SERIAL_IPAQ=m +-CONFIG_USB_SERIAL_IR=m +-CONFIG_USB_SERIAL_EDGEPORT=m +-CONFIG_USB_SERIAL_EDGEPORT_TI=m +-CONFIG_USB_SERIAL_F81232=m +-CONFIG_USB_SERIAL_GARMIN=m +-CONFIG_USB_SERIAL_IPW=m +-CONFIG_USB_SERIAL_IUU=m +-CONFIG_USB_SERIAL_KEYSPAN_PDA=m +-CONFIG_USB_SERIAL_KEYSPAN=m +-CONFIG_USB_SERIAL_KEYSPAN_MPR=y +-CONFIG_USB_SERIAL_KEYSPAN_USA28=y +-CONFIG_USB_SERIAL_KEYSPAN_USA28X=y +-CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y +-CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y +-CONFIG_USB_SERIAL_KEYSPAN_USA19=y +-CONFIG_USB_SERIAL_KEYSPAN_USA18X=y +-CONFIG_USB_SERIAL_KEYSPAN_USA19W=y +-CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y +-CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y +-CONFIG_USB_SERIAL_KEYSPAN_USA49W=y +-CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y +-CONFIG_USB_SERIAL_KLSI=m +-CONFIG_USB_SERIAL_KOBIL_SCT=m +-CONFIG_USB_SERIAL_MCT_U232=m +-CONFIG_USB_SERIAL_METRO=m +-CONFIG_USB_SERIAL_MOS7720=m +-CONFIG_USB_SERIAL_MOS7840=m +-CONFIG_USB_SERIAL_MXUPORT=m +-CONFIG_USB_SERIAL_NAVMAN=m +-CONFIG_USB_SERIAL_PL2303=m +-CONFIG_USB_SERIAL_OTI6858=m +-CONFIG_USB_SERIAL_QCAUX=m +-CONFIG_USB_SERIAL_QUALCOMM=m +-CONFIG_USB_SERIAL_SPCP8X5=m +-CONFIG_USB_SERIAL_SAFE=m +-CONFIG_USB_SERIAL_SAFE_PADDED=y +-CONFIG_USB_SERIAL_SIERRAWIRELESS=m +-CONFIG_USB_SERIAL_SYMBOL=m +-CONFIG_USB_SERIAL_TI=m +-CONFIG_USB_SERIAL_CYBERJACK=m +-CONFIG_USB_SERIAL_XIRCOM=m +-CONFIG_USB_SERIAL_WWAN=m +-CONFIG_USB_SERIAL_OPTION=m +-CONFIG_USB_SERIAL_OMNINET=m +-CONFIG_USB_SERIAL_OPTICON=m +-CONFIG_USB_SERIAL_XSENS_MT=m +-CONFIG_USB_SERIAL_WISHBONE=m +-CONFIG_USB_SERIAL_SSU100=m +-CONFIG_USB_SERIAL_QT2=m +-CONFIG_USB_SERIAL_DEBUG=m +- +-# +-# USB Miscellaneous drivers +-# +-CONFIG_USB_EMI62=m +-CONFIG_USB_EMI26=m +-# CONFIG_USB_ADUTUX is not set +-CONFIG_USB_SEVSEG=m +-CONFIG_USB_RIO500=m +-CONFIG_USB_LEGOTOWER=m +-CONFIG_USB_LCD=m +-CONFIG_USB_LED=m +-CONFIG_USB_CYPRESS_CY7C63=m +-CONFIG_USB_CYTHERM=m +-CONFIG_USB_IDMOUSE=m +-# CONFIG_USB_FTDI_ELAN is not set +-CONFIG_USB_APPLEDISPLAY=m +-CONFIG_USB_SISUSBVGA=m +-CONFIG_USB_SISUSBVGA_CON=y +-CONFIG_USB_LD=m +-CONFIG_USB_TRANCEVIBRATOR=m +-CONFIG_USB_IOWARRIOR=m +-# CONFIG_USB_TEST is not set +-# CONFIG_USB_EHSET_TEST_FIXTURE is not set +-CONFIG_USB_ISIGHTFW=m +-# CONFIG_USB_YUREX is not set +-CONFIG_USB_EZUSB_FX2=m +-CONFIG_USB_HSIC_USB3503=m +-# CONFIG_USB_LINK_LAYER_TEST is not set +-# CONFIG_USB_CHAOSKEY is not set +- +-# +-# USB Physical Layer drivers +-# +-CONFIG_USB_PHY=y +-CONFIG_NOP_USB_XCEIV=y +-CONFIG_AM335X_CONTROL_USB=y +-CONFIG_AM335X_PHY_USB=y +-CONFIG_USB_GPIO_VBUS=y +-CONFIG_USB_ISP1301=y +-CONFIG_USB_MXS_PHY=y +-CONFIG_USB_ULPI=y +-CONFIG_USB_ULPI_VIEWPORT=y +-CONFIG_USB_GADGET=y +-# CONFIG_USB_GADGET_DEBUG is not set +-# CONFIG_USB_GADGET_DEBUG_FILES is not set +-# CONFIG_USB_GADGET_DEBUG_FS is not set +-CONFIG_USB_GADGET_VBUS_DRAW=2 +-CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 +- +-# +-# USB Peripheral Controller +-# +-CONFIG_USB_FSL_USB2=m +-# CONFIG_USB_FUSB300 is not set +-# CONFIG_USB_FOTG210_UDC is not set +-# CONFIG_USB_GR_UDC is not set +-# CONFIG_USB_R8A66597 is not set +-# CONFIG_USB_PXA27X is not set +-# CONFIG_USB_MV_UDC is not set +-# CONFIG_USB_MV_U3D is not set +-# CONFIG_USB_M66592 is not set +-# CONFIG_USB_BDC_UDC is not set +-# CONFIG_USB_AMD5536UDC is not set +-# CONFIG_USB_NET2272 is not set +-# CONFIG_USB_NET2280 is not set +-# CONFIG_USB_GOKU is not set +-# CONFIG_USB_EG20T is not set +-# CONFIG_USB_GADGET_XILINX is not set +-# CONFIG_USB_DUMMY_HCD is not set +-CONFIG_USB_LIBCOMPOSITE=m +-CONFIG_USB_F_ACM=m +-CONFIG_USB_F_SS_LB=m +-CONFIG_USB_U_SERIAL=m +-CONFIG_USB_U_ETHER=m +-CONFIG_USB_F_SERIAL=m +-CONFIG_USB_F_OBEX=m +-CONFIG_USB_F_NCM=m +-CONFIG_USB_F_ECM=m +-CONFIG_USB_F_EEM=m +-CONFIG_USB_F_SUBSET=m +-CONFIG_USB_F_RNDIS=m +-CONFIG_USB_F_MASS_STORAGE=m +-CONFIG_USB_F_FS=m +-CONFIG_USB_F_UAC1=m +-CONFIG_USB_F_UAC2=m +-CONFIG_USB_F_UVC=m +-CONFIG_USB_F_MIDI=m +-CONFIG_USB_F_HID=m +-CONFIG_USB_F_PRINTER=m +-CONFIG_USB_CONFIGFS=m +-CONFIG_USB_CONFIGFS_SERIAL=y +-CONFIG_USB_CONFIGFS_ACM=y +-CONFIG_USB_CONFIGFS_OBEX=y +-CONFIG_USB_CONFIGFS_NCM=y +-CONFIG_USB_CONFIGFS_ECM=y +-CONFIG_USB_CONFIGFS_ECM_SUBSET=y +-CONFIG_USB_CONFIGFS_RNDIS=y +-CONFIG_USB_CONFIGFS_EEM=y +-CONFIG_USB_CONFIGFS_MASS_STORAGE=y +-CONFIG_USB_CONFIGFS_F_LB_SS=y +-CONFIG_USB_CONFIGFS_F_FS=y +-CONFIG_USB_CONFIGFS_F_UAC1=y +-CONFIG_USB_CONFIGFS_F_UAC2=y +-CONFIG_USB_CONFIGFS_F_MIDI=y +-CONFIG_USB_CONFIGFS_F_HID=y +-CONFIG_USB_CONFIGFS_F_UVC=y +-CONFIG_USB_CONFIGFS_F_PRINTER=y +-CONFIG_USB_ZERO=m +-# CONFIG_USB_ZERO_HNPTEST is not set +-CONFIG_USB_AUDIO=m +-# CONFIG_GADGET_UAC1 is not set +-CONFIG_USB_ETH=m +-CONFIG_USB_ETH_RNDIS=y +-# CONFIG_USB_ETH_EEM is not set +-CONFIG_USB_G_NCM=m +-CONFIG_USB_GADGETFS=m +-CONFIG_USB_FUNCTIONFS=m +-# CONFIG_USB_FUNCTIONFS_ETH is not set +-# CONFIG_USB_FUNCTIONFS_RNDIS is not set +-CONFIG_USB_FUNCTIONFS_GENERIC=y +-CONFIG_USB_MASS_STORAGE=m +-CONFIG_USB_G_SERIAL=m +-CONFIG_USB_MIDI_GADGET=m +-CONFIG_USB_G_PRINTER=m +-CONFIG_USB_CDC_COMPOSITE=m +-CONFIG_USB_G_ACM_MS=m +-CONFIG_USB_G_MULTI=m +-CONFIG_USB_G_MULTI_RNDIS=y +-# CONFIG_USB_G_MULTI_CDC is not set +-CONFIG_USB_G_HID=m +-# CONFIG_USB_G_DBGP is not set +-CONFIG_USB_G_WEBCAM=m +-CONFIG_USB_LED_TRIG=y +-# CONFIG_UWB is not set +-CONFIG_MMC=y +-# CONFIG_MMC_DEBUG is not set +- +-# +-# MMC/SD/SDIO Card Drivers +-# +-CONFIG_MMC_BLOCK=y +-CONFIG_MMC_BLOCK_MINORS=8 +-CONFIG_MMC_BLOCK_BOUNCE=y +-CONFIG_SDIO_UART=y +-# CONFIG_MMC_TEST is not set +- +-# +-# MMC/SD/SDIO Host Controller Drivers +-# +-CONFIG_MMC_SDHCI=y +-CONFIG_MMC_SDHCI_IO_ACCESSORS=y +-# CONFIG_MMC_SDHCI_PCI is not set +-CONFIG_MMC_SDHCI_PLTFM=y +-CONFIG_MMC_SDHCI_OF_ARASAN=m +-# CONFIG_MMC_SDHCI_OF_AT91 is not set +-# CONFIG_MMC_SDHCI_OF_ESDHC is not set +-CONFIG_MMC_SDHCI_ESDHC_IMX=y +-# CONFIG_MMC_SDHCI_F_SDH30 is not set +-# CONFIG_MMC_MXC is not set +-CONFIG_MMC_TIFM_SD=m +-CONFIG_MMC_CB710=m +-# CONFIG_MMC_VIA_SDMMC is not set +-# CONFIG_MMC_DW is not set +-CONFIG_MMC_VUB300=m +-CONFIG_MMC_USHC=y +-CONFIG_MMC_USDHI6ROL0=m +-CONFIG_MMC_TOSHIBA_PCI=m +-# CONFIG_MMC_MTK is not set +-# CONFIG_MEMSTICK is not set +-CONFIG_NEW_LEDS=y +-CONFIG_LEDS_CLASS=y +-# CONFIG_LEDS_CLASS_FLASH is not set +- +-# +-# LED drivers +-# +-# CONFIG_LEDS_BCM6328 is not set +-# CONFIG_LEDS_BCM6358 is not set +-# CONFIG_LEDS_LM3530 is not set +-# CONFIG_LEDS_LM3642 is not set +-# CONFIG_LEDS_PCA9532 is not set +-CONFIG_LEDS_GPIO=m +-# CONFIG_LEDS_LP3944 is not set +-# CONFIG_LEDS_LP5521 is not set +-# CONFIG_LEDS_LP5523 is not set +-# CONFIG_LEDS_LP5562 is not set +-# CONFIG_LEDS_LP8501 is not set +-# CONFIG_LEDS_LP8860 is not set +-# CONFIG_LEDS_PCA955X is not set +-# CONFIG_LEDS_PCA963X is not set +-# CONFIG_LEDS_DA9052 is not set +-# CONFIG_LEDS_DAC124S085 is not set +-CONFIG_LEDS_PWM=y +-CONFIG_LEDS_REGULATOR=m +-# CONFIG_LEDS_BD2802 is not set +-# CONFIG_LEDS_LT3593 is not set +-# CONFIG_LEDS_MC13783 is not set +-# CONFIG_LEDS_TCA6507 is not set +-# CONFIG_LEDS_TLC591XX is not set +-# CONFIG_LEDS_LM355x is not set +- +-# +-# LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM) +-# +-# CONFIG_LEDS_BLINKM is not set +-# CONFIG_LEDS_SYSCON is not set +- +-# +-# LED Triggers +-# +-CONFIG_LEDS_TRIGGERS=y +-CONFIG_LEDS_TRIGGER_TIMER=m +-CONFIG_LEDS_TRIGGER_ONESHOT=m +-CONFIG_LEDS_TRIGGER_HEARTBEAT=y +-CONFIG_LEDS_TRIGGER_BACKLIGHT=m +-CONFIG_LEDS_TRIGGER_CPU=y +-CONFIG_LEDS_TRIGGER_GPIO=m +-CONFIG_LEDS_TRIGGER_DEFAULT_ON=y +- +-# +-# iptables trigger is under Netfilter config (LED target) +-# +-CONFIG_LEDS_TRIGGER_TRANSIENT=m +-CONFIG_LEDS_TRIGGER_CAMERA=m +-# CONFIG_ACCESSIBILITY is not set +-# CONFIG_INFINIBAND is not set +-CONFIG_EDAC_ATOMIC_SCRUB=y +-CONFIG_EDAC_SUPPORT=y +-# CONFIG_EDAC is not set +-CONFIG_RTC_LIB=y +-CONFIG_RTC_CLASS=y +-CONFIG_RTC_HCTOSYS=y +-CONFIG_RTC_HCTOSYS_DEVICE="rtc0" +-# CONFIG_RTC_SYSTOHC is not set +-# CONFIG_RTC_DEBUG is not set +- +-# +-# RTC interfaces +-# +-CONFIG_RTC_INTF_SYSFS=y +-CONFIG_RTC_INTF_PROC=y +-CONFIG_RTC_INTF_DEV=y +-CONFIG_RTC_INTF_DEV_UIE_EMUL=y +-# CONFIG_RTC_DRV_TEST is not set +- +-# +-# I2C RTC drivers +-# +-# CONFIG_RTC_DRV_ABB5ZES3 is not set +-# CONFIG_RTC_DRV_ABX80X is not set +-# CONFIG_RTC_DRV_DS1307 is not set +-# CONFIG_RTC_DRV_DS1374 is not set +-# CONFIG_RTC_DRV_DS1672 is not set +-# CONFIG_RTC_DRV_DS3232 is not set +-# CONFIG_RTC_DRV_HYM8563 is not set +-# CONFIG_RTC_DRV_MAX6900 is not set +-# CONFIG_RTC_DRV_RS5C372 is not set +-# CONFIG_RTC_DRV_ISL1208 is not set +-# CONFIG_RTC_DRV_ISL12022 is not set +-# CONFIG_RTC_DRV_ISL12057 is not set +-# CONFIG_RTC_DRV_X1205 is not set +-# CONFIG_RTC_DRV_PCF2127 is not set +-CONFIG_RTC_DRV_PCF8523=y +-# CONFIG_RTC_DRV_PCF8563 is not set +-# CONFIG_RTC_DRV_PCF85063 is not set +-# CONFIG_RTC_DRV_PCF8583 is not set +-# CONFIG_RTC_DRV_M41T80 is not set +-# CONFIG_RTC_DRV_BQ32K is not set +-# CONFIG_RTC_DRV_S35390A is not set +-# CONFIG_RTC_DRV_FM3130 is not set +-# CONFIG_RTC_DRV_RX8581 is not set +-# CONFIG_RTC_DRV_RX8025 is not set +-# CONFIG_RTC_DRV_EM3027 is not set +-# CONFIG_RTC_DRV_RV3029C2 is not set +-# CONFIG_RTC_DRV_RV8803 is not set +- +-# +-# SPI RTC drivers +-# +-# CONFIG_RTC_DRV_M41T93 is not set +-# CONFIG_RTC_DRV_M41T94 is not set +-# CONFIG_RTC_DRV_DS1305 is not set +-# CONFIG_RTC_DRV_DS1343 is not set +-# CONFIG_RTC_DRV_DS1347 is not set +-# CONFIG_RTC_DRV_DS1390 is not set +-# CONFIG_RTC_DRV_MAX6902 is not set +-# CONFIG_RTC_DRV_R9701 is not set +-# CONFIG_RTC_DRV_RS5C348 is not set +-# CONFIG_RTC_DRV_DS3234 is not set +-# CONFIG_RTC_DRV_PCF2123 is not set +-# CONFIG_RTC_DRV_RX4581 is not set +-# CONFIG_RTC_DRV_MCP795 is not set +- +-# +-# Platform RTC drivers +-# +-CONFIG_RTC_DRV_CMOS=y +-# CONFIG_RTC_DRV_DS1286 is not set +-# CONFIG_RTC_DRV_DS1511 is not set +-# CONFIG_RTC_DRV_DS1553 is not set +-# CONFIG_RTC_DRV_DS1685_FAMILY is not set +-# CONFIG_RTC_DRV_DS1742 is not set +-# CONFIG_RTC_DRV_DS2404 is not set +-# CONFIG_RTC_DRV_DA9052 is not set +-# CONFIG_RTC_DRV_STK17TA8 is not set +-# CONFIG_RTC_DRV_M48T86 is not set +-# CONFIG_RTC_DRV_M48T35 is not set +-# CONFIG_RTC_DRV_M48T59 is not set +-# CONFIG_RTC_DRV_MSM6242 is not set +-# CONFIG_RTC_DRV_BQ4802 is not set +-# CONFIG_RTC_DRV_RP5C01 is not set +-# CONFIG_RTC_DRV_V3020 is not set +-# CONFIG_RTC_DRV_ZYNQMP is not set +- +-# +-# on-CPU RTC drivers +-# +-CONFIG_RTC_DRV_IMXDI=y +-CONFIG_RTC_DRV_MC13XXX=y +-CONFIG_RTC_DRV_MXC=y +-CONFIG_RTC_DRV_SNVS=y +- +-# +-# HID Sensor RTC drivers +-# +-# CONFIG_RTC_DRV_HID_SENSOR_TIME is not set +-CONFIG_DMADEVICES=y +-# CONFIG_DMADEVICES_DEBUG is not set +- +-# +-# DMA Devices +-# +-CONFIG_DMA_ENGINE=y +-CONFIG_DMA_VIRTUAL_CHANNELS=m +-CONFIG_DMA_OF=y +-CONFIG_FSL_EDMA=m +-# CONFIG_IMX_DMA is not set +-CONFIG_IMX_SDMA=y +-# CONFIG_INTEL_IDMA64 is not set +-CONFIG_MXS_DMA=y +-# CONFIG_MX3_IPU is not set +-CONFIG_MXC_PXP_V2=y +-CONFIG_MXC_PXP_CLIENT_DEVICE=y +-# CONFIG_NBPFAXI_DMA is not set +-CONFIG_DW_DMAC_CORE=m +-CONFIG_DW_DMAC=m +-CONFIG_DW_DMAC_PCI=m +- +-# +-# DMA Clients +-# +-CONFIG_ASYNC_TX_DMA=y +-# CONFIG_DMATEST is not set +-# CONFIG_AUXDISPLAY is not set +-# CONFIG_UIO is not set +-# CONFIG_VIRT_DRIVERS is not set +- +-# +-# Virtio drivers +-# +-# CONFIG_VIRTIO_PCI is not set +-# CONFIG_VIRTIO_MMIO is not set +- +-# +-# Microsoft Hyper-V guest support +-# +-CONFIG_STAGING=y +-CONFIG_PRISM2_USB=m +-CONFIG_COMEDI=m +-# CONFIG_COMEDI_DEBUG is not set +-CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB=2048 +-CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB=20480 +-# CONFIG_COMEDI_MISC_DRIVERS is not set +-# CONFIG_COMEDI_ISA_DRIVERS is not set +-# CONFIG_COMEDI_PCI_DRIVERS is not set +-# CONFIG_COMEDI_USB_DRIVERS is not set +-# CONFIG_COMEDI_8255_SA is not set +-# CONFIG_COMEDI_KCOMEDILIB is not set +-CONFIG_RTL8192U=m +-CONFIG_RTLLIB=m +-CONFIG_RTLLIB_CRYPTO_CCMP=m +-CONFIG_RTLLIB_CRYPTO_TKIP=m +-CONFIG_RTLLIB_CRYPTO_WEP=m +-CONFIG_RTL8192E=m +-CONFIG_R8712U=m +-CONFIG_R8188EU=m +-CONFIG_88EU_AP_MODE=y +-CONFIG_R8723AU=m +-CONFIG_8723AU_AP_MODE=y +-CONFIG_8723AU_BT_COEXIST=y +-CONFIG_RTS5208=m +-# CONFIG_VT6655 is not set +-# CONFIG_VT6656 is not set +- +-# +-# IIO staging drivers +-# +- +-# +-# Accelerometers +-# +-# CONFIG_ADIS16201 is not set +-# CONFIG_ADIS16203 is not set +-# CONFIG_ADIS16204 is not set +-# CONFIG_ADIS16209 is not set +-# CONFIG_ADIS16220 is not set +-# CONFIG_ADIS16240 is not set +-# CONFIG_LIS3L02DQ is not set +-# CONFIG_SCA3000 is not set +- +-# +-# Analog to digital converters +-# +-# CONFIG_AD7606 is not set +-# CONFIG_AD7780 is not set +-# CONFIG_AD7816 is not set +-# CONFIG_AD7192 is not set +-# CONFIG_AD7280 is not set +- +-# +-# Analog digital bi-direction converters +-# +-# CONFIG_ADT7316 is not set +- +-# +-# Capacitance to digital converters +-# +-# CONFIG_AD7150 is not set +-# CONFIG_AD7152 is not set +-# CONFIG_AD7746 is not set +- +-# +-# Direct Digital Synthesis +-# +-# CONFIG_AD9832 is not set +-# CONFIG_AD9834 is not set +- +-# +-# Digital gyroscope sensors +-# +-# CONFIG_ADIS16060 is not set +- +-# +-# Network Analyzer, Impedance Converters +-# +-# CONFIG_AD5933 is not set +- +-# +-# Light sensors +-# +-# CONFIG_SENSORS_ISL29018 is not set +-# CONFIG_SENSORS_ISL29028 is not set +-# CONFIG_TSL2583 is not set +-# CONFIG_TSL2x7x is not set +- +-# +-# Magnetometer sensors +-# +-# CONFIG_SENSORS_HMC5843_I2C is not set +-# CONFIG_SENSORS_HMC5843_SPI is not set +- +-# +-# Active energy metering IC +-# +-# CONFIG_ADE7753 is not set +-# CONFIG_ADE7754 is not set +-# CONFIG_ADE7758 is not set +-# CONFIG_ADE7759 is not set +-# CONFIG_ADE7854 is not set +- +-# +-# Resolver to digital converters +-# +-# CONFIG_AD2S90 is not set +-# CONFIG_AD2S1200 is not set +-# CONFIG_AD2S1210 is not set +- +-# +-# Triggers - standalone +-# +-CONFIG_IIO_PERIODIC_RTC_TRIGGER=m +-# CONFIG_IIO_SIMPLE_DUMMY is not set +-# CONFIG_FB_SM750 is not set +-# CONFIG_FB_XGI is not set +- +-# +-# Speakup console speech +-# +-CONFIG_SPEAKUP=m +-CONFIG_SPEAKUP_SYNTH_ACNTSA=m +-CONFIG_SPEAKUP_SYNTH_APOLLO=m +-CONFIG_SPEAKUP_SYNTH_AUDPTR=m +-CONFIG_SPEAKUP_SYNTH_BNS=m +-CONFIG_SPEAKUP_SYNTH_DECTLK=m +-CONFIG_SPEAKUP_SYNTH_DECEXT=m +-CONFIG_SPEAKUP_SYNTH_LTLK=m +-CONFIG_SPEAKUP_SYNTH_SOFT=m +-CONFIG_SPEAKUP_SYNTH_SPKOUT=m +-CONFIG_SPEAKUP_SYNTH_TXPRT=m +-CONFIG_SPEAKUP_SYNTH_DUMMY=m +-CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=m +-CONFIG_STAGING_MEDIA=y +-CONFIG_I2C_BCM2048=m +-CONFIG_DVB_CXD2099=m +-CONFIG_DVB_MN88472=m +-CONFIG_DVB_MN88473=m +-CONFIG_LIRC_STAGING=y +-CONFIG_LIRC_BT829=m +-CONFIG_LIRC_IMON=m +-CONFIG_LIRC_SASEM=m +-CONFIG_LIRC_SERIAL=m +-CONFIG_LIRC_SERIAL_TRANSMITTER=y +-CONFIG_LIRC_SIR=m +-CONFIG_LIRC_ZILOG=m +- +-# +-# Android +-# +-# CONFIG_STAGING_BOARD is not set +-CONFIG_WIMAX_GDM72XX=m +-CONFIG_WIMAX_GDM72XX_QOS=y +-CONFIG_WIMAX_GDM72XX_K_MODE=y +-CONFIG_WIMAX_GDM72XX_WIMAX2=y +-CONFIG_WIMAX_GDM72XX_USB=y +-# CONFIG_WIMAX_GDM72XX_SDIO is not set +-CONFIG_WIMAX_GDM72XX_USB_PM=y +-CONFIG_LTE_GDM724X=m +-CONFIG_MTD_SPINAND_MT29F=m +-# CONFIG_MTD_SPINAND_ONDIEECC is not set +-# CONFIG_LUSTRE_FS is not set +-CONFIG_DGNC=m +-CONFIG_DGAP=m +-# CONFIG_GS_FPGABOOT is not set +-# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set +-CONFIG_FB_TFT=m +-CONFIG_FB_TFT_AGM1264K_FL=m +-CONFIG_FB_TFT_BD663474=m +-CONFIG_FB_TFT_HX8340BN=m +-CONFIG_FB_TFT_HX8347D=m +-CONFIG_FB_TFT_HX8353D=m +-CONFIG_FB_TFT_HX8357D=m +-CONFIG_FB_TFT_ILI9163=m +-CONFIG_FB_TFT_ILI9320=m +-CONFIG_FB_TFT_ILI9325=m +-CONFIG_FB_TFT_ILI9340=m +-CONFIG_FB_TFT_ILI9341=m +-CONFIG_FB_TFT_ILI9481=m +-CONFIG_FB_TFT_ILI9486=m +-CONFIG_FB_TFT_PCD8544=m +-CONFIG_FB_TFT_RA8875=m +-CONFIG_FB_TFT_S6D02A1=m +-CONFIG_FB_TFT_S6D1121=m +-CONFIG_FB_TFT_SSD1289=m +-CONFIG_FB_TFT_SSD1306=m +-CONFIG_FB_TFT_SSD1331=m +-CONFIG_FB_TFT_SSD1351=m +-CONFIG_FB_TFT_ST7735R=m +-# CONFIG_FB_TFT_ST7789V is not set +-CONFIG_FB_TFT_TINYLCD=m +-CONFIG_FB_TFT_TLS8204=m +-CONFIG_FB_TFT_UC1611=m +-CONFIG_FB_TFT_UC1701=m +-CONFIG_FB_TFT_UPD161704=m +-CONFIG_FB_TFT_WATTEROTT=m +-CONFIG_FB_FLEX=m +-CONFIG_FB_TFT_FBTFT_DEVICE=m +-# CONFIG_WILC1000_DRIVER is not set +-# CONFIG_MOST is not set +-# CONFIG_CHROME_PLATFORMS is not set +-CONFIG_CLKDEV_LOOKUP=y +-CONFIG_HAVE_CLK_PREPARE=y +-CONFIG_COMMON_CLK=y +- +-# +-# Common Clock Framework +-# +-# CONFIG_COMMON_CLK_SI5351 is not set +-# CONFIG_COMMON_CLK_SI514 is not set +-# CONFIG_COMMON_CLK_SI570 is not set +-# CONFIG_COMMON_CLK_CDCE925 is not set +-# CONFIG_CLK_QORIQ is not set +-# CONFIG_COMMON_CLK_PWM is not set +-# CONFIG_COMMON_CLK_PXA is not set +-# CONFIG_COMMON_CLK_CDCE706 is not set +- +-# +-# Hardware Spinlock drivers +-# +- +-# +-# Clock Source drivers +-# +-CONFIG_CLKSRC_OF=y +-CONFIG_CLKSRC_PROBE=y +-CONFIG_CLKSRC_MMIO=y +-# CONFIG_ARM_TIMER_SP804 is not set +-# CONFIG_ATMEL_PIT is not set +-# CONFIG_SH_TIMER_CMT is not set +-# CONFIG_SH_TIMER_MTU2 is not set +-# CONFIG_SH_TIMER_TMU is not set +-# CONFIG_EM_TIMER_STI is not set +-CONFIG_CLKSRC_IMX_GPT=y +-# CONFIG_MAILBOX is not set +-CONFIG_IOMMU_SUPPORT=y +- +-# +-# Generic IOMMU Pagetable Support +-# +-# CONFIG_IOMMU_IO_PGTABLE_LPAE is not set +-# CONFIG_ARM_SMMU is not set +- +-# +-# Remoteproc drivers +-# +-# CONFIG_STE_MODEM_RPROC is not set +- +-# +-# Rpmsg drivers +-# +- +-# +-# SOC (System On Chip) specific Drivers +-# +-# CONFIG_SOC_BRCMSTB is not set +-# CONFIG_SUNXI_SRAM is not set +-# CONFIG_SOC_TI is not set +-CONFIG_PM_DEVFREQ=y +- +-# +-# DEVFREQ Governors +-# +-CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y +-CONFIG_DEVFREQ_GOV_PERFORMANCE=y +-CONFIG_DEVFREQ_GOV_POWERSAVE=y +-CONFIG_DEVFREQ_GOV_USERSPACE=y +- +-# +-# DEVFREQ Drivers +-# +-CONFIG_PM_DEVFREQ_EVENT=y +-CONFIG_EXTCON=y +- +-# +-# Extcon Device Drivers +-# +-CONFIG_EXTCON_ADC_JACK=m +-CONFIG_EXTCON_GPIO=y +-CONFIG_EXTCON_RT8973A=m +-CONFIG_EXTCON_SM5502=m +-CONFIG_EXTCON_USB_GPIO=y +-# CONFIG_MEMORY is not set +-CONFIG_IIO=m +-CONFIG_IIO_BUFFER=y +-# CONFIG_IIO_BUFFER_CB is not set +-CONFIG_IIO_KFIFO_BUF=m +-CONFIG_IIO_TRIGGERED_BUFFER=m +-CONFIG_IIO_TRIGGER=y +-CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 +- +-# +-# Accelerometers +-# +-# CONFIG_BMA180 is not set +-# CONFIG_BMC150_ACCEL is not set +-# CONFIG_HID_SENSOR_ACCEL_3D is not set +-# CONFIG_IIO_ST_ACCEL_3AXIS is not set +-# CONFIG_KXSD9 is not set +-# CONFIG_KXCJK1013 is not set +-# CONFIG_MMA8452 is not set +-# CONFIG_MMA9551 is not set +-# CONFIG_MMA9553 is not set +-# CONFIG_MXC4005 is not set +-# CONFIG_STK8312 is not set +-# CONFIG_STK8BA50 is not set +- +-# +-# Analog to digital converters +-# +-# CONFIG_AD7266 is not set +-# CONFIG_AD7291 is not set +-# CONFIG_AD7298 is not set +-# CONFIG_AD7476 is not set +-# CONFIG_AD7791 is not set +-# CONFIG_AD7793 is not set +-# CONFIG_AD7887 is not set +-# CONFIG_AD7923 is not set +-# CONFIG_AD799X is not set +-# CONFIG_CC10001_ADC is not set +-# CONFIG_HI8435 is not set +-# CONFIG_MAX1027 is not set +-# CONFIG_MAX1363 is not set +-# CONFIG_MCP320X is not set +-# CONFIG_MCP3422 is not set +-# CONFIG_NAU7802 is not set +-# CONFIG_TI_ADC081C is not set +-# CONFIG_TI_ADC128S052 is not set +-# CONFIG_VF610_ADC is not set +- +-# +-# Amplifiers +-# +-# CONFIG_AD8366 is not set +- +-# +-# Chemical Sensors +-# +-# CONFIG_VZ89X is not set +- +-# +-# Hid Sensor IIO Common +-# +-CONFIG_HID_SENSOR_IIO_COMMON=m +-CONFIG_HID_SENSOR_IIO_TRIGGER=m +- +-# +-# SSP Sensor Common +-# +-# CONFIG_IIO_SSP_SENSORHUB is not set +- +-# +-# Digital to analog converters +-# +-# CONFIG_AD5064 is not set +-# CONFIG_AD5360 is not set +-# CONFIG_AD5380 is not set +-# CONFIG_AD5421 is not set +-# CONFIG_AD5446 is not set +-# CONFIG_AD5449 is not set +-# CONFIG_AD5504 is not set +-# CONFIG_AD5624R_SPI is not set +-# CONFIG_AD5686 is not set +-# CONFIG_AD5755 is not set +-# CONFIG_AD5764 is not set +-# CONFIG_AD5791 is not set +-# CONFIG_AD7303 is not set +-# CONFIG_M62332 is not set +-# CONFIG_MAX517 is not set +-# CONFIG_MAX5821 is not set +-# CONFIG_MCP4725 is not set +-# CONFIG_MCP4922 is not set +- +-# +-# Frequency Synthesizers DDS/PLL +-# +- +-# +-# Clock Generator/Distribution +-# +-# CONFIG_AD9523 is not set +- +-# +-# Phase-Locked Loop (PLL) frequency synthesizers +-# +-# CONFIG_ADF4350 is not set +- +-# +-# Digital gyroscope sensors +-# +-# CONFIG_ADIS16080 is not set +-# CONFIG_ADIS16130 is not set +-# CONFIG_ADIS16136 is not set +-# CONFIG_ADIS16260 is not set +-# CONFIG_ADXRS450 is not set +-# CONFIG_BMG160 is not set +-CONFIG_HID_SENSOR_GYRO_3D=m +-# CONFIG_IIO_ST_GYRO_3AXIS is not set +-# CONFIG_ITG3200 is not set +- +-# +-# Humidity sensors +-# +-CONFIG_DHT11=m +-# CONFIG_HDC100X is not set +-# CONFIG_HTU21 is not set +-# CONFIG_SI7005 is not set +-# CONFIG_SI7020 is not set +- +-# +-# Inertial measurement units +-# +-# CONFIG_ADIS16400 is not set +-# CONFIG_ADIS16480 is not set +-# CONFIG_KMX61 is not set +-# CONFIG_INV_MPU6050_IIO is not set +- +-# +-# Light sensors +-# +-# CONFIG_ADJD_S311 is not set +-# CONFIG_AL3320A is not set +-# CONFIG_APDS9300 is not set +-# CONFIG_APDS9960 is not set +-# CONFIG_BH1750 is not set +-# CONFIG_CM32181 is not set +-# CONFIG_CM3232 is not set +-# CONFIG_CM3323 is not set +-# CONFIG_CM36651 is not set +-# CONFIG_GP2AP020A00F is not set +-# CONFIG_ISL29125 is not set +-# CONFIG_HID_SENSOR_ALS is not set +-# CONFIG_HID_SENSOR_PROX is not set +-# CONFIG_JSA1212 is not set +-# CONFIG_RPR0521 is not set +-# CONFIG_LTR501 is not set +-# CONFIG_OPT3001 is not set +-# CONFIG_PA12203001 is not set +-# CONFIG_STK3310 is not set +-# CONFIG_TCS3414 is not set +-# CONFIG_TCS3472 is not set +-# CONFIG_SENSORS_TSL2563 is not set +-# CONFIG_TSL4531 is not set +-# CONFIG_US5182D is not set +-# CONFIG_VCNL4000 is not set +- +-# +-# Magnetometer sensors +-# +-# CONFIG_AK8975 is not set +-# CONFIG_AK09911 is not set +-# CONFIG_BMC150_MAGN is not set +-# CONFIG_MAG3110 is not set +-# CONFIG_HID_SENSOR_MAGNETOMETER_3D is not set +-# CONFIG_MMC35240 is not set +-# CONFIG_IIO_ST_MAGN_3AXIS is not set +- +-# +-# Inclinometer sensors +-# +-# CONFIG_HID_SENSOR_INCLINOMETER_3D is not set +-# CONFIG_HID_SENSOR_DEVICE_ROTATION is not set +- +-# +-# Triggers - standalone +-# +-CONFIG_IIO_INTERRUPT_TRIGGER=m +-CONFIG_IIO_SYSFS_TRIGGER=m +- +-# +-# Digital potentiometers +-# +-# CONFIG_MCP4531 is not set +- +-# +-# Pressure sensors +-# +-# CONFIG_BMP280 is not set +-# CONFIG_HID_SENSOR_PRESS is not set +-# CONFIG_MPL115 is not set +-# CONFIG_MPL3115 is not set +-# CONFIG_MS5611 is not set +-# CONFIG_MS5637 is not set +-# CONFIG_IIO_ST_PRESS is not set +-# CONFIG_T5403 is not set +- +-# +-# Lightning sensors +-# +-# CONFIG_AS3935 is not set +- +-# +-# Proximity sensors +-# +-# CONFIG_LIDAR_LITE_V2 is not set +-# CONFIG_SX9500 is not set +- +-# +-# Temperature sensors +-# +-# CONFIG_MLX90614 is not set +-# CONFIG_TMP006 is not set +-# CONFIG_TSYS01 is not set +-# CONFIG_TSYS02D is not set +-# CONFIG_NTB is not set +-# CONFIG_VME_BUS is not set +-CONFIG_PWM=y +-CONFIG_PWM_SYSFS=y +-CONFIG_PWM_FSL_FTM=y +-CONFIG_PWM_IMX=y +-CONFIG_PWM_PCA9685=y +-CONFIG_IRQCHIP=y +-CONFIG_ARM_GIC=y +-# CONFIG_IPACK_BUS is not set +-CONFIG_ARCH_HAS_RESET_CONTROLLER=y +-CONFIG_RESET_CONTROLLER=y +-# CONFIG_FMC is not set +- +-# +-# PHY Subsystem +-# +-CONFIG_GENERIC_PHY=y +-# CONFIG_PHY_PXA_28NM_HSIC is not set +-# CONFIG_PHY_PXA_28NM_USB2 is not set +-# CONFIG_BCM_KONA_USB2_PHY is not set +-# CONFIG_PHY_SAMSUNG_USB2 is not set +-CONFIG_POWERCAP=y +-# CONFIG_MCB is not set +- +-# +-# Performance monitor support +-# +-CONFIG_ARM_PMU=y +-CONFIG_RAS=y +-# CONFIG_THUNDERBOLT is not set +- +-# +-# Android +-# +-# CONFIG_ANDROID is not set +-CONFIG_NVMEM=y +-CONFIG_NVMEM_IMX_OCOTP=m +-# CONFIG_STM is not set +-# CONFIG_STM_DUMMY is not set +-# CONFIG_STM_SOURCE_CONSOLE is not set +-# CONFIG_INTEL_TH is not set +- +-# +-# FPGA Configuration Support +-# +-# CONFIG_FPGA is not set +- +-# +-# MXC support drivers +-# +-CONFIG_MXC_IPU=y +- +-# +-# Vivante GPU support +-# +-CONFIG_MXC_GPU_VIV=y +-CONFIG_MXC_IPU_V3_FSL=y +- +-# +-# MXC VPU(Video Processing Unit) support +-# +-CONFIG_MXC_VPU=y +-# CONFIG_MXC_VPU_DEBUG is not set +-# CONFIG_MX6_VPU_352M is not set +- +-# +-# MXC HDMI CEC (Consumer Electronics Control) support +-# +-CONFIG_MXC_HDMI_CEC=y +- +-# +-# MXC MIPI Support +-# +-CONFIG_MXC_MIPI_CSI2=y +- +-# +-# MXC Media Local Bus Driver +-# +-CONFIG_MXC_MLB=y +-CONFIG_MXC_MLB150=m +- +-# +-# Firmware Drivers +-# +-CONFIG_FIRMWARE_MEMMAP=y +- +-# +-# File systems +-# +-CONFIG_DCACHE_WORD_ACCESS=y +-# CONFIG_EXT2_FS is not set +-# CONFIG_EXT3_FS is not set +-CONFIG_EXT4_FS=y +-CONFIG_EXT4_USE_FOR_EXT2=y +-CONFIG_EXT4_FS_POSIX_ACL=y +-CONFIG_EXT4_FS_SECURITY=y +-CONFIG_EXT4_ENCRYPTION=y +-CONFIG_EXT4_FS_ENCRYPTION=y +-# CONFIG_EXT4_DEBUG is not set +-CONFIG_JBD2=y +-# CONFIG_JBD2_DEBUG is not set +-CONFIG_FS_MBCACHE=y +-CONFIG_REISERFS_FS=m +-# CONFIG_REISERFS_CHECK is not set +-# CONFIG_REISERFS_PROC_INFO is not set +-CONFIG_REISERFS_FS_XATTR=y +-CONFIG_REISERFS_FS_POSIX_ACL=y +-# CONFIG_REISERFS_FS_SECURITY is not set +-CONFIG_JFS_FS=m +-CONFIG_JFS_POSIX_ACL=y +-CONFIG_JFS_SECURITY=y +-# CONFIG_JFS_DEBUG is not set +-# CONFIG_JFS_STATISTICS is not set +-CONFIG_XFS_FS=m +-CONFIG_XFS_QUOTA=y +-CONFIG_XFS_POSIX_ACL=y +-# CONFIG_XFS_RT is not set +-# CONFIG_XFS_WARN is not set +-# CONFIG_XFS_DEBUG is not set +-# CONFIG_GFS2_FS is not set +-# CONFIG_OCFS2_FS is not set +-CONFIG_BTRFS_FS=y +-CONFIG_BTRFS_FS_POSIX_ACL=y +-# CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set +-# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set +-# CONFIG_BTRFS_DEBUG is not set +-# CONFIG_BTRFS_ASSERT is not set +-# CONFIG_NILFS2_FS is not set +-CONFIG_F2FS_FS=m +-CONFIG_F2FS_STAT_FS=y +-CONFIG_F2FS_FS_XATTR=y +-CONFIG_F2FS_FS_POSIX_ACL=y +-# CONFIG_F2FS_FS_SECURITY is not set +-# CONFIG_F2FS_CHECK_FS is not set +-# CONFIG_F2FS_FS_ENCRYPTION is not set +-# CONFIG_F2FS_IO_TRACE is not set +-CONFIG_FS_POSIX_ACL=y +-CONFIG_EXPORTFS=y +-CONFIG_FILE_LOCKING=y +-CONFIG_FSNOTIFY=y +-CONFIG_DNOTIFY=y +-CONFIG_INOTIFY_USER=y +-CONFIG_FANOTIFY=y +-CONFIG_QUOTA=y +-# CONFIG_QUOTA_NETLINK_INTERFACE is not set +-CONFIG_PRINT_QUOTA_WARNING=y +-# CONFIG_QUOTA_DEBUG is not set +-CONFIG_QUOTA_TREE=m +-CONFIG_QFMT_V1=m +-CONFIG_QFMT_V2=m +-CONFIG_QUOTACTL=y +-CONFIG_AUTOFS4_FS=y +-CONFIG_FUSE_FS=y +-CONFIG_CUSE=y +-CONFIG_OVERLAY_FS=y +- +-# +-# Caches +-# +-CONFIG_FSCACHE=m +-# CONFIG_FSCACHE_STATS is not set +-# CONFIG_FSCACHE_HISTOGRAM is not set +-# CONFIG_FSCACHE_DEBUG is not set +-# CONFIG_FSCACHE_OBJECT_LIST is not set +-CONFIG_CACHEFILES=m +-# CONFIG_CACHEFILES_DEBUG is not set +-# CONFIG_CACHEFILES_HISTOGRAM is not set +- +-# +-# CD-ROM/DVD Filesystems +-# +-CONFIG_ISO9660_FS=y +-CONFIG_JOLIET=y +-CONFIG_ZISOFS=y +-CONFIG_UDF_FS=y +-CONFIG_UDF_NLS=y +- +-# +-# DOS/FAT/NT Filesystems +-# +-CONFIG_FAT_FS=y +-CONFIG_MSDOS_FS=y +-CONFIG_VFAT_FS=y +-CONFIG_FAT_DEFAULT_CODEPAGE=437 +-CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +-CONFIG_NTFS_FS=m +-# CONFIG_NTFS_DEBUG is not set +-CONFIG_NTFS_RW=y +- +-# +-# Pseudo filesystems +-# +-CONFIG_PROC_FS=y +-CONFIG_PROC_SYSCTL=y +-CONFIG_PROC_PAGE_MONITOR=y +-CONFIG_PROC_CHILDREN=y +-CONFIG_KERNFS=y +-CONFIG_SYSFS=y +-CONFIG_TMPFS=y +-CONFIG_TMPFS_POSIX_ACL=y +-CONFIG_TMPFS_XATTR=y +-# CONFIG_HUGETLB_PAGE is not set +-CONFIG_CONFIGFS_FS=y +-CONFIG_MISC_FILESYSTEMS=y +-# CONFIG_ADFS_FS is not set +-# CONFIG_AFFS_FS is not set +-# CONFIG_ECRYPT_FS is not set +-CONFIG_HFS_FS=m +-CONFIG_HFSPLUS_FS=m +-# CONFIG_HFSPLUS_FS_POSIX_ACL is not set +-# CONFIG_BEFS_FS is not set +-# CONFIG_BFS_FS is not set +-# CONFIG_EFS_FS is not set +-CONFIG_JFFS2_FS=m +-CONFIG_JFFS2_FS_DEBUG=0 +-CONFIG_JFFS2_FS_WRITEBUFFER=y +-# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +-# CONFIG_JFFS2_SUMMARY is not set +-# CONFIG_JFFS2_FS_XATTR is not set +-# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set +-CONFIG_JFFS2_ZLIB=y +-# CONFIG_JFFS2_LZO is not set +-CONFIG_JFFS2_RTIME=y +-# CONFIG_JFFS2_RUBIN is not set +-CONFIG_UBIFS_FS=m +-# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set +-CONFIG_UBIFS_FS_LZO=y +-CONFIG_UBIFS_FS_ZLIB=y +-# CONFIG_UBIFS_ATIME_SUPPORT is not set +-CONFIG_LOGFS=m +-# CONFIG_CRAMFS is not set +-CONFIG_SQUASHFS=m +-CONFIG_SQUASHFS_FILE_CACHE=y +-# CONFIG_SQUASHFS_FILE_DIRECT is not set +-CONFIG_SQUASHFS_DECOMP_SINGLE=y +-# CONFIG_SQUASHFS_DECOMP_MULTI is not set +-# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set +-CONFIG_SQUASHFS_XATTR=y +-CONFIG_SQUASHFS_ZLIB=y +-# CONFIG_SQUASHFS_LZ4 is not set +-# CONFIG_SQUASHFS_LZO is not set +-# CONFIG_SQUASHFS_XZ is not set +-# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set +-# CONFIG_SQUASHFS_EMBEDDED is not set +-CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 +-# CONFIG_VXFS_FS is not set +-# CONFIG_MINIX_FS is not set +-# CONFIG_OMFS_FS is not set +-# CONFIG_HPFS_FS is not set +-# CONFIG_QNX4FS_FS is not set +-# CONFIG_QNX6FS_FS is not set +-CONFIG_ROMFS_FS=m +-CONFIG_ROMFS_BACKED_BY_BLOCK=y +-# CONFIG_ROMFS_BACKED_BY_MTD is not set +-# CONFIG_ROMFS_BACKED_BY_BOTH is not set +-CONFIG_ROMFS_ON_BLOCK=y +-# CONFIG_PSTORE is not set +-CONFIG_SYSV_FS=m +-# CONFIG_UFS_FS is not set +-CONFIG_NETWORK_FILESYSTEMS=y +-CONFIG_NFS_FS=y +-CONFIG_NFS_V2=y +-CONFIG_NFS_V3=y +-CONFIG_NFS_V3_ACL=y +-CONFIG_NFS_V4=y +-# CONFIG_NFS_SWAP is not set +-CONFIG_NFS_V4_1=y +-CONFIG_NFS_V4_2=y +-CONFIG_PNFS_FILE_LAYOUT=y +-CONFIG_PNFS_BLOCK=m +-CONFIG_PNFS_FLEXFILE_LAYOUT=m +-CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org" +-CONFIG_NFS_V4_1_MIGRATION=y +-CONFIG_ROOT_NFS=y +-# CONFIG_NFS_USE_LEGACY_DNS is not set +-CONFIG_NFS_USE_KERNEL_DNS=y +-CONFIG_NFS_DEBUG=y +-CONFIG_NFSD=m +-CONFIG_NFSD_V2_ACL=y +-CONFIG_NFSD_V3=y +-CONFIG_NFSD_V3_ACL=y +-CONFIG_NFSD_V4=y +-# CONFIG_NFSD_PNFS is not set +-# CONFIG_NFSD_FAULT_INJECTION is not set +-CONFIG_GRACE_PERIOD=y +-CONFIG_LOCKD=y +-CONFIG_LOCKD_V4=y +-CONFIG_NFS_ACL_SUPPORT=y +-CONFIG_NFS_COMMON=y +-CONFIG_SUNRPC=y +-CONFIG_SUNRPC_GSS=y +-CONFIG_SUNRPC_BACKCHANNEL=y +-CONFIG_RPCSEC_GSS_KRB5=m +-CONFIG_SUNRPC_DEBUG=y +-# CONFIG_CEPH_FS is not set +-CONFIG_CIFS=m +-# CONFIG_CIFS_STATS is not set +-CONFIG_CIFS_WEAK_PW_HASH=y +-# CONFIG_CIFS_UPCALL is not set +-CONFIG_CIFS_XATTR=y +-CONFIG_CIFS_POSIX=y +-CONFIG_CIFS_ACL=y +-# CONFIG_CIFS_DEBUG is not set +-CONFIG_CIFS_DFS_UPCALL=y +-CONFIG_CIFS_SMB2=y +-CONFIG_CIFS_SMB311=y +-CONFIG_CIFS_FSCACHE=y +-CONFIG_NCP_FS=m +-# CONFIG_NCPFS_PACKET_SIGNING is not set +-# CONFIG_NCPFS_IOCTL_LOCKING is not set +-# CONFIG_NCPFS_STRONG is not set +-# CONFIG_NCPFS_NFS_NS is not set +-# CONFIG_NCPFS_OS2_NS is not set +-# CONFIG_NCPFS_SMALLDOS is not set +-# CONFIG_NCPFS_NLS is not set +-# CONFIG_NCPFS_EXTRAS is not set +-# CONFIG_CODA_FS is not set +-# CONFIG_AFS_FS is not set +-CONFIG_NLS=y +-CONFIG_NLS_DEFAULT="utf8" +-CONFIG_NLS_CODEPAGE_437=y +-CONFIG_NLS_CODEPAGE_737=m +-CONFIG_NLS_CODEPAGE_775=m +-CONFIG_NLS_CODEPAGE_850=y +-CONFIG_NLS_CODEPAGE_852=y +-CONFIG_NLS_CODEPAGE_855=m +-CONFIG_NLS_CODEPAGE_857=m +-CONFIG_NLS_CODEPAGE_860=m +-CONFIG_NLS_CODEPAGE_861=m +-CONFIG_NLS_CODEPAGE_862=m +-CONFIG_NLS_CODEPAGE_863=m +-CONFIG_NLS_CODEPAGE_864=m +-CONFIG_NLS_CODEPAGE_865=m +-CONFIG_NLS_CODEPAGE_866=m +-CONFIG_NLS_CODEPAGE_869=m +-CONFIG_NLS_CODEPAGE_936=m +-CONFIG_NLS_CODEPAGE_950=m +-CONFIG_NLS_CODEPAGE_932=m +-CONFIG_NLS_CODEPAGE_949=m +-CONFIG_NLS_CODEPAGE_874=m +-CONFIG_NLS_ISO8859_8=m +-CONFIG_NLS_CODEPAGE_1250=y +-CONFIG_NLS_CODEPAGE_1251=y +-CONFIG_NLS_ASCII=y +-CONFIG_NLS_ISO8859_1=y +-CONFIG_NLS_ISO8859_2=y +-CONFIG_NLS_ISO8859_3=m +-CONFIG_NLS_ISO8859_4=m +-CONFIG_NLS_ISO8859_5=m +-CONFIG_NLS_ISO8859_6=m +-CONFIG_NLS_ISO8859_7=m +-CONFIG_NLS_ISO8859_9=m +-CONFIG_NLS_ISO8859_13=m +-CONFIG_NLS_ISO8859_14=m +-CONFIG_NLS_ISO8859_15=y +-CONFIG_NLS_KOI8_R=m +-CONFIG_NLS_KOI8_U=m +-CONFIG_NLS_MAC_ROMAN=m +-CONFIG_NLS_MAC_CELTIC=m +-CONFIG_NLS_MAC_CENTEURO=m +-CONFIG_NLS_MAC_CROATIAN=m +-CONFIG_NLS_MAC_CYRILLIC=m +-CONFIG_NLS_MAC_GAELIC=m +-CONFIG_NLS_MAC_GREEK=m +-CONFIG_NLS_MAC_ICELAND=m +-CONFIG_NLS_MAC_INUIT=m +-CONFIG_NLS_MAC_ROMANIAN=m +-CONFIG_NLS_MAC_TURKISH=m +-CONFIG_NLS_UTF8=y +-CONFIG_DLM=m +-# CONFIG_DLM_DEBUG is not set +- +-# +-# Kernel hacking +-# +- +-# +-# printk and dmesg options +-# +-CONFIG_PRINTK_TIME=y +-CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 +-# CONFIG_BOOT_PRINTK_DELAY is not set +-CONFIG_DYNAMIC_DEBUG=y +- +-# +-# Compile-time checks and compiler options +-# +-# CONFIG_DEBUG_INFO is not set +-CONFIG_ENABLE_WARN_DEPRECATED=y +-CONFIG_ENABLE_MUST_CHECK=y +-CONFIG_FRAME_WARN=1024 +-CONFIG_STRIP_ASM_SYMS=y +-# CONFIG_READABLE_ASM is not set +-# CONFIG_UNUSED_SYMBOLS is not set +-# CONFIG_PAGE_OWNER is not set +-CONFIG_DEBUG_FS=y +-# CONFIG_HEADERS_CHECK is not set +-# CONFIG_DEBUG_SECTION_MISMATCH is not set +-CONFIG_SECTION_MISMATCH_WARN_ONLY=y +-CONFIG_FRAME_POINTER=y +-# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +-CONFIG_MAGIC_SYSRQ=y +-CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1 +-CONFIG_DEBUG_KERNEL=y +- +-# +-# Memory Debugging +-# +-# CONFIG_PAGE_EXTENSION is not set +-# CONFIG_DEBUG_PAGEALLOC is not set +-# CONFIG_DEBUG_OBJECTS is not set +-# CONFIG_SLUB_STATS is not set +-CONFIG_HAVE_DEBUG_KMEMLEAK=y +-# CONFIG_DEBUG_KMEMLEAK is not set +-# CONFIG_DEBUG_STACK_USAGE is not set +-# CONFIG_DEBUG_VM is not set +-# CONFIG_DEBUG_MEMORY_INIT is not set +-# CONFIG_DEBUG_PER_CPU_MAPS is not set +-# CONFIG_DEBUG_HIGHMEM is not set +-# CONFIG_DEBUG_SHIRQ is not set +- +-# +-# Debug Lockups and Hangs +-# +-# CONFIG_LOCKUP_DETECTOR is not set +-# CONFIG_DETECT_HUNG_TASK is not set +-CONFIG_PANIC_ON_OOPS=y +-CONFIG_PANIC_ON_OOPS_VALUE=1 +-CONFIG_PANIC_TIMEOUT=1 +-# CONFIG_SCHED_DEBUG is not set +-# CONFIG_SCHED_INFO is not set +-# CONFIG_SCHEDSTATS is not set +-# CONFIG_SCHED_STACK_END_CHECK is not set +-# CONFIG_DEBUG_TIMEKEEPING is not set +-CONFIG_TIMER_STATS=y +-# CONFIG_DEBUG_PREEMPT is not set +- +-# +-# Lock Debugging (spinlocks, mutexes, etc...) +-# +-# CONFIG_DEBUG_RT_MUTEXES is not set +-# CONFIG_DEBUG_SPINLOCK is not set +-# CONFIG_DEBUG_MUTEXES is not set +-# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set +-# CONFIG_DEBUG_LOCK_ALLOC is not set +-# CONFIG_PROVE_LOCKING is not set +-# CONFIG_LOCK_STAT is not set +-# CONFIG_DEBUG_ATOMIC_SLEEP is not set +-# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +-# CONFIG_LOCK_TORTURE_TEST is not set +-CONFIG_STACKTRACE=y +-# CONFIG_DEBUG_KOBJECT is not set +-# CONFIG_DEBUG_BUGVERBOSE is not set +-# CONFIG_DEBUG_LIST is not set +-# CONFIG_DEBUG_PI_LIST is not set +-# CONFIG_DEBUG_SG is not set +-# CONFIG_DEBUG_NOTIFIERS is not set +-# CONFIG_DEBUG_CREDENTIALS is not set +- +-# +-# RCU Debugging +-# +-# CONFIG_PROVE_RCU is not set +-# CONFIG_SPARSE_RCU_POINTER is not set +-# CONFIG_TORTURE_TEST is not set +-# CONFIG_RCU_TORTURE_TEST is not set +-CONFIG_RCU_CPU_STALL_TIMEOUT=21 +-# CONFIG_RCU_TRACE is not set +-# CONFIG_RCU_EQS_DEBUG is not set +-# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +-# CONFIG_NOTIFIER_ERROR_INJECTION is not set +-# CONFIG_FAULT_INJECTION is not set +-CONFIG_NOP_TRACER=y +-CONFIG_HAVE_FUNCTION_TRACER=y +-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +-CONFIG_HAVE_DYNAMIC_FTRACE=y +-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +-CONFIG_HAVE_C_RECORDMCOUNT=y +-CONFIG_TRACE_CLOCK=y +-CONFIG_RING_BUFFER=y +-CONFIG_EVENT_TRACING=y +-CONFIG_CONTEXT_SWITCH_TRACER=y +-CONFIG_TRACING=y +-CONFIG_GENERIC_TRACER=y +-CONFIG_TRACING_SUPPORT=y +-CONFIG_FTRACE=y +-CONFIG_FUNCTION_TRACER=y +-CONFIG_FUNCTION_GRAPH_TRACER=y +-# CONFIG_IRQSOFF_TRACER is not set +-# CONFIG_PREEMPT_TRACER is not set +-# CONFIG_SCHED_TRACER is not set +-# CONFIG_MISSED_TIMER_OFFSETS_HIST is not set +-# CONFIG_FTRACE_SYSCALLS is not set +-# CONFIG_TRACER_SNAPSHOT is not set +-CONFIG_BRANCH_PROFILE_NONE=y +-# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set +-# CONFIG_PROFILE_ALL_BRANCHES is not set +-# CONFIG_STACK_TRACER is not set +-# CONFIG_BLK_DEV_IO_TRACE is not set +-# CONFIG_UPROBE_EVENT is not set +-# CONFIG_PROBE_EVENTS is not set +-CONFIG_DYNAMIC_FTRACE=y +-# CONFIG_FUNCTION_PROFILER is not set +-CONFIG_FTRACE_MCOUNT_RECORD=y +-# CONFIG_FTRACE_STARTUP_TEST is not set +-# CONFIG_TRACEPOINT_BENCHMARK is not set +-# CONFIG_RING_BUFFER_BENCHMARK is not set +-# CONFIG_RING_BUFFER_STARTUP_TEST is not set +-# CONFIG_TRACE_ENUM_MAP_FILE is not set +-# CONFIG_TRACING_EVENTS_GPIO is not set +- +-# +-# Runtime Testing +-# +-# CONFIG_LKDTM is not set +-# CONFIG_TEST_LIST_SORT is not set +-# CONFIG_BACKTRACE_SELF_TEST is not set +-# CONFIG_RBTREE_TEST is not set +-# CONFIG_INTERVAL_TREE_TEST is not set +-# CONFIG_PERCPU_TEST is not set +-# CONFIG_ATOMIC64_SELFTEST is not set +-# CONFIG_ASYNC_RAID6_TEST is not set +-# CONFIG_TEST_HEXDUMP is not set +-# CONFIG_TEST_STRING_HELPERS is not set +-# CONFIG_TEST_KSTRTOX is not set +-# CONFIG_TEST_PRINTF is not set +-# CONFIG_TEST_RHASHTABLE is not set +-# CONFIG_DMA_API_DEBUG is not set +-# CONFIG_TEST_LKM is not set +-# CONFIG_TEST_USER_COPY is not set +-# CONFIG_TEST_BPF is not set +-# CONFIG_TEST_FIRMWARE is not set +-# CONFIG_TEST_UDELAY is not set +-# CONFIG_MEMTEST is not set +-# CONFIG_TEST_STATIC_KEYS is not set +-# CONFIG_SAMPLES is not set +-CONFIG_HAVE_ARCH_KGDB=y +-# CONFIG_KGDB is not set +-# CONFIG_ARM_PTDUMP is not set +-# CONFIG_STRICT_DEVMEM is not set +-CONFIG_ARM_UNWIND=y +-CONFIG_OLD_MCOUNT=y +-# CONFIG_DEBUG_USER is not set +-# CONFIG_DEBUG_LL is not set +-CONFIG_DEBUG_IMX_UART_PORT=1 +-CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" +-# CONFIG_DEBUG_UART_8250 is not set +-# CONFIG_DEBUG_UART_BCM63XX is not set +-CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +-# CONFIG_PID_IN_CONTEXTIDR is not set +-# CONFIG_DEBUG_SET_MODULE_RONX is not set +-# CONFIG_CORESIGHT is not set +- +-# +-# Security options +-# +-CONFIG_KEYS=y +-# CONFIG_PERSISTENT_KEYRINGS is not set +-# CONFIG_BIG_KEYS is not set +-CONFIG_ENCRYPTED_KEYS=y +-# CONFIG_SECURITY_DMESG_RESTRICT is not set +-# CONFIG_SECURITY is not set +-# CONFIG_SECURITYFS is not set +-CONFIG_DEFAULT_SECURITY_DAC=y +-CONFIG_DEFAULT_SECURITY="" +-CONFIG_XOR_BLOCKS=y +-CONFIG_ASYNC_CORE=m +-CONFIG_ASYNC_MEMCPY=m +-CONFIG_ASYNC_XOR=m +-CONFIG_ASYNC_PQ=m +-CONFIG_ASYNC_RAID6_RECOV=m +-CONFIG_CRYPTO=y +- +-# +-# Crypto core or helper +-# +-CONFIG_CRYPTO_ALGAPI=y +-CONFIG_CRYPTO_ALGAPI2=y +-CONFIG_CRYPTO_AEAD=y +-CONFIG_CRYPTO_AEAD2=y +-CONFIG_CRYPTO_BLKCIPHER=y +-CONFIG_CRYPTO_BLKCIPHER2=y +-CONFIG_CRYPTO_HASH=y +-CONFIG_CRYPTO_HASH2=y +-CONFIG_CRYPTO_RNG=y +-CONFIG_CRYPTO_RNG2=y +-CONFIG_CRYPTO_RNG_DEFAULT=y +-CONFIG_CRYPTO_PCOMP=y +-CONFIG_CRYPTO_PCOMP2=y +-CONFIG_CRYPTO_AKCIPHER2=y +-CONFIG_CRYPTO_AKCIPHER=m +-CONFIG_CRYPTO_RSA=m +-CONFIG_CRYPTO_CRYPTODEV=y +-CONFIG_CRYPTO_MANAGER=y +-CONFIG_CRYPTO_MANAGER2=y +-CONFIG_CRYPTO_USER=y +-CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y +-CONFIG_CRYPTO_GF128MUL=y +-CONFIG_CRYPTO_NULL=y +-CONFIG_CRYPTO_NULL2=y +-CONFIG_CRYPTO_PCRYPT=y +-CONFIG_CRYPTO_WORKQUEUE=y +-CONFIG_CRYPTO_CRYPTD=y +-CONFIG_CRYPTO_MCRYPTD=m +-CONFIG_CRYPTO_AUTHENC=y +-# CONFIG_CRYPTO_TEST is not set +-CONFIG_CRYPTO_ABLK_HELPER=m +- +-# +-# Authenticated Encryption with Associated Data +-# +-CONFIG_CRYPTO_CCM=y +-CONFIG_CRYPTO_GCM=y +-CONFIG_CRYPTO_CHACHA20POLY1305=m +-CONFIG_CRYPTO_SEQIV=y +-CONFIG_CRYPTO_ECHAINIV=m +- +-# +-# Block modes +-# +-CONFIG_CRYPTO_CBC=y +-CONFIG_CRYPTO_CTR=y +-CONFIG_CRYPTO_CTS=y +-CONFIG_CRYPTO_ECB=y +-CONFIG_CRYPTO_LRW=y +-CONFIG_CRYPTO_PCBC=y +-CONFIG_CRYPTO_XTS=y +-CONFIG_CRYPTO_KEYWRAP=m +- +-# +-# Hash modes +-# +-CONFIG_CRYPTO_CMAC=y +-CONFIG_CRYPTO_HMAC=y +-CONFIG_CRYPTO_XCBC=y +-CONFIG_CRYPTO_VMAC=y +- +-# +-# Digest +-# +-CONFIG_CRYPTO_CRC32C=y +-CONFIG_CRYPTO_CRC32=y +-CONFIG_CRYPTO_CRCT10DIF=y +-CONFIG_CRYPTO_GHASH=y +-CONFIG_CRYPTO_POLY1305=m +-CONFIG_CRYPTO_MD4=y +-CONFIG_CRYPTO_MD5=y +-CONFIG_CRYPTO_MICHAEL_MIC=y +-CONFIG_CRYPTO_RMD128=m +-CONFIG_CRYPTO_RMD160=m +-CONFIG_CRYPTO_RMD256=m +-CONFIG_CRYPTO_RMD320=m +-CONFIG_CRYPTO_SHA1=y +-CONFIG_CRYPTO_SHA256=y +-CONFIG_CRYPTO_SHA512=y +-CONFIG_CRYPTO_TGR192=m +-CONFIG_CRYPTO_WP512=m +- +-# +-# Ciphers +-# +-CONFIG_CRYPTO_AES=y +-CONFIG_CRYPTO_ANUBIS=m +-CONFIG_CRYPTO_ARC4=y +-CONFIG_CRYPTO_BLOWFISH=m +-CONFIG_CRYPTO_BLOWFISH_COMMON=m +-CONFIG_CRYPTO_CAMELLIA=m +-CONFIG_CRYPTO_CAST_COMMON=m +-CONFIG_CRYPTO_CAST5=m +-CONFIG_CRYPTO_CAST6=m +-CONFIG_CRYPTO_DES=y +-CONFIG_CRYPTO_FCRYPT=m +-CONFIG_CRYPTO_KHAZAD=m +-CONFIG_CRYPTO_SALSA20=m +-CONFIG_CRYPTO_CHACHA20=m +-CONFIG_CRYPTO_SEED=m +-CONFIG_CRYPTO_SERPENT=m +-CONFIG_CRYPTO_TEA=y +-CONFIG_CRYPTO_TWOFISH=y +-CONFIG_CRYPTO_TWOFISH_COMMON=y +- +-# +-# Compression +-# +-CONFIG_CRYPTO_DEFLATE=y +-CONFIG_CRYPTO_ZLIB=y +-CONFIG_CRYPTO_LZO=y +-CONFIG_CRYPTO_842=y +-CONFIG_CRYPTO_LZ4=y +-CONFIG_CRYPTO_LZ4HC=y +- +-# +-# Random Number Generation +-# +-CONFIG_CRYPTO_ANSI_CPRNG=y +-CONFIG_CRYPTO_DRBG_MENU=y +-CONFIG_CRYPTO_DRBG_HMAC=y +-# CONFIG_CRYPTO_DRBG_HASH is not set +-# CONFIG_CRYPTO_DRBG_CTR is not set +-CONFIG_CRYPTO_DRBG=y +-CONFIG_CRYPTO_JITTERENTROPY=y +-CONFIG_CRYPTO_USER_API=m +-CONFIG_CRYPTO_USER_API_HASH=m +-CONFIG_CRYPTO_USER_API_SKCIPHER=m +-CONFIG_CRYPTO_USER_API_RNG=m +-# CONFIG_CRYPTO_USER_API_AEAD is not set +-CONFIG_CRYPTO_HASH_INFO=y +-CONFIG_CRYPTO_HW=y +-# CONFIG_CRYPTO_DEV_HIFN_795X is not set +-CONFIG_CRYPTO_DEV_FSL_CAAM=y +-CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y +-CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9 +-# CONFIG_CRYPTO_DEV_FSL_CAAM_INTC is not set +-CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y +-CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API=y +-CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y +-CONFIG_CRYPTO_DEV_FSL_CAAM_IMX=y +-CONFIG_CRYPTO_DEV_FSL_CAAM_LE=y +-# CONFIG_CRYPTO_DEV_FSL_CAAM_SM is not set +-# CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO is not set +-# CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG is not set +-# CONFIG_CRYPTO_DEV_SAHARA is not set +-# CONFIG_CRYPTO_DEV_MXS_DCP is not set +-CONFIG_ASYMMETRIC_KEY_TYPE=m +-CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m +-CONFIG_PUBLIC_KEY_ALGO_RSA=m +-CONFIG_X509_CERTIFICATE_PARSER=m +-CONFIG_PKCS7_MESSAGE_PARSER=m +-CONFIG_PKCS7_TEST_KEY=m +- +-# +-# Certificates for signature checking +-# +-CONFIG_SYSTEM_TRUSTED_KEYRING=y +-CONFIG_SYSTEM_TRUSTED_KEYS="" +-CONFIG_ARM_CRYPTO=y +-CONFIG_CRYPTO_SHA1_ARM=m +-CONFIG_CRYPTO_SHA1_ARM_NEON=m +-CONFIG_CRYPTO_SHA1_ARM_CE=m +-CONFIG_CRYPTO_SHA2_ARM_CE=m +-CONFIG_CRYPTO_SHA256_ARM=y +-CONFIG_CRYPTO_SHA512_ARM=m +-CONFIG_CRYPTO_AES_ARM=m +-CONFIG_CRYPTO_AES_ARM_BS=m +-CONFIG_CRYPTO_AES_ARM_CE=m +-CONFIG_CRYPTO_GHASH_ARM_CE=m +-CONFIG_BINARY_PRINTF=y +- +-# +-# Library routines +-# +-CONFIG_RAID6_PQ=y +-CONFIG_BITREVERSE=y +-CONFIG_HAVE_ARCH_BITREVERSE=y +-CONFIG_RATIONAL=y +-CONFIG_GENERIC_STRNCPY_FROM_USER=y +-CONFIG_GENERIC_STRNLEN_USER=y +-CONFIG_GENERIC_NET_UTILS=y +-CONFIG_GENERIC_PCI_IOMAP=y +-CONFIG_GENERIC_IO=y +-CONFIG_STMP_DEVICE=y +-CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +-CONFIG_CRC_CCITT=y +-CONFIG_CRC16=y +-CONFIG_CRC_T10DIF=y +-CONFIG_CRC_ITU_T=y +-CONFIG_CRC32=y +-# CONFIG_CRC32_SELFTEST is not set +-CONFIG_CRC32_SLICEBY8=y +-# CONFIG_CRC32_SLICEBY4 is not set +-# CONFIG_CRC32_SARWATE is not set +-# CONFIG_CRC32_BIT is not set +-CONFIG_CRC7=y +-CONFIG_LIBCRC32C=y +-CONFIG_CRC8=m +-# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set +-# CONFIG_RANDOM32_SELFTEST is not set +-CONFIG_842_COMPRESS=y +-CONFIG_842_DECOMPRESS=y +-CONFIG_ZLIB_INFLATE=y +-CONFIG_ZLIB_DEFLATE=y +-CONFIG_LZO_COMPRESS=y +-CONFIG_LZO_DECOMPRESS=y +-CONFIG_LZ4_COMPRESS=y +-CONFIG_LZ4HC_COMPRESS=y +-CONFIG_LZ4_DECOMPRESS=y +-CONFIG_XZ_DEC=m +-# CONFIG_XZ_DEC_X86 is not set +-# CONFIG_XZ_DEC_POWERPC is not set +-# CONFIG_XZ_DEC_IA64 is not set +-CONFIG_XZ_DEC_ARM=y +-CONFIG_XZ_DEC_ARMTHUMB=y +-# CONFIG_XZ_DEC_SPARC is not set +-CONFIG_XZ_DEC_BCJ=y +-# CONFIG_XZ_DEC_TEST is not set +-CONFIG_DECOMPRESS_GZIP=y +-CONFIG_DECOMPRESS_LZO=y +-CONFIG_GENERIC_ALLOCATOR=y +-CONFIG_TEXTSEARCH=y +-CONFIG_TEXTSEARCH_KMP=m +-CONFIG_TEXTSEARCH_BM=m +-CONFIG_TEXTSEARCH_FSM=m +-CONFIG_BTREE=y +-CONFIG_ASSOCIATIVE_ARRAY=y +-CONFIG_HAS_IOMEM=y +-CONFIG_HAS_IOPORT_MAP=y +-CONFIG_HAS_DMA=y +-CONFIG_CPU_RMAP=y +-CONFIG_DQL=y +-CONFIG_GLOB=y +-# CONFIG_GLOB_SELFTEST is not set +-CONFIG_NLATTR=y +-CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y +-CONFIG_CLZ_TAB=y +-CONFIG_CORDIC=y +-# CONFIG_DDR is not set +-CONFIG_MPILIB=m +-CONFIG_LIBFDT=y +-CONFIG_OID_REGISTRY=y +-CONFIG_FONT_SUPPORT=y +-# CONFIG_FONTS is not set +-CONFIG_FONT_8x8=y +-CONFIG_FONT_8x16=y +-# CONFIG_SG_SPLIT is not set +-CONFIG_ARCH_HAS_SG_CHAIN=y +-# CONFIG_VIRTUALIZATION is not set +diff --git a/arch/arm/configs/xbian_defconfig_imx6_mvebu b/arch/arm/configs/xbian_defconfig_imx6_mvebu +index 2bc59d8..83cda36 100644 +--- a/arch/arm/configs/xbian_defconfig_imx6_mvebu ++++ b/arch/arm/configs/xbian_defconfig_imx6_mvebu +@@ -1,6 +1,6 @@ + # + # Automatically generated file; DO NOT EDIT. +-# Linux/arm 4.4.1 Kernel Configuration ++# Linux/arm 4.4.6 Kernel Configuration + # + CONFIG_ARM=y + CONFIG_ARM_HAS_SG_CHAIN=y +@@ -83,7 +83,7 @@ CONFIG_NO_HZ_COMMON=y + # CONFIG_HZ_PERIODIC is not set + CONFIG_NO_HZ_IDLE=y + # CONFIG_NO_HZ_FULL is not set +-CONFIG_NO_HZ=y ++# CONFIG_NO_HZ is not set + CONFIG_HIGH_RES_TIMERS=y + + # +@@ -104,12 +104,12 @@ CONFIG_RCU_EXPERT=y + CONFIG_SRCU=y + # CONFIG_TASKS_RCU is not set + CONFIG_RCU_STALL_COMMON=y +-CONFIG_RCU_FANOUT=16 +-CONFIG_RCU_FANOUT_LEAF=8 ++CONFIG_RCU_FANOUT=8 ++CONFIG_RCU_FANOUT_LEAF=2 + # CONFIG_TREE_RCU_TRACE is not set + CONFIG_RCU_BOOST=y + CONFIG_RCU_KTHREAD_PRIO=1 +-CONFIG_RCU_BOOST_DELAY=500 ++CONFIG_RCU_BOOST_DELAY=300 + CONFIG_RCU_NOCB_CPU=y + CONFIG_RCU_NOCB_CPU_NONE=y + # CONFIG_RCU_NOCB_CPU_ZERO is not set +@@ -166,7 +166,6 @@ CONFIG_MULTIUSER=y + CONFIG_SYSFS_SYSCALL=y + CONFIG_SYSCTL_SYSCALL=y + CONFIG_KALLSYMS=y +-CONFIG_KALLSYMS_ALL=y + CONFIG_PRINTK=y + CONFIG_BUG=y + CONFIG_BASE_FULL=y +@@ -178,7 +177,7 @@ CONFIG_EVENTFD=y + # CONFIG_BPF_SYSCALL is not set + CONFIG_SHMEM=y + CONFIG_AIO=y +-# CONFIG_ADVISE_SYSCALLS is not set ++CONFIG_ADVISE_SYSCALLS=y + CONFIG_USERFAULTFD=y + CONFIG_PCI_QUIRKS=y + CONFIG_MEMBARRIER=y +@@ -190,7 +189,6 @@ CONFIG_PERF_USE_VMALLOC=y + # Kernel Performance Events And Counters + # + CONFIG_PERF_EVENTS=y +-# CONFIG_DEBUG_PERF_USE_VMALLOC is not set + # CONFIG_VM_EVENT_COUNTERS is not set + # CONFIG_SLUB_DEBUG is not set + CONFIG_COMPAT_BRK=y +@@ -248,8 +246,8 @@ CONFIG_MODULES=y + # CONFIG_MODULE_FORCE_LOAD is not set + CONFIG_MODULE_UNLOAD=y + # CONFIG_MODULE_FORCE_UNLOAD is not set +-CONFIG_MODVERSIONS=y +-CONFIG_MODULE_SRCVERSION_ALL=y ++# CONFIG_MODVERSIONS is not set ++# CONFIG_MODULE_SRCVERSION_ALL is not set + # CONFIG_MODULE_SIG is not set + # CONFIG_MODULE_COMPRESS is not set + CONFIG_MODULES_TREE_LOOKUP=y +@@ -490,7 +488,6 @@ CONFIG_PCI_DOMAINS=y + CONFIG_PCI_DOMAINS_GENERIC=y + CONFIG_PCI_SYSCALL=y + CONFIG_PCI_MSI=y +-# CONFIG_PCI_DEBUG is not set + CONFIG_PCI_REALLOC_ENABLE_AUTO=y + CONFIG_PCI_STUB=y + CONFIG_PCI_ATS=y +@@ -587,14 +584,12 @@ CONFIG_MIGRATION=y + CONFIG_ZONE_DMA_FLAG=1 + CONFIG_BOUNCE=y + # CONFIG_KSM is not set +-CONFIG_DEFAULT_MMAP_MIN_ADDR=16384 +-CONFIG_CLEANCACHE=y +-CONFIG_FRONTSWAP=y ++CONFIG_DEFAULT_MMAP_MIN_ADDR=8192 ++# CONFIG_CLEANCACHE is not set ++# CONFIG_FRONTSWAP is not set + CONFIG_CMA=y +-# CONFIG_CMA_DEBUG is not set + # CONFIG_CMA_DEBUGFS is not set + CONFIG_CMA_AREAS=7 +-# CONFIG_ZSWAP is not set + # CONFIG_ZPOOL is not set + # CONFIG_ZBUD is not set + # CONFIG_ZSMALLOC is not set +@@ -699,14 +694,18 @@ CONFIG_BINFMT_MISC=m + CONFIG_SUSPEND=y + CONFIG_SUSPEND_FREEZER=y + # CONFIG_SUSPEND_SKIP_SYNC is not set +-# CONFIG_HIBERNATION is not set ++CONFIG_HIBERNATE_CALLBACKS=y ++CONFIG_HIBERNATION=y ++CONFIG_PM_STD_PARTITION="" + CONFIG_PM_SLEEP=y + CONFIG_PM_SLEEP_SMP=y + # CONFIG_PM_AUTOSLEEP is not set +-# CONFIG_PM_WAKELOCKS is not set ++CONFIG_PM_WAKELOCKS=y ++CONFIG_PM_WAKELOCKS_LIMIT=100 ++CONFIG_PM_WAKELOCKS_GC=y + CONFIG_PM=y + # CONFIG_PM_DEBUG is not set +-# CONFIG_APM_EMULATION is not set ++CONFIG_APM_EMULATION=y + CONFIG_PM_OPP=y + CONFIG_PM_CLK=y + CONFIG_PM_GENERIC_DOMAINS=y +@@ -777,7 +776,7 @@ CONFIG_INET_UDP_DIAG=m + CONFIG_TCP_CONG_ADVANCED=y + CONFIG_TCP_CONG_BIC=m + CONFIG_TCP_CONG_CUBIC=m +-CONFIG_TCP_CONG_WESTWOOD=m ++CONFIG_TCP_CONG_WESTWOOD=y + CONFIG_TCP_CONG_HTCP=m + CONFIG_TCP_CONG_HSTCP=m + CONFIG_TCP_CONG_HYBLA=m +@@ -789,9 +788,10 @@ CONFIG_TCP_CONG_YEAH=y + CONFIG_TCP_CONG_ILLINOIS=m + CONFIG_TCP_CONG_DCTCP=m + # CONFIG_TCP_CONG_CDG is not set +-CONFIG_DEFAULT_VEGAS=y ++# CONFIG_DEFAULT_VEGAS is not set ++CONFIG_DEFAULT_WESTWOOD=y + # CONFIG_DEFAULT_RENO is not set +-CONFIG_DEFAULT_TCP_CONG="vegas" ++CONFIG_DEFAULT_TCP_CONG="westwood" + CONFIG_TCP_MD5SIG=y + CONFIG_IPV6=m + CONFIG_IPV6_ROUTER_PREF=y +@@ -821,7 +821,7 @@ CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y + CONFIG_IPV6_PIMSM_V2=y + # CONFIG_NETWORK_SECMARK is not set + CONFIG_NET_PTP_CLASSIFY=y +-# CONFIG_NETWORK_PHY_TIMESTAMPING is not set ++CONFIG_NETWORK_PHY_TIMESTAMPING=y + CONFIG_NETFILTER=y + # CONFIG_NETFILTER_DEBUG is not set + CONFIG_NETFILTER_ADVANCED=y +@@ -1153,20 +1153,15 @@ CONFIG_INET_DCCP_DIAG=m + CONFIG_IP_DCCP_CCID3=y + # CONFIG_IP_DCCP_CCID3_DEBUG is not set + CONFIG_IP_DCCP_TFRC_LIB=y +- +-# +-# DCCP Kernel Hacking +-# +-# CONFIG_IP_DCCP_DEBUG is not set + CONFIG_IP_SCTP=m + # CONFIG_SCTP_DBG_OBJCNT is not set +-CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5=y ++# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5 is not set + # CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA1 is not set +-# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE is not set +-CONFIG_SCTP_COOKIE_HMAC_MD5=y +-CONFIG_SCTP_COOKIE_HMAC_SHA1=y ++CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE=y ++# CONFIG_SCTP_COOKIE_HMAC_MD5 is not set ++# CONFIG_SCTP_COOKIE_HMAC_SHA1 is not set + CONFIG_RDS=m +-# CONFIG_RDS_TCP is not set ++CONFIG_RDS_TCP=m + # CONFIG_RDS_DEBUG is not set + CONFIG_TIPC=m + CONFIG_TIPC_MEDIA_UDP=y +@@ -1177,6 +1172,8 @@ CONFIG_L2TP_V3=y + CONFIG_L2TP_IP=m + CONFIG_L2TP_ETH=m + CONFIG_STP=m ++CONFIG_GARP=m ++CONFIG_MRP=m + CONFIG_BRIDGE=m + CONFIG_BRIDGE_IGMP_SNOOPING=y + CONFIG_BRIDGE_VLAN_FILTERING=y +@@ -1185,8 +1182,8 @@ CONFIG_NET_DSA=y + CONFIG_NET_DSA_HWMON=y + CONFIG_NET_DSA_TAG_EDSA=y + CONFIG_VLAN_8021Q=m +-# CONFIG_VLAN_8021Q_GVRP is not set +-# CONFIG_VLAN_8021Q_MVRP is not set ++CONFIG_VLAN_8021Q_GVRP=y ++CONFIG_VLAN_8021Q_MVRP=y + # CONFIG_DECNET is not set + CONFIG_LLC=m + CONFIG_LLC2=m +@@ -1197,7 +1194,7 @@ CONFIG_IPDDP=m + CONFIG_IPDDP_ENCAP=y + # CONFIG_X25 is not set + # CONFIG_LAPB is not set +-# CONFIG_PHONET is not set ++CONFIG_PHONET=m + # CONFIG_6LOWPAN is not set + # CONFIG_IEEE802154 is not set + CONFIG_NET_SCHED=y +@@ -1286,7 +1283,7 @@ CONFIG_NET_MPLS_GSO=m + # CONFIG_MPLS_ROUTING is not set + # CONFIG_HSR is not set + CONFIG_NET_SWITCHDEV=y +-# CONFIG_NET_L3_MASTER_DEV is not set ++CONFIG_NET_L3_MASTER_DEV=y + CONFIG_RPS=y + CONFIG_RFS_ACCEL=y + CONFIG_XPS=y +@@ -1403,7 +1400,6 @@ CONFIG_BT_CMTP=m + CONFIG_BT_HIDP=y + CONFIG_BT_HS=y + CONFIG_BT_LE=y +-# CONFIG_BT_SELFTEST is not set + # CONFIG_BT_DEBUGFS is not set + + # +@@ -1523,8 +1519,6 @@ CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y + CONFIG_WANT_DEV_COREDUMP=y + CONFIG_ALLOW_DEV_COREDUMP=y + CONFIG_DEV_COREDUMP=y +-# CONFIG_DEBUG_DRIVER is not set +-# CONFIG_DEBUG_DEVRES is not set + # CONFIG_SYS_HYPERVISOR is not set + # CONFIG_GENERIC_CPU_DEVICES is not set + CONFIG_SOC_BUS=y +@@ -2043,9 +2037,9 @@ CONFIG_DM_VERITY=m + # CONFIG_FIREWIRE is not set + # CONFIG_FIREWIRE_NOSY is not set + CONFIG_NETDEVICES=y +-CONFIG_MII=y ++CONFIG_MII=m + CONFIG_NET_CORE=y +-CONFIG_BONDING=y ++CONFIG_BONDING=m + CONFIG_DUMMY=m + CONFIG_EQUALIZER=m + # CONFIG_NET_FC is not set +@@ -2070,6 +2064,7 @@ CONFIG_TUN=m + CONFIG_VETH=m + # CONFIG_VIRTIO_NET is not set + CONFIG_NLMON=m ++# CONFIG_NET_VRF is not set + # CONFIG_ARCNET is not set + + # +@@ -2096,7 +2091,7 @@ CONFIG_NET_DSA_MV88E6XXX=y + CONFIG_NET_DSA_MV88E6352=y + # CONFIG_NET_DSA_BCM_SF2 is not set + CONFIG_ETHERNET=y +-CONFIG_MDIO=y ++CONFIG_MDIO=m + # CONFIG_NET_VENDOR_3COM is not set + # CONFIG_NET_VENDOR_ADAPTEC is not set + # CONFIG_NET_VENDOR_AGERE is not set +@@ -2105,11 +2100,11 @@ CONFIG_MDIO=y + # CONFIG_NET_VENDOR_AMD is not set + # CONFIG_NET_VENDOR_ARC is not set + CONFIG_NET_VENDOR_ATHEROS=y +-CONFIG_ATL2=y +-CONFIG_ATL1=y +-CONFIG_ATL1E=y +-CONFIG_ATL1C=y +-CONFIG_ALX=y ++CONFIG_ATL2=m ++CONFIG_ATL1=m ++CONFIG_ATL1E=m ++CONFIG_ATL1C=m ++CONFIG_ALX=m + # CONFIG_NET_VENDOR_AURORA is not set + # CONFIG_NET_CADENCE is not set + # CONFIG_NET_VENDOR_BROADCOM is not set +@@ -2129,7 +2124,7 @@ CONFIG_ALX=y + CONFIG_NET_VENDOR_FREESCALE=y + CONFIG_FEC=y + CONFIG_FSL_PQ_MDIO=y +-CONFIG_FSL_XGMAC_MDIO=y ++# CONFIG_FSL_XGMAC_MDIO is not set + CONFIG_GIANFAR=y + # CONFIG_NET_VENDOR_HISILICON is not set + # CONFIG_NET_VENDOR_HP is not set +@@ -2279,6 +2274,7 @@ CONFIG_USB_NET_KALMIA=m + CONFIG_USB_NET_QMI_WWAN=m + CONFIG_USB_HSO=m + CONFIG_USB_NET_INT51X1=m ++# CONFIG_USB_CDC_PHONET is not set + CONFIG_USB_IPHETH=m + CONFIG_USB_SIERRA_NET=m + CONFIG_USB_VL600=m +@@ -2471,24 +2467,9 @@ CONFIG_RT2X00_LIB_LEDS=y + # CONFIG_RT2X00_DEBUG is not set + CONFIG_WL_MEDIATEK=y + CONFIG_MT7601U=m +-CONFIG_RTL_CARDS=m +-CONFIG_RTL8192CE=m +-CONFIG_RTL8192SE=m +-CONFIG_RTL8192DE=m +-CONFIG_RTL8723AE=m +-CONFIG_RTL8723BE=m +-CONFIG_RTL8188EE=m +-CONFIG_RTL8192EE=m +-CONFIG_RTL8821AE=m ++CONFIG_RTL8XXXU=m ++CONFIG_RTL8XXXU_UNTESTED=y + CONFIG_RTL8192CU=m +-CONFIG_RTLWIFI=m +-CONFIG_RTLWIFI_PCI=m +-CONFIG_RTLWIFI_USB=m +-CONFIG_RTLWIFI_DEBUG=y +-CONFIG_RTL8192C_COMMON=m +-CONFIG_RTL8723_COMMON=m +-CONFIG_RTLBTCOEXIST=m +-# CONFIG_RTL8XXXU is not set + CONFIG_WL_TI=y + CONFIG_WL1251=m + CONFIG_WL1251_SPI=m +@@ -2619,6 +2600,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 + CONFIG_INPUT_JOYDEV=m + CONFIG_INPUT_EVDEV=y + CONFIG_INPUT_EVBUG=m ++# CONFIG_INPUT_APMPOWER is not set + + # + # Input Device Drivers +@@ -3007,7 +2989,6 @@ CONFIG_I2C_SLAVE_EEPROM=m + # CONFIG_I2C_DEBUG_ALGO is not set + # CONFIG_I2C_DEBUG_BUS is not set + CONFIG_SPI=y +-# CONFIG_SPI_DEBUG is not set + CONFIG_SPI_MASTER=y + + # +@@ -3016,8 +2997,8 @@ CONFIG_SPI_MASTER=y + # CONFIG_SPI_ALTERA is not set + CONFIG_SPI_BITBANG=y + # CONFIG_SPI_CADENCE is not set +-CONFIG_SPI_GPIO=y +-CONFIG_SPI_IMX=m ++# CONFIG_SPI_GPIO is not set ++CONFIG_SPI_IMX=y + # CONFIG_SPI_FSL_SPI is not set + # CONFIG_SPI_OC_TINY is not set + CONFIG_SPI_ORION=m +@@ -3043,13 +3024,14 @@ CONFIG_SPI_SPIDEV=y + # + CONFIG_PPS=y + # CONFIG_PPS_DEBUG is not set ++CONFIG_NTP_PPS=y + + # + # PPS clients support + # + # CONFIG_PPS_CLIENT_KTIMER is not set +-CONFIG_PPS_CLIENT_LDISC=m +-CONFIG_PPS_CLIENT_GPIO=m ++CONFIG_PPS_CLIENT_LDISC=y ++CONFIG_PPS_CLIENT_GPIO=y + + # + # PPS generators support +@@ -3060,10 +3042,7 @@ CONFIG_PPS_CLIENT_GPIO=m + # + CONFIG_PTP_1588_CLOCK=y + CONFIG_PTP_1588_CLOCK_GIANFAR=y +- +-# +-# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. +-# ++# CONFIG_DP83640_PHY is not set + CONFIG_PINCTRL=y + + # +@@ -3072,7 +3051,6 @@ CONFIG_PINCTRL=y + CONFIG_PINMUX=y + CONFIG_PINCONF=y + CONFIG_GENERIC_PINCONF=y +-# CONFIG_DEBUG_PINCTRL is not set + # CONFIG_PINCTRL_AMD is not set + CONFIG_PINCTRL_SINGLE=y + CONFIG_PINCTRL_IMX=y +@@ -3087,7 +3065,6 @@ CONFIG_GPIOLIB=y + CONFIG_GPIO_DEVRES=y + CONFIG_OF_GPIO=y + CONFIG_GPIOLIB_IRQCHIP=y +-# CONFIG_DEBUG_GPIO is not set + CONFIG_GPIO_SYSFS=y + CONFIG_GPIO_GENERIC=y + +@@ -3101,6 +3078,7 @@ CONFIG_GPIO_74XX_MMIO=y + CONFIG_GPIO_GENERIC_PLATFORM=y + # CONFIG_GPIO_GRGPIO is not set + CONFIG_GPIO_MVEBU=y ++CONFIG_GPIO_MVEBU_PWM=y + CONFIG_GPIO_MXC=y + CONFIG_GPIO_SYSCON=y + # CONFIG_GPIO_VX855 is not set +@@ -3181,6 +3159,7 @@ CONFIG_W1_SLAVE_BQ27000=m + CONFIG_POWER_SUPPLY=y + # CONFIG_POWER_SUPPLY_DEBUG is not set + # CONFIG_PDA_POWER is not set ++# CONFIG_APM_POWER is not set + # CONFIG_GENERIC_ADC_BATTERY is not set + CONFIG_TEST_POWER=m + # CONFIG_BATTERY_88PM860X is not set +@@ -4830,7 +4809,7 @@ CONFIG_USB_XHCI_MVEBU=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_EHCI_ROOT_HUB_TT=y + CONFIG_USB_EHCI_TT_NEWSCHED=y +-CONFIG_USB_FSL_MPH_DR_OF=m ++CONFIG_USB_FSL_MPH_DR_OF=y + CONFIG_USB_EHCI_PCI=y + CONFIG_USB_EHCI_MXC=y + CONFIG_USB_EHCI_HCD_ORION=y +@@ -5044,7 +5023,6 @@ CONFIG_USB_ISP1301=y + CONFIG_USB_MXS_PHY=y + # CONFIG_USB_ULPI is not set + CONFIG_USB_GADGET=y +-# CONFIG_USB_GADGET_DEBUG is not set + # CONFIG_USB_GADGET_DEBUG_FILES is not set + # CONFIG_USB_GADGET_DEBUG_FS is not set + CONFIG_USB_GADGET_VBUS_DRAW=2 +@@ -5053,7 +5031,7 @@ CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 + # + # USB Peripheral Controller + # +-CONFIG_USB_FSL_USB2=m ++CONFIG_USB_FSL_USB2=y + # CONFIG_USB_FUSB300 is not set + # CONFIG_USB_FOTG210_UDC is not set + # CONFIG_USB_GR_UDC is not set +@@ -5099,6 +5077,7 @@ CONFIG_USB_CONFIGFS_ECM=y + CONFIG_USB_CONFIGFS_ECM_SUBSET=y + CONFIG_USB_CONFIGFS_RNDIS=y + CONFIG_USB_CONFIGFS_EEM=y ++# CONFIG_USB_CONFIGFS_PHONET is not set + CONFIG_USB_CONFIGFS_MASS_STORAGE=y + CONFIG_USB_CONFIGFS_F_LB_SS=y + CONFIG_USB_CONFIGFS_F_FS=y +@@ -5126,6 +5105,7 @@ CONFIG_USB_G_SERIAL=m + CONFIG_USB_MIDI_GADGET=m + CONFIG_USB_G_PRINTER=m + CONFIG_USB_CDC_COMPOSITE=m ++# CONFIG_USB_G_NOKIA is not set + CONFIG_USB_G_ACM_MS=m + CONFIG_USB_G_MULTI=m + CONFIG_USB_G_MULTI_RNDIS=y +@@ -5531,11 +5511,14 @@ CONFIG_DVB_MN88473=m + CONFIG_LIRC_STAGING=y + CONFIG_LIRC_BT829=m + CONFIG_LIRC_IMON=m ++CONFIG_LIRC_HB=m ++CONFIG_LIRC_XBOX=m + CONFIG_LIRC_SASEM=m + CONFIG_LIRC_SERIAL=m + CONFIG_LIRC_SERIAL_TRANSMITTER=y + CONFIG_LIRC_SIR=m + CONFIG_LIRC_ZILOG=m ++CONFIG_LIRC_ATIUSB=m + + # + # Android +@@ -6177,7 +6160,6 @@ CONFIG_NFSD_V3=y + CONFIG_NFSD_V3_ACL=y + CONFIG_NFSD_V4=y + # CONFIG_NFSD_PNFS is not set +-# CONFIG_NFSD_FAULT_INJECTION is not set + CONFIG_GRACE_PERIOD=y + CONFIG_LOCKD=y + CONFIG_LOCKD_V4=y +@@ -6274,83 +6256,47 @@ CONFIG_DLM=m + # + CONFIG_PRINTK_TIME=y + CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 +-# CONFIG_BOOT_PRINTK_DELAY is not set + CONFIG_DYNAMIC_DEBUG=y + + # + # Compile-time checks and compiler options + # +-# CONFIG_DEBUG_INFO is not set + CONFIG_ENABLE_WARN_DEPRECATED=y + CONFIG_ENABLE_MUST_CHECK=y + CONFIG_FRAME_WARN=1024 + CONFIG_STRIP_ASM_SYMS=y +-# CONFIG_READABLE_ASM is not set + # CONFIG_UNUSED_SYMBOLS is not set +-# CONFIG_PAGE_OWNER is not set + CONFIG_DEBUG_FS=y + # CONFIG_HEADERS_CHECK is not set + # CONFIG_DEBUG_SECTION_MISMATCH is not set + CONFIG_SECTION_MISMATCH_WARN_ONLY=y + CONFIG_FRAME_POINTER=y +-# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set + CONFIG_MAGIC_SYSRQ=y + CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1 +-CONFIG_DEBUG_KERNEL=y ++# CONFIG_DEBUG_KERNEL is not set + + # + # Memory Debugging + # + # CONFIG_PAGE_EXTENSION is not set +-# CONFIG_DEBUG_PAGEALLOC is not set +-# CONFIG_DEBUG_OBJECTS is not set + # CONFIG_SLUB_STATS is not set + CONFIG_HAVE_DEBUG_KMEMLEAK=y +-# CONFIG_DEBUG_KMEMLEAK is not set +-# CONFIG_DEBUG_STACK_USAGE is not set +-# CONFIG_DEBUG_VM is not set + # CONFIG_DEBUG_MEMORY_INIT is not set +-# CONFIG_DEBUG_PER_CPU_MAPS is not set +-# CONFIG_DEBUG_HIGHMEM is not set +-# CONFIG_DEBUG_SHIRQ is not set + + # + # Debug Lockups and Hangs + # +-# CONFIG_LOCKUP_DETECTOR is not set +-# CONFIG_DETECT_HUNG_TASK is not set + CONFIG_PANIC_ON_OOPS=y + CONFIG_PANIC_ON_OOPS_VALUE=1 + CONFIG_PANIC_TIMEOUT=1 +-# CONFIG_SCHED_DEBUG is not set + # CONFIG_SCHED_INFO is not set +-# CONFIG_SCHEDSTATS is not set +-# CONFIG_SCHED_STACK_END_CHECK is not set + # CONFIG_DEBUG_TIMEKEEPING is not set +-CONFIG_TIMER_STATS=y +-# CONFIG_DEBUG_PREEMPT is not set + + # + # Lock Debugging (spinlocks, mutexes, etc...) + # +-# CONFIG_DEBUG_RT_MUTEXES is not set +-# CONFIG_DEBUG_SPINLOCK is not set +-# CONFIG_DEBUG_MUTEXES is not set +-# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set +-# CONFIG_DEBUG_LOCK_ALLOC is not set +-# CONFIG_PROVE_LOCKING is not set +-# CONFIG_LOCK_STAT is not set +-# CONFIG_DEBUG_ATOMIC_SLEEP is not set +-# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +-# CONFIG_LOCK_TORTURE_TEST is not set + CONFIG_STACKTRACE=y +-# CONFIG_DEBUG_KOBJECT is not set +-# CONFIG_DEBUG_BUGVERBOSE is not set +-# CONFIG_DEBUG_LIST is not set +-# CONFIG_DEBUG_PI_LIST is not set +-# CONFIG_DEBUG_SG is not set +-# CONFIG_DEBUG_NOTIFIERS is not set +-# CONFIG_DEBUG_CREDENTIALS is not set ++CONFIG_DEBUG_BUGVERBOSE=y + + # + # RCU Debugging +@@ -6358,13 +6304,7 @@ CONFIG_STACKTRACE=y + # CONFIG_PROVE_RCU is not set + # CONFIG_SPARSE_RCU_POINTER is not set + # CONFIG_TORTURE_TEST is not set +-# CONFIG_RCU_TORTURE_TEST is not set + CONFIG_RCU_CPU_STALL_TIMEOUT=21 +-# CONFIG_RCU_TRACE is not set +-# CONFIG_RCU_EQS_DEBUG is not set +-# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +-# CONFIG_NOTIFIER_ERROR_INJECTION is not set +-# CONFIG_FAULT_INJECTION is not set + CONFIG_NOP_TRACER=y + CONFIG_HAVE_FUNCTION_TRACER=y + CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +@@ -6409,11 +6349,6 @@ CONFIG_FTRACE_MCOUNT_RECORD=y + # Runtime Testing + # + # CONFIG_LKDTM is not set +-# CONFIG_TEST_LIST_SORT is not set +-# CONFIG_BACKTRACE_SELF_TEST is not set +-# CONFIG_RBTREE_TEST is not set +-# CONFIG_INTERVAL_TREE_TEST is not set +-# CONFIG_PERCPU_TEST is not set + # CONFIG_ATOMIC64_SELFTEST is not set + # CONFIG_ASYNC_RAID6_TEST is not set + # CONFIG_TEST_HEXDUMP is not set +@@ -6431,17 +6366,13 @@ CONFIG_FTRACE_MCOUNT_RECORD=y + # CONFIG_TEST_STATIC_KEYS is not set + # CONFIG_SAMPLES is not set + CONFIG_HAVE_ARCH_KGDB=y +-# CONFIG_KGDB is not set +-# CONFIG_ARM_PTDUMP is not set + # CONFIG_STRICT_DEVMEM is not set + CONFIG_ARM_UNWIND=y + CONFIG_OLD_MCOUNT=y + # CONFIG_DEBUG_USER is not set +-# CONFIG_DEBUG_LL is not set + CONFIG_DEBUG_IMX_UART_PORT=1 + CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" + # CONFIG_DEBUG_UART_8250 is not set +-# CONFIG_DEBUG_UART_BCM63XX is not set + CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" + # CONFIG_PID_IN_CONTEXTIDR is not set + # CONFIG_DEBUG_SET_MODULE_RONX is not set +-- +2.7.1 + + +From 8093d93a21db3d4cee9e4fe276e73990caac1e4b Mon Sep 17 00:00:00 2001 +From: Troy Kisky +Date: Mon, 8 Jun 2015 09:49:47 -0700 +Subject: [PATCH 011/384] fec: Russell Kings corruption fix + +(cherry picked from commit 43e7d29fd2c0df374a95341146991cc449c016b7) +Signed-off-by: Matus Kral +--- + drivers/net/ethernet/freescale/fec_main.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c +index d9f1ab3..55bab37 100644 +--- a/drivers/net/ethernet/freescale/fec_main.c ++++ b/drivers/net/ethernet/freescale/fec_main.c +@@ -1237,8 +1237,7 @@ fec_enet_tx_queue(struct net_device *ndev, u16 queue_id) + skb = txq->tx_skbuff[index]; + bdnum++; + } +- if (skb_shinfo(skb)->nr_frags && +- (status = bdp_t->cbd_sc) & BD_ENET_TX_READY) ++ if ((status = bdp_t->cbd_sc) & BD_ENET_TX_READY) + break; + + for (i = 0; i < bdnum; i++) { +-- +2.7.1 + + +From c748921827b0f31bae74eb72346cd859cbfa1439 Mon Sep 17 00:00:00 2001 +From: Christian Borntraeger +Date: Mon, 29 Feb 2016 15:59:18 +0100 +Subject: [PATCH 012/384] s390/cpumf: Fix lpp detection + +commit 7a76aa95f6f6682db5629449d763251d1c9f8c4e upstream. + +we have to check bit 40 of the facility list before issuing LPP +and not bit 48. Otherwise a guest running on a system with +"The decimal-floating-point zoned-conversion facility" and without +the "The set-program-parameters facility" might crash on an lpp +instruction. + +Signed-off-by: Christian Borntraeger +Fixes: e22cf8ca6f75 ("s390/cpumf: rework program parameter setting to detect guest samples") +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman +--- + arch/s390/kernel/head64.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S +index 58b719f..1ad2407 100644 +--- a/arch/s390/kernel/head64.S ++++ b/arch/s390/kernel/head64.S +@@ -16,7 +16,7 @@ + + __HEAD + ENTRY(startup_continue) +- tm __LC_STFL_FAC_LIST+6,0x80 # LPP available ? ++ tm __LC_STFL_FAC_LIST+5,0x80 # LPP available ? + jz 0f + xc __LC_LPP+1(7,0),__LC_LPP+1 # clear lpp and current_pid + mvi __LC_LPP,0x80 # and set LPP_MAGIC +-- +2.7.1 + + +From 6a959d0e733a54c448b44c5d7d3c12ff1c895fe8 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Fri, 20 Nov 2015 15:24:39 +0100 +Subject: [PATCH 013/384] regulator: core: avoid unused variable warning + +commit fa731ac7ea04a7d3a5c6d2f568132478c02a83b3 upstream. + +The second argument of the mutex_lock_nested() helper is only +evaluated if CONFIG_DEBUG_LOCK_ALLOC is set. Otherwise we +get this build warning for the new regulator_lock_supply +function: + +drivers/regulator/core.c: In function 'regulator_lock_supply': +drivers/regulator/core.c:142:6: warning: unused variable 'i' [-Wunused-variable] + +To avoid the warning, this restructures the code to make it +both simpler and to move the 'i++' outside of the mutex_lock_nested +call, where it is now always used and the variable is not +flagged as unused. + +We had some discussion about changing mutex_lock_nested to an +inline function, which would make the code do the right thing here, +but in the end decided against it, in order to guarantee that +mutex_lock_nested() does not introduced overhead without +CONFIG_DEBUG_LOCK_ALLOC. + +Signed-off-by: Arnd Bergmann +Fixes: 9f01cd4a915 ("regulator: core: introduce function to lock regulators and its supplies") +Link: http://permalink.gmane.org/gmane.linux.kernel/2068900 +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/regulator/core.c | 14 +++----------- + 1 file changed, 3 insertions(+), 11 deletions(-) + +diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c +index 73b7683..c70017d 100644 +--- a/drivers/regulator/core.c ++++ b/drivers/regulator/core.c +@@ -138,18 +138,10 @@ static bool have_full_constraints(void) + */ + static void regulator_lock_supply(struct regulator_dev *rdev) + { +- struct regulator *supply; +- int i = 0; +- +- while (1) { +- mutex_lock_nested(&rdev->mutex, i++); +- supply = rdev->supply; +- +- if (!rdev->supply) +- return; ++ int i; + +- rdev = supply->rdev; +- } ++ for (i = 0; rdev->supply; rdev = rdev->supply->rdev, i++) ++ mutex_lock_nested(&rdev->mutex, i); + } + + /** +-- +2.7.1 + + +From 224d355648e19d1a469f452f546fa191043d0743 Mon Sep 17 00:00:00 2001 +From: Thierry Reding +Date: Wed, 2 Dec 2015 16:54:50 +0100 +Subject: [PATCH 014/384] regulator: core: Fix nested locking of supplies + +commit 70a7fb80e85ae7f78f8e90cec3fbd862ea6a4d4b upstream. + +Commit fa731ac7ea04 ("regulator: core: avoid unused variable warning") +introduced a subtle change in how supplies are locked. Where previously +code was always locking the regulator of the current iteration, the new +implementation only locks the regulator if it has a supply. For any +given power tree that means that the root will never get locked. + +On the other hand the regulator_unlock_supply() will still release all +the locks, which in turn causes the lock debugging code to warn about a +mutex being unlocked which wasn't locked. + +Cc: Mark Brown +Cc: Arnd Bergmann +Fixes: Fixes: fa731ac7ea04 ("regulator: core: avoid unused variable warning") +Signed-off-by: Thierry Reding +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/regulator/core.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c +index c70017d..7b94b8e 100644 +--- a/drivers/regulator/core.c ++++ b/drivers/regulator/core.c +@@ -132,6 +132,14 @@ static bool have_full_constraints(void) + return has_full_constraints || of_have_populated_dt(); + } + ++static inline struct regulator_dev *rdev_get_supply(struct regulator_dev *rdev) ++{ ++ if (rdev && rdev->supply) ++ return rdev->supply->rdev; ++ ++ return NULL; ++} ++ + /** + * regulator_lock_supply - lock a regulator and its supplies + * @rdev: regulator source +@@ -140,7 +148,7 @@ static void regulator_lock_supply(struct regulator_dev *rdev) + { + int i; + +- for (i = 0; rdev->supply; rdev = rdev->supply->rdev, i++) ++ for (i = 0; rdev->supply; rdev = rdev_get_supply(rdev), i++) + mutex_lock_nested(&rdev->mutex, i); + } + +-- +2.7.1 + + +From 6afc8537765c6eb1ec65a200a702f2fdfa4a0ea6 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Wed, 18 Nov 2015 15:25:23 +0100 +Subject: [PATCH 015/384] ASoC: samsung: pass DMA channels as pointers + +commit b9a1a743818ea3265abf98f9431623afa8c50c86 upstream. + +ARM64 allmodconfig produces a bunch of warnings when building the +samsung ASoC code: + +sound/soc/samsung/dmaengine.c: In function 'samsung_asoc_init_dma_data': +sound/soc/samsung/dmaengine.c:53:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] + playback_data->filter_data = (void *)playback->channel; +sound/soc/samsung/dmaengine.c:60:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] + capture_data->filter_data = (void *)capture->channel; + +We could easily shut up the warning by adding an intermediate cast, +but there is a bigger underlying problem: The use of IORESOURCE_DMA +to pass data from platform code to device drivers is dubious to start +with, as what we really want is a pointer that can be passed into +a filter function. + +Note that on s3c64xx, the pl08x DMA data is already a pointer, but +gets cast to resource_size_t so we can pass it as a resource, and it +then gets converted back to a pointer. In contrast, the data we pass +for s3c24xx is an index into a device specific table, and we artificially +convert that into a pointer for the filter function. + +Signed-off-by: Arnd Bergmann +Reviewed-by: Krzysztof Kozlowski +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/mach-s3c64xx/dev-audio.c | 41 ++++++++++++++----------- + arch/arm/mach-s3c64xx/include/mach/dma.h | 52 ++++++++++++++++---------------- + arch/arm/plat-samsung/devs.c | 11 +++++-- + include/linux/platform_data/asoc-s3c.h | 4 +++ + sound/soc/samsung/ac97.c | 26 +++------------- + sound/soc/samsung/dma.h | 2 +- + sound/soc/samsung/dmaengine.c | 4 +-- + sound/soc/samsung/i2s.c | 26 +++------------- + sound/soc/samsung/pcm.c | 20 +++--------- + sound/soc/samsung/s3c2412-i2s.c | 4 +-- + sound/soc/samsung/s3c24xx-i2s.c | 4 +-- + sound/soc/samsung/spdif.c | 10 ++---- + 12 files changed, 84 insertions(+), 120 deletions(-) + +diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c +index ff780a8..9a42736 100644 +--- a/arch/arm/mach-s3c64xx/dev-audio.c ++++ b/arch/arm/mach-s3c64xx/dev-audio.c +@@ -54,12 +54,12 @@ static int s3c64xx_i2s_cfg_gpio(struct platform_device *pdev) + + static struct resource s3c64xx_iis0_resource[] = { + [0] = DEFINE_RES_MEM(S3C64XX_PA_IIS0, SZ_256), +- [1] = DEFINE_RES_DMA(DMACH_I2S0_OUT), +- [2] = DEFINE_RES_DMA(DMACH_I2S0_IN), + }; + +-static struct s3c_audio_pdata i2sv3_pdata = { ++static struct s3c_audio_pdata i2s0_pdata = { + .cfg_gpio = s3c64xx_i2s_cfg_gpio, ++ .dma_playback = DMACH_I2S0_OUT, ++ .dma_capture = DMACH_I2S0_IN, + }; + + struct platform_device s3c64xx_device_iis0 = { +@@ -68,15 +68,19 @@ struct platform_device s3c64xx_device_iis0 = { + .num_resources = ARRAY_SIZE(s3c64xx_iis0_resource), + .resource = s3c64xx_iis0_resource, + .dev = { +- .platform_data = &i2sv3_pdata, ++ .platform_data = &i2s0_pdata, + }, + }; + EXPORT_SYMBOL(s3c64xx_device_iis0); + + static struct resource s3c64xx_iis1_resource[] = { + [0] = DEFINE_RES_MEM(S3C64XX_PA_IIS1, SZ_256), +- [1] = DEFINE_RES_DMA(DMACH_I2S1_OUT), +- [2] = DEFINE_RES_DMA(DMACH_I2S1_IN), ++}; ++ ++static struct s3c_audio_pdata i2s1_pdata = { ++ .cfg_gpio = s3c64xx_i2s_cfg_gpio, ++ .dma_playback = DMACH_I2S1_OUT, ++ .dma_capture = DMACH_I2S1_IN, + }; + + struct platform_device s3c64xx_device_iis1 = { +@@ -85,19 +89,19 @@ struct platform_device s3c64xx_device_iis1 = { + .num_resources = ARRAY_SIZE(s3c64xx_iis1_resource), + .resource = s3c64xx_iis1_resource, + .dev = { +- .platform_data = &i2sv3_pdata, ++ .platform_data = &i2s1_pdata, + }, + }; + EXPORT_SYMBOL(s3c64xx_device_iis1); + + static struct resource s3c64xx_iisv4_resource[] = { + [0] = DEFINE_RES_MEM(S3C64XX_PA_IISV4, SZ_256), +- [1] = DEFINE_RES_DMA(DMACH_HSI_I2SV40_TX), +- [2] = DEFINE_RES_DMA(DMACH_HSI_I2SV40_RX), + }; + + static struct s3c_audio_pdata i2sv4_pdata = { + .cfg_gpio = s3c64xx_i2s_cfg_gpio, ++ .dma_playback = DMACH_HSI_I2SV40_TX, ++ .dma_capture = DMACH_HSI_I2SV40_RX, + .type = { + .i2s = { + .quirks = QUIRK_PRI_6CHAN, +@@ -142,12 +146,12 @@ static int s3c64xx_pcm_cfg_gpio(struct platform_device *pdev) + + static struct resource s3c64xx_pcm0_resource[] = { + [0] = DEFINE_RES_MEM(S3C64XX_PA_PCM0, SZ_256), +- [1] = DEFINE_RES_DMA(DMACH_PCM0_TX), +- [2] = DEFINE_RES_DMA(DMACH_PCM0_RX), + }; + + static struct s3c_audio_pdata s3c_pcm0_pdata = { + .cfg_gpio = s3c64xx_pcm_cfg_gpio, ++ .dma_capture = DMACH_PCM0_RX, ++ .dma_playback = DMACH_PCM0_TX, + }; + + struct platform_device s3c64xx_device_pcm0 = { +@@ -163,12 +167,12 @@ EXPORT_SYMBOL(s3c64xx_device_pcm0); + + static struct resource s3c64xx_pcm1_resource[] = { + [0] = DEFINE_RES_MEM(S3C64XX_PA_PCM1, SZ_256), +- [1] = DEFINE_RES_DMA(DMACH_PCM1_TX), +- [2] = DEFINE_RES_DMA(DMACH_PCM1_RX), + }; + + static struct s3c_audio_pdata s3c_pcm1_pdata = { + .cfg_gpio = s3c64xx_pcm_cfg_gpio, ++ .dma_playback = DMACH_PCM1_TX, ++ .dma_capture = DMACH_PCM1_RX, + }; + + struct platform_device s3c64xx_device_pcm1 = { +@@ -196,13 +200,14 @@ static int s3c64xx_ac97_cfg_gpe(struct platform_device *pdev) + + static struct resource s3c64xx_ac97_resource[] = { + [0] = DEFINE_RES_MEM(S3C64XX_PA_AC97, SZ_256), +- [1] = DEFINE_RES_DMA(DMACH_AC97_PCMOUT), +- [2] = DEFINE_RES_DMA(DMACH_AC97_PCMIN), +- [3] = DEFINE_RES_DMA(DMACH_AC97_MICIN), +- [4] = DEFINE_RES_IRQ(IRQ_AC97), ++ [1] = DEFINE_RES_IRQ(IRQ_AC97), + }; + +-static struct s3c_audio_pdata s3c_ac97_pdata; ++static struct s3c_audio_pdata s3c_ac97_pdata = { ++ .dma_playback = DMACH_AC97_PCMOUT, ++ .dma_capture = DMACH_AC97_PCMIN, ++ .dma_capture_mic = DMACH_AC97_MICIN, ++}; + + static u64 s3c64xx_ac97_dmamask = DMA_BIT_MASK(32); + +diff --git a/arch/arm/mach-s3c64xx/include/mach/dma.h b/arch/arm/mach-s3c64xx/include/mach/dma.h +index 096e140..9c739ea 100644 +--- a/arch/arm/mach-s3c64xx/include/mach/dma.h ++++ b/arch/arm/mach-s3c64xx/include/mach/dma.h +@@ -14,38 +14,38 @@ + #define S3C64XX_DMA_CHAN(name) ((unsigned long)(name)) + + /* DMA0/SDMA0 */ +-#define DMACH_UART0 S3C64XX_DMA_CHAN("uart0_tx") +-#define DMACH_UART0_SRC2 S3C64XX_DMA_CHAN("uart0_rx") +-#define DMACH_UART1 S3C64XX_DMA_CHAN("uart1_tx") +-#define DMACH_UART1_SRC2 S3C64XX_DMA_CHAN("uart1_rx") +-#define DMACH_UART2 S3C64XX_DMA_CHAN("uart2_tx") +-#define DMACH_UART2_SRC2 S3C64XX_DMA_CHAN("uart2_rx") +-#define DMACH_UART3 S3C64XX_DMA_CHAN("uart3_tx") +-#define DMACH_UART3_SRC2 S3C64XX_DMA_CHAN("uart3_rx") +-#define DMACH_PCM0_TX S3C64XX_DMA_CHAN("pcm0_tx") +-#define DMACH_PCM0_RX S3C64XX_DMA_CHAN("pcm0_rx") +-#define DMACH_I2S0_OUT S3C64XX_DMA_CHAN("i2s0_tx") +-#define DMACH_I2S0_IN S3C64XX_DMA_CHAN("i2s0_rx") ++#define DMACH_UART0 "uart0_tx" ++#define DMACH_UART0_SRC2 "uart0_rx" ++#define DMACH_UART1 "uart1_tx" ++#define DMACH_UART1_SRC2 "uart1_rx" ++#define DMACH_UART2 "uart2_tx" ++#define DMACH_UART2_SRC2 "uart2_rx" ++#define DMACH_UART3 "uart3_tx" ++#define DMACH_UART3_SRC2 "uart3_rx" ++#define DMACH_PCM0_TX "pcm0_tx" ++#define DMACH_PCM0_RX "pcm0_rx" ++#define DMACH_I2S0_OUT "i2s0_tx" ++#define DMACH_I2S0_IN "i2s0_rx" + #define DMACH_SPI0_TX S3C64XX_DMA_CHAN("spi0_tx") + #define DMACH_SPI0_RX S3C64XX_DMA_CHAN("spi0_rx") +-#define DMACH_HSI_I2SV40_TX S3C64XX_DMA_CHAN("i2s2_tx") +-#define DMACH_HSI_I2SV40_RX S3C64XX_DMA_CHAN("i2s2_rx") ++#define DMACH_HSI_I2SV40_TX "i2s2_tx" ++#define DMACH_HSI_I2SV40_RX "i2s2_rx" + + /* DMA1/SDMA1 */ +-#define DMACH_PCM1_TX S3C64XX_DMA_CHAN("pcm1_tx") +-#define DMACH_PCM1_RX S3C64XX_DMA_CHAN("pcm1_rx") +-#define DMACH_I2S1_OUT S3C64XX_DMA_CHAN("i2s1_tx") +-#define DMACH_I2S1_IN S3C64XX_DMA_CHAN("i2s1_rx") ++#define DMACH_PCM1_TX "pcm1_tx" ++#define DMACH_PCM1_RX "pcm1_rx" ++#define DMACH_I2S1_OUT "i2s1_tx" ++#define DMACH_I2S1_IN "i2s1_rx" + #define DMACH_SPI1_TX S3C64XX_DMA_CHAN("spi1_tx") + #define DMACH_SPI1_RX S3C64XX_DMA_CHAN("spi1_rx") +-#define DMACH_AC97_PCMOUT S3C64XX_DMA_CHAN("ac97_out") +-#define DMACH_AC97_PCMIN S3C64XX_DMA_CHAN("ac97_in") +-#define DMACH_AC97_MICIN S3C64XX_DMA_CHAN("ac97_mic") +-#define DMACH_PWM S3C64XX_DMA_CHAN("pwm") +-#define DMACH_IRDA S3C64XX_DMA_CHAN("irda") +-#define DMACH_EXTERNAL S3C64XX_DMA_CHAN("external") +-#define DMACH_SECURITY_RX S3C64XX_DMA_CHAN("sec_rx") +-#define DMACH_SECURITY_TX S3C64XX_DMA_CHAN("sec_tx") ++#define DMACH_AC97_PCMOUT "ac97_out" ++#define DMACH_AC97_PCMIN "ac97_in" ++#define DMACH_AC97_MICIN "ac97_mic" ++#define DMACH_PWM "pwm" ++#define DMACH_IRDA "irda" ++#define DMACH_EXTERNAL "external" ++#define DMACH_SECURITY_RX "sec_rx" ++#define DMACH_SECURITY_TX "sec_tx" + + enum dma_ch { + DMACH_MAX = 32 +diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c +index 8207462..e212f9d 100644 +--- a/arch/arm/plat-samsung/devs.c ++++ b/arch/arm/plat-samsung/devs.c +@@ -65,6 +65,7 @@ + #include + #include + #include ++#include + #include + + static u64 samsung_device_dma_mask = DMA_BIT_MASK(32); +@@ -74,9 +75,12 @@ static u64 samsung_device_dma_mask = DMA_BIT_MASK(32); + static struct resource s3c_ac97_resource[] = { + [0] = DEFINE_RES_MEM(S3C2440_PA_AC97, S3C2440_SZ_AC97), + [1] = DEFINE_RES_IRQ(IRQ_S3C244X_AC97), +- [2] = DEFINE_RES_DMA_NAMED(DMACH_PCM_OUT, "PCM out"), +- [3] = DEFINE_RES_DMA_NAMED(DMACH_PCM_IN, "PCM in"), +- [4] = DEFINE_RES_DMA_NAMED(DMACH_MIC_IN, "Mic in"), ++}; ++ ++static struct s3c_audio_pdata s3c_ac97_pdata = { ++ .dma_playback = (void *)DMACH_PCM_OUT, ++ .dma_capture = (void *)DMACH_PCM_IN, ++ .dma_capture_mic = (void *)DMACH_MIC_IN, + }; + + struct platform_device s3c_device_ac97 = { +@@ -87,6 +91,7 @@ struct platform_device s3c_device_ac97 = { + .dev = { + .dma_mask = &samsung_device_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), ++ .platform_data = &s3c_ac97_pdata, + } + }; + #endif /* CONFIG_CPU_S3C2440 */ +diff --git a/include/linux/platform_data/asoc-s3c.h b/include/linux/platform_data/asoc-s3c.h +index 5e0bc77..33f88b4 100644 +--- a/include/linux/platform_data/asoc-s3c.h ++++ b/include/linux/platform_data/asoc-s3c.h +@@ -39,6 +39,10 @@ struct samsung_i2s { + */ + struct s3c_audio_pdata { + int (*cfg_gpio)(struct platform_device *); ++ void *dma_playback; ++ void *dma_capture; ++ void *dma_play_sec; ++ void *dma_capture_mic; + union { + struct samsung_i2s i2s; + } type; +diff --git a/sound/soc/samsung/ac97.c b/sound/soc/samsung/ac97.c +index e414550..9c52193 100644 +--- a/sound/soc/samsung/ac97.c ++++ b/sound/soc/samsung/ac97.c +@@ -324,7 +324,7 @@ static const struct snd_soc_component_driver s3c_ac97_component = { + + static int s3c_ac97_probe(struct platform_device *pdev) + { +- struct resource *mem_res, *dmatx_res, *dmarx_res, *dmamic_res, *irq_res; ++ struct resource *mem_res, *irq_res; + struct s3c_audio_pdata *ac97_pdata; + int ret; + +@@ -335,24 +335,6 @@ static int s3c_ac97_probe(struct platform_device *pdev) + } + + /* Check for availability of necessary resource */ +- dmatx_res = platform_get_resource(pdev, IORESOURCE_DMA, 0); +- if (!dmatx_res) { +- dev_err(&pdev->dev, "Unable to get AC97-TX dma resource\n"); +- return -ENXIO; +- } +- +- dmarx_res = platform_get_resource(pdev, IORESOURCE_DMA, 1); +- if (!dmarx_res) { +- dev_err(&pdev->dev, "Unable to get AC97-RX dma resource\n"); +- return -ENXIO; +- } +- +- dmamic_res = platform_get_resource(pdev, IORESOURCE_DMA, 2); +- if (!dmamic_res) { +- dev_err(&pdev->dev, "Unable to get AC97-MIC dma resource\n"); +- return -ENXIO; +- } +- + irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); + if (!irq_res) { + dev_err(&pdev->dev, "AC97 IRQ not provided!\n"); +@@ -364,11 +346,11 @@ static int s3c_ac97_probe(struct platform_device *pdev) + if (IS_ERR(s3c_ac97.regs)) + return PTR_ERR(s3c_ac97.regs); + +- s3c_ac97_pcm_out.channel = dmatx_res->start; ++ s3c_ac97_pcm_out.slave = ac97_pdata->dma_playback; + s3c_ac97_pcm_out.dma_addr = mem_res->start + S3C_AC97_PCM_DATA; +- s3c_ac97_pcm_in.channel = dmarx_res->start; ++ s3c_ac97_pcm_in.slave = ac97_pdata->dma_capture; + s3c_ac97_pcm_in.dma_addr = mem_res->start + S3C_AC97_PCM_DATA; +- s3c_ac97_mic_in.channel = dmamic_res->start; ++ s3c_ac97_mic_in.slave = ac97_pdata->dma_capture_mic; + s3c_ac97_mic_in.dma_addr = mem_res->start + S3C_AC97_MIC_DATA; + + init_completion(&s3c_ac97.done); +diff --git a/sound/soc/samsung/dma.h b/sound/soc/samsung/dma.h +index 0e85dcf..085ef30 100644 +--- a/sound/soc/samsung/dma.h ++++ b/sound/soc/samsung/dma.h +@@ -15,7 +15,7 @@ + #include + + struct s3c_dma_params { +- int channel; /* Channel ID */ ++ void *slave; /* Channel ID */ + dma_addr_t dma_addr; + int dma_size; /* Size of the DMA transfer */ + char *ch_name; +diff --git a/sound/soc/samsung/dmaengine.c b/sound/soc/samsung/dmaengine.c +index 506f5bf..727008d 100644 +--- a/sound/soc/samsung/dmaengine.c ++++ b/sound/soc/samsung/dmaengine.c +@@ -50,14 +50,14 @@ void samsung_asoc_init_dma_data(struct snd_soc_dai *dai, + + if (playback) { + playback_data = &playback->dma_data; +- playback_data->filter_data = (void *)playback->channel; ++ playback_data->filter_data = playback->slave; + playback_data->chan_name = playback->ch_name; + playback_data->addr = playback->dma_addr; + playback_data->addr_width = playback->dma_size; + } + if (capture) { + capture_data = &capture->dma_data; +- capture_data->filter_data = (void *)capture->channel; ++ capture_data->filter_data = capture->slave; + capture_data->chan_name = capture->ch_name; + capture_data->addr = capture->dma_addr; + capture_data->addr_width = capture->dma_size; +diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c +index 7dbf899..e163b01 100644 +--- a/sound/soc/samsung/i2s.c ++++ b/sound/soc/samsung/i2s.c +@@ -1260,27 +1260,14 @@ static int samsung_i2s_probe(struct platform_device *pdev) + pri_dai->lock = &pri_dai->spinlock; + + if (!np) { +- res = platform_get_resource(pdev, IORESOURCE_DMA, 0); +- if (!res) { +- dev_err(&pdev->dev, +- "Unable to get I2S-TX dma resource\n"); +- return -ENXIO; +- } +- pri_dai->dma_playback.channel = res->start; +- +- res = platform_get_resource(pdev, IORESOURCE_DMA, 1); +- if (!res) { +- dev_err(&pdev->dev, +- "Unable to get I2S-RX dma resource\n"); +- return -ENXIO; +- } +- pri_dai->dma_capture.channel = res->start; +- + if (i2s_pdata == NULL) { + dev_err(&pdev->dev, "Can't work without s3c_audio_pdata\n"); + return -EINVAL; + } + ++ pri_dai->dma_playback.slave = i2s_pdata->dma_playback; ++ pri_dai->dma_capture.slave = i2s_pdata->dma_capture; ++ + if (&i2s_pdata->type) + i2s_cfg = &i2s_pdata->type.i2s; + +@@ -1341,11 +1328,8 @@ static int samsung_i2s_probe(struct platform_device *pdev) + sec_dai->dma_playback.dma_addr = regs_base + I2STXDS; + sec_dai->dma_playback.ch_name = "tx-sec"; + +- if (!np) { +- res = platform_get_resource(pdev, IORESOURCE_DMA, 2); +- if (res) +- sec_dai->dma_playback.channel = res->start; +- } ++ if (!np) ++ sec_dai->dma_playback.slave = i2s_pdata->dma_play_sec; + + sec_dai->dma_playback.dma_size = 4; + sec_dai->addr = pri_dai->addr; +diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c +index b320a9d..c77f324 100644 +--- a/sound/soc/samsung/pcm.c ++++ b/sound/soc/samsung/pcm.c +@@ -486,7 +486,7 @@ static const struct snd_soc_component_driver s3c_pcm_component = { + static int s3c_pcm_dev_probe(struct platform_device *pdev) + { + struct s3c_pcm_info *pcm; +- struct resource *mem_res, *dmatx_res, *dmarx_res; ++ struct resource *mem_res; + struct s3c_audio_pdata *pcm_pdata; + int ret; + +@@ -499,18 +499,6 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev) + pcm_pdata = pdev->dev.platform_data; + + /* Check for availability of necessary resource */ +- dmatx_res = platform_get_resource(pdev, IORESOURCE_DMA, 0); +- if (!dmatx_res) { +- dev_err(&pdev->dev, "Unable to get PCM-TX dma resource\n"); +- return -ENXIO; +- } +- +- dmarx_res = platform_get_resource(pdev, IORESOURCE_DMA, 1); +- if (!dmarx_res) { +- dev_err(&pdev->dev, "Unable to get PCM-RX dma resource\n"); +- return -ENXIO; +- } +- + mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!mem_res) { + dev_err(&pdev->dev, "Unable to get register resource\n"); +@@ -568,8 +556,10 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev) + s3c_pcm_stereo_out[pdev->id].dma_addr = mem_res->start + + S3C_PCM_TXFIFO; + +- s3c_pcm_stereo_in[pdev->id].channel = dmarx_res->start; +- s3c_pcm_stereo_out[pdev->id].channel = dmatx_res->start; ++ if (pcm_pdata) { ++ s3c_pcm_stereo_in[pdev->id].slave = pcm_pdata->dma_capture; ++ s3c_pcm_stereo_out[pdev->id].slave = pcm_pdata->dma_playback; ++ } + + pcm->dma_capture = &s3c_pcm_stereo_in[pdev->id]; + pcm->dma_playback = &s3c_pcm_stereo_out[pdev->id]; +diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c +index 2b766d2..77d27c8 100644 +--- a/sound/soc/samsung/s3c2412-i2s.c ++++ b/sound/soc/samsung/s3c2412-i2s.c +@@ -34,13 +34,13 @@ + #include "s3c2412-i2s.h" + + static struct s3c_dma_params s3c2412_i2s_pcm_stereo_out = { +- .channel = DMACH_I2S_OUT, ++ .slave = (void *)(uintptr_t)DMACH_I2S_OUT, + .ch_name = "tx", + .dma_size = 4, + }; + + static struct s3c_dma_params s3c2412_i2s_pcm_stereo_in = { +- .channel = DMACH_I2S_IN, ++ .slave = (void *)(uintptr_t)DMACH_I2S_IN, + .ch_name = "rx", + .dma_size = 4, + }; +diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c +index 5bf7236..9da3a77 100644 +--- a/sound/soc/samsung/s3c24xx-i2s.c ++++ b/sound/soc/samsung/s3c24xx-i2s.c +@@ -32,13 +32,13 @@ + #include "s3c24xx-i2s.h" + + static struct s3c_dma_params s3c24xx_i2s_pcm_stereo_out = { +- .channel = DMACH_I2S_OUT, ++ .slave = (void *)(uintptr_t)DMACH_I2S_OUT, + .ch_name = "tx", + .dma_size = 2, + }; + + static struct s3c_dma_params s3c24xx_i2s_pcm_stereo_in = { +- .channel = DMACH_I2S_IN, ++ .slave = (void *)(uintptr_t)DMACH_I2S_IN, + .ch_name = "rx", + .dma_size = 2, + }; +diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c +index 36dbc0e9..9dd7ee6 100644 +--- a/sound/soc/samsung/spdif.c ++++ b/sound/soc/samsung/spdif.c +@@ -359,7 +359,7 @@ static const struct snd_soc_component_driver samsung_spdif_component = { + static int spdif_probe(struct platform_device *pdev) + { + struct s3c_audio_pdata *spdif_pdata; +- struct resource *mem_res, *dma_res; ++ struct resource *mem_res; + struct samsung_spdif_info *spdif; + int ret; + +@@ -367,12 +367,6 @@ static int spdif_probe(struct platform_device *pdev) + + dev_dbg(&pdev->dev, "Entered %s\n", __func__); + +- dma_res = platform_get_resource(pdev, IORESOURCE_DMA, 0); +- if (!dma_res) { +- dev_err(&pdev->dev, "Unable to get dma resource.\n"); +- return -ENXIO; +- } +- + mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!mem_res) { + dev_err(&pdev->dev, "Unable to get register resource.\n"); +@@ -432,7 +426,7 @@ static int spdif_probe(struct platform_device *pdev) + + spdif_stereo_out.dma_size = 2; + spdif_stereo_out.dma_addr = mem_res->start + DATA_OUTBUF; +- spdif_stereo_out.channel = dma_res->start; ++ spdif_stereo_out.slave = spdif_pdata ? spdif_pdata->dma_playback : NULL; + + spdif->dma_playback = &spdif_stereo_out; + +-- +2.7.1 + + +From ce490c0c3f2201aec2b49a5c1fd0c78600917b23 Mon Sep 17 00:00:00 2001 +From: Chris Paterson +Date: Wed, 10 Feb 2016 14:07:01 +0000 +Subject: [PATCH 016/384] mmc: sh_mmcif: Correct TX DMA channel allocation + +commit a32ef81c9889c9554a3c4b465c4ee7b2d26c6b10 upstream. + +Commit 27cbd7e815a8 ("mmc: sh_mmcif: rework dma channel handling") +introduced a typo causing the TX DMA channel allocation to be overwritten +by the requested RX DMA channel. + +Fixes: 27cbd7e815a8 ("mmc: sh_mmcif: rework dma channel handling") +Signed-off-by: Chris Paterson +Acked-by: Laurent Pinchart +Acked-by: Arnd Bergmann +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/host/sh_mmcif.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c +index 1ca8a13..6234eab3 100644 +--- a/drivers/mmc/host/sh_mmcif.c ++++ b/drivers/mmc/host/sh_mmcif.c +@@ -445,7 +445,7 @@ static void sh_mmcif_request_dma(struct sh_mmcif_host *host) + pdata->slave_id_rx); + } else { + host->chan_tx = dma_request_slave_channel(dev, "tx"); +- host->chan_tx = dma_request_slave_channel(dev, "rx"); ++ host->chan_rx = dma_request_slave_channel(dev, "rx"); + } + dev_dbg(dev, "%s: got channel TX %p RX %p\n", __func__, host->chan_tx, + host->chan_rx); +-- +2.7.1 + + +From 1448ebaaac887250b5c9575d75b641ddea60b63c Mon Sep 17 00:00:00 2001 +From: Borislav Petkov +Date: Wed, 3 Feb 2016 12:33:30 +0100 +Subject: [PATCH 017/384] x86/microcode/intel: Make early loader look for + builtin microcode too + +commit 264285ac01673e70557c43ecee338ce97c4c0672 upstream. + +Set the initrd @start depending on the presence of an initrd. Otherwise, +builtin microcode loading doesn't work as the start is wrong and we're +using it to compute offset to the microcode blobs. + +Tested-by: Thomas Voegtle +Signed-off-by: Borislav Petkov +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Link: http://lkml.kernel.org/r/1454499225-21544-3-git-send-email-bp@alien8.de +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kernel/cpu/microcode/intel.c | 24 ++++++++++++++++-------- + 1 file changed, 16 insertions(+), 8 deletions(-) + +diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c +index ce47402..5e3a310 100644 +--- a/arch/x86/kernel/cpu/microcode/intel.c ++++ b/arch/x86/kernel/cpu/microcode/intel.c +@@ -555,10 +555,14 @@ scan_microcode(struct mc_saved_data *mc_saved_data, unsigned long *initrd, + cd.data = NULL; + cd.size = 0; + +- cd = find_cpio_data(p, (void *)start, size, &offset); +- if (!cd.data) { ++ /* try built-in microcode if no initrd */ ++ if (!size) { + if (!load_builtin_intel_microcode(&cd)) + return UCODE_ERROR; ++ } else { ++ cd = find_cpio_data(p, (void *)start, size, &offset); ++ if (!cd.data) ++ return UCODE_ERROR; + } + + return get_matching_model_microcode(0, start, cd.data, cd.size, +@@ -732,16 +736,20 @@ void __init load_ucode_intel_bsp(void) + struct boot_params *p; + + p = (struct boot_params *)__pa_nodebug(&boot_params); +- start = p->hdr.ramdisk_image; + size = p->hdr.ramdisk_size; + +- _load_ucode_intel_bsp( +- (struct mc_saved_data *)__pa_nodebug(&mc_saved_data), +- (unsigned long *)__pa_nodebug(&mc_saved_in_initrd), +- start, size); ++ /* ++ * Set start only if we have an initrd image. We cannot use initrd_start ++ * because it is not set that early yet. ++ */ ++ start = (size ? p->hdr.ramdisk_image : 0); ++ ++ _load_ucode_intel_bsp((struct mc_saved_data *)__pa_nodebug(&mc_saved_data), ++ (unsigned long *)__pa_nodebug(&mc_saved_in_initrd), ++ start, size); + #else +- start = boot_params.hdr.ramdisk_image + PAGE_OFFSET; + size = boot_params.hdr.ramdisk_size; ++ start = (size ? boot_params.hdr.ramdisk_image + PAGE_OFFSET : 0); + + _load_ucode_intel_bsp(&mc_saved_data, mc_saved_in_initrd, start, size); + #endif +-- +2.7.1 + + +From b82bbe5f1d7c633e23a10792977cf427e8fbf2ed Mon Sep 17 00:00:00 2001 +From: Borislav Petkov +Date: Wed, 3 Feb 2016 12:33:29 +0100 +Subject: [PATCH 018/384] x86/microcode: Untangle from BLK_DEV_INITRD + +commit 5f9c01aa7c49a2d74474d6d879a797b8badf29e6 upstream. + +Thomas Voegtle reported that doing oldconfig with a .config which has +CONFIG_MICROCODE enabled but BLK_DEV_INITRD disabled prevents the +microcode loading mechanism from being built. + +So untangle it from the BLK_DEV_INITRD dependency so that oldconfig +doesn't turn it off and add an explanatory text to its Kconfig help what +the supported methods for supplying microcode are. + +Reported-by: Thomas Voegtle +Tested-by: Thomas Voegtle +Signed-off-by: Borislav Petkov +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Link: http://lkml.kernel.org/r/1454499225-21544-2-git-send-email-bp@alien8.de +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/Kconfig | 27 ++++++++++++++------------- + arch/x86/include/asm/microcode.h | 26 ++++++++++++++++++++++++++ + arch/x86/kernel/cpu/microcode/intel.c | 14 ++++---------- + 3 files changed, 44 insertions(+), 23 deletions(-) + +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig +index d8a1650..6ee1dd0 100644 +--- a/arch/x86/Kconfig ++++ b/arch/x86/Kconfig +@@ -1130,22 +1130,23 @@ config MICROCODE + bool "CPU microcode loading support" + default y + depends on CPU_SUP_AMD || CPU_SUP_INTEL +- depends on BLK_DEV_INITRD + select FW_LOADER + ---help--- +- + If you say Y here, you will be able to update the microcode on +- certain Intel and AMD processors. The Intel support is for the +- IA32 family, e.g. Pentium Pro, Pentium II, Pentium III, Pentium 4, +- Xeon etc. The AMD support is for families 0x10 and later. You will +- obviously need the actual microcode binary data itself which is not +- shipped with the Linux kernel. +- +- This option selects the general module only, you need to select +- at least one vendor specific module as well. +- +- To compile this driver as a module, choose M here: the module +- will be called microcode. ++ Intel and AMD processors. The Intel support is for the IA32 family, ++ e.g. Pentium Pro, Pentium II, Pentium III, Pentium 4, Xeon etc. The ++ AMD support is for families 0x10 and later. You will obviously need ++ the actual microcode binary data itself which is not shipped with ++ the Linux kernel. ++ ++ The preferred method to load microcode from a detached initrd is described ++ in Documentation/x86/early-microcode.txt. For that you need to enable ++ CONFIG_BLK_DEV_INITRD in order for the loader to be able to scan the ++ initrd for microcode blobs. ++ ++ In addition, you can build-in the microcode into the kernel. For that you ++ need to enable FIRMWARE_IN_KERNEL and add the vendor-supplied microcode ++ to the CONFIG_EXTRA_FIRMWARE config option. + + config MICROCODE_INTEL + bool "Intel microcode loading support" +diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h +index 34e62b1..712b24e 100644 +--- a/arch/x86/include/asm/microcode.h ++++ b/arch/x86/include/asm/microcode.h +@@ -2,6 +2,7 @@ + #define _ASM_X86_MICROCODE_H + + #include ++#include + + #define native_rdmsr(msr, val1, val2) \ + do { \ +@@ -168,4 +169,29 @@ static inline void reload_early_microcode(void) { } + static inline bool + get_builtin_firmware(struct cpio_data *cd, const char *name) { return false; } + #endif ++ ++static inline unsigned long get_initrd_start(void) ++{ ++#ifdef CONFIG_BLK_DEV_INITRD ++ return initrd_start; ++#else ++ return 0; ++#endif ++} ++ ++static inline unsigned long get_initrd_start_addr(void) ++{ ++#ifdef CONFIG_BLK_DEV_INITRD ++#ifdef CONFIG_X86_32 ++ unsigned long *initrd_start_p = (unsigned long *)__pa_nodebug(&initrd_start); ++ ++ return (unsigned long)__pa_nodebug(*initrd_start_p); ++#else ++ return get_initrd_start(); ++#endif ++#else /* CONFIG_BLK_DEV_INITRD */ ++ return 0; ++#endif ++} ++ + #endif /* _ASM_X86_MICROCODE_H */ +diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c +index 5e3a310..ac8975a 100644 +--- a/arch/x86/kernel/cpu/microcode/intel.c ++++ b/arch/x86/kernel/cpu/microcode/intel.c +@@ -698,7 +698,7 @@ int __init save_microcode_in_initrd_intel(void) + if (count == 0) + return ret; + +- copy_initrd_ptrs(mc_saved, mc_saved_in_initrd, initrd_start, count); ++ copy_initrd_ptrs(mc_saved, mc_saved_in_initrd, get_initrd_start(), count); + ret = save_microcode(&mc_saved_data, mc_saved, count); + if (ret) + pr_err("Cannot save microcode patches from initrd.\n"); +@@ -760,20 +760,14 @@ void load_ucode_intel_ap(void) + struct mc_saved_data *mc_saved_data_p; + struct ucode_cpu_info uci; + unsigned long *mc_saved_in_initrd_p; +- unsigned long initrd_start_addr; + enum ucode_state ret; + #ifdef CONFIG_X86_32 +- unsigned long *initrd_start_p; + +- mc_saved_in_initrd_p = +- (unsigned long *)__pa_nodebug(mc_saved_in_initrd); ++ mc_saved_in_initrd_p = (unsigned long *)__pa_nodebug(mc_saved_in_initrd); + mc_saved_data_p = (struct mc_saved_data *)__pa_nodebug(&mc_saved_data); +- initrd_start_p = (unsigned long *)__pa_nodebug(&initrd_start); +- initrd_start_addr = (unsigned long)__pa_nodebug(*initrd_start_p); + #else +- mc_saved_data_p = &mc_saved_data; + mc_saved_in_initrd_p = mc_saved_in_initrd; +- initrd_start_addr = initrd_start; ++ mc_saved_data_p = &mc_saved_data; + #endif + + /* +@@ -785,7 +779,7 @@ void load_ucode_intel_ap(void) + + collect_cpu_info_early(&uci); + ret = load_microcode(mc_saved_data_p, mc_saved_in_initrd_p, +- initrd_start_addr, &uci); ++ get_initrd_start_addr(), &uci); + + if (ret != UCODE_OK) + return; +-- +2.7.1 + + +From c19b5663cb746f9479e279c1579d6bd6d4284c2f Mon Sep 17 00:00:00 2001 +From: Andy Lutomirski +Date: Wed, 10 Feb 2016 14:15:27 -0800 +Subject: [PATCH 019/384] x86/entry/compat: Keep TS_COMPAT set during signal + delivery + +commit 4e79e182b419172e35936a47f098509092d69817 upstream. + +Signal delivery needs to know the sign of an interrupted syscall's +return value in order to detect -ERESTART variants. Normally this +works independently of bitness because syscalls internally return +long. Under ptrace, however, this can break, and syscall_get_error +is supposed to sign-extend regs->ax if needed. + +We were clearing TS_COMPAT too early, though, and this prevented +sign extension, which subtly broke syscall restart under ptrace. + +Reported-by: Robert O'Callahan +Signed-off-by: Andy Lutomirski +Cc: Al Viro +Cc: Andy Lutomirski +Cc: Borislav Petkov +Cc: Brian Gerst +Cc: Denys Vlasenko +Cc: H. Peter Anvin +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Shuah Khan +Cc: Thomas Gleixner +Fixes: c5c46f59e4e7 ("x86/entry: Add new, comprehensible entry and exit handlers written in C") +Link: http://lkml.kernel.org/r/cbce3cf545522f64eb37f5478cb59746230db3b5.1455142412.git.luto@kernel.org +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/entry/common.c | 23 +++++++++++++---------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c +index 3ec240f..75a301b 100644 +--- a/arch/x86/entry/common.c ++++ b/arch/x86/entry/common.c +@@ -275,6 +275,7 @@ static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) + /* Called with IRQs disabled. */ + __visible inline void prepare_exit_to_usermode(struct pt_regs *regs) + { ++ struct thread_info *ti = pt_regs_to_thread_info(regs); + u32 cached_flags; + + if (IS_ENABLED(CONFIG_PROVE_LOCKING) && WARN_ON(!irqs_disabled())) +@@ -282,12 +283,22 @@ __visible inline void prepare_exit_to_usermode(struct pt_regs *regs) + + lockdep_sys_exit(); + +- cached_flags = +- READ_ONCE(pt_regs_to_thread_info(regs)->flags); ++ cached_flags = READ_ONCE(ti->flags); + + if (unlikely(cached_flags & EXIT_TO_USERMODE_LOOP_FLAGS)) + exit_to_usermode_loop(regs, cached_flags); + ++#ifdef CONFIG_COMPAT ++ /* ++ * Compat syscalls set TS_COMPAT. Make sure we clear it before ++ * returning to user mode. We need to clear it *after* signal ++ * handling, because syscall restart has a fixup for compat ++ * syscalls. The fixup is exercised by the ptrace_syscall_32 ++ * selftest. ++ */ ++ ti->status &= ~TS_COMPAT; ++#endif ++ + user_enter(); + } + +@@ -339,14 +350,6 @@ __visible inline void syscall_return_slowpath(struct pt_regs *regs) + if (unlikely(cached_flags & SYSCALL_EXIT_WORK_FLAGS)) + syscall_slow_exit_work(regs, cached_flags); + +-#ifdef CONFIG_COMPAT +- /* +- * Compat syscalls set TS_COMPAT. Make sure we clear it before +- * returning to user mode. +- */ +- ti->status &= ~TS_COMPAT; +-#endif +- + local_irq_disable(); + prepare_exit_to_usermode(regs); + } +-- +2.7.1 + + +From 9c4bc8f53cf18002d04a566980311d2db54804b0 Mon Sep 17 00:00:00 2001 +From: Stephane Eranian +Date: Thu, 3 Mar 2016 20:50:40 +0100 +Subject: [PATCH 020/384] perf/x86/intel: Add definition for PT PMI bit + +commit 5690ae28e472d25e330ad0c637a5cea3fc39fb32 upstream. + +This patch adds a definition for GLOBAL_OVFL_STATUS bit 55 +which is used with the Processor Trace (PT) feature. + +Signed-off-by: Stephane Eranian +Signed-off-by: Peter Zijlstra (Intel) +Cc: Alexander Shishkin +Cc: Arnaldo Carvalho de Melo +Cc: Jiri Olsa +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Cc: Vince Weaver +Cc: adrian.hunter@intel.com +Cc: kan.liang@intel.com +Cc: namhyung@kernel.org +Link: http://lkml.kernel.org/r/1457034642-21837-2-git-send-email-eranian@google.com +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/include/asm/perf_event.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_event.h +index 7bcb861..5a2ed3e 100644 +--- a/arch/x86/include/asm/perf_event.h ++++ b/arch/x86/include/asm/perf_event.h +@@ -165,6 +165,7 @@ struct x86_pmu_capability { + #define GLOBAL_STATUS_ASIF BIT_ULL(60) + #define GLOBAL_STATUS_COUNTERS_FROZEN BIT_ULL(59) + #define GLOBAL_STATUS_LBRS_FROZEN BIT_ULL(58) ++#define GLOBAL_STATUS_TRACE_TOPAPMI BIT_ULL(55) + + /* + * IBS cpuid feature detection +-- +2.7.1 + + +From 35b95fd8fde053d4cda00f56dce89e449f36b44a Mon Sep 17 00:00:00 2001 +From: Bjorn Helgaas +Date: Fri, 26 Feb 2016 09:15:11 -0600 +Subject: [PATCH 021/384] x86/PCI: Mark Broadwell-EP Home Agent & PCU as having + non-compliant BARs + +commit b894157145e4ac7598d7062bc93320898a5e059e upstream. + +The Home Agent and PCU PCI devices in Broadwell-EP have a non-BAR register +where a BAR should be. We don't know what the side effects of sizing the +"BAR" would be, and we don't know what address space the "BAR" might appear +to describe. + +Mark these devices as having non-compliant BARs so the PCI core doesn't +touch them. + +Signed-off-by: Bjorn Helgaas +Tested-by: Andi Kleen +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/pci/fixup.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c +index e585655..0ae7e9f 100644 +--- a/arch/x86/pci/fixup.c ++++ b/arch/x86/pci/fixup.c +@@ -540,3 +540,10 @@ static void twinhead_reserve_killing_zone(struct pci_dev *dev) + } + } + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x27B9, twinhead_reserve_killing_zone); ++ ++static void pci_bdwep_bar(struct pci_dev *dev) ++{ ++ dev->non_compliant_bars = 1; ++} ++DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6fa0, pci_bdwep_bar); ++DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6fc0, pci_bdwep_bar); +-- +2.7.1 + + +From 4d7df7ca625ce1da03f72fd15ad44a9a3ef3849f Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Wed, 10 Feb 2016 17:50:23 +0100 +Subject: [PATCH 022/384] KVM: x86: fix missed hardware breakpoints + +commit 4e422bdd2f849d98fffccbc3295c2f0996097fb3 upstream. + +Sometimes when setting a breakpoint a process doesn't stop on it. +This is because the debug registers are not loaded correctly on +VCPU load. + +The following simple reproducer from Oleg Nesterov tries using debug +registers in both the host and the guest, for example by running "./bp +0 1" on the host and "./bp 14 15" under QEMU. + + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) + + unsigned long encode_dr7(int drnum, int enable, unsigned int type, unsigned int len) + { + unsigned long dr7; + + dr7 = ((len | type) & 0xf) + << (DR_CONTROL_SHIFT + drnum * DR_CONTROL_SIZE); + if (enable) + dr7 |= (DR_GLOBAL_ENABLE << (drnum * DR_ENABLE_SIZE)); + + return dr7; + } + + int write_dr(int pid, int dr, unsigned long val) + { + return ptrace(PTRACE_POKEUSER, pid, + offsetof (struct user, u_debugreg[dr]), + val); + } + + void set_bp(pid_t pid, void *addr) + { + unsigned long dr7; + assert(write_dr(pid, 0, (long)addr) == 0); + dr7 = encode_dr7(0, 1, DR_RW_EXECUTE, DR_LEN_1); + assert(write_dr(pid, 7, dr7) == 0); + } + + void *get_rip(int pid) + { + return (void*)ptrace(PTRACE_PEEKUSER, pid, + offsetof(struct user, regs.rip), 0); + } + + void test(int nr) + { + void *bp_addr = &&label + nr, *bp_hit; + int pid; + + printf("test bp %d\n", nr); + assert(nr < 16); // see 16 asm nops below + + pid = fork(); + if (!pid) { + assert(ptrace(PTRACE_TRACEME, 0,0,0) == 0); + kill(getpid(), SIGSTOP); + for (;;) { + label: asm ( + "nop; nop; nop; nop;" + "nop; nop; nop; nop;" + "nop; nop; nop; nop;" + "nop; nop; nop; nop;" + ); + } + } + + assert(pid == wait(NULL)); + set_bp(pid, bp_addr); + + for (;;) { + assert(ptrace(PTRACE_CONT, pid, 0, 0) == 0); + assert(pid == wait(NULL)); + + bp_hit = get_rip(pid); + if (bp_hit != bp_addr) + fprintf(stderr, "ERR!! hit wrong bp %ld != %d\n", + bp_hit - &&label, nr); + } + } + + int main(int argc, const char *argv[]) + { + while (--argc) { + int nr = atoi(*++argv); + if (!fork()) + test(nr); + } + + while (wait(NULL) > 0) + ; + return 0; + } + +Suggested-by: Nadadv Amit +Reported-by: Andrey Wagin +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kvm/x86.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c +index 27419ba..7ee7b76 100644 +--- a/arch/x86/kvm/x86.c ++++ b/arch/x86/kvm/x86.c +@@ -2736,6 +2736,7 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) + } + + kvm_make_request(KVM_REQ_STEAL_UPDATE, vcpu); ++ vcpu->arch.switch_db_regs |= KVM_DEBUGREG_RELOAD; + } + + void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) +-- +2.7.1 + + +From 3479e73ebeea1ab5a52e976d0cf43131262f20c3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= +Date: Wed, 2 Mar 2016 22:56:38 +0100 +Subject: [PATCH 023/384] KVM: i8254: change PIT discard tick policy +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit 7dd0fdff145c5be7146d0ac06732ae3613412ac1 upstream. + +Discard policy uses ack_notifiers to prevent injection of PIT interrupts +before EOI from the last one. + +This patch changes the policy to always try to deliver the interrupt, +which makes a difference when its vector is in ISR. +Old implementation would drop the interrupt, but proposed one injects to +IRR, like real hardware would. + +The old policy breaks legacy NMI watchdogs, where PIT is used through +virtual wire (LVT0): PIT never sends an interrupt before receiving EOI, +thus a guest deadlock with disabled interrupts will stop NMIs. + +Note that NMI doesn't do EOI, so PIT also had to send a normal interrupt +through IOAPIC. (KVM's PIT is deeply rotten and luckily not used much +in modern systems.) + +Even though there is a chance of regressions, I think we can fix the +LVT0 NMI bug without introducing a new tick policy. + +Reported-by: Yuki Shibuya +Reviewed-by: Paolo Bonzini +Signed-off-by: Radim Krčmář +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kvm/i8254.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c +index b0ea42b..ab531872 100644 +--- a/arch/x86/kvm/i8254.c ++++ b/arch/x86/kvm/i8254.c +@@ -245,7 +245,7 @@ static void kvm_pit_ack_irq(struct kvm_irq_ack_notifier *kian) + * PIC is being reset. Handle it gracefully here + */ + atomic_inc(&ps->pending); +- else if (value > 0) ++ else if (value > 0 && ps->reinject) + /* in this case, we had multiple outstanding pit interrupts + * that we needed to inject. Reinject + */ +@@ -288,7 +288,9 @@ static void pit_do_work(struct kthread_work *work) + * last one has been acked. + */ + spin_lock(&ps->inject_lock); +- if (ps->irq_ack) { ++ if (!ps->reinject) ++ inject = 1; ++ else if (ps->irq_ack) { + ps->irq_ack = 0; + inject = 1; + } +@@ -317,10 +319,10 @@ static enum hrtimer_restart pit_timer_fn(struct hrtimer *data) + struct kvm_kpit_state *ps = container_of(data, struct kvm_kpit_state, timer); + struct kvm_pit *pt = ps->kvm->arch.vpit; + +- if (ps->reinject || !atomic_read(&ps->pending)) { ++ if (ps->reinject) + atomic_inc(&ps->pending); +- queue_kthread_work(&pt->worker, &pt->expired); +- } ++ ++ queue_kthread_work(&pt->worker, &pt->expired); + + if (ps->is_periodic) { + hrtimer_add_expires_ns(&ps->timer, ps->period); +-- +2.7.1 + + +From 5eff65399d844a0b37cceab5cba557f1eaee7fda Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Mon, 21 Mar 2016 10:15:25 +0100 +Subject: [PATCH 024/384] KVM: fix spin_lock_init order on x86 + +commit e9ad4ec8379ad1ba6f68b8ca1c26b50b5ae0a327 upstream. + +Moving the initialization earlier is needed in 4.6 because +kvm_arch_init_vm is now using mmu_lock, causing lockdep to +complain: + +[ 284.440294] INFO: trying to register non-static key. +[ 284.445259] the code is fine but needs lockdep annotation. +[ 284.450736] turning off the locking correctness validator. +... +[ 284.528318] [] lock_acquire+0xd3/0x240 +[ 284.533733] [] ? kvm_page_track_register_notifier+0x20/0x60 [kvm] +[ 284.541467] [] _raw_spin_lock+0x41/0x80 +[ 284.546960] [] ? kvm_page_track_register_notifier+0x20/0x60 [kvm] +[ 284.554707] [] kvm_page_track_register_notifier+0x20/0x60 [kvm] +[ 284.562281] [] kvm_mmu_init_vm+0x20/0x30 [kvm] +[ 284.568381] [] kvm_arch_init_vm+0x1ea/0x200 [kvm] +[ 284.574740] [] kvm_dev_ioctl+0xbf/0x4d0 [kvm] + +However, it also helps fixing a preexisting problem, which is why this +patch is also good for stable kernels: kvm_create_vm was incrementing +current->mm->mm_count but not decrementing it at the out_err label (in +case kvm_init_mmu_notifier failed). The new initialization order makes +it possible to add the required mmdrop without adding a new error label. + +Reported-by: Borislav Petkov +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman +--- + virt/kvm/kvm_main.c | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c +index eeed326..9c75003 100644 +--- a/virt/kvm/kvm_main.c ++++ b/virt/kvm/kvm_main.c +@@ -546,6 +546,16 @@ static struct kvm *kvm_create_vm(unsigned long type) + if (!kvm) + return ERR_PTR(-ENOMEM); + ++ spin_lock_init(&kvm->mmu_lock); ++ atomic_inc(¤t->mm->mm_count); ++ kvm->mm = current->mm; ++ kvm_eventfd_init(kvm); ++ mutex_init(&kvm->lock); ++ mutex_init(&kvm->irq_lock); ++ mutex_init(&kvm->slots_lock); ++ atomic_set(&kvm->users_count, 1); ++ INIT_LIST_HEAD(&kvm->devices); ++ + r = kvm_arch_init_vm(kvm, type); + if (r) + goto out_err_no_disable; +@@ -578,16 +588,6 @@ static struct kvm *kvm_create_vm(unsigned long type) + goto out_err; + } + +- spin_lock_init(&kvm->mmu_lock); +- kvm->mm = current->mm; +- atomic_inc(&kvm->mm->mm_count); +- kvm_eventfd_init(kvm); +- mutex_init(&kvm->lock); +- mutex_init(&kvm->irq_lock); +- mutex_init(&kvm->slots_lock); +- atomic_set(&kvm->users_count, 1); +- INIT_LIST_HEAD(&kvm->devices); +- + r = kvm_init_mmu_notifier(kvm); + if (r) + goto out_err; +@@ -612,6 +612,7 @@ out_err_no_disable: + for (i = 0; i < KVM_ADDRESS_SPACE_NUM; i++) + kvm_free_memslots(kvm, kvm->memslots[i]); + kvm_arch_free_vm(kvm); ++ mmdrop(current->mm); + return ERR_PTR(r); + } + +-- +2.7.1 + + +From f261894e90ace81031973a7fa07349a5b41a6e73 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 18 Mar 2016 16:53:29 +0100 +Subject: [PATCH 025/384] KVM: VMX: avoid guest hang on invalid invept + instruction + +commit 2849eb4f99d54925c543db12917127f88b3c38ff upstream. + +A guest executing an invalid invept instruction would hang +because the instruction pointer was not updated. + +Fixes: bfd0a56b90005f8c8a004baf407ad90045c2b11e +Reviewed-by: David Matlack +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kvm/vmx.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c +index 0958fa2..89d5e02 100644 +--- a/arch/x86/kvm/vmx.c ++++ b/arch/x86/kvm/vmx.c +@@ -7340,6 +7340,7 @@ static int handle_invept(struct kvm_vcpu *vcpu) + if (!(types & (1UL << type))) { + nested_vmx_failValid(vcpu, + VMXERR_INVALID_OPERAND_TO_INVEPT_INVVPID); ++ skip_emulated_instruction(vcpu); + return 1; + } + +-- +2.7.1 + + +From 27af8bb756bb9deafbd9b077df0d651e563c6ad1 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 18 Mar 2016 16:53:42 +0100 +Subject: [PATCH 026/384] KVM: VMX: avoid guest hang on invalid invvpid + instruction + +commit f6870ee9e53430f2a318ccf0dd5e66bb46194e43 upstream. + +A guest executing an invalid invvpid instruction would hang +because the instruction pointer was not updated. + +Reported-by: jmontleo@redhat.com +Tested-by: jmontleo@redhat.com +Fixes: 99b83ac893b84ed1a62ad6d1f2b6cc32026b9e85 +Reviewed-by: David Matlack +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kvm/vmx.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c +index 89d5e02..75d5d5b 100644 +--- a/arch/x86/kvm/vmx.c ++++ b/arch/x86/kvm/vmx.c +@@ -7399,6 +7399,7 @@ static int handle_invvpid(struct kvm_vcpu *vcpu) + if (!(types & (1UL << type))) { + nested_vmx_failValid(vcpu, + VMXERR_INVALID_OPERAND_TO_INVEPT_INVVPID); ++ skip_emulated_instruction(vcpu); + return 1; + } + +-- +2.7.1 + + +From 4ed3de161272657b57ab1301170c97de2aa8ec2b Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 18 Mar 2016 16:58:38 +0100 +Subject: [PATCH 027/384] KVM: VMX: fix nested vpid for old KVM guests + +commit ef697a712a6165aea7779c295604b099e8bfae2e upstream. + +Old KVM guests invoke single-context invvpid without actually checking +whether it is supported. This was fixed by commit 518c8ae ("KVM: VMX: +Make sure single type invvpid is supported before issuing invvpid +instruction", 2010-08-01) and the patch after, but pre-2.6.36 +kernels lack it including RHEL 6. + +Reported-by: jmontleo@redhat.com +Tested-by: jmontleo@redhat.com +Fixes: 99b83ac893b84ed1a62ad6d1f2b6cc32026b9e85 +Reviewed-by: David Matlack +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kvm/vmx.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c +index 75d5d5b..f34ab71 100644 +--- a/arch/x86/kvm/vmx.c ++++ b/arch/x86/kvm/vmx.c +@@ -2637,8 +2637,15 @@ static void nested_vmx_setup_ctls_msrs(struct vcpu_vmx *vmx) + } else + vmx->nested.nested_vmx_ept_caps = 0; + ++ /* ++ * Old versions of KVM use the single-context version without ++ * checking for support, so declare that it is supported even ++ * though it is treated as global context. The alternative is ++ * not failing the single-context invvpid, and it is worse. ++ */ + if (enable_vpid) + vmx->nested.nested_vmx_vpid_caps = VMX_VPID_INVVPID_BIT | ++ VMX_VPID_EXTENT_SINGLE_CONTEXT_BIT | + VMX_VPID_EXTENT_GLOBAL_CONTEXT_BIT; + else + vmx->nested.nested_vmx_vpid_caps = 0; +@@ -7416,12 +7423,17 @@ static int handle_invvpid(struct kvm_vcpu *vcpu) + } + + switch (type) { ++ case VMX_VPID_EXTENT_SINGLE_CONTEXT: ++ /* ++ * Old versions of KVM use the single-context version so we ++ * have to support it; just treat it the same as all-context. ++ */ + case VMX_VPID_EXTENT_ALL_CONTEXT: + __vmx_flush_tlb(vcpu, to_vmx(vcpu)->nested.vpid02); + nested_vmx_succeed(vcpu); + break; + default: +- /* Trap single context invalidation invvpid calls */ ++ /* Trap individual address invalidation invvpid calls */ + BUG_ON(1); + break; + } +-- +2.7.1 + + +From ea44d3c58d25cd3da843dbe7bdaf5d7cc8fab61b Mon Sep 17 00:00:00 2001 +From: Alexander Shishkin +Date: Wed, 2 Mar 2016 13:24:14 +0200 +Subject: [PATCH 028/384] perf/core: Fix perf_sched_count derailment + +commit 927a5570855836e5d5859a80ce7e91e963545e8f upstream. + +The error path in perf_event_open() is such that asking for a sampling +event on a PMU that doesn't generate interrupts will end up in dropping +the perf_sched_count even though it hasn't been incremented for this +event yet. + +Given a sufficient amount of these calls, we'll end up disabling +scheduler's jump label even though we'd still have active events in the +system, thereby facilitating the arrival of the infernal regions upon us. + +I'm fixing this by moving account_event() inside perf_event_alloc(). + +Signed-off-by: Alexander Shishkin +Signed-off-by: Peter Zijlstra (Intel) +Cc: Arnaldo Carvalho de Melo +Cc: Arnaldo Carvalho de Melo +Cc: Jiri Olsa +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Stephane Eranian +Cc: Thomas Gleixner +Cc: Vince Weaver +Cc: vince@deater.net +Link: http://lkml.kernel.org/r/1456917854-29427-1-git-send-email-alexander.shishkin@linux.intel.com +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + kernel/events/core.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/kernel/events/core.c b/kernel/events/core.c +index 760f41d..53a4b55 100644 +--- a/kernel/events/core.c ++++ b/kernel/events/core.c +@@ -7981,6 +7981,9 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu, + } + } + ++ /* symmetric to unaccount_event() in _free_event() */ ++ account_event(event); ++ + return event; + + err_per_task: +@@ -8344,8 +8347,6 @@ SYSCALL_DEFINE5(perf_event_open, + } + } + +- account_event(event); +- + /* + * Special case software events and allow them to be part of + * any hardware group. +@@ -8628,8 +8629,6 @@ perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu, + /* Mark owner so we could distinguish it from user events. */ + event->owner = EVENT_OWNER_KERNEL; + +- account_event(event); +- + ctx = find_get_context(event->pmu, task, event); + if (IS_ERR(ctx)) { + err = PTR_ERR(ctx); +-- +2.7.1 + + +From 9d0ac86ded1d81c3d1a7a997eb68dc9326472bef Mon Sep 17 00:00:00 2001 +From: Andi Kleen +Date: Wed, 17 Feb 2016 14:44:55 -0800 +Subject: [PATCH 029/384] perf tools: Dont stop PMU parsing on alias parse + error + +commit 940db6dcd3f4659303fdf6befe7416adc4d24118 upstream. + +When an error happens during alias parsing currently the complete +parsing of all attributes of the PMU is stopped. This is breaks old perf +on a newer kernel that may have not-yet-know alias attributes (such as +.scale or .per-pkg). + +Continue when some attribute is unparseable. + +This is IMHO a stable candidate and should be backported to older +versions to avoid problems with newer kernels. + +v2: Print warnings when something goes wrong. +v3: Change warning to debug output + +Signed-off-by: Andi Kleen +Cc: Jiri Olsa +Link: http://lkml.kernel.org/r/1455749095-18358-1-git-send-email-andi@firstfloor.org +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/util/pmu.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c +index e4b173d..6f2a027 100644 +--- a/tools/perf/util/pmu.c ++++ b/tools/perf/util/pmu.c +@@ -283,13 +283,12 @@ static int pmu_aliases_parse(char *dir, struct list_head *head) + { + struct dirent *evt_ent; + DIR *event_dir; +- int ret = 0; + + event_dir = opendir(dir); + if (!event_dir) + return -EINVAL; + +- while (!ret && (evt_ent = readdir(event_dir))) { ++ while ((evt_ent = readdir(event_dir))) { + char path[PATH_MAX]; + char *name = evt_ent->d_name; + FILE *file; +@@ -305,17 +304,19 @@ static int pmu_aliases_parse(char *dir, struct list_head *head) + + snprintf(path, PATH_MAX, "%s/%s", dir, name); + +- ret = -EINVAL; + file = fopen(path, "r"); +- if (!file) +- break; ++ if (!file) { ++ pr_debug("Cannot open %s\n", path); ++ continue; ++ } + +- ret = perf_pmu__new_alias(head, dir, name, file); ++ if (perf_pmu__new_alias(head, dir, name, file) < 0) ++ pr_debug("Cannot set up %s\n", name); + fclose(file); + } + + closedir(event_dir); +- return ret; ++ return 0; + } + + /* +-- +2.7.1 + + +From 62a245da080f0844dc3785ddc32b8e570ea6162a Mon Sep 17 00:00:00 2001 +From: Wang Nan +Date: Fri, 19 Feb 2016 11:43:52 +0000 +Subject: [PATCH 030/384] perf tools: Fix checking asprintf return value + +commit 26dee028d365fbc0e3326606a8520260b4462381 upstream. + +According to man pages, asprintf returns -1 when failure. This patch +fixes two incorrect return value checker. + +Signed-off-by: Wang Nan +Cc: Adrian Hunter +Cc: Alexei Starovoitov +Cc: Brendan Gregg +Cc: Cody P Schafer +Cc: He Kuang +Cc: Jeremie Galarneau +Cc: Jiri Olsa +Cc: Kirill Smelkov +Cc: Li Zefan +Cc: Masami Hiramatsu +Cc: Namhyung Kim +Cc: Peter Zijlstra +Cc: Zefan Li +Cc: pi3orama@163.com +Fixes: ffeb883e5662 ("perf tools: Show proper error message for wrong terms of hw/sw events") +Link: http://lkml.kernel.org/r/1455882283-79592-5-git-send-email-wangnan0@huawei.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/util/parse-events.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c +index b48e876..a35db82 100644 +--- a/tools/perf/util/parse-events.c ++++ b/tools/perf/util/parse-events.c +@@ -2101,11 +2101,11 @@ char *parse_events_formats_error_string(char *additional_terms) + + /* valid terms */ + if (additional_terms) { +- if (!asprintf(&str, "valid terms: %s,%s", +- additional_terms, static_terms)) ++ if (asprintf(&str, "valid terms: %s,%s", ++ additional_terms, static_terms) < 0) + goto fail; + } else { +- if (!asprintf(&str, "valid terms: %s", static_terms)) ++ if (asprintf(&str, "valid terms: %s", static_terms) < 0) + goto fail; + } + return str; +-- +2.7.1 + + +From 9ec8e2e699d8db1f31a343088f2da37be8c7668e Mon Sep 17 00:00:00 2001 +From: Jiri Olsa +Date: Sat, 27 Feb 2016 21:21:12 +0100 +Subject: [PATCH 031/384] perf tools: Fix python extension build + +commit 67d5268908283c187e0a460048a423256c2fb288 upstream. + +The util/python-ext-sources file contains source files required to build +the python extension relative to $(srctree)/tools/perf, + +Such a file path $(FILE).c is handed over to the python extension build +system, which builds the final object in the +$(PYTHON_EXTBUILD)/tmp/$(FILE).o path. + +After the build is done all files from $(PYTHON_EXTBUILD)lib/ are +carried as the result binaries. + +Above system fails when we add source file relative to ../lib, which we +do for: + + ../lib/bitmap.c + ../lib/find_bit.c + ../lib/hweight.c + ../lib/rbtree.c + +All above objects will be built like: + + $(PYTHON_EXTBUILD)/tmp/../lib/bitmap.c + $(PYTHON_EXTBUILD)/tmp/../lib/find_bit.c + $(PYTHON_EXTBUILD)/tmp/../lib/hweight.c + $(PYTHON_EXTBUILD)/tmp/../lib/rbtree.c + +which accidentally happens to be final library path: + + $(PYTHON_EXTBUILD)/lib/ + +Changing setup.py to pass full paths of source files to Extension build +class and thus keep all built objects under $(PYTHON_EXTBUILD)tmp +directory. + +Reported-by: Jeff Bastian +Signed-off-by: Jiri Olsa +Tested-by: Josh Boyer +Cc: David Ahern +Cc: Namhyung Kim +Cc: Peter Zijlstra +Link: http://lkml.kernel.org/r/20160227201350.GB28494@krava.redhat.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/util/setup.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py +index 1833103..c868098 100644 +--- a/tools/perf/util/setup.py ++++ b/tools/perf/util/setup.py +@@ -22,6 +22,7 @@ cflags = getenv('CFLAGS', '').split() + # switch off several checks (need to be at the end of cflags list) + cflags += ['-fno-strict-aliasing', '-Wno-write-strings', '-Wno-unused-parameter' ] + ++src_perf = getenv('srctree') + '/tools/perf' + build_lib = getenv('PYTHON_EXTBUILD_LIB') + build_tmp = getenv('PYTHON_EXTBUILD_TMP') + libtraceevent = getenv('LIBTRACEEVENT') +@@ -30,6 +31,9 @@ libapikfs = getenv('LIBAPI') + ext_sources = [f.strip() for f in file('util/python-ext-sources') + if len(f.strip()) > 0 and f[0] != '#'] + ++# use full paths with source files ++ext_sources = map(lambda x: '%s/%s' % (src_perf, x) , ext_sources) ++ + perf = Extension('perf', + sources = ext_sources, + include_dirs = ['util/include'], +-- +2.7.1 + + +From 2ba61e58acf6a479dfc1f093c91d6ce0f4db1551 Mon Sep 17 00:00:00 2001 +From: Zhang Rui +Date: Fri, 18 Mar 2016 10:03:24 +0800 +Subject: [PATCH 032/384] Thermal: Ignore invalid trip points + +commit 81ad4276b505e987dd8ebbdf63605f92cd172b52 upstream. + +In some cases, platform thermal driver may report invalid trip points, +thermal core should not take any action for these trip points. + +This fixed a regression that bogus trip point starts to screw up thermal +control on some Lenovo laptops, after +commit bb431ba26c5cd0a17c941ca6c3a195a3a6d5d461 +Author: Zhang Rui +Date: Fri Oct 30 16:31:47 2015 +0800 + + Thermal: initialize thermal zone device correctly + + After thermal zone device registered, as we have not read any + temperature before, thus tz->temperature should not be 0, + which actually means 0C, and thermal trend is not available. + In this case, we need specially handling for the first + thermal_zone_device_update(). + + Both thermal core framework and step_wise governor is + enhanced to handle this. And since the step_wise governor + is the only one that uses trends, so it's the only thermal + governor that needs to be updated. + + Tested-by: Manuel Krause + Tested-by: szegad + Tested-by: prash + Tested-by: amish + Tested-by: Matthias + Reviewed-by: Javi Merino + Signed-off-by: Zhang Rui + Signed-off-by: Chen Yu + +Link: https://bugzilla.redhat.com/show_bug.cgi?id=1317190 +Link: https://bugzilla.kernel.org/show_bug.cgi?id=114551 +Signed-off-by: Zhang Rui +Signed-off-by: Greg Kroah-Hartman +--- + drivers/thermal/thermal_core.c | 13 ++++++++++++- + include/linux/thermal.h | 2 ++ + 2 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c +index ba08b55..3d5f8f4 100644 +--- a/drivers/thermal/thermal_core.c ++++ b/drivers/thermal/thermal_core.c +@@ -454,6 +454,10 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip) + { + enum thermal_trip_type type; + ++ /* Ignore disabled trip points */ ++ if (test_bit(trip, &tz->trips_disabled)) ++ return; ++ + tz->ops->get_trip_type(tz, trip, &type); + + if (type == THERMAL_TRIP_CRITICAL || type == THERMAL_TRIP_HOT) +@@ -1796,6 +1800,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type, + { + struct thermal_zone_device *tz; + enum thermal_trip_type trip_type; ++ int trip_temp; + int result; + int count; + int passive = 0; +@@ -1867,9 +1872,15 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type, + goto unregister; + + for (count = 0; count < trips; count++) { +- tz->ops->get_trip_type(tz, count, &trip_type); ++ if (tz->ops->get_trip_type(tz, count, &trip_type)) ++ set_bit(count, &tz->trips_disabled); + if (trip_type == THERMAL_TRIP_PASSIVE) + passive = 1; ++ if (tz->ops->get_trip_temp(tz, count, &trip_temp)) ++ set_bit(count, &tz->trips_disabled); ++ /* Check for bogus trip points */ ++ if (trip_temp == 0) ++ set_bit(count, &tz->trips_disabled); + } + + if (!passive) { +diff --git a/include/linux/thermal.h b/include/linux/thermal.h +index e13a1ac..4a849f1 100644 +--- a/include/linux/thermal.h ++++ b/include/linux/thermal.h +@@ -156,6 +156,7 @@ struct thermal_attr { + * @trip_hyst_attrs: attributes for trip points for sysfs: trip hysteresis + * @devdata: private pointer for device private data + * @trips: number of trip points the thermal zone supports ++ * @trips_disabled; bitmap for disabled trips + * @passive_delay: number of milliseconds to wait between polls when + * performing passive cooling. + * @polling_delay: number of milliseconds to wait between polls when +@@ -191,6 +192,7 @@ struct thermal_zone_device { + struct thermal_attr *trip_hyst_attrs; + void *devdata; + int trips; ++ unsigned long trips_disabled; /* bitmap for disabled trips */ + int passive_delay; + int polling_delay; + int temperature; +-- +2.7.1 + + +From ff121c18ef86e446123a97789303d40fceafa5e5 Mon Sep 17 00:00:00 2001 +From: Chris Friesen +Date: Sat, 5 Mar 2016 23:18:48 -0600 +Subject: [PATCH 033/384] sched/cputime: Fix steal_account_process_tick() to + always return jiffies + +commit f9c904b7613b8b4c85b10cd6b33ad41b2843fa9d upstream. + +The callers of steal_account_process_tick() expect it to return +whether a jiffy should be considered stolen or not. + +Currently the return value of steal_account_process_tick() is in +units of cputime, which vary between either jiffies or nsecs +depending on CONFIG_VIRT_CPU_ACCOUNTING_GEN. + +If cputime has nsecs granularity and there is a tiny amount of +stolen time (a few nsecs, say) then we will consider the entire +tick stolen and will not account the tick on user/system/idle, +causing /proc/stats to show invalid data. + +The fix is to change steal_account_process_tick() to accumulate +the stolen time and only account it once it's worth a jiffy. + +(Thanks to Frederic Weisbecker for suggestions to fix a bug in my +first version of the patch.) + +Signed-off-by: Chris Friesen +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Thomas Gleixner +Cc: Frederic Weisbecker +Cc: Linus Torvalds +Cc: Peter Zijlstra +Link: http://lkml.kernel.org/r/56DBBDB8.40305@mail.usask.ca +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + kernel/sched/cputime.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c +index 0f75a38..c45f4b0 100644 +--- a/kernel/sched/cputime.c ++++ b/kernel/sched/cputime.c +@@ -259,21 +259,21 @@ static __always_inline bool steal_account_process_tick(void) + #ifdef CONFIG_PARAVIRT + if (static_key_false(¶virt_steal_enabled)) { + u64 steal; +- cputime_t steal_ct; ++ unsigned long steal_jiffies; + + steal = paravirt_steal_clock(smp_processor_id()); + steal -= this_rq()->prev_steal_time; + + /* +- * cputime_t may be less precise than nsecs (eg: if it's +- * based on jiffies). Lets cast the result to cputime ++ * steal is in nsecs but our caller is expecting steal ++ * time in jiffies. Lets cast the result to jiffies + * granularity and account the rest on the next rounds. + */ +- steal_ct = nsecs_to_cputime(steal); +- this_rq()->prev_steal_time += cputime_to_nsecs(steal_ct); ++ steal_jiffies = nsecs_to_jiffies(steal); ++ this_rq()->prev_steal_time += jiffies_to_nsecs(steal_jiffies); + +- account_steal_time(steal_ct); +- return steal_ct; ++ account_steal_time(jiffies_to_cputime(steal_jiffies)); ++ return steal_jiffies; + } + #endif + return false; +-- +2.7.1 + + +From 1f5c47b6ed03c60b2392cbb9713a522b63564c00 Mon Sep 17 00:00:00 2001 +From: David Hildenbrand +Date: Mon, 29 Feb 2016 09:19:24 +0100 +Subject: [PATCH 034/384] sched/preempt, sh: kmap_coherent relies on disabled + preemption + +commit b15d53d009558d14c4f394a6d1fa2039c7f45c43 upstream. + +kmap_coherent needs disabled preemption to not schedule in the critical +section, just like kmap_coherent on mips and kmap_atomic in general. + +Fixes: 8222dbe21e79 "sched/preempt, mm/fault: Decouple preemption from the page fault logic" +Reported-by: Hans Verkuil +Signed-off-by: David Hildenbrand +Tested-by: Hans Verkuil +Signed-off-by: Rich Felker +Signed-off-by: Greg Kroah-Hartman +--- + arch/sh/mm/kmap.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/sh/mm/kmap.c b/arch/sh/mm/kmap.c +index ec29e14..bf25d7c 100644 +--- a/arch/sh/mm/kmap.c ++++ b/arch/sh/mm/kmap.c +@@ -36,6 +36,7 @@ void *kmap_coherent(struct page *page, unsigned long addr) + + BUG_ON(!test_bit(PG_dcache_clean, &page->flags)); + ++ preempt_disable(); + pagefault_disable(); + + idx = FIX_CMAP_END - +@@ -64,4 +65,5 @@ void kunmap_coherent(void *kvaddr) + } + + pagefault_enable(); ++ preempt_enable(); + } +-- +2.7.1 + + +From 15e4e428841ca553a1ed93d810c4443ece1147a4 Mon Sep 17 00:00:00 2001 +From: Tony Luck +Date: Wed, 9 Mar 2016 16:40:48 -0800 +Subject: [PATCH 035/384] EDAC/sb_edac: Fix computation of channel address + +commit eb1af3b71f9d83e45f2fd2fd649356e98e1c582c upstream. + +Large memory Haswell-EX systems with multiple DIMMs per channel were +sometimes reporting the wrong DIMM. + +Found three problems: + + 1) Debug printouts for socket and channel interleave were not interpreting + the register fields correctly. The socket interleave field is a 2^X + value (0=1, 1=2, 2=4, 3=8). The channel interleave is X+1 (0=1, 1=2, + 2=3. 3=4). + + 2) Actual use of the socket interleave value didn't interpret as 2^X + + 3) Conversion of address to channel address was complicated, and wrong. + +Signed-off-by: Tony Luck +Acked-by: Aristeu Rozanski +Cc: Borislav Petkov +Cc: Linus Torvalds +Cc: Mauro Carvalho Chehab +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Cc: linux-edac@vger.kernel.org +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + drivers/edac/sb_edac.c | 26 ++++++++++---------------- + 1 file changed, 10 insertions(+), 16 deletions(-) + +diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c +index 429309c..cbee317 100644 +--- a/drivers/edac/sb_edac.c ++++ b/drivers/edac/sb_edac.c +@@ -1117,8 +1117,8 @@ static void get_memory_layout(const struct mem_ctl_info *mci) + edac_dbg(0, "TAD#%d: up to %u.%03u GB (0x%016Lx), socket interleave %d, memory interleave %d, TGT: %d, %d, %d, %d, reg=0x%08x\n", + n_tads, gb, (mb*1000)/1024, + ((u64)tmp_mb) << 20L, +- (u32)TAD_SOCK(reg), +- (u32)TAD_CH(reg), ++ (u32)(1 << TAD_SOCK(reg)), ++ (u32)TAD_CH(reg) + 1, + (u32)TAD_TGT0(reg), + (u32)TAD_TGT1(reg), + (u32)TAD_TGT2(reg), +@@ -1396,7 +1396,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci, + } + + ch_way = TAD_CH(reg) + 1; +- sck_way = TAD_SOCK(reg) + 1; ++ sck_way = 1 << TAD_SOCK(reg); + + if (ch_way == 3) + idx = addr >> 6; +@@ -1453,7 +1453,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci, + n_tads, + addr, + limit, +- (u32)TAD_SOCK(reg), ++ sck_way, + ch_way, + offset, + idx, +@@ -1468,18 +1468,12 @@ static int get_memory_error_data(struct mem_ctl_info *mci, + offset, addr); + return -EINVAL; + } +- addr -= offset; +- /* Store the low bits [0:6] of the addr */ +- ch_addr = addr & 0x7f; +- /* Remove socket wayness and remove 6 bits */ +- addr >>= 6; +- addr = div_u64(addr, sck_xch); +-#if 0 +- /* Divide by channel way */ +- addr = addr / ch_way; +-#endif +- /* Recover the last 6 bits */ +- ch_addr |= addr << 6; ++ ++ ch_addr = addr - offset; ++ ch_addr >>= (6 + shiftup); ++ ch_addr /= ch_way * sck_way; ++ ch_addr <<= (6 + shiftup); ++ ch_addr |= addr & ((1 << (6 + shiftup)) - 1); + + /* + * Step 3) Decode rank +-- +2.7.1 + + +From 2afede428b160c6e533f36af547dea7659683e6c Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Wed, 20 Jan 2016 12:54:51 +0300 +Subject: [PATCH 036/384] EDAC, amd64_edac: Shift wrapping issue in + f1x_get_norm_dct_addr() + +commit 6f3508f61c814ee852c199988a62bd954c50dfc1 upstream. + +dct_sel_base_off is declared as a u64 but we're only using the lower 32 +bits because of a shift wrapping bug. This can possibly truncate the +upper 16 bits of DctSelBaseOffset[47:26], causing us to misdecode the CS +row. + +Fixes: c8e518d5673d ('amd64_edac: Sanitize f10_get_base_addr_offset') +Signed-off-by: Dan Carpenter +Cc: Aravind Gopalakrishnan +Cc: linux-edac +Link: http://lkml.kernel.org/r/20160120095451.GB19898@mwanda +Signed-off-by: Borislav Petkov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/edac/amd64_edac.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c +index 9eee13e..d87a475 100644 +--- a/drivers/edac/amd64_edac.c ++++ b/drivers/edac/amd64_edac.c +@@ -1452,7 +1452,7 @@ static u64 f1x_get_norm_dct_addr(struct amd64_pvt *pvt, u8 range, + u64 chan_off; + u64 dram_base = get_dram_base(pvt, range); + u64 hole_off = f10_dhar_offset(pvt); +- u64 dct_sel_base_off = (pvt->dct_sel_hi & 0xFFFFFC00) << 16; ++ u64 dct_sel_base_off = (u64)(pvt->dct_sel_hi & 0xFFFFFC00) << 16; + + if (hi_rng) { + /* +-- +2.7.1 + + +From be33f49a9ebaea149d188ee76e80dcf633b74bd3 Mon Sep 17 00:00:00 2001 +From: Martin Schwidefsky +Date: Thu, 10 Mar 2016 09:52:55 +0100 +Subject: [PATCH 037/384] s390: fix floating pointer register corruption + (again) + +commit e370e4769463a65dcf8806fa26d2874e0542ac41 upstream. + +There is a tricky interaction between the machine check handler +and the critical sections of load_fpu_regs and save_fpu_regs +functions. If the machine check interrupts one of the two +functions the critical section cleanup will complete the function +before the machine check handler s390_do_machine_check is called. +Trouble is that the machine check handler needs to validate the +floating point registers *before* and not *after* the completion +of load_fpu_regs/save_fpu_regs. + +The simplest solution is to rewind the PSW to the start of the +load_fpu_regs/save_fpu_regs and retry the function after the +return from the machine check handler. + +Tested-by: Christian Borntraeger +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman +--- + arch/s390/kernel/entry.S | 106 +---------------------------------------------- + 1 file changed, 2 insertions(+), 104 deletions(-) + +diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S +index 857b652..424e680 100644 +--- a/arch/s390/kernel/entry.S ++++ b/arch/s390/kernel/entry.S +@@ -1197,114 +1197,12 @@ cleanup_critical: + .quad .Lpsw_idle_lpsw + + .Lcleanup_save_fpu_regs: +- TSTMSK __LC_CPU_FLAGS,_CIF_FPU +- bor %r14 +- clg %r9,BASED(.Lcleanup_save_fpu_regs_done) +- jhe 5f +- clg %r9,BASED(.Lcleanup_save_fpu_regs_fp) +- jhe 4f +- clg %r9,BASED(.Lcleanup_save_fpu_regs_vx_high) +- jhe 3f +- clg %r9,BASED(.Lcleanup_save_fpu_regs_vx_low) +- jhe 2f +- clg %r9,BASED(.Lcleanup_save_fpu_fpc_end) +- jhe 1f +- lg %r2,__LC_CURRENT +- aghi %r2,__TASK_thread +-0: # Store floating-point controls +- stfpc __THREAD_FPU_fpc(%r2) +-1: # Load register save area and check if VX is active +- lg %r3,__THREAD_FPU_regs(%r2) +- TSTMSK __LC_MACHINE_FLAGS,MACHINE_FLAG_VX +- jz 4f # no VX -> store FP regs +-2: # Store vector registers (V0-V15) +- VSTM %v0,%v15,0,%r3 # vstm 0,15,0(3) +-3: # Store vector registers (V16-V31) +- VSTM %v16,%v31,256,%r3 # vstm 16,31,256(3) +- j 5f # -> done, set CIF_FPU flag +-4: # Store floating-point registers +- std 0,0(%r3) +- std 1,8(%r3) +- std 2,16(%r3) +- std 3,24(%r3) +- std 4,32(%r3) +- std 5,40(%r3) +- std 6,48(%r3) +- std 7,56(%r3) +- std 8,64(%r3) +- std 9,72(%r3) +- std 10,80(%r3) +- std 11,88(%r3) +- std 12,96(%r3) +- std 13,104(%r3) +- std 14,112(%r3) +- std 15,120(%r3) +-5: # Set CIF_FPU flag +- oi __LC_CPU_FLAGS+7,_CIF_FPU +- lg %r9,48(%r11) # return from save_fpu_regs ++ larl %r9,save_fpu_regs + br %r14 +-.Lcleanup_save_fpu_fpc_end: +- .quad .Lsave_fpu_regs_fpc_end +-.Lcleanup_save_fpu_regs_vx_low: +- .quad .Lsave_fpu_regs_vx_low +-.Lcleanup_save_fpu_regs_vx_high: +- .quad .Lsave_fpu_regs_vx_high +-.Lcleanup_save_fpu_regs_fp: +- .quad .Lsave_fpu_regs_fp +-.Lcleanup_save_fpu_regs_done: +- .quad .Lsave_fpu_regs_done + + .Lcleanup_load_fpu_regs: +- TSTMSK __LC_CPU_FLAGS,_CIF_FPU +- bnor %r14 +- clg %r9,BASED(.Lcleanup_load_fpu_regs_done) +- jhe 1f +- clg %r9,BASED(.Lcleanup_load_fpu_regs_fp) +- jhe 2f +- clg %r9,BASED(.Lcleanup_load_fpu_regs_vx_high) +- jhe 3f +- clg %r9,BASED(.Lcleanup_load_fpu_regs_vx) +- jhe 4f +- lg %r4,__LC_CURRENT +- aghi %r4,__TASK_thread +- lfpc __THREAD_FPU_fpc(%r4) +- TSTMSK __LC_MACHINE_FLAGS,MACHINE_FLAG_VX +- lg %r4,__THREAD_FPU_regs(%r4) # %r4 <- reg save area +- jz 2f # -> no VX, load FP regs +-4: # Load V0 ..V15 registers +- VLM %v0,%v15,0,%r4 +-3: # Load V16..V31 registers +- VLM %v16,%v31,256,%r4 +- j 1f +-2: # Load floating-point registers +- ld 0,0(%r4) +- ld 1,8(%r4) +- ld 2,16(%r4) +- ld 3,24(%r4) +- ld 4,32(%r4) +- ld 5,40(%r4) +- ld 6,48(%r4) +- ld 7,56(%r4) +- ld 8,64(%r4) +- ld 9,72(%r4) +- ld 10,80(%r4) +- ld 11,88(%r4) +- ld 12,96(%r4) +- ld 13,104(%r4) +- ld 14,112(%r4) +- ld 15,120(%r4) +-1: # Clear CIF_FPU bit +- ni __LC_CPU_FLAGS+7,255-_CIF_FPU +- lg %r9,48(%r11) # return from load_fpu_regs ++ larl %r9,load_fpu_regs + br %r14 +-.Lcleanup_load_fpu_regs_vx: +- .quad .Lload_fpu_regs_vx +-.Lcleanup_load_fpu_regs_vx_high: +- .quad .Lload_fpu_regs_vx_high +-.Lcleanup_load_fpu_regs_fp: +- .quad .Lload_fpu_regs_fp +-.Lcleanup_load_fpu_regs_done: +- .quad .Lload_fpu_regs_done + + /* + * Integer constants +-- +2.7.1 + + +From 9c816a68b0437adfbcce12246c25705299d9ab46 Mon Sep 17 00:00:00 2001 +From: Heiko Carstens +Date: Thu, 10 Mar 2016 10:32:21 +0100 +Subject: [PATCH 038/384] s390/cpumf: add missing lpp magic initialization + +commit 8f100bb1ff27873dd71f636da670e503b9ade3c6 upstream. + +Add the missing lpp magic initialization for cpu 0. Without this all +samples on cpu 0 do not have the most significant bit set in the +program parameter field, which we use to distinguish between guest and +host samples if the pid is also 0. + +We did initialize the lpp magic in the absolute zero lowcore but +forgot that when switching to the allocated lowcore on cpu 0 only. + +Reported-by: Shu Juan Zhang +Acked-by: Christian Borntraeger +Fixes: e22cf8ca6f75 ("s390/cpumf: rework program parameter setting to detect guest samples") +Signed-off-by: Heiko Carstens +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman +--- + arch/s390/kernel/setup.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c +index c837bca..1f581eb 100644 +--- a/arch/s390/kernel/setup.c ++++ b/arch/s390/kernel/setup.c +@@ -329,6 +329,7 @@ static void __init setup_lowcore(void) + + PAGE_SIZE - STACK_FRAME_OVERHEAD - sizeof(struct pt_regs); + lc->current_task = (unsigned long) init_thread_union.thread_info.task; + lc->thread_info = (unsigned long) &init_thread_union; ++ lc->lpp = LPP_MAGIC; + lc->machine_flags = S390_lowcore.machine_flags; + lc->stfl_fac_list = S390_lowcore.stfl_fac_list; + memcpy(lc->stfle_fac_list, S390_lowcore.stfle_fac_list, +-- +2.7.1 + + +From 7b74c474319f60302f869997f91314db6f52cf3b Mon Sep 17 00:00:00 2001 +From: Sebastian Ott +Date: Mon, 14 Mar 2016 15:47:23 +0100 +Subject: [PATCH 039/384] s390/pci: enforce fmb page boundary rule + +commit 80c544ded25ac14d7cc3e555abb8ed2c2da99b84 upstream. + +The function measurement block must not cross a page boundary. Ensure +that by raising the alignment requirement to the smallest power of 2 +larger than the size of the fmb. + +Fixes: d0b088531 ("s390/pci: performance statistics and debug infrastructure") +Signed-off-by: Sebastian Ott +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman +--- + arch/s390/include/asm/pci.h | 2 +- + arch/s390/pci/pci.c | 5 ++++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h +index c873e68..2b2ced9 100644 +--- a/arch/s390/include/asm/pci.h ++++ b/arch/s390/include/asm/pci.h +@@ -45,7 +45,7 @@ struct zpci_fmb { + u64 rpcit_ops; + u64 dma_rbytes; + u64 dma_wbytes; +-} __packed __aligned(16); ++} __packed __aligned(64); + + enum zpci_state { + ZPCI_FN_STATE_RESERVED, +diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c +index 7ef12a3..1944239 100644 +--- a/arch/s390/pci/pci.c ++++ b/arch/s390/pci/pci.c +@@ -871,8 +871,11 @@ static inline int barsize(u8 size) + + static int zpci_mem_init(void) + { ++ BUILD_BUG_ON(!is_power_of_2(__alignof__(struct zpci_fmb)) || ++ __alignof__(struct zpci_fmb) < sizeof(struct zpci_fmb)); ++ + zdev_fmb_cache = kmem_cache_create("PCI_FMB_cache", sizeof(struct zpci_fmb), +- 16, 0, NULL); ++ __alignof__(struct zpci_fmb), 0, NULL); + if (!zdev_fmb_cache) + goto error_zdev; + +-- +2.7.1 + + +From 4ce6438e94dcf173eb83856c40ae048a59970770 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 29 Feb 2016 17:30:08 -0800 +Subject: [PATCH 040/384] pinctrl-bcm2835: Fix cut-and-paste error in "pull" + parsing + +commit 2c7e3306d23864d49f686f22e56e180ff0fffb7f upstream. + +The DT bindings for pinctrl-bcm2835 allow both the function and pull +to contain either one entry or one per pin. However, an error in the +DT parsing can cause failures if the number of pulls differs from the +number of functions. + +Signed-off-by: Eric Anholt +Signed-off-by: Phil Elwell +Reviewed-by: Stephen Warren +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman +--- + drivers/pinctrl/bcm/pinctrl-bcm2835.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +index 2e6ca69..17dd8fe 100644 +--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c ++++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +@@ -779,7 +779,7 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, + } + if (num_pulls) { + err = of_property_read_u32_index(np, "brcm,pull", +- (num_funcs > 1) ? i : 0, &pull); ++ (num_pulls > 1) ? i : 0, &pull); + if (err) + goto out; + err = bcm2835_pctl_dt_node_to_map_pull(pc, np, pin, +-- +2.7.1 + + +From 417f3cfc30f4f1d942a7c546c0e67c1a17ffc829 Mon Sep 17 00:00:00 2001 +From: Bjorn Helgaas +Date: Thu, 25 Feb 2016 14:35:57 -0600 +Subject: [PATCH 041/384] PCI: Disable IO/MEM decoding for devices with + non-compliant BARs + +commit b84106b4e2290c081cdab521fa832596cdfea246 upstream. + +The PCI config header (first 64 bytes of each device's config space) is +defined by the PCI spec so generic software can identify the device and +manage its usage of I/O, memory, and IRQ resources. + +Some non-spec-compliant devices put registers other than BARs where the +BARs should be. When the PCI core sizes these "BARs", the reads and writes +it does may have unwanted side effects, and the "BAR" may appear to +describe non-sensical address space. + +Add a flag bit to mark non-compliant devices so we don't touch their BARs. +Turn off IO/MEM decoding to prevent the devices from consuming address +space, since we can't read the BARs to find out what that address space +would be. + +Signed-off-by: Bjorn Helgaas +Tested-by: Andi Kleen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/pci/probe.c | 14 ++++++++++++++ + include/linux/pci.h | 1 + + 2 files changed, 15 insertions(+) + +diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c +index edb1984..7aafb5f 100644 +--- a/drivers/pci/probe.c ++++ b/drivers/pci/probe.c +@@ -179,6 +179,9 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, + u16 orig_cmd; + struct pci_bus_region region, inverted_region; + ++ if (dev->non_compliant_bars) ++ return 0; ++ + mask = type ? PCI_ROM_ADDRESS_MASK : ~0; + + /* No printks while decoding is disabled! */ +@@ -1174,6 +1177,7 @@ void pci_msi_setup_pci_dev(struct pci_dev *dev) + int pci_setup_device(struct pci_dev *dev) + { + u32 class; ++ u16 cmd; + u8 hdr_type; + int pos = 0; + struct pci_bus_region region; +@@ -1219,6 +1223,16 @@ int pci_setup_device(struct pci_dev *dev) + /* device class may be changed after fixup */ + class = dev->class >> 8; + ++ if (dev->non_compliant_bars) { ++ pci_read_config_word(dev, PCI_COMMAND, &cmd); ++ if (cmd & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { ++ dev_info(&dev->dev, "device has non-compliant BARs; disabling IO/MEM decoding\n"); ++ cmd &= ~PCI_COMMAND_IO; ++ cmd &= ~PCI_COMMAND_MEMORY; ++ pci_write_config_word(dev, PCI_COMMAND, cmd); ++ } ++ } ++ + switch (dev->hdr_type) { /* header type */ + case PCI_HEADER_TYPE_NORMAL: /* standard header */ + if (class == PCI_CLASS_BRIDGE_PCI) +diff --git a/include/linux/pci.h b/include/linux/pci.h +index 6ae25aa..4e554bf 100644 +--- a/include/linux/pci.h ++++ b/include/linux/pci.h +@@ -359,6 +359,7 @@ struct pci_dev { + unsigned int io_window_1k:1; /* Intel P2P bridge 1K I/O windows */ + unsigned int irq_managed:1; + unsigned int has_secondary_link:1; ++ unsigned int non_compliant_bars:1; /* broken BARs; ignore them */ + pci_dev_flags_t dev_flags; + atomic_t enable_cnt; /* pci_enable_device has been called */ + +-- +2.7.1 + + +From e0b8d3a5f91be2e429eda1a43e840b997f5fc3d1 Mon Sep 17 00:00:00 2001 +From: Lorenzo Pieralisi +Date: Mon, 21 Mar 2016 11:12:55 +0000 +Subject: [PATCH 042/384] PCI: ACPI: IA64: fix IO port generic range check + +commit 4a2e7aab4ffce1e0e79b303dc2f9a03aa9f3a332 upstream. + +The [0 - 64k] ACPI PCI IO port resource boundary check in: + +acpi_dev_ioresource_flags() + +is currently applied blindly in the ACPI resource parsing to all +architectures, but only x86 suffers from that IO space limitation. + +On arches (ie IA64 and ARM64) where IO space is memory mapped, +the PCI root bridges IO resource windows are firstly initialized from +the _CRS (in acpi_decode_space()) and contain the CPU physical address +at which a root bridge decodes IO space in the CPU physical address +space with the offset value representing the offset required to translate +the PCI bus address into the CPU physical address. + +The IO resource windows are then parsed and updated in arch code +before creating and enumerating PCI buses (eg IA64 add_io_space()) +to map in an arch specific way the obtained CPU physical address range +to a slice of virtual address space reserved to map PCI IO space, +ending up with PCI bridges resource windows containing IO +resources like the following on a working IA64 configuration: + +PCI host bridge to bus 0000:00 +pci_bus 0000:00: root bus resource [io 0x1000000-0x100ffff window] (bus +address [0x0000-0xffff]) +pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000fffff window] +pci_bus 0000:00: root bus resource [mem 0x80000000-0x8fffffff window] +pci_bus 0000:00: root bus resource [mem 0x80004000000-0x800ffffffff window] +pci_bus 0000:00: root bus resource [bus 00] + +This implies that the [0 - 64K] check in acpi_dev_ioresource_flags() +leaves platforms with memory mapped IO space (ie IA64) broken (ie kernel +can't claim IO resources since the host bridge IO resource is disabled +and discarded by ACPI core code, see log on IA64 with missing root bridge +IO resource, silently filtered by current [0 - 64k] check in +acpi_dev_ioresource_flags()): + +PCI host bridge to bus 0000:00 +pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000fffff window] +pci_bus 0000:00: root bus resource [mem 0x80000000-0x8fffffff window] +pci_bus 0000:00: root bus resource [mem 0x80004000000-0x800ffffffff window] +pci_bus 0000:00: root bus resource [bus 00] + +[...] + +pci 0000:00:03.0: [1002:515e] type 00 class 0x030000 +pci 0000:00:03.0: reg 0x10: [mem 0x80000000-0x87ffffff pref] +pci 0000:00:03.0: reg 0x14: [io 0x1000-0x10ff] +pci 0000:00:03.0: reg 0x18: [mem 0x88020000-0x8802ffff] +pci 0000:00:03.0: reg 0x30: [mem 0x88000000-0x8801ffff pref] +pci 0000:00:03.0: supports D1 D2 +pci 0000:00:03.0: can't claim BAR 1 [io 0x1000-0x10ff]: no compatible +bridge window + +For this reason, the IO port resources boundaries check in generic ACPI +parsing code should be guarded with a CONFIG_X86 guard so that more arches +(ie ARM64) can benefit from the generic ACPI resources parsing interface +without incurring in unexpected resource filtering, fixing at the same +time current breakage on IA64. + +This patch factors out IO ports boundary [0 - 64k] check in generic ACPI +code and makes the IO space check X86 specific to make sure that IO +space resources are usable on other arches too. + +Fixes: 3772aea7d6f3 (ia64/PCI/ACPI: Use common ACPI resource parsing interface for host bridge) +Signed-off-by: Lorenzo Pieralisi +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/acpi/resource.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c +index cdc5c25..627f8fb 100644 +--- a/drivers/acpi/resource.c ++++ b/drivers/acpi/resource.c +@@ -26,8 +26,20 @@ + + #ifdef CONFIG_X86 + #define valid_IRQ(i) (((i) != 0) && ((i) != 2)) ++static inline bool acpi_iospace_resource_valid(struct resource *res) ++{ ++ /* On X86 IO space is limited to the [0 - 64K] IO port range */ ++ return res->end < 0x10003; ++} + #else + #define valid_IRQ(i) (true) ++/* ++ * ACPI IO descriptors on arches other than X86 contain MMIO CPU physical ++ * addresses mapping IO space in CPU physical address space, IO space ++ * resources can be placed anywhere in the 64-bit physical address space. ++ */ ++static inline bool ++acpi_iospace_resource_valid(struct resource *res) { return true; } + #endif + + static bool acpi_dev_resource_len_valid(u64 start, u64 end, u64 len, bool io) +@@ -126,7 +138,7 @@ static void acpi_dev_ioresource_flags(struct resource *res, u64 len, + if (!acpi_dev_resource_len_valid(res->start, res->end, len, true)) + res->flags |= IORESOURCE_DISABLED | IORESOURCE_UNSET; + +- if (res->end >= 0x10003) ++ if (!acpi_iospace_resource_valid(res)) + res->flags |= IORESOURCE_DISABLED | IORESOURCE_UNSET; + + if (io_decode == ACPI_DECODE_16) +-- +2.7.1 + + +From 0156b13d7d18548e4b8bb9f701c378e78fb264f2 Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner +Date: Mon, 14 Mar 2016 09:40:46 +0100 +Subject: [PATCH 043/384] x86/irq: Cure live lock in fixup_irqs() + +commit 551adc60573cb68e3d55cacca9ba1b7437313df7 upstream. + +Harry reported, that he's able to trigger a system freeze with cpu hot +unplug. The freeze turned out to be a live lock caused by recent changes in +irq_force_complete_move(). + +When fixup_irqs() and from there irq_force_complete_move() is called on the +dying cpu, then all other cpus are in stop machine an wait for the dying cpu +to complete the teardown. If there is a move of an interrupt pending then +irq_force_complete_move() sends the cleanup IPI to the cpus in the old_domain +mask and waits for them to clear the mask. That's obviously impossible as +those cpus are firmly stuck in stop machine with interrupts disabled. + +I should have known that, but I completely overlooked it being concentrated on +the locking issues around the vectors. And the existance of the call to +__irq_complete_move() in the code, which actually sends the cleanup IPI made +it reasonable to wait for that cleanup to complete. That call was bogus even +before the recent changes as it was just a pointless distraction. + +We have to look at two cases: + +1) The move_in_progress flag of the interrupt is set + + This means the ioapic has been updated with the new vector, but it has not + fired yet. In theory there is a race: + + set_ioapic(new_vector) <-- Interrupt is raised before update is effective, + i.e. it's raised on the old vector. + + So if the target cpu cannot handle that interrupt before the old vector is + cleaned up, we get a spurious interrupt and in the worst case the ioapic + irq line becomes stale, but my experiments so far have only resulted in + spurious interrupts. + + But in case of cpu hotplug this should be a non issue because if the + affinity update happens right before all cpus rendevouz in stop machine, + there is no way that the interrupt can be blocked on the target cpu because + all cpus loops first with interrupts enabled in stop machine, so the old + vector is not yet cleaned up when the interrupt fires. + + So the only way to run into this issue is if the delivery of the interrupt + on the apic/system bus would be delayed beyond the point where the target + cpu disables interrupts in stop machine. I doubt that it can happen, but at + least there is a theroretical chance. Virtualization might be able to + expose this, but AFAICT the IOAPIC emulation is not as stupid as the real + hardware. + + I've spent quite some time over the weekend to enforce that situation, + though I was not able to trigger the delayed case. + +2) The move_in_progress flag is not set and the old_domain cpu mask is not + empty. + + That means, that an interrupt was delivered after the change and the + cleanup IPI has been sent to the cpus in old_domain, but not all CPUs have + responded to it yet. + +In both cases we can assume that the next interrupt will arrive on the new +vector, so we can cleanup the old vectors on the cpus in the old_domain cpu +mask. + +Fixes: 98229aa36caa "x86/irq: Plug vector cleanup race" +Reported-by: Harry Junior +Tested-by: Tony Luck +Signed-off-by: Thomas Gleixner +Cc: Peter Zijlstra +Cc: Joe Lawrence +Cc: Borislav Petkov +Cc: Ben Hutchings +Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1603140931430.3657@nanos +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/include/asm/hw_irq.h | 1 + + arch/x86/kernel/apic/vector.c | 88 ++++++++++++++++++++++++++++++++++--------- + 2 files changed, 71 insertions(+), 18 deletions(-) + +diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h +index 1e3408e..59caa55 100644 +--- a/arch/x86/include/asm/hw_irq.h ++++ b/arch/x86/include/asm/hw_irq.h +@@ -136,6 +136,7 @@ struct irq_alloc_info { + struct irq_cfg { + unsigned int dest_apicid; + u8 vector; ++ u8 old_vector; + }; + + extern struct irq_cfg *irq_cfg(unsigned int irq); +diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c +index a35f6b5..7af2505 100644 +--- a/arch/x86/kernel/apic/vector.c ++++ b/arch/x86/kernel/apic/vector.c +@@ -211,6 +211,7 @@ update: + */ + cpumask_and(d->old_domain, d->old_domain, cpu_online_mask); + d->move_in_progress = !cpumask_empty(d->old_domain); ++ d->cfg.old_vector = d->move_in_progress ? d->cfg.vector : 0; + d->cfg.vector = vector; + cpumask_copy(d->domain, vector_cpumask); + success: +@@ -653,46 +654,97 @@ void irq_complete_move(struct irq_cfg *cfg) + } + + /* +- * Called with @desc->lock held and interrupts disabled. ++ * Called from fixup_irqs() with @desc->lock held and interrupts disabled. + */ + void irq_force_complete_move(struct irq_desc *desc) + { + struct irq_data *irqdata = irq_desc_get_irq_data(desc); + struct apic_chip_data *data = apic_chip_data(irqdata); + struct irq_cfg *cfg = data ? &data->cfg : NULL; ++ unsigned int cpu; + + if (!cfg) + return; + +- __irq_complete_move(cfg, cfg->vector); +- + /* + * This is tricky. If the cleanup of @data->old_domain has not been + * done yet, then the following setaffinity call will fail with + * -EBUSY. This can leave the interrupt in a stale state. + * +- * The cleanup cannot make progress because we hold @desc->lock. So in +- * case @data->old_domain is not yet cleaned up, we need to drop the +- * lock and acquire it again. @desc cannot go away, because the +- * hotplug code holds the sparse irq lock. ++ * All CPUs are stuck in stop machine with interrupts disabled so ++ * calling __irq_complete_move() would be completely pointless. + */ + raw_spin_lock(&vector_lock); +- /* Clean out all offline cpus (including ourself) first. */ ++ /* ++ * Clean out all offline cpus (including the outgoing one) from the ++ * old_domain mask. ++ */ + cpumask_and(data->old_domain, data->old_domain, cpu_online_mask); +- while (!cpumask_empty(data->old_domain)) { ++ ++ /* ++ * If move_in_progress is cleared and the old_domain mask is empty, ++ * then there is nothing to cleanup. fixup_irqs() will take care of ++ * the stale vectors on the outgoing cpu. ++ */ ++ if (!data->move_in_progress && cpumask_empty(data->old_domain)) { + raw_spin_unlock(&vector_lock); +- raw_spin_unlock(&desc->lock); +- cpu_relax(); +- raw_spin_lock(&desc->lock); ++ return; ++ } ++ ++ /* ++ * 1) The interrupt is in move_in_progress state. That means that we ++ * have not seen an interrupt since the io_apic was reprogrammed to ++ * the new vector. ++ * ++ * 2) The interrupt has fired on the new vector, but the cleanup IPIs ++ * have not been processed yet. ++ */ ++ if (data->move_in_progress) { + /* +- * Reevaluate apic_chip_data. It might have been cleared after +- * we dropped @desc->lock. ++ * In theory there is a race: ++ * ++ * set_ioapic(new_vector) <-- Interrupt is raised before update ++ * is effective, i.e. it's raised on ++ * the old vector. ++ * ++ * So if the target cpu cannot handle that interrupt before ++ * the old vector is cleaned up, we get a spurious interrupt ++ * and in the worst case the ioapic irq line becomes stale. ++ * ++ * But in case of cpu hotplug this should be a non issue ++ * because if the affinity update happens right before all ++ * cpus rendevouz in stop machine, there is no way that the ++ * interrupt can be blocked on the target cpu because all cpus ++ * loops first with interrupts enabled in stop machine, so the ++ * old vector is not yet cleaned up when the interrupt fires. ++ * ++ * So the only way to run into this issue is if the delivery ++ * of the interrupt on the apic/system bus would be delayed ++ * beyond the point where the target cpu disables interrupts ++ * in stop machine. I doubt that it can happen, but at least ++ * there is a theroretical chance. Virtualization might be ++ * able to expose this, but AFAICT the IOAPIC emulation is not ++ * as stupid as the real hardware. ++ * ++ * Anyway, there is nothing we can do about that at this point ++ * w/o refactoring the whole fixup_irq() business completely. ++ * We print at least the irq number and the old vector number, ++ * so we have the necessary information when a problem in that ++ * area arises. + */ +- data = apic_chip_data(irqdata); +- if (!data) +- return; +- raw_spin_lock(&vector_lock); ++ pr_warn("IRQ fixup: irq %d move in progress, old vector %d\n", ++ irqdata->irq, cfg->old_vector); + } ++ /* ++ * If old_domain is not empty, then other cpus still have the irq ++ * descriptor set in their vector array. Clean it up. ++ */ ++ for_each_cpu(cpu, data->old_domain) ++ per_cpu(vector_irq, cpu)[cfg->old_vector] = VECTOR_UNUSED; ++ ++ /* Cleanup the left overs of the (half finished) move */ ++ cpumask_clear(data->old_domain); ++ data->move_in_progress = 0; + raw_spin_unlock(&vector_lock); + } + #endif +-- +2.7.1 + + +From c47827e90c90effdbc55b2668949a098698b5ba3 Mon Sep 17 00:00:00 2001 +From: Dave Jones +Date: Mon, 14 Mar 2016 21:20:54 -0400 +Subject: [PATCH 044/384] x86/apic: Fix suspicious RCU usage in + smp_trace_call_function_interrupt() + +commit 7834c10313fb823e538f2772be78edcdeed2e6e3 upstream. + +Since 4.4, I've been able to trigger this occasionally: + +=============================== +[ INFO: suspicious RCU usage. ] +4.5.0-rc7-think+ #3 Not tainted +Cc: Andi Kleen +Link: http://lkml.kernel.org/r/20160315012054.GA17765@codemonkey.org.uk +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +------------------------------- +./arch/x86/include/asm/msr-trace.h:47 suspicious rcu_dereference_check() usage! + +other info that might help us debug this: + +RCU used illegally from idle CPU! +rcu_scheduler_active = 1, debug_locks = 1 +RCU used illegally from extended quiescent state! +no locks held by swapper/3/0. + +stack backtrace: +CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.5.0-rc7-think+ #3 + ffffffff92f821e0 1f3e5c340597d7fc ffff880468e07f10 ffffffff92560c2a + ffff880462145280 0000000000000001 ffff880468e07f40 ffffffff921376a6 + ffffffff93665ea0 0000cc7c876d28da 0000000000000005 ffffffff9383dd60 +Call Trace: + [] dump_stack+0x67/0x9d + [] lockdep_rcu_suspicious+0xe6/0x100 + [] do_trace_write_msr+0x127/0x1a0 + [] native_apic_msr_eoi_write+0x23/0x30 + [] smp_trace_call_function_interrupt+0x38/0x360 + [] trace_call_function_interrupt+0x90/0xa0 + [] ? cpuidle_enter_state+0x1b4/0x520 + +Move the entering_irq() call before ack_APIC_irq(), because entering_irq() +tells the RCU susbstems to end the extended quiescent state, so that the +following trace call in ack_APIC_irq() works correctly. + +Suggested-by: Andi Kleen +Fixes: 4787c368a9bc "x86/tracing: Add irq_enter/exit() in smp_trace_reschedule_interrupt()" +Signed-off-by: Dave Jones +Signed-off-by: Thomas Gleixner +--- + arch/x86/include/asm/apic.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h +index a30316b..163769d 100644 +--- a/arch/x86/include/asm/apic.h ++++ b/arch/x86/include/asm/apic.h +@@ -638,8 +638,8 @@ static inline void entering_irq(void) + + static inline void entering_ack_irq(void) + { +- ack_APIC_irq(); + entering_irq(); ++ ack_APIC_irq(); + } + + static inline void ipi_entering_ack_irq(void) +-- +2.7.1 + + +From 7494d8aa64c40f4e07c51e064799be83314a4eec Mon Sep 17 00:00:00 2001 +From: Andy Lutomirski +Date: Wed, 16 Mar 2016 14:14:21 -0700 +Subject: [PATCH 045/384] x86/iopl/64: Properly context-switch IOPL on Xen PV + +commit b7a584598aea7ca73140cb87b40319944dd3393f upstream. + +On Xen PV, regs->flags doesn't reliably reflect IOPL and the +exit-to-userspace code doesn't change IOPL. We need to context +switch it manually. + +I'm doing this without going through paravirt because this is +specific to Xen PV. After the dust settles, we can merge this with +the 32-bit code, tidy up the iopl syscall implementation, and remove +the set_iopl pvop entirely. + +Fixes XSA-171. + +Reviewewd-by: Jan Beulich +Signed-off-by: Andy Lutomirski +Cc: Andrew Cooper +Cc: Andy Lutomirski +Cc: Boris Ostrovsky +Cc: Borislav Petkov +Cc: Brian Gerst +Cc: David Vrabel +Cc: Denys Vlasenko +Cc: H. Peter Anvin +Cc: Jan Beulich +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Link: http://lkml.kernel.org/r/693c3bd7aeb4d3c27c92c622b7d0f554a458173c.1458162709.git.luto@kernel.org +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/include/asm/xen/hypervisor.h | 2 ++ + arch/x86/kernel/process_64.c | 12 ++++++++++++ + arch/x86/xen/enlighten.c | 2 +- + 3 files changed, 15 insertions(+), 1 deletion(-) + +diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/xen/hypervisor.h +index 8b2d4be..39171b3 100644 +--- a/arch/x86/include/asm/xen/hypervisor.h ++++ b/arch/x86/include/asm/xen/hypervisor.h +@@ -62,4 +62,6 @@ void xen_arch_register_cpu(int num); + void xen_arch_unregister_cpu(int num); + #endif + ++extern void xen_set_iopl_mask(unsigned mask); ++ + #endif /* _ASM_X86_XEN_HYPERVISOR_H */ +diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c +index e835d26..4cbb60f 100644 +--- a/arch/x86/kernel/process_64.c ++++ b/arch/x86/kernel/process_64.c +@@ -48,6 +48,7 @@ + #include + #include + #include ++#include + + asmlinkage extern void ret_from_fork(void); + +@@ -411,6 +412,17 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) + task_thread_info(prev_p)->flags & _TIF_WORK_CTXSW_PREV)) + __switch_to_xtra(prev_p, next_p, tss); + ++#ifdef CONFIG_XEN ++ /* ++ * On Xen PV, IOPL bits in pt_regs->flags have no effect, and ++ * current_pt_regs()->flags may not match the current task's ++ * intended IOPL. We need to switch it manually. ++ */ ++ if (unlikely(static_cpu_has(X86_FEATURE_XENPV) && ++ prev->iopl != next->iopl)) ++ xen_set_iopl_mask(next->iopl); ++#endif ++ + if (static_cpu_has_bug(X86_BUG_SYSRET_SS_ATTRS)) { + /* + * AMD CPUs have a misfeature: SYSRET sets the SS selector but +diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c +index b7de78b..beab8c7 100644 +--- a/arch/x86/xen/enlighten.c ++++ b/arch/x86/xen/enlighten.c +@@ -961,7 +961,7 @@ static void xen_load_sp0(struct tss_struct *tss, + tss->x86_tss.sp0 = thread->sp0; + } + +-static void xen_set_iopl_mask(unsigned mask) ++void xen_set_iopl_mask(unsigned mask) + { + struct physdev_set_iopl set_iopl; + +-- +2.7.1 + + +From a2475de2b98272ef937701c51caa91524a5fc646 Mon Sep 17 00:00:00 2001 +From: Andy Lutomirski +Date: Wed, 16 Mar 2016 14:14:22 -0700 +Subject: [PATCH 046/384] x86/iopl: Fix iopl capability check on Xen PV + +commit c29016cf41fe9fa994a5ecca607cf5f1cd98801e upstream. + +iopl(3) is supposed to work if iopl is already 3, even if +unprivileged. This didn't work right on Xen PV. Fix it. + +Reviewewd-by: Jan Beulich +Signed-off-by: Andy Lutomirski +Cc: Andrew Cooper +Cc: Andy Lutomirski +Cc: Boris Ostrovsky +Cc: Borislav Petkov +Cc: Brian Gerst +Cc: David Vrabel +Cc: Denys Vlasenko +Cc: H. Peter Anvin +Cc: Jan Beulich +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Link: http://lkml.kernel.org/r/8ce12013e6e4c0a44a97e316be4a6faff31bd5ea.1458162709.git.luto@kernel.org +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kernel/ioport.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c +index 37dae79..589b319 100644 +--- a/arch/x86/kernel/ioport.c ++++ b/arch/x86/kernel/ioport.c +@@ -96,9 +96,14 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on) + SYSCALL_DEFINE1(iopl, unsigned int, level) + { + struct pt_regs *regs = current_pt_regs(); +- unsigned int old = (regs->flags >> 12) & 3; + struct thread_struct *t = ¤t->thread; + ++ /* ++ * Careful: the IOPL bits in regs->flags are undefined under Xen PV ++ * and changing them has no effect. ++ */ ++ unsigned int old = t->iopl >> X86_EFLAGS_IOPL_BIT; ++ + if (level > 3) + return -EINVAL; + /* Trying to gain more privileges? */ +@@ -106,8 +111,9 @@ SYSCALL_DEFINE1(iopl, unsigned int, level) + if (!capable(CAP_SYS_RAWIO)) + return -EPERM; + } +- regs->flags = (regs->flags & ~X86_EFLAGS_IOPL) | (level << 12); +- t->iopl = level << 12; ++ regs->flags = (regs->flags & ~X86_EFLAGS_IOPL) | ++ (level << X86_EFLAGS_IOPL_BIT); ++ t->iopl = level << X86_EFLAGS_IOPL_BIT; + set_iopl_mask(t->iopl); + + return 0; +-- +2.7.1 + + +From 11c15c06358da032762810b55a45d5ba543d701c Mon Sep 17 00:00:00 2001 +From: Nadav Amit +Date: Fri, 1 Apr 2016 14:31:23 -0700 +Subject: [PATCH 047/384] x86/mm: TLB_REMOTE_SEND_IPI should count pages + +commit 18c98243ddf05a1827ad2c359c5ac051101e7ff7 upstream. + +TLB_REMOTE_SEND_IPI was recently introduced, but it counts bytes instead +of pages. In addition, it does not report correctly the case in which +flush_tlb_page flushes a page. Fix it to be consistent with other TLB +counters. + +Fixes: 5b74283ab251b9d ("x86, mm: trace when an IPI is about to be sent") +Signed-off-by: Nadav Amit +Cc: Mel Gorman +Cc: Rik van Riel +Cc: Dave Hansen +Cc: Ingo Molnar +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/mm/tlb.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c +index 8f4cc3d..5fb6ada 100644 +--- a/arch/x86/mm/tlb.c ++++ b/arch/x86/mm/tlb.c +@@ -106,8 +106,6 @@ static void flush_tlb_func(void *info) + + if (f->flush_mm != this_cpu_read(cpu_tlbstate.active_mm)) + return; +- if (!f->flush_end) +- f->flush_end = f->flush_start + PAGE_SIZE; + + count_vm_tlb_event(NR_TLB_REMOTE_FLUSH_RECEIVED); + if (this_cpu_read(cpu_tlbstate.state) == TLBSTATE_OK) { +@@ -135,12 +133,20 @@ void native_flush_tlb_others(const struct cpumask *cpumask, + unsigned long end) + { + struct flush_tlb_info info; ++ ++ if (end == 0) ++ end = start + PAGE_SIZE; + info.flush_mm = mm; + info.flush_start = start; + info.flush_end = end; + + count_vm_tlb_event(NR_TLB_REMOTE_FLUSH); +- trace_tlb_flush(TLB_REMOTE_SEND_IPI, end - start); ++ if (end == TLB_FLUSH_ALL) ++ trace_tlb_flush(TLB_REMOTE_SEND_IPI, TLB_FLUSH_ALL); ++ else ++ trace_tlb_flush(TLB_REMOTE_SEND_IPI, ++ (end - start) >> PAGE_SHIFT); ++ + if (is_uv_system()) { + unsigned int cpu; + +-- +2.7.1 + + +From b749f56dd4b68f429e9175c635fe1a2720d66f4e Mon Sep 17 00:00:00 2001 +From: Douglas Gilbert +Date: Thu, 3 Mar 2016 00:31:29 -0500 +Subject: [PATCH 048/384] sg: fix dxferp in from_to case + +commit 5ecee0a3ee8d74b6950cb41e8989b0c2174568d4 upstream. + +One of the strange things that the original sg driver did was let the +user provide both a data-out buffer (it followed the sg_header+cdb) +_and_ specify a reply length greater than zero. What happened was that +the user data-out buffer was copied into some kernel buffers and then +the mid level was told a read type operation would take place with the +data from the device overwriting the same kernel buffers. The user would +then read those kernel buffers back into the user space. + +From what I can tell, the above action was broken by commit fad7f01e61bf +("sg: set dxferp to NULL for READ with the older SG interface") in 2008 +and syzkaller found that out recently. + +Make sure that a user space pointer is passed through when data follows +the sg_header structure and command. Fix the abnormal case when a +non-zero reply_len is also given. + +Fixes: fad7f01e61bf737fe8a3740d803f000db57ecac6 +Signed-off-by: Douglas Gilbert +Reviewed-by: Ewan Milne +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/sg.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c +index 5e82067..ae7d9bd 100644 +--- a/drivers/scsi/sg.c ++++ b/drivers/scsi/sg.c +@@ -652,7 +652,8 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) + else + hp->dxfer_direction = (mxsize > 0) ? SG_DXFER_FROM_DEV : SG_DXFER_NONE; + hp->dxfer_len = mxsize; +- if (hp->dxfer_direction == SG_DXFER_TO_DEV) ++ if ((hp->dxfer_direction == SG_DXFER_TO_DEV) || ++ (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV)) + hp->dxferp = (char __user *)buf + cmd_size; + else + hp->dxferp = NULL; +-- +2.7.1 + + +From 92260e4145457f500164b02e3a580f1a2e00507f Mon Sep 17 00:00:00 2001 +From: Raghava Aditya Renukunta +Date: Wed, 3 Feb 2016 15:06:00 -0800 +Subject: [PATCH 049/384] aacraid: Fix RRQ overload + +commit 3f4ce057d51a9c0ed9b01ba693df685d230ffcae upstream. + +The driver utilizes an array of atomic variables to keep track of IO +submissions to each vector. To submit an IO multiple threads iterate +through the array to find a vector which has empty slots to send an +IO. The reading and updating of the variable is not atomic, causing race +conditions when a thread uses a full vector to submit an IO. + +Fixed by mapping each FIB to a vector, the submission path then uses +said vector to submit IO thereby removing the possibly of a race +condition.The vector assignment is started from 1 since vector 0 is +reserved for the use of AIF management FIBS.If the number of MSIx +vectors is 1 (MSI or INTx mode) then all the fibs are allocated to +vector 0. + +Fixes: 495c0217 "aacraid: MSI-x support" +Signed-off-by: Raghava Aditya Renukunta +Reviewed-by: Johannes Thumshirn +Reviewed-by: Tomas Henzl +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/aacraid/aacraid.h | 2 ++ + drivers/scsi/aacraid/commsup.c | 28 ++++++++++++++++++++++++++++ + drivers/scsi/aacraid/src.c | 30 +++++++----------------------- + 3 files changed, 37 insertions(+), 23 deletions(-) + +diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h +index 074878b..d044f3f 100644 +--- a/drivers/scsi/aacraid/aacraid.h ++++ b/drivers/scsi/aacraid/aacraid.h +@@ -944,6 +944,7 @@ struct fib { + */ + struct list_head fiblink; + void *data; ++ u32 vector_no; + struct hw_fib *hw_fib_va; /* Actual shared object */ + dma_addr_t hw_fib_pa; /* physical address of hw_fib*/ + }; +@@ -2113,6 +2114,7 @@ static inline unsigned int cap_to_cyls(sector_t capacity, unsigned divisor) + int aac_acquire_irq(struct aac_dev *dev); + void aac_free_irq(struct aac_dev *dev); + const char *aac_driverinfo(struct Scsi_Host *); ++void aac_fib_vector_assign(struct aac_dev *dev); + struct fib *aac_fib_alloc(struct aac_dev *dev); + int aac_fib_setup(struct aac_dev *dev); + void aac_fib_map_free(struct aac_dev *dev); +diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c +index a1f90fe..e9b4c11 100644 +--- a/drivers/scsi/aacraid/commsup.c ++++ b/drivers/scsi/aacraid/commsup.c +@@ -90,6 +90,28 @@ void aac_fib_map_free(struct aac_dev *dev) + dev->hw_fib_pa = 0; + } + ++void aac_fib_vector_assign(struct aac_dev *dev) ++{ ++ u32 i = 0; ++ u32 vector = 1; ++ struct fib *fibptr = NULL; ++ ++ for (i = 0, fibptr = &dev->fibs[i]; ++ i < (dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB); ++ i++, fibptr++) { ++ if ((dev->max_msix == 1) || ++ (i > ((dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB - 1) ++ - dev->vector_cap))) { ++ fibptr->vector_no = 0; ++ } else { ++ fibptr->vector_no = vector; ++ vector++; ++ if (vector == dev->max_msix) ++ vector = 1; ++ } ++ } ++} ++ + /** + * aac_fib_setup - setup the fibs + * @dev: Adapter to set up +@@ -151,6 +173,12 @@ int aac_fib_setup(struct aac_dev * dev) + hw_fib_pa = hw_fib_pa + + dev->max_fib_size + sizeof(struct aac_fib_xporthdr); + } ++ ++ /* ++ *Assign vector numbers to fibs ++ */ ++ aac_fib_vector_assign(dev); ++ + /* + * Add the fib chain to the free list + */ +diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c +index 2aa34ea..bc0203f 100644 +--- a/drivers/scsi/aacraid/src.c ++++ b/drivers/scsi/aacraid/src.c +@@ -156,8 +156,8 @@ static irqreturn_t aac_src_intr_message(int irq, void *dev_id) + break; + if (dev->msi_enabled && dev->max_msix > 1) + atomic_dec(&dev->rrq_outstanding[vector_no]); +- aac_intr_normal(dev, handle-1, 0, isFastResponse, NULL); + dev->host_rrq[index++] = 0; ++ aac_intr_normal(dev, handle-1, 0, isFastResponse, NULL); + if (index == (vector_no + 1) * dev->vector_cap) + index = vector_no * dev->vector_cap; + dev->host_rrq_idx[vector_no] = index; +@@ -452,36 +452,20 @@ static int aac_src_deliver_message(struct fib *fib) + #endif + + u16 hdr_size = le16_to_cpu(fib->hw_fib_va->header.Size); ++ u16 vector_no; + + atomic_inc(&q->numpending); + + if (dev->msi_enabled && fib->hw_fib_va->header.Command != AifRequest && + dev->max_msix > 1) { +- u_int16_t vector_no, first_choice = 0xffff; +- +- vector_no = dev->fibs_pushed_no % dev->max_msix; +- do { +- vector_no += 1; +- if (vector_no == dev->max_msix) +- vector_no = 1; +- if (atomic_read(&dev->rrq_outstanding[vector_no]) < +- dev->vector_cap) +- break; +- if (0xffff == first_choice) +- first_choice = vector_no; +- else if (vector_no == first_choice) +- break; +- } while (1); +- if (vector_no == first_choice) +- vector_no = 0; +- atomic_inc(&dev->rrq_outstanding[vector_no]); +- if (dev->fibs_pushed_no == 0xffffffff) +- dev->fibs_pushed_no = 0; +- else +- dev->fibs_pushed_no++; ++ vector_no = fib->vector_no; + fib->hw_fib_va->header.Handle += (vector_no << 16); ++ } else { ++ vector_no = 0; + } + ++ atomic_inc(&dev->rrq_outstanding[vector_no]); ++ + if (dev->comm_interface == AAC_COMM_MESSAGE_TYPE2) { + /* Calculate the amount to the fibsize bits */ + fibsize = (hdr_size + 127) / 128 - 1; +-- +2.7.1 + + +From 9a5e1586770e0f4fd602d19c03d8c7079690ca9d Mon Sep 17 00:00:00 2001 +From: Raghava Aditya Renukunta +Date: Wed, 3 Feb 2016 15:06:02 -0800 +Subject: [PATCH 050/384] aacraid: Fix memory leak in aac_fib_map_free + +commit f88fa79a61726ce9434df9b4aede36961f709f17 upstream. + +aac_fib_map_free() calls pci_free_consistent() without checking that +dev->hw_fib_va is not NULL and dev->max_fib_size is not zero.If they are +indeed NULL/0, this will result in a hang as pci_free_consistent() will +attempt to invalidate cache for the entire 64-bit address space +(which would take a very long time). + +Fixed by adding a check to make sure that dev->hw_fib_va and +dev->max_fib_size are not NULL and 0 respectively. + +Fixes: 9ad5204d6 - "[SCSI]aacraid: incorrect dma mapping mask during blinked recover or user initiated reset" +Signed-off-by: Raghava Aditya Renukunta +Reviewed-by: Johannes Thumshirn +Reviewed-by: Tomas Henzl +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/aacraid/commsup.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c +index e9b4c11..4cbf549 100644 +--- a/drivers/scsi/aacraid/commsup.c ++++ b/drivers/scsi/aacraid/commsup.c +@@ -83,9 +83,12 @@ static int fib_map_alloc(struct aac_dev *dev) + + void aac_fib_map_free(struct aac_dev *dev) + { +- pci_free_consistent(dev->pdev, +- dev->max_fib_size * (dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB), +- dev->hw_fib_va, dev->hw_fib_pa); ++ if (dev->hw_fib_va && dev->max_fib_size) { ++ pci_free_consistent(dev->pdev, ++ (dev->max_fib_size * ++ (dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB)), ++ dev->hw_fib_va, dev->hw_fib_pa); ++ } + dev->hw_fib_va = NULL; + dev->hw_fib_pa = 0; + } +-- +2.7.1 + + +From 725c991e4dbdc33da1f06ff3fb2737592c61020a Mon Sep 17 00:00:00 2001 +From: Raghava Aditya Renukunta +Date: Wed, 3 Feb 2016 15:06:03 -0800 +Subject: [PATCH 051/384] aacraid: Set correct msix count for EEH recovery + +commit ecc479e00db8eb110b200afe1effcb3df20ca7ae upstream. + +During EEH recovery number of online CPU's might change thereby changing +the number of MSIx vectors. Since each fib is allocated to a vector, +changes in the number of vectors causes fib to be sent thru invalid +vectors.In addition the correct number of MSIx vectors is not updated in +the INIT struct sent to the controller, when it is reinitialized. + +Fixed by reassigning vectors to fibs based on the updated number of MSIx +vectors and updating the INIT structure before sending to controller. + +Fixes: MSI-X vector calculation for suspend/resume +Signed-off-by: Raghava Aditya Renukunta +Reviewed-by: Shane Seymour +Reviewed-by: Johannes Thumshirn +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/aacraid/linit.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c +index 3b6e5c6..aa6eccb 100644 +--- a/drivers/scsi/aacraid/linit.c ++++ b/drivers/scsi/aacraid/linit.c +@@ -1404,8 +1404,18 @@ static int aac_acquire_resources(struct aac_dev *dev) + + aac_adapter_enable_int(dev); + +- if (!dev->sync_mode) ++ /*max msix may change after EEH ++ * Re-assign vectors to fibs ++ */ ++ aac_fib_vector_assign(dev); ++ ++ if (!dev->sync_mode) { ++ /* After EEH recovery or suspend resume, max_msix count ++ * may change, therfore updating in init as well. ++ */ + aac_adapter_start(dev); ++ dev->init->Sa_MSIXVectors = cpu_to_le32(dev->max_msix); ++ } + return 0; + + error_iounmap: +-- +2.7.1 + + +From 424627b65de5db9e5b9f054517b4b564a6dfc0c5 Mon Sep 17 00:00:00 2001 +From: "Martin K. Petersen" +Date: Sat, 5 Mar 2016 17:52:02 -0500 +Subject: [PATCH 052/384] sd: Fix discard granularity when LBPRZ=1 + +commit 6540a65da90c09590897310e31993b1f6e28485a upstream. + +Commit 397737223c59 ("sd: Make discard granularity match logical block +size when LBPRZ=1") accidentally set the granularity to one byte instead +of one logical block on devices that provide deterministic zeroes after +UNMAP. + +Signed-off-by: Martin K. Petersen +Reported-by: Mike Snitzer +Reviewed-by: Ewan Milne +Reviewed-by: Bart Van Assche +Fixes: 397737223c59e89dca7305feb6528caef8fbef84 +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/sd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c +index bb669d3..cc84ea7 100644 +--- a/drivers/scsi/sd.c ++++ b/drivers/scsi/sd.c +@@ -648,7 +648,7 @@ static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode) + */ + if (sdkp->lbprz) { + q->limits.discard_alignment = 0; +- q->limits.discard_granularity = 1; ++ q->limits.discard_granularity = logical_block_size; + } else { + q->limits.discard_alignment = sdkp->unmap_alignment * + logical_block_size; +-- +2.7.1 + + +From c22ed0e45a6b04895e79f5a1dcada74a92d151bb Mon Sep 17 00:00:00 2001 +From: Vitaly Kuznetsov +Date: Mon, 7 Mar 2016 11:59:44 +0100 +Subject: [PATCH 053/384] scsi: storvsc: fix SRB_STATUS_ABORTED handling + +commit ff06c5ffbcb4ffa542fb80c897be977956fafecc upstream. + +Commit 3209f9d780d1 ("scsi: storvsc: Fix a bug in the handling of SRB +status flags") filtered SRB_STATUS_AUTOSENSE_VALID out effectively making +the (SRB_STATUS_ABORTED | SRB_STATUS_AUTOSENSE_VALID) case a dead code. The +logic from this branch (e.g. storvsc_device_scan() call) is still required, +fix the check. + +Fixes: 3209f9d780d1 ("scsi: storvsc: Fix a bug in the handling of SRB status flags") +Signed-off-by: Vitaly Kuznetsov +Acked-by: K. Y. Srinivasan +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/storvsc_drv.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c +index 3fba42a..0f636cc 100644 +--- a/drivers/scsi/storvsc_drv.c ++++ b/drivers/scsi/storvsc_drv.c +@@ -889,8 +889,9 @@ static void storvsc_handle_error(struct vmscsi_request *vm_srb, + do_work = true; + process_err_fn = storvsc_remove_lun; + break; +- case (SRB_STATUS_ABORTED | SRB_STATUS_AUTOSENSE_VALID): +- if ((asc == 0x2a) && (ascq == 0x9)) { ++ case SRB_STATUS_ABORTED: ++ if (vm_srb->srb_status & SRB_STATUS_AUTOSENSE_VALID && ++ (asc == 0x2a) && (ascq == 0x9)) { + do_work = true; + process_err_fn = storvsc_device_scan; + /* +-- +2.7.1 + + +From 86ee495cc0bfee967b6c3e5ff1f00be4ad24d3f4 Mon Sep 17 00:00:00 2001 +From: Maurizio Lombardi +Date: Fri, 4 Mar 2016 10:41:49 +0100 +Subject: [PATCH 054/384] be2iscsi: set the boot_kset pointer to NULL in case + of failure + +commit 84bd64993f916bcf86270c67686ecf4cea7b8933 upstream. + +In beiscsi_setup_boot_info(), the boot_kset pointer should be set to +NULL in case of failure otherwise an invalid pointer dereference may +occur later. + +Signed-off-by: Maurizio Lombardi +Reviewed-by: Johannes Thumshirn +Reviewed-by: Jitendra Bhivare +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/be2iscsi/be_main.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c +index fe0c514..758f76e 100644 +--- a/drivers/scsi/be2iscsi/be_main.c ++++ b/drivers/scsi/be2iscsi/be_main.c +@@ -4470,6 +4470,7 @@ put_shost: + scsi_host_put(phba->shost); + free_kset: + iscsi_boot_destroy_kset(phba->boot_kset); ++ phba->boot_kset = NULL; + return -ENOMEM; + } + +-- +2.7.1 + + +From e30460ef959668eb463ec234dafcabbeff4ad7f2 Mon Sep 17 00:00:00 2001 +From: Alan +Date: Mon, 15 Feb 2016 18:53:15 +0000 +Subject: [PATCH 055/384] aic7xxx: Fix queue depth handling + +commit 5a51a7abca133860a6f4429655a9eda3c4afde32 upstream. + +We were setting the queue depth correctly, then setting it back to +two. If you hit this as a bisection point then please send me an email +as it would imply we've been hiding other bugs with this one. + +Signed-off-by: Alan Cox +Reviewed-by: Hannes Reinicke +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/aic7xxx/aic7xxx_osm.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c +index b846a46..fc6a831 100644 +--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c ++++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c +@@ -1336,6 +1336,7 @@ ahc_platform_set_tags(struct ahc_softc *ahc, struct scsi_device *sdev, + case AHC_DEV_Q_TAGGED: + scsi_change_queue_depth(sdev, + dev->openings + dev->active); ++ break; + default: + /* + * We allow the OS to queue 2 untagged transactions to +-- +2.7.1 + + +From d0a6a6aaaf19f49f4b938159e95556190e21e900 Mon Sep 17 00:00:00 2001 +From: Jerry Hoemann +Date: Wed, 6 Jan 2016 16:03:41 -0700 +Subject: [PATCH 056/384] libnvdimm: Fix security issue with DSM IOCTL. + +commit 07accfa9d1a8bac8262f6d24a94a54d2d1f35149 upstream. + +Code attempts to prevent certain IOCTL DSM from being called +when device is opened read only. This security feature can +be trivially overcome by changing the size portion of the +ioctl_command which isn't used. + +Check only the _IOC_NR (i.e. the command). + +Signed-off-by: Jerry Hoemann +Signed-off-by: Dan Williams +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvdimm/bus.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c +index 7e2c43f..496b9b6 100644 +--- a/drivers/nvdimm/bus.c ++++ b/drivers/nvdimm/bus.c +@@ -513,10 +513,10 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, + + /* fail write commands (when read-only) */ + if (read_only) +- switch (ioctl_cmd) { +- case ND_IOCTL_VENDOR: +- case ND_IOCTL_SET_CONFIG_DATA: +- case ND_IOCTL_ARS_START: ++ switch (cmd) { ++ case ND_CMD_VENDOR: ++ case ND_CMD_SET_CONFIG_DATA: ++ case ND_CMD_ARS_START: + dev_dbg(&nvdimm_bus->dev, "'%s' command while read-only.\n", + nvdimm ? nvdimm_cmd_name(cmd) + : nvdimm_bus_cmd_name(cmd)); +-- +2.7.1 + + +From e6be757ae19d873766cac4e8b21d4380f2aeef76 Mon Sep 17 00:00:00 2001 +From: DingXiang +Date: Tue, 2 Feb 2016 12:29:18 +0800 +Subject: [PATCH 057/384] dm snapshot: disallow the COW and origin devices from + being identical + +commit 4df2bf466a9c9c92f40d27c4aa9120f4e8227bfc upstream. + +Otherwise loading a "snapshot" table using the same device for the +origin and COW devices, e.g.: + +echo "0 20971520 snapshot 253:3 253:3 P 8" | dmsetup create snap + +will trigger: + +BUG: unable to handle kernel NULL pointer dereference at 0000000000000098 +[ 1958.979934] IP: [] dm_exception_store_set_chunk_size+0x7a/0x110 [dm_snapshot] +[ 1958.989655] PGD 0 +[ 1958.991903] Oops: 0000 [#1] SMP +... +[ 1959.059647] CPU: 9 PID: 3556 Comm: dmsetup Tainted: G IO 4.5.0-rc5.snitm+ #150 +... +[ 1959.083517] task: ffff8800b9660c80 ti: ffff88032a954000 task.ti: ffff88032a954000 +[ 1959.091865] RIP: 0010:[] [] dm_exception_store_set_chunk_size+0x7a/0x110 [dm_snapshot] +[ 1959.104295] RSP: 0018:ffff88032a957b30 EFLAGS: 00010246 +[ 1959.110219] RAX: 0000000000000000 RBX: 0000000000000008 RCX: 0000000000000001 +[ 1959.118180] RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff880329334a00 +[ 1959.126141] RBP: ffff88032a957b50 R08: 0000000000000000 R09: 0000000000000001 +[ 1959.134102] R10: 000000000000000a R11: f000000000000000 R12: ffff880330884d80 +[ 1959.142061] R13: 0000000000000008 R14: ffffc90001c13088 R15: ffff880330884d80 +[ 1959.150021] FS: 00007f8926ba3840(0000) GS:ffff880333440000(0000) knlGS:0000000000000000 +[ 1959.159047] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +[ 1959.165456] CR2: 0000000000000098 CR3: 000000032f48b000 CR4: 00000000000006e0 +[ 1959.173415] Stack: +[ 1959.175656] ffffc90001c13040 ffff880329334a00 ffff880330884ed0 ffff88032a957bdc +[ 1959.183946] ffff88032a957bb8 ffffffffa040f225 ffff880329334a30 ffff880300000000 +[ 1959.192233] ffffffffa04133e0 ffff880329334b30 0000000830884d58 00000000569c58cf +[ 1959.200521] Call Trace: +[ 1959.203248] [] dm_exception_store_create+0x1d5/0x240 [dm_snapshot] +[ 1959.211986] [] snapshot_ctr+0x140/0x630 [dm_snapshot] +[ 1959.219469] [] ? dm_split_args+0x64/0x150 [dm_mod] +[ 1959.226656] [] dm_table_add_target+0x177/0x440 [dm_mod] +[ 1959.234328] [] table_load+0x143/0x370 [dm_mod] +[ 1959.241129] [] ? retrieve_status+0x1b0/0x1b0 [dm_mod] +[ 1959.248607] [] ctl_ioctl+0x255/0x4d0 [dm_mod] +[ 1959.255307] [] ? memzero_explicit+0x12/0x20 +[ 1959.261816] [] dm_ctl_ioctl+0x13/0x20 [dm_mod] +[ 1959.268615] [] do_vfs_ioctl+0xa6/0x5c0 +[ 1959.274637] [] ? __audit_syscall_entry+0xaf/0x100 +[ 1959.281726] [] ? do_audit_syscall_entry+0x66/0x70 +[ 1959.288814] [] SyS_ioctl+0x79/0x90 +[ 1959.294450] [] entry_SYSCALL_64_fastpath+0x12/0x71 +... +[ 1959.323277] RIP [] dm_exception_store_set_chunk_size+0x7a/0x110 [dm_snapshot] +[ 1959.333090] RSP +[ 1959.336978] CR2: 0000000000000098 +[ 1959.344121] ---[ end trace b049991ccad1169e ]--- + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1195899 +Signed-off-by: Ding Xiang +Signed-off-by: Mike Snitzer +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/dm-snap.c | 9 +++++++++ + drivers/md/dm-table.c | 36 ++++++++++++++++++++++++------------ + include/linux/device-mapper.h | 2 ++ + 3 files changed, 35 insertions(+), 12 deletions(-) + +diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c +index 61f184a..e108dee 100644 +--- a/drivers/md/dm-snap.c ++++ b/drivers/md/dm-snap.c +@@ -1106,6 +1106,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) + int i; + int r = -EINVAL; + char *origin_path, *cow_path; ++ dev_t origin_dev, cow_dev; + unsigned args_used, num_flush_bios = 1; + fmode_t origin_mode = FMODE_READ; + +@@ -1136,11 +1137,19 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) + ti->error = "Cannot get origin device"; + goto bad_origin; + } ++ origin_dev = s->origin->bdev->bd_dev; + + cow_path = argv[0]; + argv++; + argc--; + ++ cow_dev = dm_get_dev_t(cow_path); ++ if (cow_dev && cow_dev == origin_dev) { ++ ti->error = "COW device cannot be the same as origin device"; ++ r = -EINVAL; ++ goto bad_cow; ++ } ++ + r = dm_get_device(ti, cow_path, dm_table_get_mode(ti->table), &s->cow); + if (r) { + ti->error = "Cannot get COW device"; +diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c +index 061152a..cb5d0da 100644 +--- a/drivers/md/dm-table.c ++++ b/drivers/md/dm-table.c +@@ -365,6 +365,26 @@ static int upgrade_mode(struct dm_dev_internal *dd, fmode_t new_mode, + } + + /* ++ * Convert the path to a device ++ */ ++dev_t dm_get_dev_t(const char *path) ++{ ++ dev_t uninitialized_var(dev); ++ struct block_device *bdev; ++ ++ bdev = lookup_bdev(path); ++ if (IS_ERR(bdev)) ++ dev = name_to_dev_t(path); ++ else { ++ dev = bdev->bd_dev; ++ bdput(bdev); ++ } ++ ++ return dev; ++} ++EXPORT_SYMBOL_GPL(dm_get_dev_t); ++ ++/* + * Add a device to the list, or just increment the usage count if + * it's already present. + */ +@@ -372,23 +392,15 @@ int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode, + struct dm_dev **result) + { + int r; +- dev_t uninitialized_var(dev); ++ dev_t dev; + struct dm_dev_internal *dd; + struct dm_table *t = ti->table; +- struct block_device *bdev; + + BUG_ON(!t); + +- /* convert the path to a device */ +- bdev = lookup_bdev(path); +- if (IS_ERR(bdev)) { +- dev = name_to_dev_t(path); +- if (!dev) +- return -ENODEV; +- } else { +- dev = bdev->bd_dev; +- bdput(bdev); +- } ++ dev = dm_get_dev_t(path); ++ if (!dev) ++ return -ENODEV; + + dd = find_device(&t->devices, dev); + if (!dd) { +diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h +index ec1c61c..899ab9f 100644 +--- a/include/linux/device-mapper.h ++++ b/include/linux/device-mapper.h +@@ -124,6 +124,8 @@ struct dm_dev { + char name[16]; + }; + ++dev_t dm_get_dev_t(const char *path); ++ + /* + * Constructors should call these functions to ensure destination devices + * are opened/closed correctly. +-- +2.7.1 + + +From 201ef6a2d61875621bb114f6dbabc1f24e598881 Mon Sep 17 00:00:00 2001 +From: Mike Snitzer +Date: Fri, 5 Feb 2016 08:49:01 -0500 +Subject: [PATCH 058/384] dm: fix excessive dm-mq context switching + +commit 6acfe68bac7e6f16dc312157b1fa6e2368985013 upstream. + +Request-based DM's blk-mq support (dm-mq) was reported to be 50% slower +than if an underlying null_blk device were used directly. One of the +reasons for this drop in performance is that blk_insert_clone_request() +was calling blk_mq_insert_request() with @async=true. This forced the +use of kblockd_schedule_delayed_work_on() to run the blk-mq hw queues +which ushered in ping-ponging between process context (fio in this case) +and kblockd's kworker to submit the cloned request. The ftrace +function_graph tracer showed: + + kworker-2013 => fio-12190 + fio-12190 => kworker-2013 + ... + kworker-2013 => fio-12190 + fio-12190 => kworker-2013 + ... + +Fixing blk_insert_clone_request()'s blk_mq_insert_request() call to +_not_ use kblockd to submit the cloned requests isn't enough to +eliminate the observed context switches. + +In addition to this dm-mq specific blk-core fix, there are 2 DM core +fixes to dm-mq that (when paired with the blk-core fix) completely +eliminate the observed context switching: + +1) don't blk_mq_run_hw_queues in blk-mq request completion + + Motivated by desire to reduce overhead of dm-mq, punting to kblockd + just increases context switches. + + In my testing against a really fast null_blk device there was no benefit + to running blk_mq_run_hw_queues() on completion (and no other blk-mq + driver does this). So hopefully this change doesn't induce the need for + yet another revert like commit 621739b00e16ca2d ! + +2) use blk_mq_complete_request() in dm_complete_request() + + blk_complete_request() doesn't offer the traditional q->mq_ops vs + .request_fn branching pattern that other historic block interfaces + do (e.g. blk_get_request). Using blk_mq_complete_request() for + blk-mq requests is important for performance. It should be noted + that, like blk_complete_request(), blk_mq_complete_request() doesn't + natively handle partial completions -- but the request-based + DM-multipath target does provide the required partial completion + support by dm.c:end_clone_bio() triggering requeueing of the request + via dm-mpath.c:multipath_end_io()'s return of DM_ENDIO_REQUEUE. + +dm-mq fix #2 is _much_ more important than #1 for eliminating the +context switches. +Before: cpu : usr=15.10%, sys=59.39%, ctx=7905181, majf=0, minf=475 +After: cpu : usr=20.60%, sys=79.35%, ctx=2008, majf=0, minf=472 + +With these changes multithreaded async read IOPs improved from ~950K +to ~1350K for this dm-mq stacked on null_blk test-case. The raw read +IOPs of the underlying null_blk device for the same workload is ~1950K. + +Fixes: 7fb4898e0 ("block: add blk-mq support to blk_insert_cloned_request()") +Fixes: bfebd1cdb ("dm: add full blk-mq support to request-based DM") +Reported-by: Sagi Grimberg +Signed-off-by: Mike Snitzer +Acked-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + block/blk-core.c | 2 +- + drivers/md/dm.c | 13 ++++++------- + 2 files changed, 7 insertions(+), 8 deletions(-) + +diff --git a/block/blk-core.c b/block/blk-core.c +index 2f7afb9..842cfe4 100644 +--- a/block/blk-core.c ++++ b/block/blk-core.c +@@ -2192,7 +2192,7 @@ int blk_insert_cloned_request(struct request_queue *q, struct request *rq) + if (q->mq_ops) { + if (blk_queue_io_stat(q)) + blk_account_io_start(rq, true); +- blk_mq_insert_request(rq, false, true, true); ++ blk_mq_insert_request(rq, false, true, false); + return 0; + } + +diff --git a/drivers/md/dm.c b/drivers/md/dm.c +index 4745d2f..7a2a0b0 100644 +--- a/drivers/md/dm.c ++++ b/drivers/md/dm.c +@@ -1109,12 +1109,8 @@ static void rq_completed(struct mapped_device *md, int rw, bool run_queue) + * back into ->request_fn() could deadlock attempting to grab the + * queue lock again. + */ +- if (run_queue) { +- if (md->queue->mq_ops) +- blk_mq_run_hw_queues(md->queue, true); +- else +- blk_run_queue_async(md->queue); +- } ++ if (!md->queue->mq_ops && run_queue) ++ blk_run_queue_async(md->queue); + + /* + * dm_put() must be at the end of this function. See the comment above +@@ -1336,7 +1332,10 @@ static void dm_complete_request(struct request *rq, int error) + struct dm_rq_target_io *tio = tio_from_request(rq); + + tio->error = error; +- blk_complete_request(rq); ++ if (!rq->q->mq_ops) ++ blk_complete_request(rq); ++ else ++ blk_mq_complete_request(rq, error); + } + + /* +-- +2.7.1 + + +From 639f9821124a425aa4f16f3e5fa6535dca708ea3 Mon Sep 17 00:00:00 2001 +From: Joe Thornber +Date: Tue, 1 Mar 2016 10:58:44 +0000 +Subject: [PATCH 059/384] dm thin metadata: don't issue prefetches if a + transaction abort has failed + +commit 2eae9e4489b4cf83213fa3bd508b5afca3f01780 upstream. + +If a transaction abort has failed then we can no longer use the metadata +device. Typically this happens if the superblock is unreadable. + +This fix addresses a crash seen during metadata device failure testing. + +Fixes: 8a01a6af75 ("dm thin: prefetch missing metadata pages") +Signed-off-by: Joe Thornber +Signed-off-by: Mike Snitzer +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/dm-thin-metadata.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c +index c219a05..911ada6 100644 +--- a/drivers/md/dm-thin-metadata.c ++++ b/drivers/md/dm-thin-metadata.c +@@ -1943,5 +1943,8 @@ bool dm_pool_metadata_needs_check(struct dm_pool_metadata *pmd) + + void dm_pool_issue_prefetches(struct dm_pool_metadata *pmd) + { +- dm_tm_issue_prefetches(pmd->tm); ++ down_read(&pmd->root_lock); ++ if (!pmd->fail_io) ++ dm_tm_issue_prefetches(pmd->tm); ++ up_read(&pmd->root_lock); + } +-- +2.7.1 + + +From 4c7237e3fb4cb3a1a6656565c01089aff2b8a2aa Mon Sep 17 00:00:00 2001 +From: Joe Thornber +Date: Thu, 10 Mar 2016 16:20:58 +0000 +Subject: [PATCH 060/384] dm cache: make sure every metadata function checks + fail_io + +commit d14fcf3dd79c0b8a8d0ba469c44a6b04f3a1403b upstream. + +Otherwise operations may be attempted that will only ever go on to crash +(since the metadata device is either missing or unreliable if 'fail_io' +is set). + +Signed-off-by: Joe Thornber +Signed-off-by: Mike Snitzer +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/dm-cache-metadata.c | 98 +++++++++++++++++++++++++----------------- + drivers/md/dm-cache-metadata.h | 4 +- + drivers/md/dm-cache-target.c | 12 +++++- + 3 files changed, 71 insertions(+), 43 deletions(-) + +diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c +index f6543f3..27f2ef3 100644 +--- a/drivers/md/dm-cache-metadata.c ++++ b/drivers/md/dm-cache-metadata.c +@@ -867,19 +867,40 @@ static int blocks_are_unmapped_or_clean(struct dm_cache_metadata *cmd, + return 0; + } + +-#define WRITE_LOCK(cmd) \ +- if (cmd->fail_io || dm_bm_is_read_only(cmd->bm)) \ ++#define WRITE_LOCK(cmd) \ ++ down_write(&cmd->root_lock); \ ++ if (cmd->fail_io || dm_bm_is_read_only(cmd->bm)) { \ ++ up_write(&cmd->root_lock); \ + return -EINVAL; \ +- down_write(&cmd->root_lock) ++ } + + #define WRITE_LOCK_VOID(cmd) \ +- if (cmd->fail_io || dm_bm_is_read_only(cmd->bm)) \ ++ down_write(&cmd->root_lock); \ ++ if (cmd->fail_io || dm_bm_is_read_only(cmd->bm)) { \ ++ up_write(&cmd->root_lock); \ + return; \ +- down_write(&cmd->root_lock) ++ } + + #define WRITE_UNLOCK(cmd) \ + up_write(&cmd->root_lock) + ++#define READ_LOCK(cmd) \ ++ down_read(&cmd->root_lock); \ ++ if (cmd->fail_io || dm_bm_is_read_only(cmd->bm)) { \ ++ up_read(&cmd->root_lock); \ ++ return -EINVAL; \ ++ } ++ ++#define READ_LOCK_VOID(cmd) \ ++ down_read(&cmd->root_lock); \ ++ if (cmd->fail_io || dm_bm_is_read_only(cmd->bm)) { \ ++ up_read(&cmd->root_lock); \ ++ return; \ ++ } ++ ++#define READ_UNLOCK(cmd) \ ++ up_read(&cmd->root_lock) ++ + int dm_cache_resize(struct dm_cache_metadata *cmd, dm_cblock_t new_cache_size) + { + int r; +@@ -1015,22 +1036,20 @@ int dm_cache_load_discards(struct dm_cache_metadata *cmd, + { + int r; + +- down_read(&cmd->root_lock); ++ READ_LOCK(cmd); + r = __load_discards(cmd, fn, context); +- up_read(&cmd->root_lock); ++ READ_UNLOCK(cmd); + + return r; + } + +-dm_cblock_t dm_cache_size(struct dm_cache_metadata *cmd) ++int dm_cache_size(struct dm_cache_metadata *cmd, dm_cblock_t *result) + { +- dm_cblock_t r; ++ READ_LOCK(cmd); ++ *result = cmd->cache_blocks; ++ READ_UNLOCK(cmd); + +- down_read(&cmd->root_lock); +- r = cmd->cache_blocks; +- up_read(&cmd->root_lock); +- +- return r; ++ return 0; + } + + static int __remove(struct dm_cache_metadata *cmd, dm_cblock_t cblock) +@@ -1188,9 +1207,9 @@ int dm_cache_load_mappings(struct dm_cache_metadata *cmd, + { + int r; + +- down_read(&cmd->root_lock); ++ READ_LOCK(cmd); + r = __load_mappings(cmd, policy, fn, context); +- up_read(&cmd->root_lock); ++ READ_UNLOCK(cmd); + + return r; + } +@@ -1215,18 +1234,18 @@ static int __dump_mappings(struct dm_cache_metadata *cmd) + + void dm_cache_dump(struct dm_cache_metadata *cmd) + { +- down_read(&cmd->root_lock); ++ READ_LOCK_VOID(cmd); + __dump_mappings(cmd); +- up_read(&cmd->root_lock); ++ READ_UNLOCK(cmd); + } + + int dm_cache_changed_this_transaction(struct dm_cache_metadata *cmd) + { + int r; + +- down_read(&cmd->root_lock); ++ READ_LOCK(cmd); + r = cmd->changed; +- up_read(&cmd->root_lock); ++ READ_UNLOCK(cmd); + + return r; + } +@@ -1276,9 +1295,9 @@ int dm_cache_set_dirty(struct dm_cache_metadata *cmd, + void dm_cache_metadata_get_stats(struct dm_cache_metadata *cmd, + struct dm_cache_statistics *stats) + { +- down_read(&cmd->root_lock); ++ READ_LOCK_VOID(cmd); + *stats = cmd->stats; +- up_read(&cmd->root_lock); ++ READ_UNLOCK(cmd); + } + + void dm_cache_metadata_set_stats(struct dm_cache_metadata *cmd, +@@ -1312,9 +1331,9 @@ int dm_cache_get_free_metadata_block_count(struct dm_cache_metadata *cmd, + { + int r = -EINVAL; + +- down_read(&cmd->root_lock); ++ READ_LOCK(cmd); + r = dm_sm_get_nr_free(cmd->metadata_sm, result); +- up_read(&cmd->root_lock); ++ READ_UNLOCK(cmd); + + return r; + } +@@ -1324,9 +1343,9 @@ int dm_cache_get_metadata_dev_size(struct dm_cache_metadata *cmd, + { + int r = -EINVAL; + +- down_read(&cmd->root_lock); ++ READ_LOCK(cmd); + r = dm_sm_get_nr_blocks(cmd->metadata_sm, result); +- up_read(&cmd->root_lock); ++ READ_UNLOCK(cmd); + + return r; + } +@@ -1417,7 +1436,13 @@ int dm_cache_write_hints(struct dm_cache_metadata *cmd, struct dm_cache_policy * + + int dm_cache_metadata_all_clean(struct dm_cache_metadata *cmd, bool *result) + { +- return blocks_are_unmapped_or_clean(cmd, 0, cmd->cache_blocks, result); ++ int r; ++ ++ READ_LOCK(cmd); ++ r = blocks_are_unmapped_or_clean(cmd, 0, cmd->cache_blocks, result); ++ READ_UNLOCK(cmd); ++ ++ return r; + } + + void dm_cache_metadata_set_read_only(struct dm_cache_metadata *cmd) +@@ -1440,10 +1465,7 @@ int dm_cache_metadata_set_needs_check(struct dm_cache_metadata *cmd) + struct dm_block *sblock; + struct cache_disk_superblock *disk_super; + +- /* +- * We ignore fail_io for this function. +- */ +- down_write(&cmd->root_lock); ++ WRITE_LOCK(cmd); + set_bit(NEEDS_CHECK, &cmd->flags); + + r = superblock_lock(cmd, &sblock); +@@ -1458,19 +1480,17 @@ int dm_cache_metadata_set_needs_check(struct dm_cache_metadata *cmd) + dm_bm_unlock(sblock); + + out: +- up_write(&cmd->root_lock); ++ WRITE_UNLOCK(cmd); + return r; + } + +-bool dm_cache_metadata_needs_check(struct dm_cache_metadata *cmd) ++int dm_cache_metadata_needs_check(struct dm_cache_metadata *cmd, bool *result) + { +- bool needs_check; ++ READ_LOCK(cmd); ++ *result = !!test_bit(NEEDS_CHECK, &cmd->flags); ++ READ_UNLOCK(cmd); + +- down_read(&cmd->root_lock); +- needs_check = !!test_bit(NEEDS_CHECK, &cmd->flags); +- up_read(&cmd->root_lock); +- +- return needs_check; ++ return 0; + } + + int dm_cache_metadata_abort(struct dm_cache_metadata *cmd) +diff --git a/drivers/md/dm-cache-metadata.h b/drivers/md/dm-cache-metadata.h +index 2ffee21..8528744 100644 +--- a/drivers/md/dm-cache-metadata.h ++++ b/drivers/md/dm-cache-metadata.h +@@ -66,7 +66,7 @@ void dm_cache_metadata_close(struct dm_cache_metadata *cmd); + * origin blocks to map to. + */ + int dm_cache_resize(struct dm_cache_metadata *cmd, dm_cblock_t new_cache_size); +-dm_cblock_t dm_cache_size(struct dm_cache_metadata *cmd); ++int dm_cache_size(struct dm_cache_metadata *cmd, dm_cblock_t *result); + + int dm_cache_discard_bitset_resize(struct dm_cache_metadata *cmd, + sector_t discard_block_size, +@@ -137,7 +137,7 @@ int dm_cache_write_hints(struct dm_cache_metadata *cmd, struct dm_cache_policy * + */ + int dm_cache_metadata_all_clean(struct dm_cache_metadata *cmd, bool *result); + +-bool dm_cache_metadata_needs_check(struct dm_cache_metadata *cmd); ++int dm_cache_metadata_needs_check(struct dm_cache_metadata *cmd, bool *result); + int dm_cache_metadata_set_needs_check(struct dm_cache_metadata *cmd); + void dm_cache_metadata_set_read_only(struct dm_cache_metadata *cmd); + void dm_cache_metadata_set_read_write(struct dm_cache_metadata *cmd); +diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c +index 2fd4c82..515f83e 100644 +--- a/drivers/md/dm-cache-target.c ++++ b/drivers/md/dm-cache-target.c +@@ -987,9 +987,14 @@ static void notify_mode_switch(struct cache *cache, enum cache_metadata_mode mod + + static void set_cache_mode(struct cache *cache, enum cache_metadata_mode new_mode) + { +- bool needs_check = dm_cache_metadata_needs_check(cache->cmd); ++ bool needs_check; + enum cache_metadata_mode old_mode = get_cache_mode(cache); + ++ if (dm_cache_metadata_needs_check(cache->cmd, &needs_check)) { ++ DMERR("unable to read needs_check flag, setting failure mode"); ++ new_mode = CM_FAIL; ++ } ++ + if (new_mode == CM_WRITE && needs_check) { + DMERR("%s: unable to switch cache to write mode until repaired.", + cache_device_name(cache)); +@@ -3513,6 +3518,7 @@ static void cache_status(struct dm_target *ti, status_type_t type, + char buf[BDEVNAME_SIZE]; + struct cache *cache = ti->private; + dm_cblock_t residency; ++ bool needs_check; + + switch (type) { + case STATUSTYPE_INFO: +@@ -3586,7 +3592,9 @@ static void cache_status(struct dm_target *ti, status_type_t type, + else + DMEMIT("rw "); + +- if (dm_cache_metadata_needs_check(cache->cmd)) ++ r = dm_cache_metadata_needs_check(cache->cmd, &needs_check); ++ ++ if (r || needs_check) + DMEMIT("needs_check "); + else + DMEMIT("- "); +-- +2.7.1 + + +From ec03545de79f6c2e3fd73ad141b9e96d949ff96d Mon Sep 17 00:00:00 2001 +From: "Bryn M. Reeves" +Date: Mon, 14 Mar 2016 17:04:34 -0400 +Subject: [PATCH 061/384] dm: fix rq_end_stats() NULL pointer in + dm_requeue_original_request() + +commit 98dbc9c6c61698792e3a66f32f3bf066201d42d7 upstream. + +An "old" (.request_fn) DM 'struct request' stores a pointer to the +associated 'struct dm_rq_target_io' in rq->special. + +dm_requeue_original_request(), previously named +dm_requeue_unmapped_original_request(), called dm_unprep_request() to +reset rq->special to NULL. But rq_end_stats() would go on to hit a NULL +pointer deference because its call to tio_from_request() returned NULL. + +Fix this by calling rq_end_stats() _before_ dm_unprep_request() + +Signed-off-by: Bryn M. Reeves +Signed-off-by: Mike Snitzer +Fixes: e262f34741 ("dm stats: add support for request-based DM devices") +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/dm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/md/dm.c b/drivers/md/dm.c +index 7a2a0b0..a37b947 100644 +--- a/drivers/md/dm.c ++++ b/drivers/md/dm.c +@@ -1210,9 +1210,9 @@ static void dm_requeue_original_request(struct mapped_device *md, + { + int rw = rq_data_dir(rq); + ++ rq_end_stats(md, rq); + dm_unprep_request(rq); + +- rq_end_stats(md, rq); + if (!rq->q->mq_ops) + old_requeue_request(rq); + else { +-- +2.7.1 + + +From 55a2e31783935ed18fe35cae346c531f1bf73bd3 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Wed, 10 Feb 2016 11:33:18 +0100 +Subject: [PATCH 062/384] usb: retry reset if a device times out + +commit 264904ccc33c604d4b3141bbd33808152dfac45b upstream. + +Some devices I got show an inability to operate right after +power on if they are already connected. They are beyond recovery +if the descriptors are requested multiple times. So in case of +a timeout we rather bail early and reset again. But it must be +done only on the first loop lest we get into a reset/time out +spiral that can be overcome with a retry. + +This patch is a rework of a patch that fell through the cracks. +http://www.spinics.net/lists/linux-usb/msg103263.html + +Signed-off-by: Oliver Neukum +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/core/hub.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c +index 1560f3f..a44db86 100644 +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -4426,7 +4426,13 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, + r = -EPROTO; + break; + } +- if (r == 0) ++ /* ++ * Some devices time out if they are powered on ++ * when already connected. They need a second ++ * reset. But only on the first attempt, ++ * lest we get into a time out/reset loop ++ */ ++ if (r == 0 || (r == -ETIMEDOUT && j == 0)) + break; + } + udev->descriptor.bMaxPacketSize0 = +-- +2.7.1 + + +From f3fac5aedb1588d04c5764250bdd799f44f80fc1 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Wed, 17 Feb 2016 11:52:43 +0100 +Subject: [PATCH 063/384] usb: hub: fix a typo in hub_port_init() leading to + wrong logic + +commit 0d5ce778c43bf888328231bcdce05d5c860655aa upstream. + +A typo of j for i led to a logic bug. To rule out future +confusion, the variable names are made meaningful. + +Signed-off-by: Oliver Neukum +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/core/hub.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c +index a44db86..2a27488 100644 +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -4277,7 +4277,7 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, + { + struct usb_device *hdev = hub->hdev; + struct usb_hcd *hcd = bus_to_hcd(hdev->bus); +- int i, j, retval; ++ int retries, operations, retval, i; + unsigned delay = HUB_SHORT_RESET_TIME; + enum usb_device_speed oldspeed = udev->speed; + const char *speed; +@@ -4379,7 +4379,7 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, + * first 8 bytes of the device descriptor to get the ep0 maxpacket + * value. + */ +- for (i = 0; i < GET_DESCRIPTOR_TRIES; (++i, msleep(100))) { ++ for (retries = 0; retries < GET_DESCRIPTOR_TRIES; (++retries, msleep(100))) { + bool did_new_scheme = false; + + if (use_new_scheme(udev, retry_counter)) { +@@ -4406,7 +4406,7 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, + * 255 is for WUSB devices, we actually need to use + * 512 (WUSB1.0[4.8.1]). + */ +- for (j = 0; j < 3; ++j) { ++ for (operations = 0; operations < 3; ++operations) { + buf->bMaxPacketSize0 = 0; + r = usb_control_msg(udev, usb_rcvaddr0pipe(), + USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, +@@ -4432,7 +4432,7 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, + * reset. But only on the first attempt, + * lest we get into a time out/reset loop + */ +- if (r == 0 || (r == -ETIMEDOUT && j == 0)) ++ if (r == 0 || (r == -ETIMEDOUT && retries == 0)) + break; + } + udev->descriptor.bMaxPacketSize0 = +@@ -4464,7 +4464,7 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, + * authorization will assign the final address. + */ + if (udev->wusb == 0) { +- for (j = 0; j < SET_ADDRESS_TRIES; ++j) { ++ for (operations = 0; operations < SET_ADDRESS_TRIES; ++operations) { + retval = hub_set_address(udev, devnum); + if (retval >= 0) + break; +-- +2.7.1 + + +From 8b080d80644701da074b8c6cc406895cea283bd8 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 7 Mar 2016 20:11:52 +0100 +Subject: [PATCH 064/384] USB: uas: Reduce can_queue to MAX_CMNDS + +commit 55ff8cfbc4e12a7d2187df523938cc671fbebdd1 upstream. + +The uas driver can never queue more then MAX_CMNDS (- 1) tags and tags +are shared between luns, so there is no need to claim that we can_queue +some random large number. + +Not claiming that we can_queue 65536 commands, fixes the uas driver +failing to initialize while allocating the tag map with a "Page allocation +failure (order 7)" error on systems which have been running for a while +and thus have fragmented memory. + +Reported-and-tested-by: Yves-Alexis Perez +Signed-off-by: Hans de Goede +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/storage/uas.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c +index 5c66d3f..ce0cd6e 100644 +--- a/drivers/usb/storage/uas.c ++++ b/drivers/usb/storage/uas.c +@@ -812,7 +812,7 @@ static struct scsi_host_template uas_host_template = { + .slave_configure = uas_slave_configure, + .eh_abort_handler = uas_eh_abort_handler, + .eh_bus_reset_handler = uas_eh_bus_reset_handler, +- .can_queue = 65536, /* Is there a limit on the _host_ ? */ ++ .can_queue = MAX_CMNDS, + .this_id = -1, + .sg_tablesize = SG_NONE, + .skip_settle_delay = 1, +-- +2.7.1 + + +From 433e56d4de8b304654a88fc99387eb2edd44a7a1 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Tue, 15 Mar 2016 10:14:04 +0100 +Subject: [PATCH 065/384] USB: cdc-acm: more sanity checking + +commit 8835ba4a39cf53f705417b3b3a94eb067673f2c9 upstream. + +An attack has become available which pretends to be a quirky +device circumventing normal sanity checks and crashes the kernel +by an insufficient number of interfaces. This patch adds a check +to the code path for quirky devices. + +Signed-off-by: Oliver Neukum +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/class/cdc-acm.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c +index fa4e239..d37fdcc 100644 +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -1114,6 +1114,9 @@ static int acm_probe(struct usb_interface *intf, + if (quirks == NO_UNION_NORMAL) { + data_interface = usb_ifnum_to_if(usb_dev, 1); + control_interface = usb_ifnum_to_if(usb_dev, 0); ++ /* we would crash */ ++ if (!data_interface || !control_interface) ++ return -ENODEV; + goto skip_normal_probe; + } + +-- +2.7.1 + + +From e74164bc3c0b11a1482e5c59b01e04fcf92c3377 Mon Sep 17 00:00:00 2001 +From: Josh Boyer +Date: Mon, 14 Mar 2016 10:42:38 -0400 +Subject: [PATCH 066/384] USB: iowarrior: fix oops with malicious USB + descriptors + +commit 4ec0ef3a82125efc36173062a50624550a900ae0 upstream. + +The iowarrior driver expects at least one valid endpoint. If given +malicious descriptors that specify 0 for the number of endpoints, +it will crash in the probe function. Ensure there is at least +one endpoint on the interface before using it. + +The full report of this issue can be found here: +http://seclists.org/bugtraq/2016/Mar/87 + +Reported-by: Ralf Spenneberg +Signed-off-by: Josh Boyer +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/misc/iowarrior.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c +index c6bfd13..1950e87 100644 +--- a/drivers/usb/misc/iowarrior.c ++++ b/drivers/usb/misc/iowarrior.c +@@ -787,6 +787,12 @@ static int iowarrior_probe(struct usb_interface *interface, + iface_desc = interface->cur_altsetting; + dev->product_id = le16_to_cpu(udev->descriptor.idProduct); + ++ if (iface_desc->desc.bNumEndpoints < 1) { ++ dev_err(&interface->dev, "Invalid number of endpoints\n"); ++ retval = -EINVAL; ++ goto error; ++ } ++ + /* set up the endpoint information */ + for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { + endpoint = &iface_desc->endpoint[i].desc; +-- +2.7.1 + + +From 4d577f3449336e0a8b4d74fe66872d658497e8c9 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Wed, 16 Mar 2016 13:26:17 +0100 +Subject: [PATCH 067/384] USB: usb_driver_claim_interface: add sanity checking + +commit 0b818e3956fc1ad976bee791eadcbb3b5fec5bfd upstream. + +Attacks that trick drivers into passing a NULL pointer +to usb_driver_claim_interface() using forged descriptors are +known. This thwarts them by sanity checking. + +Signed-off-by: Oliver Neukum +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/core/driver.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c +index 56593a9..2057d91 100644 +--- a/drivers/usb/core/driver.c ++++ b/drivers/usb/core/driver.c +@@ -502,11 +502,15 @@ static int usb_unbind_interface(struct device *dev) + int usb_driver_claim_interface(struct usb_driver *driver, + struct usb_interface *iface, void *priv) + { +- struct device *dev = &iface->dev; ++ struct device *dev; + struct usb_device *udev; + int retval = 0; + int lpm_disable_error; + ++ if (!iface) ++ return -ENODEV; ++ ++ dev = &iface->dev; + if (dev->driver) + return -EBUSY; + +-- +2.7.1 + + +From 27424f3a127c6a98382efd899f2c90035ca233e3 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Thu, 31 Mar 2016 12:04:24 -0400 +Subject: [PATCH 068/384] USB: mct_u232: add sanity checking in probe + +commit 4e9a0b05257f29cf4b75f3209243ed71614d062e upstream. + +An attack using the lack of sanity checking in probe is known. This +patch checks for the existence of a second port. + +CVE-2016-3136 + +Signed-off-by: Oliver Neukum +[johan: add error message ] +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/mct_u232.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c +index fd707d6..89726f7 100644 +--- a/drivers/usb/serial/mct_u232.c ++++ b/drivers/usb/serial/mct_u232.c +@@ -376,14 +376,21 @@ static void mct_u232_msr_to_state(struct usb_serial_port *port, + + static int mct_u232_port_probe(struct usb_serial_port *port) + { ++ struct usb_serial *serial = port->serial; + struct mct_u232_private *priv; + ++ /* check first to simplify error handling */ ++ if (!serial->port[1] || !serial->port[1]->interrupt_in_urb) { ++ dev_err(&port->dev, "expected endpoint missing\n"); ++ return -ENODEV; ++ } ++ + priv = kzalloc(sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + /* Use second interrupt-in endpoint for reading. */ +- priv->read_urb = port->serial->port[1]->interrupt_in_urb; ++ priv->read_urb = serial->port[1]->interrupt_in_urb; + priv->read_urb->context = port; + + spin_lock_init(&priv->lock); +-- +2.7.1 + + +From ee1e19493cd26318923a5df5314e9a1cf6a0e586 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Thu, 31 Mar 2016 12:04:26 -0400 +Subject: [PATCH 069/384] USB: digi_acceleport: do sanity checking for the + number of ports + +commit 5a07975ad0a36708c6b0a5b9fea1ff811d0b0c1f upstream. + +The driver can be crashed with devices that expose crafted descriptors +with too few endpoints. + +See: http://seclists.org/bugtraq/2016/Mar/61 + +Signed-off-by: Oliver Neukum +[johan: fix OOB endpoint check and add error messages ] +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/digi_acceleport.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c +index 12b0e67..3df7b7e 100644 +--- a/drivers/usb/serial/digi_acceleport.c ++++ b/drivers/usb/serial/digi_acceleport.c +@@ -1251,8 +1251,27 @@ static int digi_port_init(struct usb_serial_port *port, unsigned port_num) + + static int digi_startup(struct usb_serial *serial) + { ++ struct device *dev = &serial->interface->dev; + struct digi_serial *serial_priv; + int ret; ++ int i; ++ ++ /* check whether the device has the expected number of endpoints */ ++ if (serial->num_port_pointers < serial->type->num_ports + 1) { ++ dev_err(dev, "OOB endpoints missing\n"); ++ return -ENODEV; ++ } ++ ++ for (i = 0; i < serial->type->num_ports + 1 ; i++) { ++ if (!serial->port[i]->read_urb) { ++ dev_err(dev, "bulk-in endpoint missing\n"); ++ return -ENODEV; ++ } ++ if (!serial->port[i]->write_urb) { ++ dev_err(dev, "bulk-out endpoint missing\n"); ++ return -ENODEV; ++ } ++ } + + serial_priv = kzalloc(sizeof(*serial_priv), GFP_KERNEL); + if (!serial_priv) +-- +2.7.1 + + +From e37884e1da50145cc56e9dad07f1f5f8096cd291 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Thu, 31 Mar 2016 12:04:25 -0400 +Subject: [PATCH 070/384] USB: cypress_m8: add endpoint sanity check + +commit c55aee1bf0e6b6feec8b2927b43f7a09a6d5f754 upstream. + +An attack using missing endpoints exists. + +CVE-2016-3137 + +Signed-off-by: Oliver Neukum +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/cypress_m8.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c +index 01bf533..244acb12 100644 +--- a/drivers/usb/serial/cypress_m8.c ++++ b/drivers/usb/serial/cypress_m8.c +@@ -447,6 +447,11 @@ static int cypress_generic_port_probe(struct usb_serial_port *port) + struct usb_serial *serial = port->serial; + struct cypress_private *priv; + ++ if (!port->interrupt_out_urb || !port->interrupt_in_urb) { ++ dev_err(&port->dev, "required endpoint is missing\n"); ++ return -ENODEV; ++ } ++ + priv = kzalloc(sizeof(struct cypress_private), GFP_KERNEL); + if (!priv) + return -ENOMEM; +@@ -606,12 +611,6 @@ static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port) + cypress_set_termios(tty, port, &priv->tmp_termios); + + /* setup the port and start reading from the device */ +- if (!port->interrupt_in_urb) { +- dev_err(&port->dev, "%s - interrupt_in_urb is empty!\n", +- __func__); +- return -1; +- } +- + usb_fill_int_urb(port->interrupt_in_urb, serial->dev, + usb_rcvintpipe(serial->dev, port->interrupt_in_endpointAddress), + port->interrupt_in_urb->transfer_buffer, +-- +2.7.1 + + +From f52f0b5aaff354a0f239b4417bcbc33bbf332946 Mon Sep 17 00:00:00 2001 +From: Martyn Welch +Date: Tue, 29 Mar 2016 17:47:29 +0100 +Subject: [PATCH 071/384] USB: serial: cp210x: Adding GE Healthcare Device ID + +commit cddc9434e3dcc37a85c4412fb8e277d3a582e456 upstream. + +The CP2105 is used in the GE Healthcare Remote Alarm Box, with the +Manufacturer ID of 0x1901 and Product ID of 0x0194. + +Signed-off-by: Martyn Welch +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/cp210x.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c +index 7a76fe4..bdc0f2f 100644 +--- a/drivers/usb/serial/cp210x.c ++++ b/drivers/usb/serial/cp210x.c +@@ -164,6 +164,7 @@ static const struct usb_device_id id_table[] = { + { USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */ + { USB_DEVICE(0x1901, 0x0190) }, /* GE B850 CP2105 Recorder interface */ + { USB_DEVICE(0x1901, 0x0193) }, /* GE B650 CP2104 PMC interface */ ++ { USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */ + { USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */ + { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ + { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */ +-- +2.7.1 + + +From 18aa712cac25bfede7ec040b16b6247303317c78 Mon Sep 17 00:00:00 2001 +From: Josh Boyer +Date: Thu, 10 Mar 2016 09:48:52 -0500 +Subject: [PATCH 072/384] USB: serial: ftdi_sio: Add support for ICP DAS + I-756xU devices + +commit ea6db90e750328068837bed34cb1302b7a177339 upstream. + +A Fedora user reports that the ftdi_sio driver works properly for the +ICP DAS I-7561U device. Further, the user manual for these devices +instructs users to load the driver and add the ids using the sysfs +interface. + +Add support for these in the driver directly so that the devices work +out of the box instead of needing manual configuration. + +Reported-by: +Signed-off-by: Josh Boyer +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/ftdi_sio.c | 4 ++++ + drivers/usb/serial/ftdi_sio_ids.h | 8 ++++++++ + 2 files changed, 12 insertions(+) + +diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c +index 8c660ae..b61f121 100644 +--- a/drivers/usb/serial/ftdi_sio.c ++++ b/drivers/usb/serial/ftdi_sio.c +@@ -1004,6 +1004,10 @@ static const struct usb_device_id id_table_combined[] = { + { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_DISPLAY_PID) }, + { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_LITE_PID) }, + { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ANALOG_PID) }, ++ /* ICP DAS I-756xU devices */ ++ { USB_DEVICE(ICPDAS_VID, ICPDAS_I7560U_PID) }, ++ { USB_DEVICE(ICPDAS_VID, ICPDAS_I7561U_PID) }, ++ { USB_DEVICE(ICPDAS_VID, ICPDAS_I7563U_PID) }, + { } /* Terminating entry */ + }; + +diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h +index a84df25..c5d6c1e 100644 +--- a/drivers/usb/serial/ftdi_sio_ids.h ++++ b/drivers/usb/serial/ftdi_sio_ids.h +@@ -872,6 +872,14 @@ + #define NOVITUS_BONO_E_PID 0x6010 + + /* ++ * ICPDAS I-756*U devices ++ */ ++#define ICPDAS_VID 0x1b5c ++#define ICPDAS_I7560U_PID 0x0103 ++#define ICPDAS_I7561U_PID 0x0104 ++#define ICPDAS_I7563U_PID 0x0105 ++ ++/* + * RT Systems programming cables for various ham radios + */ + #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ +-- +2.7.1 + + +From daf8bd3901a9cb4f539af72e682b0683b5fd45f6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +Date: Thu, 7 Apr 2016 12:09:17 +0200 +Subject: [PATCH 073/384] USB: option: add "D-Link DWM-221 B1" device id +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit d48d5691ebf88a15d95ba96486917ffc79256536 upstream. + +Thomas reports: +"Windows: + +00 diagnostics +01 modem +02 at-port +03 nmea +04 nic + +Linux: + +T: Bus=02 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#= 4 Spd=480 MxCh= 0 +D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 +P: Vendor=2001 ProdID=7e19 Rev=02.32 +S: Manufacturer=Mobile Connect +S: Product=Mobile Connect +S: SerialNumber=0123456789ABCDEF +C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA +I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option +I: If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan +I: If#= 5 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage" + +Reported-by: Thomas Schäfer +Signed-off-by: Bjørn Mork +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/option.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c +index 348e198..c6f497f 100644 +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -1818,6 +1818,8 @@ static const struct usb_device_id option_ids[] = { + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d02, 0xff, 0x00, 0x00) }, + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x02, 0x01) }, + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) }, ++ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e19, 0xff), /* D-Link DWM-221 B1 */ ++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */ + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */ + { USB_DEVICE_INTERFACE_CLASS(0x2020, 0x4000, 0xff) }, /* OLICARD300 - MT6225 */ +-- +2.7.1 + + +From 4e760dae4ec44e0d82b75a3a1c25f2f7b764ed1d Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 22 Jan 2016 08:53:55 -0200 +Subject: [PATCH 074/384] pwc: Add USB id for Philips Spc880nc webcam + +commit 7445e45d19a09e5269dc85f17f9635be29d2f76c upstream. + +SPC 880NC PC camera discussions: + http://www.pclinuxos.com/forum/index.php/topic,135688.0.html + +Reported-by: Kikim +Signed-off-by: Hans de Goede +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/usb/pwc/pwc-if.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c +index b79c36f..58f23bc 100644 +--- a/drivers/media/usb/pwc/pwc-if.c ++++ b/drivers/media/usb/pwc/pwc-if.c +@@ -91,6 +91,7 @@ static const struct usb_device_id pwc_device_table [] = { + { USB_DEVICE(0x0471, 0x0312) }, + { USB_DEVICE(0x0471, 0x0313) }, /* the 'new' 720K */ + { USB_DEVICE(0x0471, 0x0329) }, /* Philips SPC 900NC PC Camera */ ++ { USB_DEVICE(0x0471, 0x032C) }, /* Philips SPC 880NC PC Camera */ + { USB_DEVICE(0x069A, 0x0001) }, /* Askey */ + { USB_DEVICE(0x046D, 0x08B0) }, /* Logitech QuickCam Pro 3000 */ + { USB_DEVICE(0x046D, 0x08B1) }, /* Logitech QuickCam Notebook Pro */ +@@ -811,6 +812,11 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id + name = "Philips SPC 900NC webcam"; + type_id = 740; + break; ++ case 0x032C: ++ PWC_INFO("Philips SPC 880NC USB webcam detected.\n"); ++ name = "Philips SPC 880NC webcam"; ++ type_id = 740; ++ break; + default: + return -ENODEV; + break; +-- +2.7.1 + + +From 0b34c69cf7601094443fc238b299717179360ebd Mon Sep 17 00:00:00 2001 +From: Josh Boyer +Date: Mon, 14 Mar 2016 09:33:40 -0700 +Subject: [PATCH 075/384] Input: powermate - fix oops with malicious USB + descriptors + +commit 9c6ba456711687b794dcf285856fc14e2c76074f upstream. + +The powermate driver expects at least one valid USB endpoint in its +probe function. If given malicious descriptors that specify 0 for +the number of endpoints, it will crash. Validate the number of +endpoints on the interface before using them. + +The full report for this issue can be found here: +http://seclists.org/bugtraq/2016/Mar/85 + +Reported-by: Ralf Spenneberg +Signed-off-by: Josh Boyer +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/input/misc/powermate.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c +index 63b539d..84909a1 100644 +--- a/drivers/input/misc/powermate.c ++++ b/drivers/input/misc/powermate.c +@@ -307,6 +307,9 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i + int error = -ENOMEM; + + interface = intf->cur_altsetting; ++ if (interface->desc.bNumEndpoints < 1) ++ return -EINVAL; ++ + endpoint = &interface->endpoint[0].desc; + if (!usb_endpoint_is_int_in(endpoint)) + return -EIO; +-- +2.7.1 + + +From d7b0a2697aea0722c864ace4216a486681d02ef6 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 15 Mar 2016 12:09:10 +0100 +Subject: [PATCH 076/384] ALSA: usb-audio: Fix NULL dereference in + create_fixed_stream_quirk() + +commit 0f886ca12765d20124bd06291c82951fd49a33be upstream. + +create_fixed_stream_quirk() may cause a NULL-pointer dereference by +accessing the non-existing endpoint when a USB device with a malformed +USB descriptor is used. + +This patch avoids it simply by adding a sanity check of bNumEndpoints +before the accesses. + +Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=971125 +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/quirks.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c +index c458d60..f2e4eeb 100644 +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -180,6 +180,12 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip, + } + alts = &iface->altsetting[fp->altset_idx]; + altsd = get_iface_desc(alts); ++ if (altsd->bNumEndpoints < 1) { ++ kfree(fp); ++ kfree(rate_table); ++ return -EINVAL; ++ } ++ + fp->protocol = altsd->bInterfaceProtocol; + + if (fp->datainterval == 0) +-- +2.7.1 + + +From c879341ce49f19e6bff0b8fcc145e350580b9ed1 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 15 Mar 2016 15:20:58 +0100 +Subject: [PATCH 077/384] ALSA: usb-audio: Add sanity checks for endpoint + accesses + +commit 447d6275f0c21f6cc97a88b3a0c601436a4cdf2a upstream. + +Add some sanity check codes before actually accessing the endpoint via +get_endpoint() in order to avoid the invalid access through a +malformed USB descriptor. Mostly just checking bNumEndpoints, but in +one place (snd_microii_spdif_default_get()), the validity of iface and +altsetting index is checked as well. + +Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=971125 +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/clock.c | 2 ++ + sound/usb/endpoint.c | 3 +++ + sound/usb/mixer_quirks.c | 4 ++++ + sound/usb/pcm.c | 2 ++ + 4 files changed, 11 insertions(+) + +diff --git a/sound/usb/clock.c b/sound/usb/clock.c +index 2ed260b..7ccbcaf 100644 +--- a/sound/usb/clock.c ++++ b/sound/usb/clock.c +@@ -285,6 +285,8 @@ static int set_sample_rate_v1(struct snd_usb_audio *chip, int iface, + unsigned char data[3]; + int err, crate; + ++ if (get_iface_desc(alts)->bNumEndpoints < 1) ++ return -EINVAL; + ep = get_endpoint(alts, 0)->bEndpointAddress; + + /* if endpoint doesn't have sampling rate control, bail out */ +diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c +index 7b1cb36..c07a7ed 100644 +--- a/sound/usb/endpoint.c ++++ b/sound/usb/endpoint.c +@@ -438,6 +438,9 @@ exit_clear: + * + * New endpoints will be added to chip->ep_list and must be freed by + * calling snd_usb_endpoint_free(). ++ * ++ * For SND_USB_ENDPOINT_TYPE_SYNC, the caller needs to guarantee that ++ * bNumEndpoints > 1 beforehand. + */ + struct snd_usb_endpoint *snd_usb_add_endpoint(struct snd_usb_audio *chip, + struct usb_host_interface *alts, +diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c +index 2790256..f6c3bf7 100644 +--- a/sound/usb/mixer_quirks.c ++++ b/sound/usb/mixer_quirks.c +@@ -1519,7 +1519,11 @@ static int snd_microii_spdif_default_get(struct snd_kcontrol *kcontrol, + + /* use known values for that card: interface#1 altsetting#1 */ + iface = usb_ifnum_to_if(chip->dev, 1); ++ if (!iface || iface->num_altsetting < 2) ++ return -EINVAL; + alts = &iface->altsetting[1]; ++ if (get_iface_desc(alts)->bNumEndpoints < 1) ++ return -EINVAL; + ep = get_endpoint(alts, 0)->bEndpointAddress; + + err = snd_usb_ctl_msg(chip->dev, +diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c +index 9245f52..44d178e 100644 +--- a/sound/usb/pcm.c ++++ b/sound/usb/pcm.c +@@ -159,6 +159,8 @@ static int init_pitch_v1(struct snd_usb_audio *chip, int iface, + unsigned char data[1]; + int err; + ++ if (get_iface_desc(alts)->bNumEndpoints < 1) ++ return -EINVAL; + ep = get_endpoint(alts, 0)->bEndpointAddress; + + data[0] = 1; +-- +2.7.1 + + +From 5e2c051d32146c947a24a9bd76e58b0513598fb8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Victor=20Cl=C3=A9ment?= +Date: Sat, 19 Mar 2016 13:17:42 +0100 +Subject: [PATCH 078/384] ALSA: usb-audio: add Microsoft HD-5001 to quirks +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit 0ef21100ae912f76ed89f76ecd894f4ffb3689c1 upstream. + +The Microsoft HD-5001 webcam microphone does not support sample rate +reading as the HD-5000 one. +This results in dmesg errors and sound hanging with pulseaudio. + +Signed-off-by: Victor Clément +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/quirks.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c +index f2e4eeb..2967242 100644 +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -1127,6 +1127,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) + switch (chip->usb_id) { + case USB_ID(0x045E, 0x075D): /* MS Lifecam Cinema */ + case USB_ID(0x045E, 0x076D): /* MS Lifecam HD-5000 */ ++ case USB_ID(0x045E, 0x076E): /* MS Lifecam HD-5001 */ + case USB_ID(0x045E, 0x076F): /* MS Lifecam HD-6000 */ + case USB_ID(0x045E, 0x0772): /* MS Lifecam Studio */ + case USB_ID(0x045E, 0x0779): /* MS Lifecam HD-3000 */ +-- +2.7.1 + + +From 2e3663d4faf595a715e5b6f996e68cfe83271d52 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 15 Mar 2016 12:14:49 +0100 +Subject: [PATCH 079/384] ALSA: usb-audio: Minor code cleanup in + create_fixed_stream_quirk() + +commit 902eb7fd1e4af3ac69b9b30f8373f118c92b9729 upstream. + +Just a minor code cleanup: unify the error paths. + +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/quirks.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c +index 2967242..f9263de 100644 +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -167,23 +167,18 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip, + stream = (fp->endpoint & USB_DIR_IN) + ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; + err = snd_usb_add_audio_stream(chip, stream, fp); +- if (err < 0) { +- kfree(fp); +- kfree(rate_table); +- return err; +- } ++ if (err < 0) ++ goto error; + if (fp->iface != get_iface_desc(&iface->altsetting[0])->bInterfaceNumber || + fp->altset_idx >= iface->num_altsetting) { +- kfree(fp); +- kfree(rate_table); +- return -EINVAL; ++ err = -EINVAL; ++ goto error; + } + alts = &iface->altsetting[fp->altset_idx]; + altsd = get_iface_desc(alts); + if (altsd->bNumEndpoints < 1) { +- kfree(fp); +- kfree(rate_table); +- return -EINVAL; ++ err = -EINVAL; ++ goto error; + } + + fp->protocol = altsd->bInterfaceProtocol; +@@ -196,6 +191,11 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip, + snd_usb_init_pitch(chip, fp->iface, alts, fp); + snd_usb_init_sample_rate(chip, fp->iface, alts, fp, fp->rate_max); + return 0; ++ ++ error: ++ kfree(fp); ++ kfree(rate_table); ++ return err; + } + + static int create_auto_pcm_quirk(struct snd_usb_audio *chip, +-- +2.7.1 + + +From a3326ab368abe032462681acc1779aa92f811859 Mon Sep 17 00:00:00 2001 +From: Vladis Dronov +Date: Thu, 31 Mar 2016 12:05:43 -0400 +Subject: [PATCH 080/384] ALSA: usb-audio: Fix double-free in error paths after + snd_usb_add_audio_stream() call + +commit 836b34a935abc91e13e63053d0a83b24dfb5ea78 upstream. + +create_fixed_stream_quirk(), snd_usb_parse_audio_interface() and +create_uaxx_quirk() functions allocate the audioformat object by themselves +and free it upon error before returning. However, once the object is linked +to a stream, it's freed again in snd_usb_audio_pcm_free(), thus it'll be +double-freed, eventually resulting in a memory corruption. + +This patch fixes these failures in the error paths by unlinking the audioformat +object before freeing it. + +Based on a patch by Takashi Iwai + +[Note for stable backports: + this patch requires the commit 902eb7fd1e4a ('ALSA: usb-audio: Minor + code cleanup in create_fixed_stream_quirk()')] + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1283358 +Reported-by: Ralf Spenneberg +Signed-off-by: Vladis Dronov +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/quirks.c | 4 ++++ + sound/usb/stream.c | 6 +++++- + 2 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c +index f9263de..cd7eac2 100644 +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -150,6 +150,7 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip, + usb_audio_err(chip, "cannot memdup\n"); + return -ENOMEM; + } ++ INIT_LIST_HEAD(&fp->list); + if (fp->nr_rates > MAX_NR_RATES) { + kfree(fp); + return -EINVAL; +@@ -193,6 +194,7 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip, + return 0; + + error: ++ list_del(&fp->list); /* unlink for avoiding double-free */ + kfree(fp); + kfree(rate_table); + return err; +@@ -468,6 +470,7 @@ static int create_uaxx_quirk(struct snd_usb_audio *chip, + fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; + fp->datainterval = 0; + fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize); ++ INIT_LIST_HEAD(&fp->list); + + switch (fp->maxpacksize) { + case 0x120: +@@ -491,6 +494,7 @@ static int create_uaxx_quirk(struct snd_usb_audio *chip, + ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; + err = snd_usb_add_audio_stream(chip, stream, fp); + if (err < 0) { ++ list_del(&fp->list); /* unlink for avoiding double-free */ + kfree(fp); + return err; + } +diff --git a/sound/usb/stream.c b/sound/usb/stream.c +index 8ee14f2..3b23102 100644 +--- a/sound/usb/stream.c ++++ b/sound/usb/stream.c +@@ -316,7 +316,9 @@ static struct snd_pcm_chmap_elem *convert_chmap(int channels, unsigned int bits, + /* + * add this endpoint to the chip instance. + * if a stream with the same endpoint already exists, append to it. +- * if not, create a new pcm stream. ++ * if not, create a new pcm stream. note, fp is added to the substream ++ * fmt_list and will be freed on the chip instance release. do not free ++ * fp or do remove it from the substream fmt_list to avoid double-free. + */ + int snd_usb_add_audio_stream(struct snd_usb_audio *chip, + int stream, +@@ -677,6 +679,7 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) + * (fp->maxpacksize & 0x7ff); + fp->attributes = parse_uac_endpoint_attributes(chip, alts, protocol, iface_no); + fp->clock = clock; ++ INIT_LIST_HEAD(&fp->list); + + /* some quirks for attributes here */ + +@@ -725,6 +728,7 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) + dev_dbg(&dev->dev, "%u:%d: add audio endpoint %#x\n", iface_no, altno, fp->endpoint); + err = snd_usb_add_audio_stream(chip, stream, fp); + if (err < 0) { ++ list_del(&fp->list); /* unlink for avoiding double-free */ + kfree(fp->rate_table); + kfree(fp->chmap); + kfree(fp); +-- +2.7.1 + + +From fd1570cd3f8ad04a6b2a93586a4710ab9645d805 Mon Sep 17 00:00:00 2001 +From: Dmitry Tunin +Date: Wed, 10 Feb 2016 15:33:17 +0300 +Subject: [PATCH 081/384] Bluetooth: btusb: Add new AR3012 ID 13d3:3395 + +commit 609574eb46335cfac1421a07c0505627cbbab1f0 upstream. + +T: Bus=03 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=12 MxCh= 0 +D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=13d3 ProdID=3395 Rev=00.01 +C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA +I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb + +BugLink: https://bugs.launchpad.net/bugs/1542564 + +Reported-and-tested-by: Christopher Simerly +Signed-off-by: Dmitry Tunin +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + drivers/bluetooth/ath3k.c | 2 ++ + drivers/bluetooth/btusb.c | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c +index fa893c3..cb1cb9a 100644 +--- a/drivers/bluetooth/ath3k.c ++++ b/drivers/bluetooth/ath3k.c +@@ -113,6 +113,7 @@ static const struct usb_device_id ath3k_table[] = { + { USB_DEVICE(0x13d3, 0x3362) }, + { USB_DEVICE(0x13d3, 0x3375) }, + { USB_DEVICE(0x13d3, 0x3393) }, ++ { USB_DEVICE(0x13d3, 0x3395) }, + { USB_DEVICE(0x13d3, 0x3402) }, + { USB_DEVICE(0x13d3, 0x3408) }, + { USB_DEVICE(0x13d3, 0x3423) }, +@@ -175,6 +176,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = { + { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 }, ++ { USB_DEVICE(0x13d3, 0x3395), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3408), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3423), .driver_info = BTUSB_ATH3012 }, +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c +index 9688971..d4888ea 100644 +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -227,6 +227,7 @@ static const struct usb_device_id blacklist_table[] = { + { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 }, ++ { USB_DEVICE(0x13d3, 0x3395), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3408), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3423), .driver_info = BTUSB_ATH3012 }, +-- +2.7.1 + + +From a81a4175ccb295c15699fd3544ba160cb27a7955 Mon Sep 17 00:00:00 2001 +From: Dmitry Tunin +Date: Sun, 28 Feb 2016 11:04:06 +0300 +Subject: [PATCH 082/384] Bluetooth: btusb: Add a new AR3012 ID 04ca:3014 + +commit 81d90442eac779938217c3444b240aa51fd3db47 upstream. + +T: Bus=01 Lev=01 Prnt=01 Port=04 Cnt=03 Dev#= 5 Spd=12 MxCh= 0 +D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=04ca ProdID=3014 Rev=00.02 +C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA +I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb + +BugLink: https://bugs.launchpad.net/bugs/1546694 + +Signed-off-by: Dmitry Tunin +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + drivers/bluetooth/ath3k.c | 2 ++ + drivers/bluetooth/btusb.c | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c +index cb1cb9a..3062a3a 100644 +--- a/drivers/bluetooth/ath3k.c ++++ b/drivers/bluetooth/ath3k.c +@@ -92,6 +92,7 @@ static const struct usb_device_id ath3k_table[] = { + { USB_DEVICE(0x04CA, 0x300d) }, + { USB_DEVICE(0x04CA, 0x300f) }, + { USB_DEVICE(0x04CA, 0x3010) }, ++ { USB_DEVICE(0x04CA, 0x3014) }, + { USB_DEVICE(0x0930, 0x0219) }, + { USB_DEVICE(0x0930, 0x021c) }, + { USB_DEVICE(0x0930, 0x0220) }, +@@ -155,6 +156,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = { + { USB_DEVICE(0x04ca, 0x300d), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x04ca, 0x300f), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x04ca, 0x3010), .driver_info = BTUSB_ATH3012 }, ++ { USB_DEVICE(0x04ca, 0x3014), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0930, 0x021c), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 }, +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c +index d4888ea..b4dd940 100644 +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -206,6 +206,7 @@ static const struct usb_device_id blacklist_table[] = { + { USB_DEVICE(0x04ca, 0x300d), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x04ca, 0x300f), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x04ca, 0x3010), .driver_info = BTUSB_ATH3012 }, ++ { USB_DEVICE(0x04ca, 0x3014), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0930, 0x021c), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 }, +-- +2.7.1 + + +From 943a2d67907b5fa75ed32a5559d43910d8dbec8f Mon Sep 17 00:00:00 2001 +From: Dmitry Tunin +Date: Fri, 4 Mar 2016 01:32:19 +0300 +Subject: [PATCH 083/384] Bluetooth: btusb: Add a new AR3012 ID 13d3:3472 + +commit 75c6aca4765dbe3d0c1507ab5052f2e373dc2331 upstream. + +T: Bus=01 Lev=01 Prnt=01 Port=04 Cnt=01 Dev#= 4 Spd=12 MxCh= 0 +D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=13d3 ProdID=3472 Rev=00.01 +C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA +I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb + +BugLink: https://bugs.launchpad.net/bugs/1552925 + +Signed-off-by: Dmitry Tunin +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + drivers/bluetooth/ath3k.c | 2 ++ + drivers/bluetooth/btusb.c | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c +index 3062a3a..0c4a748 100644 +--- a/drivers/bluetooth/ath3k.c ++++ b/drivers/bluetooth/ath3k.c +@@ -119,6 +119,7 @@ static const struct usb_device_id ath3k_table[] = { + { USB_DEVICE(0x13d3, 0x3408) }, + { USB_DEVICE(0x13d3, 0x3423) }, + { USB_DEVICE(0x13d3, 0x3432) }, ++ { USB_DEVICE(0x13d3, 0x3472) }, + { USB_DEVICE(0x13d3, 0x3474) }, + + /* Atheros AR5BBU12 with sflash firmware */ +@@ -183,6 +184,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = { + { USB_DEVICE(0x13d3, 0x3408), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3423), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3432), .driver_info = BTUSB_ATH3012 }, ++ { USB_DEVICE(0x13d3, 0x3472), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3474), .driver_info = BTUSB_ATH3012 }, + + /* Atheros AR5BBU22 with sflash firmware */ +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c +index b4dd940..342ec8d 100644 +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -233,6 +233,7 @@ static const struct usb_device_id blacklist_table[] = { + { USB_DEVICE(0x13d3, 0x3408), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3423), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3432), .driver_info = BTUSB_ATH3012 }, ++ { USB_DEVICE(0x13d3, 0x3472), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3474), .driver_info = BTUSB_ATH3012 }, + + /* Atheros AR5BBU12 with sflash firmware */ +-- +2.7.1 + + +From db6121318c30c8904f4435fc4f6cca5afb0991b1 Mon Sep 17 00:00:00 2001 +From: Tom Lendacky +Date: Tue, 12 Jan 2016 11:17:38 -0600 +Subject: [PATCH 084/384] crypto: ccp - Add hash state import and export + support + +commit 952bce9792e6bf36fda09c2e5718abb5d9327369 upstream. + +Commit 8996eafdcbad ("crypto: ahash - ensure statesize is non-zero") +added a check to prevent ahash algorithms from successfully registering +if the import and export functions were not implemented. This prevents +an oops in the hash_accept function of algif_hash. This commit causes +the ccp-crypto module SHA support and AES CMAC support from successfully +registering and causing the ccp-crypto module load to fail because the +ahash import and export functions are not implemented. + +Update the CCP Crypto API support to provide import and export support +for ahash algorithms. + +Signed-off-by: Tom Lendacky +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/ccp/ccp-crypto-aes-cmac.c | 23 +++++++++++++++++++++++ + drivers/crypto/ccp/ccp-crypto-sha.c | 23 +++++++++++++++++++++++ + 2 files changed, 46 insertions(+) + +diff --git a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c +index d89f20c..00207cf 100644 +--- a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c ++++ b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c +@@ -220,6 +220,26 @@ static int ccp_aes_cmac_digest(struct ahash_request *req) + return ccp_aes_cmac_finup(req); + } + ++static int ccp_aes_cmac_export(struct ahash_request *req, void *out) ++{ ++ struct ccp_aes_cmac_req_ctx *rctx = ahash_request_ctx(req); ++ struct ccp_aes_cmac_req_ctx *state = out; ++ ++ *state = *rctx; ++ ++ return 0; ++} ++ ++static int ccp_aes_cmac_import(struct ahash_request *req, const void *in) ++{ ++ struct ccp_aes_cmac_req_ctx *rctx = ahash_request_ctx(req); ++ const struct ccp_aes_cmac_req_ctx *state = in; ++ ++ *rctx = *state; ++ ++ return 0; ++} ++ + static int ccp_aes_cmac_setkey(struct crypto_ahash *tfm, const u8 *key, + unsigned int key_len) + { +@@ -352,10 +372,13 @@ int ccp_register_aes_cmac_algs(struct list_head *head) + alg->final = ccp_aes_cmac_final; + alg->finup = ccp_aes_cmac_finup; + alg->digest = ccp_aes_cmac_digest; ++ alg->export = ccp_aes_cmac_export; ++ alg->import = ccp_aes_cmac_import; + alg->setkey = ccp_aes_cmac_setkey; + + halg = &alg->halg; + halg->digestsize = AES_BLOCK_SIZE; ++ halg->statesize = sizeof(struct ccp_aes_cmac_req_ctx); + + base = &halg->base; + snprintf(base->cra_name, CRYPTO_MAX_ALG_NAME, "cmac(aes)"); +diff --git a/drivers/crypto/ccp/ccp-crypto-sha.c b/drivers/crypto/ccp/ccp-crypto-sha.c +index d14b3f2..3aae58d 100644 +--- a/drivers/crypto/ccp/ccp-crypto-sha.c ++++ b/drivers/crypto/ccp/ccp-crypto-sha.c +@@ -207,6 +207,26 @@ static int ccp_sha_digest(struct ahash_request *req) + return ccp_sha_finup(req); + } + ++static int ccp_sha_export(struct ahash_request *req, void *out) ++{ ++ struct ccp_sha_req_ctx *rctx = ahash_request_ctx(req); ++ struct ccp_sha_req_ctx *state = out; ++ ++ *state = *rctx; ++ ++ return 0; ++} ++ ++static int ccp_sha_import(struct ahash_request *req, const void *in) ++{ ++ struct ccp_sha_req_ctx *rctx = ahash_request_ctx(req); ++ const struct ccp_sha_req_ctx *state = in; ++ ++ *rctx = *state; ++ ++ return 0; ++} ++ + static int ccp_sha_setkey(struct crypto_ahash *tfm, const u8 *key, + unsigned int key_len) + { +@@ -403,9 +423,12 @@ static int ccp_register_sha_alg(struct list_head *head, + alg->final = ccp_sha_final; + alg->finup = ccp_sha_finup; + alg->digest = ccp_sha_digest; ++ alg->export = ccp_sha_export; ++ alg->import = ccp_sha_import; + + halg = &alg->halg; + halg->digestsize = def->digest_size; ++ halg->statesize = sizeof(struct ccp_sha_req_ctx); + + base = &halg->base; + snprintf(base->cra_name, CRYPTO_MAX_ALG_NAME, "%s", def->name); +-- +2.7.1 + + +From a6192269876f70c6d9260f45f89a18f7c555dbcb Mon Sep 17 00:00:00 2001 +From: Tom Lendacky +Date: Fri, 29 Jan 2016 12:45:14 -0600 +Subject: [PATCH 085/384] crypto: ccp - Limit the amount of information + exported + +commit d1662165ae612ec8b5f94a6b07e65ea58b6dce34 upstream. + +Since the exported information can be exposed to user-space, instead of +exporting the entire request context only export the minimum information +needed. + +Signed-off-by: Tom Lendacky +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/ccp/ccp-crypto-aes-cmac.c | 16 +++++++++++----- + drivers/crypto/ccp/ccp-crypto-sha.c | 20 +++++++++++++++----- + drivers/crypto/ccp/ccp-crypto.h | 22 ++++++++++++++++++++++ + 3 files changed, 48 insertions(+), 10 deletions(-) + +diff --git a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c +index 00207cf..6a2d836 100644 +--- a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c ++++ b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c +@@ -223,9 +223,12 @@ static int ccp_aes_cmac_digest(struct ahash_request *req) + static int ccp_aes_cmac_export(struct ahash_request *req, void *out) + { + struct ccp_aes_cmac_req_ctx *rctx = ahash_request_ctx(req); +- struct ccp_aes_cmac_req_ctx *state = out; ++ struct ccp_aes_cmac_exp_ctx *state = out; + +- *state = *rctx; ++ state->null_msg = rctx->null_msg; ++ memcpy(state->iv, rctx->iv, sizeof(state->iv)); ++ state->buf_count = rctx->buf_count; ++ memcpy(state->buf, rctx->buf, sizeof(state->buf)); + + return 0; + } +@@ -233,9 +236,12 @@ static int ccp_aes_cmac_export(struct ahash_request *req, void *out) + static int ccp_aes_cmac_import(struct ahash_request *req, const void *in) + { + struct ccp_aes_cmac_req_ctx *rctx = ahash_request_ctx(req); +- const struct ccp_aes_cmac_req_ctx *state = in; ++ const struct ccp_aes_cmac_exp_ctx *state = in; + +- *rctx = *state; ++ rctx->null_msg = state->null_msg; ++ memcpy(rctx->iv, state->iv, sizeof(rctx->iv)); ++ rctx->buf_count = state->buf_count; ++ memcpy(rctx->buf, state->buf, sizeof(rctx->buf)); + + return 0; + } +@@ -378,7 +384,7 @@ int ccp_register_aes_cmac_algs(struct list_head *head) + + halg = &alg->halg; + halg->digestsize = AES_BLOCK_SIZE; +- halg->statesize = sizeof(struct ccp_aes_cmac_req_ctx); ++ halg->statesize = sizeof(struct ccp_aes_cmac_exp_ctx); + + base = &halg->base; + snprintf(base->cra_name, CRYPTO_MAX_ALG_NAME, "cmac(aes)"); +diff --git a/drivers/crypto/ccp/ccp-crypto-sha.c b/drivers/crypto/ccp/ccp-crypto-sha.c +index 3aae58d..a67128a 100644 +--- a/drivers/crypto/ccp/ccp-crypto-sha.c ++++ b/drivers/crypto/ccp/ccp-crypto-sha.c +@@ -210,9 +210,14 @@ static int ccp_sha_digest(struct ahash_request *req) + static int ccp_sha_export(struct ahash_request *req, void *out) + { + struct ccp_sha_req_ctx *rctx = ahash_request_ctx(req); +- struct ccp_sha_req_ctx *state = out; ++ struct ccp_sha_exp_ctx *state = out; + +- *state = *rctx; ++ state->type = rctx->type; ++ state->msg_bits = rctx->msg_bits; ++ state->first = rctx->first; ++ memcpy(state->ctx, rctx->ctx, sizeof(state->ctx)); ++ state->buf_count = rctx->buf_count; ++ memcpy(state->buf, rctx->buf, sizeof(state->buf)); + + return 0; + } +@@ -220,9 +225,14 @@ static int ccp_sha_export(struct ahash_request *req, void *out) + static int ccp_sha_import(struct ahash_request *req, const void *in) + { + struct ccp_sha_req_ctx *rctx = ahash_request_ctx(req); +- const struct ccp_sha_req_ctx *state = in; ++ const struct ccp_sha_exp_ctx *state = in; + +- *rctx = *state; ++ rctx->type = state->type; ++ rctx->msg_bits = state->msg_bits; ++ rctx->first = state->first; ++ memcpy(rctx->ctx, state->ctx, sizeof(rctx->ctx)); ++ rctx->buf_count = state->buf_count; ++ memcpy(rctx->buf, state->buf, sizeof(rctx->buf)); + + return 0; + } +@@ -428,7 +438,7 @@ static int ccp_register_sha_alg(struct list_head *head, + + halg = &alg->halg; + halg->digestsize = def->digest_size; +- halg->statesize = sizeof(struct ccp_sha_req_ctx); ++ halg->statesize = sizeof(struct ccp_sha_exp_ctx); + + base = &halg->base; + snprintf(base->cra_name, CRYPTO_MAX_ALG_NAME, "%s", def->name); +diff --git a/drivers/crypto/ccp/ccp-crypto.h b/drivers/crypto/ccp/ccp-crypto.h +index 76a96f0..a326ec2 100644 +--- a/drivers/crypto/ccp/ccp-crypto.h ++++ b/drivers/crypto/ccp/ccp-crypto.h +@@ -129,6 +129,15 @@ struct ccp_aes_cmac_req_ctx { + struct ccp_cmd cmd; + }; + ++struct ccp_aes_cmac_exp_ctx { ++ unsigned int null_msg; ++ ++ u8 iv[AES_BLOCK_SIZE]; ++ ++ unsigned int buf_count; ++ u8 buf[AES_BLOCK_SIZE]; ++}; ++ + /***** SHA related defines *****/ + #define MAX_SHA_CONTEXT_SIZE SHA256_DIGEST_SIZE + #define MAX_SHA_BLOCK_SIZE SHA256_BLOCK_SIZE +@@ -171,6 +180,19 @@ struct ccp_sha_req_ctx { + struct ccp_cmd cmd; + }; + ++struct ccp_sha_exp_ctx { ++ enum ccp_sha_type type; ++ ++ u64 msg_bits; ++ ++ unsigned int first; ++ ++ u8 ctx[MAX_SHA_CONTEXT_SIZE]; ++ ++ unsigned int buf_count; ++ u8 buf[MAX_SHA_BLOCK_SIZE]; ++}; ++ + /***** Common Context Structure *****/ + struct ccp_ctx { + int (*complete)(struct crypto_async_request *req, int ret); +-- +2.7.1 + + +From 22e73359394fdd2dd6eb3cffec5af01c7fc6ba22 Mon Sep 17 00:00:00 2001 +From: Tom Lendacky +Date: Tue, 2 Feb 2016 11:38:21 -0600 +Subject: [PATCH 086/384] crypto: ccp - Don't assume export/import areas are + aligned + +commit b31dde2a5cb1bf764282abf934266b7193c2bc7c upstream. + +Use a local variable for the exported and imported state so that +alignment is not an issue. On export, set a local variable from the +request context and then memcpy the contents of the local variable to +the export memory area. On import, memcpy the import memory area into +a local variable and then use the local variable to set the request +context. + +Signed-off-by: Tom Lendacky +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/ccp/ccp-crypto-aes-cmac.c | 26 ++++++++++++++--------- + drivers/crypto/ccp/ccp-crypto-sha.c | 36 +++++++++++++++++++------------- + 2 files changed, 37 insertions(+), 25 deletions(-) + +diff --git a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c +index 6a2d836..d095452 100644 +--- a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c ++++ b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c +@@ -223,12 +223,15 @@ static int ccp_aes_cmac_digest(struct ahash_request *req) + static int ccp_aes_cmac_export(struct ahash_request *req, void *out) + { + struct ccp_aes_cmac_req_ctx *rctx = ahash_request_ctx(req); +- struct ccp_aes_cmac_exp_ctx *state = out; ++ struct ccp_aes_cmac_exp_ctx state; + +- state->null_msg = rctx->null_msg; +- memcpy(state->iv, rctx->iv, sizeof(state->iv)); +- state->buf_count = rctx->buf_count; +- memcpy(state->buf, rctx->buf, sizeof(state->buf)); ++ state.null_msg = rctx->null_msg; ++ memcpy(state.iv, rctx->iv, sizeof(state.iv)); ++ state.buf_count = rctx->buf_count; ++ memcpy(state.buf, rctx->buf, sizeof(state.buf)); ++ ++ /* 'out' may not be aligned so memcpy from local variable */ ++ memcpy(out, &state, sizeof(state)); + + return 0; + } +@@ -236,12 +239,15 @@ static int ccp_aes_cmac_export(struct ahash_request *req, void *out) + static int ccp_aes_cmac_import(struct ahash_request *req, const void *in) + { + struct ccp_aes_cmac_req_ctx *rctx = ahash_request_ctx(req); +- const struct ccp_aes_cmac_exp_ctx *state = in; ++ struct ccp_aes_cmac_exp_ctx state; ++ ++ /* 'in' may not be aligned so memcpy to local variable */ ++ memcpy(&state, in, sizeof(state)); + +- rctx->null_msg = state->null_msg; +- memcpy(rctx->iv, state->iv, sizeof(rctx->iv)); +- rctx->buf_count = state->buf_count; +- memcpy(rctx->buf, state->buf, sizeof(rctx->buf)); ++ rctx->null_msg = state.null_msg; ++ memcpy(rctx->iv, state.iv, sizeof(rctx->iv)); ++ rctx->buf_count = state.buf_count; ++ memcpy(rctx->buf, state.buf, sizeof(rctx->buf)); + + return 0; + } +diff --git a/drivers/crypto/ccp/ccp-crypto-sha.c b/drivers/crypto/ccp/ccp-crypto-sha.c +index a67128a..7002c6b 100644 +--- a/drivers/crypto/ccp/ccp-crypto-sha.c ++++ b/drivers/crypto/ccp/ccp-crypto-sha.c +@@ -210,14 +210,17 @@ static int ccp_sha_digest(struct ahash_request *req) + static int ccp_sha_export(struct ahash_request *req, void *out) + { + struct ccp_sha_req_ctx *rctx = ahash_request_ctx(req); +- struct ccp_sha_exp_ctx *state = out; ++ struct ccp_sha_exp_ctx state; + +- state->type = rctx->type; +- state->msg_bits = rctx->msg_bits; +- state->first = rctx->first; +- memcpy(state->ctx, rctx->ctx, sizeof(state->ctx)); +- state->buf_count = rctx->buf_count; +- memcpy(state->buf, rctx->buf, sizeof(state->buf)); ++ state.type = rctx->type; ++ state.msg_bits = rctx->msg_bits; ++ state.first = rctx->first; ++ memcpy(state.ctx, rctx->ctx, sizeof(state.ctx)); ++ state.buf_count = rctx->buf_count; ++ memcpy(state.buf, rctx->buf, sizeof(state.buf)); ++ ++ /* 'out' may not be aligned so memcpy from local variable */ ++ memcpy(out, &state, sizeof(state)); + + return 0; + } +@@ -225,14 +228,17 @@ static int ccp_sha_export(struct ahash_request *req, void *out) + static int ccp_sha_import(struct ahash_request *req, const void *in) + { + struct ccp_sha_req_ctx *rctx = ahash_request_ctx(req); +- const struct ccp_sha_exp_ctx *state = in; +- +- rctx->type = state->type; +- rctx->msg_bits = state->msg_bits; +- rctx->first = state->first; +- memcpy(rctx->ctx, state->ctx, sizeof(rctx->ctx)); +- rctx->buf_count = state->buf_count; +- memcpy(rctx->buf, state->buf, sizeof(rctx->buf)); ++ struct ccp_sha_exp_ctx state; ++ ++ /* 'in' may not be aligned so memcpy to local variable */ ++ memcpy(&state, in, sizeof(state)); ++ ++ rctx->type = state.type; ++ rctx->msg_bits = state.msg_bits; ++ rctx->first = state.first; ++ memcpy(rctx->ctx, state.ctx, sizeof(rctx->ctx)); ++ rctx->buf_count = state.buf_count; ++ memcpy(rctx->buf, state.buf, sizeof(rctx->buf)); + + return 0; + } +-- +2.7.1 + + +From fbec1e4783a78ed80b0f2341625e934f1b8bfa0a Mon Sep 17 00:00:00 2001 +From: Tom Lendacky +Date: Thu, 25 Feb 2016 16:48:13 -0600 +Subject: [PATCH 087/384] crypto: ccp - memset request context to zero during + import + +commit ce0ae266feaf35930394bd770c69778e4ef03ba9 upstream. + +Since a crypto_ahash_import() can be called against a request context +that has not had a crypto_ahash_init() performed, the request context +needs to be cleared to insure there is no random data present. If not, +the random data can result in a kernel oops during crypto_ahash_update(). + +Signed-off-by: Tom Lendacky +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/ccp/ccp-crypto-aes-cmac.c | 1 + + drivers/crypto/ccp/ccp-crypto-sha.c | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c +index d095452..3d9acc5 100644 +--- a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c ++++ b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c +@@ -244,6 +244,7 @@ static int ccp_aes_cmac_import(struct ahash_request *req, const void *in) + /* 'in' may not be aligned so memcpy to local variable */ + memcpy(&state, in, sizeof(state)); + ++ memset(rctx, 0, sizeof(*rctx)); + rctx->null_msg = state.null_msg; + memcpy(rctx->iv, state.iv, sizeof(rctx->iv)); + rctx->buf_count = state.buf_count; +diff --git a/drivers/crypto/ccp/ccp-crypto-sha.c b/drivers/crypto/ccp/ccp-crypto-sha.c +index 7002c6b..8ef06fa 100644 +--- a/drivers/crypto/ccp/ccp-crypto-sha.c ++++ b/drivers/crypto/ccp/ccp-crypto-sha.c +@@ -233,6 +233,7 @@ static int ccp_sha_import(struct ahash_request *req, const void *in) + /* 'in' may not be aligned so memcpy to local variable */ + memcpy(&state, in, sizeof(state)); + ++ memset(rctx, 0, sizeof(*rctx)); + rctx->type = state.type; + rctx->msg_bits = state.msg_bits; + rctx->first = state.first; +-- +2.7.1 + + +From 93ba04a4ef1ca7c24cdfefe4364b31d908b626f8 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Sat, 30 Jan 2016 17:38:28 +0300 +Subject: [PATCH 088/384] crypto: keywrap - memzero the correct memory + +commit 2b8b28fd232233c22fb61009dd8b0587390d2875 upstream. + +We're clearing the wrong memory. The memory corruption is likely +harmless because we weren't going to use that stack memory again but not +zeroing is a potential information leak. + +Fixes: e28facde3c39 ('crypto: keywrap - add key wrapping block chaining mode') +Signed-off-by: Dan Carpenter +Acked-by: Stephan Mueller +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + crypto/keywrap.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/crypto/keywrap.c b/crypto/keywrap.c +index b1d106c..72014f9 100644 +--- a/crypto/keywrap.c ++++ b/crypto/keywrap.c +@@ -212,7 +212,7 @@ static int crypto_kw_decrypt(struct blkcipher_desc *desc, + SEMIBSIZE)) + ret = -EBADMSG; + +- memzero_explicit(&block, sizeof(struct crypto_kw_block)); ++ memzero_explicit(block, sizeof(struct crypto_kw_block)); + + return ret; + } +@@ -297,7 +297,7 @@ static int crypto_kw_encrypt(struct blkcipher_desc *desc, + /* establish the IV for the caller to pick up */ + memcpy(desc->info, block->A, SEMIBSIZE); + +- memzero_explicit(&block, sizeof(struct crypto_kw_block)); ++ memzero_explicit(block, sizeof(struct crypto_kw_block)); + + return 0; + } +-- +2.7.1 + + +From 5c6efd1b23e608c3735fd93586c9e6d72645feef Mon Sep 17 00:00:00 2001 +From: Vladimir Zapolskiy +Date: Sun, 6 Mar 2016 03:21:52 +0200 +Subject: [PATCH 089/384] crypto: atmel - fix checks of error code returned by + devm_ioremap_resource() + +commit 9b52d55f4f0e2bb9a34abbcf99e05e17f1b3b281 upstream. + +The change fixes potential oops while accessing iomem on invalid +address, if devm_ioremap_resource() fails due to some reason. + +The devm_ioremap_resource() function returns ERR_PTR() and never +returns NULL, which makes useless a following check for NULL. + +Signed-off-by: Vladimir Zapolskiy +Fixes: b0e8b3417a62 ("crypto: atmel - use devm_xxx() managed function") +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/atmel-aes.c | 4 ++-- + drivers/crypto/atmel-sha.c | 4 ++-- + drivers/crypto/atmel-tdes.c | 4 ++-- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c +index fb16d81..1dffb13 100644 +--- a/drivers/crypto/atmel-aes.c ++++ b/drivers/crypto/atmel-aes.c +@@ -1396,9 +1396,9 @@ static int atmel_aes_probe(struct platform_device *pdev) + } + + aes_dd->io_base = devm_ioremap_resource(&pdev->dev, aes_res); +- if (!aes_dd->io_base) { ++ if (IS_ERR(aes_dd->io_base)) { + dev_err(dev, "can't ioremap\n"); +- err = -ENOMEM; ++ err = PTR_ERR(aes_dd->io_base); + goto res_err; + } + +diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c +index 3178f84..0dadb63 100644 +--- a/drivers/crypto/atmel-sha.c ++++ b/drivers/crypto/atmel-sha.c +@@ -1405,9 +1405,9 @@ static int atmel_sha_probe(struct platform_device *pdev) + } + + sha_dd->io_base = devm_ioremap_resource(&pdev->dev, sha_res); +- if (!sha_dd->io_base) { ++ if (IS_ERR(sha_dd->io_base)) { + dev_err(dev, "can't ioremap\n"); +- err = -ENOMEM; ++ err = PTR_ERR(sha_dd->io_base); + goto res_err; + } + +diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c +index 2c7a628..bf467d7 100644 +--- a/drivers/crypto/atmel-tdes.c ++++ b/drivers/crypto/atmel-tdes.c +@@ -1417,9 +1417,9 @@ static int atmel_tdes_probe(struct platform_device *pdev) + } + + tdes_dd->io_base = devm_ioremap_resource(&pdev->dev, tdes_res); +- if (!tdes_dd->io_base) { ++ if (IS_ERR(tdes_dd->io_base)) { + dev_err(dev, "can't ioremap\n"); +- err = -ENOMEM; ++ err = PTR_ERR(tdes_dd->io_base); + goto res_err; + } + +-- +2.7.1 + + +From f4cb331b31734034a03f383627e1de1d77bf4674 Mon Sep 17 00:00:00 2001 +From: Vladimir Zapolskiy +Date: Sun, 6 Mar 2016 03:22:04 +0200 +Subject: [PATCH 090/384] crypto: ux500 - fix checks of error code returned by + devm_ioremap_resource() + +commit b62917a2622ebcb03a500ef20da47be80d8c8951 upstream. + +The change fixes potential oops while accessing iomem on invalid +address, if devm_ioremap_resource() fails due to some reason. + +The devm_ioremap_resource() function returns ERR_PTR() and never +returns NULL, which makes useless a following check for NULL. + +Signed-off-by: Vladimir Zapolskiy +Fixes: 5a4eea2658c93 ("crypto: ux500 - Use devm_xxx() managed function") +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/ux500/cryp/cryp_core.c | 4 ++-- + drivers/crypto/ux500/hash/hash_core.c | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c +index 4c243c1..790f7ca 100644 +--- a/drivers/crypto/ux500/cryp/cryp_core.c ++++ b/drivers/crypto/ux500/cryp/cryp_core.c +@@ -1440,9 +1440,9 @@ static int ux500_cryp_probe(struct platform_device *pdev) + + device_data->phybase = res->start; + device_data->base = devm_ioremap_resource(dev, res); +- if (!device_data->base) { ++ if (IS_ERR(device_data->base)) { + dev_err(dev, "[%s]: ioremap failed!", __func__); +- ret = -ENOMEM; ++ ret = PTR_ERR(device_data->base); + goto out; + } + +diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c +index f47d112..66b1c33 100644 +--- a/drivers/crypto/ux500/hash/hash_core.c ++++ b/drivers/crypto/ux500/hash/hash_core.c +@@ -1675,9 +1675,9 @@ static int ux500_hash_probe(struct platform_device *pdev) + + device_data->phybase = res->start; + device_data->base = devm_ioremap_resource(dev, res); +- if (!device_data->base) { ++ if (IS_ERR(device_data->base)) { + dev_err(dev, "%s: ioremap() failed!\n", __func__); +- ret = -ENOMEM; ++ ret = PTR_ERR(device_data->base); + goto out; + } + spin_lock_init(&device_data->ctx_lock); +-- +2.7.1 + + +From 1764172148e49b3c26f8774fb1832b6ba667a36d Mon Sep 17 00:00:00 2001 +From: Boris BREZILLON +Date: Thu, 17 Mar 2016 10:47:10 +0100 +Subject: [PATCH 091/384] crypto: marvell/cesa - forward + devm_ioremap_resource() error code + +commit dfe97ad30e8c038261663a18b9e04b8b5bc07bea upstream. + +Forward devm_ioremap_resource() error code instead of returning +-ENOMEM. + +Signed-off-by: Boris Brezillon +Reported-by: Russell King - ARM Linux +Fixes: f63601fd616a ("crypto: marvell/cesa - add a new driver for Marvell's CESA") +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/marvell/cesa.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/crypto/marvell/cesa.c b/drivers/crypto/marvell/cesa.c +index c0656e7..80239ae 100644 +--- a/drivers/crypto/marvell/cesa.c ++++ b/drivers/crypto/marvell/cesa.c +@@ -420,7 +420,7 @@ static int mv_cesa_probe(struct platform_device *pdev) + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); + cesa->regs = devm_ioremap_resource(dev, res); + if (IS_ERR(cesa->regs)) +- return -ENOMEM; ++ return PTR_ERR(cesa->regs); + + ret = mv_cesa_dev_dma_init(cesa); + if (ret) +-- +2.7.1 + + +From c67e68d2eff642c46f211c763e6b22501667c882 Mon Sep 17 00:00:00 2001 +From: David Howells +Date: Wed, 24 Feb 2016 14:37:15 +0000 +Subject: [PATCH 092/384] X.509: Fix leap year handling again + +commit ac4cbedfdf55455b4c447f17f0fa027dbf02b2a6 upstream. + +There are still a couple of minor issues in the X.509 leap year handling: + + (1) To avoid doing a modulus-by-400 in addition to a modulus-by-100 when + determining whether the year is a leap year or not, I divided the year + by 100 after doing the modulus-by-100, thereby letting the compiler do + one instruction for both, and then did a modulus-by-4. + + Unfortunately, I then passed the now-modified year value to mktime64() + to construct a time value. + + Since this isn't a fast path and since mktime64() does a bunch of + divisions, just condense down to "% 400". It's also easier to read. + + (2) The default month length for any February where the year doesn't + divide by four exactly is obtained from the month_length[] array where + the value is 29, not 28. + + This is fixed by altering the table. + +Reported-by: Rudolf Polzer +Signed-off-by: David Howells +Acked-by: David Woodhouse +Acked-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman +--- + crypto/asymmetric_keys/x509_cert_parser.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c +index 021d39c..13c4e5a 100644 +--- a/crypto/asymmetric_keys/x509_cert_parser.c ++++ b/crypto/asymmetric_keys/x509_cert_parser.c +@@ -494,7 +494,7 @@ int x509_decode_time(time64_t *_t, size_t hdrlen, + unsigned char tag, + const unsigned char *value, size_t vlen) + { +- static const unsigned char month_lengths[] = { 31, 29, 31, 30, 31, 30, ++ static const unsigned char month_lengths[] = { 31, 28, 31, 30, 31, 30, + 31, 31, 30, 31, 30, 31 }; + const unsigned char *p = value; + unsigned year, mon, day, hour, min, sec, mon_len; +@@ -540,9 +540,9 @@ int x509_decode_time(time64_t *_t, size_t hdrlen, + if (year % 4 == 0) { + mon_len = 29; + if (year % 100 == 0) { +- year /= 100; +- if (year % 4 != 0) +- mon_len = 28; ++ mon_len = 28; ++ if (year % 400 == 0) ++ mon_len = 29; + } + } + } +-- +2.7.1 + + +From a29a65aa519779889fa6cc02bc595bbf21bde88a Mon Sep 17 00:00:00 2001 +From: Alexander Usyskin +Date: Sun, 7 Feb 2016 23:35:32 +0200 +Subject: [PATCH 093/384] mei: bus: check if the device is enabled before data + transfer + +commit 15c13dfcad883a1e76b714480fb27be96247fd82 upstream. + +The bus data transfer interface was missing the check if the device is +in enabled state, this may lead to stack corruption during link reset. + +Signed-off-by: Alexander Usyskin +Signed-off-by: Tomas Winkler +Signed-off-by: Greg Kroah-Hartman +--- + drivers/misc/mei/bus.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c +index 0b05aa9..1a173d0 100644 +--- a/drivers/misc/mei/bus.c ++++ b/drivers/misc/mei/bus.c +@@ -53,6 +53,11 @@ ssize_t __mei_cl_send(struct mei_cl *cl, u8 *buf, size_t length, + bus = cl->dev; + + mutex_lock(&bus->device_lock); ++ if (bus->dev_state != MEI_DEV_ENABLED) { ++ rets = -ENODEV; ++ goto out; ++ } ++ + if (!mei_cl_is_connected(cl)) { + rets = -ENODEV; + goto out; +@@ -109,6 +114,10 @@ ssize_t __mei_cl_recv(struct mei_cl *cl, u8 *buf, size_t length) + bus = cl->dev; + + mutex_lock(&bus->device_lock); ++ if (bus->dev_state != MEI_DEV_ENABLED) { ++ rets = -ENODEV; ++ goto out; ++ } + + cb = mei_cl_read_cb(cl, NULL); + if (cb) +-- +2.7.1 + + +From e166cd37cfbc2f73a5527a1416178e06281bd69d Mon Sep 17 00:00:00 2001 +From: Jarkko Sakkinen +Date: Fri, 29 Jan 2016 09:47:22 -0800 +Subject: [PATCH 094/384] tpm: fix the rollback in tpm_chip_register() + +commit 72c91ce8523ae5828fe5e4417ae0aaab53707a08 upstream. + +Fixed the rollback and gave more self-documenting names for the +functions. + +Fixes: d972b0523f ("tpm: fix call order in tpm-chip.c") +Signed-off-by: Jarkko Sakkinen +Reviewed-by: Jason Gunthorpe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/char/tpm/tpm-chip.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c +index 45cc39a..1a9dcee 100644 +--- a/drivers/char/tpm/tpm-chip.c ++++ b/drivers/char/tpm/tpm-chip.c +@@ -140,7 +140,7 @@ struct tpm_chip *tpmm_chip_alloc(struct device *dev, + } + EXPORT_SYMBOL_GPL(tpmm_chip_alloc); + +-static int tpm_dev_add_device(struct tpm_chip *chip) ++static int tpm_add_char_device(struct tpm_chip *chip) + { + int rc; + +@@ -151,7 +151,6 @@ static int tpm_dev_add_device(struct tpm_chip *chip) + chip->devname, MAJOR(chip->dev.devt), + MINOR(chip->dev.devt), rc); + +- device_unregister(&chip->dev); + return rc; + } + +@@ -162,13 +161,14 @@ static int tpm_dev_add_device(struct tpm_chip *chip) + chip->devname, MAJOR(chip->dev.devt), + MINOR(chip->dev.devt), rc); + ++ cdev_del(&chip->cdev); + return rc; + } + + return rc; + } + +-static void tpm_dev_del_device(struct tpm_chip *chip) ++static void tpm_del_char_device(struct tpm_chip *chip) + { + cdev_del(&chip->cdev); + device_unregister(&chip->dev); +@@ -222,7 +222,7 @@ int tpm_chip_register(struct tpm_chip *chip) + + tpm_add_ppi(chip); + +- rc = tpm_dev_add_device(chip); ++ rc = tpm_add_char_device(chip); + if (rc) + goto out_err; + +@@ -274,6 +274,6 @@ void tpm_chip_unregister(struct tpm_chip *chip) + sysfs_remove_link(&chip->pdev->kobj, "ppi"); + + tpm1_chip_unregister(chip); +- tpm_dev_del_device(chip); ++ tpm_del_char_device(chip); + } + EXPORT_SYMBOL_GPL(tpm_chip_unregister); +-- +2.7.1 + + +From c916415a9787fbf413c8edb47cad3a26216a0f05 Mon Sep 17 00:00:00 2001 +From: Jarkko Sakkinen +Date: Thu, 18 Feb 2016 22:11:29 +0200 +Subject: [PATCH 095/384] tpm_crb: tpm2_shutdown() must be called before + tpm_chip_unregister() + +commit 99cda8cb4639de81cde785b5bab9bc52e916e594 upstream. + +Wrong call order. + +Reported-by: Jason Gunthorpe +Fixes: 74d6b3ceaa17 +Signed-off-by: Jarkko Sakkinen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/char/tpm/tpm_crb.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c +index 4bb9727..61e6429 100644 +--- a/drivers/char/tpm/tpm_crb.c ++++ b/drivers/char/tpm/tpm_crb.c +@@ -310,11 +310,11 @@ static int crb_acpi_remove(struct acpi_device *device) + struct device *dev = &device->dev; + struct tpm_chip *chip = dev_get_drvdata(dev); + +- tpm_chip_unregister(chip); +- + if (chip->flags & TPM_CHIP_FLAG_TPM2) + tpm2_shutdown(chip, TPM2_SU_CLEAR); + ++ tpm_chip_unregister(chip); ++ + return 0; + } + +-- +2.7.1 + + +From 354f23187135a4f55da3e4591b04ab86086b8e17 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Sat, 6 Feb 2016 15:44:42 +0100 +Subject: [PATCH 096/384] tpm_eventlog.c: fix binary_bios_measurements + +commit 186d124f07da193a8f47e491af85cb695d415f2f upstream. + +The commit 0cc698af36ff ("vTPM: support little endian guests") copied +the event, but without the event data, did an endian conversion on the +size and tried to output the event data from the copied version, which +has only have one byte of the data, resulting in garbage event data. + +[jarkko.sakkinen@linux.intel.com: fixed minor coding style issues and + renamed the local variable tempPtr as temp_ptr now that there is an + excuse to do this.] + +Signed-off-by: Harald Hoyer +Fixes: 0cc698af36ff ("vTPM: support little endian guests") +Reviewed-by: Jarkko Sakkinen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/char/tpm/tpm_eventlog.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/drivers/char/tpm/tpm_eventlog.c b/drivers/char/tpm/tpm_eventlog.c +index bd72fb0..4e6940a 100644 +--- a/drivers/char/tpm/tpm_eventlog.c ++++ b/drivers/char/tpm/tpm_eventlog.c +@@ -232,7 +232,7 @@ static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v) + { + struct tcpa_event *event = v; + struct tcpa_event temp_event; +- char *tempPtr; ++ char *temp_ptr; + int i; + + memcpy(&temp_event, event, sizeof(struct tcpa_event)); +@@ -242,10 +242,16 @@ static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v) + temp_event.event_type = do_endian_conversion(event->event_type); + temp_event.event_size = do_endian_conversion(event->event_size); + +- tempPtr = (char *)&temp_event; ++ temp_ptr = (char *) &temp_event; + +- for (i = 0; i < sizeof(struct tcpa_event) + temp_event.event_size; i++) +- seq_putc(m, tempPtr[i]); ++ for (i = 0; i < (sizeof(struct tcpa_event) - 1) ; i++) ++ seq_putc(m, temp_ptr[i]); ++ ++ temp_ptr = (char *) v; ++ ++ for (i = (sizeof(struct tcpa_event) - 1); ++ i < (sizeof(struct tcpa_event) + temp_event.event_size); i++) ++ seq_putc(m, temp_ptr[i]); + + return 0; + +-- +2.7.1 + + +From 060365c15c5657db70147a9133375346429c9253 Mon Sep 17 00:00:00 2001 +From: Jarkko Sakkinen +Date: Mon, 8 Feb 2016 22:31:08 +0200 +Subject: [PATCH 097/384] tpm: fix the cleanup of struct tpm_chip + +commit 8e0ee3c9faed7ca68807ea45141775856c438ac0 upstream. + +If the initialization fails before tpm_chip_register(), put_device() +will be not called, which causes release callback not to be called. +This patch fixes the issue by adding put_device() to devres list of +the parent device. + +Fixes: 313d21eeab ("tpm: device class for tpm") +Signed-off-by: Jarkko Sakkinen +Reviewed-by: Jason Gunthorpe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/char/tpm/tpm-chip.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c +index 1a9dcee..2521425 100644 +--- a/drivers/char/tpm/tpm-chip.c ++++ b/drivers/char/tpm/tpm-chip.c +@@ -136,6 +136,8 @@ struct tpm_chip *tpmm_chip_alloc(struct device *dev, + chip->cdev.owner = chip->pdev->driver->owner; + chip->cdev.kobj.parent = &chip->dev.kobj; + ++ devm_add_action(dev, (void (*)(void *)) put_device, &chip->dev); ++ + return chip; + } + EXPORT_SYMBOL_GPL(tpmm_chip_alloc); +@@ -171,7 +173,7 @@ static int tpm_add_char_device(struct tpm_chip *chip) + static void tpm_del_char_device(struct tpm_chip *chip) + { + cdev_del(&chip->cdev); +- device_unregister(&chip->dev); ++ device_del(&chip->dev); + } + + static int tpm1_chip_register(struct tpm_chip *chip) +-- +2.7.1 + + +From 796a23f9b3fb8fecee8c66429f30f16c4d1beadf Mon Sep 17 00:00:00 2001 +From: Grazvydas Ignotas +Date: Sat, 13 Feb 2016 22:41:51 +0200 +Subject: [PATCH 098/384] HID: logitech: fix Dual Action gamepad support + +commit 5d74325a2201376a95520a4a38a1ce2c65761c49 upstream. + +The patch that added Logitech Dual Action gamepad support forgot to +update the special driver list for the device. This caused the logitech +driver not to probe unless kernel module load order was favorable. +Update the special driver list to fix it. Thanks to Simon Wood for the +idea. + +Cc: Vitaly Katraew +Fixes: 56d0c8b7c8fb ("HID: add support for Logitech Dual Action gamepads") +Signed-off-by: Grazvydas Ignotas +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hid/hid-core.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c +index c6f7a69..f16155f5 100644 +--- a/drivers/hid/hid-core.c ++++ b/drivers/hid/hid-core.c +@@ -1897,6 +1897,7 @@ static const struct hid_device_id hid_have_special_driver[] = { + { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_ELITE_KBD) }, + { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500) }, + { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_EXTREME_3D) }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_DUAL_ACTION) }, + { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WHEEL) }, + { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD_CORD) }, + { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD) }, +-- +2.7.1 + + +From 5c53ee39b972ec98f12cc888a2edeaa226cbab98 Mon Sep 17 00:00:00 2001 +From: Dmitry Torokhov +Date: Mon, 14 Mar 2016 15:21:04 -0700 +Subject: [PATCH 099/384] HID: i2c-hid: fix OOB write in + i2c_hid_set_or_send_report() + +commit 3b654288b196ceaa156029d9457ccbded0489b98 upstream. + +Even though hid_hw_* checks that passed in data_len is less than +HID_MAX_BUFFER_SIZE it is not enough, as i2c-hid does not necessarily +allocate buffers of HID_MAX_BUFFER_SIZE but rather checks all device +reports and select largest size. In-kernel users normally just send as much +data as report needs, so there is no problem, but hidraw users can do +whatever they please: + +BUG: KASAN: slab-out-of-bounds in memcpy+0x34/0x54 at addr ffffffc07135ea80 +Write of size 4101 by task syz-executor/8747 +CPU: 2 PID: 8747 Comm: syz-executor Tainted: G BU 3.18.0 #37 +Hardware name: Google Tegra210 Smaug Rev 1,3+ (DT) +Call trace: +[] dump_backtrace+0x0/0x258 arch/arm64/kernel/traps.c:83 +[] show_stack+0x1c/0x2c arch/arm64/kernel/traps.c:172 +[< inline >] __dump_stack lib/dump_stack.c:15 +[] dump_stack+0x90/0x140 lib/dump_stack.c:50 +[< inline >] print_error_description mm/kasan/report.c:97 +[< inline >] kasan_report_error mm/kasan/report.c:278 +[] kasan_report+0x268/0x530 mm/kasan/report.c:305 +[] __asan_storeN+0x20/0x150 mm/kasan/kasan.c:718 +[] memcpy+0x30/0x54 mm/kasan/kasan.c:299 +[] __i2c_hid_command+0x2b0/0x7b4 drivers/hid/i2c-hid/i2c-hid.c:178 +[< inline >] i2c_hid_set_or_send_report drivers/hid/i2c-hid/i2c-hid.c:321 +[] i2c_hid_output_raw_report.isra.2+0x3d4/0x4b8 drivers/hid/i2c-hid/i2c-hid.c:589 +[] i2c_hid_output_report+0x54/0x68 drivers/hid/i2c-hid/i2c-hid.c:602 +[< inline >] hid_hw_output_report include/linux/hid.h:1039 +[] hidraw_send_report+0x400/0x414 drivers/hid/hidraw.c:154 +[] hidraw_write+0x40/0x64 drivers/hid/hidraw.c:177 +[] vfs_write+0x1d4/0x3cc fs/read_write.c:534 +[< inline >] SYSC_pwrite64 fs/read_write.c:627 +[] SyS_pwrite64+0xec/0x144 fs/read_write.c:614 +Object at ffffffc07135ea80, in cache kmalloc-512 +Object allocated with size 268 bytes. + +Let's check data length against the buffer size before attempting to copy +data over. + +Reported-by: Alexander Potapenko +Signed-off-by: Dmitry Torokhov +Reviewed-by: Benjamin Tissoires +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hid/i2c-hid/i2c-hid.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c +index 10bd8e6..0b80633 100644 +--- a/drivers/hid/i2c-hid/i2c-hid.c ++++ b/drivers/hid/i2c-hid/i2c-hid.c +@@ -282,17 +282,21 @@ static int i2c_hid_set_or_send_report(struct i2c_client *client, u8 reportType, + u16 dataRegister = le16_to_cpu(ihid->hdesc.wDataRegister); + u16 outputRegister = le16_to_cpu(ihid->hdesc.wOutputRegister); + u16 maxOutputLength = le16_to_cpu(ihid->hdesc.wMaxOutputLength); ++ u16 size; ++ int args_len; ++ int index = 0; ++ ++ i2c_hid_dbg(ihid, "%s\n", __func__); ++ ++ if (data_len > ihid->bufsize) ++ return -EINVAL; + +- /* hid_hw_* already checked that data_len < HID_MAX_BUFFER_SIZE */ +- u16 size = 2 /* size */ + ++ size = 2 /* size */ + + (reportID ? 1 : 0) /* reportID */ + + data_len /* buf */; +- int args_len = (reportID >= 0x0F ? 1 : 0) /* optional third byte */ + ++ args_len = (reportID >= 0x0F ? 1 : 0) /* optional third byte */ + + 2 /* dataRegister */ + + size /* args */; +- int index = 0; +- +- i2c_hid_dbg(ihid, "%s\n", __func__); + + if (!use_data && maxOutputLength == 0) + return -ENOSYS; +-- +2.7.1 + + +From 751d9bf88f43540cf1de26cdc9cab96630a6b68c Mon Sep 17 00:00:00 2001 +From: Benjamin Tissoires +Date: Mon, 7 Mar 2016 11:02:38 +0100 +Subject: [PATCH 100/384] HID: multitouch: force retrieving of Win8 signature + blob + +commit 45c5c6828214605eaefa6755c47bd1a2c7eb203e upstream. + +The Synaptics 0x11e5 over I2C found in the Asus T100-CHI requires to +fetch the signature blob to actually start sending events. + +With this patch, we should be close enough to the Windows driver which +checks the content of the blob at plugin to validate or not the +touchscreen. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=113481 +Fixes: 6d4f5440 ("HID: multitouch: Fetch feature reports on demand for Win8 devices") +Signed-off-by: Benjamin Tissoires +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hid/hid-multitouch.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c +index 2b8ff18..c5ec4f9 100644 +--- a/drivers/hid/hid-multitouch.c ++++ b/drivers/hid/hid-multitouch.c +@@ -396,6 +396,11 @@ static void mt_feature_mapping(struct hid_device *hdev, + td->is_buttonpad = true; + + break; ++ case 0xff0000c5: ++ /* Retrieve the Win8 blob once to enable some devices */ ++ if (usage->usage_index == 0) ++ mt_get_feature(hdev, field->report); ++ break; + } + } + +-- +2.7.1 + + +From 5aafebaea005c9f143d83e7507e51ddbb2b6c789 Mon Sep 17 00:00:00 2001 +From: Benjamin Tissoires +Date: Fri, 12 Feb 2016 17:10:37 +0100 +Subject: [PATCH 101/384] HID: fix hid_ignore_special_drivers module parameter + +commit 4392bf333388cabdad5afe5b1500002d7b9c318e upstream. + +hid_ignore_special_drivers works fine until hid_scan_report autodetects and +reassign devices (for hid-multitouch, hid-microsoft and hid-rmi). + +Simplify the handling of the parameter: if it is there, use hid-generic, no +matter what, and if not, scan the device or rely on the hid_have_special_driver +table. + +This was detected while trying to disable hid-multitouch on a Surface Pro cover +which prevented to use the keyboard. + +Signed-off-by: Benjamin Tissoires +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hid/hid-core.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c +index f16155f5..ec791e1 100644 +--- a/drivers/hid/hid-core.c ++++ b/drivers/hid/hid-core.c +@@ -2616,9 +2616,10 @@ int hid_add_device(struct hid_device *hdev) + /* + * Scan generic devices for group information + */ +- if (hid_ignore_special_drivers || +- (!hdev->group && +- !hid_match_id(hdev, hid_have_special_driver))) { ++ if (hid_ignore_special_drivers) { ++ hdev->group = HID_GROUP_GENERIC; ++ } else if (!hdev->group && ++ !hid_match_id(hdev, hid_have_special_driver)) { + ret = hid_scan_report(hdev); + if (ret) + hid_warn(hdev, "bad device descriptor (%d)\n", ret); +-- +2.7.1 + + +From 193e0cdc86a8e0c7bdaaa03573c49b5df00e591c Mon Sep 17 00:00:00 2001 +From: "Spencer E. Olson" +Date: Tue, 12 Jan 2016 10:33:18 -0700 +Subject: [PATCH 102/384] staging: comedi: ni_tiocmd: change mistaken use of + start_src for start_arg + +commit 1fd24a4702d2af0ea4d5845126cf57d4d1796216 upstream. + +This fixes a bug in function ni_tio_input_inttrig(). The trigger number +should be compared to cmd->start_arg, not cmd->start_src. + +Fixes: 6a760394d7eb ("staging: comedi: ni_tiocmd: clarify the cmd->start_arg validation and use") +Signed-off-by: Spencer E. Olson +Reviewed-by: Ian Abbott +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/comedi/drivers/ni_tiocmd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/staging/comedi/drivers/ni_tiocmd.c b/drivers/staging/comedi/drivers/ni_tiocmd.c +index 437f723..823e479 100644 +--- a/drivers/staging/comedi/drivers/ni_tiocmd.c ++++ b/drivers/staging/comedi/drivers/ni_tiocmd.c +@@ -92,7 +92,7 @@ static int ni_tio_input_inttrig(struct comedi_device *dev, + unsigned long flags; + int ret = 0; + +- if (trig_num != cmd->start_src) ++ if (trig_num != cmd->start_arg) + return -EINVAL; + + spin_lock_irqsave(&counter->lock, flags); +-- +2.7.1 + + +From 38c2429da6265a879adda0859eaa2f58705a512d Mon Sep 17 00:00:00 2001 +From: Vladimir Zapolskiy +Date: Wed, 23 Mar 2016 00:38:43 +0200 +Subject: [PATCH 103/384] staging: android: ion_test: fix check of + platform_device_register_simple() error code + +commit ccbc2a9e7878ff09bcaed4893c2a2d3adbb797e2 upstream. + +On error platform_device_register_simple() returns ERR_PTR() value, +check for NULL always fails. The change corrects the check itself and +propagates the returned error upwards. + +Fixes: 81fb0b901397 ("staging: android: ion_test: unregister the platform device") +Signed-off-by: Vladimir Zapolskiy +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/android/ion/ion_test.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/staging/android/ion/ion_test.c b/drivers/staging/android/ion/ion_test.c +index b8dcf5a..58d4689 100644 +--- a/drivers/staging/android/ion/ion_test.c ++++ b/drivers/staging/android/ion/ion_test.c +@@ -285,8 +285,8 @@ static int __init ion_test_init(void) + { + ion_test_pdev = platform_device_register_simple("ion-test", + -1, NULL, 0); +- if (!ion_test_pdev) +- return -ENODEV; ++ if (IS_ERR(ion_test_pdev)) ++ return PTR_ERR(ion_test_pdev); + + return platform_driver_probe(&ion_test_platform_driver, ion_test_probe); + } +-- +2.7.1 + + +From 6cb4bb812cb2c5972ccbb633ab8f3abd0e3f91af Mon Sep 17 00:00:00 2001 +From: H Hartley Sweeten +Date: Tue, 22 Mar 2016 10:04:48 -0700 +Subject: [PATCH 104/384] staging: comedi: ni_mio_common: fix the + ni_write[blw]() functions + +commit bd3a3cd6c27b117fb9a43a38c8072c95332beecc upstream. + +Memory mapped io (dev->mmio) should not also be writing to the ioport +(dev->iobase) registers. Add the missing 'else' to these functions. + +Fixes: 0953ee4acca0 ("staging: comedi: ni_mio_common: checkpatch.pl cleanup (else not useful)") +Signed-off-by: H Hartley Sweeten +Reviewed-by: Ian Abbott +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/comedi/drivers/ni_mio_common.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c +index 6cc304a..27fbf1a 100644 +--- a/drivers/staging/comedi/drivers/ni_mio_common.c ++++ b/drivers/staging/comedi/drivers/ni_mio_common.c +@@ -246,24 +246,24 @@ static void ni_writel(struct comedi_device *dev, uint32_t data, int reg) + { + if (dev->mmio) + writel(data, dev->mmio + reg); +- +- outl(data, dev->iobase + reg); ++ else ++ outl(data, dev->iobase + reg); + } + + static void ni_writew(struct comedi_device *dev, uint16_t data, int reg) + { + if (dev->mmio) + writew(data, dev->mmio + reg); +- +- outw(data, dev->iobase + reg); ++ else ++ outw(data, dev->iobase + reg); + } + + static void ni_writeb(struct comedi_device *dev, uint8_t data, int reg) + { + if (dev->mmio) + writeb(data, dev->mmio + reg); +- +- outb(data, dev->iobase + reg); ++ else ++ outb(data, dev->iobase + reg); + } + + static uint32_t ni_readl(struct comedi_device *dev, int reg) +-- +2.7.1 + + +From afbccde01abf731a8d122433a55c4672c2fd79e5 Mon Sep 17 00:00:00 2001 +From: Peter Hurley +Date: Sun, 10 Jan 2016 20:36:12 -0800 +Subject: [PATCH 105/384] tty: Fix GPF in flush_to_ldisc(), part 2 + +commit f33798deecbd59a2955f40ac0ae2bc7dff54c069 upstream. + +commit 9ce119f318ba ("tty: Fix GPF in flush_to_ldisc()") fixed a +GPF caused by a line discipline which does not define a receive_buf() +method. + +However, the vt driver (and speakup driver also) pushes selection +data directly to the line discipline receive_buf() method via +tty_ldisc_receive_buf(). Fix the same problem in tty_ldisc_receive_buf(). + +Signed-off-by: Peter Hurley +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/tty.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/linux/tty.h b/include/linux/tty.h +index 6b6e811..3bf03b6 100644 +--- a/include/linux/tty.h ++++ b/include/linux/tty.h +@@ -594,7 +594,7 @@ static inline int tty_ldisc_receive_buf(struct tty_ldisc *ld, unsigned char *p, + count = ld->ops->receive_buf2(ld->tty, p, f, count); + else { + count = min_t(int, count, ld->tty->receive_room); +- if (count) ++ if (count && ld->ops->receive_buf) + ld->ops->receive_buf(ld->tty, p, f, count); + } + return count; +-- +2.7.1 + + +From 632e736bce348188843c61a2a1d0db0791afac5c Mon Sep 17 00:00:00 2001 +From: Peter Hurley +Date: Sat, 9 Jan 2016 17:48:45 -0800 +Subject: [PATCH 106/384] net: irda: Fix use-after-free in irtty_open() + +commit 401879c57f01cbf2da204ad2e8db910525c6dbea upstream. + +The N_IRDA line discipline may access the previous line discipline's closed +and already-fre private data on open [1]. + +The tty->disc_data field _never_ refers to valid data on entry to the +line discipline's open() method. Rather, the ldisc is expected to +initialize that field for its own use for the lifetime of the instance +(ie. from open() to close() only). + +[1] + ================================================================== + BUG: KASAN: use-after-free in irtty_open+0x422/0x550 at addr ffff8800331dd068 + Read of size 4 by task a.out/13960 + ============================================================================= + BUG kmalloc-512 (Tainted: G B ): kasan: bad access detected + ----------------------------------------------------------------------------- + ... + Call Trace: + [] __asan_report_load4_noabort+0x3e/0x40 mm/kasan/report.c:279 + [] irtty_open+0x422/0x550 drivers/net/irda/irtty-sir.c:436 + [] tty_ldisc_open.isra.2+0x60/0xa0 drivers/tty/tty_ldisc.c:447 + [] tty_set_ldisc+0x1a0/0x940 drivers/tty/tty_ldisc.c:567 + [< inline >] tiocsetd drivers/tty/tty_io.c:2650 + [] tty_ioctl+0xace/0x1fd0 drivers/tty/tty_io.c:2883 + [< inline >] vfs_ioctl fs/ioctl.c:43 + [] do_vfs_ioctl+0x57c/0xe60 fs/ioctl.c:607 + [< inline >] SYSC_ioctl fs/ioctl.c:622 + [] SyS_ioctl+0x74/0x80 fs/ioctl.c:613 + [] entry_SYSCALL_64_fastpath+0x16/0x7a + +Reported-and-tested-by: Dmitry Vyukov +Signed-off-by: Peter Hurley +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/irda/irtty-sir.c | 10 ---------- + 1 file changed, 10 deletions(-) + +diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c +index 696852e..7a3f990 100644 +--- a/drivers/net/irda/irtty-sir.c ++++ b/drivers/net/irda/irtty-sir.c +@@ -430,16 +430,6 @@ static int irtty_open(struct tty_struct *tty) + + /* Module stuff handled via irda_ldisc.owner - Jean II */ + +- /* First make sure we're not already connected. */ +- if (tty->disc_data != NULL) { +- priv = tty->disc_data; +- if (priv && priv->magic == IRTTY_MAGIC) { +- ret = -EEXIST; +- goto out; +- } +- tty->disc_data = NULL; /* ### */ +- } +- + /* stop the underlying driver */ + irtty_stop_receiver(tty, TRUE); + if (tty->ops->stop) +-- +2.7.1 + + +From 7f92ca9f91f7c6a5d851490aa4e3ff77a3cfe893 Mon Sep 17 00:00:00 2001 +From: Sebastian Frias +Date: Fri, 18 Dec 2015 17:40:05 +0100 +Subject: [PATCH 107/384] 8250: use callbacks to access UART_DLL/UART_DLM + +commit 0b41ce991052022c030fd868e03877700220b090 upstream. + +Some UART HW has a single register combining UART_DLL/UART_DLM +(this was probably forgotten in the change that introduced the +callbacks, commit b32b19b8ffc05cbd3bf91c65e205f6a912ca15d9) + +Fixes: b32b19b8ffc0 ("[SERIAL] 8250: set divisor register correctly ...") + +Signed-off-by: Sebastian Frias +Reviewed-by: Peter Hurley +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/8250/8250_port.c | 18 ++++++------------ + 1 file changed, 6 insertions(+), 12 deletions(-) + +diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c +index 5568d70..91b831a1 100644 +--- a/drivers/tty/serial/8250/8250_port.c ++++ b/drivers/tty/serial/8250/8250_port.c +@@ -714,22 +714,16 @@ static int size_fifo(struct uart_8250_port *up) + */ + static unsigned int autoconfig_read_divisor_id(struct uart_8250_port *p) + { +- unsigned char old_dll, old_dlm, old_lcr; +- unsigned int id; ++ unsigned char old_lcr; ++ unsigned int id, old_dl; + + old_lcr = serial_in(p, UART_LCR); + serial_out(p, UART_LCR, UART_LCR_CONF_MODE_A); ++ old_dl = serial_dl_read(p); ++ serial_dl_write(p, 0); ++ id = serial_dl_read(p); ++ serial_dl_write(p, old_dl); + +- old_dll = serial_in(p, UART_DLL); +- old_dlm = serial_in(p, UART_DLM); +- +- serial_out(p, UART_DLL, 0); +- serial_out(p, UART_DLM, 0); +- +- id = serial_in(p, UART_DLL) | serial_in(p, UART_DLM) << 8; +- +- serial_out(p, UART_DLL, old_dll); +- serial_out(p, UART_DLM, old_dlm); + serial_out(p, UART_LCR, old_lcr); + + return id; +-- +2.7.1 + + +From c6f9f65c69d92acd0f555eb857796ff557206dae Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sun, 14 Feb 2016 17:51:37 -0200 +Subject: [PATCH 108/384] saa7134: Fix bytesperline not being set correctly for + planar formats + +commit 3e71da19f9dc22e39a755d6ae9678661abb66adc upstream. + +bytesperline should be the bytesperline for the first plane for planar +formats, not that of all planes combined. + +This fixes a crash in xawtv caused by the wrong bpl. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1305389 +Reported-and-tested-by: Stas Sergeev + +Signed-off-by: Hans de Goede +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/pci/saa7134/saa7134-video.c | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c +index 518086c..15e56c0 100644 +--- a/drivers/media/pci/saa7134/saa7134-video.c ++++ b/drivers/media/pci/saa7134/saa7134-video.c +@@ -1219,10 +1219,13 @@ static int saa7134_g_fmt_vid_cap(struct file *file, void *priv, + f->fmt.pix.height = dev->height; + f->fmt.pix.field = dev->field; + f->fmt.pix.pixelformat = dev->fmt->fourcc; +- f->fmt.pix.bytesperline = +- (f->fmt.pix.width * dev->fmt->depth) >> 3; ++ if (dev->fmt->planar) ++ f->fmt.pix.bytesperline = f->fmt.pix.width; ++ else ++ f->fmt.pix.bytesperline = ++ (f->fmt.pix.width * dev->fmt->depth) / 8; + f->fmt.pix.sizeimage = +- f->fmt.pix.height * f->fmt.pix.bytesperline; ++ (f->fmt.pix.height * f->fmt.pix.width * dev->fmt->depth) / 8; + f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; + return 0; + } +@@ -1298,10 +1301,13 @@ static int saa7134_try_fmt_vid_cap(struct file *file, void *priv, + if (f->fmt.pix.height > maxh) + f->fmt.pix.height = maxh; + f->fmt.pix.width &= ~0x03; +- f->fmt.pix.bytesperline = +- (f->fmt.pix.width * fmt->depth) >> 3; ++ if (fmt->planar) ++ f->fmt.pix.bytesperline = f->fmt.pix.width; ++ else ++ f->fmt.pix.bytesperline = ++ (f->fmt.pix.width * fmt->depth) / 8; + f->fmt.pix.sizeimage = +- f->fmt.pix.height * f->fmt.pix.bytesperline; ++ (f->fmt.pix.height * f->fmt.pix.width * fmt->depth) / 8; + f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; + + return 0; +-- +2.7.1 + + +From 316c49a508095cd848e6f1820437ee857e154830 Mon Sep 17 00:00:00 2001 +From: Hans Verkuil +Date: Wed, 10 Feb 2016 09:32:25 -0200 +Subject: [PATCH 109/384] adv7511: TX_EDID_PRESENT is still 1 after a + disconnect + +commit b339a72e04a62f0b1882c43492fc712f1176b3e6 upstream. + +The V4L2_CID_TX_EDID_PRESENT control reports if an EDID is present. +The adv7511 however still reported the EDID present after disconnecting +the HDMI cable. Fix the logic regarding this control. And when the EDID +is disconnected also call ADV7511_EDID_DETECT to notify the bridge driver. +This was also missing. + +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/i2c/adv7511.c | 21 +++++++++++++++------ + 1 file changed, 15 insertions(+), 6 deletions(-) + +diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c +index e4900df..c24839c 100644 +--- a/drivers/media/i2c/adv7511.c ++++ b/drivers/media/i2c/adv7511.c +@@ -1161,12 +1161,23 @@ static void adv7511_dbg_dump_edid(int lvl, int debug, struct v4l2_subdev *sd, in + } + } + ++static void adv7511_notify_no_edid(struct v4l2_subdev *sd) ++{ ++ struct adv7511_state *state = get_adv7511_state(sd); ++ struct adv7511_edid_detect ed; ++ ++ /* We failed to read the EDID, so send an event for this. */ ++ ed.present = false; ++ ed.segment = adv7511_rd(sd, 0xc4); ++ v4l2_subdev_notify(sd, ADV7511_EDID_DETECT, (void *)&ed); ++ v4l2_ctrl_s_ctrl(state->have_edid0_ctrl, 0x0); ++} ++ + static void adv7511_edid_handler(struct work_struct *work) + { + struct delayed_work *dwork = to_delayed_work(work); + struct adv7511_state *state = container_of(dwork, struct adv7511_state, edid_handler); + struct v4l2_subdev *sd = &state->sd; +- struct adv7511_edid_detect ed; + + v4l2_dbg(1, debug, sd, "%s:\n", __func__); + +@@ -1191,9 +1202,7 @@ static void adv7511_edid_handler(struct work_struct *work) + } + + /* We failed to read the EDID, so send an event for this. */ +- ed.present = false; +- ed.segment = adv7511_rd(sd, 0xc4); +- v4l2_subdev_notify(sd, ADV7511_EDID_DETECT, (void *)&ed); ++ adv7511_notify_no_edid(sd); + v4l2_dbg(1, debug, sd, "%s: no edid found\n", __func__); + } + +@@ -1264,7 +1273,6 @@ static void adv7511_check_monitor_present_status(struct v4l2_subdev *sd) + /* update read only ctrls */ + v4l2_ctrl_s_ctrl(state->hotplug_ctrl, adv7511_have_hotplug(sd) ? 0x1 : 0x0); + v4l2_ctrl_s_ctrl(state->rx_sense_ctrl, adv7511_have_rx_sense(sd) ? 0x1 : 0x0); +- v4l2_ctrl_s_ctrl(state->have_edid0_ctrl, state->edid.segments ? 0x1 : 0x0); + + if ((status & MASK_ADV7511_HPD_DETECT) && ((status & MASK_ADV7511_MSEN_DETECT) || state->edid.segments)) { + v4l2_dbg(1, debug, sd, "%s: hotplug and (rx-sense or edid)\n", __func__); +@@ -1294,6 +1302,7 @@ static void adv7511_check_monitor_present_status(struct v4l2_subdev *sd) + } + adv7511_s_power(sd, false); + memset(&state->edid, 0, sizeof(struct adv7511_state_edid)); ++ adv7511_notify_no_edid(sd); + } + } + +@@ -1370,6 +1379,7 @@ static bool adv7511_check_edid_status(struct v4l2_subdev *sd) + } + /* one more segment read ok */ + state->edid.segments = segment + 1; ++ v4l2_ctrl_s_ctrl(state->have_edid0_ctrl, 0x1); + if (((state->edid.data[0x7e] >> 1) + 1) > state->edid.segments) { + /* Request next EDID segment */ + v4l2_dbg(1, debug, sd, "%s: request segment %d\n", __func__, state->edid.segments); +@@ -1389,7 +1399,6 @@ static bool adv7511_check_edid_status(struct v4l2_subdev *sd) + ed.present = true; + ed.segment = 0; + state->edid_detect_counter++; +- v4l2_ctrl_s_ctrl(state->have_edid0_ctrl, state->edid.segments ? 0x1 : 0x0); + v4l2_subdev_notify(sd, ADV7511_EDID_DETECT, (void *)&ed); + return ed.present; + } +-- +2.7.1 + + +From f3c73cbb5ee61a8f3219294f819388ab78bca132 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sun, 7 Feb 2016 09:24:29 -0200 +Subject: [PATCH 110/384] bttv: Width must be a multiple of 16 when capturing + planar formats + +commit 5c915c68763889f0183a1cc61c84bb228b60124a upstream. + +On my bttv card "Hauppauge WinTV [card=10]" capturing in YV12 fmt at max +size results in a solid green rectangle being captured (all colors 0 in +YUV). + +This turns out to be caused by max-width (924) not being a multiple of 16. + +We've likely never hit this problem before since normally xawtv / tvtime, +etc. will prefer packed pixel formats. But when using a video card which +is using xf86-video-modesetting + glamor, only planar XVideo fmts are +available, and xawtv will chose a matching capture format to avoid needing +to do conversion, triggering the solid green window problem. + +Signed-off-by: Hans de Goede +Acked-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/pci/bt8xx/bttv-driver.c | 26 ++++++++++++++++++++------ + 1 file changed, 20 insertions(+), 6 deletions(-) + +diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c +index 15a4ebc..51dbef2 100644 +--- a/drivers/media/pci/bt8xx/bttv-driver.c ++++ b/drivers/media/pci/bt8xx/bttv-driver.c +@@ -2334,6 +2334,19 @@ static int bttv_g_fmt_vid_overlay(struct file *file, void *priv, + return 0; + } + ++static void bttv_get_width_mask_vid_cap(const struct bttv_format *fmt, ++ unsigned int *width_mask, ++ unsigned int *width_bias) ++{ ++ if (fmt->flags & FORMAT_FLAGS_PLANAR) { ++ *width_mask = ~15; /* width must be a multiple of 16 pixels */ ++ *width_bias = 8; /* nearest */ ++ } else { ++ *width_mask = ~3; /* width must be a multiple of 4 pixels */ ++ *width_bias = 2; /* nearest */ ++ } ++} ++ + static int bttv_try_fmt_vid_cap(struct file *file, void *priv, + struct v4l2_format *f) + { +@@ -2343,6 +2356,7 @@ static int bttv_try_fmt_vid_cap(struct file *file, void *priv, + enum v4l2_field field; + __s32 width, height; + __s32 height2; ++ unsigned int width_mask, width_bias; + int rc; + + fmt = format_by_fourcc(f->fmt.pix.pixelformat); +@@ -2375,9 +2389,9 @@ static int bttv_try_fmt_vid_cap(struct file *file, void *priv, + width = f->fmt.pix.width; + height = f->fmt.pix.height; + ++ bttv_get_width_mask_vid_cap(fmt, &width_mask, &width_bias); + rc = limit_scaled_size_lock(fh, &width, &height, field, +- /* width_mask: 4 pixels */ ~3, +- /* width_bias: nearest */ 2, ++ width_mask, width_bias, + /* adjust_size */ 1, + /* adjust_crop */ 0); + if (0 != rc) +@@ -2410,6 +2424,7 @@ static int bttv_s_fmt_vid_cap(struct file *file, void *priv, + struct bttv_fh *fh = priv; + struct bttv *btv = fh->btv; + __s32 width, height; ++ unsigned int width_mask, width_bias; + enum v4l2_field field; + + retval = bttv_switch_type(fh, f->type); +@@ -2424,9 +2439,10 @@ static int bttv_s_fmt_vid_cap(struct file *file, void *priv, + height = f->fmt.pix.height; + field = f->fmt.pix.field; + ++ fmt = format_by_fourcc(f->fmt.pix.pixelformat); ++ bttv_get_width_mask_vid_cap(fmt, &width_mask, &width_bias); + retval = limit_scaled_size_lock(fh, &width, &height, f->fmt.pix.field, +- /* width_mask: 4 pixels */ ~3, +- /* width_bias: nearest */ 2, ++ width_mask, width_bias, + /* adjust_size */ 1, + /* adjust_crop */ 1); + if (0 != retval) +@@ -2434,8 +2450,6 @@ static int bttv_s_fmt_vid_cap(struct file *file, void *priv, + + f->fmt.pix.field = field; + +- fmt = format_by_fourcc(f->fmt.pix.pixelformat); +- + /* update our state informations */ + fh->fmt = fmt; + fh->cap.field = f->fmt.pix.field; +-- +2.7.1 + + +From e3e8ebc6f619bab571dbc877fcc465056ba888bc Mon Sep 17 00:00:00 2001 +From: Philipp Zabel +Date: Mon, 4 Jan 2016 17:30:09 -0200 +Subject: [PATCH 111/384] coda: fix first encoded frame payload + +commit 74dc385cb450089b28c28be2c8a0baca296b95f9 upstream. + +During the recent vb2_buffer restructuring, the calculation of the +buffer payload reported to userspace was accidentally broken for the +first encoded frame, counting only the length of the headers. +This patch re-adds the length of the actual frame data. + +Fixes: 2d7007153f0c ("[media] media: videobuf2: Restructure vb2_buffer") + +Reported-by: Michael Olbrich +Signed-off-by: Philipp Zabel +Tested-by: Jan Luebbe +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/platform/coda/coda-bit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c +index 654e964..d76511c 100644 +--- a/drivers/media/platform/coda/coda-bit.c ++++ b/drivers/media/platform/coda/coda-bit.c +@@ -1342,7 +1342,7 @@ static void coda_finish_encode(struct coda_ctx *ctx) + + /* Calculate bytesused field */ + if (dst_buf->sequence == 0) { +- vb2_set_plane_payload(&dst_buf->vb2_buf, 0, ++ vb2_set_plane_payload(&dst_buf->vb2_buf, 0, wr_ptr - start_ptr + + ctx->vpu_header_size[0] + + ctx->vpu_header_size[1] + + ctx->vpu_header_size[2]); +-- +2.7.1 + + +From 61be5108ff34fe25f7d55f4c8c07d1071035b695 Mon Sep 17 00:00:00 2001 +From: Tiffany Lin +Date: Tue, 19 Jan 2016 05:56:50 -0200 +Subject: [PATCH 112/384] media: v4l2-compat-ioctl32: fix missing length copy + in put_v4l2_buffer32 + +commit 7df5ab8774aa383c6d2bff00688d004585d96dfd upstream. + +In v4l2-compliance utility, test QUERYBUF required correct length +value to go through each planar to check planar's length in +multi-planar buffer type + +Signed-off-by: Tiffany Lin +Reviewed-by: Laurent Pinchart +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 21 ++++++++------------- + 1 file changed, 8 insertions(+), 13 deletions(-) + +diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +index 0504b05..1349e5d 100644 +--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c ++++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +@@ -416,7 +416,8 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user + get_user(kp->index, &up->index) || + get_user(kp->type, &up->type) || + get_user(kp->flags, &up->flags) || +- get_user(kp->memory, &up->memory)) ++ get_user(kp->memory, &up->memory) || ++ get_user(kp->length, &up->length)) + return -EFAULT; + + if (V4L2_TYPE_IS_OUTPUT(kp->type)) +@@ -428,9 +429,6 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user + return -EFAULT; + + if (V4L2_TYPE_IS_MULTIPLANAR(kp->type)) { +- if (get_user(kp->length, &up->length)) +- return -EFAULT; +- + num_planes = kp->length; + if (num_planes == 0) { + kp->m.planes = NULL; +@@ -463,16 +461,14 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user + } else { + switch (kp->memory) { + case V4L2_MEMORY_MMAP: +- if (get_user(kp->length, &up->length) || +- get_user(kp->m.offset, &up->m.offset)) ++ if (get_user(kp->m.offset, &up->m.offset)) + return -EFAULT; + break; + case V4L2_MEMORY_USERPTR: + { + compat_long_t tmp; + +- if (get_user(kp->length, &up->length) || +- get_user(tmp, &up->m.userptr)) ++ if (get_user(tmp, &up->m.userptr)) + return -EFAULT; + + kp->m.userptr = (unsigned long)compat_ptr(tmp); +@@ -514,7 +510,8 @@ static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user + copy_to_user(&up->timecode, &kp->timecode, sizeof(struct v4l2_timecode)) || + put_user(kp->sequence, &up->sequence) || + put_user(kp->reserved2, &up->reserved2) || +- put_user(kp->reserved, &up->reserved)) ++ put_user(kp->reserved, &up->reserved) || ++ put_user(kp->length, &up->length)) + return -EFAULT; + + if (V4L2_TYPE_IS_MULTIPLANAR(kp->type)) { +@@ -537,13 +534,11 @@ static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user + } else { + switch (kp->memory) { + case V4L2_MEMORY_MMAP: +- if (put_user(kp->length, &up->length) || +- put_user(kp->m.offset, &up->m.offset)) ++ if (put_user(kp->m.offset, &up->m.offset)) + return -EFAULT; + break; + case V4L2_MEMORY_USERPTR: +- if (put_user(kp->length, &up->length) || +- put_user(kp->m.userptr, &up->m.userptr)) ++ if (put_user(kp->m.userptr, &up->m.userptr)) + return -EFAULT; + break; + case V4L2_MEMORY_OVERLAY: +-- +2.7.1 + + +From 85351bf7466a1bb5309e5f90a088267c72f12b5c Mon Sep 17 00:00:00 2001 +From: Asai Thambi SP +Date: Wed, 24 Feb 2016 21:17:32 -0800 +Subject: [PATCH 113/384] mtip32xx: Avoid issuing standby immediate cmd during + FTL rebuild + +commit d8a18d2d8f5de55666c6011ed175939d22c8e3d8 upstream. + +Prevent standby immediate command from being issued in remove, +suspend and shutdown paths, while drive is in FTL rebuild process. + +Signed-off-by: Selvan Mani +Signed-off-by: Vignesh Gunasekaran +Signed-off-by: Asai Thambi S P +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/block/mtip32xx/mtip32xx.c | 20 ++++++++++++-------- + 1 file changed, 12 insertions(+), 8 deletions(-) + +diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c +index 3457ac8..deb0c76 100644 +--- a/drivers/block/mtip32xx/mtip32xx.c ++++ b/drivers/block/mtip32xx/mtip32xx.c +@@ -3270,20 +3270,25 @@ out1: + return rv; + } + +-static void mtip_standby_drive(struct driver_data *dd) ++static int mtip_standby_drive(struct driver_data *dd) + { +- if (dd->sr) +- return; ++ int rv = 0; + ++ if (dd->sr || !dd->port) ++ return -ENODEV; + /* + * Send standby immediate (E0h) to the drive so that it + * saves its state. + */ + if (!test_bit(MTIP_PF_REBUILD_BIT, &dd->port->flags) && +- !test_bit(MTIP_DDF_SEC_LOCK_BIT, &dd->dd_flag)) +- if (mtip_standby_immediate(dd->port)) ++ !test_bit(MTIP_DDF_REBUILD_FAILED_BIT, &dd->dd_flag) && ++ !test_bit(MTIP_DDF_SEC_LOCK_BIT, &dd->dd_flag)) { ++ rv = mtip_standby_immediate(dd->port); ++ if (rv) + dev_warn(&dd->pdev->dev, + "STANDBY IMMEDIATE failed\n"); ++ } ++ return rv; + } + + /* +@@ -3341,8 +3346,7 @@ static int mtip_hw_shutdown(struct driver_data *dd) + * Send standby immediate (E0h) to the drive so that it + * saves its state. + */ +- if (!dd->sr && dd->port) +- mtip_standby_immediate(dd->port); ++ mtip_standby_drive(dd); + + return 0; + } +@@ -3365,7 +3369,7 @@ static int mtip_hw_suspend(struct driver_data *dd) + * Send standby immediate (E0h) to the drive + * so that it saves its state. + */ +- if (mtip_standby_immediate(dd->port) != 0) { ++ if (mtip_standby_drive(dd) != 0) { + dev_err(&dd->pdev->dev, + "Failed standby-immediate command\n"); + return -EFAULT; +-- +2.7.1 + + +From 2055f3846909a24be94025bfdbcfe1d0b79e7af0 Mon Sep 17 00:00:00 2001 +From: Asai Thambi SP +Date: Wed, 24 Feb 2016 21:16:00 -0800 +Subject: [PATCH 114/384] mtip32xx: Fix broken service thread handling + +commit cfc05bd31384c4898bf2437a4de5557f3cf9803a upstream. + +Service thread does not detect the need for taskfile error hanlding. Fixed the +flag condition to process taskfile error. + +Signed-off-by: Selvan Mani +Signed-off-by: Asai Thambi S P +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/block/mtip32xx/mtip32xx.c | 6 +++--- + drivers/block/mtip32xx/mtip32xx.h | 5 +++++ + 2 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c +index deb0c76..de4d965 100644 +--- a/drivers/block/mtip32xx/mtip32xx.c ++++ b/drivers/block/mtip32xx/mtip32xx.c +@@ -2924,9 +2924,7 @@ static int mtip_service_thread(void *data) + * is in progress nor error handling is active + */ + wait_event_interruptible(port->svc_wait, (port->flags) && +- !(port->flags & MTIP_PF_PAUSE_IO)); +- +- set_bit(MTIP_PF_SVC_THD_ACTIVE_BIT, &port->flags); ++ (port->flags & MTIP_PF_SVC_THD_WORK)); + + if (kthread_should_stop() || + test_bit(MTIP_PF_SVC_THD_STOP_BIT, &port->flags)) +@@ -2936,6 +2934,8 @@ static int mtip_service_thread(void *data) + &dd->dd_flag))) + goto st_out; + ++ set_bit(MTIP_PF_SVC_THD_ACTIVE_BIT, &port->flags); ++ + restart_eh: + /* Demux bits: start with error handling */ + if (test_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags)) { +diff --git a/drivers/block/mtip32xx/mtip32xx.h b/drivers/block/mtip32xx/mtip32xx.h +index 3274784..8635239 100644 +--- a/drivers/block/mtip32xx/mtip32xx.h ++++ b/drivers/block/mtip32xx/mtip32xx.h +@@ -144,6 +144,11 @@ enum { + MTIP_PF_REBUILD_BIT = 6, + MTIP_PF_SVC_THD_STOP_BIT = 8, + ++ MTIP_PF_SVC_THD_WORK = ((1 << MTIP_PF_EH_ACTIVE_BIT) | ++ (1 << MTIP_PF_ISSUE_CMDS_BIT) | ++ (1 << MTIP_PF_REBUILD_BIT) | ++ (1 << MTIP_PF_SVC_THD_STOP_BIT)), ++ + /* below are bit numbers in 'dd_flag' defined in driver_data */ + MTIP_DDF_SEC_LOCK_BIT = 0, + MTIP_DDF_REMOVE_PENDING_BIT = 1, +-- +2.7.1 + + +From 353a1b9a1d38ab4aa270c5d0a269def5fb3da985 Mon Sep 17 00:00:00 2001 +From: Asai Thambi SP +Date: Wed, 24 Feb 2016 21:16:21 -0800 +Subject: [PATCH 115/384] mtip32xx: Remove unwanted code from taskfile error + handler + +commit e35b94738a2f7caa12017f69ef385cb6b8028965 upstream. + +Remove setting and clearing MTIP_PF_EH_ACTIVE_BIT flag in +mtip_handle_tfe() as they are redundant. Also avoid waking +up service thread from mtip_handle_tfe() because it is +already woken up in case of taskfile error. + +Signed-off-by: Selvan Mani +Signed-off-by: Rajesh Kumar Sambandam +Signed-off-by: Asai Thambi S P +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/block/mtip32xx/mtip32xx.c | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c +index de4d965..a9cc83d 100644 +--- a/drivers/block/mtip32xx/mtip32xx.c ++++ b/drivers/block/mtip32xx/mtip32xx.c +@@ -618,8 +618,6 @@ static void mtip_handle_tfe(struct driver_data *dd) + + port = dd->port; + +- set_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags); +- + if (test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags)) { + cmd = mtip_cmd_from_tag(dd, MTIP_TAG_INTERNAL); + dbg_printk(MTIP_DRV_NAME " TFE for the internal command\n"); +@@ -628,7 +626,7 @@ static void mtip_handle_tfe(struct driver_data *dd) + cmd->comp_func(port, MTIP_TAG_INTERNAL, + cmd, PORT_IRQ_TF_ERR); + } +- goto handle_tfe_exit; ++ return; + } + + /* clear the tag accumulator */ +@@ -771,11 +769,6 @@ static void mtip_handle_tfe(struct driver_data *dd) + } + } + print_tags(dd, "reissued (TFE)", tagaccum, cmd_cnt); +- +-handle_tfe_exit: +- /* clear eh_active */ +- clear_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags); +- wake_up_interruptible(&port->svc_wait); + } + + /* +-- +2.7.1 + + +From 46579614c268c0636541379771c24b214d53c83b Mon Sep 17 00:00:00 2001 +From: Asai Thambi SP +Date: Wed, 24 Feb 2016 21:16:38 -0800 +Subject: [PATCH 116/384] mtip32xx: Print exact time when an internal command + is interrupted + +commit 5b7e0a8ac85e2dfd83830dc9e0b3554d153a37e3 upstream. + +Print exact time when an internal command is interrupted. + +Signed-off-by: Selvan Mani +Signed-off-by: Rajesh Kumar Sambandam +Signed-off-by: Asai Thambi S P +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/block/mtip32xx/mtip32xx.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c +index a9cc83d..27feff9 100644 +--- a/drivers/block/mtip32xx/mtip32xx.c ++++ b/drivers/block/mtip32xx/mtip32xx.c +@@ -1092,6 +1092,7 @@ static int mtip_exec_internal_command(struct mtip_port *port, + struct mtip_cmd *int_cmd; + struct driver_data *dd = port->dd; + int rv = 0; ++ unsigned long start; + + /* Make sure the buffer is 8 byte aligned. This is asic specific. */ + if (buffer & 0x00000007) { +@@ -1155,6 +1156,8 @@ static int mtip_exec_internal_command(struct mtip_port *port, + /* Populate the command header */ + int_cmd->command_header->byte_count = 0; + ++ start = jiffies; ++ + /* Issue the command to the hardware */ + mtip_issue_non_ncq_command(port, MTIP_TAG_INTERNAL); + +@@ -1165,8 +1168,9 @@ static int mtip_exec_internal_command(struct mtip_port *port, + msecs_to_jiffies(timeout))) <= 0) { + if (rv == -ERESTARTSYS) { /* interrupted */ + dev_err(&dd->pdev->dev, +- "Internal command [%02X] was interrupted after %lu ms\n", +- fis->command, timeout); ++ "Internal command [%02X] was interrupted after %u ms\n", ++ fis->command, ++ jiffies_to_msecs(jiffies - start)); + rv = -EINTR; + goto exec_ic_exit; + } else if (rv == 0) /* timeout */ +-- +2.7.1 + + +From 7460d5a864a9fc6a7d31a918b777f8b8894a0c59 Mon Sep 17 00:00:00 2001 +From: Asai Thambi SP +Date: Wed, 24 Feb 2016 21:17:47 -0800 +Subject: [PATCH 117/384] mtip32xx: Fix for rmmod crash when drive is in FTL + rebuild + +commit 59cf70e236c96594d9f1e065755d8fce9df5356b upstream. + +When FTL rebuild is in progress, alloc_disk() initializes the disk +but device node will be created by add_disk() only after successful +completion of FTL rebuild. So, skip deletion of device node in +removal path when FTL rebuild is in progress. + +Signed-off-by: Selvan Mani +Signed-off-by: Asai Thambi S P +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/block/mtip32xx/mtip32xx.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c +index 27feff9..47d96bd 100644 +--- a/drivers/block/mtip32xx/mtip32xx.c ++++ b/drivers/block/mtip32xx/mtip32xx.c +@@ -2975,10 +2975,8 @@ restart_eh: + } + + if (test_bit(MTIP_PF_REBUILD_BIT, &port->flags)) { +- if (mtip_ftl_rebuild_poll(dd) < 0) +- set_bit(MTIP_DDF_REBUILD_FAILED_BIT, +- &dd->dd_flag); +- clear_bit(MTIP_PF_REBUILD_BIT, &port->flags); ++ if (mtip_ftl_rebuild_poll(dd) == 0) ++ clear_bit(MTIP_PF_REBUILD_BIT, &port->flags); + } + } + +@@ -3858,7 +3856,6 @@ static int mtip_block_initialize(struct driver_data *dd) + + mtip_hw_debugfs_init(dd); + +-skip_create_disk: + memset(&dd->tags, 0, sizeof(dd->tags)); + dd->tags.ops = &mtip_mq_ops; + dd->tags.nr_hw_queues = 1; +@@ -3888,6 +3885,7 @@ skip_create_disk: + dd->disk->queue = dd->queue; + dd->queue->queuedata = dd; + ++skip_create_disk: + /* Initialize the protocol layer. */ + wait_for_rebuild = mtip_hw_get_identify(dd); + if (wait_for_rebuild < 0) { +@@ -4048,7 +4046,8 @@ static int mtip_block_remove(struct driver_data *dd) + dd->bdev = NULL; + } + if (dd->disk) { +- del_gendisk(dd->disk); ++ if (test_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag)) ++ del_gendisk(dd->disk); + if (dd->disk->queue) { + blk_cleanup_queue(dd->queue); + blk_mq_free_tag_set(&dd->tags); +@@ -4089,7 +4088,8 @@ static int mtip_block_shutdown(struct driver_data *dd) + dev_info(&dd->pdev->dev, + "Shutting down %s ...\n", dd->disk->disk_name); + +- del_gendisk(dd->disk); ++ if (test_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag)) ++ del_gendisk(dd->disk); + if (dd->disk->queue) { + blk_cleanup_queue(dd->queue); + blk_mq_free_tag_set(&dd->tags); +-- +2.7.1 + + +From a7e75c6ddfb0444b865f1418a94c3e98e4435629 Mon Sep 17 00:00:00 2001 +From: Asai Thambi SP +Date: Wed, 24 Feb 2016 21:18:10 -0800 +Subject: [PATCH 118/384] mtip32xx: Handle safe removal during IO + +commit 51c6570eb922146470c2fe660c34585414679bd6 upstream. + +Flush inflight IOs using fsync_bdev() when the device is safely +removed. Also, block further IOs in device open function. + +Signed-off-by: Selvan Mani +Signed-off-by: Rajesh Kumar Sambandam +Signed-off-by: Asai Thambi S P +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/block/mtip32xx/mtip32xx.c | 34 ++++++++++++++++++++++++++++++++-- + drivers/block/mtip32xx/mtip32xx.h | 1 + + 2 files changed, 33 insertions(+), 2 deletions(-) + +diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c +index 47d96bd..cda3efe 100644 +--- a/drivers/block/mtip32xx/mtip32xx.c ++++ b/drivers/block/mtip32xx/mtip32xx.c +@@ -3602,6 +3602,28 @@ static int mtip_block_getgeo(struct block_device *dev, + return 0; + } + ++static int mtip_block_open(struct block_device *dev, fmode_t mode) ++{ ++ struct driver_data *dd; ++ ++ if (dev && dev->bd_disk) { ++ dd = (struct driver_data *) dev->bd_disk->private_data; ++ ++ if (dd) { ++ if (test_bit(MTIP_DDF_REMOVAL_BIT, ++ &dd->dd_flag)) { ++ return -ENODEV; ++ } ++ return 0; ++ } ++ } ++ return -ENODEV; ++} ++ ++void mtip_block_release(struct gendisk *disk, fmode_t mode) ++{ ++} ++ + /* + * Block device operation function. + * +@@ -3609,6 +3631,8 @@ static int mtip_block_getgeo(struct block_device *dev, + * layer. + */ + static const struct block_device_operations mtip_block_ops = { ++ .open = mtip_block_open, ++ .release = mtip_block_release, + .ioctl = mtip_block_ioctl, + #ifdef CONFIG_COMPAT + .compat_ioctl = mtip_block_compat_ioctl, +@@ -4434,7 +4458,7 @@ static void mtip_pci_remove(struct pci_dev *pdev) + struct driver_data *dd = pci_get_drvdata(pdev); + unsigned long flags, to; + +- set_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag); ++ set_bit(MTIP_DDF_REMOVAL_BIT, &dd->dd_flag); + + spin_lock_irqsave(&dev_lock, flags); + list_del_init(&dd->online_list); +@@ -4451,12 +4475,18 @@ static void mtip_pci_remove(struct pci_dev *pdev) + } while (atomic_read(&dd->irq_workers_active) != 0 && + time_before(jiffies, to)); + ++ fsync_bdev(dd->bdev); ++ + if (atomic_read(&dd->irq_workers_active) != 0) { + dev_warn(&dd->pdev->dev, + "Completion workers still active!\n"); + } + +- blk_mq_stop_hw_queues(dd->queue); ++ if (dd->sr) ++ blk_mq_stop_hw_queues(dd->queue); ++ ++ set_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag); ++ + /* Clean up the block layer. */ + mtip_block_remove(dd); + +diff --git a/drivers/block/mtip32xx/mtip32xx.h b/drivers/block/mtip32xx/mtip32xx.h +index 8635239..50af742 100644 +--- a/drivers/block/mtip32xx/mtip32xx.h ++++ b/drivers/block/mtip32xx/mtip32xx.h +@@ -158,6 +158,7 @@ enum { + MTIP_DDF_RESUME_BIT = 6, + MTIP_DDF_INIT_DONE_BIT = 7, + MTIP_DDF_REBUILD_FAILED_BIT = 8, ++ MTIP_DDF_REMOVAL_BIT = 9, + + MTIP_DDF_STOP_IO = ((1 << MTIP_DDF_REMOVE_PENDING_BIT) | + (1 << MTIP_DDF_SEC_LOCK_BIT) | +-- +2.7.1 + + +From eff89f34ee5c83a8557c7bf4399e8938960f6e17 Mon Sep 17 00:00:00 2001 +From: Asai Thambi SP +Date: Wed, 24 Feb 2016 21:18:20 -0800 +Subject: [PATCH 119/384] mtip32xx: Handle FTL rebuild failure state during + device initialization + +commit aae4a033868c496adae86fc6f9c3e0c405bbf360 upstream. + +Allow device initialization to finish gracefully when it is in +FTL rebuild failure state. Also, recover device out of this state +after successfully secure erasing it. + +Signed-off-by: Selvan Mani +Signed-off-by: Vignesh Gunasekaran +Signed-off-by: Asai Thambi S P +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/block/mtip32xx/mtip32xx.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c +index cda3efe..6bec939 100644 +--- a/drivers/block/mtip32xx/mtip32xx.c ++++ b/drivers/block/mtip32xx/mtip32xx.c +@@ -699,7 +699,7 @@ static void mtip_handle_tfe(struct driver_data *dd) + fail_reason = "thermal shutdown"; + } + if (buf[288] == 0xBF) { +- set_bit(MTIP_DDF_SEC_LOCK_BIT, &dd->dd_flag); ++ set_bit(MTIP_DDF_REBUILD_FAILED_BIT, &dd->dd_flag); + dev_info(&dd->pdev->dev, + "Drive indicates rebuild has failed. Secure erase required.\n"); + fail_all_ncq_cmds = 1; +@@ -1000,6 +1000,7 @@ static bool mtip_pause_ncq(struct mtip_port *port, + (fis->features == 0x27 || fis->features == 0x72 || + fis->features == 0x62 || fis->features == 0x26))) { + clear_bit(MTIP_DDF_SEC_LOCK_BIT, &port->dd->dd_flag); ++ clear_bit(MTIP_DDF_REBUILD_FAILED_BIT, &port->dd->dd_flag); + /* Com reset after secure erase or lowlevel format */ + mtip_restart_port(port); + clear_bit(MTIP_PF_SE_ACTIVE_BIT, &port->flags); +@@ -1166,6 +1167,7 @@ static int mtip_exec_internal_command(struct mtip_port *port, + if ((rv = wait_for_completion_interruptible_timeout( + &wait, + msecs_to_jiffies(timeout))) <= 0) { ++ + if (rv == -ERESTARTSYS) { /* interrupted */ + dev_err(&dd->pdev->dev, + "Internal command [%02X] was interrupted after %u ms\n", +@@ -3091,7 +3093,7 @@ static int mtip_hw_get_identify(struct driver_data *dd) + if (buf[288] == 0xBF) { + dev_info(&dd->pdev->dev, + "Drive indicates rebuild has failed.\n"); +- /* TODO */ ++ set_bit(MTIP_DDF_REBUILD_FAILED_BIT, &dd->dd_flag); + } + } + +@@ -3694,10 +3696,9 @@ static int mtip_submit_request(struct blk_mq_hw_ctx *hctx, struct request *rq) + rq_data_dir(rq))) { + return -ENODATA; + } +- if (unlikely(test_bit(MTIP_DDF_SEC_LOCK_BIT, &dd->dd_flag))) ++ if (unlikely(test_bit(MTIP_DDF_SEC_LOCK_BIT, &dd->dd_flag) || ++ test_bit(MTIP_DDF_REBUILD_FAILED_BIT, &dd->dd_flag))) + return -ENODATA; +- if (test_bit(MTIP_DDF_REBUILD_FAILED_BIT, &dd->dd_flag)) +- return -ENXIO; + } + + if (rq->cmd_flags & REQ_DISCARD) { +-- +2.7.1 + + +From 9b80b38c91657d262950c83bc4603b3ecd8fc183 Mon Sep 17 00:00:00 2001 +From: Asai Thambi SP +Date: Wed, 24 Feb 2016 21:21:13 -0800 +Subject: [PATCH 120/384] mtip32xx: Implement timeout handler + +commit abb0ccd185c9e31847709b86192e6c815d1f57ad upstream. + +Added timeout handler. Replaced blk_mq_end_request() with +blk_mq_complete_request() to avoid double completion of a request. + +Signed-off-by: Selvan Mani +Signed-off-by: Rajesh Kumar Sambandam +Signed-off-by: Asai Thambi S P +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/block/mtip32xx/mtip32xx.c | 95 +++++++++++++++++++++++++++++++++++---- + drivers/block/mtip32xx/mtip32xx.h | 7 ++- + 2 files changed, 92 insertions(+), 10 deletions(-) + +diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c +index 6bec939..2a9001e 100644 +--- a/drivers/block/mtip32xx/mtip32xx.c ++++ b/drivers/block/mtip32xx/mtip32xx.c +@@ -233,15 +233,9 @@ static void mtip_async_complete(struct mtip_port *port, + "Command tag %d failed due to TFE\n", tag); + } + +- /* Unmap the DMA scatter list entries */ +- dma_unmap_sg(&dd->pdev->dev, cmd->sg, cmd->scatter_ents, cmd->direction); +- + rq = mtip_rq_from_tag(dd, tag); + +- if (unlikely(cmd->unaligned)) +- up(&port->cmd_slot_unal); +- +- blk_mq_end_request(rq, status ? -EIO : 0); ++ blk_mq_complete_request(rq, status); + } + + /* +@@ -2896,6 +2890,42 @@ static int mtip_ftl_rebuild_poll(struct driver_data *dd) + return -EFAULT; + } + ++static void mtip_softirq_done_fn(struct request *rq) ++{ ++ struct mtip_cmd *cmd = blk_mq_rq_to_pdu(rq); ++ struct driver_data *dd = rq->q->queuedata; ++ ++ /* Unmap the DMA scatter list entries */ ++ dma_unmap_sg(&dd->pdev->dev, cmd->sg, cmd->scatter_ents, ++ cmd->direction); ++ ++ if (unlikely(cmd->unaligned)) ++ up(&dd->port->cmd_slot_unal); ++ ++ blk_mq_end_request(rq, rq->errors); ++} ++ ++static void mtip_abort_cmd(struct request *req, void *data, ++ bool reserved) ++{ ++ struct driver_data *dd = data; ++ ++ dbg_printk(MTIP_DRV_NAME " Aborting request, tag = %d\n", req->tag); ++ ++ clear_bit(req->tag, dd->port->cmds_to_issue); ++ req->errors = -EIO; ++ mtip_softirq_done_fn(req); ++} ++ ++static void mtip_queue_cmd(struct request *req, void *data, ++ bool reserved) ++{ ++ struct driver_data *dd = data; ++ ++ set_bit(req->tag, dd->port->cmds_to_issue); ++ blk_abort_request(req); ++} ++ + /* + * service thread to issue queued commands + * +@@ -2908,7 +2938,7 @@ static int mtip_ftl_rebuild_poll(struct driver_data *dd) + static int mtip_service_thread(void *data) + { + struct driver_data *dd = (struct driver_data *)data; +- unsigned long slot, slot_start, slot_wrap; ++ unsigned long slot, slot_start, slot_wrap, to; + unsigned int num_cmd_slots = dd->slot_groups * 32; + struct mtip_port *port = dd->port; + +@@ -2945,6 +2975,32 @@ restart_eh: + if (test_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags)) + goto restart_eh; + ++ if (test_bit(MTIP_PF_TO_ACTIVE_BIT, &port->flags)) { ++ to = jiffies + msecs_to_jiffies(5000); ++ ++ do { ++ mdelay(100); ++ } while (atomic_read(&dd->irq_workers_active) != 0 && ++ time_before(jiffies, to)); ++ ++ if (atomic_read(&dd->irq_workers_active) != 0) ++ dev_warn(&dd->pdev->dev, ++ "Completion workers still active!"); ++ ++ spin_lock(dd->queue->queue_lock); ++ blk_mq_all_tag_busy_iter(*dd->tags.tags, ++ mtip_queue_cmd, dd); ++ spin_unlock(dd->queue->queue_lock); ++ ++ set_bit(MTIP_PF_ISSUE_CMDS_BIT, &dd->port->flags); ++ ++ if (mtip_device_reset(dd)) ++ blk_mq_all_tag_busy_iter(*dd->tags.tags, ++ mtip_abort_cmd, dd); ++ ++ clear_bit(MTIP_PF_TO_ACTIVE_BIT, &dd->port->flags); ++ } ++ + if (test_bit(MTIP_PF_ISSUE_CMDS_BIT, &port->flags)) { + slot = 1; + /* used to restrict the loop to one iteration */ +@@ -3810,11 +3866,33 @@ static int mtip_init_cmd(void *data, struct request *rq, unsigned int hctx_idx, + return 0; + } + ++static enum blk_eh_timer_return mtip_cmd_timeout(struct request *req, ++ bool reserved) ++{ ++ struct driver_data *dd = req->q->queuedata; ++ int ret = BLK_EH_RESET_TIMER; ++ ++ if (reserved) ++ goto exit_handler; ++ ++ if (test_bit(req->tag, dd->port->cmds_to_issue)) ++ goto exit_handler; ++ ++ if (test_and_set_bit(MTIP_PF_TO_ACTIVE_BIT, &dd->port->flags)) ++ goto exit_handler; ++ ++ wake_up_interruptible(&dd->port->svc_wait); ++exit_handler: ++ return ret; ++} ++ + static struct blk_mq_ops mtip_mq_ops = { + .queue_rq = mtip_queue_rq, + .map_queue = blk_mq_map_queue, + .init_request = mtip_init_cmd, + .exit_request = mtip_free_cmd, ++ .complete = mtip_softirq_done_fn, ++ .timeout = mtip_cmd_timeout, + }; + + /* +@@ -3890,6 +3968,7 @@ static int mtip_block_initialize(struct driver_data *dd) + dd->tags.numa_node = dd->numa_node; + dd->tags.flags = BLK_MQ_F_SHOULD_MERGE; + dd->tags.driver_data = dd; ++ dd->tags.timeout = MTIP_NCQ_CMD_TIMEOUT_MS; + + rv = blk_mq_alloc_tag_set(&dd->tags); + if (rv) { +diff --git a/drivers/block/mtip32xx/mtip32xx.h b/drivers/block/mtip32xx/mtip32xx.h +index 50af742..7617888 100644 +--- a/drivers/block/mtip32xx/mtip32xx.h ++++ b/drivers/block/mtip32xx/mtip32xx.h +@@ -134,10 +134,12 @@ enum { + MTIP_PF_EH_ACTIVE_BIT = 1, /* error handling */ + MTIP_PF_SE_ACTIVE_BIT = 2, /* secure erase */ + MTIP_PF_DM_ACTIVE_BIT = 3, /* download microcde */ ++ MTIP_PF_TO_ACTIVE_BIT = 9, /* timeout handling */ + MTIP_PF_PAUSE_IO = ((1 << MTIP_PF_IC_ACTIVE_BIT) | + (1 << MTIP_PF_EH_ACTIVE_BIT) | + (1 << MTIP_PF_SE_ACTIVE_BIT) | +- (1 << MTIP_PF_DM_ACTIVE_BIT)), ++ (1 << MTIP_PF_DM_ACTIVE_BIT) | ++ (1 << MTIP_PF_TO_ACTIVE_BIT)), + + MTIP_PF_SVC_THD_ACTIVE_BIT = 4, + MTIP_PF_ISSUE_CMDS_BIT = 5, +@@ -147,7 +149,8 @@ enum { + MTIP_PF_SVC_THD_WORK = ((1 << MTIP_PF_EH_ACTIVE_BIT) | + (1 << MTIP_PF_ISSUE_CMDS_BIT) | + (1 << MTIP_PF_REBUILD_BIT) | +- (1 << MTIP_PF_SVC_THD_STOP_BIT)), ++ (1 << MTIP_PF_SVC_THD_STOP_BIT) | ++ (1 << MTIP_PF_TO_ACTIVE_BIT)), + + /* below are bit numbers in 'dd_flag' defined in driver_data */ + MTIP_DDF_SEC_LOCK_BIT = 0, +-- +2.7.1 + + +From 207c7c309d54985bf248bc8897777479ece61f9c Mon Sep 17 00:00:00 2001 +From: Asai Thambi SP +Date: Wed, 24 Feb 2016 21:21:20 -0800 +Subject: [PATCH 121/384] mtip32xx: Cleanup queued requests after surprise + removal + +commit 008e56d200225321371748d95908e6222436f06d upstream. + +Fail all pending requests after surprise removal of a drive. + +Signed-off-by: Vignesh Gunasekaran +Signed-off-by: Selvan Mani +Signed-off-by: Asai Thambi S P +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/block/mtip32xx/mtip32xx.c | 78 ++++++++++++++++++++++++++++++--------- + 1 file changed, 60 insertions(+), 18 deletions(-) + +diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c +index 2a9001e..55d3d1d 100644 +--- a/drivers/block/mtip32xx/mtip32xx.c ++++ b/drivers/block/mtip32xx/mtip32xx.c +@@ -173,7 +173,13 @@ static struct mtip_cmd *mtip_get_int_command(struct driver_data *dd) + { + struct request *rq; + ++ if (mtip_check_surprise_removal(dd->pdev)) ++ return NULL; ++ + rq = blk_mq_alloc_request(dd->queue, 0, __GFP_RECLAIM, true); ++ if (IS_ERR(rq)) ++ return NULL; ++ + return blk_mq_rq_to_pdu(rq); + } + +@@ -575,6 +581,8 @@ static void mtip_completion(struct mtip_port *port, + dev_warn(&port->dd->pdev->dev, + "Internal command %d completed with TFE\n", tag); + ++ command->comp_func = NULL; ++ command->comp_data = NULL; + complete(waiting); + } + +@@ -1009,12 +1017,14 @@ static bool mtip_pause_ncq(struct mtip_port *port, + * + * @port Pointer to port data structure + * @timeout Max duration to wait (ms) ++ * @atomic gfp_t flag to indicate blockable context or not + * + * return value + * 0 Success + * -EBUSY Commands still active + */ +-static int mtip_quiesce_io(struct mtip_port *port, unsigned long timeout) ++static int mtip_quiesce_io(struct mtip_port *port, unsigned long timeout, ++ gfp_t atomic) + { + unsigned long to; + unsigned int n; +@@ -1025,16 +1035,21 @@ static int mtip_quiesce_io(struct mtip_port *port, unsigned long timeout) + to = jiffies + msecs_to_jiffies(timeout); + do { + if (test_bit(MTIP_PF_SVC_THD_ACTIVE_BIT, &port->flags) && +- test_bit(MTIP_PF_ISSUE_CMDS_BIT, &port->flags)) { ++ test_bit(MTIP_PF_ISSUE_CMDS_BIT, &port->flags) && ++ atomic == GFP_KERNEL) { + msleep(20); + continue; /* svc thd is actively issuing commands */ + } + +- msleep(100); ++ if (atomic == GFP_KERNEL) ++ msleep(100); ++ else { ++ cpu_relax(); ++ udelay(100); ++ } ++ + if (mtip_check_surprise_removal(port->dd->pdev)) + goto err_fault; +- if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &port->dd->dd_flag)) +- goto err_fault; + + /* + * Ignore s_active bit 0 of array element 0. +@@ -1096,6 +1111,10 @@ static int mtip_exec_internal_command(struct mtip_port *port, + } + + int_cmd = mtip_get_int_command(dd); ++ if (!int_cmd) { ++ dbg_printk(MTIP_DRV_NAME "Unable to allocate tag for PIO cmd\n"); ++ return -EFAULT; ++ } + + set_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags); + +@@ -1108,7 +1127,7 @@ static int mtip_exec_internal_command(struct mtip_port *port, + if (fis->command != ATA_CMD_STANDBYNOW1) { + /* wait for io to complete if non atomic */ + if (mtip_quiesce_io(port, +- MTIP_QUIESCE_IO_TIMEOUT_MS) < 0) { ++ MTIP_QUIESCE_IO_TIMEOUT_MS, atomic) < 0) { + dev_warn(&dd->pdev->dev, + "Failed to quiesce IO\n"); + mtip_put_int_command(dd, int_cmd); +@@ -3354,10 +3373,6 @@ static int mtip_standby_drive(struct driver_data *dd) + */ + static int mtip_hw_exit(struct driver_data *dd) + { +- /* +- * Send standby immediate (E0h) to the drive so that it +- * saves its state. +- */ + if (!dd->sr) { + /* de-initialize the port. */ + mtip_deinit_port(dd->port); +@@ -3974,7 +3989,7 @@ static int mtip_block_initialize(struct driver_data *dd) + if (rv) { + dev_err(&dd->pdev->dev, + "Unable to allocate request queue\n"); +- goto block_queue_alloc_init_error; ++ goto block_queue_alloc_tag_error; + } + + /* Allocate the request queue. */ +@@ -4086,8 +4101,9 @@ kthread_run_error: + read_capacity_error: + init_hw_cmds_error: + blk_cleanup_queue(dd->queue); +- blk_mq_free_tag_set(&dd->tags); + block_queue_alloc_init_error: ++ blk_mq_free_tag_set(&dd->tags); ++block_queue_alloc_tag_error: + mtip_hw_debugfs_exit(dd); + disk_index_error: + spin_lock(&rssd_index_lock); +@@ -4104,6 +4120,22 @@ protocol_init_error: + return rv; + } + ++static void mtip_no_dev_cleanup(struct request *rq, void *data, bool reserv) ++{ ++ struct driver_data *dd = (struct driver_data *)data; ++ struct mtip_cmd *cmd; ++ ++ if (likely(!reserv)) ++ blk_mq_complete_request(rq, -ENODEV); ++ else if (test_bit(MTIP_PF_IC_ACTIVE_BIT, &dd->port->flags)) { ++ ++ cmd = mtip_cmd_from_tag(dd, MTIP_TAG_INTERNAL); ++ if (cmd->comp_func) ++ cmd->comp_func(dd->port, MTIP_TAG_INTERNAL, ++ cmd, -ENODEV); ++ } ++} ++ + /* + * Block layer deinitialization function. + * +@@ -4135,12 +4167,23 @@ static int mtip_block_remove(struct driver_data *dd) + } + } + +- if (!dd->sr) +- mtip_standby_drive(dd); ++ if (!dd->sr) { ++ /* ++ * Explicitly wait here for IOs to quiesce, ++ * as mtip_standby_drive usually won't wait for IOs. ++ */ ++ if (!mtip_quiesce_io(dd->port, MTIP_QUIESCE_IO_TIMEOUT_MS, ++ GFP_KERNEL)) ++ mtip_standby_drive(dd); ++ } + else + dev_info(&dd->pdev->dev, "device %s surprise removal\n", + dd->disk->disk_name); + ++ blk_mq_freeze_queue_start(dd->queue); ++ blk_mq_stop_hw_queues(dd->queue); ++ blk_mq_all_tag_busy_iter(dd->tags.tags[0], mtip_no_dev_cleanup, dd); ++ + /* + * Delete our gendisk structure. This also removes the device + * from /dev +@@ -4555,16 +4598,15 @@ static void mtip_pci_remove(struct pci_dev *pdev) + } while (atomic_read(&dd->irq_workers_active) != 0 && + time_before(jiffies, to)); + +- fsync_bdev(dd->bdev); ++ if (!dd->sr) ++ fsync_bdev(dd->bdev); + + if (atomic_read(&dd->irq_workers_active) != 0) { + dev_warn(&dd->pdev->dev, + "Completion workers still active!\n"); + } + +- if (dd->sr) +- blk_mq_stop_hw_queues(dd->queue); +- ++ blk_set_queue_dying(dd->queue); + set_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag); + + /* Clean up the block layer. */ +-- +2.7.1 + + +From 4d3e9839bfaeb71b1346cc7477eb7e0a48041a12 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 10 Mar 2016 11:33:43 +0100 +Subject: [PATCH 122/384] ALSA: hda - Apply reboot D3 fix for CX20724 codec, + too + +commit 56dc66ff1c6d71f9a38c4a7c000b72b921fe4c89 upstream. + +Just like CX20722, CX7024 codec also requires the power down at reboot +in order to reduce the noise at reboot/shutdown. + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=113511 +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_conexant.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c +index ef19890..600af58 100644 +--- a/sound/pci/hda/patch_conexant.c ++++ b/sound/pci/hda/patch_conexant.c +@@ -204,8 +204,13 @@ static void cx_auto_reboot_notify(struct hda_codec *codec) + { + struct conexant_spec *spec = codec->spec; + +- if (codec->core.vendor_id != 0x14f150f2) ++ switch (codec->core.vendor_id) { ++ case 0x14f150f2: /* CX20722 */ ++ case 0x14f150f4: /* CX20724 */ ++ break; ++ default: + return; ++ } + + /* Turn the CX20722 codec into D3 to avoid spurious noises + from the internal speaker during (and after) reboot */ +-- +2.7.1 + + +From d5b447c897bd9689b0a0ad3b656516bcb233fda9 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 10 Mar 2016 20:56:20 +0100 +Subject: [PATCH 123/384] ALSA: pcm: Avoid "BUG:" string for warnings again + +commit 0ab1ace856205d10cbc1924b2d931c01ffd216a6 upstream. + +The commit [d507941beb1e: ALSA: pcm: Correct PCM BUG error message] +made the warning prefix back to "BUG:" due to its previous wrong +prefix. But a kernel message containing "BUG:" seems taken as an Oops +message wrongly by some brain-dead daemons, and it annoys users in the +end. Instead of teaching daemons, change the string again to a more +reasonable one. + +Fixes: 507941beb1e ('ALSA: pcm: Correct PCM BUG error message') +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/core/pcm_lib.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c +index 6b5a811..3a9b66c 100644 +--- a/sound/core/pcm_lib.c ++++ b/sound/core/pcm_lib.c +@@ -322,7 +322,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, + char name[16]; + snd_pcm_debug_name(substream, name, sizeof(name)); + pcm_err(substream->pcm, +- "BUG: %s, pos = %ld, buffer size = %ld, period size = %ld\n", ++ "invalid position: %s, pos = %ld, buffer size = %ld, period size = %ld\n", + name, pos, runtime->buffer_size, + runtime->period_size); + } +-- +2.7.1 + + +From 0f06fc3a924f8af4e31c46076eaa207233a3a4c0 Mon Sep 17 00:00:00 2001 +From: "Vittorio Gambaletta (VittGam)" +Date: Sun, 13 Mar 2016 22:19:34 +0100 +Subject: [PATCH 124/384] ALSA: intel8x0: Add clock quirk entry for AD1981B on + IBM ThinkPad X41. + +commit 4061db03dd71d195b9973ee466f6ed32f6a3fc16 upstream. + +The clock measurement on the AC'97 audio card found in the IBM ThinkPad X41 +will often fail, so add a quirk entry to fix it. + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=441087 +Signed-off-by: Vittorio Gambaletta +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/intel8x0.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c +index 42bcbac..ccdab29 100644 +--- a/sound/pci/intel8x0.c ++++ b/sound/pci/intel8x0.c +@@ -2879,6 +2879,7 @@ static void intel8x0_measure_ac97_clock(struct intel8x0 *chip) + + static struct snd_pci_quirk intel8x0_clock_list[] = { + SND_PCI_QUIRK(0x0e11, 0x008a, "AD1885", 41000), ++ SND_PCI_QUIRK(0x1014, 0x0581, "AD1981B", 48000), + SND_PCI_QUIRK(0x1028, 0x00be, "AD1885", 44100), + SND_PCI_QUIRK(0x1028, 0x0177, "AD1980", 48000), + SND_PCI_QUIRK(0x1028, 0x01ad, "AD1981B", 48000), +-- +2.7.1 + + +From 3fc065857396b5d9b46971be9d32f91916ca1246 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 10 Mar 2016 12:02:49 +0100 +Subject: [PATCH 125/384] ALSA: hda - Don't handle ELD notify from invalid port + +commit 4f8e4f3537cafc4de128e6bfdf83baa78bc60eb1 upstream. + +The current Intel HDMI codec driver supports only three fixed ports +from port B to port D. However, i915 driver may assign a DP on other +ports, e.g. port A, when no eDP is used. This incompatibility is +caught later at pin_nid_to_pin_index() and results in a warning +message like "HDMI: pin nid 4 not registered" at each time. + +This patch filters out such invalid events beforehand, so that the +kernel won't be too grumbling. + +Reported-by: Stefan Assmann +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_hdmi.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c +index 70c9456..f7bcd8d 100644 +--- a/sound/pci/hda/patch_hdmi.c ++++ b/sound/pci/hda/patch_hdmi.c +@@ -2353,6 +2353,10 @@ static void intel_pin_eld_notify(void *audio_ptr, int port) + struct hda_codec *codec = audio_ptr; + int pin_nid = port + 0x04; + ++ /* we assume only from port-B to port-D */ ++ if (port < 1 || port > 3) ++ return; ++ + /* skip notification during system suspend (but not in runtime PM); + * the state will be updated at resume + */ +-- +2.7.1 + + +From 66381a51eba27f2a059ed88e28fecb7abe3dd1e4 Mon Sep 17 00:00:00 2001 +From: Hui Wang +Date: Fri, 11 Mar 2016 12:04:02 +0800 +Subject: [PATCH 126/384] ALSA: hda - fix the mic mute button and led problem + for a Lenovo AIO + +commit 6ef2f68fa38bf415830f67903d87180d933e0f47 upstream. + +This Lenovo ThinkCentre AIO also uses Line2 as mic mute button and +uses GPIO2 to control the mic mute led, so applying this quirk can +make both the button and led work. + +BugLink: https://bugs.launchpad.net/bugs/1555912 +Signed-off-by: Hui Wang +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index c2430b3..6968b79 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -5529,6 +5529,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { + SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), + SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), + SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), ++ SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), + SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), + SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), + SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP), +-- +2.7.1 + + +From 8063b766118208302c72cfe81b6fafa5c15d9b9b Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 15 Mar 2016 16:44:55 +0100 +Subject: [PATCH 127/384] ALSA: hda - Fix unconditional GPIO toggle via + automute + +commit 1f7c6658962fa1260c1658d681bd6bb0c746b99a upstream. + +Cirrus HD-audio driver may adjust GPIO pins for EAPD dynamically +depending on the jack plug state. This works fine for the auto-mute +mode where the speaker gets muted upon the HP jack plug. OTOH, when +the auto-mute mode is off, this turns off the EAPD unexpectedly +depending on the jack state, which results in the silent speaker +output. + +This patch fixes the silent speaker output issue by setting GPIO bits +constantly when the auto-mute mode is off. + +Reported-and-tested-by: moosotc@gmail.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_cirrus.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c +index c1c855a..a47e8ae 100644 +--- a/sound/pci/hda/patch_cirrus.c ++++ b/sound/pci/hda/patch_cirrus.c +@@ -174,8 +174,12 @@ static void cs_automute(struct hda_codec *codec) + snd_hda_gen_update_outputs(codec); + + if (spec->gpio_eapd_hp || spec->gpio_eapd_speaker) { +- spec->gpio_data = spec->gen.hp_jack_present ? +- spec->gpio_eapd_hp : spec->gpio_eapd_speaker; ++ if (spec->gen.automute_speaker) ++ spec->gpio_data = spec->gen.hp_jack_present ? ++ spec->gpio_eapd_hp : spec->gpio_eapd_speaker; ++ else ++ spec->gpio_data = ++ spec->gpio_eapd_hp | spec->gpio_eapd_speaker; + snd_hda_codec_write(codec, 0x01, 0, + AC_VERB_SET_GPIO_DATA, spec->gpio_data); + } +-- +2.7.1 + + +From e813a3556d595397c52bafbbd1bc2f5ff4e28d0c Mon Sep 17 00:00:00 2001 +From: Kamal Mostafa +Date: Wed, 27 Jan 2016 22:29:33 -0800 +Subject: [PATCH 128/384] tools/hv: Use include/uapi with __EXPORTED_HEADERS__ + +commit 50fe6dd10069e7c062e27f29606f6e91ea979399 upstream. + +Use the local uapi headers to keep in sync with "recently" added #define's +(e.g. VSS_OP_REGISTER1). + +Fixes: 3eb2094c59e8 ("Adding makefile for tools/hv") +Signed-off-by: Kamal Mostafa +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Greg Kroah-Hartman +--- + tools/hv/Makefile | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tools/hv/Makefile b/tools/hv/Makefile +index a8ab795..a8c4644 100644 +--- a/tools/hv/Makefile ++++ b/tools/hv/Makefile +@@ -5,6 +5,8 @@ PTHREAD_LIBS = -lpthread + WARNINGS = -Wall -Wextra + CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS) $(shell getconf LFS_CFLAGS) + ++CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include ++ + all: hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon + %: %.c + $(CC) $(CFLAGS) -o $@ $^ +-- +2.7.1 + + +From 24cf072202ffb94852b20142a9464557525d73d7 Mon Sep 17 00:00:00 2001 +From: OGAWA Hirofumi +Date: Wed, 9 Mar 2016 23:47:25 -0500 +Subject: [PATCH 129/384] jbd2: fix FS corruption possibility in + jbd2_journal_destroy() on umount path + +commit c0a2ad9b50dd80eeccd73d9ff962234590d5ec93 upstream. + +On umount path, jbd2_journal_destroy() writes latest transaction ID +(->j_tail_sequence) to be used at next mount. + +The bug is that ->j_tail_sequence is not holding latest transaction ID +in some cases. So, at next mount, there is chance to conflict with +remaining (not overwritten yet) transactions. + + mount (id=10) + write transaction (id=11) + write transaction (id=12) + umount (id=10) <= the bug doesn't write latest ID + + mount (id=10) + write transaction (id=11) + crash + + mount + [recovery process] + transaction (id=11) + transaction (id=12) <= valid transaction ID, but old commit + must not replay + +Like above, this bug become the cause of recovery failure, or FS +corruption. + +So why ->j_tail_sequence doesn't point latest ID? + +Because if checkpoint transactions was reclaimed by memory pressure +(i.e. bdev_try_to_free_page()), then ->j_tail_sequence is not updated. +(And another case is, __jbd2_journal_clean_checkpoint_list() is called +with empty transaction.) + +So in above cases, ->j_tail_sequence is not pointing latest +transaction ID at umount path. Plus, REQ_FLUSH for checkpoint is not +done too. + +So, to fix this problem with minimum changes, this patch updates +->j_tail_sequence, and issue REQ_FLUSH. (With more complex changes, +some optimizations would be possible to avoid unnecessary REQ_FLUSH +for example though.) + +BTW, + + journal->j_tail_sequence = + ++journal->j_transaction_sequence; + +Increment of ->j_transaction_sequence seems to be unnecessary, but +ext3 does this. + +Signed-off-by: OGAWA Hirofumi +Signed-off-by: Theodore Ts'o +Signed-off-by: Greg Kroah-Hartman +--- + fs/jbd2/journal.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c +index 81e6226..624a57a 100644 +--- a/fs/jbd2/journal.c ++++ b/fs/jbd2/journal.c +@@ -1408,11 +1408,12 @@ out: + /** + * jbd2_mark_journal_empty() - Mark on disk journal as empty. + * @journal: The journal to update. ++ * @write_op: With which operation should we write the journal sb + * + * Update a journal's dynamic superblock fields to show that journal is empty. + * Write updated superblock to disk waiting for IO to complete. + */ +-static void jbd2_mark_journal_empty(journal_t *journal) ++static void jbd2_mark_journal_empty(journal_t *journal, int write_op) + { + journal_superblock_t *sb = journal->j_superblock; + +@@ -1430,7 +1431,7 @@ static void jbd2_mark_journal_empty(journal_t *journal) + sb->s_start = cpu_to_be32(0); + read_unlock(&journal->j_state_lock); + +- jbd2_write_superblock(journal, WRITE_FUA); ++ jbd2_write_superblock(journal, write_op); + + /* Log is no longer empty */ + write_lock(&journal->j_state_lock); +@@ -1716,7 +1717,13 @@ int jbd2_journal_destroy(journal_t *journal) + if (journal->j_sb_buffer) { + if (!is_journal_aborted(journal)) { + mutex_lock(&journal->j_checkpoint_mutex); +- jbd2_mark_journal_empty(journal); ++ ++ write_lock(&journal->j_state_lock); ++ journal->j_tail_sequence = ++ ++journal->j_transaction_sequence; ++ write_unlock(&journal->j_state_lock); ++ ++ jbd2_mark_journal_empty(journal, WRITE_FLUSH_FUA); + mutex_unlock(&journal->j_checkpoint_mutex); + } else + err = -EIO; +@@ -1975,7 +1982,7 @@ int jbd2_journal_flush(journal_t *journal) + * the magic code for a fully-recovered superblock. Any future + * commits of data to the journal will restore the current + * s_start value. */ +- jbd2_mark_journal_empty(journal); ++ jbd2_mark_journal_empty(journal, WRITE_FUA); + mutex_unlock(&journal->j_checkpoint_mutex); + write_lock(&journal->j_state_lock); + J_ASSERT(!journal->j_running_transaction); +@@ -2021,7 +2028,7 @@ int jbd2_journal_wipe(journal_t *journal, int write) + if (write) { + /* Lock to make assertions happy... */ + mutex_lock(&journal->j_checkpoint_mutex); +- jbd2_mark_journal_empty(journal); ++ jbd2_mark_journal_empty(journal, WRITE_FUA); + mutex_unlock(&journal->j_checkpoint_mutex); + } + +-- +2.7.1 + + +From 18006299eb5cc5d334851c8f937bb729991e6ca5 Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Tue, 15 Dec 2015 16:38:22 +0100 +Subject: [PATCH 130/384] brd: Fix discard request processing + +commit 5e4298be45e83ecdffaabb370eea9396889b07f1 upstream. + +Avoid that discard requests with size => PAGE_SIZE fail with +-EIO. Refuse discard requests if the discard size is not a +multiple of the page size. + +Fixes: 2dbe54957636 ("brd: Refuse improperly aligned discard requests") +Signed-off-by: Bart Van Assche +Reviewed-by: Jan Kara +Cc: Christoph Hellwig +Cc: Robert Elliot +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/block/brd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/block/brd.c b/drivers/block/brd.c +index a5880f4..1914c63 100644 +--- a/drivers/block/brd.c ++++ b/drivers/block/brd.c +@@ -338,7 +338,7 @@ static blk_qc_t brd_make_request(struct request_queue *q, struct bio *bio) + + if (unlikely(bio->bi_rw & REQ_DISCARD)) { + if (sector & ((PAGE_SIZE >> SECTOR_SHIFT) - 1) || +- bio->bi_iter.bi_size & PAGE_MASK) ++ bio->bi_iter.bi_size & ~PAGE_MASK) + goto io_error; + discard_from_brd(brd, sector, bio->bi_iter.bi_size); + goto out; +-- +2.7.1 + + +From 397cb127f59b5b69abdda85b85a60d90653e809e Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Thu, 11 Feb 2016 11:03:09 -0800 +Subject: [PATCH 131/384] IB/srpt: Simplify srpt_handle_tsk_mgmt() + +commit 51093254bf879bc9ce96590400a87897c7498463 upstream. + +Let the target core check task existence instead of the SRP target +driver. Additionally, let the target core check the validity of the +task management request instead of the ib_srpt driver. + +This patch fixes the following kernel crash: + +BUG: unable to handle kernel NULL pointer dereference at 0000000000000001 +IP: [] srpt_handle_new_iu+0x6d7/0x790 [ib_srpt] +Oops: 0002 [#1] SMP +Call Trace: + [] srpt_process_completion+0xde/0x570 [ib_srpt] + [] srpt_compl_thread+0x13f/0x160 [ib_srpt] + [] kthread+0xcf/0xe0 + [] ret_from_fork+0x7c/0xb0 + +Signed-off-by: Bart Van Assche +Fixes: 3e4f574857ee ("ib_srpt: Convert TMR path to target_submit_tmr") +Tested-by: Alex Estrin +Reviewed-by: Christoph Hellwig +Cc: Nicholas Bellinger +Cc: Sagi Grimberg +Signed-off-by: Doug Ledford +Signed-off-by: Greg Kroah-Hartman +--- + drivers/infiniband/ulp/srpt/ib_srpt.c | 59 +---------------------------------- + 1 file changed, 1 insertion(+), 58 deletions(-) + +diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c +index 2e2fe81..eaabf31 100644 +--- a/drivers/infiniband/ulp/srpt/ib_srpt.c ++++ b/drivers/infiniband/ulp/srpt/ib_srpt.c +@@ -1737,47 +1737,6 @@ send_sense: + return -1; + } + +-/** +- * srpt_rx_mgmt_fn_tag() - Process a task management function by tag. +- * @ch: RDMA channel of the task management request. +- * @fn: Task management function to perform. +- * @req_tag: Tag of the SRP task management request. +- * @mgmt_ioctx: I/O context of the task management request. +- * +- * Returns zero if the target core will process the task management +- * request asynchronously. +- * +- * Note: It is assumed that the initiator serializes tag-based task management +- * requests. +- */ +-static int srpt_rx_mgmt_fn_tag(struct srpt_send_ioctx *ioctx, u64 tag) +-{ +- struct srpt_device *sdev; +- struct srpt_rdma_ch *ch; +- struct srpt_send_ioctx *target; +- int ret, i; +- +- ret = -EINVAL; +- ch = ioctx->ch; +- BUG_ON(!ch); +- BUG_ON(!ch->sport); +- sdev = ch->sport->sdev; +- BUG_ON(!sdev); +- spin_lock_irq(&sdev->spinlock); +- for (i = 0; i < ch->rq_size; ++i) { +- target = ch->ioctx_ring[i]; +- if (target->cmd.se_lun == ioctx->cmd.se_lun && +- target->cmd.tag == tag && +- srpt_get_cmd_state(target) != SRPT_STATE_DONE) { +- ret = 0; +- /* now let the target core abort &target->cmd; */ +- break; +- } +- } +- spin_unlock_irq(&sdev->spinlock); +- return ret; +-} +- + static int srp_tmr_to_tcm(int fn) + { + switch (fn) { +@@ -1812,7 +1771,6 @@ static void srpt_handle_tsk_mgmt(struct srpt_rdma_ch *ch, + struct se_cmd *cmd; + struct se_session *sess = ch->sess; + uint64_t unpacked_lun; +- uint32_t tag = 0; + int tcm_tmr; + int rc; + +@@ -1828,25 +1786,10 @@ static void srpt_handle_tsk_mgmt(struct srpt_rdma_ch *ch, + srpt_set_cmd_state(send_ioctx, SRPT_STATE_MGMT); + send_ioctx->cmd.tag = srp_tsk->tag; + tcm_tmr = srp_tmr_to_tcm(srp_tsk->tsk_mgmt_func); +- if (tcm_tmr < 0) { +- send_ioctx->cmd.se_tmr_req->response = +- TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED; +- goto fail; +- } + unpacked_lun = srpt_unpack_lun((uint8_t *)&srp_tsk->lun, + sizeof(srp_tsk->lun)); +- +- if (srp_tsk->tsk_mgmt_func == SRP_TSK_ABORT_TASK) { +- rc = srpt_rx_mgmt_fn_tag(send_ioctx, srp_tsk->task_tag); +- if (rc < 0) { +- send_ioctx->cmd.se_tmr_req->response = +- TMR_TASK_DOES_NOT_EXIST; +- goto fail; +- } +- tag = srp_tsk->task_tag; +- } + rc = target_submit_tmr(&send_ioctx->cmd, sess, NULL, unpacked_lun, +- srp_tsk, tcm_tmr, GFP_KERNEL, tag, ++ srp_tsk, tcm_tmr, GFP_KERNEL, srp_tsk->task_tag, + TARGET_SCF_ACK_KREF); + if (rc != 0) { + send_ioctx->cmd.se_tmr_req->response = TMR_FUNCTION_REJECTED; +-- +2.7.1 + + +From 05ca345f3e065c48523e0a9579beff9af28f1f7c Mon Sep 17 00:00:00 2001 +From: Eric Wheeler +Date: Fri, 26 Feb 2016 14:33:56 -0800 +Subject: [PATCH 132/384] bcache: cleaned up error handling around + register_cache() + +commit 9b299728ed777428b3908ac72ace5f8f84b97789 upstream. + +Fix null pointer dereference by changing register_cache() to return an int +instead of being void. This allows it to return -ENOMEM or -ENODEV and +enables upper layers to handle the OOM case without NULL pointer issues. + +See this thread: + http://thread.gmane.org/gmane.linux.kernel.bcache.devel/3521 + +Fixes this error: + gargamel:/sys/block/md5/bcache# echo /dev/sdh2 > /sys/fs/bcache/register + + bcache: register_cache() error opening sdh2: cannot allocate memory + BUG: unable to handle kernel NULL pointer dereference at 00000000000009b8 + IP: [] cache_set_flush+0x102/0x15c [bcache] + PGD 120dff067 PUD 1119a3067 PMD 0 + Oops: 0000 [#1] SMP + Modules linked in: veth ip6table_filter ip6_tables + (...) + CPU: 4 PID: 3371 Comm: kworker/4:3 Not tainted 4.4.2-amd64-i915-volpreempt-20160213bc1 #3 + Hardware name: System manufacturer System Product Name/P8H67-M PRO, BIOS 3904 04/27/2013 + Workqueue: events cache_set_flush [bcache] + task: ffff88020d5dc280 ti: ffff88020b6f8000 task.ti: ffff88020b6f8000 + RIP: 0010:[] [] cache_set_flush+0x102/0x15c [bcache] + +Signed-off-by: Eric Wheeler +Tested-by: Marc MERLIN +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/bcache/super.c | 34 ++++++++++++++++++++++------------ + 1 file changed, 22 insertions(+), 12 deletions(-) + +diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c +index 8d0ead9..f3f98c3 100644 +--- a/drivers/md/bcache/super.c ++++ b/drivers/md/bcache/super.c +@@ -1828,11 +1828,12 @@ static int cache_alloc(struct cache_sb *sb, struct cache *ca) + return 0; + } + +-static void register_cache(struct cache_sb *sb, struct page *sb_page, ++static int register_cache(struct cache_sb *sb, struct page *sb_page, + struct block_device *bdev, struct cache *ca) + { + char name[BDEVNAME_SIZE]; +- const char *err = "cannot allocate memory"; ++ const char *err = NULL; ++ int ret = 0; + + memcpy(&ca->sb, sb, sizeof(struct cache_sb)); + ca->bdev = bdev; +@@ -1847,27 +1848,35 @@ static void register_cache(struct cache_sb *sb, struct page *sb_page, + if (blk_queue_discard(bdev_get_queue(ca->bdev))) + ca->discard = CACHE_DISCARD(&ca->sb); + +- if (cache_alloc(sb, ca) != 0) ++ ret = cache_alloc(sb, ca); ++ if (ret != 0) + goto err; + +- err = "error creating kobject"; +- if (kobject_add(&ca->kobj, &part_to_dev(bdev->bd_part)->kobj, "bcache")) +- goto err; ++ if (kobject_add(&ca->kobj, &part_to_dev(bdev->bd_part)->kobj, "bcache")) { ++ err = "error calling kobject_add"; ++ ret = -ENOMEM; ++ goto out; ++ } + + mutex_lock(&bch_register_lock); + err = register_cache_set(ca); + mutex_unlock(&bch_register_lock); + +- if (err) +- goto err; ++ if (err) { ++ ret = -ENODEV; ++ goto out; ++ } + + pr_info("registered cache device %s", bdevname(bdev, name)); ++ + out: + kobject_put(&ca->kobj); +- return; ++ + err: +- pr_notice("error opening %s: %s", bdevname(bdev, name), err); +- goto out; ++ if (err) ++ pr_notice("error opening %s: %s", bdevname(bdev, name), err); ++ ++ return ret; + } + + /* Global interfaces/init */ +@@ -1965,7 +1974,8 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr, + if (!ca) + goto err_close; + +- register_cache(sb, sb_page, bdev, ca); ++ if (register_cache(sb, sb_page, bdev, ca) != 0) ++ goto err_close; + } + out: + if (sb_page) +-- +2.7.1 + + +From 950e1c49c21528a06f110a753f90cc0cc0c31adb Mon Sep 17 00:00:00 2001 +From: Eric Wheeler +Date: Fri, 26 Feb 2016 14:39:06 -0800 +Subject: [PATCH 133/384] bcache: fix race of writeback thread starting before + complete initialization + +commit 07cc6ef8edc47f8b4fc1e276d31127a0a5863d4d upstream. + +The bch_writeback_thread might BUG_ON in read_dirty() if +dc->sb==BDEV_STATE_DIRTY and bch_sectors_dirty_init has not yet completed +its related initialization. This patch downs the dc->writeback_lock until +after initialization is complete, thus preventing bch_writeback_thread +from proceeding prematurely. + +See this thread: + http://thread.gmane.org/gmane.linux.kernel.bcache.devel/3453 + +Signed-off-by: Eric Wheeler +Tested-by: Marc MERLIN +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/bcache/super.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c +index f3f98c3..6b07a0c 100644 +--- a/drivers/md/bcache/super.c ++++ b/drivers/md/bcache/super.c +@@ -1015,8 +1015,12 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c) + */ + atomic_set(&dc->count, 1); + +- if (bch_cached_dev_writeback_start(dc)) ++ /* Block writeback thread, but spawn it */ ++ down_write(&dc->writeback_lock); ++ if (bch_cached_dev_writeback_start(dc)) { ++ up_write(&dc->writeback_lock); + return -ENOMEM; ++ } + + if (BDEV_STATE(&dc->sb) == BDEV_STATE_DIRTY) { + bch_sectors_dirty_init(dc); +@@ -1028,6 +1032,9 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c) + bch_cached_dev_run(dc); + bcache_device_link(&dc->disk, c, "bdev"); + ++ /* Allow the writeback thread to proceed */ ++ up_write(&dc->writeback_lock); ++ + pr_info("Caching %s as %s on set %pU", + bdevname(dc->bdev, buf), dc->disk.disk->disk_name, + dc->disk.c->sb.set_uuid); +-- +2.7.1 + + +From 134429c60dbb3403a79297f0e0c17126752e304f Mon Sep 17 00:00:00 2001 +From: Eric Wheeler +Date: Mon, 7 Mar 2016 15:17:50 -0800 +Subject: [PATCH 134/384] bcache: fix cache_set_flush() NULL pointer + dereference on OOM + +commit f8b11260a445169989d01df75d35af0f56178f95 upstream. + +When bch_cache_set_alloc() fails to kzalloc the cache_set, the +asyncronous closure handling tries to dereference a cache_set that +hadn't yet been allocated inside of cache_set_flush() which is called +by __cache_set_unregister() during cleanup. This appears to happen only +during an OOM condition on bcache_register. + +Signed-off-by: Eric Wheeler +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/bcache/super.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c +index 6b07a0c..a296425 100644 +--- a/drivers/md/bcache/super.c ++++ b/drivers/md/bcache/super.c +@@ -1373,6 +1373,9 @@ static void cache_set_flush(struct closure *cl) + struct btree *b; + unsigned i; + ++ if (!c) ++ closure_return(cl); ++ + bch_cache_accounting_destroy(&c->accounting); + + kobject_put(&c->internal); +-- +2.7.1 + + +From b90712bb2e52f4da11c4caef11373db6c0bd0d12 Mon Sep 17 00:00:00 2001 +From: Johannes Weiner +Date: Thu, 17 Mar 2016 14:20:25 -0700 +Subject: [PATCH 135/384] mm: memcontrol: reclaim when shrinking memory.high + below usage + +commit 588083bb37a3cea8533c392370a554417c8f29cb upstream. + +When setting memory.high below usage, nothing happens until the next +charge comes along, and then it will only reclaim its own charge and not +the now potentially huge excess of the new memory.high. This can cause +groups to stay in excess of their memory.high indefinitely. + +To fix that, when shrinking memory.high, kick off a reclaim cycle that +goes after the delta. + +Signed-off-by: Johannes Weiner +Acked-by: Michal Hocko +Cc: Vladimir Davydov +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + mm/memcontrol.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/mm/memcontrol.c b/mm/memcontrol.c +index 095d20f..a089f9d 100644 +--- a/mm/memcontrol.c ++++ b/mm/memcontrol.c +@@ -5127,6 +5127,7 @@ static ssize_t memory_high_write(struct kernfs_open_file *of, + char *buf, size_t nbytes, loff_t off) + { + struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); ++ unsigned long nr_pages; + unsigned long high; + int err; + +@@ -5137,6 +5138,11 @@ static ssize_t memory_high_write(struct kernfs_open_file *of, + + memcg->high = high; + ++ nr_pages = page_counter_read(&memcg->memory); ++ if (nr_pages > high) ++ try_to_free_mem_cgroup_pages(memcg, nr_pages - high, ++ GFP_KERNEL, true); ++ + memcg_wb_domain_size_changed(memcg); + return nbytes; + } +-- +2.7.1 + + +From aeb87d1d6993bcad9671b14a5680c4e8f42c38fd Mon Sep 17 00:00:00 2001 +From: Johannes Weiner +Date: Thu, 17 Mar 2016 14:20:28 -0700 +Subject: [PATCH 136/384] mm: memcontrol: reclaim and OOM kill when shrinking + memory.max below usage + +commit b6e6edcfa40561e9c8abe5eecf1c96f8e5fd9c6f upstream. + +Setting the original memory.limit_in_bytes hardlimit is subject to a +race condition when the desired value is below the current usage. The +code tries a few times to first reclaim and then see if the usage has +dropped to where we would like it to be, but there is no locking, and +the workload is free to continue making new charges up to the old limit. +Thus, attempting to shrink a workload relies on pure luck and hope that +the workload happens to cooperate. + +To fix this in the cgroup2 memory.max knob, do it the other way round: +set the limit first, then try enforcement. And if reclaim is not able +to succeed, trigger OOM kills in the group. Keep going until the new +limit is met, we run out of OOM victims and there's only unreclaimable +memory left, or the task writing to memory.max is killed. This allows +users to shrink groups reliably, and the behavior is consistent with +what happens when new charges are attempted in excess of memory.max. + +Signed-off-by: Johannes Weiner +Acked-by: Michal Hocko +Cc: Vladimir Davydov +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + mm/memcontrol.c | 38 ++++++++++++++++++++++++++++++++++---- + 1 file changed, 34 insertions(+), 4 deletions(-) + +diff --git a/mm/memcontrol.c b/mm/memcontrol.c +index a089f9d..43719f3 100644 +--- a/mm/memcontrol.c ++++ b/mm/memcontrol.c +@@ -1335,7 +1335,7 @@ static unsigned long mem_cgroup_get_limit(struct mem_cgroup *memcg) + return limit; + } + +-static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, ++static bool mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, + int order) + { + struct oom_control oc = { +@@ -1413,6 +1413,7 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, + } + unlock: + mutex_unlock(&oom_lock); ++ return chosen; + } + + #if MAX_NUMNODES > 1 +@@ -5164,6 +5165,8 @@ static ssize_t memory_max_write(struct kernfs_open_file *of, + char *buf, size_t nbytes, loff_t off) + { + struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); ++ unsigned int nr_reclaims = MEM_CGROUP_RECLAIM_RETRIES; ++ bool drained = false; + unsigned long max; + int err; + +@@ -5172,9 +5175,36 @@ static ssize_t memory_max_write(struct kernfs_open_file *of, + if (err) + return err; + +- err = mem_cgroup_resize_limit(memcg, max); +- if (err) +- return err; ++ xchg(&memcg->memory.limit, max); ++ ++ for (;;) { ++ unsigned long nr_pages = page_counter_read(&memcg->memory); ++ ++ if (nr_pages <= max) ++ break; ++ ++ if (signal_pending(current)) { ++ err = -EINTR; ++ break; ++ } ++ ++ if (!drained) { ++ drain_all_stock(memcg); ++ drained = true; ++ continue; ++ } ++ ++ if (nr_reclaims) { ++ if (!try_to_free_mem_cgroup_pages(memcg, nr_pages - max, ++ GFP_KERNEL, true)) ++ nr_reclaims--; ++ continue; ++ } ++ ++ mem_cgroup_events(memcg, MEMCG_OOM, 1); ++ if (!mem_cgroup_out_of_memory(memcg, GFP_KERNEL, 0)) ++ break; ++ } + + memcg_wb_domain_size_changed(memcg); + return nbytes; +-- +2.7.1 + + +From c2158d5156ec79b72b80088c29f2179423f59037 Mon Sep 17 00:00:00 2001 +From: "Luis R. Rodriguez" +Date: Thu, 17 Mar 2016 14:17:16 -0700 +Subject: [PATCH 137/384] ia64: define ioremap_uc() + +commit b0f84ac352762ed02d7ea9f284942a8cab7f9077 upstream. + +All architectures now need ioremap_uc(), ia64 seems defines this already +through its ioremap_nocache() and it already ensures it *only* uses UC. + +This is needed since v4.3 to complete an allyesconfig compile on ia64, +there were others archs that needed this, and this one seems to have +fallen through the cracks. + +Signed-off-by: Luis R. Rodriguez +Reported-by: kbuild test robot +Acked-by: Tony Luck +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + arch/ia64/include/asm/io.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/ia64/include/asm/io.h b/arch/ia64/include/asm/io.h +index 9041bbe..8fdb9c7 100644 +--- a/arch/ia64/include/asm/io.h ++++ b/arch/ia64/include/asm/io.h +@@ -436,6 +436,7 @@ static inline void __iomem * ioremap_cache (unsigned long phys_addr, unsigned lo + return ioremap(phys_addr, size); + } + #define ioremap_cache ioremap_cache ++#define ioremap_uc ioremap_nocache + + + /* +-- +2.7.1 + + +From 1a19958de623f56c45d856c8cab22a21e00a4399 Mon Sep 17 00:00:00 2001 +From: Joshua Hunt +Date: Thu, 17 Mar 2016 14:17:23 -0700 +Subject: [PATCH 138/384] watchdog: don't run proc_watchdog_update if new value + is same as old + +commit a1ee1932aa6bea0bb074f5e3ced112664e4637ed upstream. + +While working on a script to restore all sysctl params before a series of +tests I found that writing any value into the +/proc/sys/kernel/{nmi_watchdog,soft_watchdog,watchdog,watchdog_thresh} +causes them to call proc_watchdog_update(). + + NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter. + NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter. + NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter. + NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter. + +There doesn't appear to be a reason for doing this work every time a write +occurs, so only do it when the values change. + +Signed-off-by: Josh Hunt +Acked-by: Don Zickus +Reviewed-by: Aaron Tomlin +Cc: Ulrich Obergfell +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + kernel/watchdog.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/kernel/watchdog.c b/kernel/watchdog.c +index 201775b..d974121 100644 +--- a/kernel/watchdog.c ++++ b/kernel/watchdog.c +@@ -918,6 +918,9 @@ static int proc_watchdog_common(int which, struct ctl_table *table, int write, + * both lockup detectors are disabled if proc_watchdog_update() + * returns an error. + */ ++ if (old == new) ++ goto out; ++ + err = proc_watchdog_update(); + } + out: +@@ -962,7 +965,7 @@ int proc_soft_watchdog(struct ctl_table *table, int write, + int proc_watchdog_thresh(struct ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) + { +- int err, old; ++ int err, old, new; + + get_online_cpus(); + mutex_lock(&watchdog_proc_mutex); +@@ -982,6 +985,10 @@ int proc_watchdog_thresh(struct ctl_table *table, int write, + /* + * Update the sample period. Restore on failure. + */ ++ new = ACCESS_ONCE(watchdog_thresh); ++ if (old == new) ++ goto out; ++ + set_sample_period(); + err = proc_watchdog_update(); + if (err) { +-- +2.7.1 + + +From 3d2baa00fbbd7037ada109297dd227c0adf91836 Mon Sep 17 00:00:00 2001 +From: "Michael S. Tsirkin" +Date: Sun, 28 Feb 2016 17:44:09 +0200 +Subject: [PATCH 139/384] watchdog: rc32434_wdt: fix ioctl error handling + +commit 10e7ac22cdd4d211cef99afcb9371b70cb175be6 upstream. + +Calling return copy_to_user(...) in an ioctl will not do the right thing +if there's a pagefault: copy_to_user returns the number of bytes not +copied in this case. + +Fix up watchdog/rc32434_wdt to do + return copy_to_user(...)) ? -EFAULT : 0; + +instead. + +Signed-off-by: Michael S. Tsirkin +Signed-off-by: Guenter Roeck +Signed-off-by: Wim Van Sebroeck +Signed-off-by: Greg Kroah-Hartman +--- + drivers/watchdog/rc32434_wdt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/watchdog/rc32434_wdt.c b/drivers/watchdog/rc32434_wdt.c +index 71e78ef..3a75f3b 100644 +--- a/drivers/watchdog/rc32434_wdt.c ++++ b/drivers/watchdog/rc32434_wdt.c +@@ -237,7 +237,7 @@ static long rc32434_wdt_ioctl(struct file *file, unsigned int cmd, + return -EINVAL; + /* Fall through */ + case WDIOC_GETTIMEOUT: +- return copy_to_user(argp, &timeout, sizeof(int)); ++ return copy_to_user(argp, &timeout, sizeof(int)) ? -EFAULT : 0; + default: + return -ENOTTY; + } +-- +2.7.1 + + +From 12e2b8db0f069b672053efc066f7c3282492f0f2 Mon Sep 17 00:00:00 2001 +From: Dmitry Tunin +Date: Wed, 10 Feb 2016 00:49:11 +0300 +Subject: [PATCH 140/384] Bluetooth: Add new AR3012 ID 0489:e095 + +commit 28c971d82fb58ef7cba22e5308be6d2d2590473d upstream. + +T: Bus=01 Lev=01 Prnt=01 Port=04 Cnt=02 Dev#= 3 Spd=12 MxCh= 0 +D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=0489 ProdID=e095 Rev=00.01 +C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA +I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb + +This device requires ar3k/AthrBT_0x31010100.dfu and +ar3k/ramps_0x31010100_40.dfu firmware files that are not in +linux-firmware yet. + +BugLink: https://bugs.launchpad.net/bugs/1542944 + +Signed-off-by: Dmitry Tunin +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + drivers/bluetooth/ath3k.c | 2 ++ + drivers/bluetooth/btusb.c | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c +index 0c4a748..0beaa52 100644 +--- a/drivers/bluetooth/ath3k.c ++++ b/drivers/bluetooth/ath3k.c +@@ -82,6 +82,7 @@ static const struct usb_device_id ath3k_table[] = { + { USB_DEVICE(0x0489, 0xe05f) }, + { USB_DEVICE(0x0489, 0xe076) }, + { USB_DEVICE(0x0489, 0xe078) }, ++ { USB_DEVICE(0x0489, 0xe095) }, + { USB_DEVICE(0x04c5, 0x1330) }, + { USB_DEVICE(0x04CA, 0x3004) }, + { USB_DEVICE(0x04CA, 0x3005) }, +@@ -147,6 +148,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = { + { USB_DEVICE(0x0489, 0xe05f), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0489, 0xe076), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0489, 0xe078), .driver_info = BTUSB_ATH3012 }, ++ { USB_DEVICE(0x0489, 0xe095), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x04c5, 0x1330), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c +index 342ec8d..7910759 100644 +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -196,6 +196,7 @@ static const struct usb_device_id blacklist_table[] = { + { USB_DEVICE(0x0489, 0xe05f), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0489, 0xe076), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0489, 0xe078), .driver_info = BTUSB_ATH3012 }, ++ { USB_DEVICE(0x0489, 0xe095), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x04c5, 0x1330), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, +-- +2.7.1 + + +From 298618e195074ef7de290546167cbd517ed5ab6e Mon Sep 17 00:00:00 2001 +From: Johan Hedberg +Date: Fri, 11 Mar 2016 09:56:33 +0200 +Subject: [PATCH 141/384] Bluetooth: Fix potential buffer overflow with Add + Advertising + +commit 6a0e78072c2ae7b20b14e0249d8108441ea928d2 upstream. + +The Add Advertising command handler does the appropriate checks for +the AD and Scan Response data, however fails to take into account the +general length of the mgmt command itself, which could lead to +potential buffer overflows. This patch adds the necessary check that +the mgmt command length is consistent with the given ad and scan_rsp +lengths. + +Signed-off-by: Johan Hedberg +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + net/bluetooth/mgmt.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c +index 7f22119..b1b0a1c 100644 +--- a/net/bluetooth/mgmt.c ++++ b/net/bluetooth/mgmt.c +@@ -7155,6 +7155,10 @@ static int add_advertising(struct sock *sk, struct hci_dev *hdev, + return mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING, + status); + ++ if (data_len != sizeof(*cp) + cp->adv_data_len + cp->scan_rsp_len) ++ return mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING, ++ MGMT_STATUS_INVALID_PARAMS); ++ + flags = __le32_to_cpu(cp->flags); + timeout = __le16_to_cpu(cp->timeout); + duration = __le16_to_cpu(cp->duration); +-- +2.7.1 + + +From 688c4c3f028e74bb8750b6a7175d4d219c001759 Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Tue, 15 Mar 2016 20:43:04 -0400 +Subject: [PATCH 142/384] cgroup: ignore css_sets associated with dead cgroups + during migration + +commit 2b021cbf3cb6208f0d40fd2f1869f237934340ed upstream. + +Before 2e91fa7f6d45 ("cgroup: keep zombies associated with their +original cgroups"), all dead tasks were associated with init_css_set. +If a zombie task is requested for migration, while migration prep +operations would still be performed on init_css_set, the actual +migration would ignore zombie tasks. As init_css_set is always valid, +this worked fine. + +However, after 2e91fa7f6d45, zombie tasks stay with the css_set it was +associated with at the time of death. Let's say a task T associated +with cgroup A on hierarchy H-1 and cgroup B on hiearchy H-2. After T +becomes a zombie, it would still remain associated with A and B. If A +only contains zombie tasks, it can be removed. On removal, A gets +marked offline but stays pinned until all zombies are drained. At +this point, if migration is initiated on T to a cgroup C on hierarchy +H-2, migration path would try to prepare T's css_set for migration and +trigger the following. + + WARNING: CPU: 0 PID: 1576 at kernel/cgroup.c:474 cgroup_get+0x121/0x160() + CPU: 0 PID: 1576 Comm: bash Not tainted 4.4.0-work+ #289 + ... + Call Trace: + [] dump_stack+0x4e/0x82 + [] warn_slowpath_common+0x78/0xb0 + [] warn_slowpath_null+0x15/0x20 + [] cgroup_get+0x121/0x160 + [] link_css_set+0x7b/0x90 + [] find_css_set+0x3bc/0x5e0 + [] cgroup_migrate_prepare_dst+0x89/0x1f0 + [] cgroup_attach_task+0x157/0x230 + [] __cgroup_procs_write+0x2b7/0x470 + [] cgroup_tasks_write+0xc/0x10 + [] cgroup_file_write+0x30/0x1b0 + [] kernfs_fop_write+0x13c/0x180 + [] __vfs_write+0x23/0xe0 + [] vfs_write+0xa4/0x1a0 + [] SyS_write+0x44/0xa0 + [] entry_SYSCALL_64_fastpath+0x12/0x6f + +It doesn't make sense to prepare migration for css_sets pointing to +dead cgroups as they are guaranteed to contain only zombies which are +ignored later during migration. This patch makes cgroup destruction +path mark all affected css_sets as dead and updates the migration path +to ignore them during preparation. + +Signed-off-by: Tejun Heo +Fixes: 2e91fa7f6d45 ("cgroup: keep zombies associated with their original cgroups") +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/cgroup-defs.h | 3 +++ + kernel/cgroup.c | 20 ++++++++++++++++++-- + 2 files changed, 21 insertions(+), 2 deletions(-) + +diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h +index 63f0063..5024950 100644 +--- a/include/linux/cgroup-defs.h ++++ b/include/linux/cgroup-defs.h +@@ -218,6 +218,9 @@ struct css_set { + /* all css_task_iters currently walking this cset */ + struct list_head task_iters; + ++ /* dead and being drained, ignore for migration */ ++ bool dead; ++ + /* For RCU-protected deletion */ + struct rcu_head rcu_head; + }; +diff --git a/kernel/cgroup.c b/kernel/cgroup.c +index a0087e5..d8a41fd 100644 +--- a/kernel/cgroup.c ++++ b/kernel/cgroup.c +@@ -2498,6 +2498,14 @@ static void cgroup_migrate_add_src(struct css_set *src_cset, + lockdep_assert_held(&cgroup_mutex); + lockdep_assert_held(&css_set_lock); + ++ /* ++ * If ->dead, @src_set is associated with one or more dead cgroups ++ * and doesn't contain any migratable tasks. Ignore it early so ++ * that the rest of migration path doesn't get confused by it. ++ */ ++ if (src_cset->dead) ++ return; ++ + src_cgrp = cset_cgroup_from_root(src_cset, dst_cgrp->root); + + if (!list_empty(&src_cset->mg_preload_node)) +@@ -5131,6 +5139,7 @@ static int cgroup_destroy_locked(struct cgroup *cgrp) + __releases(&cgroup_mutex) __acquires(&cgroup_mutex) + { + struct cgroup_subsys_state *css; ++ struct cgrp_cset_link *link; + int ssid; + + lockdep_assert_held(&cgroup_mutex); +@@ -5151,11 +5160,18 @@ static int cgroup_destroy_locked(struct cgroup *cgrp) + return -EBUSY; + + /* +- * Mark @cgrp dead. This prevents further task migration and child +- * creation by disabling cgroup_lock_live_group(). ++ * Mark @cgrp and the associated csets dead. The former prevents ++ * further task migration and child creation by disabling ++ * cgroup_lock_live_group(). The latter makes the csets ignored by ++ * the migration path. + */ + cgrp->self.flags &= ~CSS_ONLINE; + ++ spin_lock_bh(&css_set_lock); ++ list_for_each_entry(link, &cgrp->cset_links, cset_link) ++ link->cset->dead = true; ++ spin_unlock_bh(&css_set_lock); ++ + /* initiate massacre of all css's */ + for_each_css(css, ssid, cgrp) + kill_css(css); +-- +2.7.1 + + +From b2e486592b4def1f0a17c8898da1f9331c8f8116 Mon Sep 17 00:00:00 2001 +From: Dmitri Epshtein +Date: Sat, 12 Mar 2016 18:44:18 +0100 +Subject: [PATCH 143/384] net: mvneta: enable change MAC address when interface + is up + +commit 928b6519afeb2a5e2dc61154380b545ed66c476a upstream. + +Function eth_prepare_mac_addr_change() is called as part of MAC +address change. This function check if interface is running. +To enable change MAC address when interface is running: +IFF_LIVE_ADDR_CHANGE flag must be set to dev->priv_flags field + +Fixes: c5aff18204da ("net: mvneta: driver for Marvell Armada 370/XP +network unit") +Signed-off-by: Dmitri Epshtein +Signed-off-by: Gregory CLEMENT +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/marvell/mvneta.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c +index 7e0f8f5..c3952aa 100644 +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -3591,7 +3591,7 @@ static int mvneta_probe(struct platform_device *pdev) + dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; + dev->hw_features |= dev->features; + dev->vlan_features |= dev->features; +- dev->priv_flags |= IFF_UNICAST_FLT; ++ dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE; + dev->gso_max_segs = MVNETA_MAX_TSO_SEGS; + + phylink = phylink_create(dev, dn, phy_mode, &mvneta_phylink_ops); +-- +2.7.1 + + +From 25bbbc1731eb5ed77f61ac279b99b5b2140978bd Mon Sep 17 00:00:00 2001 +From: Vinayak Menon +Date: Mon, 22 Feb 2016 19:15:44 +0530 +Subject: [PATCH 144/384] of: alloc anywhere from memblock if range not + specified + +commit e53b50c0cbe392c946807abf7d07615a3c588642 upstream. + +early_init_dt_alloc_reserved_memory_arch passes end as 0 to +__memblock_alloc_base, when limits are not specified. But +__memblock_alloc_base takes end value of 0 as MEMBLOCK_ALLOC_ACCESSIBLE +and limits the end to memblock.current_limit. This results in regions +never being placed in HIGHMEM area, for e.g. CMA. +Let __memblock_alloc_base allocate from anywhere in memory if limits are +not specified. + +Acked-by: Marek Szyprowski +Signed-off-by: Vinayak Menon +Signed-off-by: Rob Herring +Signed-off-by: Greg Kroah-Hartman +--- + drivers/of/of_reserved_mem.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c +index 1a3556a..ed01c01 100644 +--- a/drivers/of/of_reserved_mem.c ++++ b/drivers/of/of_reserved_mem.c +@@ -32,11 +32,13 @@ int __init __weak early_init_dt_alloc_reserved_memory_arch(phys_addr_t size, + phys_addr_t align, phys_addr_t start, phys_addr_t end, bool nomap, + phys_addr_t *res_base) + { ++ phys_addr_t base; + /* + * We use __memblock_alloc_base() because memblock_alloc_base() + * panic()s on allocation failure. + */ +- phys_addr_t base = __memblock_alloc_base(size, align, end); ++ end = !end ? MEMBLOCK_ALLOC_ANYWHERE : end; ++ base = __memblock_alloc_base(size, align, end); + if (!base) + return -ENOMEM; + +-- +2.7.1 + + +From 61db4a72e8bffd5bdd9557471854eb78b29665f1 Mon Sep 17 00:00:00 2001 +From: "Dmitry V. Levin" +Date: Thu, 19 Mar 2015 11:10:54 +0000 +Subject: [PATCH 145/384] vfs: show_vfsstat: do not ignore errors from + show_devname method + +commit 5f8d498d4364f544fee17125787a47553db02afa upstream. + +Explicitly check show_devname method return code and bail out in case +of an error. This fixes regression introduced by commit 9d4d65748a5c. + +Signed-off-by: Dmitry V. Levin +Signed-off-by: Al Viro +Signed-off-by: Greg Kroah-Hartman +--- + fs/proc_namespace.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/fs/proc_namespace.c b/fs/proc_namespace.c +index 8ebd9a3..876459559 100644 +--- a/fs/proc_namespace.c ++++ b/fs/proc_namespace.c +@@ -197,6 +197,8 @@ static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt) + if (sb->s_op->show_devname) { + seq_puts(m, "device "); + err = sb->s_op->show_devname(m, mnt_path.dentry); ++ if (err) ++ goto out; + } else { + if (r->mnt_devname) { + seq_puts(m, "device "); +-- +2.7.1 + + +From eb596a2d8d8fe033630723185721466c485c36c3 Mon Sep 17 00:00:00 2001 +From: Rabin Vincent +Date: Thu, 10 Mar 2016 21:19:06 +0100 +Subject: [PATCH 146/384] splice: handle zero nr_pages in splice_to_pipe() + +commit d6785d9152147596f60234157da2b02540c3e60f upstream. + +Running the following command: + + busybox cat /sys/kernel/debug/tracing/trace_pipe > /dev/null + +with any tracing enabled pretty very quickly leads to various NULL +pointer dereferences and VM BUG_ON()s, such as these: + + BUG: unable to handle kernel NULL pointer dereference at 0000000000000020 + IP: [] generic_pipe_buf_release+0xc/0x40 + Call Trace: + [] splice_direct_to_actor+0x143/0x1e0 + [] ? generic_pipe_buf_nosteal+0x10/0x10 + [] do_splice_direct+0x8f/0xb0 + [] do_sendfile+0x199/0x380 + [] SyS_sendfile64+0x90/0xa0 + [] entry_SYSCALL_64_fastpath+0x12/0x6d + + page dumped because: VM_BUG_ON_PAGE(atomic_read(&page->_count) == 0) + kernel BUG at include/linux/mm.h:367! + invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC + RIP: [] generic_pipe_buf_release+0x3c/0x40 + Call Trace: + [] splice_direct_to_actor+0x143/0x1e0 + [] ? generic_pipe_buf_nosteal+0x10/0x10 + [] do_splice_direct+0x8f/0xb0 + [] do_sendfile+0x199/0x380 + [] SyS_sendfile64+0x90/0xa0 + [] tracesys_phase2+0x84/0x89 + +(busybox's cat uses sendfile(2), unlike the coreutils version) + +This is because tracing_splice_read_pipe() can call splice_to_pipe() +with spd->nr_pages == 0. spd_pages underflows in splice_to_pipe() and +we fill the page pointers and the other fields of the pipe_buffers with +garbage. + +All other callers of splice_to_pipe() avoid calling it when nr_pages == +0, and we could make tracing_splice_read_pipe() do that too, but it +seems reasonable to have splice_to_page() handle this condition +gracefully. + +Signed-off-by: Rabin Vincent +Reviewed-by: Christoph Hellwig +Signed-off-by: Al Viro +Signed-off-by: Greg Kroah-Hartman +--- + fs/splice.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/fs/splice.c b/fs/splice.c +index 4cf700d..0f77e96 100644 +--- a/fs/splice.c ++++ b/fs/splice.c +@@ -185,6 +185,9 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe, + unsigned int spd_pages = spd->nr_pages; + int ret, do_wakeup, page_nr; + ++ if (!spd_pages) ++ return 0; ++ + ret = 0; + do_wakeup = 0; + page_nr = 0; +-- +2.7.1 + + +From 1b7ace2cc09e48dbfcd869c13b2d61d5b528d5e9 Mon Sep 17 00:00:00 2001 +From: Max Filippov +Date: Tue, 9 Feb 2016 01:02:38 +0300 +Subject: [PATCH 147/384] xtensa: ISS: don't hang if stdin EOF is reached + +commit 362014c8d9d51d504c167c44ac280169457732be upstream. + +Simulator stdin may be connected to a file, when its end is reached +kernel hangs in infinite loop inside rs_poll, because simc_poll always +signals that descriptor 0 is readable and simc_read always returns 0. +Check simc_read return value and exit loop if it's not positive. Also +don't rewind polling timer if it's zero. + +Signed-off-by: Max Filippov +Signed-off-by: Greg Kroah-Hartman +--- + arch/xtensa/platforms/iss/console.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c +index 70cb408..92d785f 100644 +--- a/arch/xtensa/platforms/iss/console.c ++++ b/arch/xtensa/platforms/iss/console.c +@@ -100,21 +100,23 @@ static void rs_poll(unsigned long priv) + { + struct tty_port *port = (struct tty_port *)priv; + int i = 0; ++ int rd = 1; + unsigned char c; + + spin_lock(&timer_lock); + + while (simc_poll(0)) { +- simc_read(0, &c, 1); ++ rd = simc_read(0, &c, 1); ++ if (rd <= 0) ++ break; + tty_insert_flip_char(port, c, TTY_NORMAL); + i++; + } + + if (i) + tty_flip_buffer_push(port); +- +- +- mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE); ++ if (rd) ++ mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE); + spin_unlock(&timer_lock); + } + +-- +2.7.1 + + +From 1ae8e40ef44ab363da046f90baf2fbda3dde0585 Mon Sep 17 00:00:00 2001 +From: Max Filippov +Date: Thu, 25 Feb 2016 23:27:51 +0300 +Subject: [PATCH 148/384] xtensa: fix preemption in {clear,copy}_user_highpage + +commit a67cc9aa2dfc6e66addf240bbd79e16e01565e81 upstream. + +Disabling pagefault makes little sense there, preemption disabling is +what was meant. + +Signed-off-by: Max Filippov +Signed-off-by: Greg Kroah-Hartman +--- + arch/xtensa/mm/cache.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/xtensa/mm/cache.c b/arch/xtensa/mm/cache.c +index d75aa14..1a804a2 100644 +--- a/arch/xtensa/mm/cache.c ++++ b/arch/xtensa/mm/cache.c +@@ -97,11 +97,11 @@ void clear_user_highpage(struct page *page, unsigned long vaddr) + unsigned long paddr; + void *kvaddr = coherent_kvaddr(page, TLBTEMP_BASE_1, vaddr, &paddr); + +- pagefault_disable(); ++ preempt_disable(); + kmap_invalidate_coherent(page, vaddr); + set_bit(PG_arch_1, &page->flags); + clear_page_alias(kvaddr, paddr); +- pagefault_enable(); ++ preempt_enable(); + } + + void copy_user_highpage(struct page *dst, struct page *src, +@@ -113,11 +113,11 @@ void copy_user_highpage(struct page *dst, struct page *src, + void *src_vaddr = coherent_kvaddr(src, TLBTEMP_BASE_2, vaddr, + &src_paddr); + +- pagefault_disable(); ++ preempt_disable(); + kmap_invalidate_coherent(dst, vaddr); + set_bit(PG_arch_1, &dst->flags); + copy_page_alias(dst_vaddr, src_vaddr, dst_paddr, src_paddr); +- pagefault_enable(); ++ preempt_enable(); + } + + #endif /* DCACHE_WAY_SIZE > PAGE_SIZE */ +-- +2.7.1 + + +From 2438e30356eda33ff1308218319f02a36f6b3721 Mon Sep 17 00:00:00 2001 +From: Max Filippov +Date: Thu, 3 Mar 2016 18:34:29 +0300 +Subject: [PATCH 149/384] xtensa: clear all DBREAKC registers on start + +commit 7de7ac785ae18a2cdc78d7560f48e3213d9ea0ab upstream. + +There are XCHAL_NUM_DBREAK registers, clear them all. +This also fixes cryptic assembler error message with binutils 2.25 when +XCHAL_NUM_DBREAK is 0: + + as: out of memory allocating 18446744073709551575 bytes after a total + of 495616 bytes + +Signed-off-by: Max Filippov +Signed-off-by: Greg Kroah-Hartman +--- + arch/xtensa/kernel/head.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/xtensa/kernel/head.S b/arch/xtensa/kernel/head.S +index 9ed5564..05e1df9 100644 +--- a/arch/xtensa/kernel/head.S ++++ b/arch/xtensa/kernel/head.S +@@ -128,7 +128,7 @@ ENTRY(_startup) + wsr a0, icountlevel + + .set _index, 0 +- .rept XCHAL_NUM_DBREAK - 1 ++ .rept XCHAL_NUM_DBREAK + wsr a0, SREG_DBREAKC + _index + .set _index, _index + 1 + .endr +-- +2.7.1 + + +From 4097e0804ce10638fc3da319afadcc43c0e5d4eb Mon Sep 17 00:00:00 2001 +From: Lada Trimasova +Date: Wed, 9 Mar 2016 20:21:04 +0300 +Subject: [PATCH 150/384] ARC: [BE] readl()/writel() to work in Big Endian CPU + configuration + +commit f778cc65717687a3d3f26dd21bef62cd059f1b8b upstream. + +read{l,w}() write{l,w}() primitives should use le{16,32}_to_cpu() and +cpu_to_le{16,32}() respectively to ensure device registers are read +correctly in Big Endian CPU configuration. + +Per Arnd Bergmann +| Most drivers using readl() or readl_relaxed() expect those to perform byte +| swaps on big-endian architectures, as the registers tend to be fixed endian + +This was needed for getting UART to work correctly on a Big Endian ARC. + +The ARC accessors originally were fine, and the bug got introduced +inadventently by commit b8a033023994 ("ARCv2: barriers") + +Fixes: b8a033023994 ("ARCv2: barriers") +Link: http://lkml.kernel.org/r/201603100845.30602.arnd@arndb.de +Cc: Alexey Brodkin +Cc: Arnd Bergmann +Signed-off-by: Lada Trimasova +[vgupta: beefed up changelog, added Fixes/stable tags] +Signed-off-by: Vineet Gupta +Signed-off-by: Greg Kroah-Hartman +--- + arch/arc/include/asm/io.h | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +diff --git a/arch/arc/include/asm/io.h b/arch/arc/include/asm/io.h +index 694ece8..27b17ad 100644 +--- a/arch/arc/include/asm/io.h ++++ b/arch/arc/include/asm/io.h +@@ -129,15 +129,23 @@ static inline void __raw_writel(u32 w, volatile void __iomem *addr) + #define writel(v,c) ({ __iowmb(); writel_relaxed(v,c); }) + + /* +- * Relaxed API for drivers which can handle any ordering themselves ++ * Relaxed API for drivers which can handle barrier ordering themselves ++ * ++ * Also these are defined to perform little endian accesses. ++ * To provide the typical device register semantics of fixed endian, ++ * swap the byte order for Big Endian ++ * ++ * http://lkml.kernel.org/r/201603100845.30602.arnd@arndb.de + */ + #define readb_relaxed(c) __raw_readb(c) +-#define readw_relaxed(c) __raw_readw(c) +-#define readl_relaxed(c) __raw_readl(c) ++#define readw_relaxed(c) ({ u16 __r = le16_to_cpu((__force __le16) \ ++ __raw_readw(c)); __r; }) ++#define readl_relaxed(c) ({ u32 __r = le32_to_cpu((__force __le32) \ ++ __raw_readl(c)); __r; }) + + #define writeb_relaxed(v,c) __raw_writeb(v,c) +-#define writew_relaxed(v,c) __raw_writew(v,c) +-#define writel_relaxed(v,c) __raw_writel(v,c) ++#define writew_relaxed(v,c) __raw_writew((__force u16) cpu_to_le16(v),c) ++#define writel_relaxed(v,c) __raw_writel((__force u32) cpu_to_le32(v),c) + + #include + +-- +2.7.1 + + +From 8a34ec7e65d3502442c3681aa2d09ba6337e91ad Mon Sep 17 00:00:00 2001 +From: Vineet Gupta +Date: Tue, 8 Mar 2016 19:31:24 +0530 +Subject: [PATCH 151/384] ARC: bitops: Remove non relevant comments + +commit 2a41b6dc28dc71c1a3f1622612a26edc58f7561e upstream. + +commit 80f420842ff42 removed the ARC bitops microoptimization but failed +to prune the comments to same effect + +Fixes: 80f420842ff42 ("ARC: Make ARC bitops "safer" (add anti-optimization)") +Signed-off-by: Vineet Gupta +Signed-off-by: Greg Kroah-Hartman +--- + arch/arc/include/asm/bitops.h | 15 --------------- + 1 file changed, 15 deletions(-) + +diff --git a/arch/arc/include/asm/bitops.h b/arch/arc/include/asm/bitops.h +index 57c1f33..0352fb8 100644 +--- a/arch/arc/include/asm/bitops.h ++++ b/arch/arc/include/asm/bitops.h +@@ -35,21 +35,6 @@ static inline void op##_bit(unsigned long nr, volatile unsigned long *m)\ + \ + m += nr >> 5; \ + \ +- /* \ +- * ARC ISA micro-optimization: \ +- * \ +- * Instructions dealing with bitpos only consider lower 5 bits \ +- * e.g (x << 33) is handled like (x << 1) by ASL instruction \ +- * (mem pointer still needs adjustment to point to next word) \ +- * \ +- * Hence the masking to clamp @nr arg can be elided in general. \ +- * \ +- * However if @nr is a constant (above assumed in a register), \ +- * and greater than 31, gcc can optimize away (x << 33) to 0, \ +- * as overflow, given the 32-bit ISA. Thus masking needs to be \ +- * done for const @nr, but no code is generated due to gcc \ +- * const prop. \ +- */ \ + nr &= 0x1f; \ + \ + __asm__ __volatile__( \ +-- +2.7.1 + + +From 1aa406bb0c7c7f4c16eebfff8b9d6c7e6855e685 Mon Sep 17 00:00:00 2001 +From: Nikolay Borisov +Date: Thu, 3 Mar 2016 10:54:57 +0100 +Subject: [PATCH 152/384] quota: Fix possible GPF due to uninitialised pointers + +commit ab73ef46398e2c0159f3a71de834586422d2a44a upstream. + +When dqget() in __dquot_initialize() fails e.g. due to IO error, +__dquot_initialize() will pass an array of uninitialized pointers to +dqput_all() and thus can lead to deference of random data. Fix the +problem by properly initializing the array. + +Signed-off-by: Nikolay Borisov +Signed-off-by: Jan Kara +Signed-off-by: Greg Kroah-Hartman +--- + fs/quota/dquot.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c +index ef0d64b..353ff31 100644 +--- a/fs/quota/dquot.c ++++ b/fs/quota/dquot.c +@@ -1398,7 +1398,7 @@ static int dquot_active(const struct inode *inode) + static int __dquot_initialize(struct inode *inode, int type) + { + int cnt, init_needed = 0; +- struct dquot **dquots, *got[MAXQUOTAS]; ++ struct dquot **dquots, *got[MAXQUOTAS] = {}; + struct super_block *sb = inode->i_sb; + qsize_t rsv; + int ret = 0; +@@ -1415,7 +1415,6 @@ static int __dquot_initialize(struct inode *inode, int type) + int rc; + struct dquot *dquot; + +- got[cnt] = NULL; + if (type != -1 && cnt != type) + continue; + /* +-- +2.7.1 + + +From cbca9db355bf3f1f10c4214c513f762503d7af37 Mon Sep 17 00:00:00 2001 +From: Mateusz Guzik +Date: Wed, 2 Mar 2016 09:51:09 +1100 +Subject: [PATCH 153/384] xfs: fix two memory leaks in xfs_attr_list.c error + paths + +commit 2e83b79b2d6c78bf1b4aa227938a214dcbddc83f upstream. + +This plugs 2 trivial leaks in xfs_attr_shortform_list and +xfs_attr3_leaf_list_int. + +Signed-off-by: Mateusz Guzik +Reviewed-by: Eric Sandeen +Signed-off-by: Dave Chinner +Signed-off-by: Greg Kroah-Hartman +--- + fs/xfs/xfs_attr_list.c | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) + +diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c +index 0ef7c2e..4fa1482 100644 +--- a/fs/xfs/xfs_attr_list.c ++++ b/fs/xfs/xfs_attr_list.c +@@ -202,8 +202,10 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context) + sbp->namelen, + sbp->valuelen, + &sbp->name[sbp->namelen]); +- if (error) ++ if (error) { ++ kmem_free(sbuf); + return error; ++ } + if (context->seen_enough) + break; + cursor->offset++; +@@ -454,14 +456,13 @@ xfs_attr3_leaf_list_int( + args.rmtblkcnt = xfs_attr3_rmt_blocks( + args.dp->i_mount, valuelen); + retval = xfs_attr_rmtval_get(&args); +- if (retval) +- return retval; +- retval = context->put_listent(context, +- entry->flags, +- name_rmt->name, +- (int)name_rmt->namelen, +- valuelen, +- args.value); ++ if (!retval) ++ retval = context->put_listent(context, ++ entry->flags, ++ name_rmt->name, ++ (int)name_rmt->namelen, ++ valuelen, ++ args.value); + kmem_free(args.value); + } else { + retval = context->put_listent(context, +-- +2.7.1 + + +From a922a80ec32a3236bf8f768e31438fb917b96aa9 Mon Sep 17 00:00:00 2001 +From: Nate Dailey +Date: Mon, 29 Feb 2016 10:43:58 -0500 +Subject: [PATCH 154/384] raid1: include bio_end_io_list in nr_queued to + prevent freeze_array hang + +commit ccfc7bf1f09d6190ef86693ddc761d5fe3fa47cb upstream. + +If raid1d is handling a mix of read and write errors, handle_read_error's +call to freeze_array can get stuck. + +This can happen because, though the bio_end_io_list is initially drained, +writes can be added to it via handle_write_finished as the retry_list +is processed. These writes contribute to nr_pending but are not included +in nr_queued. + +If a later entry on the retry_list triggers a call to handle_read_error, +freeze array hangs waiting for nr_pending == nr_queued+extra. The writes +on the bio_end_io_list aren't included in nr_queued so the condition will +never be satisfied. + +To prevent the hang, include bio_end_io_list writes in nr_queued. + +There's probably a better way to handle decrementing nr_queued, but this +seemed like the safest way to avoid breaking surrounding code. + +I'm happy to supply the script I used to repro this hang. + +Fixes: 55ce74d4bfe1b(md/raid1: ensure device failure recorded before write request returns.) +Signed-off-by: Nate Dailey +Signed-off-by: Shaohua Li +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/raid1.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c +index c4b9134..515554c 100644 +--- a/drivers/md/raid1.c ++++ b/drivers/md/raid1.c +@@ -2274,6 +2274,7 @@ static void handle_write_finished(struct r1conf *conf, struct r1bio *r1_bio) + if (fail) { + spin_lock_irq(&conf->device_lock); + list_add(&r1_bio->retry_list, &conf->bio_end_io_list); ++ conf->nr_queued++; + spin_unlock_irq(&conf->device_lock); + md_wakeup_thread(conf->mddev->thread); + } else { +@@ -2391,8 +2392,10 @@ static void raid1d(struct md_thread *thread) + LIST_HEAD(tmp); + spin_lock_irqsave(&conf->device_lock, flags); + if (!test_bit(MD_CHANGE_PENDING, &mddev->flags)) { +- list_add(&tmp, &conf->bio_end_io_list); +- list_del_init(&conf->bio_end_io_list); ++ while (!list_empty(&conf->bio_end_io_list)) { ++ list_move(conf->bio_end_io_list.prev, &tmp); ++ conf->nr_queued--; ++ } + } + spin_unlock_irqrestore(&conf->device_lock, flags); + while (!list_empty(&tmp)) { +-- +2.7.1 + + +From cfa032c2600970f5c3a8b57b672754ad68a7dbad Mon Sep 17 00:00:00 2001 +From: Jes Sorensen +Date: Tue, 16 Feb 2016 16:44:24 -0500 +Subject: [PATCH 155/384] md/raid5: Compare apples to apples (or sectors to + sectors) + +commit e7597e69dec59b65c5525db1626b9d34afdfa678 upstream. + +'max_discard_sectors' is in sectors, while 'stripe' is in bytes. + +This fixes the problem where DISCARD would get disabled on some larger +RAID5 configurations (6 or more drives in my testing), while it worked +as expected with smaller configurations. + +Fixes: 620125f2bf8 ("MD: raid5 trim support") +Signed-off-by: Jes Sorensen +Signed-off-by: Shaohua Li +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/raid5.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c +index adf72a9..ac22372 100644 +--- a/drivers/md/raid5.c ++++ b/drivers/md/raid5.c +@@ -7018,8 +7018,8 @@ static int run(struct mddev *mddev) + } + + if (discard_supported && +- mddev->queue->limits.max_discard_sectors >= stripe && +- mddev->queue->limits.discard_granularity >= stripe) ++ mddev->queue->limits.max_discard_sectors >= (stripe >> 9) && ++ mddev->queue->limits.discard_granularity >= stripe) + queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, + mddev->queue); + else +-- +2.7.1 + + +From c7c5302759bad99aad46b9421c939979d9e8f6d6 Mon Sep 17 00:00:00 2001 +From: Shaohua Li +Date: Wed, 24 Feb 2016 17:38:28 -0800 +Subject: [PATCH 156/384] RAID5: check_reshape() shouldn't call mddev_suspend + +commit 27a353c026a879a1001e5eac4bda75b16262c44a upstream. + +check_reshape() is called from raid5d thread. raid5d thread shouldn't +call mddev_suspend(), because mddev_suspend() waits for all IO finish +but IO is handled in raid5d thread, we could easily deadlock here. + +This issue is introduced by +738a273 ("md/raid5: fix allocation of 'scribble' array.") + +Reported-and-tested-by: Artur Paszkiewicz +Reviewed-by: NeilBrown +Signed-off-by: Shaohua Li +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/raid5.c | 18 ++++++++++++++++++ + drivers/md/raid5.h | 2 ++ + 2 files changed, 20 insertions(+) + +diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c +index ac22372..4dd185b 100644 +--- a/drivers/md/raid5.c ++++ b/drivers/md/raid5.c +@@ -2093,6 +2093,14 @@ static int resize_chunks(struct r5conf *conf, int new_disks, int new_sectors) + unsigned long cpu; + int err = 0; + ++ /* ++ * Never shrink. And mddev_suspend() could deadlock if this is called ++ * from raid5d. In that case, scribble_disks and scribble_sectors ++ * should equal to new_disks and new_sectors ++ */ ++ if (conf->scribble_disks >= new_disks && ++ conf->scribble_sectors >= new_sectors) ++ return 0; + mddev_suspend(conf->mddev); + get_online_cpus(); + for_each_present_cpu(cpu) { +@@ -2114,6 +2122,10 @@ static int resize_chunks(struct r5conf *conf, int new_disks, int new_sectors) + } + put_online_cpus(); + mddev_resume(conf->mddev); ++ if (!err) { ++ conf->scribble_disks = new_disks; ++ conf->scribble_sectors = new_sectors; ++ } + return err; + } + +@@ -6417,6 +6429,12 @@ static int raid5_alloc_percpu(struct r5conf *conf) + } + put_online_cpus(); + ++ if (!err) { ++ conf->scribble_disks = max(conf->raid_disks, ++ conf->previous_raid_disks); ++ conf->scribble_sectors = max(conf->chunk_sectors, ++ conf->prev_chunk_sectors); ++ } + return err; + } + +diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h +index 3f0c2e2..b5eb89a 100644 +--- a/drivers/md/raid5.h ++++ b/drivers/md/raid5.h +@@ -511,6 +511,8 @@ struct r5conf { + * conversions + */ + } __percpu *percpu; ++ int scribble_disks; ++ int scribble_sectors; + #ifdef CONFIG_HOTPLUG_CPU + struct notifier_block cpu_notify; + #endif +-- +2.7.1 + + +From f274785acf8dd32d8b6897ae3044ab82c5dcee2c Mon Sep 17 00:00:00 2001 +From: Shaohua Li +Date: Thu, 25 Feb 2016 16:24:42 -0800 +Subject: [PATCH 157/384] RAID5: revert e9e4c377e2f563 to fix a livelock + +commit 6ab2a4b806ae21b6c3e47c5ff1285ec06d505325 upstream. + +Revert commit +e9e4c377e2f563(md/raid5: per hash value and exclusive wait_for_stripe) + +The problem is raid5_get_active_stripe waits on +conf->wait_for_stripe[hash]. Assume hash is 0. My test release stripes +in this order: +- release all stripes with hash 0 +- raid5_get_active_stripe still sleeps since active_stripes > + max_nr_stripes * 3 / 4 +- release all stripes with hash other than 0. active_stripes becomes 0 +- raid5_get_active_stripe still sleeps, since nobody wakes up + wait_for_stripe[0] +The system live locks. The problem is active_stripes isn't a per-hash +count. Revert the patch makes the live lock go away. + +Cc: Yuanhan Liu +Cc: NeilBrown +Signed-off-by: Shaohua Li +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/raid5.c | 27 ++++++++------------------- + drivers/md/raid5.h | 2 +- + 2 files changed, 9 insertions(+), 20 deletions(-) + +diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c +index 4dd185b..55de965 100644 +--- a/drivers/md/raid5.c ++++ b/drivers/md/raid5.c +@@ -340,8 +340,7 @@ static void release_inactive_stripe_list(struct r5conf *conf, + int hash) + { + int size; +- unsigned long do_wakeup = 0; +- int i = 0; ++ bool do_wakeup = false; + unsigned long flags; + + if (hash == NR_STRIPE_HASH_LOCKS) { +@@ -362,19 +361,15 @@ static void release_inactive_stripe_list(struct r5conf *conf, + !list_empty(list)) + atomic_dec(&conf->empty_inactive_list_nr); + list_splice_tail_init(list, conf->inactive_list + hash); +- do_wakeup |= 1 << hash; ++ do_wakeup = true; + spin_unlock_irqrestore(conf->hash_locks + hash, flags); + } + size--; + hash--; + } + +- for (i = 0; i < NR_STRIPE_HASH_LOCKS; i++) { +- if (do_wakeup & (1 << i)) +- wake_up(&conf->wait_for_stripe[i]); +- } +- + if (do_wakeup) { ++ wake_up(&conf->wait_for_stripe); + if (atomic_read(&conf->active_stripes) == 0) + wake_up(&conf->wait_for_quiescent); + if (conf->retry_read_aligned) +@@ -687,15 +682,14 @@ raid5_get_active_stripe(struct r5conf *conf, sector_t sector, + if (!sh) { + set_bit(R5_INACTIVE_BLOCKED, + &conf->cache_state); +- wait_event_exclusive_cmd( +- conf->wait_for_stripe[hash], ++ wait_event_lock_irq( ++ conf->wait_for_stripe, + !list_empty(conf->inactive_list + hash) && + (atomic_read(&conf->active_stripes) + < (conf->max_nr_stripes * 3 / 4) + || !test_bit(R5_INACTIVE_BLOCKED, + &conf->cache_state)), +- spin_unlock_irq(conf->hash_locks + hash), +- spin_lock_irq(conf->hash_locks + hash)); ++ *(conf->hash_locks + hash)); + clear_bit(R5_INACTIVE_BLOCKED, + &conf->cache_state); + } else { +@@ -720,9 +714,6 @@ raid5_get_active_stripe(struct r5conf *conf, sector_t sector, + } + } while (sh == NULL); + +- if (!list_empty(conf->inactive_list + hash)) +- wake_up(&conf->wait_for_stripe[hash]); +- + spin_unlock_irq(conf->hash_locks + hash); + return sh; + } +@@ -2206,7 +2197,7 @@ static int resize_stripes(struct r5conf *conf, int newsize) + cnt = 0; + list_for_each_entry(nsh, &newstripes, lru) { + lock_device_hash_lock(conf, hash); +- wait_event_exclusive_cmd(conf->wait_for_stripe[hash], ++ wait_event_cmd(conf->wait_for_stripe, + !list_empty(conf->inactive_list + hash), + unlock_device_hash_lock(conf, hash), + lock_device_hash_lock(conf, hash)); +@@ -6525,9 +6516,7 @@ static struct r5conf *setup_conf(struct mddev *mddev) + seqcount_init(&conf->gen_lock); + mutex_init(&conf->cache_size_mutex); + init_waitqueue_head(&conf->wait_for_quiescent); +- for (i = 0; i < NR_STRIPE_HASH_LOCKS; i++) { +- init_waitqueue_head(&conf->wait_for_stripe[i]); +- } ++ init_waitqueue_head(&conf->wait_for_stripe); + init_waitqueue_head(&conf->wait_for_overlap); + INIT_LIST_HEAD(&conf->handle_list); + INIT_LIST_HEAD(&conf->hold_list); +diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h +index b5eb89a..efe9188 100644 +--- a/drivers/md/raid5.h ++++ b/drivers/md/raid5.h +@@ -525,7 +525,7 @@ struct r5conf { + atomic_t empty_inactive_list_nr; + struct llist_head released_stripes; + wait_queue_head_t wait_for_quiescent; +- wait_queue_head_t wait_for_stripe[NR_STRIPE_HASH_LOCKS]; ++ wait_queue_head_t wait_for_stripe; + wait_queue_head_t wait_for_overlap; + unsigned long cache_state; + #define R5_INACTIVE_BLOCKED 1 /* release of inactive stripes blocked, +-- +2.7.1 + + +From e892d006d4d9d500929683e32743d85d31fe97ba Mon Sep 17 00:00:00 2001 +From: Shaohua Li +Date: Mon, 14 Mar 2016 11:49:32 -0700 +Subject: [PATCH 158/384] raid10: include bio_end_io_list in nr_queued to + prevent freeze_array hang + +commit 23ddba80ebe836476bb2fa1f5ef305dd1c63dc0b upstream. + +This is the raid10 counterpart of the bug fixed by Nate +(raid1: include bio_end_io_list in nr_queued to prevent freeze_array hang) + +Fixes: 95af587e95(md/raid10: ensure device failure recorded before write request returns) +Cc: Nate Dailey +Signed-off-by: Shaohua Li +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/raid10.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c +index ce959b4..ebb0dd6 100644 +--- a/drivers/md/raid10.c ++++ b/drivers/md/raid10.c +@@ -2664,6 +2664,7 @@ static void handle_write_completed(struct r10conf *conf, struct r10bio *r10_bio) + if (fail) { + spin_lock_irq(&conf->device_lock); + list_add(&r10_bio->retry_list, &conf->bio_end_io_list); ++ conf->nr_queued++; + spin_unlock_irq(&conf->device_lock); + md_wakeup_thread(conf->mddev->thread); + } else { +@@ -2691,8 +2692,10 @@ static void raid10d(struct md_thread *thread) + LIST_HEAD(tmp); + spin_lock_irqsave(&conf->device_lock, flags); + if (!test_bit(MD_CHANGE_PENDING, &mddev->flags)) { +- list_add(&tmp, &conf->bio_end_io_list); +- list_del_init(&conf->bio_end_io_list); ++ while (!list_empty(&conf->bio_end_io_list)) { ++ list_move(conf->bio_end_io_list.prev, &tmp); ++ conf->nr_queued--; ++ } + } + spin_unlock_irqrestore(&conf->device_lock, flags); + while (!list_empty(&tmp)) { +-- +2.7.1 + + +From 4d7d063a42182f277e89cee972f7d163a16ec7fb Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Wed, 9 Mar 2016 12:58:25 +1100 +Subject: [PATCH 159/384] md/raid5: preserve STRIPE_PREREAD_ACTIVE in + break_stripe_batch_list + +commit 550da24f8d62fe81f3c13e3ec27602d6e44d43dc upstream. + +break_stripe_batch_list breaks up a batch and copies some flags from +the batch head to the members, preserving others. + +It doesn't preserve or copy STRIPE_PREREAD_ACTIVE. This is not +normally a problem as STRIPE_PREREAD_ACTIVE is cleared when a +stripe_head is added to a batch, and is not set on stripe_heads +already in a batch. + +However there is no locking to ensure one thread doesn't set the flag +after it has just been cleared in another. This does occasionally happen. + +md/raid5 maintains a count of the number of stripe_heads with +STRIPE_PREREAD_ACTIVE set: conf->preread_active_stripes. When +break_stripe_batch_list clears STRIPE_PREREAD_ACTIVE inadvertently +this could becomes incorrect and will never again return to zero. + +md/raid5 delays the handling of some stripe_heads until +preread_active_stripes becomes zero. So when the above mention race +happens, those stripe_heads become blocked and never progress, +resulting is write to the array handing. + +So: change break_stripe_batch_list to preserve STRIPE_PREREAD_ACTIVE +in the members of a batch. + +URL: https://bugzilla.kernel.org/show_bug.cgi?id=108741 +URL: https://bugzilla.redhat.com/show_bug.cgi?id=1258153 +URL: http://thread.gmane.org/5649C0E9.2030204@zoner.cz +Reported-by: Martin Svec (and others) +Tested-by: Tom Weber +Fixes: 1b956f7a8f9a ("md/raid5: be more selective about distributing flags across batch.") +Signed-off-by: NeilBrown +Signed-off-by: Shaohua Li +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/raid5.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c +index 55de965..76f7179 100644 +--- a/drivers/md/raid5.c ++++ b/drivers/md/raid5.c +@@ -4243,7 +4243,6 @@ static void break_stripe_batch_list(struct stripe_head *head_sh, + WARN_ON_ONCE(sh->state & ((1 << STRIPE_ACTIVE) | + (1 << STRIPE_SYNCING) | + (1 << STRIPE_REPLACED) | +- (1 << STRIPE_PREREAD_ACTIVE) | + (1 << STRIPE_DELAYED) | + (1 << STRIPE_BIT_DELAY) | + (1 << STRIPE_FULL_WRITE) | +@@ -4258,6 +4257,7 @@ static void break_stripe_batch_list(struct stripe_head *head_sh, + (1 << STRIPE_REPLACED))); + + set_mask_bits(&sh->state, ~(STRIPE_EXPAND_SYNC_FLAGS | ++ (1 << STRIPE_PREREAD_ACTIVE) | + (1 << STRIPE_DEGRADED)), + head_sh->state & (1 << STRIPE_INSYNC)); + +-- +2.7.1 + + +From 622e7f0f8215a2ace13d758c89e2d2f072c50837 Mon Sep 17 00:00:00 2001 +From: Ming Lei +Date: Sat, 12 Mar 2016 09:29:40 +0800 +Subject: [PATCH 160/384] md: multipath: don't hardcopy bio in .make_request + path + +commit fafcde3ac1a418688a734365203a12483b83907a upstream. + +Inside multipath_make_request(), multipath maps the incoming +bio into low level device's bio, but it is totally wrong to +copy the bio into mapped bio via '*mapped_bio = *bio'. For +example, .__bi_remaining is kept in the copy, especially if +the incoming bio is chained to via bio splitting, so .bi_end_io +can't be called for the mapped bio at all in the completing path +in this kind of situation. + +This patch fixes the issue by using clone style. + +Reported-and-tested-by: Andrea Righi +Signed-off-by: Ming Lei +Signed-off-by: Shaohua Li +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/multipath.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c +index 0a72ab6..dd483bb 100644 +--- a/drivers/md/multipath.c ++++ b/drivers/md/multipath.c +@@ -129,7 +129,9 @@ static void multipath_make_request(struct mddev *mddev, struct bio * bio) + } + multipath = conf->multipaths + mp_bh->path; + +- mp_bh->bio = *bio; ++ bio_init(&mp_bh->bio); ++ __bio_clone_fast(&mp_bh->bio, bio); ++ + mp_bh->bio.bi_iter.bi_sector += multipath->rdev->data_offset; + mp_bh->bio.bi_bdev = multipath->rdev->bdev; + mp_bh->bio.bi_rw |= REQ_FAILFAST_TRANSPORT; +-- +2.7.1 + + +From ecda56253056f502906329fcada44c6c33b1307b Mon Sep 17 00:00:00 2001 +From: Robert Doebbelin +Date: Mon, 7 Mar 2016 09:50:56 +0100 +Subject: [PATCH 161/384] fuse: do not use iocb after it may have been freed + +commit 7cabc61e01a0a8b663bd2b4c982aa53048218734 upstream. + +There's a race in fuse_direct_IO(), whereby is_sync_kiocb() is called on an +iocb that could have been freed if async io has already completed. The fix +in this case is simple and obvious: cache the result before starting io. + +It was discovered by KASan: + +kernel: ================================================================== +kernel: BUG: KASan: use after free in fuse_direct_IO+0xb1a/0xcc0 at addr ffff88036c414390 + +Signed-off-by: Robert Doebbelin +Signed-off-by: Miklos Szeredi +Fixes: bcba24ccdc82 ("fuse: enable asynchronous processing direct IO") +Signed-off-by: Greg Kroah-Hartman +--- + fs/fuse/file.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/fs/fuse/file.c b/fs/fuse/file.c +index 570ca40..6991b5c 100644 +--- a/fs/fuse/file.c ++++ b/fs/fuse/file.c +@@ -2786,6 +2786,7 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset) + loff_t i_size; + size_t count = iov_iter_count(iter); + struct fuse_io_priv *io; ++ bool is_sync = is_sync_kiocb(iocb); + + pos = offset; + inode = file->f_mapping->host; +@@ -2825,11 +2826,11 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset) + * to wait on real async I/O requests, so we must submit this request + * synchronously. + */ +- if (!is_sync_kiocb(iocb) && (offset + count > i_size) && ++ if (!is_sync && (offset + count > i_size) && + iov_iter_rw(iter) == WRITE) + io->async = false; + +- if (io->async && is_sync_kiocb(iocb)) ++ if (io->async && is_sync) + io->done = &wait; + + if (iov_iter_rw(iter) == WRITE) { +@@ -2843,7 +2844,7 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset) + fuse_aio_complete(io, ret < 0 ? ret : 0, -1); + + /* we have a non-extending, async request, so return */ +- if (!is_sync_kiocb(iocb)) ++ if (!is_sync) + return -EIOCBQUEUED; + + wait_for_completion(&wait); +-- +2.7.1 + + +From 9288dd1dd21042eb596f00b9217ac0f18a6cfd25 Mon Sep 17 00:00:00 2001 +From: Seth Forshee +Date: Fri, 11 Mar 2016 10:35:34 -0600 +Subject: [PATCH 162/384] fuse: Add reference counting for fuse_io_priv + +commit 744742d692e37ad5c20630e57d526c8f2e2fe3c9 upstream. + +The 'reqs' member of fuse_io_priv serves two purposes. First is to track +the number of oustanding async requests to the server and to signal that +the io request is completed. The second is to be a reference count on the +structure to know when it can be freed. + +For sync io requests these purposes can be at odds. fuse_direct_IO() wants +to block until the request is done, and since the signal is sent when +'reqs' reaches 0 it cannot keep a reference to the object. Yet it needs to +use the object after the userspace server has completed processing +requests. This leads to some handshaking and special casing that it +needlessly complicated and responsible for at least one race condition. + +It's much cleaner and safer to maintain a separate reference count for the +object lifecycle and to let 'reqs' just be a count of outstanding requests +to the userspace server. Then we can know for sure when it is safe to free +the object without any handshaking or special cases. + +The catch here is that most of the time these objects are stack allocated +and should not be freed. Initializing these objects with a single reference +that is never released prevents accidental attempts to free the objects. + +Fixes: 9d5722b7777e ("fuse: handle synchronous iocbs internally") +Signed-off-by: Seth Forshee +Signed-off-by: Miklos Szeredi +Signed-off-by: Greg Kroah-Hartman +--- + fs/fuse/cuse.c | 4 ++-- + fs/fuse/file.c | 28 +++++++++++++++++++++------- + fs/fuse/fuse_i.h | 9 +++++++++ + 3 files changed, 32 insertions(+), 9 deletions(-) + +diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c +index 8e3ee19..c5b6b71 100644 +--- a/fs/fuse/cuse.c ++++ b/fs/fuse/cuse.c +@@ -90,7 +90,7 @@ static struct list_head *cuse_conntbl_head(dev_t devt) + + static ssize_t cuse_read_iter(struct kiocb *kiocb, struct iov_iter *to) + { +- struct fuse_io_priv io = { .async = 0, .file = kiocb->ki_filp }; ++ struct fuse_io_priv io = FUSE_IO_PRIV_SYNC(kiocb->ki_filp); + loff_t pos = 0; + + return fuse_direct_io(&io, to, &pos, FUSE_DIO_CUSE); +@@ -98,7 +98,7 @@ static ssize_t cuse_read_iter(struct kiocb *kiocb, struct iov_iter *to) + + static ssize_t cuse_write_iter(struct kiocb *kiocb, struct iov_iter *from) + { +- struct fuse_io_priv io = { .async = 0, .file = kiocb->ki_filp }; ++ struct fuse_io_priv io = FUSE_IO_PRIV_SYNC(kiocb->ki_filp); + loff_t pos = 0; + /* + * No locking or generic_write_checks(), the server is +diff --git a/fs/fuse/file.c b/fs/fuse/file.c +index 6991b5c..c2e340d 100644 +--- a/fs/fuse/file.c ++++ b/fs/fuse/file.c +@@ -528,6 +528,11 @@ static void fuse_release_user_pages(struct fuse_req *req, int write) + } + } + ++static void fuse_io_release(struct kref *kref) ++{ ++ kfree(container_of(kref, struct fuse_io_priv, refcnt)); ++} ++ + static ssize_t fuse_get_res_by_io(struct fuse_io_priv *io) + { + if (io->err) +@@ -585,8 +590,9 @@ static void fuse_aio_complete(struct fuse_io_priv *io, int err, ssize_t pos) + } + + io->iocb->ki_complete(io->iocb, res, 0); +- kfree(io); + } ++ ++ kref_put(&io->refcnt, fuse_io_release); + } + + static void fuse_aio_complete_req(struct fuse_conn *fc, struct fuse_req *req) +@@ -613,6 +619,7 @@ static size_t fuse_async_req_send(struct fuse_conn *fc, struct fuse_req *req, + size_t num_bytes, struct fuse_io_priv *io) + { + spin_lock(&io->lock); ++ kref_get(&io->refcnt); + io->size += num_bytes; + io->reqs++; + spin_unlock(&io->lock); +@@ -691,7 +698,7 @@ static void fuse_short_read(struct fuse_req *req, struct inode *inode, + + static int fuse_do_readpage(struct file *file, struct page *page) + { +- struct fuse_io_priv io = { .async = 0, .file = file }; ++ struct fuse_io_priv io = FUSE_IO_PRIV_SYNC(file); + struct inode *inode = page->mapping->host; + struct fuse_conn *fc = get_fuse_conn(inode); + struct fuse_req *req; +@@ -984,7 +991,7 @@ static size_t fuse_send_write_pages(struct fuse_req *req, struct file *file, + size_t res; + unsigned offset; + unsigned i; +- struct fuse_io_priv io = { .async = 0, .file = file }; ++ struct fuse_io_priv io = FUSE_IO_PRIV_SYNC(file); + + for (i = 0; i < req->num_pages; i++) + fuse_wait_on_page_writeback(inode, req->pages[i]->index); +@@ -1398,7 +1405,7 @@ static ssize_t __fuse_direct_read(struct fuse_io_priv *io, + + static ssize_t fuse_direct_read_iter(struct kiocb *iocb, struct iov_iter *to) + { +- struct fuse_io_priv io = { .async = 0, .file = iocb->ki_filp }; ++ struct fuse_io_priv io = FUSE_IO_PRIV_SYNC(iocb->ki_filp); + return __fuse_direct_read(&io, to, &iocb->ki_pos); + } + +@@ -1406,7 +1413,7 @@ static ssize_t fuse_direct_write_iter(struct kiocb *iocb, struct iov_iter *from) + { + struct file *file = iocb->ki_filp; + struct inode *inode = file_inode(file); +- struct fuse_io_priv io = { .async = 0, .file = file }; ++ struct fuse_io_priv io = FUSE_IO_PRIV_SYNC(file); + ssize_t res; + + if (is_bad_inode(inode)) +@@ -2807,6 +2814,7 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset) + if (!io) + return -ENOMEM; + spin_lock_init(&io->lock); ++ kref_init(&io->refcnt); + io->reqs = 1; + io->bytes = -1; + io->size = 0; +@@ -2830,8 +2838,14 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset) + iov_iter_rw(iter) == WRITE) + io->async = false; + +- if (io->async && is_sync) ++ if (io->async && is_sync) { ++ /* ++ * Additional reference to keep io around after ++ * calling fuse_aio_complete() ++ */ ++ kref_get(&io->refcnt); + io->done = &wait; ++ } + + if (iov_iter_rw(iter) == WRITE) { + ret = fuse_direct_io(io, iter, &pos, FUSE_DIO_WRITE); +@@ -2851,7 +2865,7 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset) + ret = fuse_get_res_by_io(io); + } + +- kfree(io); ++ kref_put(&io->refcnt, fuse_io_release); + + if (iov_iter_rw(iter) == WRITE) { + if (ret > 0) +diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h +index 4051131..604cd42 100644 +--- a/fs/fuse/fuse_i.h ++++ b/fs/fuse/fuse_i.h +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + /** Max number of pages that can be used in a single read request */ + #define FUSE_MAX_PAGES_PER_REQ 32 +@@ -243,6 +244,7 @@ struct fuse_args { + + /** The request IO state (for asynchronous processing) */ + struct fuse_io_priv { ++ struct kref refcnt; + int async; + spinlock_t lock; + unsigned reqs; +@@ -256,6 +258,13 @@ struct fuse_io_priv { + struct completion *done; + }; + ++#define FUSE_IO_PRIV_SYNC(f) \ ++{ \ ++ .refcnt = { ATOMIC_INIT(1) }, \ ++ .async = 0, \ ++ .file = f, \ ++} ++ + /** + * Request flags + * +-- +2.7.1 + + +From ffad483fa0779369b12cb1af0c64eae7e6e5f739 Mon Sep 17 00:00:00 2001 +From: Jann Horn +Date: Tue, 22 Mar 2016 14:25:36 -0700 +Subject: [PATCH 163/384] fs/coredump: prevent fsuid=0 dumps into + user-controlled directories + +commit 378c6520e7d29280f400ef2ceaf155c86f05a71a upstream. + +This commit fixes the following security hole affecting systems where +all of the following conditions are fulfilled: + + - The fs.suid_dumpable sysctl is set to 2. + - The kernel.core_pattern sysctl's value starts with "/". (Systems + where kernel.core_pattern starts with "|/" are not affected.) + - Unprivileged user namespace creation is permitted. (This is + true on Linux >=3.8, but some distributions disallow it by + default using a distro patch.) + +Under these conditions, if a program executes under secure exec rules, +causing it to run with the SUID_DUMP_ROOT flag, then unshares its user +namespace, changes its root directory and crashes, the coredump will be +written using fsuid=0 and a path derived from kernel.core_pattern - but +this path is interpreted relative to the root directory of the process, +allowing the attacker to control where a coredump will be written with +root privileges. + +To fix the security issue, always interpret core_pattern for dumps that +are written under SUID_DUMP_ROOT relative to the root directory of init. + +Signed-off-by: Jann Horn +Acked-by: Kees Cook +Cc: Al Viro +Cc: "Eric W. Biederman" +Cc: Andy Lutomirski +Cc: Oleg Nesterov +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + arch/um/drivers/mconsole_kern.c | 2 +- + fs/coredump.c | 30 ++++++++++++++++++++++++++---- + fs/fhandle.c | 2 +- + fs/open.c | 6 ++---- + include/linux/fs.h | 2 +- + kernel/sysctl_binary.c | 2 +- + 6 files changed, 32 insertions(+), 12 deletions(-) + +diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c +index 29880c9..e22e572 100644 +--- a/arch/um/drivers/mconsole_kern.c ++++ b/arch/um/drivers/mconsole_kern.c +@@ -133,7 +133,7 @@ void mconsole_proc(struct mc_request *req) + ptr += strlen("proc"); + ptr = skip_spaces(ptr); + +- file = file_open_root(mnt->mnt_root, mnt, ptr, O_RDONLY); ++ file = file_open_root(mnt->mnt_root, mnt, ptr, O_RDONLY, 0); + if (IS_ERR(file)) { + mconsole_reply(req, "Failed to open file", 1, 0); + printk(KERN_ERR "open /proc/%s: %ld\n", ptr, PTR_ERR(file)); +diff --git a/fs/coredump.c b/fs/coredump.c +index 1777331..dfc87c5 100644 +--- a/fs/coredump.c ++++ b/fs/coredump.c +@@ -32,6 +32,9 @@ + #include + #include + #include ++#include ++#include ++#include + + #include + #include +@@ -627,6 +630,8 @@ void do_coredump(const siginfo_t *siginfo) + } + } else { + struct inode *inode; ++ int open_flags = O_CREAT | O_RDWR | O_NOFOLLOW | ++ O_LARGEFILE | O_EXCL; + + if (cprm.limit < binfmt->min_coredump) + goto fail_unlock; +@@ -665,10 +670,27 @@ void do_coredump(const siginfo_t *siginfo) + * what matters is that at least one of the two processes + * writes its coredump successfully, not which one. + */ +- cprm.file = filp_open(cn.corename, +- O_CREAT | 2 | O_NOFOLLOW | +- O_LARGEFILE | O_EXCL, +- 0600); ++ if (need_suid_safe) { ++ /* ++ * Using user namespaces, normal user tasks can change ++ * their current->fs->root to point to arbitrary ++ * directories. Since the intention of the "only dump ++ * with a fully qualified path" rule is to control where ++ * coredumps may be placed using root privileges, ++ * current->fs->root must not be used. Instead, use the ++ * root directory of init_task. ++ */ ++ struct path root; ++ ++ task_lock(&init_task); ++ get_fs_root(init_task.fs, &root); ++ task_unlock(&init_task); ++ cprm.file = file_open_root(root.dentry, root.mnt, ++ cn.corename, open_flags, 0600); ++ path_put(&root); ++ } else { ++ cprm.file = filp_open(cn.corename, open_flags, 0600); ++ } + if (IS_ERR(cprm.file)) + goto fail_unlock; + +diff --git a/fs/fhandle.c b/fs/fhandle.c +index d59712d..ca3c3dd 100644 +--- a/fs/fhandle.c ++++ b/fs/fhandle.c +@@ -228,7 +228,7 @@ long do_handle_open(int mountdirfd, + path_put(&path); + return fd; + } +- file = file_open_root(path.dentry, path.mnt, "", open_flag); ++ file = file_open_root(path.dentry, path.mnt, "", open_flag, 0); + if (IS_ERR(file)) { + put_unused_fd(fd); + retval = PTR_ERR(file); +diff --git a/fs/open.c b/fs/open.c +index e6bf602..65f7056 100644 +--- a/fs/open.c ++++ b/fs/open.c +@@ -998,14 +998,12 @@ struct file *filp_open(const char *filename, int flags, umode_t mode) + EXPORT_SYMBOL(filp_open); + + struct file *file_open_root(struct dentry *dentry, struct vfsmount *mnt, +- const char *filename, int flags) ++ const char *filename, int flags, umode_t mode) + { + struct open_flags op; +- int err = build_open_flags(flags, 0, &op); ++ int err = build_open_flags(flags, mode, &op); + if (err) + return ERR_PTR(err); +- if (flags & O_CREAT) +- return ERR_PTR(-EINVAL); + return do_file_open_root(dentry, mnt, filename, &op); + } + EXPORT_SYMBOL(file_open_root); +diff --git a/include/linux/fs.h b/include/linux/fs.h +index 3aa5142..22c5a0c 100644 +--- a/include/linux/fs.h ++++ b/include/linux/fs.h +@@ -2217,7 +2217,7 @@ extern long do_sys_open(int dfd, const char __user *filename, int flags, + extern struct file *file_open_name(struct filename *, int, umode_t); + extern struct file *filp_open(const char *, int, umode_t); + extern struct file *file_open_root(struct dentry *, struct vfsmount *, +- const char *, int); ++ const char *, int, umode_t); + extern struct file * dentry_open(const struct path *, int, const struct cred *); + extern int filp_close(struct file *, fl_owner_t id); + +diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c +index 7e7746a..10a1d7d 100644 +--- a/kernel/sysctl_binary.c ++++ b/kernel/sysctl_binary.c +@@ -1321,7 +1321,7 @@ static ssize_t binary_sysctl(const int *name, int nlen, + } + + mnt = task_active_pid_ns(current)->proc_mnt; +- file = file_open_root(mnt->mnt_root, mnt, pathname, flags); ++ file = file_open_root(mnt->mnt_root, mnt, pathname, flags, 0); + result = PTR_ERR(file); + if (IS_ERR(file)) + goto out_putname; +-- +2.7.1 + + +From 1f425bddcc6ff4d2204bf5923de43d5d321203df Mon Sep 17 00:00:00 2001 +From: Aurelien Jacquiot +Date: Tue, 22 Mar 2016 14:25:42 -0700 +Subject: [PATCH 164/384] rapidio/rionet: fix deadlock on SMP + +commit 36915976eca58f2eefa040ba8f9939672564df61 upstream. + +Fix deadlocking during concurrent receive and transmit operations on SMP +platforms caused by the use of incorrect lock: on transmit 'tx_lock' +spinlock should be used instead of 'lock' which is used for receive +operation. + +This fix is applicable to kernel versions starting from v2.15. + +Signed-off-by: Aurelien Jacquiot +Signed-off-by: Alexandre Bounine +Cc: Matt Porter +Cc: Andre van Herk +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/rionet.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c +index aed2659..2e4ee0f 100644 +--- a/drivers/net/rionet.c ++++ b/drivers/net/rionet.c +@@ -276,7 +276,7 @@ static void rionet_outb_msg_event(struct rio_mport *mport, void *dev_id, int mbo + struct net_device *ndev = dev_id; + struct rionet_private *rnet = netdev_priv(ndev); + +- spin_lock(&rnet->lock); ++ spin_lock(&rnet->tx_lock); + + if (netif_msg_intr(rnet)) + printk(KERN_INFO +@@ -295,7 +295,7 @@ static void rionet_outb_msg_event(struct rio_mport *mport, void *dev_id, int mbo + if (rnet->tx_cnt < RIONET_TX_RING_SIZE) + netif_wake_queue(ndev); + +- spin_unlock(&rnet->lock); ++ spin_unlock(&rnet->tx_lock); + } + + static int rionet_open(struct net_device *ndev) +-- +2.7.1 + + +From 0c65f36c98e731055a44c48d3ca38085db69ddc0 Mon Sep 17 00:00:00 2001 +From: Insu Yun +Date: Wed, 6 Jan 2016 12:44:01 -0500 +Subject: [PATCH 165/384] ipr: Fix out-of-bounds null overwrite + +commit d63c7dd5bcb9441af0526d370c43a65ca2c980d9 upstream. + +Return value of snprintf is not bound by size value, 2nd argument. +(https://www.kernel.org/doc/htmldocs/kernel-api/API-snprintf.html). +Return value is number of printed chars, can be larger than 2nd +argument. Therefore, it can write null byte out of bounds ofbuffer. +Since snprintf puts null, it does not need to put additional null byte. + +Signed-off-by: Insu Yun +Reviewed-by: Shane Seymour +Signed-off-by: Martin K. Petersen +Cc: Ben Hutchings +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/ipr.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c +index 536cd5a..1c3759b 100644 +--- a/drivers/scsi/ipr.c ++++ b/drivers/scsi/ipr.c +@@ -4003,13 +4003,12 @@ static ssize_t ipr_store_update_fw(struct device *dev, + struct ipr_sglist *sglist; + char fname[100]; + char *src; +- int len, result, dnld_size; ++ int result, dnld_size; + + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; + +- len = snprintf(fname, 99, "%s", buf); +- fname[len-1] = '\0'; ++ snprintf(fname, sizeof(fname), "%s", buf); + + if (request_firmware(&fw_entry, fname, &ioa_cfg->pdev->dev)) { + dev_err(&ioa_cfg->pdev->dev, "Firmware file %s not found\n", fname); +-- +2.7.1 + + +From d1702b21daaf76d9b8faabb4862481d1f3d11e83 Mon Sep 17 00:00:00 2001 +From: Gabriel Krisman Bertazi +Date: Thu, 25 Feb 2016 13:54:20 -0300 +Subject: [PATCH 166/384] ipr: Fix regression when loading firmware + +commit 21b81716c6bff24cda52dc75588455f879ddbfe9 upstream. + +Commit d63c7dd5bcb9 ("ipr: Fix out-of-bounds null overwrite") removed +the end of line handling when storing the update_fw sysfs attribute. +This changed the userpace API because it started refusing writes +terminated by a line feed, which broke the update tools we already have. + +This patch re-adds that handling, so both a write terminated by a line +feed or not can make it through with the update. + +Fixes: d63c7dd5bcb9 ("ipr: Fix out-of-bounds null overwrite") +Signed-off-by: Gabriel Krisman Bertazi +Cc: Insu Yun +Acked-by: Brian King +Signed-off-by: Martin K. Petersen +Cc: Ben Hutchings +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/ipr.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c +index 1c3759b..43ac626 100644 +--- a/drivers/scsi/ipr.c ++++ b/drivers/scsi/ipr.c +@@ -4003,6 +4003,7 @@ static ssize_t ipr_store_update_fw(struct device *dev, + struct ipr_sglist *sglist; + char fname[100]; + char *src; ++ char *endline; + int result, dnld_size; + + if (!capable(CAP_SYS_ADMIN)) +@@ -4010,6 +4011,10 @@ static ssize_t ipr_store_update_fw(struct device *dev, + + snprintf(fname, sizeof(fname), "%s", buf); + ++ endline = strchr(fname, '\n'); ++ if (endline) ++ *endline = '\0'; ++ + if (request_firmware(&fw_entry, fname, &ioa_cfg->pdev->dev)) { + dev_err(&ioa_cfg->pdev->dev, "Firmware file %s not found\n", fname); + return -EIO; +-- +2.7.1 + + +From 0b7e4c961f220e044c10917cdd4373259aa13839 Mon Sep 17 00:00:00 2001 +From: Matti Gottlieb +Date: Sun, 14 Feb 2016 17:05:39 +0200 +Subject: [PATCH 167/384] iwlwifi: mvm: Fix paging memory leak + +commit 905e36ae172c83a30894a3adefab7d4f850fcf54 upstream. + +If the opmode is stopped and started again we did not free +the paging buffers. Fix that. +In addition when freeing the firmware's paging download +buffer, set the pointer to NULL. + +Signed-off-by: Matti Gottlieb +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireless/iwlwifi/mvm/fw.c | 4 +++- + drivers/net/wireless/iwlwifi/mvm/mvm.h | 3 +++ + drivers/net/wireless/iwlwifi/mvm/ops.c | 2 ++ + 3 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/iwlwifi/mvm/fw.c b/drivers/net/wireless/iwlwifi/mvm/fw.c +index d906fa1..610c442 100644 +--- a/drivers/net/wireless/iwlwifi/mvm/fw.c ++++ b/drivers/net/wireless/iwlwifi/mvm/fw.c +@@ -106,7 +106,7 @@ static int iwl_send_tx_ant_cfg(struct iwl_mvm *mvm, u8 valid_tx_ant) + sizeof(tx_ant_cmd), &tx_ant_cmd); + } + +-static void iwl_free_fw_paging(struct iwl_mvm *mvm) ++void iwl_free_fw_paging(struct iwl_mvm *mvm) + { + int i; + +@@ -126,6 +126,8 @@ static void iwl_free_fw_paging(struct iwl_mvm *mvm) + get_order(mvm->fw_paging_db[i].fw_paging_size)); + } + kfree(mvm->trans->paging_download_buf); ++ mvm->trans->paging_download_buf = NULL; ++ + memset(mvm->fw_paging_db, 0, sizeof(mvm->fw_paging_db)); + } + +diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h +index 4bde2d0..244e26c 100644 +--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h ++++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h +@@ -1190,6 +1190,9 @@ void iwl_mvm_rx_umac_scan_complete_notif(struct iwl_mvm *mvm, + void iwl_mvm_rx_umac_scan_iter_complete_notif(struct iwl_mvm *mvm, + struct iwl_rx_cmd_buffer *rxb); + ++/* Paging */ ++void iwl_free_fw_paging(struct iwl_mvm *mvm); ++ + /* MVM debugfs */ + #ifdef CONFIG_IWLWIFI_DEBUGFS + int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir); +diff --git a/drivers/net/wireless/iwlwifi/mvm/ops.c b/drivers/net/wireless/iwlwifi/mvm/ops.c +index 13c97f6..c3adf2b 100644 +--- a/drivers/net/wireless/iwlwifi/mvm/ops.c ++++ b/drivers/net/wireless/iwlwifi/mvm/ops.c +@@ -645,6 +645,8 @@ static void iwl_op_mode_mvm_stop(struct iwl_op_mode *op_mode) + for (i = 0; i < NVM_MAX_NUM_SECTIONS; i++) + kfree(mvm->nvm_sections[i].data); + ++ iwl_free_fw_paging(mvm); ++ + iwl_mvm_tof_clean(mvm); + + ieee80211_free_hw(mvm->hw); +-- +2.7.1 + + +From c80776f4c29e6df42dc69e04f19e0edc75c49085 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Wed, 2 Mar 2016 11:47:29 -0500 +Subject: [PATCH 168/384] drm/radeon: disable runtime pm on PX laptops without + dGPU power control +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit e64c952efb8e0c15ae82cec8e455ab4910690ef1 upstream. + +Some PX laptops don't provide an ACPI method to control dGPU power. On +those systems, the driver is responsible for handling the dGPU power +state. Disable runtime PM on them until support for this is implemented. + +Reviewed-by: Michel Dänzer +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/radeon/radeon_atpx_handler.c | 8 ++++---- + drivers/gpu/drm/radeon/radeon_device.c | 8 +++++++- + 2 files changed, 11 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c +index c4b4f29..9bc408c 100644 +--- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c ++++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c +@@ -62,6 +62,10 @@ bool radeon_has_atpx(void) { + return radeon_atpx_priv.atpx_detected; + } + ++bool radeon_has_atpx_dgpu_power_cntl(void) { ++ return radeon_atpx_priv.atpx.functions.power_cntl; ++} ++ + /** + * radeon_atpx_call - call an ATPX method + * +@@ -141,10 +145,6 @@ static void radeon_atpx_parse_functions(struct radeon_atpx_functions *f, u32 mas + */ + static int radeon_atpx_validate(struct radeon_atpx *atpx) + { +- /* make sure required functions are enabled */ +- /* dGPU power control is required */ +- atpx->functions.power_cntl = true; +- + if (atpx->functions.px_params) { + union acpi_object *info; + struct atpx_px_params output; +diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c +index c566993..f78f111 100644 +--- a/drivers/gpu/drm/radeon/radeon_device.c ++++ b/drivers/gpu/drm/radeon/radeon_device.c +@@ -103,6 +103,12 @@ static const char radeon_family_name[][16] = { + "LAST", + }; + ++#if defined(CONFIG_VGA_SWITCHEROO) ++bool radeon_has_atpx_dgpu_power_cntl(void); ++#else ++static inline bool radeon_has_atpx_dgpu_power_cntl(void) { return false; } ++#endif ++ + #define RADEON_PX_QUIRK_DISABLE_PX (1 << 0) + #define RADEON_PX_QUIRK_LONG_WAKEUP (1 << 1) + +@@ -1433,7 +1439,7 @@ int radeon_device_init(struct radeon_device *rdev, + * ignore it */ + vga_client_register(rdev->pdev, rdev, NULL, radeon_vga_set_decode); + +- if (rdev->flags & RADEON_IS_PX) ++ if ((rdev->flags & RADEON_IS_PX) && radeon_has_atpx_dgpu_power_cntl()) + runtime = true; + vga_switcheroo_register_client(rdev->pdev, &radeon_switcheroo_ops, runtime); + if (runtime) +-- +2.7.1 + + +From 5e2bc5e869f261302492b4d95a707a78c3e7ede6 Mon Sep 17 00:00:00 2001 +From: Mario Kleiner +Date: Sun, 6 Mar 2016 02:39:53 +0100 +Subject: [PATCH 169/384] drm/radeon: Don't drop DP 2.7 Ghz link setup on some + cards. + +commit 459ee1c3fd097ab56ababd8ff4bb7ef6a792de33 upstream. + +As observed on Apple iMac10,1, DCE-3.2, RV-730, +link rate of 2.7 Ghz is not selected, because +the args.v1.ucConfig flag setting for 2.7 Ghz +gets overwritten by a following assignment of +the transmitter to use. + +Move link rate setup a few lines down to fix this. +In practice this didn't have any positive or +negative effect on display setup on the tested +iMac10,1 so i don't know if backporting to stable +makes sense or not. + +Signed-off-by: Mario Kleiner +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/radeon/atombios_encoders.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c +index bb29214..adf74f4 100644 +--- a/drivers/gpu/drm/radeon/atombios_encoders.c ++++ b/drivers/gpu/drm/radeon/atombios_encoders.c +@@ -892,8 +892,6 @@ atombios_dig_encoder_setup2(struct drm_encoder *encoder, int action, int panel_m + else + args.v1.ucLaneNum = 4; + +- if (ENCODER_MODE_IS_DP(args.v1.ucEncoderMode) && (dp_clock == 270000)) +- args.v1.ucConfig |= ATOM_ENCODER_CONFIG_DPLINKRATE_2_70GHZ; + switch (radeon_encoder->encoder_id) { + case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: + args.v1.ucConfig = ATOM_ENCODER_CONFIG_V2_TRANSMITTER1; +@@ -910,6 +908,10 @@ atombios_dig_encoder_setup2(struct drm_encoder *encoder, int action, int panel_m + args.v1.ucConfig |= ATOM_ENCODER_CONFIG_LINKB; + else + args.v1.ucConfig |= ATOM_ENCODER_CONFIG_LINKA; ++ ++ if (ENCODER_MODE_IS_DP(args.v1.ucEncoderMode) && (dp_clock == 270000)) ++ args.v1.ucConfig |= ATOM_ENCODER_CONFIG_DPLINKRATE_2_70GHZ; ++ + break; + case 2: + case 3: +-- +2.7.1 + + +From 021d9ae8b8696fbc4f9656316903cb954b15222c Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Wed, 2 Mar 2016 12:10:20 -0500 +Subject: [PATCH 170/384] drm/amdgpu: disable runtime pm on PX laptops without + dGPU power control +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit bedf2a65c1aa8fb29ba8527fd00c0f68ec1f55f1 upstream. + +Some PX laptops don't provide an ACPI method to control dGPU power. On +those systems, the driver is responsible for handling the dGPU power +state. Disable runtime PM on them until support for this is implemented. + +Reviewed-by: Michel Dänzer +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 8 ++++---- + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 +++++++- + 2 files changed, 11 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +index 5a8fbad..8ac4981 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +@@ -63,6 +63,10 @@ bool amdgpu_has_atpx(void) { + return amdgpu_atpx_priv.atpx_detected; + } + ++bool amdgpu_has_atpx_dgpu_power_cntl(void) { ++ return amdgpu_atpx_priv.atpx.functions.power_cntl; ++} ++ + /** + * amdgpu_atpx_call - call an ATPX method + * +@@ -142,10 +146,6 @@ static void amdgpu_atpx_parse_functions(struct amdgpu_atpx_functions *f, u32 mas + */ + static int amdgpu_atpx_validate(struct amdgpu_atpx *atpx) + { +- /* make sure required functions are enabled */ +- /* dGPU power control is required */ +- atpx->functions.power_cntl = true; +- + if (atpx->functions.px_params) { + union acpi_object *info; + struct atpx_px_params output; +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +index c961fe0..9d88023 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +@@ -61,6 +61,12 @@ static const char *amdgpu_asic_name[] = { + "LAST", + }; + ++#if defined(CONFIG_VGA_SWITCHEROO) ++bool amdgpu_has_atpx_dgpu_power_cntl(void); ++#else ++static inline bool amdgpu_has_atpx_dgpu_power_cntl(void) { return false; } ++#endif ++ + bool amdgpu_device_is_px(struct drm_device *dev) + { + struct amdgpu_device *adev = dev->dev_private; +@@ -1469,7 +1475,7 @@ int amdgpu_device_init(struct amdgpu_device *adev, + + if (amdgpu_runtime_pm == 1) + runtime = true; +- if (amdgpu_device_is_px(ddev)) ++ if (amdgpu_device_is_px(ddev) && amdgpu_has_atpx_dgpu_power_cntl()) + runtime = true; + vga_switcheroo_register_client(adev->pdev, &amdgpu_switcheroo_ops, runtime); + if (runtime) +-- +2.7.1 + + +From 04c58c8d4af7aa26aaf5fc2f6cef3d17e89e885f Mon Sep 17 00:00:00 2001 +From: Ken Wang +Date: Thu, 17 Mar 2016 17:26:57 +0800 +Subject: [PATCH 171/384] drm/amdgpu: include the right version of gmc header + files for iceland + +commit 16a8a49be1b878ef6dd5d1663d456e254e54ae3d upstream. + +Signed-off-by: Ken Wang +Reviewed-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c +index 2cf5018..b1c7a9b 100644 +--- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c ++++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c +@@ -32,8 +32,8 @@ + #include "oss/oss_2_4_d.h" + #include "oss/oss_2_4_sh_mask.h" + +-#include "gmc/gmc_8_1_d.h" +-#include "gmc/gmc_8_1_sh_mask.h" ++#include "gmc/gmc_7_1_d.h" ++#include "gmc/gmc_7_1_sh_mask.h" + + #include "gca/gfx_8_0_d.h" + #include "gca/gfx_8_0_enum.h" +-- +2.7.1 + + +From 6738a1d67e98ddfc2241778bcec3c70cbf322651 Mon Sep 17 00:00:00 2001 +From: Alex Estrin +Date: Thu, 11 Feb 2016 16:30:51 -0500 +Subject: [PATCH 172/384] IB/ipoib: fix for rare multicast join race condition + +commit 08bc327629cbd63bb2f66677e4b33b643695097c upstream. + +A narrow window for race condition still exist between +multicast join thread and *dev_flush workers. +A kernel crash caused by prolong erratic link state changes +was observed (most likely a faulty cabling): + +[167275.656270] BUG: unable to handle kernel NULL pointer dereference at +0000000000000020 +[167275.665973] IP: [] ipoib_mcast_join+0xae/0x1d0 [ib_ipoib] +[167275.674443] PGD 0 +[167275.677373] Oops: 0000 [#1] SMP +... +[167275.977530] Call Trace: +[167275.982225] [] ? ipoib_mcast_free+0x200/0x200 [ib_ipoib] +[167275.992024] [] ipoib_mcast_join_task+0x2a7/0x490 +[ib_ipoib] +[167276.002149] [] process_one_work+0x17b/0x470 +[167276.010754] [] worker_thread+0x11b/0x400 +[167276.019088] [] ? rescuer_thread+0x400/0x400 +[167276.027737] [] kthread+0xcf/0xe0 +Here was a hit spot: +ipoib_mcast_join() { +.............. + rec.qkey = priv->broadcast->mcmember.qkey; + ^^^^^^^ +..... + } +Proposed patch should prevent multicast join task to continue +if link state change is detected. + +Signed-off-by: Alex Estrin +Changes from v4: +- as suggested by Doug Ledford, optimized spinlock usage, +i.e. ipoib_mcast_join() is called with lock held. +Changes from v3: +- sync with priv->lock before flag check. +Chages from v2: +- Move check for OPER_UP flag state to mcast_join() to +ensure no event worker is in progress. +- minor style fixes. +Changes from v1: +- No need to lock again if error detected. +Signed-off-by: Doug Ledford +Cc: Nikolay Borisov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 24 +++++++++++++++++------- + 1 file changed, 17 insertions(+), 7 deletions(-) + +diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +index 6dcef67..66cdd37 100644 +--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c ++++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +@@ -456,7 +456,10 @@ out_locked: + return status; + } + +-static void ipoib_mcast_join(struct net_device *dev, struct ipoib_mcast *mcast) ++/* ++ * Caller must hold 'priv->lock' ++ */ ++static int ipoib_mcast_join(struct net_device *dev, struct ipoib_mcast *mcast) + { + struct ipoib_dev_priv *priv = netdev_priv(dev); + struct ib_sa_multicast *multicast; +@@ -466,6 +469,10 @@ static void ipoib_mcast_join(struct net_device *dev, struct ipoib_mcast *mcast) + ib_sa_comp_mask comp_mask; + int ret = 0; + ++ if (!priv->broadcast || ++ !test_bit(IPOIB_FLAG_OPER_UP, &priv->flags)) ++ return -EINVAL; ++ + ipoib_dbg_mcast(priv, "joining MGID %pI6\n", mcast->mcmember.mgid.raw); + + rec.mgid = mcast->mcmember.mgid; +@@ -525,20 +532,23 @@ static void ipoib_mcast_join(struct net_device *dev, struct ipoib_mcast *mcast) + rec.join_state = 4; + #endif + } ++ spin_unlock_irq(&priv->lock); + + multicast = ib_sa_join_multicast(&ipoib_sa_client, priv->ca, priv->port, + &rec, comp_mask, GFP_KERNEL, + ipoib_mcast_join_complete, mcast); ++ spin_lock_irq(&priv->lock); + if (IS_ERR(multicast)) { + ret = PTR_ERR(multicast); + ipoib_warn(priv, "ib_sa_join_multicast failed, status %d\n", ret); +- spin_lock_irq(&priv->lock); + /* Requeue this join task with a backoff delay */ + __ipoib_mcast_schedule_join_thread(priv, mcast, 1); + clear_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags); + spin_unlock_irq(&priv->lock); + complete(&mcast->done); ++ spin_lock_irq(&priv->lock); + } ++ return 0; + } + + void ipoib_mcast_join_task(struct work_struct *work) +@@ -620,9 +630,10 @@ void ipoib_mcast_join_task(struct work_struct *work) + /* Found the next unjoined group */ + init_completion(&mcast->done); + set_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags); +- spin_unlock_irq(&priv->lock); +- ipoib_mcast_join(dev, mcast); +- spin_lock_irq(&priv->lock); ++ if (ipoib_mcast_join(dev, mcast)) { ++ spin_unlock_irq(&priv->lock); ++ return; ++ } + } else if (!delay_until || + time_before(mcast->delay_until, delay_until)) + delay_until = mcast->delay_until; +@@ -641,10 +652,9 @@ out: + if (mcast) { + init_completion(&mcast->done); + set_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags); ++ ipoib_mcast_join(dev, mcast); + } + spin_unlock_irq(&priv->lock); +- if (mcast) +- ipoib_mcast_join(dev, mcast); + } + + int ipoib_mcast_start_thread(struct net_device *dev) +-- +2.7.1 + + +From f4d5734b5b8921a7ae57786a4f6eb5510e3b24f7 Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (Red Hat)" +Date: Fri, 18 Mar 2016 12:27:43 -0400 +Subject: [PATCH 173/384] tracing: Have preempt(irqs)off trace preempt disabled + functions + +commit cb86e05390debcc084cfdb0a71ed4c5dbbec517d upstream. + +Joel Fernandes reported that the function tracing of preempt disabled +sections was not being reported when running either the preemptirqsoff or +preemptoff tracers. This was due to the fact that the function tracer +callback for those tracers checked if irqs were disabled before tracing. But +this fails when we want to trace preempt off locations as well. + +Joel explained that he wanted to see funcitons where interrupts are enabled +but preemption was disabled. The expected output he wanted: + + <...>-2265 1d.h1 3419us : preempt_count_sub <-irq_exit + <...>-2265 1d..1 3419us : __do_softirq <-irq_exit + <...>-2265 1d..1 3419us : msecs_to_jiffies <-__do_softirq + <...>-2265 1d..1 3420us : irqtime_account_irq <-__do_softirq + <...>-2265 1d..1 3420us : __local_bh_disable_ip <-__do_softirq + <...>-2265 1..s1 3421us : run_timer_softirq <-__do_softirq + <...>-2265 1..s1 3421us : hrtimer_run_pending <-run_timer_softirq + <...>-2265 1..s1 3421us : _raw_spin_lock_irq <-run_timer_softirq + <...>-2265 1d.s1 3422us : preempt_count_add <-_raw_spin_lock_irq + <...>-2265 1d.s2 3422us : _raw_spin_unlock_irq <-run_timer_softirq + <...>-2265 1..s2 3422us : preempt_count_sub <-_raw_spin_unlock_irq + <...>-2265 1..s1 3423us : rcu_bh_qs <-__do_softirq + <...>-2265 1d.s1 3423us : irqtime_account_irq <-__do_softirq + <...>-2265 1d.s1 3423us : __local_bh_enable <-__do_softirq + +There's a comment saying that the irq disabled check is because there's a +possible race that tracing_cpu may be set when the function is executed. But +I don't remember that race. For now, I added a check for preemption being +enabled too to not record the function, as there would be no race if that +was the case. I need to re-investigate this, as I'm now thinking that the +tracing_cpu will always be correct. But no harm in keeping the check for +now, except for the slight performance hit. + +Link: http://lkml.kernel.org/r/1457770386-88717-1-git-send-email-agnel.joel@gmail.com + +Fixes: 5e6d2b9cfa3a "tracing: Use one prologue for the preempt irqs off tracer function tracers" +Reported-by: Joel Fernandes +Signed-off-by: Steven Rostedt +Signed-off-by: Greg Kroah-Hartman +--- + kernel/trace/trace_irqsoff.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c +index 069942c..553e712 100644 +--- a/kernel/trace/trace_irqsoff.c ++++ b/kernel/trace/trace_irqsoff.c +@@ -110,8 +110,12 @@ static int func_prolog_dec(struct trace_array *tr, + return 0; + + local_save_flags(*flags); +- /* slight chance to get a false positive on tracing_cpu */ +- if (!irqs_disabled_flags(*flags)) ++ /* ++ * Slight chance to get a false positive on tracing_cpu, ++ * although I'm starting to think there isn't a chance. ++ * Leave this for now just to be paranoid. ++ */ ++ if (!irqs_disabled_flags(*flags) && !preempt_count()) + return 0; + + *data = per_cpu_ptr(tr->trace_buffer.data, cpu); +-- +2.7.1 + + +From 84e5870697768f3d8d90218e0713081f08ce77aa Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (Red Hat)" +Date: Fri, 18 Mar 2016 15:46:48 -0400 +Subject: [PATCH 174/384] tracing: Fix crash from reading trace_pipe with + sendfile + +commit a29054d9478d0435ab01b7544da4f674ab13f533 upstream. + +If tracing contains data and the trace_pipe file is read with sendfile(), +then it can trigger a NULL pointer dereference and various BUG_ON within the +VM code. + +There's a patch to fix this in the splice_to_pipe() code, but it's also a +good idea to not let that happen from trace_pipe either. + +Link: http://lkml.kernel.org/r/1457641146-9068-1-git-send-email-rabin@rab.in + +Reported-by: Rabin Vincent +Signed-off-by: Steven Rostedt +Signed-off-by: Greg Kroah-Hartman +--- + kernel/trace/trace.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index f1ee84b..8b0ae7d 100644 +--- a/kernel/trace/trace.c ++++ b/kernel/trace/trace.c +@@ -4959,7 +4959,10 @@ static ssize_t tracing_splice_read_pipe(struct file *filp, + + spd.nr_pages = i; + +- ret = splice_to_pipe(pipe, &spd); ++ if (i) ++ ret = splice_to_pipe(pipe, &spd); ++ else ++ ret = 0; + out: + splice_shrink_spd(&spd); + return ret; +-- +2.7.1 + + +From 42dffde1a83bc7f0001883d10ea30ac3d873a126 Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (Red Hat)" +Date: Tue, 22 Mar 2016 17:30:58 -0400 +Subject: [PATCH 175/384] tracing: Fix trace_printk() to print when not using + bprintk() + +commit 3debb0a9ddb16526de8b456491b7db60114f7b5e upstream. + +The trace_printk() code will allocate extra buffers if the compile detects +that a trace_printk() is used. To do this, the format of the trace_printk() +is saved to the __trace_printk_fmt section, and if that section is bigger +than zero, the buffers are allocated (along with a message that this has +happened). + +If trace_printk() uses a format that is not a constant, and thus something +not guaranteed to be around when the print happens, the compiler optimizes +the fmt out, as it is not used, and the __trace_printk_fmt section is not +filled. This means the kernel will not allocate the special buffers needed +for the trace_printk() and the trace_printk() will not write anything to the +tracing buffer. + +Adding a "__used" to the variable in the __trace_printk_fmt section will +keep it around, even though it is set to NULL. This will keep the string +from being printed in the debugfs/tracing/printk_formats section as it is +not needed. + +Reported-by: Vlastimil Babka +Fixes: 07d777fe8c398 "tracing: Add percpu buffers for trace_printk()" +Signed-off-by: Steven Rostedt +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/kernel.h | 6 +++--- + kernel/trace/trace_printk.c | 3 +++ + 2 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/include/linux/kernel.h b/include/linux/kernel.h +index 2370991..c44e33a 100644 +--- a/include/linux/kernel.h ++++ b/include/linux/kernel.h +@@ -612,7 +612,7 @@ do { \ + + #define do_trace_printk(fmt, args...) \ + do { \ +- static const char *trace_printk_fmt \ ++ static const char *trace_printk_fmt __used \ + __attribute__((section("__trace_printk_fmt"))) = \ + __builtin_constant_p(fmt) ? fmt : NULL; \ + \ +@@ -656,7 +656,7 @@ int __trace_printk(unsigned long ip, const char *fmt, ...); + */ + + #define trace_puts(str) ({ \ +- static const char *trace_printk_fmt \ ++ static const char *trace_printk_fmt __used \ + __attribute__((section("__trace_printk_fmt"))) = \ + __builtin_constant_p(str) ? str : NULL; \ + \ +@@ -678,7 +678,7 @@ extern void trace_dump_stack(int skip); + #define ftrace_vprintk(fmt, vargs) \ + do { \ + if (__builtin_constant_p(fmt)) { \ +- static const char *trace_printk_fmt \ ++ static const char *trace_printk_fmt __used \ + __attribute__((section("__trace_printk_fmt"))) = \ + __builtin_constant_p(fmt) ? fmt : NULL; \ + \ +diff --git a/kernel/trace/trace_printk.c b/kernel/trace/trace_printk.c +index 060df67..f96f038 100644 +--- a/kernel/trace/trace_printk.c ++++ b/kernel/trace/trace_printk.c +@@ -296,6 +296,9 @@ static int t_show(struct seq_file *m, void *v) + const char *str = *fmt; + int i; + ++ if (!*fmt) ++ return 0; ++ + seq_printf(m, "0x%lx : \"", *(unsigned long *)fmt); + + /* +-- +2.7.1 + + +From f711b1d34c7b414e67adf80a17dda23c660f04fd Mon Sep 17 00:00:00 2001 +From: Peter Zijlstra +Date: Wed, 9 Mar 2016 12:40:54 +0100 +Subject: [PATCH 176/384] bitops: Do not default to __clear_bit() for + __clear_bit_unlock() + +commit f75d48644c56a31731d17fa693c8175328957e1d upstream. + +__clear_bit_unlock() is a special little snowflake. While it carries the +non-atomic '__' prefix, it is specifically documented to pair with +test_and_set_bit() and therefore should be 'somewhat' atomic. + +Therefore the generic implementation of __clear_bit_unlock() cannot use +the fully non-atomic __clear_bit() as a default. + +If an arch is able to do better; is must provide an implementation of +__clear_bit_unlock() itself. + +Specifically, this came up as a result of hackbench livelock'ing in +slab_lock() on ARC with SMP + SLUB + !LLSC. + +The issue was incorrect pairing of atomic ops. + + slab_lock() -> bit_spin_lock() -> test_and_set_bit() + slab_unlock() -> __bit_spin_unlock() -> __clear_bit() + +The non serializing __clear_bit() was getting "lost" + + 80543b8e: ld_s r2,[r13,0] <--- (A) Finds PG_locked is set + 80543b90: or r3,r2,1 <--- (B) other core unlocks right here + 80543b94: st_s r3,[r13,0] <--- (C) sets PG_locked (overwrites unlock) + +Fixes ARC STAR 9000817404 (and probably more). + +Reported-by: Vineet Gupta +Tested-by: Vineet Gupta +Signed-off-by: Peter Zijlstra (Intel) +Cc: Andrew Morton +Cc: Christoph Lameter +Cc: David Rientjes +Cc: Helge Deller +Cc: James E.J. Bottomley +Cc: Joonsoo Kim +Cc: Linus Torvalds +Cc: Noam Camus +Cc: Paul E. McKenney +Cc: Pekka Enberg +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Link: http://lkml.kernel.org/r/20160309114054.GJ6356@twins.programming.kicks-ass.net +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + include/asm-generic/bitops/lock.h | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/include/asm-generic/bitops/lock.h b/include/asm-generic/bitops/lock.h +index c30266e..8ef0ccb 100644 +--- a/include/asm-generic/bitops/lock.h ++++ b/include/asm-generic/bitops/lock.h +@@ -29,16 +29,16 @@ do { \ + * @nr: the bit to set + * @addr: the address to start counting from + * +- * This operation is like clear_bit_unlock, however it is not atomic. +- * It does provide release barrier semantics so it can be used to unlock +- * a bit lock, however it would only be used if no other CPU can modify +- * any bits in the memory until the lock is released (a good example is +- * if the bit lock itself protects access to the other bits in the word). ++ * A weaker form of clear_bit_unlock() as used by __bit_lock_unlock(). If all ++ * the bits in the word are protected by this lock some archs can use weaker ++ * ops to safely unlock. ++ * ++ * See for example x86's implementation. + */ + #define __clear_bit_unlock(nr, addr) \ + do { \ +- smp_mb(); \ +- __clear_bit(nr, addr); \ ++ smp_mb__before_atomic(); \ ++ clear_bit(nr, addr); \ + } while (0) + + #endif /* _ASM_GENERIC_BITOPS_LOCK_H_ */ +-- +2.7.1 + + +From d32be4ec138c71a59f10ba1996d964800893af83 Mon Sep 17 00:00:00 2001 +From: Julia Lawall +Date: Thu, 18 Feb 2016 00:16:14 +0100 +Subject: [PATCH 177/384] scripts/coccinelle: modernize & + +commit 1b669e713f277a4d4b3cec84e13d16544ac8286d upstream. + +& is no longer allowed in column 0, since Coccinelle 1.0.4. + +Signed-off-by: Julia Lawall +Tested-by: Nishanth Menon +Signed-off-by: Michal Marek +Signed-off-by: Greg Kroah-Hartman +--- + scripts/coccinelle/iterators/use_after_iter.cocci | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/coccinelle/iterators/use_after_iter.cocci b/scripts/coccinelle/iterators/use_after_iter.cocci +index f085f59..ce8cc9c 100644 +--- a/scripts/coccinelle/iterators/use_after_iter.cocci ++++ b/scripts/coccinelle/iterators/use_after_iter.cocci +@@ -123,7 +123,7 @@ list_remove_head(x,c,...) + | + sizeof(<+...c...+>) + | +-&c->member ++ &c->member + | + c = E + | +-- +2.7.1 + + +From 6c79c6e9a7a3d030a7715d1f4e1341a057bb52ad Mon Sep 17 00:00:00 2001 +From: Jan Beulich +Date: Mon, 25 Jan 2016 09:45:47 -0700 +Subject: [PATCH 178/384] scripts/kconfig: allow building with make 3.80 again + +commit 42f9d3c6888bceef6dc7ba72c77acf47347dcf05 upstream. + +Documentation/Changes still lists this as the minimal required version, +so it ought to remain usable for the time being. + +Fixes: d2036f30cf ("scripts/kconfig/Makefile: Allow KBUILD_DEFCONFIG to be a target") +Signed-off-by: Jan Beulich +Cc: Michael Ellerman +Signed-off-by: Michal Marek +Signed-off-by: Greg Kroah-Hartman +--- + scripts/kconfig/Makefile | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile +index d79cba4..ebced77 100644 +--- a/scripts/kconfig/Makefile ++++ b/scripts/kconfig/Makefile +@@ -96,13 +96,15 @@ savedefconfig: $(obj)/conf + defconfig: $(obj)/conf + ifeq ($(KBUILD_DEFCONFIG),) + $< $(silent) --defconfig $(Kconfig) +-else ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)),) ++else ++ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)),) + @$(kecho) "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" + $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) + else + @$(kecho) "*** Default configuration is based on target '$(KBUILD_DEFCONFIG)'" + $(Q)$(MAKE) -f $(srctree)/Makefile $(KBUILD_DEFCONFIG) + endif ++endif + + %_defconfig: $(obj)/conf + $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) +-- +2.7.1 + + +From 1e6d5a5481a2f53891116921ac840b2b630aa341 Mon Sep 17 00:00:00 2001 +From: Jiri Kosina +Date: Fri, 26 Feb 2016 16:15:17 +0100 +Subject: [PATCH 179/384] kbuild/mkspec: fix grub2 installkernel issue + +commit c8b08ca558c0067bc9e15ce3f1e70af260410bb2 upstream. + +mkspec is copying built kernel to temporrary location + + /boot/vmlinuz-$KERNELRELEASE-rpm + +and runs installkernel on it. This however directly leads to grub2 +menuentry for this suffixed binary being generated as well during the run +of installkernel script. + +Later in the process the temporary -rpm suffixed files are removed, and +therefore we end up with spurious (and non-functional) grub2 menu entries +for each installed kernel RPM. + +Fix that by using a different temporary name (prefixed by '.'), so that +the binary is not recognized as an actual kernel binary and no menuentry +is created for it. + +Signed-off-by: Jiri Kosina +Fixes: 3c9c7a14b627 ("rpm-pkg: add %post section to create initramfs and grub hooks") +Signed-off-by: Michal Marek +Signed-off-by: Greg Kroah-Hartman +--- + scripts/package/mkspec | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/scripts/package/mkspec b/scripts/package/mkspec +index 71004da..fe44d68 100755 +--- a/scripts/package/mkspec ++++ b/scripts/package/mkspec +@@ -131,11 +131,11 @@ echo 'rm -rf $RPM_BUILD_ROOT' + echo "" + echo "%post" + echo "if [ -x /sbin/installkernel -a -r /boot/vmlinuz-$KERNELRELEASE -a -r /boot/System.map-$KERNELRELEASE ]; then" +-echo "cp /boot/vmlinuz-$KERNELRELEASE /boot/vmlinuz-$KERNELRELEASE-rpm" +-echo "cp /boot/System.map-$KERNELRELEASE /boot/System.map-$KERNELRELEASE-rpm" ++echo "cp /boot/vmlinuz-$KERNELRELEASE /boot/.vmlinuz-$KERNELRELEASE-rpm" ++echo "cp /boot/System.map-$KERNELRELEASE /boot/.System.map-$KERNELRELEASE-rpm" + echo "rm -f /boot/vmlinuz-$KERNELRELEASE /boot/System.map-$KERNELRELEASE" +-echo "/sbin/installkernel $KERNELRELEASE /boot/vmlinuz-$KERNELRELEASE-rpm /boot/System.map-$KERNELRELEASE-rpm" +-echo "rm -f /boot/vmlinuz-$KERNELRELEASE-rpm /boot/System.map-$KERNELRELEASE-rpm" ++echo "/sbin/installkernel $KERNELRELEASE /boot/.vmlinuz-$KERNELRELEASE-rpm /boot/.System.map-$KERNELRELEASE-rpm" ++echo "rm -f /boot/.vmlinuz-$KERNELRELEASE-rpm /boot/.System.map-$KERNELRELEASE-rpm" + echo "fi" + echo "" + echo "%files" +-- +2.7.1 + + +From 7cbd0d8a029b15cccc5f9678d84cf4436b581e6f Mon Sep 17 00:00:00 2001 +From: Guenter Roeck +Date: Tue, 22 Mar 2016 15:11:03 -0700 +Subject: [PATCH 180/384] MAINTAINERS: Update mailing list and web page for + hwmon subsystem + +commit 968ce1b1f45a7d76b5471b19bd035dbecc72f32d upstream. + +The old web page for the hwmon subsystem is no longer operational, +and the mailing list has become unreliable. Move both to kernel.org. + +Reviewed-by: Jean Delvare +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman +--- + MAINTAINERS | 96 ++++++++++++++++++++++++++++++------------------------------- + 1 file changed, 48 insertions(+), 48 deletions(-) + +diff --git a/MAINTAINERS b/MAINTAINERS +index d826f1b..4c3e1d2 100644 +--- a/MAINTAINERS ++++ b/MAINTAINERS +@@ -230,13 +230,13 @@ F: kernel/sys_ni.c + + ABIT UGURU 1,2 HARDWARE MONITOR DRIVER + M: Hans de Goede +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: drivers/hwmon/abituguru.c + + ABIT UGURU 3 HARDWARE MONITOR DRIVER + M: Alistair John Strachan +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: drivers/hwmon/abituguru3.c + +@@ -373,14 +373,14 @@ S: Maintained + + ADM1025 HARDWARE MONITOR DRIVER + M: Jean Delvare +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/adm1025 + F: drivers/hwmon/adm1025.c + + ADM1029 HARDWARE MONITOR DRIVER + M: Corentin Labbe +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: drivers/hwmon/adm1029.c + +@@ -425,7 +425,7 @@ F: drivers/video/backlight/adp8860_bl.c + + ADS1015 HARDWARE MONITOR DRIVER + M: Dirk Eibach +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/ads1015 + F: drivers/hwmon/ads1015.c +@@ -438,7 +438,7 @@ F: drivers/macintosh/therm_adt746x.c + + ADT7475 HARDWARE MONITOR DRIVER + M: Jean Delvare +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/adt7475 + F: drivers/hwmon/adt7475.c +@@ -615,7 +615,7 @@ F: include/linux/ccp.h + + AMD FAM15H PROCESSOR POWER MONITORING DRIVER + M: Andreas Herrmann +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/fam15h_power + F: drivers/hwmon/fam15h_power.c +@@ -779,7 +779,7 @@ F: drivers/input/mouse/bcm5974.c + + APPLE SMC DRIVER + M: Henrik Rydberg +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Odd fixes + F: drivers/hwmon/applesmc.c + +@@ -1777,7 +1777,7 @@ F: include/media/as3645a.h + + ASC7621 HARDWARE MONITOR DRIVER + M: George Joseph +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/asc7621 + F: drivers/hwmon/asc7621.c +@@ -1864,7 +1864,7 @@ F: drivers/net/wireless/ath/carl9170/ + + ATK0110 HWMON DRIVER + M: Luca Tettamanti +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: drivers/hwmon/asus_atk0110.c + +@@ -2984,7 +2984,7 @@ F: mm/swap_cgroup.c + + CORETEMP HARDWARE MONITORING DRIVER + M: Fenghua Yu +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/coretemp + F: drivers/hwmon/coretemp.c +@@ -3549,7 +3549,7 @@ T: git git://git.infradead.org/users/vkoul/slave-dma.git + + DME1737 HARDWARE MONITOR DRIVER + M: Juerg Haefliger +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/dme1737 + F: drivers/hwmon/dme1737.c +@@ -4262,7 +4262,7 @@ F: include/video/exynos_mipi* + + F71805F HARDWARE MONITORING DRIVER + M: Jean Delvare +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/f71805f + F: drivers/hwmon/f71805f.c +@@ -4341,7 +4341,7 @@ F: fs/* + + FINTEK F75375S HARDWARE MONITOR AND FAN CONTROLLER DRIVER + M: Riku Voipio +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: drivers/hwmon/f75375s.c + F: include/linux/f75375s.h +@@ -4883,8 +4883,8 @@ F: drivers/media/usb/hackrf/ + HARDWARE MONITORING + M: Jean Delvare + M: Guenter Roeck +-L: lm-sensors@lm-sensors.org +-W: http://www.lm-sensors.org/ ++L: linux-hwmon@vger.kernel.org ++W: http://hwmon.wiki.kernel.org/ + T: quilt http://jdelvare.nerim.net/devel/linux/jdelvare-hwmon/ + T: git git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git + S: Maintained +@@ -5393,7 +5393,7 @@ F: drivers/usb/atm/ueagle-atm.c + + INA209 HARDWARE MONITOR DRIVER + M: Guenter Roeck +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/ina209 + F: Documentation/devicetree/bindings/i2c/ina209.txt +@@ -5401,7 +5401,7 @@ F: drivers/hwmon/ina209.c + + INA2XX HARDWARE MONITOR DRIVER + M: Guenter Roeck +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/ina2xx + F: drivers/hwmon/ina2xx.c +@@ -5884,7 +5884,7 @@ F: drivers/isdn/hardware/eicon/ + + IT87 HARDWARE MONITORING DRIVER + M: Jean Delvare +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/it87 + F: drivers/hwmon/it87.c +@@ -5920,7 +5920,7 @@ F: drivers/media/dvb-frontends/ix2505v* + + JC42.4 TEMPERATURE SENSOR DRIVER + M: Guenter Roeck +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: drivers/hwmon/jc42.c + F: Documentation/hwmon/jc42 +@@ -5970,14 +5970,14 @@ F: drivers/tty/serial/jsm/ + + K10TEMP HARDWARE MONITORING DRIVER + M: Clemens Ladisch +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/k10temp + F: drivers/hwmon/k10temp.c + + K8TEMP HARDWARE MONITORING DRIVER + M: Rudolf Marek +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/k8temp + F: drivers/hwmon/k8temp.c +@@ -6485,27 +6485,27 @@ F: net/llc/ + + LM73 HARDWARE MONITOR DRIVER + M: Guillaume Ligneul +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: drivers/hwmon/lm73.c + + LM78 HARDWARE MONITOR DRIVER + M: Jean Delvare +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/lm78 + F: drivers/hwmon/lm78.c + + LM83 HARDWARE MONITOR DRIVER + M: Jean Delvare +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/lm83 + F: drivers/hwmon/lm83.c + + LM90 HARDWARE MONITOR DRIVER + M: Jean Delvare +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/lm90 + F: Documentation/devicetree/bindings/hwmon/lm90.txt +@@ -6513,7 +6513,7 @@ F: drivers/hwmon/lm90.c + + LM95234 HARDWARE MONITOR DRIVER + M: Guenter Roeck +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/lm95234 + F: drivers/hwmon/lm95234.c +@@ -6580,7 +6580,7 @@ F: drivers/scsi/sym53c8xx_2/ + + LTC4261 HARDWARE MONITOR DRIVER + M: Guenter Roeck +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/ltc4261 + F: drivers/hwmon/ltc4261.c +@@ -6749,28 +6749,28 @@ F: include/uapi/linux/matroxfb.h + + MAX16065 HARDWARE MONITOR DRIVER + M: Guenter Roeck +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/max16065 + F: drivers/hwmon/max16065.c + + MAX20751 HARDWARE MONITOR DRIVER + M: Guenter Roeck +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/max20751 + F: drivers/hwmon/max20751.c + + MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER + M: "Hans J. Koch" +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/max6650 + F: drivers/hwmon/max6650.c + + MAX6697 HARDWARE MONITOR DRIVER + M: Guenter Roeck +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/max6697 + F: Documentation/devicetree/bindings/i2c/max6697.txt +@@ -7303,7 +7303,7 @@ F: drivers/scsi/NCR_D700.* + + NCT6775 HARDWARE MONITOR DRIVER + M: Guenter Roeck +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/nct6775 + F: drivers/hwmon/nct6775.c +@@ -8064,7 +8064,7 @@ F: drivers/video/logo/logo_parisc* + + PC87360 HARDWARE MONITORING DRIVER + M: Jim Cromie +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/pc87360 + F: drivers/hwmon/pc87360.c +@@ -8076,7 +8076,7 @@ F: drivers/char/pc8736x_gpio.c + + PC87427 HARDWARE MONITORING DRIVER + M: Jean Delvare +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/pc87427 + F: drivers/hwmon/pc87427.c +@@ -8415,8 +8415,8 @@ F: drivers/rtc/rtc-puv3.c + + PMBUS HARDWARE MONITORING DRIVERS + M: Guenter Roeck +-L: lm-sensors@lm-sensors.org +-W: http://www.lm-sensors.org/ ++L: linux-hwmon@vger.kernel.org ++W: http://hwmon.wiki.kernel.org/ + W: http://www.roeck-us.net/linux/drivers/ + T: git git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git + S: Maintained +@@ -8610,7 +8610,7 @@ F: drivers/media/usb/pwc/* + + PWM FAN DRIVER + M: Kamil Debski +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Supported + F: Documentation/devicetree/bindings/hwmon/pwm-fan.txt + F: Documentation/hwmon/pwm-fan +@@ -9882,28 +9882,28 @@ F: Documentation/devicetree/bindings/media/i2c/nokia,smia.txt + + SMM665 HARDWARE MONITOR DRIVER + M: Guenter Roeck +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/smm665 + F: drivers/hwmon/smm665.c + + SMSC EMC2103 HARDWARE MONITOR DRIVER + M: Steve Glendinning +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/emc2103 + F: drivers/hwmon/emc2103.c + + SMSC SCH5627 HARDWARE MONITOR DRIVER + M: Hans de Goede +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Supported + F: Documentation/hwmon/sch5627 + F: drivers/hwmon/sch5627.c + + SMSC47B397 HARDWARE MONITOR DRIVER + M: Jean Delvare +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/smsc47b397 + F: drivers/hwmon/smsc47b397.c +@@ -10830,7 +10830,7 @@ F: include/linux/mmc/sh_mobile_sdhi.h + + TMP401 HARDWARE MONITOR DRIVER + M: Guenter Roeck +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/tmp401 + F: drivers/hwmon/tmp401.c +@@ -11564,14 +11564,14 @@ F: Documentation/networking/vrf.txt + + VT1211 HARDWARE MONITOR DRIVER + M: Juerg Haefliger +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/vt1211 + F: drivers/hwmon/vt1211.c + + VT8231 HARDWARE MONITOR DRIVER + M: Roger Lucas +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: drivers/hwmon/vt8231.c + +@@ -11590,21 +11590,21 @@ F: drivers/w1/ + + W83791D HARDWARE MONITORING DRIVER + M: Marc Hulsman +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/w83791d + F: drivers/hwmon/w83791d.c + + W83793 HARDWARE MONITORING DRIVER + M: Rudolf Marek +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: Documentation/hwmon/w83793 + F: drivers/hwmon/w83793.c + + W83795 HARDWARE MONITORING DRIVER + M: Jean Delvare +-L: lm-sensors@lm-sensors.org ++L: linux-hwmon@vger.kernel.org + S: Maintained + F: drivers/hwmon/w83795.c + +-- +2.7.1 + + +From a00f53978f78bed15af61d9f5e5e211155cc7449 Mon Sep 17 00:00:00 2001 +From: John Dahlstrom +Date: Sat, 27 Feb 2016 00:09:58 -0600 +Subject: [PATCH 181/384] ideapad-laptop: Add ideapad Y700 (15) to the + no_hw_rfkill DMI list + +commit 4db9675d927a71faa66e5ab128d2390d6329750b upstream. + +Some Lenovo ideapad models lack a physical rfkill switch. +On Lenovo models ideapad Y700 Touch-15ISK and ideapad Y700-15ISK, +ideapad-laptop would wrongly report all radios as blocked by +hardware which caused wireless network connections to fail. + +Add these models without an rfkill switch to the no_hw_rfkill list. + +Signed-off-by: John Dahlstrom +Cc: # 3.17.x-: 4fa9dab: ideapad_laptop: Lenovo G50-30 fix rfkill reports wireless blocked +Signed-off-by: Darren Hart +Signed-off-by: Greg Kroah-Hartman +--- + drivers/platform/x86/ideapad-laptop.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c +index d78ee15..be3bc2f 100644 +--- a/drivers/platform/x86/ideapad-laptop.c ++++ b/drivers/platform/x86/ideapad-laptop.c +@@ -865,6 +865,20 @@ static const struct dmi_system_id no_hw_rfkill_list[] = { + }, + }, + { ++ .ident = "Lenovo ideapad Y700-15ISK", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad Y700-15ISK"), ++ }, ++ }, ++ { ++ .ident = "Lenovo ideapad Y700 Touch-15ISK", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad Y700 Touch-15ISK"), ++ }, ++ }, ++ { + .ident = "Lenovo ideapad Y700-17ISK", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +-- +2.7.1 + + +From 88506a365e56aa44450ddf636423c4477e5f7580 Mon Sep 17 00:00:00 2001 +From: Shawn Lin +Date: Wed, 16 Mar 2016 18:15:47 +0800 +Subject: [PATCH 182/384] mmc: block: fix ABI regression of mmc_blk_ioctl + +commit 83c742c344c08c2bbe338d45c6ec63110e9d5e3d upstream. + +If mmc_blk_ioctl returns -EINVAL, blkdev_ioctl continues to +work without returning err to user-space. But now we check +CAP_SYS_RAWIO firstly, so we return -EPERM to blkdev_ioctl, +which make blkdev_ioctl return -EPERM to user-space directly. +So this will break all the ioctl with BLKROSET. Now we find +Android-adb suffer it for the following log: + +remount of /system failed; +couldn't make block device writable: Operation not permitted +openat(AT_FDCWD, "/dev/block/platform/ff420000.dwmmc/by-name/system", O_RDONLY) = 3 +ioctl(3, BLKROSET, 0) = -1 EPERM (Operation not permitted) + +Fixes: a5f5774c55a2 ("mmc: block: Add new ioctl to send multi commands") +Signed-off-by: Shawn Lin +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/card/block.c | 24 ++++++++++++++++-------- + 1 file changed, 16 insertions(+), 8 deletions(-) + +diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c +index 52c6346..e68b27d 100644 +--- a/drivers/mmc/card/block.c ++++ b/drivers/mmc/card/block.c +@@ -592,6 +592,14 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev, + struct mmc_card *card; + int err = 0, ioc_err = 0; + ++ /* ++ * The caller must have CAP_SYS_RAWIO, and must be calling this on the ++ * whole block device, not on a partition. This prevents overspray ++ * between sibling partitions. ++ */ ++ if ((!capable(CAP_SYS_RAWIO)) || (bdev != bdev->bd_contains)) ++ return -EPERM; ++ + idata = mmc_blk_ioctl_copy_from_user(ic_ptr); + if (IS_ERR(idata)) + return PTR_ERR(idata); +@@ -634,6 +642,14 @@ static int mmc_blk_ioctl_multi_cmd(struct block_device *bdev, + int i, err = 0, ioc_err = 0; + __u64 num_of_cmds; + ++ /* ++ * The caller must have CAP_SYS_RAWIO, and must be calling this on the ++ * whole block device, not on a partition. This prevents overspray ++ * between sibling partitions. ++ */ ++ if ((!capable(CAP_SYS_RAWIO)) || (bdev != bdev->bd_contains)) ++ return -EPERM; ++ + if (copy_from_user(&num_of_cmds, &user->num_of_cmds, + sizeof(num_of_cmds))) + return -EFAULT; +@@ -689,14 +705,6 @@ cmd_err: + static int mmc_blk_ioctl(struct block_device *bdev, fmode_t mode, + unsigned int cmd, unsigned long arg) + { +- /* +- * The caller must have CAP_SYS_RAWIO, and must be calling this on the +- * whole block device, not on a partition. This prevents overspray +- * between sibling partitions. +- */ +- if ((!capable(CAP_SYS_RAWIO)) || (bdev != bdev->bd_contains)) +- return -EPERM; +- + switch (cmd) { + case MMC_IOC_CMD: + return mmc_blk_ioctl_cmd(bdev, +-- +2.7.1 + + +From 1a477e78a37ef93b9323702c9e52ebd5b691342f Mon Sep 17 00:00:00 2001 +From: Magnus Damm +Date: Tue, 16 Feb 2016 13:06:41 +0900 +Subject: [PATCH 183/384] mmc: mmc_spi: Add Card Detect comments and fix CD + GPIO case + +commit bcdc9f260bdce09913db1464be9817170d51044a upstream. + +This patch fixes the MMC SPI driver from doing polling card detect when a +CD GPIO that supports interrupts is specified using the gpios DT property. + +Without this patch the DT node below results in the following output: + + spi_gpio: spi-gpio { /* SD2 @ CN12 */ + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + gpio-sck = <&gpio6 16 GPIO_ACTIVE_HIGH>; + gpio-mosi = <&gpio6 17 GPIO_ACTIVE_HIGH>; + gpio-miso = <&gpio6 18 GPIO_ACTIVE_HIGH>; + num-chipselects = <1>; + cs-gpios = <&gpio6 21 GPIO_ACTIVE_LOW>; + status = "okay"; + + spi@0 { + compatible = "mmc-spi-slot"; + reg = <0>; + voltage-ranges = <3200 3400>; + spi-max-frequency = <25000000>; + gpios = <&gpio6 22 GPIO_ACTIVE_LOW>; /* CD */ + }; + }; + + # dmesg | grep mmc + mmc_spi spi32766.0: SD/MMC host mmc0, no WP, no poweroff, cd polling + mmc0: host does not support reading read-only switch, assuming write-enable + mmc0: new SDHC card on SPI + mmcblk0: mmc0:0000 SU04G 3.69 GiB + mmcblk0: p1 + +With this patch applied the "cd polling" portion above disappears. + +Signed-off-by: Magnus Damm +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/host/mmc_spi.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c +index 1c1b45e..aad3243a 100644 +--- a/drivers/mmc/host/mmc_spi.c ++++ b/drivers/mmc/host/mmc_spi.c +@@ -1436,6 +1436,12 @@ static int mmc_spi_probe(struct spi_device *spi) + host->pdata->cd_debounce); + if (status != 0) + goto fail_add_host; ++ ++ /* The platform has a CD GPIO signal that may support ++ * interrupts, so let mmc_gpiod_request_cd_irq() decide ++ * if polling is needed or not. ++ */ ++ mmc->caps &= ~MMC_CAP_NEEDS_POLL; + mmc_gpiod_request_cd_irq(mmc); + } + +-- +2.7.1 + + +From a0ad6f92df9ea779d2c192cd41fed259038b2928 Mon Sep 17 00:00:00 2001 +From: Adrian Hunter +Date: Mon, 7 Mar 2016 13:33:55 +0200 +Subject: [PATCH 184/384] mmc: sdhci: Fix override of timeout clk wrt + max_busy_timeout + +commit 995136247915c5cee633d55ba23f6eebf67aa567 upstream. + +Normally the timeout clock frequency is read from the capabilities +register. It is also possible to set the value prior to calling +sdhci_add_host() in which case that value will override the +capabilities register value. However that was being done after +calculating max_busy_timeout so that max_busy_timeout was being +calculated using the wrong value of timeout_clk. + +Fix that by moving the override before max_busy_timeout is +calculated. + +The result is that the max_busy_timeout and max_discard +increase for BSW devices so that, for example, the time for +mkfs.ext4 on a 64GB eMMC drops from about 1 minute 40 seconds +to about 20 seconds. + +Note, in the future, the capabilities setting will be tidied up +and this override won't be used anymore. However this fix is +needed for stable. + +Signed-off-by: Adrian Hunter +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/host/sdhci.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c +index bbb80af..62696e6 100644 +--- a/drivers/mmc/host/sdhci.c ++++ b/drivers/mmc/host/sdhci.c +@@ -3101,14 +3101,14 @@ int sdhci_add_host(struct sdhci_host *host) + if (caps[0] & SDHCI_TIMEOUT_CLK_UNIT) + host->timeout_clk *= 1000; + ++ if (override_timeout_clk) ++ host->timeout_clk = override_timeout_clk; ++ + mmc->max_busy_timeout = host->ops->get_max_timeout_count ? + host->ops->get_max_timeout_count(host) : 1 << 27; + mmc->max_busy_timeout /= host->timeout_clk; + } + +- if (override_timeout_clk) +- host->timeout_clk = override_timeout_clk; +- + mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23; + mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD; + +-- +2.7.1 + + +From 417d5c1828efdfcab776f4fd246105bfd8185f99 Mon Sep 17 00:00:00 2001 +From: Heiko Stuebner +Date: Tue, 19 Jan 2016 10:01:08 +0100 +Subject: [PATCH 185/384] clk: rockchip: rk3368: fix cpuclk mux bit of big + cpu-cluster + +commit 535ebd428aeb07c3327947281306f2943f2c9faa upstream. + +Both clusters have their mux bit in bit 7 of their respective register. +For whatever reason the big cluster currently lists bit 15 which is +definitly wrong. + +Fixes: 3536c97a52db ("clk: rockchip: add rk3368 clock controller") +Reported-by: Zhang Qing +Signed-off-by: Heiko Stuebner +Reviewed-by: zhangqing +Signed-off-by: Greg Kroah-Hartman +--- + drivers/clk/rockchip/clk-rk3368.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/clk/rockchip/clk-rk3368.c b/drivers/clk/rockchip/clk-rk3368.c +index 7e6b783..c3b2da0 100644 +--- a/drivers/clk/rockchip/clk-rk3368.c ++++ b/drivers/clk/rockchip/clk-rk3368.c +@@ -165,7 +165,7 @@ static const struct rockchip_cpuclk_reg_data rk3368_cpuclkb_data = { + .core_reg = RK3368_CLKSEL_CON(0), + .div_core_shift = 0, + .div_core_mask = 0x1f, +- .mux_core_shift = 15, ++ .mux_core_shift = 7, + }; + + static const struct rockchip_cpuclk_reg_data rk3368_cpuclkl_data = { +-- +2.7.1 + + +From 202771476e3d541fddfe48765e7a01014852fa2a Mon Sep 17 00:00:00 2001 +From: Heiko Stuebner +Date: Tue, 19 Jan 2016 10:09:22 +0100 +Subject: [PATCH 186/384] clk: rockchip: rk3368: fix cpuclk core dividers + +commit c6d5fe2ca8286f35a79f7345c9378c39d48a1527 upstream. + +Similar to commit 9880d4277f6a ("clk: rockchip: fix rk3288 cpuclk core +dividers") it seems the cpuclk dividers are one to high on the rk3368 +as well. + +And again similar to the previous fix, we opt to make the divider list +contain the values to be written to use the same paradigm for them on all +supported socs. + +Fixes: 3536c97a52db ("clk: rockchip: add rk3368 clock controller") +Reported-by: Zhang Qing +Signed-off-by: Heiko Stuebner +Reviewed-by: zhangqing +Signed-off-by: Greg Kroah-Hartman +--- + drivers/clk/rockchip/clk-rk3368.c | 40 +++++++++++++++++++-------------------- + 1 file changed, 20 insertions(+), 20 deletions(-) + +diff --git a/drivers/clk/rockchip/clk-rk3368.c b/drivers/clk/rockchip/clk-rk3368.c +index c3b2da0..4e99072 100644 +--- a/drivers/clk/rockchip/clk-rk3368.c ++++ b/drivers/clk/rockchip/clk-rk3368.c +@@ -218,29 +218,29 @@ static const struct rockchip_cpuclk_reg_data rk3368_cpuclkl_data = { + } + + static struct rockchip_cpuclk_rate_table rk3368_cpuclkb_rates[] __initdata = { +- RK3368_CPUCLKB_RATE(1512000000, 2, 6, 6), +- RK3368_CPUCLKB_RATE(1488000000, 2, 5, 5), +- RK3368_CPUCLKB_RATE(1416000000, 2, 5, 5), +- RK3368_CPUCLKB_RATE(1200000000, 2, 4, 4), +- RK3368_CPUCLKB_RATE(1008000000, 2, 4, 4), +- RK3368_CPUCLKB_RATE( 816000000, 2, 3, 3), +- RK3368_CPUCLKB_RATE( 696000000, 2, 3, 3), +- RK3368_CPUCLKB_RATE( 600000000, 2, 2, 2), +- RK3368_CPUCLKB_RATE( 408000000, 2, 2, 2), +- RK3368_CPUCLKB_RATE( 312000000, 2, 2, 2), ++ RK3368_CPUCLKB_RATE(1512000000, 1, 5, 5), ++ RK3368_CPUCLKB_RATE(1488000000, 1, 4, 4), ++ RK3368_CPUCLKB_RATE(1416000000, 1, 4, 4), ++ RK3368_CPUCLKB_RATE(1200000000, 1, 3, 3), ++ RK3368_CPUCLKB_RATE(1008000000, 1, 3, 3), ++ RK3368_CPUCLKB_RATE( 816000000, 1, 2, 2), ++ RK3368_CPUCLKB_RATE( 696000000, 1, 2, 2), ++ RK3368_CPUCLKB_RATE( 600000000, 1, 1, 1), ++ RK3368_CPUCLKB_RATE( 408000000, 1, 1, 1), ++ RK3368_CPUCLKB_RATE( 312000000, 1, 1, 1), + }; + + static struct rockchip_cpuclk_rate_table rk3368_cpuclkl_rates[] __initdata = { +- RK3368_CPUCLKL_RATE(1512000000, 2, 7, 7), +- RK3368_CPUCLKL_RATE(1488000000, 2, 6, 6), +- RK3368_CPUCLKL_RATE(1416000000, 2, 6, 6), +- RK3368_CPUCLKL_RATE(1200000000, 2, 5, 5), +- RK3368_CPUCLKL_RATE(1008000000, 2, 5, 5), +- RK3368_CPUCLKL_RATE( 816000000, 2, 4, 4), +- RK3368_CPUCLKL_RATE( 696000000, 2, 3, 3), +- RK3368_CPUCLKL_RATE( 600000000, 2, 3, 3), +- RK3368_CPUCLKL_RATE( 408000000, 2, 2, 2), +- RK3368_CPUCLKL_RATE( 312000000, 2, 2, 2), ++ RK3368_CPUCLKL_RATE(1512000000, 1, 6, 6), ++ RK3368_CPUCLKL_RATE(1488000000, 1, 5, 5), ++ RK3368_CPUCLKL_RATE(1416000000, 1, 5, 5), ++ RK3368_CPUCLKL_RATE(1200000000, 1, 4, 4), ++ RK3368_CPUCLKL_RATE(1008000000, 1, 4, 4), ++ RK3368_CPUCLKL_RATE( 816000000, 1, 3, 3), ++ RK3368_CPUCLKL_RATE( 696000000, 1, 2, 2), ++ RK3368_CPUCLKL_RATE( 600000000, 1, 2, 2), ++ RK3368_CPUCLKL_RATE( 408000000, 1, 1, 1), ++ RK3368_CPUCLKL_RATE( 312000000, 1, 1, 1), + }; + + static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = { +-- +2.7.1 + + +From 773c004921aca1ba37e147ca76e27aa96a3a0891 Mon Sep 17 00:00:00 2001 +From: Heiko Stuebner +Date: Wed, 20 Jan 2016 19:22:38 +0100 +Subject: [PATCH 187/384] clk: rockchip: rk3368: fix parents of video + encoder/decoder + +commit 0f28d98463498c61c61a38aacbf9f69e92e85e9d upstream. + +The vdpu and vepu clocks can also be parented to the npll and current +parent list also is wrong as it would use the npll as "usbphy" source, +so adapt the parent to the correct one. + +Fixes: 3536c97a52db ("clk: rockchip: add rk3368 clock controller") +Signed-off-by: Heiko Stuebner +Reviewed-by: zhangqing +Signed-off-by: Greg Kroah-Hartman +--- + drivers/clk/rockchip/clk-rk3368.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/clk/rockchip/clk-rk3368.c b/drivers/clk/rockchip/clk-rk3368.c +index 4e99072..aa41937 100644 +--- a/drivers/clk/rockchip/clk-rk3368.c ++++ b/drivers/clk/rockchip/clk-rk3368.c +@@ -384,10 +384,10 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = { + * Clock-Architecture Diagram 3 + */ + +- COMPOSITE(0, "aclk_vepu", mux_pll_src_cpll_gpll_usb_p, 0, ++ COMPOSITE(0, "aclk_vepu", mux_pll_src_cpll_gpll_npll_usb_p, 0, + RK3368_CLKSEL_CON(15), 6, 2, MFLAGS, 0, 5, DFLAGS, + RK3368_CLKGATE_CON(4), 6, GFLAGS), +- COMPOSITE(0, "aclk_vdpu", mux_pll_src_cpll_gpll_usb_p, 0, ++ COMPOSITE(0, "aclk_vdpu", mux_pll_src_cpll_gpll_npll_usb_p, 0, + RK3368_CLKSEL_CON(15), 14, 2, MFLAGS, 8, 5, DFLAGS, + RK3368_CLKGATE_CON(4), 7, GFLAGS), + +-- +2.7.1 + + +From ac7d092965be293ea6feb5b84faa6f5509b74e6f Mon Sep 17 00:00:00 2001 +From: Heiko Stuebner +Date: Wed, 20 Jan 2016 21:47:57 +0100 +Subject: [PATCH 188/384] clk: rockchip: rk3368: fix hdmi_cec gate-register + +commit fd0c0740fac17a014704ef89d8c8b1768711ca59 upstream. + +Fix a typo making the sclk_hdmi_cec access a wrong register to handle +its gate. + +Fixes: 3536c97a52db ("clk: rockchip: add rk3368 clock controller") +Signed-off-by: Heiko Stuebner +Reviewed-by: zhangqing +Signed-off-by: Greg Kroah-Hartman +--- + drivers/clk/rockchip/clk-rk3368.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/clk/rockchip/clk-rk3368.c b/drivers/clk/rockchip/clk-rk3368.c +index aa41937..1b14869 100644 +--- a/drivers/clk/rockchip/clk-rk3368.c ++++ b/drivers/clk/rockchip/clk-rk3368.c +@@ -442,7 +442,7 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = { + GATE(SCLK_HDMI_HDCP, "sclk_hdmi_hdcp", "xin24m", 0, + RK3368_CLKGATE_CON(4), 13, GFLAGS), + GATE(SCLK_HDMI_CEC, "sclk_hdmi_cec", "xin32k", 0, +- RK3368_CLKGATE_CON(5), 12, GFLAGS), ++ RK3368_CLKGATE_CON(4), 12, GFLAGS), + + COMPOSITE_NODIV(0, "vip_src", mux_pll_src_cpll_gpll_p, 0, + RK3368_CLKSEL_CON(21), 15, 1, MFLAGS, +-- +2.7.1 + + +From 6420560c9525074f714104fbe449fbc817100c17 Mon Sep 17 00:00:00 2001 +From: Alexander Kochetkov +Date: Tue, 26 Jan 2016 16:34:00 +0300 +Subject: [PATCH 189/384] clk: rockchip: add hclk_cpubus to the list of rk3188 + critical clocks + +commit e8b63288b37dbb8457b510c9d96f6006da4653f6 upstream. + +hclk_cpubus needs to keep running because it is needed for devices like +the rom, i2s0 or spdif to be accessible via cpu. Without that all +accesses to devices (readl/writel) return wrong data. So add it +to the list of critical clocks. + +Fixes: 78eaf6095cc763c ("clk: rockchip: disable unused clocks") +Signed-off-by: Alexander Kochetkov +Signed-off-by: Heiko Stuebner +Signed-off-by: Greg Kroah-Hartman +--- + drivers/clk/rockchip/clk-rk3188.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/clk/rockchip/clk-rk3188.c b/drivers/clk/rockchip/clk-rk3188.c +index abb4760..fe728f8 100644 +--- a/drivers/clk/rockchip/clk-rk3188.c ++++ b/drivers/clk/rockchip/clk-rk3188.c +@@ -718,6 +718,7 @@ static const char *const rk3188_critical_clocks[] __initconst = { + "hclk_peri", + "pclk_cpu", + "pclk_peri", ++ "hclk_cpubus" + }; + + static void __init rk3188_common_clk_init(struct device_node *np) +-- +2.7.1 + + +From 4e892147ba24a71e5abe5581b4b9b9db6cf81825 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 15 Feb 2016 19:03:57 -0800 +Subject: [PATCH 190/384] clk: bcm2835: Fix setting of PLL divider clock rates + +commit 773b3966dd3cdaeb68e7f2edfe5656abac1dc411 upstream. + +Our dividers weren't being set successfully because CM_PASSWORD wasn't +included in the register write. It looks easier to just compute the +divider to write ourselves than to update clk-divider for the ability +to OR in some arbitrary bits on write. + +Fixes about half of the video modes on my HDMI monitor (everything +except 720x400). + +Signed-off-by: Eric Anholt +Signed-off-by: Michael Turquette +Signed-off-by: Greg Kroah-Hartman +--- + drivers/clk/bcm/clk-bcm2835.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c +index 39bf582..4f9830c 100644 +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -1097,13 +1097,15 @@ static int bcm2835_pll_divider_set_rate(struct clk_hw *hw, + struct bcm2835_pll_divider *divider = bcm2835_pll_divider_from_hw(hw); + struct bcm2835_cprman *cprman = divider->cprman; + const struct bcm2835_pll_divider_data *data = divider->data; +- u32 cm; +- int ret; ++ u32 cm, div, max_div = 1 << A2W_PLL_DIV_BITS; + +- ret = clk_divider_ops.set_rate(hw, rate, parent_rate); +- if (ret) +- return ret; ++ div = DIV_ROUND_UP_ULL(parent_rate, rate); ++ ++ div = min(div, max_div); ++ if (div == max_div) ++ div = 0; + ++ cprman_write(cprman, data->a2w_reg, div); + cm = cprman_read(cprman, data->cm_reg); + cprman_write(cprman, data->cm_reg, cm | data->load_mask); + cprman_write(cprman, data->cm_reg, cm & ~data->load_mask); +-- +2.7.1 + + +From f9eddd47da890a46d9e2bb3e0397555b870cf147 Mon Sep 17 00:00:00 2001 +From: Himanshu Madhani +Date: Mon, 14 Mar 2016 22:47:37 -0700 +Subject: [PATCH 191/384] target: Fix target_release_cmd_kref shutdown comp + leak + +commit 5e47f1985d7107331c3f64fb3ec83d66fd73577e upstream. + +This patch fixes an active I/O shutdown bug for fabric +drivers using target_wait_for_sess_cmds(), where se_cmd +descriptor shutdown would result in hung tasks waiting +indefinitely for se_cmd->cmd_wait_comp to complete(). + +To address this bug, drop the incorrect list_del_init() +usage in target_wait_for_sess_cmds() and always complete() +during se_cmd target_release_cmd_kref() put, in order to +let caller invoke the final fabric release callback +into se_cmd->se_tfo->release_cmd() code. + +Reported-by: Himanshu Madhani +Tested-by: Himanshu Madhani +Signed-off-by: Himanshu Madhani +Signed-off-by: Nicholas Bellinger +Signed-off-by: Greg Kroah-Hartman +--- + drivers/target/target_core_transport.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c +index 94f4ffa..d151bc3 100644 +--- a/drivers/target/target_core_transport.c ++++ b/drivers/target/target_core_transport.c +@@ -2618,8 +2618,6 @@ void target_wait_for_sess_cmds(struct se_session *se_sess) + + list_for_each_entry_safe(se_cmd, tmp_cmd, + &se_sess->sess_wait_list, se_cmd_list) { +- list_del_init(&se_cmd->se_cmd_list); +- + pr_debug("Waiting for se_cmd: %p t_state: %d, fabric state:" + " %d\n", se_cmd, se_cmd->t_state, + se_cmd->se_tfo->get_cmd_state(se_cmd)); +-- +2.7.1 + + +From 18d3f8d9836b323ee0c5bb5829ba79bccaec68ce Mon Sep 17 00:00:00 2001 +From: Jenny Derzhavetz +Date: Wed, 24 Feb 2016 19:23:58 +0200 +Subject: [PATCH 192/384] iser-target: Fix identification of login rx + descriptor type + +commit b89a7c25462b164db280abc3b05d4d9d888d40e9 upstream. + +Once connection request is accepted, one rx descriptor +is posted to receive login request. This descriptor has rx type, +but is outside the main pool of rx descriptors, and thus +was mistreated as tx type. + +Signed-off-by: Jenny Derzhavetz +Signed-off-by: Sagi Grimberg +Signed-off-by: Nicholas Bellinger +Signed-off-by: Greg Kroah-Hartman +--- + drivers/infiniband/ulp/isert/ib_isert.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c +index 8a51c3b..addb572 100644 +--- a/drivers/infiniband/ulp/isert/ib_isert.c ++++ b/drivers/infiniband/ulp/isert/ib_isert.c +@@ -2035,7 +2035,8 @@ is_isert_tx_desc(struct isert_conn *isert_conn, void *wr_id) + void *start = isert_conn->rx_descs; + int len = ISERT_QP_MAX_RECV_DTOS * sizeof(*isert_conn->rx_descs); + +- if (wr_id >= start && wr_id < start + len) ++ if ((wr_id >= start && wr_id < start + len) || ++ (wr_id == isert_conn->login_req_buf)) + return false; + + return true; +-- +2.7.1 + + +From fe10cec48fae5d41e68dd6a8964bb770f34e2df8 Mon Sep 17 00:00:00 2001 +From: Jenny Derzhavetz +Date: Wed, 24 Feb 2016 19:23:59 +0200 +Subject: [PATCH 193/384] iser-target: Add new state ISER_CONN_BOUND to + isert_conn + +commit aea92980601f7ddfcb3c54caa53a43726314fe46 upstream. + +We need an indication that isert_conn->iscsi_conn binding has +happened so we'll know not to invoke a connection reinstatement +on an unbound connection which will lead to a bogus isert_conn->conn +dereferece. + +Signed-off-by: Jenny Derzhavetz +Signed-off-by: Sagi Grimberg +Signed-off-by: Nicholas Bellinger +Signed-off-by: Greg Kroah-Hartman +--- + drivers/infiniband/ulp/isert/ib_isert.c | 7 +++++-- + drivers/infiniband/ulp/isert/ib_isert.h | 1 + + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c +index addb572..0919d6a 100644 +--- a/drivers/infiniband/ulp/isert/ib_isert.c ++++ b/drivers/infiniband/ulp/isert/ib_isert.c +@@ -820,7 +820,7 @@ isert_put_conn(struct isert_conn *isert_conn) + * @isert_conn: isert connection struct + * + * Notes: +- * In case the connection state is FULL_FEATURE, move state ++ * In case the connection state is BOUND, move state + * to TEMINATING and start teardown sequence (rdma_disconnect). + * In case the connection state is UP, complete flush as well. + * +@@ -836,6 +836,7 @@ isert_conn_terminate(struct isert_conn *isert_conn) + case ISER_CONN_TERMINATING: + break; + case ISER_CONN_UP: ++ case ISER_CONN_BOUND: + case ISER_CONN_FULL_FEATURE: /* FALLTHRU */ + isert_info("Terminating conn %p state %d\n", + isert_conn, isert_conn->state); +@@ -2062,7 +2063,8 @@ isert_cq_comp_err(struct isert_conn *isert_conn, struct ib_wc *wc) + isert_completion_put(desc, isert_cmd, ib_dev, true); + } else { + isert_conn->post_recv_buf_count--; +- if (!isert_conn->post_recv_buf_count) ++ if (!isert_conn->post_recv_buf_count && ++ isert_conn->state >= ISER_CONN_BOUND) + iscsit_cause_connection_reinstatement(isert_conn->conn, 0); + } + } +@@ -3194,6 +3196,7 @@ accept_wait: + + conn->context = isert_conn; + isert_conn->conn = conn; ++ isert_conn->state = ISER_CONN_BOUND; + + isert_set_conn_info(np, conn, isert_conn); + +diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h +index 3d7fbc4..d963520 100644 +--- a/drivers/infiniband/ulp/isert/ib_isert.h ++++ b/drivers/infiniband/ulp/isert/ib_isert.h +@@ -50,6 +50,7 @@ enum iser_ib_op_code { + enum iser_conn_state { + ISER_CONN_INIT, + ISER_CONN_UP, ++ ISER_CONN_BOUND, + ISER_CONN_FULL_FEATURE, + ISER_CONN_TERMINATING, + ISER_CONN_DOWN, +-- +2.7.1 + + +From d9816b978850d09c7883a3edeefa1664ba0506c3 Mon Sep 17 00:00:00 2001 +From: Jenny Derzhavetz +Date: Wed, 24 Feb 2016 19:24:00 +0200 +Subject: [PATCH 194/384] iser-target: Separate flows for np listeners and + connections cma events + +commit f81bf458208ef6d12b2fc08091204e3859dcdba4 upstream. + +No need to restrict this check to specific events. + +Signed-off-by: Jenny Derzhavetz +Signed-off-by: Sagi Grimberg +Signed-off-by: Nicholas Bellinger +Signed-off-by: Greg Kroah-Hartman +--- + drivers/infiniband/ulp/isert/ib_isert.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c +index 0919d6a..48e2394 100644 +--- a/drivers/infiniband/ulp/isert/ib_isert.c ++++ b/drivers/infiniband/ulp/isert/ib_isert.c +@@ -884,14 +884,9 @@ isert_disconnected_handler(struct rdma_cm_id *cma_id, + enum rdma_cm_event_type event) + { + struct isert_np *isert_np = cma_id->context; +- struct isert_conn *isert_conn; ++ struct isert_conn *isert_conn = cma_id->qp->qp_context; + bool terminating = false; + +- if (isert_np->cm_id == cma_id) +- return isert_np_cma_handler(cma_id->context, event); +- +- isert_conn = cma_id->qp->qp_context; +- + mutex_lock(&isert_conn->mutex); + terminating = (isert_conn->state == ISER_CONN_TERMINATING); + isert_conn_terminate(isert_conn); +@@ -930,12 +925,16 @@ isert_connect_error(struct rdma_cm_id *cma_id) + static int + isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) + { ++ struct isert_np *isert_np = cma_id->context; + int ret = 0; + + isert_info("%s (%d): status %d id %p np %p\n", + rdma_event_msg(event->event), event->event, + event->status, cma_id, cma_id->context); + ++ if (isert_np->cm_id == cma_id) ++ return isert_np_cma_handler(cma_id->context, event->event); ++ + switch (event->event) { + case RDMA_CM_EVENT_CONNECT_REQUEST: + ret = isert_connect_request(cma_id, event); +-- +2.7.1 + + +From ed5fbc03ab5d2dc5c9dabb382b1298ecd169deac Mon Sep 17 00:00:00 2001 +From: Jenny Derzhavetz +Date: Wed, 24 Feb 2016 19:24:01 +0200 +Subject: [PATCH 195/384] iser-target: Rework connection termination + +commit 6d1fba0c2cc7efe42fd761ecbba833ed0ea7b07e upstream. + +When we receive an event that triggers connection termination, +we have a a couple of things we may want to do: +1. In case we are already terminating, bailout early +2. In case we are connected but not bound, disconnect and schedule + a connection cleanup silently (don't reinstate) +3. In case we are connected and bound, disconnect and reinstate the connection + +This rework fixes a bug that was detected against a mis-behaved +initiator which rejected our rdma_cm accept, in this stage the +isert_conn is no bound and reinstate caused a bogus dereference. + +What's great about this is that we don't need the +post_recv_buf_count anymore, so get rid of it. + +Signed-off-by: Jenny Derzhavetz +Signed-off-by: Sagi Grimberg +Signed-off-by: Nicholas Bellinger +Signed-off-by: Greg Kroah-Hartman +--- + drivers/infiniband/ulp/isert/ib_isert.c | 107 ++++++++++++++++---------------- + drivers/infiniband/ulp/isert/ib_isert.h | 1 - + 2 files changed, 52 insertions(+), 56 deletions(-) + +diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c +index 48e2394..b0edb66 100644 +--- a/drivers/infiniband/ulp/isert/ib_isert.c ++++ b/drivers/infiniband/ulp/isert/ib_isert.c +@@ -66,6 +66,7 @@ isert_rdma_accept(struct isert_conn *isert_conn); + struct rdma_cm_id *isert_setup_id(struct isert_np *isert_np); + + static void isert_release_work(struct work_struct *work); ++static void isert_wait4flush(struct isert_conn *isert_conn); + + static inline bool + isert_prot_cmd(struct isert_conn *conn, struct se_cmd *cmd) +@@ -815,6 +816,25 @@ isert_put_conn(struct isert_conn *isert_conn) + kref_put(&isert_conn->kref, isert_release_kref); + } + ++static void ++isert_handle_unbound_conn(struct isert_conn *isert_conn) ++{ ++ struct isert_np *isert_np = isert_conn->cm_id->context; ++ ++ mutex_lock(&isert_np->mutex); ++ if (!list_empty(&isert_conn->node)) { ++ /* ++ * This means iscsi doesn't know this connection ++ * so schedule a cleanup ourselves ++ */ ++ list_del_init(&isert_conn->node); ++ isert_put_conn(isert_conn); ++ complete(&isert_conn->wait); ++ queue_work(isert_release_wq, &isert_conn->release_work); ++ } ++ mutex_unlock(&isert_np->mutex); ++} ++ + /** + * isert_conn_terminate() - Initiate connection termination + * @isert_conn: isert connection struct +@@ -832,24 +852,19 @@ isert_conn_terminate(struct isert_conn *isert_conn) + { + int err; + +- switch (isert_conn->state) { +- case ISER_CONN_TERMINATING: +- break; +- case ISER_CONN_UP: +- case ISER_CONN_BOUND: +- case ISER_CONN_FULL_FEATURE: /* FALLTHRU */ +- isert_info("Terminating conn %p state %d\n", +- isert_conn, isert_conn->state); +- isert_conn->state = ISER_CONN_TERMINATING; +- err = rdma_disconnect(isert_conn->cm_id); +- if (err) +- isert_warn("Failed rdma_disconnect isert_conn %p\n", +- isert_conn); +- break; +- default: +- isert_warn("conn %p teminating in state %d\n", +- isert_conn, isert_conn->state); +- } ++ if (isert_conn->state >= ISER_CONN_TERMINATING) ++ return; ++ ++ isert_info("Terminating conn %p state %d\n", ++ isert_conn, isert_conn->state); ++ isert_conn->state = ISER_CONN_TERMINATING; ++ err = rdma_disconnect(isert_conn->cm_id); ++ if (err) ++ isert_warn("Failed rdma_disconnect isert_conn %p\n", ++ isert_conn); ++ ++ isert_info("conn %p completing wait\n", isert_conn); ++ complete(&isert_conn->wait); + } + + static int +@@ -883,30 +898,27 @@ static int + isert_disconnected_handler(struct rdma_cm_id *cma_id, + enum rdma_cm_event_type event) + { +- struct isert_np *isert_np = cma_id->context; + struct isert_conn *isert_conn = cma_id->qp->qp_context; +- bool terminating = false; + + mutex_lock(&isert_conn->mutex); +- terminating = (isert_conn->state == ISER_CONN_TERMINATING); +- isert_conn_terminate(isert_conn); +- mutex_unlock(&isert_conn->mutex); +- +- isert_info("conn %p completing wait\n", isert_conn); +- complete(&isert_conn->wait); +- +- if (terminating) +- goto out; +- +- mutex_lock(&isert_np->mutex); +- if (!list_empty(&isert_conn->node)) { +- list_del_init(&isert_conn->node); +- isert_put_conn(isert_conn); +- queue_work(isert_release_wq, &isert_conn->release_work); ++ switch (isert_conn->state) { ++ case ISER_CONN_TERMINATING: ++ break; ++ case ISER_CONN_UP: ++ isert_conn_terminate(isert_conn); ++ isert_wait4flush(isert_conn); ++ isert_handle_unbound_conn(isert_conn); ++ break; ++ case ISER_CONN_BOUND: ++ case ISER_CONN_FULL_FEATURE: /* FALLTHRU */ ++ iscsit_cause_connection_reinstatement(isert_conn->conn, 0); ++ break; ++ default: ++ isert_warn("conn %p teminating in state %d\n", ++ isert_conn, isert_conn->state); + } +- mutex_unlock(&isert_np->mutex); ++ mutex_unlock(&isert_conn->mutex); + +-out: + return 0; + } + +@@ -980,13 +992,10 @@ isert_post_recvm(struct isert_conn *isert_conn, u32 count) + rx_wr--; + rx_wr->next = NULL; /* mark end of work requests list */ + +- isert_conn->post_recv_buf_count += count; + ret = ib_post_recv(isert_conn->qp, isert_conn->rx_wr, + &rx_wr_failed); +- if (ret) { ++ if (ret) + isert_err("ib_post_recv() failed with ret: %d\n", ret); +- isert_conn->post_recv_buf_count -= count; +- } + + return ret; + } +@@ -1002,12 +1011,9 @@ isert_post_recv(struct isert_conn *isert_conn, struct iser_rx_desc *rx_desc) + rx_wr.num_sge = 1; + rx_wr.next = NULL; + +- isert_conn->post_recv_buf_count++; + ret = ib_post_recv(isert_conn->qp, &rx_wr, &rx_wr_failed); +- if (ret) { ++ if (ret) + isert_err("ib_post_recv() failed with ret: %d\n", ret); +- isert_conn->post_recv_buf_count--; +- } + + return ret; + } +@@ -1120,12 +1126,9 @@ isert_rdma_post_recvl(struct isert_conn *isert_conn) + rx_wr.sg_list = &sge; + rx_wr.num_sge = 1; + +- isert_conn->post_recv_buf_count++; + ret = ib_post_recv(isert_conn->qp, &rx_wr, &rx_wr_fail); +- if (ret) { ++ if (ret) + isert_err("ib_post_recv() failed: %d\n", ret); +- isert_conn->post_recv_buf_count--; +- } + + return ret; + } +@@ -1620,7 +1623,6 @@ isert_rcv_completion(struct iser_rx_desc *desc, + ib_dma_sync_single_for_device(ib_dev, rx_dma, rx_buflen, + DMA_FROM_DEVICE); + +- isert_conn->post_recv_buf_count--; + } + + static int +@@ -2060,11 +2062,6 @@ isert_cq_comp_err(struct isert_conn *isert_conn, struct ib_wc *wc) + isert_unmap_tx_desc(desc, ib_dev); + else + isert_completion_put(desc, isert_cmd, ib_dev, true); +- } else { +- isert_conn->post_recv_buf_count--; +- if (!isert_conn->post_recv_buf_count && +- isert_conn->state >= ISER_CONN_BOUND) +- iscsit_cause_connection_reinstatement(isert_conn->conn, 0); + } + } + +diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h +index d963520..1874d21 100644 +--- a/drivers/infiniband/ulp/isert/ib_isert.h ++++ b/drivers/infiniband/ulp/isert/ib_isert.h +@@ -145,7 +145,6 @@ struct isert_device; + + struct isert_conn { + enum iser_conn_state state; +- int post_recv_buf_count; + u32 responder_resources; + u32 initiator_depth; + bool pi_support; +-- +2.7.1 + + +From 3b540bf38c7d5876ae064ca42832622da0e12142 Mon Sep 17 00:00:00 2001 +From: "J. Bruce Fields" +Date: Mon, 29 Feb 2016 20:21:21 -0500 +Subject: [PATCH 196/384] nfsd4: fix bad bounds checking + +commit 4aed9c46afb80164401143aa0fdcfe3798baa9d5 upstream. + +A number of spots in the xdr decoding follow a pattern like + + n = be32_to_cpup(p++); + READ_BUF(n + 4); + +where n is a u32. The only bounds checking is done in READ_BUF itself, +but since it's checking (n + 4), it won't catch cases where n is very +large, (u32)(-4) or higher. I'm not sure exactly what the consequences +are, but we've seen crashes soon after. + +Instead, just break these up into two READ_BUF()s. + +Signed-off-by: J. Bruce Fields +Signed-off-by: Greg Kroah-Hartman +--- + fs/nfsd/nfs4xdr.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c +index 51c9e9c..1293520 100644 +--- a/fs/nfsd/nfs4xdr.c ++++ b/fs/nfsd/nfs4xdr.c +@@ -1072,8 +1072,9 @@ nfsd4_decode_rename(struct nfsd4_compoundargs *argp, struct nfsd4_rename *rename + + READ_BUF(4); + rename->rn_snamelen = be32_to_cpup(p++); +- READ_BUF(rename->rn_snamelen + 4); ++ READ_BUF(rename->rn_snamelen); + SAVEMEM(rename->rn_sname, rename->rn_snamelen); ++ READ_BUF(4); + rename->rn_tnamelen = be32_to_cpup(p++); + READ_BUF(rename->rn_tnamelen); + SAVEMEM(rename->rn_tname, rename->rn_tnamelen); +@@ -1155,13 +1156,14 @@ nfsd4_decode_setclientid(struct nfsd4_compoundargs *argp, struct nfsd4_setclient + READ_BUF(8); + setclientid->se_callback_prog = be32_to_cpup(p++); + setclientid->se_callback_netid_len = be32_to_cpup(p++); +- +- READ_BUF(setclientid->se_callback_netid_len + 4); ++ READ_BUF(setclientid->se_callback_netid_len); + SAVEMEM(setclientid->se_callback_netid_val, setclientid->se_callback_netid_len); ++ READ_BUF(4); + setclientid->se_callback_addr_len = be32_to_cpup(p++); + +- READ_BUF(setclientid->se_callback_addr_len + 4); ++ READ_BUF(setclientid->se_callback_addr_len); + SAVEMEM(setclientid->se_callback_addr_val, setclientid->se_callback_addr_len); ++ READ_BUF(4); + setclientid->se_callback_ident = be32_to_cpup(p++); + + DECODE_TAIL; +@@ -1815,8 +1817,9 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp) + + READ_BUF(4); + argp->taglen = be32_to_cpup(p++); +- READ_BUF(argp->taglen + 8); ++ READ_BUF(argp->taglen); + SAVEMEM(argp->tag, argp->taglen); ++ READ_BUF(8); + argp->minorversion = be32_to_cpup(p++); + argp->opcnt = be32_to_cpup(p++); + max_reply += 4 + (XDR_QUADLEN(argp->taglen) << 2); +-- +2.7.1 + + +From 061161279d3160fe9571f51936d2c5704ffa1ddf Mon Sep 17 00:00:00 2001 +From: "J. Bruce Fields" +Date: Wed, 2 Mar 2016 16:36:21 -0800 +Subject: [PATCH 197/384] nfsd: fix deadlock secinfo+readdir compound + +commit 2f6fc056e899bd0144a08da5cacaecbe8997cd74 upstream. + +nfsd_lookup_dentry exits with the parent filehandle locked. fh_put also +unlocks if necessary (nfsd filehandle locking is probably too lenient), +so it gets unlocked eventually, but if the following op in the compound +needs to lock it again, we can deadlock. + +A fuzzer ran into this; normal clients don't send a secinfo followed by +a readdir in the same compound. + +Signed-off-by: J. Bruce Fields +Signed-off-by: Greg Kroah-Hartman +--- + fs/nfsd/nfs4proc.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c +index a9f096c..7d5351c 100644 +--- a/fs/nfsd/nfs4proc.c ++++ b/fs/nfsd/nfs4proc.c +@@ -877,6 +877,7 @@ nfsd4_secinfo(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, + &exp, &dentry); + if (err) + return err; ++ fh_unlock(&cstate->current_fh); + if (d_really_is_negative(dentry)) { + exp_put(exp); + err = nfserr_noent; +-- +2.7.1 + + +From 2925d2a3246e0a5c698cfff24058e751db59c075 Mon Sep 17 00:00:00 2001 +From: Ludovic Desroches +Date: Fri, 11 Mar 2016 11:43:39 +0100 +Subject: [PATCH 198/384] ARM: dts: at91: sama5d3 Xplained: don't disable hsmci + regulator + +commit ae3fc8ea08e405682f1fa959f94b6e4126afbc1b upstream. + +If enabling the hsmci regulator on card detection, the board can reboot +on sd card insertion. Keeping the regulator always enabled fixes this +issue. + +Signed-off-by: Ludovic Desroches +Fixes: 1b53e3416dd0 ("ARM: at91/dt: sama5d3 xplained: add fixed regulator for vmmc0") +Signed-off-by: Nicolas Ferre +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/boot/dts/at91-sama5d3_xplained.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/at91-sama5d3_xplained.dts b/arch/arm/boot/dts/at91-sama5d3_xplained.dts +index ff888d2..f3e2b96 100644 +--- a/arch/arm/boot/dts/at91-sama5d3_xplained.dts ++++ b/arch/arm/boot/dts/at91-sama5d3_xplained.dts +@@ -303,6 +303,7 @@ + regulator-name = "mmc0-card-supply"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; ++ regulator-always-on; + }; + + gpio_keys { +-- +2.7.1 + + +From 165eefacf09f4d9455c0fbd64101c861bf0f40b7 Mon Sep 17 00:00:00 2001 +From: Ludovic Desroches +Date: Fri, 11 Mar 2016 11:35:10 +0100 +Subject: [PATCH 199/384] ARM: dts: at91: sama5d4 Xplained: don't disable hsmci + regulator + +commit b02acd4e62602a6ab307da84388a16bf60106c48 upstream. + +If enabling the hsmci regulator on card detection, the board can reboot +on sd card insertion. Keeping the regulator always enabled fixes this +issue. + +Signed-off-by: Ludovic Desroches +Fixes: 8d545f32bd77 ("ARM: at91/dt: sama5d4 xplained: add regulators for v(q)mmc1 supplies") +Signed-off-by: Nicolas Ferre +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/boot/dts/at91-sama5d4_xplained.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/at91-sama5d4_xplained.dts b/arch/arm/boot/dts/at91-sama5d4_xplained.dts +index 569026e..da84e65 100644 +--- a/arch/arm/boot/dts/at91-sama5d4_xplained.dts ++++ b/arch/arm/boot/dts/at91-sama5d4_xplained.dts +@@ -268,5 +268,6 @@ + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vcc_3v3_reg>; ++ regulator-always-on; + }; + }; +-- +2.7.1 + + +From cb3053a619346fb397cea43207802cec8cc51819 Mon Sep 17 00:00:00 2001 +From: Lukas Wunner +Date: Wed, 23 Mar 2016 00:11:20 +0100 +Subject: [PATCH 200/384] ACPI / PM: Runtime resume devices when waking from + hibernate + +commit fbda4b38fa3995aa0777fe9cbbdcb223c6292083 upstream. + +Commit 58a1fbbb2ee8 ("PM / PCI / ACPI: Kick devices that might have been +reset by firmware") added a runtime resume for devices that were runtime +suspended when the system entered suspend-to-RAM. + +Briefly, the motivation was to ensure that devices did not remain in a +reset-power-on state after resume, potentially preventing deep SoC-wide +low-power states from being entered on idle. + +Currently we're not doing the same when leaving suspend-to-disk and this +asymmetry is a problem if drivers rely on the automatic resume triggered +by pm_complete_with_resume_check(). Fix it. + +Fixes: 58a1fbbb2ee8 (PM / PCI / ACPI: Kick devices that might have been reset by firmware) +Signed-off-by: Lukas Wunner +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/acpi/sleep.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c +index 0d94621..e3322ad 100644 +--- a/drivers/acpi/sleep.c ++++ b/drivers/acpi/sleep.c +@@ -714,6 +714,7 @@ static int acpi_hibernation_enter(void) + + static void acpi_hibernation_leave(void) + { ++ pm_set_resume_via_firmware(); + /* + * If ACPI is not enabled by the BIOS and the boot kernel, we need to + * enable it here. +-- +2.7.1 + + +From 0e316741b12130808b26aef6776f198dd659fd35 Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Fri, 18 Mar 2016 13:50:03 -0400 +Subject: [PATCH 201/384] writeback, cgroup: fix premature wb_put() in + locked_inode_to_wb_and_lock_list() + +commit 614a4e3773148a31f58dc174bbf578ceb63510c2 upstream. + +locked_inode_to_wb_and_lock_list() wb_get()'s the wb associated with +the target inode, unlocks inode, locks the wb's list_lock and verifies +that the inode is still associated with the wb. To prevent the wb +going away between dropping inode lock and acquiring list_lock, the wb +is pinned while inode lock is held. The wb reference is put right +after acquiring list_lock citing that the wb won't be dereferenced +anymore. + +This isn't true. If the inode is still associated with the wb, the +inode has reference and it's safe to return the wb; however, if inode +has been switched, the wb still needs to be unlocked which is a +dereference and can lead to use-after-free if it it races with wb +destruction. + +Fix it by putting the reference after releasing list_lock. + +Signed-off-by: Tejun Heo +Fixes: 87e1d789bf55 ("writeback: implement [locked_]inode_to_wb_and_lock_list()") +Tested-by: Tahsin Erdogan +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + fs/fs-writeback.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c +index 7a8ea13..e84b698 100644 +--- a/fs/fs-writeback.c ++++ b/fs/fs-writeback.c +@@ -281,13 +281,15 @@ locked_inode_to_wb_and_lock_list(struct inode *inode) + wb_get(wb); + spin_unlock(&inode->i_lock); + spin_lock(&wb->list_lock); +- wb_put(wb); /* not gonna deref it anymore */ + + /* i_wb may have changed inbetween, can't use inode_to_wb() */ +- if (likely(wb == inode->i_wb)) +- return wb; /* @inode already has ref */ ++ if (likely(wb == inode->i_wb)) { ++ wb_put(wb); /* @inode already has ref */ ++ return wb; ++ } + + spin_unlock(&wb->list_lock); ++ wb_put(wb); + cpu_relax(); + spin_lock(&inode->i_lock); + } +-- +2.7.1 + + +From 0b71b2d316dd9faa78bbad82df9a457a68ac2a0b Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Fri, 18 Mar 2016 13:52:04 -0400 +Subject: [PATCH 202/384] writeback, cgroup: fix use of the wrong bdi_writeback + which mismatches the inode + +commit aaf2559332ba272671bb870464a99b909b29a3a1 upstream. + +When cgroup writeback is in use, there can be multiple wb's +(bdi_writeback's) per bdi and an inode may switch among them +dynamically. In a couple places, the wrong wb was used leading to +performing operations on the wrong list under the wrong lock +corrupting the io lists. + +* writeback_single_inode() was taking @wb parameter and used it to + remove the inode from io lists if it becomes clean after writeback. + The callers of this function were always passing in the root wb + regardless of the actual wb that the inode was associated with, + which could also change while writeback is in progress. + + Fix it by dropping the @wb parameter and using + inode_to_wb_and_lock_list() to determine and lock the associated wb. + +* After writeback_sb_inodes() writes out an inode, it re-locks @wb and + inode to remove it from or move it to the right io list. It assumes + that the inode is still associated with @wb; however, the inode may + have switched to another wb while writeback was in progress. + + Fix it by using inode_to_wb_and_lock_list() to determine and lock + the associated wb after writeback is complete. As the function + requires the original @wb->list_lock locked for the next iteration, + in the unlikely case where the inode has changed association, switch + the locks. + +Kudos to Tahsin for pinpointing these subtle breakages. + +Signed-off-by: Tejun Heo +Fixes: d10c80955265 ("writeback: implement foreign cgroup inode bdi_writeback switching") +Link: http://lkml.kernel.org/g/CAAeU0aMYeM_39Y2+PaRvyB1nqAPYZSNngJ1eBRmrxn7gKAt2Mg@mail.gmail.com +Reported-and-diagnosed-by: Tahsin Erdogan +Tested-by: Tahsin Erdogan +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + fs/fs-writeback.c | 29 +++++++++++++++++++---------- + 1 file changed, 19 insertions(+), 10 deletions(-) + +diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c +index e84b698..60d6fc2 100644 +--- a/fs/fs-writeback.c ++++ b/fs/fs-writeback.c +@@ -1341,10 +1341,10 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc) + * we go e.g. from filesystem. Flusher thread uses __writeback_single_inode() + * and does more profound writeback list handling in writeback_sb_inodes(). + */ +-static int +-writeback_single_inode(struct inode *inode, struct bdi_writeback *wb, +- struct writeback_control *wbc) ++static int writeback_single_inode(struct inode *inode, ++ struct writeback_control *wbc) + { ++ struct bdi_writeback *wb; + int ret = 0; + + spin_lock(&inode->i_lock); +@@ -1382,7 +1382,8 @@ writeback_single_inode(struct inode *inode, struct bdi_writeback *wb, + ret = __writeback_single_inode(inode, wbc); + + wbc_detach_inode(wbc); +- spin_lock(&wb->list_lock); ++ ++ wb = inode_to_wb_and_lock_list(inode); + spin_lock(&inode->i_lock); + /* + * If inode is clean, remove it from writeback lists. Otherwise don't +@@ -1457,6 +1458,7 @@ static long writeback_sb_inodes(struct super_block *sb, + + while (!list_empty(&wb->b_io)) { + struct inode *inode = wb_inode(wb->b_io.prev); ++ struct bdi_writeback *tmp_wb; + + if (inode->i_sb != sb) { + if (work->sb) { +@@ -1547,15 +1549,23 @@ static long writeback_sb_inodes(struct super_block *sb, + cond_resched(); + } + +- +- spin_lock(&wb->list_lock); ++ /* ++ * Requeue @inode if still dirty. Be careful as @inode may ++ * have been switched to another wb in the meantime. ++ */ ++ tmp_wb = inode_to_wb_and_lock_list(inode); + spin_lock(&inode->i_lock); + if (!(inode->i_state & I_DIRTY_ALL)) + wrote++; +- requeue_inode(inode, wb, &wbc); ++ requeue_inode(inode, tmp_wb, &wbc); + inode_sync_complete(inode); + spin_unlock(&inode->i_lock); + ++ if (unlikely(tmp_wb != wb)) { ++ spin_unlock(&tmp_wb->list_lock); ++ spin_lock(&wb->list_lock); ++ } ++ + /* + * bail out to wb_writeback() often enough to check + * background threshold and other termination conditions. +@@ -2342,7 +2352,6 @@ EXPORT_SYMBOL(sync_inodes_sb); + */ + int write_inode_now(struct inode *inode, int sync) + { +- struct bdi_writeback *wb = &inode_to_bdi(inode)->wb; + struct writeback_control wbc = { + .nr_to_write = LONG_MAX, + .sync_mode = sync ? WB_SYNC_ALL : WB_SYNC_NONE, +@@ -2354,7 +2363,7 @@ int write_inode_now(struct inode *inode, int sync) + wbc.nr_to_write = 0; + + might_sleep(); +- return writeback_single_inode(inode, wb, &wbc); ++ return writeback_single_inode(inode, &wbc); + } + EXPORT_SYMBOL(write_inode_now); + +@@ -2371,7 +2380,7 @@ EXPORT_SYMBOL(write_inode_now); + */ + int sync_inode(struct inode *inode, struct writeback_control *wbc) + { +- return writeback_single_inode(inode, &inode_to_bdi(inode)->wb, wbc); ++ return writeback_single_inode(inode, wbc); + } + EXPORT_SYMBOL(sync_inode); + +-- +2.7.1 + + +From 23fd71d2433fca2fdc654386867ef789d6c6869c Mon Sep 17 00:00:00 2001 +From: Benjamin Tissoires +Date: Thu, 17 Mar 2016 17:12:54 -0700 +Subject: [PATCH 203/384] Input: synaptics - handle spurious release of + trackstick buttons, again + +commit 82be788c96ed5978d3cb4a00079e26b981a3df3f upstream. + +Looks like the fimware 8.2 still has the extra buttons spurious release +bug. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=114321 +Signed-off-by: Benjamin Tissoires +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/input/mouse/synaptics.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c +index 6025eb4..a41d832 100644 +--- a/drivers/input/mouse/synaptics.c ++++ b/drivers/input/mouse/synaptics.c +@@ -862,8 +862,9 @@ static void synaptics_report_ext_buttons(struct psmouse *psmouse, + 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 && ++ /* Bug in FW 8.1 & 8.2, buttons are reported only when ExtBit is 1 */ ++ if ((SYN_ID_FULL(priv->identity) == 0x801 || ++ SYN_ID_FULL(priv->identity) == 0x802) && + !((psmouse->packet[0] ^ psmouse->packet[3]) & 0x02)) + return; + +-- +2.7.1 + + +From f9873030bd639bf59377eba06bfc73dc4ec55f43 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Thu, 17 Mar 2016 14:00:17 -0700 +Subject: [PATCH 204/384] Input: ims-pcu - sanity check against missing + interfaces + +commit a0ad220c96692eda76b2e3fd7279f3dcd1d8a8ff upstream. + +A malicious device missing interface can make the driver oops. +Add sanity checking. + +Signed-off-by: Oliver Neukum +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/input/misc/ims-pcu.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c +index ac1fa5f..9c0ea36 100644 +--- a/drivers/input/misc/ims-pcu.c ++++ b/drivers/input/misc/ims-pcu.c +@@ -1663,6 +1663,8 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc + + pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, + union_desc->bMasterInterface0); ++ if (!pcu->ctrl_intf) ++ return -EINVAL; + + alt = pcu->ctrl_intf->cur_altsetting; + pcu->ep_ctrl = &alt->endpoint[0].desc; +@@ -1670,6 +1672,8 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc + + pcu->data_intf = usb_ifnum_to_if(pcu->udev, + union_desc->bSlaveInterface0); ++ if (!pcu->data_intf) ++ return -EINVAL; + + alt = pcu->data_intf->cur_altsetting; + if (alt->desc.bNumEndpoints != 2) { +-- +2.7.1 + + +From 7e938919cbb1f03ad82e5d9e33ae535ac894928e Mon Sep 17 00:00:00 2001 +From: Vladis Dronov +Date: Wed, 23 Mar 2016 11:53:46 -0700 +Subject: [PATCH 205/384] Input: ati_remote2 - fix crashes on detecting device + with invalid descriptor + +commit 950336ba3e4a1ffd2ca60d29f6ef386dd2c7351d upstream. + +The ati_remote2 driver expects at least two interfaces with one +endpoint each. If given malicious descriptor that specify one +interface or no endpoints, it will crash in the probe function. +Ensure there is at least two interfaces and one endpoint for each +interface before using it. + +The full disclosure: http://seclists.org/bugtraq/2016/Mar/90 + +Reported-by: Ralf Spenneberg +Signed-off-by: Vladis Dronov +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/input/misc/ati_remote2.c | 36 ++++++++++++++++++++++++++++++------ + 1 file changed, 30 insertions(+), 6 deletions(-) + +diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c +index cfd58e8..1c5914c 100644 +--- a/drivers/input/misc/ati_remote2.c ++++ b/drivers/input/misc/ati_remote2.c +@@ -817,26 +817,49 @@ static int ati_remote2_probe(struct usb_interface *interface, const struct usb_d + + ar2->udev = udev; + ++ /* Sanity check, first interface must have an endpoint */ ++ if (alt->desc.bNumEndpoints < 1 || !alt->endpoint) { ++ dev_err(&interface->dev, ++ "%s(): interface 0 must have an endpoint\n", __func__); ++ r = -ENODEV; ++ goto fail1; ++ } + ar2->intf[0] = interface; + ar2->ep[0] = &alt->endpoint[0].desc; + ++ /* Sanity check, the device must have two interfaces */ + ar2->intf[1] = usb_ifnum_to_if(udev, 1); ++ if ((udev->actconfig->desc.bNumInterfaces < 2) || !ar2->intf[1]) { ++ dev_err(&interface->dev, "%s(): need 2 interfaces, found %d\n", ++ __func__, udev->actconfig->desc.bNumInterfaces); ++ r = -ENODEV; ++ goto fail1; ++ } ++ + r = usb_driver_claim_interface(&ati_remote2_driver, ar2->intf[1], ar2); + if (r) + goto fail1; ++ ++ /* Sanity check, second interface must have an endpoint */ + alt = ar2->intf[1]->cur_altsetting; ++ if (alt->desc.bNumEndpoints < 1 || !alt->endpoint) { ++ dev_err(&interface->dev, ++ "%s(): interface 1 must have an endpoint\n", __func__); ++ r = -ENODEV; ++ goto fail2; ++ } + ar2->ep[1] = &alt->endpoint[0].desc; + + r = ati_remote2_urb_init(ar2); + if (r) +- goto fail2; ++ goto fail3; + + ar2->channel_mask = channel_mask; + ar2->mode_mask = mode_mask; + + r = ati_remote2_setup(ar2, ar2->channel_mask); + if (r) +- goto fail2; ++ goto fail3; + + usb_make_path(udev, ar2->phys, sizeof(ar2->phys)); + strlcat(ar2->phys, "/input0", sizeof(ar2->phys)); +@@ -845,11 +868,11 @@ static int ati_remote2_probe(struct usb_interface *interface, const struct usb_d + + r = sysfs_create_group(&udev->dev.kobj, &ati_remote2_attr_group); + if (r) +- goto fail2; ++ goto fail3; + + r = ati_remote2_input_init(ar2); + if (r) +- goto fail3; ++ goto fail4; + + usb_set_intfdata(interface, ar2); + +@@ -857,10 +880,11 @@ static int ati_remote2_probe(struct usb_interface *interface, const struct usb_d + + return 0; + +- fail3: ++ fail4: + sysfs_remove_group(&udev->dev.kobj, &ati_remote2_attr_group); +- fail2: ++ fail3: + ati_remote2_urb_cleanup(ar2); ++ fail2: + usb_driver_release_interface(&ati_remote2_driver, ar2->intf[1]); + fail1: + kfree(ar2); +-- +2.7.1 + + +From 864ccc15f6aad6d16f26f2b9503c9019d4699ffa Mon Sep 17 00:00:00 2001 +From: Joseph Qi +Date: Fri, 25 Mar 2016 14:21:26 -0700 +Subject: [PATCH 206/384] ocfs2/dlm: fix race between convert and recovery + +commit ac7cf246dfdbec3d8fed296c7bf30e16f5099dac upstream. + +There is a race window between dlmconvert_remote and +dlm_move_lockres_to_recovery_list, which will cause a lock with +OCFS2_LOCK_BUSY in grant list, thus system hangs. + +dlmconvert_remote +{ + spin_lock(&res->spinlock); + list_move_tail(&lock->list, &res->converting); + lock->convert_pending = 1; + spin_unlock(&res->spinlock); + + status = dlm_send_remote_convert_request(); + >>>>>> race window, master has queued ast and return DLM_NORMAL, + and then down before sending ast. + this node detects master down and calls + dlm_move_lockres_to_recovery_list, which will revert the + lock to grant list. + Then OCFS2_LOCK_BUSY won't be cleared as new master won't + send ast any more because it thinks already be authorized. + + spin_lock(&res->spinlock); + lock->convert_pending = 0; + if (status != DLM_NORMAL) + dlm_revert_pending_convert(res, lock); + spin_unlock(&res->spinlock); +} + +In this case, check if res->state has DLM_LOCK_RES_RECOVERING bit set +(res is still in recovering) or res master changed (new master has +finished recovery), reset the status to DLM_RECOVERING, then it will +retry convert. + +Signed-off-by: Joseph Qi +Reported-by: Yiwen Jiang +Reviewed-by: Junxiao Bi +Cc: Mark Fasheh +Cc: Joel Becker +Cc: Tariq Saeed +Cc: Junxiao Bi +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + fs/ocfs2/dlm/dlmconvert.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/fs/ocfs2/dlm/dlmconvert.c b/fs/ocfs2/dlm/dlmconvert.c +index e36d63f..84de55e 100644 +--- a/fs/ocfs2/dlm/dlmconvert.c ++++ b/fs/ocfs2/dlm/dlmconvert.c +@@ -262,6 +262,7 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm, + struct dlm_lock *lock, int flags, int type) + { + enum dlm_status status; ++ u8 old_owner = res->owner; + + mlog(0, "type=%d, convert_type=%d, busy=%d\n", lock->ml.type, + lock->ml.convert_type, res->state & DLM_LOCK_RES_IN_PROGRESS); +@@ -316,11 +317,19 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm, + spin_lock(&res->spinlock); + res->state &= ~DLM_LOCK_RES_IN_PROGRESS; + lock->convert_pending = 0; +- /* if it failed, move it back to granted queue */ ++ /* if it failed, move it back to granted queue. ++ * if master returns DLM_NORMAL and then down before sending ast, ++ * it may have already been moved to granted queue, reset to ++ * DLM_RECOVERING and retry convert */ + if (status != DLM_NORMAL) { + if (status != DLM_NOTQUEUED) + dlm_error(status); + dlm_revert_pending_convert(res, lock); ++ } else if ((res->state & DLM_LOCK_RES_RECOVERING) || ++ (old_owner != res->owner)) { ++ mlog(0, "res %.*s is in recovering or has been recovered.\n", ++ res->lockname.len, res->lockname.name); ++ status = DLM_RECOVERING; + } + bail: + spin_unlock(&res->spinlock); +-- +2.7.1 + + +From 92bd1a26c247f119865bee4deb10817c3a3f42d8 Mon Sep 17 00:00:00 2001 +From: Joseph Qi +Date: Fri, 25 Mar 2016 14:21:29 -0700 +Subject: [PATCH 207/384] ocfs2/dlm: fix BUG in + dlm_move_lockres_to_recovery_list + +commit be12b299a83fc807bbaccd2bcb8ec50cbb0cb55c upstream. + +When master handles convert request, it queues ast first and then +returns status. This may happen that the ast is sent before the request +status because the above two messages are sent by two threads. And +right after the ast is sent, if master down, it may trigger BUG in +dlm_move_lockres_to_recovery_list in the requested node because ast +handler moves it to grant list without clear lock->convert_pending. So +remove BUG_ON statement and check if the ast is processed in +dlmconvert_remote. + +Signed-off-by: Joseph Qi +Reported-by: Yiwen Jiang +Cc: Junxiao Bi +Cc: Mark Fasheh +Cc: Joel Becker +Cc: Tariq Saeed +Cc: Junxiao Bi +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + fs/ocfs2/dlm/dlmconvert.c | 13 +++++++++++++ + fs/ocfs2/dlm/dlmrecovery.c | 1 - + 2 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/fs/ocfs2/dlm/dlmconvert.c b/fs/ocfs2/dlm/dlmconvert.c +index 84de55e..f909313 100644 +--- a/fs/ocfs2/dlm/dlmconvert.c ++++ b/fs/ocfs2/dlm/dlmconvert.c +@@ -288,6 +288,19 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm, + status = DLM_DENIED; + goto bail; + } ++ ++ if (lock->ml.type == type && lock->ml.convert_type == LKM_IVMODE) { ++ mlog(0, "last convert request returned DLM_RECOVERING, but " ++ "owner has already queued and sent ast to me. res %.*s, " ++ "(cookie=%u:%llu, type=%d, conv=%d)\n", ++ res->lockname.len, res->lockname.name, ++ dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)), ++ dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)), ++ lock->ml.type, lock->ml.convert_type); ++ status = DLM_NORMAL; ++ goto bail; ++ } ++ + res->state |= DLM_LOCK_RES_IN_PROGRESS; + /* move lock to local convert queue */ + /* do not alter lock refcount. switching lists. */ +diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c +index 42f0cae..4a33880 100644 +--- a/fs/ocfs2/dlm/dlmrecovery.c ++++ b/fs/ocfs2/dlm/dlmrecovery.c +@@ -2064,7 +2064,6 @@ void dlm_move_lockres_to_recovery_list(struct dlm_ctxt *dlm, + dlm_lock_get(lock); + if (lock->convert_pending) { + /* move converting lock back to granted */ +- BUG_ON(i != DLM_CONVERTING_LIST); + mlog(0, "node died with convert pending " + "on %.*s. move back to granted list.\n", + res->lockname.len, res->lockname.name); +-- +2.7.1 + + +From 0b638ce606e1e6321b40243f8e733f300fdbf498 Mon Sep 17 00:00:00 2001 +From: Vlastimil Babka +Date: Fri, 25 Mar 2016 14:21:50 -0700 +Subject: [PATCH 208/384] mm/page_alloc: prevent merging between isolated and + other pageblocks + +commit d9dddbf556674bf125ecd925b24e43a5cf2a568a upstream. + +Hanjun Guo has reported that a CMA stress test causes broken accounting of +CMA and free pages: + +> Before the test, I got: +> -bash-4.3# cat /proc/meminfo | grep Cma +> CmaTotal: 204800 kB +> CmaFree: 195044 kB +> +> +> After running the test: +> -bash-4.3# cat /proc/meminfo | grep Cma +> CmaTotal: 204800 kB +> CmaFree: 6602584 kB +> +> So the freed CMA memory is more than total.. +> +> Also the the MemFree is more than mem total: +> +> -bash-4.3# cat /proc/meminfo +> MemTotal: 16342016 kB +> MemFree: 22367268 kB +> MemAvailable: 22370528 kB + +Laura Abbott has confirmed the issue and suspected the freepage accounting +rewrite around 3.18/4.0 by Joonsoo Kim. Joonsoo had a theory that this is +caused by unexpected merging between MIGRATE_ISOLATE and MIGRATE_CMA +pageblocks: + +> CMA isolates MAX_ORDER aligned blocks, but, during the process, +> partialy isolated block exists. If MAX_ORDER is 11 and +> pageblock_order is 9, two pageblocks make up MAX_ORDER +> aligned block and I can think following scenario because pageblock +> (un)isolation would be done one by one. +> +> (each character means one pageblock. 'C', 'I' means MIGRATE_CMA, +> MIGRATE_ISOLATE, respectively. +> +> CC -> IC -> II (Isolation) +> II -> CI -> CC (Un-isolation) +> +> If some pages are freed at this intermediate state such as IC or CI, +> that page could be merged to the other page that is resident on +> different type of pageblock and it will cause wrong freepage count. + +This was supposed to be prevented by CMA operating on MAX_ORDER blocks, +but since it doesn't hold the zone->lock between pageblocks, a race +window does exist. + +It's also likely that unexpected merging can occur between +MIGRATE_ISOLATE and non-CMA pageblocks. This should be prevented in +__free_one_page() since commit 3c605096d315 ("mm/page_alloc: restrict +max order of merging on isolated pageblock"). However, we only check +the migratetype of the pageblock where buddy merging has been initiated, +not the migratetype of the buddy pageblock (or group of pageblocks) +which can be MIGRATE_ISOLATE. + +Joonsoo has suggested checking for buddy migratetype as part of +page_is_buddy(), but that would add extra checks in allocator hotpath +and bloat-o-meter has shown significant code bloat (the function is +inline). + +This patch reduces the bloat at some expense of more complicated code. +The buddy-merging while-loop in __free_one_page() is initially bounded +to pageblock_border and without any migratetype checks. The checks are +placed outside, bumping the max_order if merging is allowed, and +returning to the while-loop with a statement which can't be possibly +considered harmful. + +This fixes the accounting bug and also removes the arguably weird state +in the original commit 3c605096d315 where buddies could be left +unmerged. + +Fixes: 3c605096d315 ("mm/page_alloc: restrict max order of merging on isolated pageblock") +Link: https://lkml.org/lkml/2016/3/2/280 +Signed-off-by: Vlastimil Babka +Reported-by: Hanjun Guo +Tested-by: Hanjun Guo +Acked-by: Joonsoo Kim +Debugged-by: Laura Abbott +Debugged-by: Joonsoo Kim +Cc: Mel Gorman +Cc: "Kirill A. Shutemov" +Cc: Johannes Weiner +Cc: Minchan Kim +Cc: Yasuaki Ishimatsu +Cc: Zhang Yanfei +Cc: Michal Nazarewicz +Cc: Naoya Horiguchi +Cc: "Aneesh Kumar K.V" +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + mm/page_alloc.c | 46 +++++++++++++++++++++++++++++++++------------- + 1 file changed, 33 insertions(+), 13 deletions(-) + +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index d002418..4ea5d17 100644 +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@ -675,34 +675,28 @@ static inline void __free_one_page(struct page *page, + unsigned long combined_idx; + unsigned long uninitialized_var(buddy_idx); + struct page *buddy; +- unsigned int max_order = MAX_ORDER; ++ unsigned int max_order; ++ ++ max_order = min_t(unsigned int, MAX_ORDER, pageblock_order + 1); + + VM_BUG_ON(!zone_is_initialized(zone)); + VM_BUG_ON_PAGE(page->flags & PAGE_FLAGS_CHECK_AT_PREP, page); + + VM_BUG_ON(migratetype == -1); +- if (is_migrate_isolate(migratetype)) { +- /* +- * We restrict max order of merging to prevent merge +- * between freepages on isolate pageblock and normal +- * pageblock. Without this, pageblock isolation +- * could cause incorrect freepage accounting. +- */ +- max_order = min_t(unsigned int, MAX_ORDER, pageblock_order + 1); +- } else { ++ if (likely(!is_migrate_isolate(migratetype))) + __mod_zone_freepage_state(zone, 1 << order, migratetype); +- } + +- page_idx = pfn & ((1 << max_order) - 1); ++ page_idx = pfn & ((1 << MAX_ORDER) - 1); + + VM_BUG_ON_PAGE(page_idx & ((1 << order) - 1), page); + VM_BUG_ON_PAGE(bad_range(zone, page), page); + ++continue_merging: + while (order < max_order - 1) { + buddy_idx = __find_buddy_index(page_idx, order); + buddy = page + (buddy_idx - page_idx); + if (!page_is_buddy(page, buddy, order)) +- break; ++ goto done_merging; + /* + * Our buddy is free or it is CONFIG_DEBUG_PAGEALLOC guard page, + * merge with it and move up one order. +@@ -719,6 +713,32 @@ static inline void __free_one_page(struct page *page, + page_idx = combined_idx; + order++; + } ++ if (max_order < MAX_ORDER) { ++ /* If we are here, it means order is >= pageblock_order. ++ * We want to prevent merge between freepages on isolate ++ * pageblock and normal pageblock. Without this, pageblock ++ * isolation could cause incorrect freepage or CMA accounting. ++ * ++ * We don't want to hit this code for the more frequent ++ * low-order merging. ++ */ ++ if (unlikely(has_isolate_pageblock(zone))) { ++ int buddy_mt; ++ ++ buddy_idx = __find_buddy_index(page_idx, order); ++ buddy = page + (buddy_idx - page_idx); ++ buddy_mt = get_pageblock_migratetype(buddy); ++ ++ if (migratetype != buddy_mt ++ && (is_migrate_isolate(migratetype) || ++ is_migrate_isolate(buddy_mt))) ++ goto done_merging; ++ } ++ max_order++; ++ goto continue_merging; ++ } ++ ++done_merging: + set_page_order(page, order); + + /* +-- +2.7.1 + + +From 4adcf6c43e8777571b454c6c2fdd151e1f69966d Mon Sep 17 00:00:00 2001 +From: Aaro Koskinen +Date: Sat, 20 Feb 2016 22:27:48 +0200 +Subject: [PATCH 209/384] mtd: onenand: fix deadlock in onenand_block_markbad + +commit 5e64c29e98bfbba1b527b0a164f9493f3db9e8cb upstream. + +Commit 5942ddbc500d ("mtd: introduce mtd_block_markbad interface") +incorrectly changed onenand_block_markbad() to call mtd_block_markbad +instead of onenand_chip's block_markbad function. As a result the function +will now recurse and deadlock. Fix by reverting the change. + +Fixes: 5942ddbc500d ("mtd: introduce mtd_block_markbad interface") +Signed-off-by: Aaro Koskinen +Acked-by: Artem Bityutskiy +Signed-off-by: Brian Norris +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mtd/onenand/onenand_base.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c +index 43b3392..652d018 100644 +--- a/drivers/mtd/onenand/onenand_base.c ++++ b/drivers/mtd/onenand/onenand_base.c +@@ -2599,6 +2599,7 @@ static int onenand_default_block_markbad(struct mtd_info *mtd, loff_t ofs) + */ + static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs) + { ++ struct onenand_chip *this = mtd->priv; + int ret; + + ret = onenand_block_isbad(mtd, ofs); +@@ -2610,7 +2611,7 @@ static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs) + } + + onenand_get_device(mtd, FL_WRITING); +- ret = mtd_block_markbad(mtd, ofs); ++ ret = this->block_markbad(mtd, ofs); + onenand_release_device(mtd); + return ret; + } +-- +2.7.1 + + +From c93190253b3255f6d338ac6275e7ebbcedec9bb1 Mon Sep 17 00:00:00 2001 +From: Len Brown +Date: Sun, 13 Mar 2016 00:33:48 -0500 +Subject: [PATCH 210/384] intel_idle: prevent SKL-H boot failure when C8+C9+C10 + enabled + +commit d70e28f57e14a481977436695b0c9ba165472431 upstream. + +Some SKL-H configurations require "intel_idle.max_cstate=7" to boot. +While that is an effective workaround, it disables C10. + +This patch detects the problematic configuration, +and disables C8 and C9, keeping C10 enabled. + +Note that enabling SGX in BIOS SETUP can also prevent this issue, +if the system BIOS provides that option. + +https://bugzilla.kernel.org/show_bug.cgi?id=109081 +"Freezes with Intel i7 6700HQ (Skylake), unless intel_idle.max_cstate=7" + +Signed-off-by: Len Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/idle/intel_idle.c | 108 ++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 86 insertions(+), 22 deletions(-) + +diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c +index cd4510a..146eed70b 100644 +--- a/drivers/idle/intel_idle.c ++++ b/drivers/idle/intel_idle.c +@@ -65,7 +65,7 @@ + #include + #include + +-#define INTEL_IDLE_VERSION "0.4" ++#define INTEL_IDLE_VERSION "0.4.1" + #define PREFIX "intel_idle: " + + static struct cpuidle_driver intel_idle_driver = { +@@ -994,36 +994,92 @@ static void intel_idle_cpuidle_devices_uninit(void) + } + + /* +- * intel_idle_state_table_update() +- * +- * Update the default state_table for this CPU-id ++ * ivt_idle_state_table_update(void) + * +- * Currently used to access tuned IVT multi-socket targets ++ * Tune IVT multi-socket targets + * Assumption: num_sockets == (max_package_num + 1) + */ +-void intel_idle_state_table_update(void) ++static void ivt_idle_state_table_update(void) + { + /* IVT uses a different table for 1-2, 3-4, and > 4 sockets */ +- if (boot_cpu_data.x86_model == 0x3e) { /* IVT */ +- int cpu, package_num, num_sockets = 1; +- +- for_each_online_cpu(cpu) { +- package_num = topology_physical_package_id(cpu); +- if (package_num + 1 > num_sockets) { +- num_sockets = package_num + 1; +- +- if (num_sockets > 4) { +- cpuidle_state_table = ivt_cstates_8s; +- return; +- } ++ int cpu, package_num, num_sockets = 1; ++ ++ for_each_online_cpu(cpu) { ++ package_num = topology_physical_package_id(cpu); ++ if (package_num + 1 > num_sockets) { ++ num_sockets = package_num + 1; ++ ++ if (num_sockets > 4) { ++ cpuidle_state_table = ivt_cstates_8s; ++ return; + } + } ++ } ++ ++ if (num_sockets > 2) ++ cpuidle_state_table = ivt_cstates_4s; ++ ++ /* else, 1 and 2 socket systems use default ivt_cstates */ ++} ++/* ++ * sklh_idle_state_table_update(void) ++ * ++ * On SKL-H (model 0x5e) disable C8 and C9 if: ++ * C10 is enabled and SGX disabled ++ */ ++static void sklh_idle_state_table_update(void) ++{ ++ unsigned long long msr; ++ unsigned int eax, ebx, ecx, edx; ++ ++ ++ /* if PC10 disabled via cmdline intel_idle.max_cstate=7 or shallower */ ++ if (max_cstate <= 7) ++ return; ++ ++ /* if PC10 not present in CPUID.MWAIT.EDX */ ++ if ((mwait_substates & (0xF << 28)) == 0) ++ return; ++ ++ rdmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr); ++ ++ /* PC10 is not enabled in PKG C-state limit */ ++ if ((msr & 0xF) != 8) ++ return; ++ ++ ecx = 0; ++ cpuid(7, &eax, &ebx, &ecx, &edx); ++ ++ /* if SGX is present */ ++ if (ebx & (1 << 2)) { + +- if (num_sockets > 2) +- cpuidle_state_table = ivt_cstates_4s; +- /* else, 1 and 2 socket systems use default ivt_cstates */ ++ rdmsrl(MSR_IA32_FEATURE_CONTROL, msr); ++ ++ /* if SGX is enabled */ ++ if (msr & (1 << 18)) ++ return; ++ } ++ ++ skl_cstates[5].disabled = 1; /* C8-SKL */ ++ skl_cstates[6].disabled = 1; /* C9-SKL */ ++} ++/* ++ * intel_idle_state_table_update() ++ * ++ * Update the default state_table for this CPU-id ++ */ ++ ++static void intel_idle_state_table_update(void) ++{ ++ switch (boot_cpu_data.x86_model) { ++ ++ case 0x3e: /* IVT */ ++ ivt_idle_state_table_update(); ++ break; ++ case 0x5e: /* SKL-H */ ++ sklh_idle_state_table_update(); ++ break; + } +- return; + } + + /* +@@ -1063,6 +1119,14 @@ static int __init intel_idle_cpuidle_driver_init(void) + if (num_substates == 0) + continue; + ++ /* if state marked as disabled, skip it */ ++ if (cpuidle_state_table[cstate].disabled != 0) { ++ pr_debug(PREFIX "state %s is disabled", ++ cpuidle_state_table[cstate].name); ++ continue; ++ } ++ ++ + if (((mwait_cstate + 1) > 2) && + !boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) + mark_tsc_unstable("TSC halts in idle" +-- +2.7.1 + + +From 8c8c194586d1d2da955e27325a6d2953ec0ca6f0 Mon Sep 17 00:00:00 2001 +From: Lukas Wunner +Date: Wed, 23 Mar 2016 00:11:20 +0100 +Subject: [PATCH 211/384] PM / sleep: Clear pm_suspend_global_flags upon + hibernate + +commit 276142730c39c9839465a36a90e5674a8c34e839 upstream. + +When suspending to RAM, waking up and later suspending to disk, +we gratuitously runtime resume devices after the thaw phase. +This does not occur if we always suspend to RAM or always to disk. + +pm_complete_with_resume_check(), which gets called from +pci_pm_complete() among others, schedules a runtime resume +if PM_SUSPEND_FLAG_FW_RESUME is set. The flag is set during +a suspend-to-RAM cycle. It is cleared at the beginning of +the suspend-to-RAM cycle but not afterwards and it is not +cleared during a suspend-to-disk cycle at all. Fix it. + +Fixes: ef25ba047601 (PM / sleep: Add flags to indicate platform firmware involvement) +Signed-off-by: Lukas Wunner +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + kernel/power/hibernate.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c +index fbb23f9..908ee58 100644 +--- a/kernel/power/hibernate.c ++++ b/kernel/power/hibernate.c +@@ -342,6 +342,7 @@ int hibernation_snapshot(int platform_mode) + pm_message_t msg; + int error; + ++ pm_suspend_clear_flags(); + error = platform_begin(platform_mode); + if (error) + goto Close; +-- +2.7.1 + + +From e98c901e8751de5af099a8c4cee32a792df9511a Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Fri, 18 Mar 2016 14:55:38 +0100 +Subject: [PATCH 212/384] scsi_common: do not clobber fixed sense information + +commit ba08311647892cc7912de74525fd78416caf544a upstream. + +For fixed sense the information field is 32 bits, to we need to truncate +the information field to avoid clobbering the sense code. + +Fixes: a1524f226a02 ("libata-eh: Set 'information' field for autosense") +Signed-off-by: Hannes Reinecke +Reviewed-by: Lee Duncan +Reviewed-by: Bart Van Assche +Reviewed-by: Ewan D. Milne +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/scsi_common.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common.c +index c126966..ce79de8 100644 +--- a/drivers/scsi/scsi_common.c ++++ b/drivers/scsi/scsi_common.c +@@ -278,8 +278,16 @@ int scsi_set_sense_information(u8 *buf, int buf_len, u64 info) + ucp[3] = 0; + put_unaligned_be64(info, &ucp[4]); + } else if ((buf[0] & 0x7f) == 0x70) { +- buf[0] |= 0x80; +- put_unaligned_be64(info, &buf[3]); ++ /* ++ * Only set the 'VALID' bit if we can represent the value ++ * correctly; otherwise just fill out the lower bytes and ++ * clear the 'VALID' flag. ++ */ ++ if (info <= 0xffffffffUL) ++ buf[0] |= 0x80; ++ else ++ buf[0] &= 0x7f; ++ put_unaligned_be32((u32)info, &buf[3]); + } + + return 0; +-- +2.7.1 + + +From 96a014ab84d37972cd19a9f8d726563009c94a92 Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner +Date: Fri, 4 Mar 2016 15:59:42 +0100 +Subject: [PATCH 213/384] sched/cputime: Fix steal time accounting vs. CPU + hotplug + +commit e9532e69b8d1d1284e8ecf8d2586de34aec61244 upstream. + +On CPU hotplug the steal time accounting can keep a stale rq->prev_steal_time +value over CPU down and up. So after the CPU comes up again the delta +calculation in steal_account_process_tick() wreckages itself due to the +unsigned math: + + u64 steal = paravirt_steal_clock(smp_processor_id()); + + steal -= this_rq()->prev_steal_time; + +So if steal is smaller than rq->prev_steal_time we end up with an insane large +value which then gets added to rq->prev_steal_time, resulting in a permanent +wreckage of the accounting. As a consequence the per CPU stats in /proc/stat +become stale. + +Nice trick to tell the world how idle the system is (100%) while the CPU is +100% busy running tasks. Though we prefer realistic numbers. + +None of the accounting values which use a previous value to account for +fractions is reset at CPU hotplug time. update_rq_clock_task() has a sanity +check for prev_irq_time and prev_steal_time_rq, but that sanity check solely +deals with clock warps and limits the /proc/stat visible wreckage. The +prev_time values are still wrong. + +Solution is simple: Reset rq->prev_*_time when the CPU is plugged in again. + +Signed-off-by: Thomas Gleixner +Acked-by: Rik van Riel +Cc: Frederic Weisbecker +Cc: Glauber Costa +Cc: Linus Torvalds +Cc: Peter Zijlstra +Fixes: commit 095c0aa83e52 "sched: adjust scheduler cpu power for stolen time" +Fixes: commit aa483808516c "sched: Remove irq time from available CPU power" +Fixes: commit e6e6685accfa "KVM guest: Steal time accounting" +Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1603041539490.3686@nanos +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + kernel/sched/core.c | 1 + + kernel/sched/sched.h | 13 +++++++++++++ + 2 files changed, 14 insertions(+) + +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 94827a5..da96d97 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -5768,6 +5768,7 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu) + + case CPU_UP_PREPARE: + rq->calc_load_update = calc_load_update; ++ account_reset_rq(rq); + break; + + case CPU_ONLINE: +diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h +index 7dd5f53..a8a9b156 100644 +--- a/kernel/sched/sched.h ++++ b/kernel/sched/sched.h +@@ -1780,3 +1780,16 @@ static inline u64 irq_time_read(int cpu) + } + #endif /* CONFIG_64BIT */ + #endif /* CONFIG_IRQ_TIME_ACCOUNTING */ ++ ++static inline void account_reset_rq(struct rq *rq) ++{ ++#ifdef CONFIG_IRQ_TIME_ACCOUNTING ++ rq->prev_irq_time = 0; ++#endif ++#ifdef CONFIG_PARAVIRT ++ rq->prev_steal_time = 0; ++#endif ++#ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING ++ rq->prev_steal_time_rq = 0; ++#endif ++} +-- +2.7.1 + + +From bc2b333f797bc725cf1b3a274a320c87ba69dd40 Mon Sep 17 00:00:00 2001 +From: Stephane Eranian +Date: Thu, 3 Mar 2016 20:50:41 +0100 +Subject: [PATCH 214/384] perf/x86/pebs: Add workaround for broken OVFL status + on HSW+ + +commit 8077eca079a212f26419c57226f28696b7100683 upstream. + +This patch fixes an issue with the GLOBAL_OVERFLOW_STATUS bits on +Haswell, Broadwell and Skylake processors when using PEBS. + +The SDM stipulates that when the PEBS iterrupt threshold is crossed, +an interrupt is posted and the kernel is interrupted. The kernel will +find GLOBAL_OVF_SATUS bit 62 set indicating there are PEBS records to +drain. But the bits corresponding to the actual counters should NOT be +set. The kernel follows the SDM and assumes that all PEBS events are +processed in the drain_pebs() callback. The kernel then checks for +remaining overflows on any other (non-PEBS) events and processes these +in the for_each_bit_set(&status) loop. + +As it turns out, under certain conditions on HSW and later processors, +on PEBS buffer interrupt, bit 62 is set but the counter bits may be +set as well. In that case, the kernel drains PEBS and generates +SAMPLES with the EXACT tag, then it processes the counter bits, and +generates normal (non-EXACT) SAMPLES. + +I ran into this problem by trying to understand why on HSW sampling on +a PEBS event was sometimes returning SAMPLES without the EXACT tag. +This should not happen on user level code because HSW has the +eventing_ip which always point to the instruction that caused the +event. + +The workaround in this patch simply ensures that the bits for the +counters used for PEBS events are cleared after the PEBS buffer has +been drained. With this fix 100% of the PEBS samples on my user code +report the EXACT tag. + +Before: + $ perf record -e cpu/event=0xd0,umask=0x81/upp ./multichase + $ perf report -D | fgrep SAMPLES + PERF_RECORD_SAMPLE(IP, 0x2): 11775/11775: 0x406de5 period: 73469 addr: 0 exact=Y + \--- EXACT tag is missing + +After: + $ perf record -e cpu/event=0xd0,umask=0x81/upp ./multichase + $ perf report -D | fgrep SAMPLES + PERF_RECORD_SAMPLE(IP, 0x4002): 11775/11775: 0x406de5 period: 73469 addr: 0 exact=Y + \--- EXACT tag is set + +The problem tends to appear more often when multiple PEBS events are used. + +Signed-off-by: Stephane Eranian +Signed-off-by: Peter Zijlstra (Intel) +Cc: Alexander Shishkin +Cc: Arnaldo Carvalho de Melo +Cc: Jiri Olsa +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Cc: Vince Weaver +Cc: adrian.hunter@intel.com +Cc: kan.liang@intel.com +Cc: namhyung@kernel.org +Link: http://lkml.kernel.org/r/1457034642-21837-3-git-send-email-eranian@google.com +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kernel/cpu/perf_event_intel.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c +index e2a4300..ad6768f 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel.c ++++ b/arch/x86/kernel/cpu/perf_event_intel.c +@@ -1840,6 +1840,16 @@ again: + if (__test_and_clear_bit(62, (unsigned long *)&status)) { + handled++; + x86_pmu.drain_pebs(regs); ++ /* ++ * There are cases where, even though, the PEBS ovfl bit is set ++ * in GLOBAL_OVF_STATUS, the PEBS events may also have their ++ * overflow bits set for their counters. We must clear them ++ * here because they have been processed as exact samples in ++ * the drain_pebs() routine. They must not be processed again ++ * in the for_each_bit_set() loop for regular samples below. ++ */ ++ status &= ~cpuc->pebs_enabled; ++ status &= x86_pmu.intel_ctrl | GLOBAL_STATUS_TRACE_TOPAPMI; + } + + /* +-- +2.7.1 + + +From ffe193110f44c3072ddd7e08d484859959353d80 Mon Sep 17 00:00:00 2001 +From: Kan Liang +Date: Thu, 3 Mar 2016 18:07:28 -0500 +Subject: [PATCH 215/384] perf/x86/intel: Fix PEBS warning by only restoring + active PMU in pmi + +commit c3d266c8a9838cc141b69548bc3b1b18808ae8c4 upstream. + +This patch tries to fix a PEBS warning found in my stress test. The +following perf command can easily trigger the pebs warning or spurious +NMI error on Skylake/Broadwell/Haswell platforms: + + sudo perf record -e 'cpu/umask=0x04,event=0xc4/pp,cycles,branches,ref-cycles,cache-misses,cache-references' --call-graph fp -b -c1000 -a + +Also the NMI watchdog must be enabled. + +For this case, the events number is larger than counter number. So +perf has to do multiplexing. + +In perf_mux_hrtimer_handler, it does perf_pmu_disable(), schedule out +old events, rotate_ctx, schedule in new events and finally +perf_pmu_enable(). + +If the old events include precise event, the MSR_IA32_PEBS_ENABLE +should be cleared when perf_pmu_disable(). The MSR_IA32_PEBS_ENABLE +should keep 0 until the perf_pmu_enable() is called and the new event is +precise event. + +However, there is a corner case which could restore PEBS_ENABLE to +stale value during the above period. In perf_pmu_disable(), GLOBAL_CTRL +will be set to 0 to stop overflow and followed PMI. But there may be +pending PMI from an earlier overflow, which cannot be stopped. So even +GLOBAL_CTRL is cleared, the kernel still be possible to get PMI. At +the end of the PMI handler, __intel_pmu_enable_all() will be called, +which will restore the stale values if old events haven't scheduled +out. + +Once the stale pebs value is set, it's impossible to be corrected if +the new events are non-precise. Because the pebs_enabled will be set +to 0. x86_pmu.enable_all() will ignore the MSR_IA32_PEBS_ENABLE +setting. As a result, the following NMI with stale PEBS_ENABLE +trigger pebs warning. + +The pending PMI after enabled=0 will become harmless if the NMI handler +does not change the state. This patch checks cpuc->enabled in pmi and +only restore the state when PMU is active. + +Here is the dump: + + Call Trace: + [] dump_stack+0x63/0x85 + [] warn_slowpath_common+0x82/0xc0 + [] warn_slowpath_null+0x1a/0x20 + [] intel_pmu_drain_pebs_nhm+0x2be/0x320 + [] intel_pmu_handle_irq+0x279/0x460 + [] ? native_write_msr_safe+0x6/0x40 + [] ? vunmap_page_range+0x20d/0x330 + [] ? unmap_kernel_range_noflush+0x11/0x20 + [] ? ghes_copy_tofrom_phys+0x10f/0x2a0 + [] ? ghes_read_estatus+0x98/0x170 + [] perf_event_nmi_handler+0x2d/0x50 + [] nmi_handle+0x69/0x120 + [] default_do_nmi+0xe6/0x100 + [] do_nmi+0xe2/0x130 + [] end_repeat_nmi+0x1a/0x1e + [] ? native_write_msr_safe+0x6/0x40 + [] ? native_write_msr_safe+0x6/0x40 + [] ? native_write_msr_safe+0x6/0x40 + <> [] ? x86_perf_event_set_period+0xd8/0x180 + [] x86_pmu_start+0x4c/0x100 + [] x86_pmu_enable+0x28d/0x300 + [] perf_pmu_enable.part.81+0x7/0x10 + [] perf_mux_hrtimer_handler+0x200/0x280 + [] ? __perf_install_in_context+0xc0/0xc0 + [] __hrtimer_run_queues+0xfd/0x280 + [] hrtimer_interrupt+0xa8/0x190 + [] ? __perf_read_group_add.part.61+0x1a0/0x1a0 + [] local_apic_timer_interrupt+0x38/0x60 + [] smp_apic_timer_interrupt+0x3d/0x50 + [] apic_timer_interrupt+0x8c/0xa0 + [] ? __perf_read_group_add.part.61+0x1a0/0x1a0 + [] ? smp_call_function_single+0xd5/0x130 + [] ? smp_call_function_single+0xcb/0x130 + [] ? __perf_read_group_add.part.61+0x1a0/0x1a0 + [] event_function_call+0x10a/0x120 + [] ? ctx_resched+0x90/0x90 + [] ? cpu_clock_event_read+0x30/0x30 + [] ? _perf_event_disable+0x60/0x60 + [] _perf_event_enable+0x5b/0x70 + [] perf_event_for_each_child+0x38/0xa0 + [] ? _perf_event_disable+0x60/0x60 + [] perf_ioctl+0x12d/0x3c0 + [] ? selinux_file_ioctl+0x95/0x1e0 + [] do_vfs_ioctl+0xa1/0x5a0 + [] ? sched_clock+0x9/0x10 + [] SyS_ioctl+0x79/0x90 + [] entry_SYSCALL_64_fastpath+0x1a/0xa4 + ---[ end trace aef202839fe9a71d ]--- + Uhhuh. NMI received for unknown reason 2d on CPU 2. + Do you have a strange power saving mode enabled? + +Signed-off-by: Kan Liang +Signed-off-by: Peter Zijlstra (Intel) +Cc: Alexander Shishkin +Cc: Arnaldo Carvalho de Melo +Cc: Jiri Olsa +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Stephane Eranian +Cc: Thomas Gleixner +Cc: Vince Weaver +Link: http://lkml.kernel.org/r/1457046448-6184-1-git-send-email-kan.liang@intel.com +[ Fixed various typos and other small details. ] +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kernel/cpu/perf_event.c | 13 +++++++++++++ + arch/x86/kernel/cpu/perf_event_intel.c | 15 +++++++++++++-- + arch/x86/kernel/cpu/perf_event_knc.c | 4 +++- + 3 files changed, 29 insertions(+), 3 deletions(-) + +diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c +index 2bf79d7..a3aeb2c 100644 +--- a/arch/x86/kernel/cpu/perf_event.c ++++ b/arch/x86/kernel/cpu/perf_event.c +@@ -593,6 +593,19 @@ void x86_pmu_disable_all(void) + } + } + ++/* ++ * There may be PMI landing after enabled=0. The PMI hitting could be before or ++ * after disable_all. ++ * ++ * If PMI hits before disable_all, the PMU will be disabled in the NMI handler. ++ * It will not be re-enabled in the NMI handler again, because enabled=0. After ++ * handling the NMI, disable_all will be called, which will not change the ++ * state either. If PMI hits after disable_all, the PMU is already disabled ++ * before entering NMI handler. The NMI handler will not change the state ++ * either. ++ * ++ * So either situation is harmless. ++ */ + static void x86_pmu_disable(struct pmu *pmu) + { + struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); +diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c +index ad6768f..98a01fd1 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel.c ++++ b/arch/x86/kernel/cpu/perf_event_intel.c +@@ -1458,7 +1458,15 @@ static __initconst const u64 slm_hw_cache_event_ids + }; + + /* +- * Use from PMIs where the LBRs are already disabled. ++ * Used from PMIs where the LBRs are already disabled. ++ * ++ * This function could be called consecutively. It is required to remain in ++ * disabled state if called consecutively. ++ * ++ * During consecutive calls, the same disable value will be written to related ++ * registers, so the PMU state remains unchanged. hw.state in ++ * intel_bts_disable_local will remain PERF_HES_STOPPED too in consecutive ++ * calls. + */ + static void __intel_pmu_disable_all(void) + { +@@ -1895,7 +1903,10 @@ again: + goto again; + + done: +- __intel_pmu_enable_all(0, true); ++ /* Only restore PMU state when it's active. See x86_pmu_disable(). */ ++ if (cpuc->enabled) ++ __intel_pmu_enable_all(0, true); ++ + /* + * Only unmask the NMI after the overflow counters + * have been reset. This avoids spurious NMIs on +diff --git a/arch/x86/kernel/cpu/perf_event_knc.c b/arch/x86/kernel/cpu/perf_event_knc.c +index 5b0c232..b931095 100644 +--- a/arch/x86/kernel/cpu/perf_event_knc.c ++++ b/arch/x86/kernel/cpu/perf_event_knc.c +@@ -263,7 +263,9 @@ again: + goto again; + + done: +- knc_pmu_enable_all(0); ++ /* Only restore PMU state when it's active. See x86_pmu_disable(). */ ++ if (cpuc->enabled) ++ knc_pmu_enable_all(0); + + return handled; + } +-- +2.7.1 + + +From f4a52a7e37bd5634cf6ab33b5c8fa24015e65769 Mon Sep 17 00:00:00 2001 +From: Jiri Olsa +Date: Tue, 1 Mar 2016 20:03:52 +0100 +Subject: [PATCH 216/384] perf/x86/intel: Use PAGE_SIZE for PEBS buffer size on + Core2 + +commit e72daf3f4d764c47fb71c9bdc7f9c54a503825b1 upstream. + +Using PAGE_SIZE buffers makes the WRMSR to PERF_GLOBAL_CTRL in +intel_pmu_enable_all() mysteriously hang on Core2. As a workaround, we +don't do this. + +The hard lockup is easily triggered by running 'perf test attr' +repeatedly. Most of the time it gets stuck on sample session with +small periods. + + # perf test attr -vv + 14: struct perf_event_attr setup : + --- start --- + ... + 'PERF_TEST_ATTR=/tmp/tmpuEKz3B /usr/bin/perf record -o /tmp/tmpuEKz3B/perf.data -c 123 kill >/dev/null 2>&1' ret 1 + +Reported-by: Arnaldo Carvalho de Melo +Signed-off-by: Jiri Olsa +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Andi Kleen +Cc: Alexander Shishkin +Cc: Jiri Olsa +Cc: Kan Liang +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Stephane Eranian +Cc: Thomas Gleixner +Cc: Vince Weaver +Cc: Wang Nan +Link: http://lkml.kernel.org/r/20160301190352.GA8355@krava.redhat.com +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kernel/cpu/perf_event.h | 1 + + arch/x86/kernel/cpu/perf_event_intel_ds.c | 13 +++++++++++-- + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h +index d0e35eb..0d7bc49 100644 +--- a/arch/x86/kernel/cpu/perf_event.h ++++ b/arch/x86/kernel/cpu/perf_event.h +@@ -591,6 +591,7 @@ struct x86_pmu { + pebs_active :1, + pebs_broken :1; + int pebs_record_size; ++ int pebs_buffer_size; + void (*drain_pebs)(struct pt_regs *regs); + struct event_constraint *pebs_constraints; + void (*pebs_aliases)(struct perf_event *event); +diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c +index 5db1c77..4bf080b 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c ++++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c +@@ -269,7 +269,7 @@ static int alloc_pebs_buffer(int cpu) + if (!x86_pmu.pebs) + return 0; + +- buffer = kzalloc_node(PEBS_BUFFER_SIZE, GFP_KERNEL, node); ++ buffer = kzalloc_node(x86_pmu.pebs_buffer_size, GFP_KERNEL, node); + if (unlikely(!buffer)) + return -ENOMEM; + +@@ -286,7 +286,7 @@ static int alloc_pebs_buffer(int cpu) + per_cpu(insn_buffer, cpu) = ibuffer; + } + +- max = PEBS_BUFFER_SIZE / x86_pmu.pebs_record_size; ++ max = x86_pmu.pebs_buffer_size / x86_pmu.pebs_record_size; + + ds->pebs_buffer_base = (u64)(unsigned long)buffer; + ds->pebs_index = ds->pebs_buffer_base; +@@ -1296,6 +1296,7 @@ void __init intel_ds_init(void) + + x86_pmu.bts = boot_cpu_has(X86_FEATURE_BTS); + x86_pmu.pebs = boot_cpu_has(X86_FEATURE_PEBS); ++ x86_pmu.pebs_buffer_size = PEBS_BUFFER_SIZE; + if (x86_pmu.pebs) { + char pebs_type = x86_pmu.intel_cap.pebs_trap ? '+' : '-'; + int format = x86_pmu.intel_cap.pebs_format; +@@ -1304,6 +1305,14 @@ void __init intel_ds_init(void) + case 0: + printk(KERN_CONT "PEBS fmt0%c, ", pebs_type); + x86_pmu.pebs_record_size = sizeof(struct pebs_record_core); ++ /* ++ * Using >PAGE_SIZE buffers makes the WRMSR to ++ * PERF_GLOBAL_CTRL in intel_pmu_enable_all() ++ * mysteriously hang on Core2. ++ * ++ * As a workaround, we don't do this. ++ */ ++ x86_pmu.pebs_buffer_size = PAGE_SIZE; + x86_pmu.drain_pebs = intel_pmu_drain_pebs_core; + break; + +-- +2.7.1 + + +From 796bfa1b21a785c9c9e9bef70e5638dc46671e26 Mon Sep 17 00:00:00 2001 +From: Andi Kleen +Date: Tue, 1 Mar 2016 14:25:24 -0800 +Subject: [PATCH 217/384] perf/x86/intel: Fix PEBS data source interpretation + on Nehalem/Westmere + +commit e17dc65328057c00db7e1bfea249c8771a78b30b upstream. + +Jiri reported some time ago that some entries in the PEBS data source table +in perf do not agree with the SDM. We investigated and the bits +changed for Sandy Bridge, but the SDM was not updated. + +perf already implements the bits correctly for Sandy Bridge +and later. This patch patches it up for Nehalem and Westmere. + +Signed-off-by: Andi Kleen +Signed-off-by: Peter Zijlstra (Intel) +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Cc: jolsa@kernel.org +Link: http://lkml.kernel.org/r/1456871124-15985-1-git-send-email-andi@firstfloor.org +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kernel/cpu/perf_event.h | 2 ++ + arch/x86/kernel/cpu/perf_event_intel.c | 2 ++ + arch/x86/kernel/cpu/perf_event_intel_ds.c | 11 ++++++++++- + 3 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h +index 0d7bc49..ee70445 100644 +--- a/arch/x86/kernel/cpu/perf_event.h ++++ b/arch/x86/kernel/cpu/perf_event.h +@@ -908,6 +908,8 @@ void intel_pmu_lbr_init_hsw(void); + + void intel_pmu_lbr_init_skl(void); + ++void intel_pmu_pebs_data_source_nhm(void); ++ + int intel_pmu_setup_lbr_filter(struct perf_event *event); + + void intel_pt_interrupt(void); +diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c +index 98a01fd1..078de2e 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel.c ++++ b/arch/x86/kernel/cpu/perf_event_intel.c +@@ -3336,6 +3336,7 @@ __init int intel_pmu_init(void) + intel_perfmon_event_map[PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = + X86_CONFIG(.event=0xb1, .umask=0x3f, .inv=1, .cmask=1); + ++ intel_pmu_pebs_data_source_nhm(); + x86_add_quirk(intel_nehalem_quirk); + + pr_cont("Nehalem events, "); +@@ -3398,6 +3399,7 @@ __init int intel_pmu_init(void) + intel_perfmon_event_map[PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = + X86_CONFIG(.event=0xb1, .umask=0x3f, .inv=1, .cmask=1); + ++ intel_pmu_pebs_data_source_nhm(); + pr_cont("Westmere events, "); + break; + +diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c +index 4bf080b..7abb2b8 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c ++++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c +@@ -51,7 +51,8 @@ union intel_x86_pebs_dse { + #define OP_LH (P(OP, LOAD) | P(LVL, HIT)) + #define SNOOP_NONE_MISS (P(SNOOP, NONE) | P(SNOOP, MISS)) + +-static const u64 pebs_data_source[] = { ++/* Version for Sandy Bridge and later */ ++static u64 pebs_data_source[] = { + P(OP, LOAD) | P(LVL, MISS) | P(LVL, L3) | P(SNOOP, NA),/* 0x00:ukn L3 */ + OP_LH | P(LVL, L1) | P(SNOOP, NONE), /* 0x01: L1 local */ + OP_LH | P(LVL, LFB) | P(SNOOP, NONE), /* 0x02: LFB hit */ +@@ -70,6 +71,14 @@ static const u64 pebs_data_source[] = { + OP_LH | P(LVL, UNC) | P(SNOOP, NONE), /* 0x0f: uncached */ + }; + ++/* Patch up minor differences in the bits */ ++void __init intel_pmu_pebs_data_source_nhm(void) ++{ ++ pebs_data_source[0x05] = OP_LH | P(LVL, L3) | P(SNOOP, HIT); ++ pebs_data_source[0x06] = OP_LH | P(LVL, L3) | P(SNOOP, HITM); ++ pebs_data_source[0x07] = OP_LH | P(LVL, L3) | P(SNOOP, HITM); ++} ++ + static u64 precise_store_data(u64 status) + { + union intel_x86_pebs_dse dse; +-- +2.7.1 + + +From 51b0e335652880b83780503fc86e2cd3d0e130ec Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Tue, 12 Apr 2016 09:09:26 -0700 +Subject: [PATCH 218/384] Linux 4.4.7 + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index d95c4a4..126971f 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + VERSION = 4 + PATCHLEVEL = 4 +-SUBLEVEL = 6 ++SUBLEVEL = 7 + EXTRAVERSION = + NAME = Blurry Fish Butt + +-- +2.7.1 + + +From e6c71b4de5ec2513a4127db059bba76e2f399988 Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Thu, 14 Apr 2016 03:12:49 +0200 +Subject: [PATCH 219/384] sdhci-esdhc-imx: add SDHCI_QUIRK2_TUNING_WORK_AROUND + for imx6q + +--- + drivers/mmc/host/sdhci-esdhc-imx.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c +index 5e23d78..83632d2 100644 +--- a/drivers/mmc/host/sdhci-esdhc-imx.c ++++ b/drivers/mmc/host/sdhci-esdhc-imx.c +@@ -136,6 +136,7 @@ + #define ESDHC_FLAG_HS200 BIT(8) + /* The IP supports HS400 mode */ + #define ESDHC_FLAG_HS400 BIT(9) ++#define ESDHC_FLAG_TUNING_WORK_AROUND BIT(10) + + /* A higher clock ferquency than this rate requires strobell dll control */ + #define ESDHC_STROBE_DLL_CLK_FREQ 100000000 +@@ -161,7 +162,8 @@ static struct esdhc_soc_data esdhc_imx53_data = { + }; + + static struct esdhc_soc_data usdhc_imx6q_data = { +- .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING, ++ .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING ++ | ESDHC_FLAG_TUNING_WORK_AROUND, + }; + + static struct esdhc_soc_data usdhc_imx6sl_data = { +@@ -1020,6 +1022,9 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev, + if (!IS_ERR_VALUE(mmc_gpio_get_cd(host->mmc))) + host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; + ++ if (imx_data->socdata->flags & ESDHC_FLAG_TUNING_WORK_AROUND) ++ host->quirks2 |= SDHCI_QUIRK2_TUNING_WORK_AROUND; ++ + return 0; + } + #else +-- +2.7.1 + + +From a3c0c18f98b9e2c5b99d33a7d7e58c8ec2297643 Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Thu, 14 Apr 2016 03:14:31 +0200 +Subject: [PATCH 220/384] mxc_hdmi: edit after + 940144cad331dedf7a6f8b38cb28c16a1d11d03f + +--- + drivers/video/mxc/mxc_hdmi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/video/mxc/mxc_hdmi.c b/drivers/video/mxc/mxc_hdmi.c +index df91138..5cc3c54 100644 +--- a/drivers/video/mxc/mxc_hdmi.c ++++ b/drivers/video/mxc/mxc_hdmi.c +@@ -2296,6 +2296,8 @@ static void mxc_hdmi_set_mode(struct mxc_hdmi *hdmi, int edid_status) + dev_dbg(&hdmi->pdev->dev, "%s: New video mode\n", __func__); + } + ++ hdmi_set_cable_state(1); ++ + console_lock(); + fb_blank(hdmi->fbi, FB_BLANK_UNBLANK); + console_unlock(); +@@ -2311,8 +2313,6 @@ static int mxc_hdmi_cable_connected(struct mxc_hdmi *hdmi) + + dev_dbg(&hdmi->pdev->dev, "%s\n", __func__); + +- hdmi_set_cable_state(1); +- + hdmi->hp_state = HDMI_HOTPLUG_CONNECTED_NO_EDID; + memcpy(edid_old, hdmi->edid, HDMI_EDID_LEN); + +-- +2.7.1 + + +From fa4c455679ec7276528c0cf08299a4248737a90a Mon Sep 17 00:00:00 2001 +From: Guenter Roeck +Date: Sat, 26 Mar 2016 12:28:05 -0700 +Subject: [PATCH 221/384] hwmon: (max1111) Return -ENODEV from + max1111_read_channel if not instantiated + +commit 3c2e2266a5bd2d1cef258e6e54dca1d99946379f upstream. + +arm:pxa_defconfig can result in the following crash if the max1111 driver +is not instantiated. + +Unhandled fault: page domain fault (0x01b) at 0x00000000 +pgd = c0004000 +[00000000] *pgd=00000000 +Internal error: : 1b [#1] PREEMPT ARM +Modules linked in: +CPU: 0 PID: 300 Comm: kworker/0:1 Not tainted 4.5.0-01301-g1701f680407c #10 +Hardware name: SHARP Akita +Workqueue: events sharpsl_charge_toggle +task: c390a000 ti: c391e000 task.ti: c391e000 +PC is at max1111_read_channel+0x20/0x30 +LR is at sharpsl_pm_pxa_read_max1111+0x2c/0x3c +pc : [] lr : [] psr: 20000013 +... +[] (max1111_read_channel) from [] + (sharpsl_pm_pxa_read_max1111+0x2c/0x3c) +[] (sharpsl_pm_pxa_read_max1111) from [] + (spitzpm_read_devdata+0x5c/0xc4) +[] (spitzpm_read_devdata) from [] + (sharpsl_check_battery_temp+0x78/0x110) +[] (sharpsl_check_battery_temp) from [] + (sharpsl_charge_toggle+0x48/0x110) +[] (sharpsl_charge_toggle) from [] + (process_one_work+0x14c/0x48c) +[] (process_one_work) from [] (worker_thread+0x3c/0x5d4) +[] (worker_thread) from [] (kthread+0xd0/0xec) +[] (kthread) from [] (ret_from_fork+0x14/0x24) + +This can occur because the SPI controller driver (SPI_PXA2XX) is built as +module and thus not necessarily loaded. While building SPI_PXA2XX into the +kernel would make the problem disappear, it appears prudent to ensure that +the driver is instantiated before accessing its data structures. + +Cc: Arnd Bergmann +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hwmon/max1111.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/hwmon/max1111.c b/drivers/hwmon/max1111.c +index 36544c4..303d0c9 100644 +--- a/drivers/hwmon/max1111.c ++++ b/drivers/hwmon/max1111.c +@@ -85,6 +85,9 @@ static struct max1111_data *the_max1111; + + int max1111_read_channel(int channel) + { ++ if (!the_max1111 || !the_max1111->spi) ++ return -ENODEV; ++ + return max1111_read(&the_max1111->spi->dev, channel); + } + EXPORT_SYMBOL(max1111_read_channel); +@@ -258,6 +261,9 @@ static int max1111_remove(struct spi_device *spi) + { + struct max1111_data *data = spi_get_drvdata(spi); + ++#ifdef CONFIG_SHARPSL_PM ++ the_max1111 = NULL; ++#endif + hwmon_device_unregister(data->hwmon_dev); + sysfs_remove_group(&spi->dev.kobj, &max1110_attr_group); + sysfs_remove_group(&spi->dev.kobj, &max1111_attr_group); +-- +2.7.1 + + +From 0a2a38bcd7b50532f05bd9854ff2dce9569a93fc Mon Sep 17 00:00:00 2001 +From: Nicolai Stange +Date: Sun, 20 Mar 2016 23:23:46 +0100 +Subject: [PATCH 222/384] PKCS#7: pkcs7_validate_trust(): initialize the + _trusted output argument + +commit e54358915d0a00399c11c2c23ae1be674cba188a upstream. + +Despite what the DocBook comment to pkcs7_validate_trust() says, the +*_trusted argument is never set to false. + +pkcs7_validate_trust() only positively sets *_trusted upon encountering +a trusted PKCS#7 SignedInfo block. + +This is quite unfortunate since its callers, system_verify_data() for +example, depend on pkcs7_validate_trust() clearing *_trusted on non-trust. + +Indeed, UBSAN splats when attempting to load the uninitialized local +variable 'trusted' from system_verify_data() in pkcs7_validate_trust(): + + UBSAN: Undefined behaviour in crypto/asymmetric_keys/pkcs7_trust.c:194:14 + load of value 82 is not a valid value for type '_Bool' + [...] + Call Trace: + [] dump_stack+0xbc/0x117 + [] ? _atomic_dec_and_lock+0x169/0x169 + [] ubsan_epilogue+0xd/0x4e + [] __ubsan_handle_load_invalid_value+0x111/0x158 + [] ? val_to_string.constprop.12+0xcf/0xcf + [] ? x509_request_asymmetric_key+0x114/0x370 + [] ? kfree+0x220/0x370 + [] ? public_key_verify_signature_2+0x32/0x50 + [] pkcs7_validate_trust+0x524/0x5f0 + [] system_verify_data+0xca/0x170 + [] ? top_trace_array+0x9b/0x9b + [] ? __vfs_read+0x279/0x3d0 + [] mod_verify_sig+0x1ff/0x290 + [...] + +The implication is that pkcs7_validate_trust() effectively grants trust +when it really shouldn't have. + +Fix this by explicitly setting *_trusted to false at the very beginning +of pkcs7_validate_trust(). + +Signed-off-by: Nicolai Stange +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + crypto/asymmetric_keys/pkcs7_trust.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/crypto/asymmetric_keys/pkcs7_trust.c b/crypto/asymmetric_keys/pkcs7_trust.c +index 90d6d47..ecdb5a2 100644 +--- a/crypto/asymmetric_keys/pkcs7_trust.c ++++ b/crypto/asymmetric_keys/pkcs7_trust.c +@@ -178,6 +178,8 @@ int pkcs7_validate_trust(struct pkcs7_message *pkcs7, + int cached_ret = -ENOKEY; + int ret; + ++ *_trusted = false; ++ + for (p = pkcs7->certs; p; p = p->next) + p->seen = false; + +-- +2.7.1 + + +From 25f437bacc1c810a381a5afc366354060e860f05 Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Fri, 8 Apr 2016 18:11:33 +0200 +Subject: [PATCH 223/384] parisc: Avoid function pointers for kernel exception + routines + +commit e3893027a300927049efc1572f852201eb785142 upstream. + +We want to avoid the kernel module loader to create function pointers +for the kernel fixup routines of get_user() and put_user(). Changing +the external reference from function type to int type fixes this. + +This unbreaks exception handling for get_user() and put_user() when +called from a kernel module. + +Signed-off-by: Helge Deller +Signed-off-by: Greg Kroah-Hartman +--- + arch/parisc/kernel/parisc_ksyms.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/arch/parisc/kernel/parisc_ksyms.c b/arch/parisc/kernel/parisc_ksyms.c +index 568b2c6..3cad8aa 100644 +--- a/arch/parisc/kernel/parisc_ksyms.c ++++ b/arch/parisc/kernel/parisc_ksyms.c +@@ -47,11 +47,11 @@ EXPORT_SYMBOL(__cmpxchg_u64); + EXPORT_SYMBOL(lclear_user); + EXPORT_SYMBOL(lstrnlen_user); + +-/* Global fixups */ +-extern void fixup_get_user_skip_1(void); +-extern void fixup_get_user_skip_2(void); +-extern void fixup_put_user_skip_1(void); +-extern void fixup_put_user_skip_2(void); ++/* Global fixups - defined as int to avoid creation of function pointers */ ++extern int fixup_get_user_skip_1; ++extern int fixup_get_user_skip_2; ++extern int fixup_put_user_skip_1; ++extern int fixup_put_user_skip_2; + EXPORT_SYMBOL(fixup_get_user_skip_1); + EXPORT_SYMBOL(fixup_get_user_skip_2); + EXPORT_SYMBOL(fixup_put_user_skip_1); +-- +2.7.1 + + +From 0c030e1bec1be6e2f7e9d87ed17d3f7539630feb Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Fri, 8 Apr 2016 18:18:48 +0200 +Subject: [PATCH 224/384] parisc: Fix kernel crash with reversed + copy_from_user() + +commit ef72f3110d8b19f4c098a0bff7ed7d11945e70c6 upstream. + +The kernel module testcase (lib/test_user_copy.c) exhibited a kernel +crash on parisc if the parameters for copy_from_user were reversed +("illegal reversed copy_to_user" testcase). + +Fix this potential crash by checking the fault handler if the faulting +address is in the exception table. + +Signed-off-by: Helge Deller +Cc: Kees Cook +Signed-off-by: Greg Kroah-Hartman +--- + arch/parisc/kernel/traps.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c +index 553b098..77e2262 100644 +--- a/arch/parisc/kernel/traps.c ++++ b/arch/parisc/kernel/traps.c +@@ -798,6 +798,9 @@ void notrace handle_interruption(int code, struct pt_regs *regs) + + if (fault_space == 0 && !faulthandler_disabled()) + { ++ /* Clean up and return if in exception table. */ ++ if (fixup_exception(regs)) ++ return; + pdc_chassis_send_status(PDC_CHASSIS_DIRECT_PANIC); + parisc_terminate("Kernel Fault", regs, code, fault_address); + } +-- +2.7.1 + + +From 69ab73498b8362ec8f64abe9f5862ad9f72e78b5 Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Fri, 8 Apr 2016 18:32:52 +0200 +Subject: [PATCH 225/384] parisc: Unbreak handling exceptions from kernel + modules + +commit 2ef4dfd9d9f288943e249b78365a69e3ea3ec072 upstream. + +Handling exceptions from modules never worked on parisc. +It was just masked by the fact that exceptions from modules +don't happen during normal use. + +When a module triggers an exception in get_user() we need to load the +main kernel dp value before accessing the exception_data structure, and +afterwards restore the original dp value of the module on exit. + +Noticed-by: Mikulas Patocka +Signed-off-by: Helge Deller +Signed-off-by: Greg Kroah-Hartman +--- + arch/parisc/include/asm/uaccess.h | 1 + + arch/parisc/kernel/asm-offsets.c | 1 + + arch/parisc/lib/fixup.S | 6 ++++++ + arch/parisc/mm/fault.c | 1 + + 4 files changed, 9 insertions(+) + +diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h +index 0abdd4c..1960b87 100644 +--- a/arch/parisc/include/asm/uaccess.h ++++ b/arch/parisc/include/asm/uaccess.h +@@ -76,6 +76,7 @@ struct exception_table_entry { + */ + struct exception_data { + unsigned long fault_ip; ++ unsigned long fault_gp; + unsigned long fault_space; + unsigned long fault_addr; + }; +diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c +index d2f6257..78d30d2 100644 +--- a/arch/parisc/kernel/asm-offsets.c ++++ b/arch/parisc/kernel/asm-offsets.c +@@ -299,6 +299,7 @@ int main(void) + #endif + BLANK(); + DEFINE(EXCDATA_IP, offsetof(struct exception_data, fault_ip)); ++ DEFINE(EXCDATA_GP, offsetof(struct exception_data, fault_gp)); + DEFINE(EXCDATA_SPACE, offsetof(struct exception_data, fault_space)); + DEFINE(EXCDATA_ADDR, offsetof(struct exception_data, fault_addr)); + BLANK(); +diff --git a/arch/parisc/lib/fixup.S b/arch/parisc/lib/fixup.S +index 536ef66..1052b74 100644 +--- a/arch/parisc/lib/fixup.S ++++ b/arch/parisc/lib/fixup.S +@@ -26,6 +26,7 @@ + + #ifdef CONFIG_SMP + .macro get_fault_ip t1 t2 ++ loadgp + addil LT%__per_cpu_offset,%r27 + LDREG RT%__per_cpu_offset(%r1),\t1 + /* t2 = smp_processor_id() */ +@@ -40,14 +41,19 @@ + LDREG RT%exception_data(%r1),\t1 + /* t1 = this_cpu_ptr(&exception_data) */ + add,l \t1,\t2,\t1 ++ /* %r27 = t1->fault_gp - restore gp */ ++ LDREG EXCDATA_GP(\t1), %r27 + /* t1 = t1->fault_ip */ + LDREG EXCDATA_IP(\t1), \t1 + .endm + #else + .macro get_fault_ip t1 t2 ++ loadgp + /* t1 = this_cpu_ptr(&exception_data) */ + addil LT%exception_data,%r27 + LDREG RT%exception_data(%r1),\t2 ++ /* %r27 = t2->fault_gp - restore gp */ ++ LDREG EXCDATA_GP(\t2), %r27 + /* t1 = t2->fault_ip */ + LDREG EXCDATA_IP(\t2), \t1 + .endm +diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c +index a762864..f906444 100644 +--- a/arch/parisc/mm/fault.c ++++ b/arch/parisc/mm/fault.c +@@ -151,6 +151,7 @@ int fixup_exception(struct pt_regs *regs) + struct exception_data *d; + d = this_cpu_ptr(&exception_data); + d->fault_ip = regs->iaoq[0]; ++ d->fault_gp = regs->gr[27]; + d->fault_space = regs->isr; + d->fault_addr = regs->ior; + +-- +2.7.1 + + +From 3f392500f326f462f17b7a039e1b269e5da2c245 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Fri, 1 Apr 2016 12:28:16 +0200 +Subject: [PATCH 226/384] ALSA: timer: Use mod_timer() for rearming the system + timer + +commit 4a07083ed613644c96c34a7dd2853dc5d7c70902 upstream. + +ALSA system timer backend stops the timer via del_timer() without sync +and leaves del_timer_sync() at the close instead. This is because of +the restriction by the design of ALSA timer: namely, the stop callback +may be called from the timer handler, and calling the sync shall lead +to a hangup. However, this also triggers a kernel BUG() when the +timer is rearmed immediately after stopping without sync: + kernel BUG at kernel/time/timer.c:966! + Call Trace: + + [] snd_timer_s_start+0x13e/0x1a0 + [] snd_timer_interrupt+0x504/0xec0 + [] ? debug_check_no_locks_freed+0x290/0x290 + [] snd_timer_s_function+0xb4/0x120 + [] call_timer_fn+0x162/0x520 + [] ? call_timer_fn+0xcd/0x520 + [] ? snd_timer_interrupt+0xec0/0xec0 + .... + +It's the place where add_timer() checks the pending timer. It's clear +that this may happen after the immediate restart without sync in our +cases. + +So, the workaround here is just to use mod_timer() instead of +add_timer(). This looks like a band-aid fix, but it's a right move, +as snd_timer_interrupt() takes care of the continuous rearm of timer. + +Reported-by: Jiri Slaby +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/core/timer.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sound/core/timer.c b/sound/core/timer.c +index f24c9fc..b982d1b 100644 +--- a/sound/core/timer.c ++++ b/sound/core/timer.c +@@ -1051,8 +1051,8 @@ static int snd_timer_s_start(struct snd_timer * timer) + njiff += timer->sticks - priv->correction; + priv->correction = 0; + } +- priv->last_expires = priv->tlist.expires = njiff; +- add_timer(&priv->tlist); ++ priv->last_expires = njiff; ++ mod_timer(&priv->tlist, njiff); + return 0; + } + +-- +2.7.1 + + +From 329629c2c7a2107973e78ec5312d6862d9af847e Mon Sep 17 00:00:00 2001 +From: Bobi Mihalca +Date: Wed, 23 Mar 2016 13:23:55 +0200 +Subject: [PATCH 227/384] ALSA: hda - Asus N750JV external subwoofer fixup + +commit 70cf2cbd685e218c3ffd105d9fb6cf0f8d767481 upstream. + +ASUS N750JV needs the same fixup as N550 for enabling its subwoofer. + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=115181 +Signed-off-by: Bobi Mihalca +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index 6968b79..1b460c1 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -6643,6 +6643,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { + SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), + SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_BASS_1A), + SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), ++ SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_BASS_1A), + SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), + SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), + SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), +-- +2.7.1 + + +From a7edfade5e3686c66c0fe9584dcd9d061b210c4d Mon Sep 17 00:00:00 2001 +From: Bobi Mihalca +Date: Wed, 23 Mar 2016 13:26:11 +0200 +Subject: [PATCH 228/384] ALSA: hda - Fix white noise on Asus N750JV headphone + +commit 9d4dc5840f93bcb002fa311693349deae7702bc5 upstream. + +For reducing the noise from the headphone output on ASUS N750JV, +call the existing fixup, alc_fixup_auto_mute_via_amp(), additionally. + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=115181 +Signed-off-by: Bobi Mihalca +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index 1b460c1..ba4e5b9 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -6379,6 +6379,7 @@ enum { + ALC668_FIXUP_AUTO_MUTE, + ALC668_FIXUP_DELL_DISABLE_AAMIX, + ALC668_FIXUP_DELL_XPS13, ++ ALC662_FIXUP_ASUS_Nx50, + }; + + static const struct hda_fixup alc662_fixups[] = { +@@ -6619,6 +6620,12 @@ static const struct hda_fixup alc662_fixups[] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc_fixup_bass_chmap, + }, ++ [ALC662_FIXUP_ASUS_Nx50] = { ++ .type = HDA_FIXUP_FUNC, ++ .v.func = alc_fixup_auto_mute_via_amp, ++ .chained = true, ++ .chain_id = ALC662_FIXUP_BASS_1A ++ }, + }; + + static const struct snd_pci_quirk alc662_fixup_tbl[] = { +@@ -6643,7 +6650,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { + SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), + SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_BASS_1A), + SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), +- SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_BASS_1A), ++ SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), + SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), + SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), + SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), +-- +2.7.1 + + +From 1efc98d62818b12818d8ce1e77dffcc98d1fe6f2 Mon Sep 17 00:00:00 2001 +From: Bobi Mihalca +Date: Wed, 23 Mar 2016 13:32:33 +0200 +Subject: [PATCH 229/384] ALSA: hda - Apply fix for white noise on Asus N550JV, + too + +commit 83a9efb5b8170b7cffef4f62656656e1d8ad2ccd upstream. + +Apply the new fixup that is used for ASUS N750JV to another similar +model, N500JV, too, for reducing the headphone noise. + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=115181 +Signed-off-by: Bobi Mihalca +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index ba4e5b9..3671eb8 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -6648,7 +6648,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { + SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), +- SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_BASS_1A), ++ SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), + SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), + SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), + SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), +-- +2.7.1 + + +From b9cc313197cbecd76a749e4a48ffad4078111619 Mon Sep 17 00:00:00 2001 +From: Xishi Qiu +Date: Fri, 1 Apr 2016 14:31:20 -0700 +Subject: [PATCH 230/384] mm: fix invalid node in alloc_migrate_target() + +commit 6f25a14a7053b69917e2ebea0d31dd444cd31fd5 upstream. + +It is incorrect to use next_node to find a target node, it will return +MAX_NUMNODES or invalid node. This will lead to crash in buddy system +allocation. + +Fixes: c8721bbbdd36 ("mm: memory-hotplug: enable memory hotplug to handle hugepage") +Signed-off-by: Xishi Qiu +Acked-by: Vlastimil Babka +Acked-by: Naoya Horiguchi +Cc: Joonsoo Kim +Cc: David Rientjes +Cc: "Laura Abbott" +Cc: Hui Zhu +Cc: Wang Xiaoqiang +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + mm/page_isolation.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/mm/page_isolation.c b/mm/page_isolation.c +index 4568fd5..00c9646 100644 +--- a/mm/page_isolation.c ++++ b/mm/page_isolation.c +@@ -283,11 +283,11 @@ struct page *alloc_migrate_target(struct page *page, unsigned long private, + * now as a simple work-around, we use the next node for destination. + */ + if (PageHuge(page)) { +- nodemask_t src = nodemask_of_node(page_to_nid(page)); +- nodemask_t dst; +- nodes_complement(dst, src); ++ int node = next_online_node(page_to_nid(page)); ++ if (node == MAX_NUMNODES) ++ node = first_online_node; + return alloc_huge_page_node(page_hstate(compound_head(page)), +- next_node(page_to_nid(page), dst)); ++ node); + } + + if (PageHighMem(page)) +-- +2.7.1 + + +From edf6793453d2cc07f79909b2b3f6937a8c496ca9 Mon Sep 17 00:00:00 2001 +From: Sebastian Siewior +Date: Tue, 8 Mar 2016 10:03:56 +0100 +Subject: [PATCH 231/384] powerpc/mm: Fixup preempt underflow with huge pages + +commit 08a5bb2921e490939f78f38fd0d02858bb709942 upstream. + +hugepd_free() used __get_cpu_var() once. Nothing ensured that the code +accessing the variable did not migrate from one CPU to another and soon +this was noticed by Tiejun Chen in 94b09d755462 ("powerpc/hugetlb: +Replace __get_cpu_var with get_cpu_var"). So we had it fixed. + +Christoph Lameter was doing his __get_cpu_var() replaces and forgot +PowerPC. Then he noticed this and sent his fixed up batch again which +got applied as 69111bac42f5 ("powerpc: Replace __get_cpu_var uses"). + +The careful reader will noticed one little detail: get_cpu_var() got +replaced with this_cpu_ptr(). So now we have a put_cpu_var() which does +a preempt_enable() and nothing that does preempt_disable() so we +underflow the preempt counter. + +Cc: Benjamin Herrenschmidt +Cc: Christoph Lameter +Signed-off-by: Sebastian Andrzej Siewior +Reviewed-by: Aneesh Kumar K.V +Signed-off-by: Michael Ellerman +Signed-off-by: Greg Kroah-Hartman +--- + arch/powerpc/mm/hugetlbpage.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c +index 9833fee..807f159 100644 +--- a/arch/powerpc/mm/hugetlbpage.c ++++ b/arch/powerpc/mm/hugetlbpage.c +@@ -486,13 +486,13 @@ static void hugepd_free(struct mmu_gather *tlb, void *hugepte) + { + struct hugepd_freelist **batchp; + +- batchp = this_cpu_ptr(&hugepd_freelist_cur); ++ batchp = &get_cpu_var(hugepd_freelist_cur); + + if (atomic_read(&tlb->mm->mm_users) < 2 || + cpumask_equal(mm_cpumask(tlb->mm), + cpumask_of(smp_processor_id()))) { + kmem_cache_free(hugepte_cache, hugepte); +- put_cpu_var(hugepd_freelist_cur); ++ put_cpu_var(hugepd_freelist_cur); + return; + } + +-- +2.7.1 + + +From b60509ced9f868935fc62569baf17ccd6d8a022b Mon Sep 17 00:00:00 2001 +From: Dan Williams +Date: Thu, 7 Apr 2016 19:58:44 -0700 +Subject: [PATCH 232/384] libnvdimm: fix smart data retrieval + +commit 211291126698c8f047617565b2e2e7f822f86354 upstream. + +It appears that smart data retrieval has been broken the since the +initial implementation. Fix the payload size to be 128-bytes per the +specification. + +Signed-off-by: Dan Williams +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvdimm/bus.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c +index 496b9b6..5f47356 100644 +--- a/drivers/nvdimm/bus.c ++++ b/drivers/nvdimm/bus.c +@@ -335,7 +335,7 @@ static const struct nd_cmd_desc __nd_cmd_dimm_descs[] = { + [ND_CMD_IMPLEMENTED] = { }, + [ND_CMD_SMART] = { + .out_num = 2, +- .out_sizes = { 4, 8, }, ++ .out_sizes = { 4, 128, }, + }, + [ND_CMD_SMART_THRESHOLD] = { + .out_num = 2, +-- +2.7.1 + + +From c5d068c7eb7951f928b091c6ed916949102de5e1 Mon Sep 17 00:00:00 2001 +From: Dan Williams +Date: Thu, 7 Apr 2016 19:59:27 -0700 +Subject: [PATCH 233/384] libnvdimm, pfn: fix uuid validation + +commit e5670563f588ed1c0603819350c0f02cec23f5c5 upstream. + +If we detect a namespace has a stale info block in the init path, we +should overwrite with the latest configuration. In fact, we already +return -ENODEV when the parent uuid is invalid, the same should be done +for the 'self' uuid. Otherwise we can get into a condition where +userspace is unable to reconfigure the pfn-device without directly / +manually invalidating the info block. + +Reported-by: Jeff Moyer +Signed-off-by: Dan Williams +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvdimm/pfn_devs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c +index 71805a1..9d39745 100644 +--- a/drivers/nvdimm/pfn_devs.c ++++ b/drivers/nvdimm/pfn_devs.c +@@ -275,7 +275,7 @@ int nd_pfn_validate(struct nd_pfn *nd_pfn) + } else { + /* from init we validate */ + if (memcmp(nd_pfn->uuid, pfn_sb->uuid, 16) != 0) +- return -EINVAL; ++ return -ENODEV; + } + + /* +-- +2.7.1 + + +From 517fbe68a2b8845733923950aee88987387b458f Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Thu, 31 Mar 2016 09:38:51 +0200 +Subject: [PATCH 234/384] compiler-gcc: disable -ftracer for __noclone + functions + +commit 95272c29378ee7dc15f43fa2758cb28a5913a06d upstream. + +-ftracer can duplicate asm blocks causing compilation to fail in +noclone functions. For example, KVM declares a global variable +in an asm like + + asm("2: ... \n + .pushsection data \n + .global vmx_return \n + vmx_return: .long 2b"); + +and -ftracer causes a double declaration. + +Cc: Andrew Morton +Cc: Michal Marek +Cc: kvm@vger.kernel.org +Reported-by: Linda Walsh +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/compiler-gcc.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h +index 22ab246..eeae401 100644 +--- a/include/linux/compiler-gcc.h ++++ b/include/linux/compiler-gcc.h +@@ -199,7 +199,7 @@ + #define unreachable() __builtin_unreachable() + + /* Mark a function definition as prohibited from being cloned. */ +-#define __noclone __attribute__((__noclone__)) ++#define __noclone __attribute__((__noclone__, __optimize__("no-tracer"))) + + #endif /* GCC_VERSION >= 40500 */ + +-- +2.7.1 + + +From f44a5c58b8706419c9d6965f3e6cf8941ad6588b Mon Sep 17 00:00:00 2001 +From: James Morse +Date: Thu, 24 Mar 2016 16:54:34 +0000 +Subject: [PATCH 235/384] arm64: opcodes.h: Add arm big-endian config options + before including arm header + +commit a6002ec5a8c68e69706b2efd6db6d682d0ab672c upstream. + +arm and arm64 use different config options to specify big endian. This +needs taking into account when including code/headers between the two +architectures. + +A case in point is PAN, which uses the __instr_arm() macro to output +instructions. The macro comes from opcodes.h, which lives under arch/arm. +On a big-endian build the mismatched config options mean the instruction +isn't byte swapped correctly, resulting in undefined instruction exceptions +during boot: + +| alternatives: patching kernel code +| kdevtmpfs[87]: undefined instruction: pc=ffffffc0004505b4 +| kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c +| kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c +| kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c +| kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c +| kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c +| kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c +| kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c +| kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c +| kdevtmpfs[87]: undefined instruction: pc=ffffffc00076231c +| Internal error: Oops - undefined instruction: 0 [#1] SMP +| Modules linked in: +| CPU: 0 PID: 87 Comm: kdevtmpfs Not tainted 4.1.16+ #5 +| Hardware name: Hisilicon PhosphorHi1382 EVB (DT) +| task: ffffffc336591700 ti: ffffffc3365a4000 task.ti: ffffffc3365a4000 +| PC is at dump_instr+0x68/0x100 +| LR is at do_undefinstr+0x1d4/0x2a4 +| pc : [] lr : [] pstate: 604001c5 +| sp : ffffffc3365a6450 + +Reported-by: Hanjun Guo +Tested-by: Xuefeng Wang +Signed-off-by: James Morse +Signed-off-by: Will Deacon +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm64/include/asm/opcodes.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/arm64/include/asm/opcodes.h b/arch/arm64/include/asm/opcodes.h +index 4e603ea..123f45d 100644 +--- a/arch/arm64/include/asm/opcodes.h ++++ b/arch/arm64/include/asm/opcodes.h +@@ -1 +1,5 @@ ++#ifdef CONFIG_CPU_BIG_ENDIAN ++#define CONFIG_CPU_ENDIAN_BE8 CONFIG_CPU_BIG_ENDIAN ++#endif ++ + #include <../../arm/include/asm/opcodes.h> +-- +2.7.1 + + +From c4d73c069cd6e052133764c99b04c5823e313703 Mon Sep 17 00:00:00 2001 +From: Rob Clark +Date: Thu, 25 Feb 2016 16:15:05 -0500 +Subject: [PATCH 236/384] drm/dp: move hw_mutex up the call stack +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit 7779c5e23c5132c22a219f1f5554ef81dd15ee91 upstream. + +1) don't let other threads trying to bang on aux channel interrupt the +defer timeout/logic +2) don't let other threads interrupt the i2c over aux logic + +Technically, according to people who actually have the DP spec, this +should not be required. In practice, it makes some troublesome Dell +monitor (and perhaps others) work, so probably a case of "It's compliant +if it works with windows" on the hw vendor's part.. + +v2: rebased to come before DPCD/AUX logging patch for easier backport +to stable branches. + +Reported-by: Dave Wysochanski +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1274157 +Signed-off-by: Rob Clark +Reviewed-by: Ville Syrjälä +Reviewed-by: Daniel Vetter +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/drm_dp_helper.c | 27 +++++++++++++++++---------- + 1 file changed, 17 insertions(+), 10 deletions(-) + +diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c +index 9535c5b..7e5a972 100644 +--- a/drivers/gpu/drm/drm_dp_helper.c ++++ b/drivers/gpu/drm/drm_dp_helper.c +@@ -178,7 +178,7 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request, + { + struct drm_dp_aux_msg msg; + unsigned int retry; +- int err; ++ int err = 0; + + memset(&msg, 0, sizeof(msg)); + msg.address = offset; +@@ -186,6 +186,8 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request, + msg.buffer = buffer; + msg.size = size; + ++ mutex_lock(&aux->hw_mutex); ++ + /* + * The specification doesn't give any recommendation on how often to + * retry native transactions. We used to retry 7 times like for +@@ -194,25 +196,24 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request, + */ + for (retry = 0; retry < 32; retry++) { + +- mutex_lock(&aux->hw_mutex); + err = aux->transfer(aux, &msg); +- mutex_unlock(&aux->hw_mutex); + if (err < 0) { + if (err == -EBUSY) + continue; + +- return err; ++ goto unlock; + } + + + switch (msg.reply & DP_AUX_NATIVE_REPLY_MASK) { + case DP_AUX_NATIVE_REPLY_ACK: + if (err < size) +- return -EPROTO; +- return err; ++ err = -EPROTO; ++ goto unlock; + + case DP_AUX_NATIVE_REPLY_NACK: +- return -EIO; ++ err = -EIO; ++ goto unlock; + + case DP_AUX_NATIVE_REPLY_DEFER: + usleep_range(AUX_RETRY_INTERVAL, AUX_RETRY_INTERVAL + 100); +@@ -221,7 +222,11 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request, + } + + DRM_DEBUG_KMS("too many retries, giving up\n"); +- return -EIO; ++ err = -EIO; ++ ++unlock: ++ mutex_unlock(&aux->hw_mutex); ++ return err; + } + + /** +@@ -543,9 +548,7 @@ static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg) + int max_retries = max(7, drm_dp_i2c_retry_count(msg, dp_aux_i2c_speed_khz)); + + for (retry = 0, defer_i2c = 0; retry < (max_retries + defer_i2c); retry++) { +- mutex_lock(&aux->hw_mutex); + ret = aux->transfer(aux, msg); +- mutex_unlock(&aux->hw_mutex); + if (ret < 0) { + if (ret == -EBUSY) + continue; +@@ -684,6 +687,8 @@ static int drm_dp_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, + + memset(&msg, 0, sizeof(msg)); + ++ mutex_lock(&aux->hw_mutex); ++ + for (i = 0; i < num; i++) { + msg.address = msgs[i].addr; + drm_dp_i2c_msg_set_request(&msg, &msgs[i]); +@@ -738,6 +743,8 @@ static int drm_dp_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, + msg.size = 0; + (void)drm_dp_i2c_do_msg(aux, &msg); + ++ mutex_unlock(&aux->hw_mutex); ++ + return err; + } + +-- +2.7.1 + + +From 63dcaa454a633d448206feac32c999e57679860d Mon Sep 17 00:00:00 2001 +From: Daniel Vetter +Date: Wed, 30 Mar 2016 11:40:43 +0200 +Subject: [PATCH 237/384] drm/udl: Use unlocked gem unreferencing + +commit 72b9ff0612ad8fc969b910cd00ac16b57a1a9ba4 upstream. + +For drm_gem_object_unreference callers are required to hold +dev->struct_mutex, which these paths don't. Enforcing this requirement +has become a bit more strict with + +commit ef4c6270bf2867e2f8032e9614d1a8cfc6c71663 +Author: Daniel Vetter +Date: Thu Oct 15 09:36:25 2015 +0200 + + drm/gem: Check locking in drm_gem_object_unreference + +Signed-off-by: Daniel Vetter +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/udl/udl_fb.c | 2 +- + drivers/gpu/drm/udl/udl_gem.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c +index 62c7b1d..73e41a8 100644 +--- a/drivers/gpu/drm/udl/udl_fb.c ++++ b/drivers/gpu/drm/udl/udl_fb.c +@@ -539,7 +539,7 @@ static int udlfb_create(struct drm_fb_helper *helper, + out_destroy_fbi: + drm_fb_helper_release_fbi(helper); + out_gfree: +- drm_gem_object_unreference(&ufbdev->ufb.obj->base); ++ drm_gem_object_unreference_unlocked(&ufbdev->ufb.obj->base); + out: + return ret; + } +diff --git a/drivers/gpu/drm/udl/udl_gem.c b/drivers/gpu/drm/udl/udl_gem.c +index 2a0a784..d7528e0 100644 +--- a/drivers/gpu/drm/udl/udl_gem.c ++++ b/drivers/gpu/drm/udl/udl_gem.c +@@ -52,7 +52,7 @@ udl_gem_create(struct drm_file *file, + return ret; + } + +- drm_gem_object_unreference(&obj->base); ++ drm_gem_object_unreference_unlocked(&obj->base); + *handle_p = handle; + return 0; + } +-- +2.7.1 + + +From aa337ec34c88158928bf195792ffefb889daf3cd Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Fri, 25 Mar 2016 10:31:04 -0400 +Subject: [PATCH 238/384] drm/radeon: add a dpm quirk for sapphire Dual-X R7 + 370 2G D5 + +commit f971f2263deaa4a441e377b385c11aee0f3b3f9a upstream. + +bug: +https://bugs.freedesktop.org/show_bug.cgi?id=94692 + +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/radeon/si_dpm.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c +index a82b891..7d75004 100644 +--- a/drivers/gpu/drm/radeon/si_dpm.c ++++ b/drivers/gpu/drm/radeon/si_dpm.c +@@ -2926,6 +2926,7 @@ static struct si_dpm_quirk si_dpm_quirk_list[] = { + /* PITCAIRN - https://bugs.freedesktop.org/show_bug.cgi?id=76490 */ + { PCI_VENDOR_ID_ATI, 0x6810, 0x1462, 0x3036, 0, 120000 }, + { PCI_VENDOR_ID_ATI, 0x6811, 0x174b, 0xe271, 0, 120000 }, ++ { PCI_VENDOR_ID_ATI, 0x6811, 0x174b, 0x2015, 0, 120000 }, + { PCI_VENDOR_ID_ATI, 0x6810, 0x174b, 0xe271, 85000, 90000 }, + { PCI_VENDOR_ID_ATI, 0x6811, 0x1462, 0x2015, 0, 120000 }, + { PCI_VENDOR_ID_ATI, 0x6811, 0x1043, 0x2015, 0, 120000 }, +-- +2.7.1 + + +From d9a2dc7fbef477e2160f8f81dc9b30d97a4948bf Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Mon, 28 Mar 2016 10:16:40 -0400 +Subject: [PATCH 239/384] drm/radeon: add another R7 370 quirk + +commit a64663d9870364bd2a2df62bf0d3a9fbe5ea62a8 upstream. + +bug: +https://bugzilla.kernel.org/show_bug.cgi?id=115291 + +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/radeon/si_dpm.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c +index 7d75004..444935d 100644 +--- a/drivers/gpu/drm/radeon/si_dpm.c ++++ b/drivers/gpu/drm/radeon/si_dpm.c +@@ -2930,6 +2930,7 @@ static struct si_dpm_quirk si_dpm_quirk_list[] = { + { PCI_VENDOR_ID_ATI, 0x6810, 0x174b, 0xe271, 85000, 90000 }, + { PCI_VENDOR_ID_ATI, 0x6811, 0x1462, 0x2015, 0, 120000 }, + { PCI_VENDOR_ID_ATI, 0x6811, 0x1043, 0x2015, 0, 120000 }, ++ { PCI_VENDOR_ID_ATI, 0x6811, 0x148c, 0x2015, 0, 120000 }, + { 0, 0, 0, 0 }, + }; + +-- +2.7.1 + + +From 01d0f4ad855b1669fbd1c588e180eefac0f91122 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Mon, 28 Mar 2016 10:21:20 -0400 +Subject: [PATCH 240/384] drm/radeon: add a dpm quirk for all R7 370 parts + +commit 0e5585dc870af947fab2af96a88c2d8b4270247c upstream. + +Higher mclk values are not stable due to a bug somewhere. +Limit them for now. + +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/radeon/si_dpm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c +index 444935d..7285adb 100644 +--- a/drivers/gpu/drm/radeon/si_dpm.c ++++ b/drivers/gpu/drm/radeon/si_dpm.c +@@ -3010,6 +3010,10 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev, + } + ++p; + } ++ /* limit mclk on all R7 370 parts for stability */ ++ if (rdev->pdev->device == 0x6811 && ++ rdev->pdev->revision == 0x81) ++ max_mclk = 120000; + + if (rps->vce_active) { + rps->evclk = rdev->pm.dpm.vce_states[rdev->pm.dpm.vce_level].evclk; +-- +2.7.1 + + +From 4a3d51ae8f953f7f414da1435a95fcc25ed37499 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Thu, 31 Mar 2016 16:07:38 -0400 +Subject: [PATCH 241/384] drm/amdgpu/gmc: move vram type fetching into sw_init + +commit d1518a1db31a25682ea09c4b135fa72d9883be42 upstream. + +early_init gets called before atom asic init so on non-posted +cards, the vram type is not initialized. + +Reviewed-by: Harish Kasiviswanathan +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 16 ++++++++-------- + drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 16 ++++++++-------- + 2 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +index 272110c..ea87033 100644 +--- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +@@ -898,14 +898,6 @@ static int gmc_v7_0_early_init(void *handle) + gmc_v7_0_set_gart_funcs(adev); + gmc_v7_0_set_irq_funcs(adev); + +- if (adev->flags & AMD_IS_APU) { +- adev->mc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN; +- } else { +- u32 tmp = RREG32(mmMC_SEQ_MISC0); +- tmp &= MC_SEQ_MISC0__MT__MASK; +- adev->mc.vram_type = gmc_v7_0_convert_vram_type(tmp); +- } +- + return 0; + } + +@@ -926,6 +918,14 @@ static int gmc_v7_0_sw_init(void *handle) + if (r) + return r; + ++ if (adev->flags & AMD_IS_APU) { ++ adev->mc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN; ++ } else { ++ u32 tmp = RREG32(mmMC_SEQ_MISC0); ++ tmp &= MC_SEQ_MISC0__MT__MASK; ++ adev->mc.vram_type = gmc_v7_0_convert_vram_type(tmp); ++ } ++ + r = amdgpu_irq_add_id(adev, 146, &adev->mc.vm_fault); + if (r) + return r; +diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +index ba4ad00..f035b5b 100644 +--- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +@@ -852,14 +852,6 @@ static int gmc_v8_0_early_init(void *handle) + gmc_v8_0_set_gart_funcs(adev); + gmc_v8_0_set_irq_funcs(adev); + +- if (adev->flags & AMD_IS_APU) { +- adev->mc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN; +- } else { +- u32 tmp = RREG32(mmMC_SEQ_MISC0); +- tmp &= MC_SEQ_MISC0__MT__MASK; +- adev->mc.vram_type = gmc_v8_0_convert_vram_type(tmp); +- } +- + return 0; + } + +@@ -880,6 +872,14 @@ static int gmc_v8_0_sw_init(void *handle) + if (r) + return r; + ++ if (adev->flags & AMD_IS_APU) { ++ adev->mc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN; ++ } else { ++ u32 tmp = RREG32(mmMC_SEQ_MISC0); ++ tmp &= MC_SEQ_MISC0__MT__MASK; ++ adev->mc.vram_type = gmc_v8_0_convert_vram_type(tmp); ++ } ++ + r = amdgpu_irq_add_id(adev, 146, &adev->mc.vm_fault); + if (r) + return r; +-- +2.7.1 + + +From 53332b22208d1090c1144f741210997e23bdcd80 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Thu, 31 Mar 2016 16:41:32 -0400 +Subject: [PATCH 242/384] drm/amdgpu/gmc: use proper register for vram type on + Fiji + +commit b634de4f446c062a0c95ec4d150b4cf7c85e3526 upstream. + +The offset changed on Fiji. + +Reviewed-by: Harish Kasiviswanathan +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +index f035b5b..0842308 100644 +--- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +@@ -862,6 +862,8 @@ static int gmc_v8_0_late_init(void *handle) + return amdgpu_irq_get(adev, &adev->mc.vm_fault, 0); + } + ++#define mmMC_SEQ_MISC0_FIJI 0xA71 ++ + static int gmc_v8_0_sw_init(void *handle) + { + int r; +@@ -875,7 +877,12 @@ static int gmc_v8_0_sw_init(void *handle) + if (adev->flags & AMD_IS_APU) { + adev->mc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN; + } else { +- u32 tmp = RREG32(mmMC_SEQ_MISC0); ++ u32 tmp; ++ ++ if (adev->asic_type == CHIP_FIJI) ++ tmp = RREG32(mmMC_SEQ_MISC0_FIJI); ++ else ++ tmp = RREG32(mmMC_SEQ_MISC0); + tmp &= MC_SEQ_MISC0__MT__MASK; + adev->mc.vram_type = gmc_v8_0_convert_vram_type(tmp); + } +-- +2.7.1 + + +From a5e04f3fe1dc67e2f5ef110bdc57fdebd7bc7d67 Mon Sep 17 00:00:00 2001 +From: Boris Ostrovsky +Date: Fri, 18 Mar 2016 10:11:07 -0400 +Subject: [PATCH 243/384] xen/events: Mask a moving irq + +commit ff1e22e7a638a0782f54f81a6c9cb139aca2da35 upstream. + +Moving an unmasked irq may result in irq handler being invoked on both +source and target CPUs. + +With 2-level this can happen as follows: + +On source CPU: + evtchn_2l_handle_events() -> + generic_handle_irq() -> + handle_edge_irq() -> + eoi_pirq(): + irq_move_irq(data); + + /***** WE ARE HERE *****/ + + if (VALID_EVTCHN(evtchn)) + clear_evtchn(evtchn); + +If at this moment target processor is handling an unrelated event in +evtchn_2l_handle_events()'s loop it may pick up our event since target's +cpu_evtchn_mask claims that this event belongs to it *and* the event is +unmasked and still pending. At the same time, source CPU will continue +executing its own handle_edge_irq(). + +With FIFO interrupt the scenario is similar: irq_move_irq() may result +in a EVTCHNOP_unmask hypercall which, in turn, may make the event +pending on the target CPU. + +We can avoid this situation by moving and clearing the event while +keeping event masked. + +Signed-off-by: Boris Ostrovsky +Signed-off-by: David Vrabel +Signed-off-by: Greg Kroah-Hartman +--- + drivers/xen/events/events_base.c | 28 ++++++++++++++++++++++++---- + 1 file changed, 24 insertions(+), 4 deletions(-) + +diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c +index 524c221..4436778 100644 +--- a/drivers/xen/events/events_base.c ++++ b/drivers/xen/events/events_base.c +@@ -484,9 +484,19 @@ static void eoi_pirq(struct irq_data *data) + struct physdev_eoi eoi = { .irq = pirq_from_irq(data->irq) }; + int rc = 0; + +- irq_move_irq(data); ++ if (!VALID_EVTCHN(evtchn)) ++ return; + +- if (VALID_EVTCHN(evtchn)) ++ if (unlikely(irqd_is_setaffinity_pending(data))) { ++ int masked = test_and_set_mask(evtchn); ++ ++ clear_evtchn(evtchn); ++ ++ irq_move_masked_irq(data); ++ ++ if (!masked) ++ unmask_evtchn(evtchn); ++ } else + clear_evtchn(evtchn); + + if (pirq_needs_eoi(data->irq)) { +@@ -1357,9 +1367,19 @@ static void ack_dynirq(struct irq_data *data) + { + int evtchn = evtchn_from_irq(data->irq); + +- irq_move_irq(data); ++ if (!VALID_EVTCHN(evtchn)) ++ return; + +- if (VALID_EVTCHN(evtchn)) ++ if (unlikely(irqd_is_setaffinity_pending(data))) { ++ int masked = test_and_set_mask(evtchn); ++ ++ clear_evtchn(evtchn); ++ ++ irq_move_masked_irq(data); ++ ++ if (!masked) ++ unmask_evtchn(evtchn); ++ } else + clear_evtchn(evtchn); + } + +-- +2.7.1 + + +From 685c55d8cfed43879a667c2dbfbd5864d7805688 Mon Sep 17 00:00:00 2001 +From: Konstantin Khlebnikov +Date: Sun, 21 Feb 2016 10:12:39 +0300 +Subject: [PATCH 244/384] tcp: convert cached rtt from usec to jiffies when + feeding initial rto + +[ Upstream commit 9bdfb3b79e61c60e1a3e2dc05ad164528afa6b8a ] + +Currently it's converted into msecs, thus HZ=1000 intact. + +Signed-off-by: Konstantin Khlebnikov +Fixes: 740b0f1841f6 ("tcp: switch rtt estimations to usec resolution") +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/tcp_metrics.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c +index c8cbc2b..a726d78 100644 +--- a/net/ipv4/tcp_metrics.c ++++ b/net/ipv4/tcp_metrics.c +@@ -550,7 +550,7 @@ reset: + */ + if (crtt > tp->srtt_us) { + /* Set RTO like tcp_rtt_estimator(), but from cached RTT. */ +- crtt /= 8 * USEC_PER_MSEC; ++ crtt /= 8 * USEC_PER_SEC / HZ; + inet_csk(sk)->icsk_rto = crtt + max(2 * crtt, tcp_rto_min(sk)); + } else if (tp->srtt_us == 0) { + /* RFC6298: 5.7 We've failed to get a valid RTT sample from +-- +2.7.1 + + +From 4c53ee4ad4d2193e3d2eab7bb6f80ba73f382c5a Mon Sep 17 00:00:00 2001 +From: Bernie Harris +Date: Mon, 22 Feb 2016 12:58:05 +1300 +Subject: [PATCH 245/384] tunnel: Clear IPCB(skb)->opt before dst_link_failure + called + +[ Upstream commit 5146d1f151122e868e594c7b45115d64825aee5f ] + +IPCB may contain data from previous layers (in the observed case the +qdisc layer). In the observed scenario, the data was misinterpreted as +ip header options, which later caused the ihl to be set to an invalid +value (<5). This resulted in an infinite loop in the mips implementation +of ip_fast_csum. + +This patch clears IPCB(skb)->opt before dst_link_failure can be called for +various types of tunnels. This change only applies to encapsulated ipv4 +packets. + +The code introduced in 11c21a30 which clears all of IPCB has been removed +to be consistent with these changes, and instead the opt field is cleared +unconditionally in ip_tunnel_xmit. The change in ip_tunnel_xmit applies to +SIT, GRE, and IPIP tunnels. + +The relevant vti, l2tp, and pptp functions already contain similar code for +clearing the IPCB. + +Signed-off-by: Bernie Harris +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/ip_tunnel.c | 3 ++- + net/ipv4/udp_tunnel.c | 2 ++ + net/ipv6/ip6_gre.c | 2 ++ + net/ipv6/ip6_tunnel.c | 2 ++ + 4 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c +index cbb51f3..ce30c8b 100644 +--- a/net/ipv4/ip_tunnel.c ++++ b/net/ipv4/ip_tunnel.c +@@ -663,6 +663,8 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, + inner_iph = (const struct iphdr *)skb_inner_network_header(skb); + connected = (tunnel->parms.iph.daddr != 0); + ++ memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); ++ + dst = tnl_params->daddr; + if (dst == 0) { + /* NBMA tunnel */ +@@ -760,7 +762,6 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, + tunnel->err_time + IPTUNNEL_ERR_TIMEO)) { + tunnel->err_count--; + +- memset(IPCB(skb), 0, sizeof(*IPCB(skb))); + dst_link_failure(skb); + } else + tunnel->err_count = 0; +diff --git a/net/ipv4/udp_tunnel.c b/net/ipv4/udp_tunnel.c +index aba4286..280a9bd 100644 +--- a/net/ipv4/udp_tunnel.c ++++ b/net/ipv4/udp_tunnel.c +@@ -89,6 +89,8 @@ int udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb, + uh->source = src_port; + uh->len = htons(skb->len); + ++ memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); ++ + udp_set_csum(nocheck, skb, src, dst, skb->len); + + return iptunnel_xmit(sk, rt, skb, src, dst, IPPROTO_UDP, +diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c +index e5ea177..4650c68 100644 +--- a/net/ipv6/ip6_gre.c ++++ b/net/ipv6/ip6_gre.c +@@ -778,6 +778,8 @@ static inline int ip6gre_xmit_ipv4(struct sk_buff *skb, struct net_device *dev) + __u32 mtu; + int err; + ++ memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); ++ + if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) + encap_limit = t->parms.encap_limit; + +diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c +index 137fca4..6c5dfec 100644 +--- a/net/ipv6/ip6_tunnel.c ++++ b/net/ipv6/ip6_tunnel.c +@@ -1180,6 +1180,8 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev) + u8 tproto; + int err; + ++ memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); ++ + tproto = ACCESS_ONCE(t->parms.proto); + if (tproto != IPPROTO_IPIP && tproto != 0) + return -1; +-- +2.7.1 + + +From d9b8f9851d972e402635edb8499845bf7b0f1bb7 Mon Sep 17 00:00:00 2001 +From: Hannes Frederic Sowa +Date: Mon, 22 Feb 2016 18:43:25 +0100 +Subject: [PATCH 246/384] ipv4: only create late gso-skb if skb is already set + up with CHECKSUM_PARTIAL + +[ Upstream commit a8c4a2522a0808c5c2143612909717d1115c40cf ] + +Otherwise we break the contract with GSO to only pass CHECKSUM_PARTIAL +skbs down. This can easily happen with UDP+IPv4 sockets with the first +MSG_MORE write smaller than the MTU, second write is a sendfile. + +Returning -EOPNOTSUPP lets the callers fall back into normal sendmsg path, +were we calculate the checksum manually during copying. + +Commit d749c9cbffd6 ("ipv4: no CHECKSUM_PARTIAL on MSG_MORE corked +sockets") started to exposes this bug. + +Fixes: d749c9cbffd6 ("ipv4: no CHECKSUM_PARTIAL on MSG_MORE corked sockets") +Reported-by: Jiri Benc +Cc: Jiri Benc +Reported-by: Wakko Warner +Cc: Wakko Warner +Signed-off-by: Hannes Frederic Sowa +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/ip_output.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c +index 49f0285..f2ad521 100644 +--- a/net/ipv4/ip_output.c ++++ b/net/ipv4/ip_output.c +@@ -1237,13 +1237,16 @@ ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page, + if (!skb) + return -EINVAL; + +- cork->length += size; + if ((size + skb->len > mtu) && + (sk->sk_protocol == IPPROTO_UDP) && + (rt->dst.dev->features & NETIF_F_UFO)) { ++ if (skb->ip_summed != CHECKSUM_PARTIAL) ++ return -EOPNOTSUPP; ++ + skb_shinfo(skb)->gso_size = mtu - fragheaderlen; + skb_shinfo(skb)->gso_type = SKB_GSO_UDP; + } ++ cork->length += size; + + while (size > 0) { + if (skb_is_gso(skb)) { +-- +2.7.1 + + +From 607a963a77ef0fe76d00d5ea1da88f3c3c7e9b87 Mon Sep 17 00:00:00 2001 +From: Diego Viola +Date: Tue, 23 Feb 2016 12:04:04 -0300 +Subject: [PATCH 247/384] net: jme: fix suspend/resume on JMC260 + +[ Upstream commit ee50c130c82175eaa0820c96b6d3763928af2241 ] + +The JMC260 network card fails to suspend/resume because the call to +jme_start_irq() was too early, moving the call to jme_start_irq() after +the call to jme_reset_link() makes it work. + +Prior this change suspend/resume would fail unless /sys/power/pm_async=0 +was explicitly specified. + +Relevant bug report: https://bugzilla.kernel.org/show_bug.cgi?id=112351 + +Signed-off-by: Diego Viola +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/jme.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c +index 060dd39..973dade 100644 +--- a/drivers/net/ethernet/jme.c ++++ b/drivers/net/ethernet/jme.c +@@ -3312,13 +3312,14 @@ jme_resume(struct device *dev) + jme_reset_phy_processor(jme); + jme_phy_calibration(jme); + jme_phy_setEA(jme); +- jme_start_irq(jme); + netif_device_attach(netdev); + + atomic_inc(&jme->link_changing); + + jme_reset_link(jme); + ++ jme_start_irq(jme); ++ + return 0; + } + +-- +2.7.1 + + +From 282d1ef99cedc7b5c3665ca233924483c49537b5 Mon Sep 17 00:00:00 2001 +From: David Ahern +Date: Tue, 23 Feb 2016 10:10:26 -0800 +Subject: [PATCH 248/384] net: vrf: Remove direct access to skb->data + +[ Upstream commit 65c38aa653c14df49e19faad74bd375f36e61c57 ] + +Nik pointed that the VRF driver should be using skb_header_pointer +instead of accessing skb->data and bits beyond directly which can +be garbage. + +Fixes: 35402e313663 ("net: Add IPv6 support to VRF device") +Cc: Nikolay Aleksandrov +Signed-off-by: David Ahern +Signed-off-by: Nikolay Aleksandrov +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/vrf.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c +index 0a242b2..903bda4 100644 +--- a/drivers/net/vrf.c ++++ b/drivers/net/vrf.c +@@ -114,20 +114,23 @@ static struct dst_ops vrf_dst_ops = { + #if IS_ENABLED(CONFIG_IPV6) + static bool check_ipv6_frame(const struct sk_buff *skb) + { +- const struct ipv6hdr *ipv6h = (struct ipv6hdr *)skb->data; +- size_t hlen = sizeof(*ipv6h); ++ const struct ipv6hdr *ipv6h; ++ struct ipv6hdr _ipv6h; + bool rc = true; + +- if (skb->len < hlen) ++ ipv6h = skb_header_pointer(skb, 0, sizeof(_ipv6h), &_ipv6h); ++ if (!ipv6h) + goto out; + + if (ipv6h->nexthdr == NEXTHDR_ICMP) { + const struct icmp6hdr *icmph; ++ struct icmp6hdr _icmph; + +- if (skb->len < hlen + sizeof(*icmph)) ++ icmph = skb_header_pointer(skb, sizeof(_ipv6h), ++ sizeof(_icmph), &_icmph); ++ if (!icmph) + goto out; + +- icmph = (struct icmp6hdr *)(skb->data + sizeof(*ipv6h)); + switch (icmph->icmp6_type) { + case NDISC_ROUTER_SOLICITATION: + case NDISC_ROUTER_ADVERTISEMENT: +-- +2.7.1 + + +From 2e68d112f6cecc05fecd0ae9f4e00e32249d6bfa Mon Sep 17 00:00:00 2001 +From: Stefan Wahren +Date: Tue, 23 Feb 2016 19:23:23 +0000 +Subject: [PATCH 249/384] net: qca_spi: Don't clear IFF_BROADCAST + +[ Upstream commit 2b70bad23c89b121a3e4a00f8968d14ebb78887d ] + +Currently qcaspi_netdev_setup accidentally clears IFF_BROADCAST. +So fix this by keeping the flags from ether_setup. + +Reported-by: Michael Heimpold +Signed-off-by: Stefan Wahren +Fixes: 291ab06ecf67 (net: qualcomm: new Ethernet over SPI driver for QCA7000) +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/qualcomm/qca_spi.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c +index 689a4a5..f2ee3e5f 100644 +--- a/drivers/net/ethernet/qualcomm/qca_spi.c ++++ b/drivers/net/ethernet/qualcomm/qca_spi.c +@@ -811,7 +811,6 @@ qcaspi_netdev_setup(struct net_device *dev) + dev->netdev_ops = &qcaspi_netdev_ops; + qcaspi_set_ethtool_ops(dev); + dev->watchdog_timeo = QCASPI_TX_TIMEOUT; +- dev->flags = IFF_MULTICAST; + dev->tx_queue_len = 100; + + qca = netdev_priv(dev); +-- +2.7.1 + + +From ab8b1ac69e0b40aa38d04a825f33018e41d65156 Mon Sep 17 00:00:00 2001 +From: Stefan Wahren +Date: Tue, 23 Feb 2016 19:23:24 +0000 +Subject: [PATCH 250/384] net: qca_spi: clear IFF_TX_SKB_SHARING + +[ Upstream commit a4690afeb0d2d7ba4d60dfa98a89f3bb1ce60ecd ] + +ether_setup sets IFF_TX_SKB_SHARING but this is not supported by +qca_spi as it modifies the skb on xmit. + +Signed-off-by: Stefan Wahren +Fixes: 291ab06ecf67 (net: qualcomm: new Ethernet over SPI driver for QCA7000) +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/qualcomm/qca_spi.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c +index f2ee3e5f..1ef0393 100644 +--- a/drivers/net/ethernet/qualcomm/qca_spi.c ++++ b/drivers/net/ethernet/qualcomm/qca_spi.c +@@ -811,6 +811,7 @@ qcaspi_netdev_setup(struct net_device *dev) + dev->netdev_ops = &qcaspi_netdev_ops; + qcaspi_set_ethtool_ops(dev); + dev->watchdog_timeo = QCASPI_TX_TIMEOUT; ++ dev->priv_flags &= ~IFF_TX_SKB_SHARING; + dev->tx_queue_len = 100; + + qca = netdev_priv(dev); +-- +2.7.1 + + +From 4292ef718bdef2d9eb783e2f78e1950d54d8c02d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Linus=20L=C3=BCssing?= +Date: Wed, 24 Feb 2016 04:21:42 +0100 +Subject: [PATCH 251/384] net: fix bridge multicast packet checksum validation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[ Upstream commit 9b368814b336b0a1a479135eb2815edbc00efd3c ] + +We need to update the skb->csum after pulling the skb, otherwise +an unnecessary checksum (re)computation can ocure for IGMP/MLD packets +in the bridge code. Additionally this fixes the following splats for +network devices / bridge ports with support for and enabled RX checksum +offloading: + +[...] +[ 43.986968] eth0: hw csum failure +[ 43.990344] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.4.0 #2 +[ 43.996193] Hardware name: BCM2709 +[ 43.999647] [<800204e0>] (unwind_backtrace) from [<8001cf14>] (show_stack+0x10/0x14) +[ 44.007432] [<8001cf14>] (show_stack) from [<801ab614>] (dump_stack+0x80/0x90) +[ 44.014695] [<801ab614>] (dump_stack) from [<802e4548>] (__skb_checksum_complete+0x6c/0xac) +[ 44.023090] [<802e4548>] (__skb_checksum_complete) from [<803a055c>] (ipv6_mc_validate_checksum+0x104/0x178) +[ 44.032959] [<803a055c>] (ipv6_mc_validate_checksum) from [<802e111c>] (skb_checksum_trimmed+0x130/0x188) +[ 44.042565] [<802e111c>] (skb_checksum_trimmed) from [<803a06e8>] (ipv6_mc_check_mld+0x118/0x338) +[ 44.051501] [<803a06e8>] (ipv6_mc_check_mld) from [<803b2c98>] (br_multicast_rcv+0x5dc/0xd00) +[ 44.060077] [<803b2c98>] (br_multicast_rcv) from [<803aa510>] (br_handle_frame_finish+0xac/0x51c) +[...] + +Fixes: 9afd85c9e455 ("net: Export IGMP/MLD message validation code") +Reported-by: Álvaro Fernández Rojas +Signed-off-by: Linus Lüssing +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/skbuff.h | 17 +++++++++++++++++ + net/core/skbuff.c | 22 ++++++++++++++++++++-- + 2 files changed, 37 insertions(+), 2 deletions(-) + +diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h +index 71a6f5b..dcf5a05 100644 +--- a/include/linux/skbuff.h ++++ b/include/linux/skbuff.h +@@ -2731,6 +2731,23 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb, + + unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); + ++static inline void skb_postpush_rcsum(struct sk_buff *skb, ++ const void *start, unsigned int len) ++{ ++ /* For performing the reverse operation to skb_postpull_rcsum(), ++ * we can instead of ... ++ * ++ * skb->csum = csum_add(skb->csum, csum_partial(start, len, 0)); ++ * ++ * ... just use this equivalent version here to save a few ++ * instructions. Feeding csum of 0 in csum_partial() and later ++ * on adding skb->csum is equivalent to feed skb->csum in the ++ * first place. ++ */ ++ if (skb->ip_summed == CHECKSUM_COMPLETE) ++ skb->csum = csum_partial(start, len, skb->csum); ++} ++ + /** + * pskb_trim_rcsum - trim received skb and update checksum + * @skb: buffer to trim +diff --git a/net/core/skbuff.c b/net/core/skbuff.c +index 12780dc..5905f61 100644 +--- a/net/core/skbuff.c ++++ b/net/core/skbuff.c +@@ -2960,6 +2960,24 @@ int skb_append_pagefrags(struct sk_buff *skb, struct page *page, + EXPORT_SYMBOL_GPL(skb_append_pagefrags); + + /** ++ * skb_push_rcsum - push skb and update receive checksum ++ * @skb: buffer to update ++ * @len: length of data pulled ++ * ++ * This function performs an skb_push on the packet and updates ++ * the CHECKSUM_COMPLETE checksum. It should be used on ++ * receive path processing instead of skb_push unless you know ++ * that the checksum difference is zero (e.g., a valid IP header) ++ * or you are setting ip_summed to CHECKSUM_NONE. ++ */ ++static unsigned char *skb_push_rcsum(struct sk_buff *skb, unsigned len) ++{ ++ skb_push(skb, len); ++ skb_postpush_rcsum(skb, skb->data, len); ++ return skb->data; ++} ++ ++/** + * skb_pull_rcsum - pull skb and update receive checksum + * @skb: buffer to update + * @len: length of data pulled +@@ -4096,9 +4114,9 @@ struct sk_buff *skb_checksum_trimmed(struct sk_buff *skb, + if (!pskb_may_pull(skb_chk, offset)) + goto err; + +- __skb_pull(skb_chk, offset); ++ skb_pull_rcsum(skb_chk, offset); + ret = skb_chkf(skb_chk); +- __skb_push(skb_chk, offset); ++ skb_push_rcsum(skb_chk, offset); + + if (ret) + goto err; +-- +2.7.1 + + +From 7bf8aaa7771167d11d01c8d4fcd4b5e68342e485 Mon Sep 17 00:00:00 2001 +From: Xin Long +Date: Sun, 28 Feb 2016 10:03:51 +0800 +Subject: [PATCH 252/384] sctp: lack the check for ports in sctp_v6_cmp_addr + +[ Upstream commit 40b4f0fd74e46c017814618d67ec9127ff20f157 ] + +As the member .cmp_addr of sctp_af_inet6, sctp_v6_cmp_addr should also check +the port of addresses, just like sctp_v4_cmp_addr, cause it's invoked by +sctp_cmp_addr_exact(). + +Now sctp_v6_cmp_addr just check the port when two addresses have different +family, and lack the port check for two ipv6 addresses. that will make +sctp_hash_cmp() cannot work well. + +so fix it by adding ports comparison in sctp_v6_cmp_addr(). + +Signed-off-by: Xin Long +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/sctp/ipv6.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c +index ec52912..ce46f1c 100644 +--- a/net/sctp/ipv6.c ++++ b/net/sctp/ipv6.c +@@ -526,6 +526,8 @@ static int sctp_v6_cmp_addr(const union sctp_addr *addr1, + } + return 0; + } ++ if (addr1->v6.sin6_port != addr2->v6.sin6_port) ++ return 0; + if (!ipv6_addr_equal(&addr1->v6.sin6_addr, &addr2->v6.sin6_addr)) + return 0; + /* If this is a linklocal address, compare the scope_id. */ +-- +2.7.1 + + +From ff5808f438c9da30b94347ff68ba5ff62fb781c1 Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Mon, 29 Feb 2016 15:03:33 -0800 +Subject: [PATCH 253/384] mld, igmp: Fix reserved tailroom calculation + +[ Upstream commit 1837b2e2bcd23137766555a63867e649c0b637f0 ] + +The current reserved_tailroom calculation fails to take hlen and tlen into +account. + +skb: +[__hlen__|__data____________|__tlen___|__extra__] +^ ^ +head skb_end_offset + +In this representation, hlen + data + tlen is the size passed to alloc_skb. +"extra" is the extra space made available in __alloc_skb because of +rounding up by kmalloc. We can reorder the representation like so: + +[__hlen__|__data____________|__extra__|__tlen___] +^ ^ +head skb_end_offset + +The maximum space available for ip headers and payload without +fragmentation is min(mtu, data + extra). Therefore, +reserved_tailroom += data + extra + tlen - min(mtu, data + extra) += skb_end_offset - hlen - min(mtu, skb_end_offset - hlen - tlen) += skb_tailroom - min(mtu, skb_tailroom - tlen) ; after skb_reserve(hlen) + +Compare the second line to the current expression: +reserved_tailroom = skb_end_offset - min(mtu, skb_end_offset) +and we can see that hlen and tlen are not taken into account. + +The min() in the third line can be expanded into: +if mtu < skb_tailroom - tlen: + reserved_tailroom = skb_tailroom - mtu +else: + reserved_tailroom = tlen + +Depending on hlen, tlen, mtu and the number of multicast address records, +the current code may output skbs that have less tailroom than +dev->needed_tailroom or it may output more skbs than needed because not all +space available is used. + +Fixes: 4c672e4b ("ipv6: mld: fix add_grhead skb_over_panic for devs with large MTUs") +Signed-off-by: Benjamin Poirier +Acked-by: Hannes Frederic Sowa +Acked-by: Daniel Borkmann +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/skbuff.h | 24 ++++++++++++++++++++++++ + net/ipv4/igmp.c | 3 +-- + net/ipv6/mcast.c | 3 +-- + 3 files changed, 26 insertions(+), 4 deletions(-) + +diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h +index dcf5a05..d17c4d9 100644 +--- a/include/linux/skbuff.h ++++ b/include/linux/skbuff.h +@@ -1915,6 +1915,30 @@ static inline void skb_reserve(struct sk_buff *skb, int len) + skb->tail += len; + } + ++/** ++ * skb_tailroom_reserve - adjust reserved_tailroom ++ * @skb: buffer to alter ++ * @mtu: maximum amount of headlen permitted ++ * @needed_tailroom: minimum amount of reserved_tailroom ++ * ++ * Set reserved_tailroom so that headlen can be as large as possible but ++ * not larger than mtu and tailroom cannot be smaller than ++ * needed_tailroom. ++ * The required headroom should already have been reserved before using ++ * this function. ++ */ ++static inline void skb_tailroom_reserve(struct sk_buff *skb, unsigned int mtu, ++ unsigned int needed_tailroom) ++{ ++ SKB_LINEAR_ASSERT(skb); ++ if (mtu < skb_tailroom(skb) - needed_tailroom) ++ /* use at most mtu */ ++ skb->reserved_tailroom = skb_tailroom(skb) - mtu; ++ else ++ /* use up to all available space */ ++ skb->reserved_tailroom = needed_tailroom; ++} ++ + #define ENCAP_TYPE_ETHER 0 + #define ENCAP_TYPE_IPPROTO 1 + +diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c +index 05e4cba..b3086cf 100644 +--- a/net/ipv4/igmp.c ++++ b/net/ipv4/igmp.c +@@ -356,9 +356,8 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, unsigned int mtu) + skb_dst_set(skb, &rt->dst); + skb->dev = dev; + +- skb->reserved_tailroom = skb_end_offset(skb) - +- min(mtu, skb_end_offset(skb)); + skb_reserve(skb, hlen); ++ skb_tailroom_reserve(skb, mtu, tlen); + + skb_reset_network_header(skb); + pip = ip_hdr(skb); +diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c +index 5ee56d0..d64ee7e 100644 +--- a/net/ipv6/mcast.c ++++ b/net/ipv6/mcast.c +@@ -1574,9 +1574,8 @@ static struct sk_buff *mld_newpack(struct inet6_dev *idev, unsigned int mtu) + return NULL; + + skb->priority = TC_PRIO_CONTROL; +- skb->reserved_tailroom = skb_end_offset(skb) - +- min(mtu, skb_end_offset(skb)); + skb_reserve(skb, hlen); ++ skb_tailroom_reserve(skb, mtu, tlen); + + if (__ipv6_get_lladdr(idev, &addr_buf, IFA_F_TENTATIVE)) { + /* : +-- +2.7.1 + + +From 4019983522d029aa07784274d048a5084628477c Mon Sep 17 00:00:00 2001 +From: Parthasarathy Bhuvaragan +Date: Tue, 1 Mar 2016 11:07:09 +0100 +Subject: [PATCH 254/384] tipc: Revert "tipc: use existing sk_write_queue for + outgoing packet chain" + +[ Upstream commit f214fc402967e1bc94ad7f39faa03db5813d6849 ] + +reverts commit 94153e36e709e ("tipc: use existing sk_write_queue for +outgoing packet chain") + +In Commit 94153e36e709e, we assume that we fill & empty the socket's +sk_write_queue within the same lock_sock() session. + +This is not true if the link is congested. During congestion, the +socket lock is released while we wait for the congestion to cease. +This implementation causes a nullptr exception, if the user space +program has several threads accessing the same socket descriptor. + +Consider two threads of the same program performing the following: + Thread1 Thread2 +-------------------- ---------------------- +Enter tipc_sendmsg() Enter tipc_sendmsg() +lock_sock() lock_sock() +Enter tipc_link_xmit(), ret=ELINKCONG spin on socket lock.. +sk_wait_event() : +release_sock() grab socket lock + : Enter tipc_link_xmit(), ret=0 + : release_sock() +Wakeup after congestion +lock_sock() +skb = skb_peek(pktchain); +!! TIPC_SKB_CB(skb)->wakeup_pending = tsk->link_cong; + +In this case, the second thread transmits the buffers belonging to +both thread1 and thread2 successfully. When the first thread wakeup +after the congestion it assumes that the pktchain is intact and +operates on the skb's in it, which leads to the following exception: + +[2102.439969] BUG: unable to handle kernel NULL pointer dereference at 00000000000000d0 +[2102.440074] IP: [] __tipc_link_xmit+0x2b0/0x4d0 [tipc] +[2102.440074] PGD 3fa3f067 PUD 3fa6b067 PMD 0 +[2102.440074] Oops: 0000 [#1] SMP +[2102.440074] CPU: 2 PID: 244 Comm: sender Not tainted 3.12.28 #1 +[2102.440074] RIP: 0010:[] [] __tipc_link_xmit+0x2b0/0x4d0 [tipc] +[...] +[2102.440074] Call Trace: +[2102.440074] [] ? schedule+0x29/0x70 +[2102.440074] [] ? tipc_node_unlock+0x46/0x170 [tipc] +[2102.440074] [] tipc_link_xmit+0x51/0xf0 [tipc] +[2102.440074] [] tipc_send_stream+0x11e/0x4f0 [tipc] +[2102.440074] [] ? __wake_up_sync+0x20/0x20 +[2102.440074] [] tipc_send_packet+0x1c/0x20 [tipc] +[2102.440074] [] sock_sendmsg+0xa8/0xd0 +[2102.440074] [] ? release_sock+0x145/0x170 +[2102.440074] [] ___sys_sendmsg+0x3d8/0x3e0 +[2102.440074] [] ? _raw_spin_unlock+0xe/0x10 +[2102.440074] [] ? handle_mm_fault+0x6ca/0x9d0 +[2102.440074] [] ? set_next_entity+0x85/0xa0 +[2102.440074] [] ? _raw_spin_unlock_irq+0xe/0x20 +[2102.440074] [] ? finish_task_switch+0x5c/0xc0 +[2102.440074] [] ? __schedule+0x34c/0x950 +[2102.440074] [] __sys_sendmsg+0x42/0x80 +[2102.440074] [] SyS_sendmsg+0x12/0x20 +[2102.440074] [] system_call_fastpath+0x16/0x1b + +In this commit, we maintain the skb list always in the stack. + +Signed-off-by: Parthasarathy Bhuvaragan +Acked-by: Ying Xue +Acked-by: Jon Maloy +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/tipc/socket.c | 33 +++++++++++++++++++-------------- + 1 file changed, 19 insertions(+), 14 deletions(-) + +diff --git a/net/tipc/socket.c b/net/tipc/socket.c +index b53246f..e53003c 100644 +--- a/net/tipc/socket.c ++++ b/net/tipc/socket.c +@@ -673,7 +673,7 @@ static int tipc_sendmcast(struct socket *sock, struct tipc_name_seq *seq, + struct tipc_sock *tsk = tipc_sk(sk); + struct net *net = sock_net(sk); + struct tipc_msg *mhdr = &tsk->phdr; +- struct sk_buff_head *pktchain = &sk->sk_write_queue; ++ struct sk_buff_head pktchain; + struct iov_iter save = msg->msg_iter; + uint mtu; + int rc; +@@ -687,14 +687,16 @@ static int tipc_sendmcast(struct socket *sock, struct tipc_name_seq *seq, + msg_set_nameupper(mhdr, seq->upper); + msg_set_hdr_sz(mhdr, MCAST_H_SIZE); + ++ skb_queue_head_init(&pktchain); ++ + new_mtu: + mtu = tipc_bcast_get_mtu(net); +- rc = tipc_msg_build(mhdr, msg, 0, dsz, mtu, pktchain); ++ rc = tipc_msg_build(mhdr, msg, 0, dsz, mtu, &pktchain); + if (unlikely(rc < 0)) + return rc; + + do { +- rc = tipc_bcast_xmit(net, pktchain); ++ rc = tipc_bcast_xmit(net, &pktchain); + if (likely(!rc)) + return dsz; + +@@ -704,7 +706,7 @@ new_mtu: + if (!rc) + continue; + } +- __skb_queue_purge(pktchain); ++ __skb_queue_purge(&pktchain); + if (rc == -EMSGSIZE) { + msg->msg_iter = save; + goto new_mtu; +@@ -863,7 +865,7 @@ static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dsz) + struct net *net = sock_net(sk); + struct tipc_msg *mhdr = &tsk->phdr; + u32 dnode, dport; +- struct sk_buff_head *pktchain = &sk->sk_write_queue; ++ struct sk_buff_head pktchain; + struct sk_buff *skb; + struct tipc_name_seq *seq; + struct iov_iter save; +@@ -924,17 +926,18 @@ static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dsz) + msg_set_hdr_sz(mhdr, BASIC_H_SIZE); + } + ++ skb_queue_head_init(&pktchain); + save = m->msg_iter; + new_mtu: + mtu = tipc_node_get_mtu(net, dnode, tsk->portid); +- rc = tipc_msg_build(mhdr, m, 0, dsz, mtu, pktchain); ++ rc = tipc_msg_build(mhdr, m, 0, dsz, mtu, &pktchain); + if (rc < 0) + return rc; + + do { +- skb = skb_peek(pktchain); ++ skb = skb_peek(&pktchain); + TIPC_SKB_CB(skb)->wakeup_pending = tsk->link_cong; +- rc = tipc_node_xmit(net, pktchain, dnode, tsk->portid); ++ rc = tipc_node_xmit(net, &pktchain, dnode, tsk->portid); + if (likely(!rc)) { + if (sock->state != SS_READY) + sock->state = SS_CONNECTING; +@@ -946,7 +949,7 @@ new_mtu: + if (!rc) + continue; + } +- __skb_queue_purge(pktchain); ++ __skb_queue_purge(&pktchain); + if (rc == -EMSGSIZE) { + m->msg_iter = save; + goto new_mtu; +@@ -1016,7 +1019,7 @@ static int __tipc_send_stream(struct socket *sock, struct msghdr *m, size_t dsz) + struct net *net = sock_net(sk); + struct tipc_sock *tsk = tipc_sk(sk); + struct tipc_msg *mhdr = &tsk->phdr; +- struct sk_buff_head *pktchain = &sk->sk_write_queue; ++ struct sk_buff_head pktchain; + DECLARE_SOCKADDR(struct sockaddr_tipc *, dest, m->msg_name); + u32 portid = tsk->portid; + int rc = -EINVAL; +@@ -1044,17 +1047,19 @@ static int __tipc_send_stream(struct socket *sock, struct msghdr *m, size_t dsz) + + timeo = sock_sndtimeo(sk, m->msg_flags & MSG_DONTWAIT); + dnode = tsk_peer_node(tsk); ++ skb_queue_head_init(&pktchain); + + next: + save = m->msg_iter; + mtu = tsk->max_pkt; + send = min_t(uint, dsz - sent, TIPC_MAX_USER_MSG_SIZE); +- rc = tipc_msg_build(mhdr, m, sent, send, mtu, pktchain); ++ rc = tipc_msg_build(mhdr, m, sent, send, mtu, &pktchain); + if (unlikely(rc < 0)) + return rc; ++ + do { + if (likely(!tsk_conn_cong(tsk))) { +- rc = tipc_node_xmit(net, pktchain, dnode, portid); ++ rc = tipc_node_xmit(net, &pktchain, dnode, portid); + if (likely(!rc)) { + tsk->sent_unacked++; + sent += send; +@@ -1063,7 +1068,7 @@ next: + goto next; + } + if (rc == -EMSGSIZE) { +- __skb_queue_purge(pktchain); ++ __skb_queue_purge(&pktchain); + tsk->max_pkt = tipc_node_get_mtu(net, dnode, + portid); + m->msg_iter = save; +@@ -1077,7 +1082,7 @@ next: + rc = tipc_wait_for_sndpkt(sock, &timeo); + } while (!rc); + +- __skb_queue_purge(pktchain); ++ __skb_queue_purge(&pktchain); + return sent ? sent : rc; + } + +-- +2.7.1 + + +From 4c107e1a29b98bf45458bd6052a41d91a9a9c860 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +Date: Tue, 1 Mar 2016 14:31:02 +0100 +Subject: [PATCH 255/384] qmi_wwan: add Sierra Wireless EM74xx device ID +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[ Upstream commit bf13c94ccb33c3182efc92ce4989506a0f541243 ] + +The MC74xx and EM74xx modules use different IDs by default, according +to the Lenovo EM7455 driver for Windows. + +Signed-off-by: Bjørn Mork +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/usb/qmi_wwan.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c +index 982e0acd..df77467 100644 +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -718,8 +718,10 @@ static const struct usb_device_id products[] = { + {QMI_FIXED_INTF(0x1199, 0x9061, 8)}, /* Sierra Wireless Modem */ + {QMI_FIXED_INTF(0x1199, 0x9070, 8)}, /* Sierra Wireless MC74xx/EM74xx */ + {QMI_FIXED_INTF(0x1199, 0x9070, 10)}, /* Sierra Wireless MC74xx/EM74xx */ +- {QMI_FIXED_INTF(0x1199, 0x9071, 8)}, /* Sierra Wireless MC74xx/EM74xx */ +- {QMI_FIXED_INTF(0x1199, 0x9071, 10)}, /* Sierra Wireless MC74xx/EM74xx */ ++ {QMI_FIXED_INTF(0x1199, 0x9071, 8)}, /* Sierra Wireless MC74xx */ ++ {QMI_FIXED_INTF(0x1199, 0x9071, 10)}, /* Sierra Wireless MC74xx */ ++ {QMI_FIXED_INTF(0x1199, 0x9079, 8)}, /* Sierra Wireless EM74xx */ ++ {QMI_FIXED_INTF(0x1199, 0x9079, 10)}, /* Sierra Wireless EM74xx */ + {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */ + {QMI_FIXED_INTF(0x1bbb, 0x0203, 2)}, /* Alcatel L800MA */ + {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ +-- +2.7.1 + + +From a4f673a4df206957d949008c5fe7a5e45d442869 Mon Sep 17 00:00:00 2001 +From: Florian Westphal +Date: Tue, 1 Mar 2016 16:15:16 +0100 +Subject: [PATCH 256/384] ipv6: re-enable fragment header matching in + ipv6_find_hdr + +[ Upstream commit 5d150a985520bbe3cb2aa1ceef24a7e32f20c15f ] + +When ipv6_find_hdr is used to find a fragment header +(caller specifies target NEXTHDR_FRAGMENT) we erronously return +-ENOENT for all fragments with nonzero offset. + +Before commit 9195bb8e381d, when target was specified, we did not +enter the exthdr walk loop as nexthdr == target so this used to work. + +Now we do (so we can skip empty route headers). When we then stumble upon +a frag with nonzero frag_off we must return -ENOENT ("header not found") +only if the caller did not specifically request NEXTHDR_FRAGMENT. + +This allows nfables exthdr expression to match ipv6 fragments, e.g. via + +nft add rule ip6 filter input frag frag-off gt 0 + +Fixes: 9195bb8e381d ("ipv6: improve ipv6_find_hdr() to skip empty routing headers") +Signed-off-by: Florian Westphal +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv6/exthdrs_core.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/net/ipv6/exthdrs_core.c b/net/ipv6/exthdrs_core.c +index 5c5d23e..9508a20 100644 +--- a/net/ipv6/exthdrs_core.c ++++ b/net/ipv6/exthdrs_core.c +@@ -257,7 +257,11 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, + *fragoff = _frag_off; + return hp->nexthdr; + } +- return -ENOENT; ++ if (!found) ++ return -ENOENT; ++ if (fragoff) ++ *fragoff = _frag_off; ++ break; + } + hdrlen = 8; + } else if (nexthdr == NEXTHDR_AUTH) { +-- +2.7.1 + + +From b8fdebda646d87124a396aa831daecee0c1f54fb Mon Sep 17 00:00:00 2001 +From: Daniel Borkmann +Date: Wed, 2 Mar 2016 02:32:08 +0100 +Subject: [PATCH 257/384] vxlan: fix missing options_len update on RX with + collect metadata + +[ Upstream commit 4024fcf70556311521e7b6cf79fa50e16f31013a ] + +When signalling to metadata consumers that the metadata_dst entry +carries additional GBP extension data for vxlan (TUNNEL_VXLAN_OPT), +the dst's vxlan_metadata information is populated, but options_len +is left to zero. F.e. in ovs, ovs_flow_key_extract() checks for +options_len before extracting the data through ip_tunnel_info_opts_get(). + +Geneve uses ip_tunnel_info_opts_set() helper in receive path, which +sets options_len internally, vxlan however uses ip_tunnel_info_opts(), +so when filling vxlan_metadata, we do need to update options_len. + +Fixes: 4c22279848c5 ("ip-tunnel: Use API to access tunnel metadata options.") +Signed-off-by: Daniel Borkmann +Acked-by: Thomas Graf +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/vxlan.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c +index e0fcda4..3c0df70 100644 +--- a/drivers/net/vxlan.c ++++ b/drivers/net/vxlan.c +@@ -1306,8 +1306,10 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb) + gbp = (struct vxlanhdr_gbp *)vxh; + md->gbp = ntohs(gbp->policy_id); + +- if (tun_dst) ++ if (tun_dst) { + tun_dst->u.tun_info.key.tun_flags |= TUNNEL_VXLAN_OPT; ++ tun_dst->u.tun_info.options_len = sizeof(*md); ++ } + + if (gbp->dont_learn) + md->gbp |= VXLAN_GBP_DONT_LEARN; +-- +2.7.1 + + +From 20f751d1f92d607d94652a7bbf51ecb4af6a9778 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +Date: Thu, 3 Mar 2016 22:20:53 +0100 +Subject: [PATCH 258/384] cdc_ncm: toggle altsetting to force reset before + setup +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[ Upstream commit 48906f62c96cc2cd35753e59310cb70eb08cc6a5 ] + +Some devices will silently fail setup unless they are reset first. +This is necessary even if the data interface is already in +altsetting 0, which it will be when the device is probed for the +first time. Briefly toggling the altsetting forces a function +reset regardless of the initial state. + +This fixes a setup problem observed on a number of Huawei devices, +appearing to operate in NTB-32 mode even if we explicitly set them +to NTB-16 mode. + +Signed-off-by: Bjørn Mork +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/usb/cdc_ncm.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c +index e8a1144..8c2bb77 100644 +--- a/drivers/net/usb/cdc_ncm.c ++++ b/drivers/net/usb/cdc_ncm.c +@@ -794,7 +794,11 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_ + + iface_no = ctx->data->cur_altsetting->desc.bInterfaceNumber; + +- /* reset data interface */ ++ /* Reset data interface. Some devices will not reset properly ++ * unless they are configured first. Toggle the altsetting to ++ * force a reset ++ */ ++ usb_set_interface(dev->udev, iface_no, data_altsetting); + temp = usb_set_interface(dev->udev, iface_no, 0); + if (temp) { + dev_dbg(&intf->dev, "set interface failed\n"); +-- +2.7.1 + + +From 51c90c9e64f28628cad93bc45444d87d17b3241a Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Mon, 7 Mar 2016 11:31:10 +0100 +Subject: [PATCH 259/384] usbnet: cleanup after bind() in probe() + +[ Upstream commit 1666984c8625b3db19a9abc298931d35ab7bc64b ] + +In case bind() works, but a later error forces bailing +in probe() in error cases work and a timer may be scheduled. +They must be killed. This fixes an error case related to +the double free reported in +http://www.spinics.net/lists/netdev/msg367669.html +and needs to go on top of Linus' fix to cdc-ncm. + +Signed-off-by: Oliver Neukum +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/usb/usbnet.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c +index 0744bf2..c2ea4e5 100644 +--- a/drivers/net/usb/usbnet.c ++++ b/drivers/net/usb/usbnet.c +@@ -1766,6 +1766,13 @@ out3: + if (info->unbind) + info->unbind (dev, udev); + out1: ++ /* subdrivers must undo all they did in bind() if they ++ * fail it, but we may fail later and a deferred kevent ++ * may trigger an error resubmitting itself and, worse, ++ * schedule a timer. So we kill it all just in case. ++ */ ++ cancel_work_sync(&dev->kevent); ++ del_timer_sync(&dev->delay); + free_netdev(net); + out: + return status; +-- +2.7.1 + + +From f7361abb2f4e00647e0c4bc4634f13117540fdc9 Mon Sep 17 00:00:00 2001 +From: Bill Sommerfeld +Date: Fri, 4 Mar 2016 14:47:21 -0800 +Subject: [PATCH 260/384] udp6: fix UDP/IPv6 encap resubmit path + +[ Upstream commit 59dca1d8a6725a121dae6c452de0b2611d5865dc ] + +IPv4 interprets a negative return value from a protocol handler as a +request to redispatch to a new protocol. In contrast, IPv6 interprets a +negative value as an error, and interprets a positive value as a request +for redispatch. + +UDP for IPv6 was unaware of this difference. Change __udp6_lib_rcv() to +return a positive value for redispatch. Note that the socket's +encap_rcv hook still needs to return a negative value to request +dispatch, and in the case of IPv6 packets, adjust IP6CB(skb)->nhoff to +identify the byte containing the next protocol. + +Signed-off-by: Bill Sommerfeld +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv6/udp.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c +index 9da3287..1e293a5 100644 +--- a/net/ipv6/udp.c ++++ b/net/ipv6/udp.c +@@ -916,11 +916,9 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, + ret = udpv6_queue_rcv_skb(sk, skb); + sock_put(sk); + +- /* a return value > 0 means to resubmit the input, but +- * it wants the return to be -protocol, or 0 +- */ ++ /* a return value > 0 means to resubmit the input */ + if (ret > 0) +- return -ret; ++ return ret; + + return 0; + } +-- +2.7.1 + + +From 17a87fbefbe01a2ed8dbd94f420c3a0a5f213608 Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Sun, 6 Mar 2016 09:29:21 -0800 +Subject: [PATCH 261/384] tcp: fix tcpi_segs_in after connection establishment + +[ Upstream commit a9d99ce28ed359d68cf6f3c1a69038aefedf6d6a ] + +If final packet (ACK) of 3WHS is lost, it appears we do not properly +account the following incoming segment into tcpi_segs_in + +While we are at it, starts segs_in with one, to count the SYN packet. + +We do not yet count number of SYN we received for a request sock, we +might add this someday. + +packetdrill script showing proper behavior after fix : + +// Tests tcpi_segs_in when 3rd packet (ACK) of 3WHS is lost +0.000 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 + +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 + +0 bind(3, ..., ...) = 0 + +0 listen(3, 1) = 0 + + +0 < S 0:0(0) win 32792 + +0 > S. 0:0(0) ack 1 ++.020 < P. 1:1001(1000) ack 1 win 32792 + + +0 accept(3, ..., ...) = 4 + ++.000 %{ assert tcpi_segs_in == 2, 'tcpi_segs_in=%d' % tcpi_segs_in }% + +Fixes: 2efd055c53c06 ("tcp: add tcpi_segs_in and tcpi_segs_out to tcp_info") +Signed-off-by: Eric Dumazet +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/tcp_minisocks.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c +index ac6b196..9475a27 100644 +--- a/net/ipv4/tcp_minisocks.c ++++ b/net/ipv4/tcp_minisocks.c +@@ -458,7 +458,7 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, + + newtp->rcv_wup = newtp->copied_seq = + newtp->rcv_nxt = treq->rcv_isn + 1; +- newtp->segs_in = 0; ++ newtp->segs_in = 1; + + newtp->snd_sml = newtp->snd_una = + newtp->snd_nxt = newtp->snd_up = treq->snt_isn + 1; +@@ -818,6 +818,7 @@ int tcp_child_process(struct sock *parent, struct sock *child, + int ret = 0; + int state = child->sk_state; + ++ tcp_sk(child)->segs_in += max_t(u16, 1, skb_shinfo(skb)->gso_segs); + if (!sock_owned_by_user(child)) { + ret = tcp_rcv_state_process(child, skb); + /* Wakeup parent, send SIGIO */ +-- +2.7.1 + + +From 80bcc56fef16fdcb33006ebff5338f7c742e8ffa Mon Sep 17 00:00:00 2001 +From: Guillaume Nault +Date: Mon, 7 Mar 2016 19:36:44 +0100 +Subject: [PATCH 262/384] ppp: release rtnl mutex when interface creation fails + +[ Upstream commit 6faac63a6986f29ef39827f460edd3a5ba64ad5c ] + +Add missing rtnl_unlock() in the error path of ppp_create_interface(). + +Fixes: 58a89ecaca53 ("ppp: fix lockdep splat in ppp_dev_uninit()") +Signed-off-by: Guillaume Nault +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ppp/ppp_generic.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c +index 9a863c6..40b303e 100644 +--- a/drivers/net/ppp/ppp_generic.c ++++ b/drivers/net/ppp/ppp_generic.c +@@ -2803,6 +2803,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit, + + out2: + mutex_unlock(&pn->all_ppp_mutex); ++ rtnl_unlock(); + free_netdev(dev); + out1: + *retp = ret; +-- +2.7.1 + + +From fd6b53b4dca72422b7ce26d6e8dc530775deeb3d Mon Sep 17 00:00:00 2001 +From: Willem de Bruijn +Date: Wed, 9 Mar 2016 21:58:32 -0500 +Subject: [PATCH 263/384] net: validate variable length ll headers + +[ Upstream commit 2793a23aacbd754dbbb5cb75093deb7e4103bace ] + +Netdevice parameter hard_header_len is variously interpreted both as +an upper and lower bound on link layer header length. The field is +used as upper bound when reserving room at allocation, as lower bound +when validating user input in PF_PACKET. + +Clarify the definition to be maximum header length. For validation +of untrusted headers, add an optional validate member to header_ops. + +Allow bypassing of validation by passing CAP_SYS_RAWIO, for instance +for deliberate testing of corrupt input. In this case, pad trailing +bytes, as some device drivers expect completely initialized headers. + +See also http://comments.gmane.org/gmane.linux.network/401064 + +Signed-off-by: Willem de Bruijn +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/netdevice.h | 22 ++++++++++++++++++++-- + 1 file changed, 20 insertions(+), 2 deletions(-) + +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h +index c0e12f7..530529e 100644 +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -265,6 +265,7 @@ struct header_ops { + void (*cache_update)(struct hh_cache *hh, + const struct net_device *dev, + const unsigned char *haddr); ++ bool (*validate)(const char *ll_header, unsigned int len); + }; + + /* These flag bits are private to the generic network queueing +@@ -1398,8 +1399,7 @@ enum netdev_priv_flags { + * @dma: DMA channel + * @mtu: Interface MTU value + * @type: Interface hardware type +- * @hard_header_len: Hardware header length, which means that this is the +- * minimum size of a packet. ++ * @hard_header_len: Maximum hardware header length. + * + * @needed_headroom: Extra headroom the hardware may need, but not in all + * cases can this be guaranteed +@@ -2502,6 +2502,24 @@ static inline int dev_parse_header(const struct sk_buff *skb, + return dev->header_ops->parse(skb, haddr); + } + ++/* ll_header must have at least hard_header_len allocated */ ++static inline bool dev_validate_header(const struct net_device *dev, ++ char *ll_header, int len) ++{ ++ if (likely(len >= dev->hard_header_len)) ++ return true; ++ ++ if (capable(CAP_SYS_RAWIO)) { ++ memset(ll_header + len, 0, dev->hard_header_len - len); ++ return true; ++ } ++ ++ if (dev->header_ops && dev->header_ops->validate) ++ return dev->header_ops->validate(ll_header, len); ++ ++ return false; ++} ++ + typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); + int register_gifconf(unsigned int family, gifconf_func_t *gifconf); + static inline int unregister_gifconf(unsigned int family) +-- +2.7.1 + + +From fc6d3b967c5a15969b884f7c5acb235ff4912281 Mon Sep 17 00:00:00 2001 +From: Willem de Bruijn +Date: Wed, 9 Mar 2016 21:58:33 -0500 +Subject: [PATCH 264/384] ax25: add link layer header validation function + +[ Upstream commit ea47781c26510e5d97f80f9aceafe9065bd5e3aa ] + +As variable length protocol, AX25 fails link layer header validation +tests based on a minimum length. header_ops.validate allows protocols +to validate headers that are shorter than hard_header_len. Implement +this callback for AX25. + +See also http://comments.gmane.org/gmane.linux.network/401064 + +Signed-off-by: Willem de Bruijn +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ax25/ax25_ip.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/net/ax25/ax25_ip.c b/net/ax25/ax25_ip.c +index b563a3f..2fa3be9 100644 +--- a/net/ax25/ax25_ip.c ++++ b/net/ax25/ax25_ip.c +@@ -228,8 +228,23 @@ netdev_tx_t ax25_ip_xmit(struct sk_buff *skb) + } + #endif + ++static bool ax25_validate_header(const char *header, unsigned int len) ++{ ++ ax25_digi digi; ++ ++ if (!len) ++ return false; ++ ++ if (header[0]) ++ return true; ++ ++ return ax25_addr_parse(header + 1, len - 1, NULL, NULL, &digi, NULL, ++ NULL); ++} ++ + const struct header_ops ax25_header_ops = { + .create = ax25_hard_header, ++ .validate = ax25_validate_header, + }; + + EXPORT_SYMBOL(ax25_header_ops); +-- +2.7.1 + + +From 2c6a2e3470a88c44d17264d0d5f02fef769b995c Mon Sep 17 00:00:00 2001 +From: Willem de Bruijn +Date: Wed, 9 Mar 2016 21:58:34 -0500 +Subject: [PATCH 265/384] packet: validate variable length ll headers + +[ Upstream commit 9ed988cd591500c040b2a6257bc68543e08ceeef ] + +Replace link layer header validation check ll_header_truncate with +more generic dev_validate_header. + +Validation based on hard_header_len incorrectly drops valid packets +in variable length protocols, such as AX25. dev_validate_header +calls header_ops.validate for such protocols to ensure correctness +below hard_header_len. + +See also http://comments.gmane.org/gmane.linux.network/401064 + +Fixes 9c7077622dd9 ("packet: make packet_snd fail on len smaller than l2 header") +Signed-off-by: Willem de Bruijn +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/packet/af_packet.c | 37 ++++++++++++++++--------------------- + 1 file changed, 16 insertions(+), 21 deletions(-) + +diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c +index 2c23bae..a1899dc 100644 +--- a/net/packet/af_packet.c ++++ b/net/packet/af_packet.c +@@ -1917,6 +1917,10 @@ retry: + goto retry; + } + ++ if (!dev_validate_header(dev, skb->data, len)) { ++ err = -EINVAL; ++ goto out_unlock; ++ } + if (len > (dev->mtu + dev->hard_header_len + extra_len) && + !packet_extra_vlan_len_allowed(dev, skb)) { + err = -EMSGSIZE; +@@ -2327,18 +2331,6 @@ static void tpacket_destruct_skb(struct sk_buff *skb) + sock_wfree(skb); + } + +-static bool ll_header_truncated(const struct net_device *dev, int len) +-{ +- /* net device doesn't like empty head */ +- if (unlikely(len < dev->hard_header_len)) { +- net_warn_ratelimited("%s: packet size is too short (%d < %d)\n", +- current->comm, len, dev->hard_header_len); +- return true; +- } +- +- return false; +-} +- + static void tpacket_set_protocol(const struct net_device *dev, + struct sk_buff *skb) + { +@@ -2421,19 +2413,19 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb, + if (unlikely(err < 0)) + return -EINVAL; + } else if (dev->hard_header_len) { +- if (ll_header_truncated(dev, tp_len)) +- return -EINVAL; ++ int hdrlen = min_t(int, dev->hard_header_len, tp_len); + + skb_push(skb, dev->hard_header_len); +- err = skb_store_bits(skb, 0, data, +- dev->hard_header_len); ++ err = skb_store_bits(skb, 0, data, hdrlen); + if (unlikely(err)) + return err; ++ if (!dev_validate_header(dev, skb->data, hdrlen)) ++ return -EINVAL; + if (!skb->protocol) + tpacket_set_protocol(dev, skb); + +- data += dev->hard_header_len; +- to_write -= dev->hard_header_len; ++ data += hdrlen; ++ to_write -= hdrlen; + } + + offset = offset_in_page(data); +@@ -2764,9 +2756,6 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) + offset = dev_hard_header(skb, dev, ntohs(proto), addr, NULL, len); + if (unlikely(offset < 0)) + goto out_free; +- } else { +- if (ll_header_truncated(dev, len)) +- goto out_free; + } + + /* Returns -EFAULT on error */ +@@ -2774,6 +2763,12 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) + if (err) + goto out_free; + ++ if (sock->type == SOCK_RAW && ++ !dev_validate_header(dev, skb->data, len)) { ++ err = -EINVAL; ++ goto out_free; ++ } ++ + sock_tx_timestamp(sk, &skb_shinfo(skb)->tx_flags); + + if (!gso_type && (len > dev->mtu + reserve + extra_len) && +-- +2.7.1 + + +From d02eb1f04e16bd32b221a8368770fd9a1c7531b5 Mon Sep 17 00:00:00 2001 +From: Alexei Starovoitov +Date: Wed, 9 Mar 2016 20:02:33 -0800 +Subject: [PATCH 266/384] bpf: avoid copying junk bytes in + bpf_get_current_comm() + +[ Upstream commit cdc4e47da8f4c32eeb6b2061a8a834f4362a12b7 ] + +Lots of places in the kernel use memcpy(buf, comm, TASK_COMM_LEN); but +the result is typically passed to print("%s", buf) and extra bytes +after zero don't cause any harm. +In bpf the result of bpf_get_current_comm() is used as the part of +map key and was causing spurious hash map mismatches. +Use strlcpy() to guarantee zero-terminated string. +bpf verifier checks that output buffer is zero-initialized, +so even for short task names the output buffer don't have junk bytes. +Note it's not a security concern, since kprobe+bpf is root only. + +Fixes: ffeedafbf023 ("bpf: introduce current->pid, tgid, uid, gid, comm accessors") +Reported-by: Tobias Waldekranz +Signed-off-by: Alexei Starovoitov +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + kernel/bpf/helpers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c +index 4504ca6..50da680 100644 +--- a/kernel/bpf/helpers.c ++++ b/kernel/bpf/helpers.c +@@ -166,7 +166,7 @@ static u64 bpf_get_current_comm(u64 r1, u64 size, u64 r3, u64 r4, u64 r5) + if (!task) + return -EINVAL; + +- memcpy(buf, task->comm, min_t(size_t, size, sizeof(task->comm))); ++ strlcpy(buf, task->comm, min_t(size_t, size, sizeof(task->comm))); + return 0; + } + +-- +2.7.1 + + +From c15f7cbfaa577e755003fcac2ae26de8761392ad Mon Sep 17 00:00:00 2001 +From: Sergei Shtylyov +Date: Tue, 8 Mar 2016 01:36:28 +0300 +Subject: [PATCH 267/384] sh_eth: fix NULL pointer dereference in + sh_eth_ring_format() + +[ Upstream commit c1b7fca65070bfadca94dd53a4e6b71cd4f69715 ] + +In a low memory situation, if netdev_alloc_skb() fails on a first RX ring +loop iteration in sh_eth_ring_format(), 'rxdesc' is still NULL. Avoid +kernel oops by adding the 'rxdesc' check after the loop. + +Reported-by: Wolfram Sang +Signed-off-by: Sergei Shtylyov +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/renesas/sh_eth.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c +index 6a8fc0f..a1702f4 100644 +--- a/drivers/net/ethernet/renesas/sh_eth.c ++++ b/drivers/net/ethernet/renesas/sh_eth.c +@@ -1212,7 +1212,8 @@ static void sh_eth_ring_format(struct net_device *ndev) + mdp->dirty_rx = (u32) (i - mdp->num_rx_ring); + + /* Mark the last entry as wrapping the ring. */ +- rxdesc->status |= cpu_to_edmac(mdp, RD_RDLE); ++ if (rxdesc) ++ rxdesc->status |= cpu_to_edmac(mdp, RD_RDLE); + + memset(mdp->tx_ring, 0, tx_ringsize); + +-- +2.7.1 + + +From af307e859fd46b5fe374f772fbc8437029732155 Mon Sep 17 00:00:00 2001 +From: Sergei Shtylyov +Date: Tue, 8 Mar 2016 01:37:09 +0300 +Subject: [PATCH 268/384] sh_eth: advance 'rxdesc' later in + sh_eth_ring_format() + +[ Upstream commit d0ba913488dc8c55d1880f5ed34f096dc45fb05d ] + +Iff dma_map_single() fails, 'rxdesc' should point to the last filled RX +descriptor, so that it can be marked as the last one, however the driver +would have already advanced it by that time. In order to fix that, only +fill an RX descriptor once all the data for it is ready. + +Signed-off-by: Sergei Shtylyov +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/renesas/sh_eth.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c +index a1702f4..36fc942 100644 +--- a/drivers/net/ethernet/renesas/sh_eth.c ++++ b/drivers/net/ethernet/renesas/sh_eth.c +@@ -1185,11 +1185,8 @@ static void sh_eth_ring_format(struct net_device *ndev) + break; + sh_eth_set_receive_align(skb); + +- /* RX descriptor */ +- rxdesc = &mdp->rx_ring[i]; + /* The size of the buffer is a multiple of 32 bytes. */ + buf_len = ALIGN(mdp->rx_buf_sz, 32); +- rxdesc->len = cpu_to_edmac(mdp, buf_len << 16); + dma_addr = dma_map_single(&ndev->dev, skb->data, buf_len, + DMA_FROM_DEVICE); + if (dma_mapping_error(&ndev->dev, dma_addr)) { +@@ -1197,6 +1194,10 @@ static void sh_eth_ring_format(struct net_device *ndev) + break; + } + mdp->rx_skbuff[i] = skb; ++ ++ /* RX descriptor */ ++ rxdesc = &mdp->rx_ring[i]; ++ rxdesc->len = cpu_to_edmac(mdp, buf_len << 16); + rxdesc->addr = cpu_to_edmac(mdp, dma_addr); + rxdesc->status = cpu_to_edmac(mdp, RD_RACT | RD_RFP); + +-- +2.7.1 + + +From 7ae1681f9b11fb17d511c24a9f26fc4b39651339 Mon Sep 17 00:00:00 2001 +From: Rajesh Borundia +Date: Tue, 8 Mar 2016 02:39:57 -0500 +Subject: [PATCH 269/384] qlcnic: Remove unnecessary usage of atomic_t + +[ Upstream commit 5bf93251cee1fb66141d1d2eaff86e04a9397bdf ] + +o atomic_t usage is incorrect as we are not implementing +any atomicity. + +Signed-off-by: Rajesh Borundia +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 2 +- + drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 9 ++++----- + 2 files changed, 5 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +index 46bbea8..d18667b 100644 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +@@ -1099,7 +1099,7 @@ struct qlcnic_mailbox { + unsigned long status; + spinlock_t queue_lock; /* Mailbox queue lock */ + spinlock_t aen_lock; /* Mailbox response/AEN lock */ +- atomic_t rsp_status; ++ u32 rsp_status; + u32 num_cmds; + }; + +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +index 37a731b..e3d1bb7 100644 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +@@ -491,7 +491,7 @@ irqreturn_t qlcnic_83xx_clear_legacy_intr(struct qlcnic_adapter *adapter) + + static inline void qlcnic_83xx_notify_mbx_response(struct qlcnic_mailbox *mbx) + { +- atomic_set(&mbx->rsp_status, QLC_83XX_MBX_RESPONSE_ARRIVED); ++ mbx->rsp_status = QLC_83XX_MBX_RESPONSE_ARRIVED; + complete(&mbx->completion); + } + +@@ -510,7 +510,7 @@ static void qlcnic_83xx_poll_process_aen(struct qlcnic_adapter *adapter) + if (event & QLCNIC_MBX_ASYNC_EVENT) { + __qlcnic_83xx_process_aen(adapter); + } else { +- if (atomic_read(&mbx->rsp_status) != rsp_status) ++ if (mbx->rsp_status != rsp_status) + qlcnic_83xx_notify_mbx_response(mbx); + } + out: +@@ -1023,7 +1023,7 @@ static void qlcnic_83xx_process_aen(struct qlcnic_adapter *adapter) + if (event & QLCNIC_MBX_ASYNC_EVENT) { + __qlcnic_83xx_process_aen(adapter); + } else { +- if (atomic_read(&mbx->rsp_status) != rsp_status) ++ if (mbx->rsp_status != rsp_status) + qlcnic_83xx_notify_mbx_response(mbx); + } + } +@@ -4050,7 +4050,6 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work) + struct qlcnic_adapter *adapter = mbx->adapter; + const struct qlcnic_mbx_ops *mbx_ops = mbx->ops; + struct device *dev = &adapter->pdev->dev; +- atomic_t *rsp_status = &mbx->rsp_status; + struct list_head *head = &mbx->cmd_q; + struct qlcnic_hardware_context *ahw; + struct qlcnic_cmd_args *cmd = NULL; +@@ -4063,7 +4062,7 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work) + return; + } + +- atomic_set(rsp_status, QLC_83XX_MBX_RESPONSE_WAIT); ++ mbx->rsp_status = QLC_83XX_MBX_RESPONSE_WAIT; + + spin_lock(&mbx->queue_lock); + +-- +2.7.1 + + +From 2dd7abdfa6da5490ce631dc878eeb89be2de8591 Mon Sep 17 00:00:00 2001 +From: Rajesh Borundia +Date: Tue, 8 Mar 2016 02:39:58 -0500 +Subject: [PATCH 270/384] qlcnic: Fix mailbox completion handling during + spurious interrupt + +[ Upstream commit 819bfe764dceec2f6b4551768453f374b4c60443 ] + +o While the driver is in the middle of a MB completion processing +and it receives a spurious MB interrupt, it is mistaken as a good MB +completion interrupt leading to premature completion of the next MB +request. Fix the driver to guard against this by checking the current +state of MB processing and ignore the spurious interrupt. +Also added a stats counter to record this condition. + +Signed-off-by: Rajesh Borundia +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 1 + + drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 15 +++++++++++---- + drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 3 ++- + 3 files changed, 14 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +index d18667b..55007f1 100644 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +@@ -566,6 +566,7 @@ struct qlcnic_adapter_stats { + u64 tx_dma_map_error; + u64 spurious_intr; + u64 mac_filter_limit_overrun; ++ u64 mbx_spurious_intr; + }; + + /* +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +index e3d1bb7..f9640d5ce 100644 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +@@ -2338,9 +2338,9 @@ static void qlcnic_83xx_handle_link_aen(struct qlcnic_adapter *adapter, + + static irqreturn_t qlcnic_83xx_handle_aen(int irq, void *data) + { ++ u32 mask, resp, event, rsp_status = QLC_83XX_MBX_RESPONSE_ARRIVED; + struct qlcnic_adapter *adapter = data; + struct qlcnic_mailbox *mbx; +- u32 mask, resp, event; + unsigned long flags; + + mbx = adapter->ahw->mailbox; +@@ -2350,10 +2350,14 @@ static irqreturn_t qlcnic_83xx_handle_aen(int irq, void *data) + goto out; + + event = readl(QLCNIC_MBX_FW(adapter->ahw, 0)); +- if (event & QLCNIC_MBX_ASYNC_EVENT) ++ if (event & QLCNIC_MBX_ASYNC_EVENT) { + __qlcnic_83xx_process_aen(adapter); +- else +- qlcnic_83xx_notify_mbx_response(mbx); ++ } else { ++ if (mbx->rsp_status != rsp_status) ++ qlcnic_83xx_notify_mbx_response(mbx); ++ else ++ adapter->stats.mbx_spurious_intr++; ++ } + + out: + mask = QLCRDX(adapter->ahw, QLCNIC_DEF_INT_MASK); +@@ -4053,6 +4057,7 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work) + struct list_head *head = &mbx->cmd_q; + struct qlcnic_hardware_context *ahw; + struct qlcnic_cmd_args *cmd = NULL; ++ unsigned long flags; + + ahw = adapter->ahw; + +@@ -4062,7 +4067,9 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work) + return; + } + ++ spin_lock_irqsave(&mbx->aen_lock, flags); + mbx->rsp_status = QLC_83XX_MBX_RESPONSE_WAIT; ++ spin_unlock_irqrestore(&mbx->aen_lock, flags); + + spin_lock(&mbx->queue_lock); + +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +index 494e810..0a2318c 100644 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +@@ -59,7 +59,8 @@ static const struct qlcnic_stats qlcnic_gstrings_stats[] = { + QLC_OFF(stats.mac_filter_limit_overrun)}, + {"spurious intr", QLC_SIZEOF(stats.spurious_intr), + QLC_OFF(stats.spurious_intr)}, +- ++ {"mbx spurious intr", QLC_SIZEOF(stats.mbx_spurious_intr), ++ QLC_OFF(stats.mbx_spurious_intr)}, + }; + + static const char qlcnic_device_gstrings_stats[][ETH_GSTRING_LEN] = { +-- +2.7.1 + + +From bd72fa203026c11aa58642795f313509f3fca6d7 Mon Sep 17 00:00:00 2001 +From: Willem de Bruijn +Date: Tue, 8 Mar 2016 15:18:54 -0500 +Subject: [PATCH 271/384] macvtap: always pass ethernet header in linear + +[ Upstream commit 8e2ad4113ce4671686740f808ff2795395c39eef ] + +The stack expects link layer headers in the skb linear section. +Macvtap can create skbs with llheader in frags in edge cases: +when (IFF_VNET_HDR is off or vnet_hdr.hdr_len < ETH_HLEN) and +prepad + len > PAGE_SIZE and vnet_hdr.flags has no or bad csum. + +Add checks to ensure linear is always at least ETH_HLEN. +At this point, len is already ensured to be >= ETH_HLEN. + +For backwards compatiblity, rounds up short vnet_hdr.hdr_len. +This differs from tap and packet, which return an error. + +Fixes b9fb9ee07e67 ("macvtap: add GSO/csum offload support") +Signed-off-by: Willem de Bruijn +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/macvtap.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c +index 0fc5219..159a687 100644 +--- a/drivers/net/macvtap.c ++++ b/drivers/net/macvtap.c +@@ -760,6 +760,8 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m, + macvtap16_to_cpu(q, vnet_hdr.hdr_len) : GOODCOPY_LEN; + if (copylen > good_linear) + copylen = good_linear; ++ else if (copylen < ETH_HLEN) ++ copylen = ETH_HLEN; + linear = copylen; + i = *from; + iov_iter_advance(&i, copylen); +@@ -769,10 +771,11 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m, + + if (!zerocopy) { + copylen = len; +- if (macvtap16_to_cpu(q, vnet_hdr.hdr_len) > good_linear) ++ linear = macvtap16_to_cpu(q, vnet_hdr.hdr_len); ++ if (linear > good_linear) + linear = good_linear; +- else +- linear = macvtap16_to_cpu(q, vnet_hdr.hdr_len); ++ else if (linear < ETH_HLEN) ++ linear = ETH_HLEN; + } + + skb = macvtap_alloc_skb(&q->sk, MACVTAP_RESERVE, copylen, +-- +2.7.1 + + +From ccd64ac4b16b1e2c7b74340156d5000c6136ea11 Mon Sep 17 00:00:00 2001 +From: Ido Schimmel +Date: Tue, 8 Mar 2016 12:59:33 -0800 +Subject: [PATCH 272/384] mlxsw: spectrum: Check requested ageing time is valid + +[ Upstream commit 869f63a4d28144c03c8f4a4c0d1e8f31f8c11a10 ] + +Commit c62987bbd8a1 ("bridge: push bridge setting ageing_time down to +switchdev") added a check for minimum and maximum ageing time, but this +breaks existing behaviour where one can set ageing time to 0 for a +non-learning bridge. + +Push this check down to the driver and allow the check in the bridge +layer to be removed. Currently ageing time 0 is refused by the driver, +but we can later add support for this functionality. + +Signed-off-by: Ido Schimmel +Acked-by: Jiri Pirko +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 2 ++ + drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 9 +++++++-- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +index 4365c8b..605f641 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +@@ -61,6 +61,8 @@ struct mlxsw_sp { + #define MLXSW_SP_DEFAULT_LEARNING_INTERVAL 100 + unsigned int interval; /* ms */ + } fdb_notify; ++#define MLXSW_SP_MIN_AGEING_TIME 10 ++#define MLXSW_SP_MAX_AGEING_TIME 1000000 + #define MLXSW_SP_DEFAULT_AGEING_TIME 300 + u32 ageing_time; + struct { +diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +index 7dbeafa..d4c4c2b 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +@@ -232,8 +232,13 @@ static int mlxsw_sp_port_attr_br_ageing_set(struct mlxsw_sp_port *mlxsw_sp_port, + unsigned long ageing_jiffies = clock_t_to_jiffies(ageing_clock_t); + u32 ageing_time = jiffies_to_msecs(ageing_jiffies) / 1000; + +- if (switchdev_trans_ph_prepare(trans)) +- return 0; ++ if (switchdev_trans_ph_prepare(trans)) { ++ if (ageing_time < MLXSW_SP_MIN_AGEING_TIME || ++ ageing_time > MLXSW_SP_MAX_AGEING_TIME) ++ return -ERANGE; ++ else ++ return 0; ++ } + + return mlxsw_sp_ageing_set(mlxsw_sp, ageing_time); + } +-- +2.7.1 + + +From d3dc22cd29a54b8e25af6907f2c6c5dc0b4d006c Mon Sep 17 00:00:00 2001 +From: Ido Schimmel +Date: Tue, 8 Mar 2016 12:59:34 -0800 +Subject: [PATCH 273/384] rocker: set FDB cleanup timer according to lowest + ageing time + +[ Upstream commit 88de1cd457e5cb664d6d437e2ea4750d089165f5 ] + +In rocker, ageing time is a per-port attribute, so the next time the FDB +cleanup timer fires should be set according to the lowest ageing time. + +This will later allow us to delete the BR_MIN_AGEING_TIME macro, which was +added to guarantee minimum ageing time in the bridge layer, thereby breaking +existing behavior. + +Signed-off-by: Ido Schimmel +Acked-by: Jiri Pirko +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/rocker/rocker.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c +index 52ec3d6..2b34622 100644 +--- a/drivers/net/ethernet/rocker/rocker.c ++++ b/drivers/net/ethernet/rocker/rocker.c +@@ -239,6 +239,7 @@ struct rocker { + struct { + u64 id; + } hw; ++ unsigned long ageing_time; + spinlock_t cmd_ring_lock; /* for cmd ring accesses */ + struct rocker_dma_ring_info cmd_ring; + struct rocker_dma_ring_info event_ring; +@@ -3704,7 +3705,7 @@ static void rocker_fdb_cleanup(unsigned long data) + struct rocker_port *rocker_port; + struct rocker_fdb_tbl_entry *entry; + struct hlist_node *tmp; +- unsigned long next_timer = jiffies + BR_MIN_AGEING_TIME; ++ unsigned long next_timer = jiffies + rocker->ageing_time; + unsigned long expires; + unsigned long lock_flags; + int flags = ROCKER_OP_FLAG_NOWAIT | ROCKER_OP_FLAG_REMOVE | +@@ -4367,8 +4368,12 @@ static int rocker_port_bridge_ageing_time(struct rocker_port *rocker_port, + struct switchdev_trans *trans, + u32 ageing_time) + { ++ struct rocker *rocker = rocker_port->rocker; ++ + if (!switchdev_trans_ph_prepare(trans)) { + rocker_port->ageing_time = clock_t_to_jiffies(ageing_time); ++ if (rocker_port->ageing_time < rocker->ageing_time) ++ rocker->ageing_time = rocker_port->ageing_time; + mod_timer(&rocker_port->rocker->fdb_cleanup_timer, jiffies); + } + +@@ -5206,10 +5211,13 @@ static int rocker_probe(struct pci_dev *pdev, const struct pci_device_id *id) + goto err_init_tbls; + } + ++ rocker->ageing_time = BR_DEFAULT_AGEING_TIME; + setup_timer(&rocker->fdb_cleanup_timer, rocker_fdb_cleanup, + (unsigned long) rocker); + mod_timer(&rocker->fdb_cleanup_timer, jiffies); + ++ rocker->ageing_time = BR_DEFAULT_AGEING_TIME; ++ + err = rocker_probe_ports(rocker); + if (err) { + dev_err(&pdev->dev, "failed to probe ports\n"); +-- +2.7.1 + + +From 88b7f38979ec2b876c9205889a7db7c674106eb8 Mon Sep 17 00:00:00 2001 +From: Stephen Hemminger +Date: Tue, 8 Mar 2016 12:59:35 -0800 +Subject: [PATCH 274/384] bridge: allow zero ageing time + +[ Upstream commit 4c656c13b254d598e83e586b7b4d36a2043dad85 ] + +This fixes a regression in the bridge ageing time caused by: +commit c62987bbd8a1 ("bridge: push bridge setting ageing_time down to switchdev") + +There are users of Linux bridge which use the feature that if ageing time +is set to 0 it causes entries to never expire. See: + https://www.linuxfoundation.org/collaborate/workgroups/networking/bridge + +For a pure software bridge, it is unnecessary for the code to have +arbitrary restrictions on what values are allowable. + +Signed-off-by: Stephen Hemminger +Acked-by: Jiri Pirko +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/if_bridge.h | 4 ---- + net/bridge/br_stp.c | 11 ++++++++--- + 2 files changed, 8 insertions(+), 7 deletions(-) + +diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h +index a338a68..dcb89e3 100644 +--- a/include/linux/if_bridge.h ++++ b/include/linux/if_bridge.h +@@ -46,10 +46,6 @@ struct br_ip_list { + #define BR_LEARNING_SYNC BIT(9) + #define BR_PROXYARP_WIFI BIT(10) + +-/* values as per ieee8021QBridgeFdbAgingTime */ +-#define BR_MIN_AGEING_TIME (10 * HZ) +-#define BR_MAX_AGEING_TIME (1000000 * HZ) +- + #define BR_DEFAULT_AGEING_TIME (300 * HZ) + + extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); +diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c +index 5f3f645..0e658f4 100644 +--- a/net/bridge/br_stp.c ++++ b/net/bridge/br_stp.c +@@ -567,6 +567,14 @@ int br_set_max_age(struct net_bridge *br, unsigned long val) + + } + ++/* Set time interval that dynamic forwarding entries live ++ * For pure software bridge, allow values outside the 802.1 ++ * standard specification for special cases: ++ * 0 - entry never ages (all permanant) ++ * 1 - entry disappears (no persistance) ++ * ++ * Offloaded switch entries maybe more restrictive ++ */ + int br_set_ageing_time(struct net_bridge *br, u32 ageing_time) + { + struct switchdev_attr attr = { +@@ -577,9 +585,6 @@ int br_set_ageing_time(struct net_bridge *br, u32 ageing_time) + unsigned long t = clock_t_to_jiffies(ageing_time); + int err; + +- if (t < BR_MIN_AGEING_TIME || t > BR_MAX_AGEING_TIME) +- return -ERANGE; +- + err = switchdev_port_attr_set(br->dev, &attr); + if (err) + return err; +-- +2.7.1 + + +From 9c894b57b2dc93fea032148f57147171d22e9410 Mon Sep 17 00:00:00 2001 +From: "David S. Miller" +Date: Sun, 13 Mar 2016 23:28:00 -0400 +Subject: [PATCH 275/384] ipv4: Don't do expensive useless work during inetdev + destroy. + +[ Upstream commit fbd40ea0180a2d328c5adc61414dc8bab9335ce2 ] + +When an inetdev is destroyed, every address assigned to the interface +is removed. And in this scenerio we do two pointless things which can +be very expensive if the number of assigned interfaces is large: + +1) Address promotion. We are deleting all addresses, so there is no + point in doing this. + +2) A full nf conntrack table purge for every address. We only need to + do this once, as is already caught by the existing + masq_dev_notifier so masq_inet_event() can skip this. + +Reported-by: Solar Designer +Signed-off-by: David S. Miller +Tested-by: Cyrill Gorcunov +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/devinet.c | 4 ++++ + net/ipv4/fib_frontend.c | 4 ++++ + net/ipv4/netfilter/nf_nat_masquerade_ipv4.c | 12 ++++++++++-- + 3 files changed, 18 insertions(+), 2 deletions(-) + +diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c +index f6303b1..0212591 100644 +--- a/net/ipv4/devinet.c ++++ b/net/ipv4/devinet.c +@@ -334,6 +334,9 @@ static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap, + + ASSERT_RTNL(); + ++ if (in_dev->dead) ++ goto no_promotions; ++ + /* 1. Deleting primary ifaddr forces deletion all secondaries + * unless alias promotion is set + **/ +@@ -380,6 +383,7 @@ static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap, + fib_del_ifaddr(ifa, ifa1); + } + ++no_promotions: + /* 2. Unlink it */ + + *ifap = ifa1->ifa_next; +diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c +index 4734475..21add55 100644 +--- a/net/ipv4/fib_frontend.c ++++ b/net/ipv4/fib_frontend.c +@@ -922,6 +922,9 @@ void fib_del_ifaddr(struct in_ifaddr *ifa, struct in_ifaddr *iprim) + subnet = 1; + } + ++ if (in_dev->dead) ++ goto no_promotions; ++ + /* Deletion is more complicated than add. + * We should take care of not to delete too much :-) + * +@@ -997,6 +1000,7 @@ void fib_del_ifaddr(struct in_ifaddr *ifa, struct in_ifaddr *iprim) + } + } + ++no_promotions: + if (!(ok & BRD_OK)) + fib_magic(RTM_DELROUTE, RTN_BROADCAST, ifa->ifa_broadcast, 32, prim); + if (subnet && ifa->ifa_prefixlen < 31) { +diff --git a/net/ipv4/netfilter/nf_nat_masquerade_ipv4.c b/net/ipv4/netfilter/nf_nat_masquerade_ipv4.c +index c6eb421..ea91058 100644 +--- a/net/ipv4/netfilter/nf_nat_masquerade_ipv4.c ++++ b/net/ipv4/netfilter/nf_nat_masquerade_ipv4.c +@@ -108,10 +108,18 @@ static int masq_inet_event(struct notifier_block *this, + unsigned long event, + void *ptr) + { +- struct net_device *dev = ((struct in_ifaddr *)ptr)->ifa_dev->dev; ++ struct in_device *idev = ((struct in_ifaddr *)ptr)->ifa_dev; + struct netdev_notifier_info info; + +- netdev_notifier_info_init(&info, dev); ++ /* The masq_dev_notifier will catch the case of the device going ++ * down. So if the inetdev is dead and being destroyed we have ++ * no work to do. Otherwise this is an individual address removal ++ * and we have to perform the flush. ++ */ ++ if (idev->dead) ++ return NOTIFY_DONE; ++ ++ netdev_notifier_info_init(&info, idev->dev); + return masq_device_event(this, event, &info); + } + +-- +2.7.1 + + +From 34e7cb7d5dc7e7f0d28d9769f4ed631ffdf54cce Mon Sep 17 00:00:00 2001 +From: Arnaldo Carvalho de Melo +Date: Mon, 14 Mar 2016 09:56:35 -0300 +Subject: [PATCH 276/384] net: Fix use after free in the recvmmsg exit path + +[ Upstream commit 34b88a68f26a75e4fded796f1a49c40f82234b7d ] + +The syzkaller fuzzer hit the following use-after-free: + + Call Trace: + [] __asan_report_load8_noabort+0x3e/0x40 mm/kasan/report.c:295 + [] __sys_recvmmsg+0x6fa/0x7f0 net/socket.c:2261 + [< inline >] SYSC_recvmmsg net/socket.c:2281 + [] SyS_recvmmsg+0x16f/0x180 net/socket.c:2270 + [] entry_SYSCALL_64_fastpath+0x16/0x7a + arch/x86/entry/entry_64.S:185 + +And, as Dmitry rightly assessed, that is because we can drop the +reference and then touch it when the underlying recvmsg calls return +some packets and then hit an error, which will make recvmmsg to set +sock->sk->sk_err, oops, fix it. + +Reported-and-Tested-by: Dmitry Vyukov +Cc: Alexander Potapenko +Cc: Eric Dumazet +Cc: Kostya Serebryany +Cc: Sasha Levin +Fixes: a2e2725541fa ("net: Introduce recvmmsg socket syscall") +http://lkml.kernel.org/r/20160122211644.GC2470@redhat.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/socket.c | 38 +++++++++++++++++++------------------- + 1 file changed, 19 insertions(+), 19 deletions(-) + +diff --git a/net/socket.c b/net/socket.c +index d730ef9..263b334 100644 +--- a/net/socket.c ++++ b/net/socket.c +@@ -2238,31 +2238,31 @@ int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, + break; + } + +-out_put: +- fput_light(sock->file, fput_needed); +- + if (err == 0) +- return datagrams; ++ goto out_put; + +- if (datagrams != 0) { ++ if (datagrams == 0) { ++ datagrams = err; ++ goto out_put; ++ } ++ ++ /* ++ * We may return less entries than requested (vlen) if the ++ * sock is non block and there aren't enough datagrams... ++ */ ++ if (err != -EAGAIN) { + /* +- * We may return less entries than requested (vlen) if the +- * sock is non block and there aren't enough datagrams... ++ * ... or if recvmsg returns an error after we ++ * received some datagrams, where we record the ++ * error to return on the next call or if the ++ * app asks about it using getsockopt(SO_ERROR). + */ +- if (err != -EAGAIN) { +- /* +- * ... or if recvmsg returns an error after we +- * received some datagrams, where we record the +- * error to return on the next call or if the +- * app asks about it using getsockopt(SO_ERROR). +- */ +- sock->sk->sk_err = -err; +- } +- +- return datagrams; ++ sock->sk->sk_err = -err; + } ++out_put: ++ fput_light(sock->file, fput_needed); + +- return err; ++ return datagrams; + } + + SYSCALL_DEFINE5(recvmmsg, int, fd, struct mmsghdr __user *, mmsg, +-- +2.7.1 + + +From 6423e3160215423ef266bccc255327fb1cc9ebe6 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Mon, 14 Mar 2016 15:18:34 +0100 +Subject: [PATCH 277/384] mlx4: add missing braces in verify_qp_parameters + +[ Upstream commit baefd7015cdb304ce6c94f9679d0486c71954766 ] + +The implementation of QP paravirtualization back in linux-3.7 included +some code that looks very dubious, and gcc-6 has grown smart enough +to warn about it: + +drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'verify_qp_parameters': +drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:3154:5: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation] + if (optpar & MLX4_QP_OPTPAR_ALT_ADDR_PATH) { + ^~ +drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:3144:4: note: ...this 'if' clause, but it is not + if (slave != mlx4_master_func_num(dev)) + +>From looking at the context, I'm reasonably sure that the indentation +is correct but that it should have contained curly braces from the +start, as the update_gid() function in the same patch correctly does. + +Signed-off-by: Arnd Bergmann +Fixes: 54679e148287 ("mlx4: Implement QP paravirtualization and maintain phys_pkey_cache for smp_snoop") +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +index cad6c44..d314d96 100644 +--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c ++++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +@@ -3132,7 +3132,7 @@ static int verify_qp_parameters(struct mlx4_dev *dev, + case QP_TRANS_RTS2RTS: + case QP_TRANS_SQD2SQD: + case QP_TRANS_SQD2RTS: +- if (slave != mlx4_master_func_num(dev)) ++ if (slave != mlx4_master_func_num(dev)) { + if (optpar & MLX4_QP_OPTPAR_PRIMARY_ADDR_PATH) { + port = (qp_ctx->pri_path.sched_queue >> 6 & 1) + 1; + if (dev->caps.port_mask[port] != MLX4_PORT_TYPE_IB) +@@ -3151,6 +3151,7 @@ static int verify_qp_parameters(struct mlx4_dev *dev, + if (qp_ctx->alt_path.mgid_index >= num_gids) + return -EINVAL; + } ++ } + break; + default: + break; +-- +2.7.1 + + +From 4781b299e7bafa2d5feac3011bf4e7432c4f3f53 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Mon, 14 Mar 2016 15:18:35 +0100 +Subject: [PATCH 278/384] farsync: fix off-by-one bug in fst_add_one + +[ Upstream commit e725a66c0202b5f36c2f9d59d26a65c53bbf21f7 ] + +gcc-6 finds an out of bounds access in the fst_add_one function +when calculating the end of the mmio area: + +drivers/net/wan/farsync.c: In function 'fst_add_one': +drivers/net/wan/farsync.c:418:53: error: index 2 denotes an offset greater than size of 'u8[2][8192] {aka unsigned char[2][8192]}' [-Werror=array-bounds] + #define BUF_OFFSET(X) (BFM_BASE + offsetof(struct buf_window, X)) + ^ +include/linux/compiler-gcc.h:158:21: note: in definition of macro '__compiler_offsetof' + __builtin_offsetof(a, b) + ^ +drivers/net/wan/farsync.c:418:37: note: in expansion of macro 'offsetof' + #define BUF_OFFSET(X) (BFM_BASE + offsetof(struct buf_window, X)) + ^~~~~~~~ +drivers/net/wan/farsync.c:2519:36: note: in expansion of macro 'BUF_OFFSET' + + BUF_OFFSET ( txBuffer[i][NUM_TX_BUFFER][0]); + ^~~~~~~~~~ + +The warning is correct, but not critical because this appears +to be a write-only variable that is set by each WAN driver but +never accessed afterwards. + +I'm taking the minimal fix here, using the correct pointer by +pointing 'mem_end' to the last byte inside of the register area +as all other WAN drivers do, rather than the first byte outside of +it. An alternative would be to just remove the mem_end member +entirely. + +Signed-off-by: Arnd Bergmann +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wan/farsync.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c +index 44541db..69b994f 100644 +--- a/drivers/net/wan/farsync.c ++++ b/drivers/net/wan/farsync.c +@@ -2516,7 +2516,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent) + dev->mem_start = card->phys_mem + + BUF_OFFSET ( txBuffer[i][0][0]); + dev->mem_end = card->phys_mem +- + BUF_OFFSET ( txBuffer[i][NUM_TX_BUFFER][0]); ++ + BUF_OFFSET ( txBuffer[i][NUM_TX_BUFFER - 1][LEN_RX_BUFFER - 1]); + dev->base_addr = card->pci_conf; + dev->irq = card->irq; + +-- +2.7.1 + + +From 1d9c587b6421536ca2c490e25b1147acbefd65bb Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Mon, 14 Mar 2016 15:18:36 +0100 +Subject: [PATCH 279/384] ath9k: fix buffer overrun for ar9287 + +[ Upstream commit 83d6f1f15f8cce844b0a131cbc63e444620e48b5 ] + +Code that was added back in 2.6.38 has an obvious overflow +when accessing a static array, and at the time it was added +only a code comment was put in front of it as a reminder +to have it reviewed properly. + +This has not happened, but gcc-6 now points to the specific +overflow: + +drivers/net/wireless/ath/ath9k/eeprom.c: In function 'ath9k_hw_get_gain_boundaries_pdadcs': +drivers/net/wireless/ath/ath9k/eeprom.c:483:44: error: array subscript is above array bounds [-Werror=array-bounds] + maxPwrT4[i] = data_9287[idxL].pwrPdg[i][4]; + ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ + +It turns out that the correct array length exists in the local +'intercepts' variable of this function, so we can just use that +instead of hardcoding '4', so this patch changes all three +instances to use that variable. The other two instances were +already correct, but it's more consistent this way. + +Signed-off-by: Arnd Bergmann +Fixes: 940cd2c12ebf ("ath9k_hw: merge the ar9287 version of ath9k_hw_get_gain_boundaries_pdadcs") +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireless/ath/ath9k/eeprom.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c +index cc81482..113a43f 100644 +--- a/drivers/net/wireless/ath/ath9k/eeprom.c ++++ b/drivers/net/wireless/ath/ath9k/eeprom.c +@@ -403,10 +403,9 @@ void ath9k_hw_get_gain_boundaries_pdadcs(struct ath_hw *ah, + + if (match) { + if (AR_SREV_9287(ah)) { +- /* FIXME: array overrun? */ + for (i = 0; i < numXpdGains; i++) { + minPwrT4[i] = data_9287[idxL].pwrPdg[i][0]; +- maxPwrT4[i] = data_9287[idxL].pwrPdg[i][4]; ++ maxPwrT4[i] = data_9287[idxL].pwrPdg[i][intercepts - 1]; + ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i], + data_9287[idxL].pwrPdg[i], + data_9287[idxL].vpdPdg[i], +@@ -416,7 +415,7 @@ void ath9k_hw_get_gain_boundaries_pdadcs(struct ath_hw *ah, + } else if (eeprom_4k) { + for (i = 0; i < numXpdGains; i++) { + minPwrT4[i] = data_4k[idxL].pwrPdg[i][0]; +- maxPwrT4[i] = data_4k[idxL].pwrPdg[i][4]; ++ maxPwrT4[i] = data_4k[idxL].pwrPdg[i][intercepts - 1]; + ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i], + data_4k[idxL].pwrPdg[i], + data_4k[idxL].vpdPdg[i], +@@ -426,7 +425,7 @@ void ath9k_hw_get_gain_boundaries_pdadcs(struct ath_hw *ah, + } else { + for (i = 0; i < numXpdGains; i++) { + minPwrT4[i] = data_def[idxL].pwrPdg[i][0]; +- maxPwrT4[i] = data_def[idxL].pwrPdg[i][4]; ++ maxPwrT4[i] = data_def[idxL].pwrPdg[i][intercepts - 1]; + ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i], + data_def[idxL].pwrPdg[i], + data_def[idxL].vpdPdg[i], +-- +2.7.1 + + +From e20a5e1dbea95eed57f3414e86573fa02aaece46 Mon Sep 17 00:00:00 2001 +From: Guillaume Nault +Date: Mon, 14 Mar 2016 21:17:16 +0100 +Subject: [PATCH 280/384] ppp: ensure file->private_data can't be overridden + +[ Upstream commit e8e56ffd9d2973398b60ece1f1bebb8d67b4d032 ] + +Locking ppp_mutex must be done before dereferencing file->private_data, +otherwise it could be modified before ppp_unattached_ioctl() takes the +lock. This could lead ppp_unattached_ioctl() to override ->private_data, +thus leaking reference to the ppp_file previously pointed to. + +v2: lock all ppp_ioctl() instead of just checking private_data in + ppp_unattached_ioctl(), to avoid ambiguous behaviour. + +Fixes: f3ff8a4d80e8 ("ppp: push BKL down into the driver") +Signed-off-by: Guillaume Nault +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ppp/ppp_generic.c | 31 +++++++++++++++++-------------- + 1 file changed, 17 insertions(+), 14 deletions(-) + +diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c +index 40b303e..35e8b5a 100644 +--- a/drivers/net/ppp/ppp_generic.c ++++ b/drivers/net/ppp/ppp_generic.c +@@ -567,7 +567,7 @@ static int get_filter(void __user *arg, struct sock_filter **p) + + static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) + { +- struct ppp_file *pf = file->private_data; ++ struct ppp_file *pf; + struct ppp *ppp; + int err = -EFAULT, val, val2, i; + struct ppp_idle idle; +@@ -577,9 +577,14 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) + void __user *argp = (void __user *)arg; + int __user *p = argp; + +- if (!pf) +- return ppp_unattached_ioctl(current->nsproxy->net_ns, +- pf, file, cmd, arg); ++ mutex_lock(&ppp_mutex); ++ ++ pf = file->private_data; ++ if (!pf) { ++ err = ppp_unattached_ioctl(current->nsproxy->net_ns, ++ pf, file, cmd, arg); ++ goto out; ++ } + + if (cmd == PPPIOCDETACH) { + /* +@@ -594,7 +599,6 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) + * this fd and reopening /dev/ppp. + */ + err = -EINVAL; +- mutex_lock(&ppp_mutex); + if (pf->kind == INTERFACE) { + ppp = PF_TO_PPP(pf); + rtnl_lock(); +@@ -608,15 +612,13 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) + } else + pr_warn("PPPIOCDETACH file->f_count=%ld\n", + atomic_long_read(&file->f_count)); +- mutex_unlock(&ppp_mutex); +- return err; ++ goto out; + } + + if (pf->kind == CHANNEL) { + struct channel *pch; + struct ppp_channel *chan; + +- mutex_lock(&ppp_mutex); + pch = PF_TO_CHANNEL(pf); + + switch (cmd) { +@@ -638,17 +640,16 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) + err = chan->ops->ioctl(chan, cmd, arg); + up_read(&pch->chan_sem); + } +- mutex_unlock(&ppp_mutex); +- return err; ++ goto out; + } + + if (pf->kind != INTERFACE) { + /* can't happen */ + pr_err("PPP: not interface or channel??\n"); +- return -EINVAL; ++ err = -EINVAL; ++ goto out; + } + +- mutex_lock(&ppp_mutex); + ppp = PF_TO_PPP(pf); + switch (cmd) { + case PPPIOCSMRU: +@@ -823,7 +824,10 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) + default: + err = -ENOTTY; + } ++ ++out: + mutex_unlock(&ppp_mutex); ++ + return err; + } + +@@ -836,7 +840,6 @@ static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf, + struct ppp_net *pn; + int __user *p = (int __user *)arg; + +- mutex_lock(&ppp_mutex); + switch (cmd) { + case PPPIOCNEWUNIT: + /* Create a new ppp unit */ +@@ -886,7 +889,7 @@ static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf, + default: + err = -ENOTTY; + } +- mutex_unlock(&ppp_mutex); ++ + return err; + } + +-- +2.7.1 + + +From 0bca4aaf5b6aa10510b5a4d49ce66331df5006ee Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Wed, 16 Mar 2016 22:52:15 -0700 +Subject: [PATCH 281/384] tcp/dccp: remove obsolete WARN_ON() in icmp handlers + +[ Upstream commit e316ea62e3203d524ff0239a40c56d3a39ad1b5c ] + +Now SYN_RECV request sockets are installed in ehash table, an ICMP +handler can find a request socket while another cpu handles an incoming +packet transforming this SYN_RECV request socket into an ESTABLISHED +socket. + +We need to remove the now obsolete WARN_ON(req->sk), since req->sk +is set when a new child is created and added into listener accept queue. + +If this race happens, the ICMP will do nothing special. + +Fixes: 079096f103fa ("tcp/dccp: install syn_recv requests into ehash table") +Signed-off-by: Eric Dumazet +Reported-by: Ben Lazarus +Reported-by: Neal Cardwell +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/dccp/ipv4.c | 2 -- + net/ipv4/tcp_ipv4.c | 2 -- + 2 files changed, 4 deletions(-) + +diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c +index 902d606..8be8f27 100644 +--- a/net/dccp/ipv4.c ++++ b/net/dccp/ipv4.c +@@ -204,8 +204,6 @@ void dccp_req_err(struct sock *sk, u64 seq) + * ICMPs are not backlogged, hence we cannot get an established + * socket here. + */ +- WARN_ON(req->sk); +- + if (!between48(seq, dccp_rsk(req)->dreq_iss, dccp_rsk(req)->dreq_gss)) { + NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS); + } else { +diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c +index 8c7e631..048418b 100644 +--- a/net/ipv4/tcp_ipv4.c ++++ b/net/ipv4/tcp_ipv4.c +@@ -320,8 +320,6 @@ void tcp_req_err(struct sock *sk, u32 seq, bool abort) + /* ICMPs are not backlogged, hence we cannot get + * an established socket here. + */ +- WARN_ON(req->sk); +- + if (seq != tcp_rsk(req)->snt_isn) { + NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS); + } else if (abort) { +-- +2.7.1 + + +From 257d1ac3d9572108155d2030067ee89b7db7926f Mon Sep 17 00:00:00 2001 +From: Manish Chopra +Date: Tue, 15 Mar 2016 07:13:45 -0400 +Subject: [PATCH 282/384] qlge: Fix receive packets drop. + +[ Upstream commit 2c9a266afefe137bff06bbe0fc48b4d3b3cb348c ] + +When running small packets [length < 256 bytes] traffic, packets were +being dropped due to invalid data in those packets which were +delivered by the driver upto the stack. Using pci_dma_sync_single_for_cpu +ensures copying latest and updated data into skb from the receive buffer. + +Signed-off-by: Sony Chacko +Signed-off-by: Manish Chopra +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/qlogic/qlge/qlge_main.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c +index 9979764..b28e73e 100644 +--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c ++++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c +@@ -1648,7 +1648,18 @@ static void ql_process_mac_rx_skb(struct ql_adapter *qdev, + return; + } + skb_reserve(new_skb, NET_IP_ALIGN); ++ ++ pci_dma_sync_single_for_cpu(qdev->pdev, ++ dma_unmap_addr(sbq_desc, mapaddr), ++ dma_unmap_len(sbq_desc, maplen), ++ PCI_DMA_FROMDEVICE); ++ + memcpy(skb_put(new_skb, length), skb->data, length); ++ ++ pci_dma_sync_single_for_device(qdev->pdev, ++ dma_unmap_addr(sbq_desc, mapaddr), ++ dma_unmap_len(sbq_desc, maplen), ++ PCI_DMA_FROMDEVICE); + skb = new_skb; + + /* Frame error, so drop the packet. */ +-- +2.7.1 + + +From 88c2cfc522eab6fd7477c7f0c3596cecac7b61d1 Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Thu, 17 Mar 2016 11:57:06 -0700 +Subject: [PATCH 283/384] net: bcmgenet: fix dma api length mismatch + +[ Upstream commit eee577232203842b4dcadb7ab477a298479633ed ] + +When un-mapping skb->data in __bcmgenet_tx_reclaim(), +we must use the length that was used in original dma_map_single(), +instead of skb->len that might be bigger (includes the frags) + +We simply can store skb_len into tx_cb_ptr->dma_len and use it +at unmap time. + +Fixes: 1c1008c793fa ("net: bcmgenet: add main driver file") +Signed-off-by: Eric Dumazet +Acked-by: Florian Fainelli +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c +index 17f017a..0fb3f8d 100644 +--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c ++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c +@@ -1197,7 +1197,7 @@ static unsigned int __bcmgenet_tx_reclaim(struct net_device *dev, + dev->stats.tx_bytes += tx_cb_ptr->skb->len; + dma_unmap_single(&dev->dev, + dma_unmap_addr(tx_cb_ptr, dma_addr), +- tx_cb_ptr->skb->len, ++ dma_unmap_len(tx_cb_ptr, dma_len), + DMA_TO_DEVICE); + bcmgenet_free_cb(tx_cb_ptr); + } else if (dma_unmap_addr(tx_cb_ptr, dma_addr)) { +@@ -1308,7 +1308,7 @@ static int bcmgenet_xmit_single(struct net_device *dev, + } + + dma_unmap_addr_set(tx_cb_ptr, dma_addr, mapping); +- dma_unmap_len_set(tx_cb_ptr, dma_len, skb->len); ++ dma_unmap_len_set(tx_cb_ptr, dma_len, skb_len); + length_status = (skb_len << DMA_BUFLENGTH_SHIFT) | dma_desc_flags | + (priv->hw_params->qtag_mask << DMA_TX_QTAG_SHIFT) | + DMA_TX_APPEND_CRC; +-- +2.7.1 + + +From 89f5f4729c1db0f1f04e4072a7b630223572dcb6 Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Thu, 17 Mar 2016 17:23:36 -0700 +Subject: [PATCH 284/384] bonding: fix bond_get_stats() + +[ Upstream commit fe30937b65354c7fec244caebbdaae68e28ca797 ] + +bond_get_stats() can be called from rtnetlink (with RTNL held) +or from /proc/net/dev seq handler (with RCU held) + +The logic added in commit 5f0c5f73e5ef ("bonding: make global bonding +stats more reliable") kind of assumed only one cpu could run there. + +If multiple threads are reading /proc/net/dev, stats can be really +messed up after a while. + +A second problem is that some fields are 32bit, so we need to properly +handle the wrap around problem. + +Given that RTNL is not always held, we need to use +bond_for_each_slave_rcu(). + +Fixes: 5f0c5f73e5ef ("bonding: make global bonding stats more reliable") +Signed-off-by: Eric Dumazet +Cc: Andy Gospodarek +Cc: Jay Vosburgh +Cc: Veaceslav Falico +Reviewed-by: Nikolay Aleksandrov +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/bonding/bond_main.c | 65 ++++++++++++++++++++++------------------- + include/net/bonding.h | 1 + + 2 files changed, 36 insertions(+), 30 deletions(-) + +diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c +index 28bbca0..b3d70a7 100644 +--- a/drivers/net/bonding/bond_main.c ++++ b/drivers/net/bonding/bond_main.c +@@ -3260,6 +3260,30 @@ static int bond_close(struct net_device *bond_dev) + return 0; + } + ++/* fold stats, assuming all rtnl_link_stats64 fields are u64, but ++ * that some drivers can provide 32bit values only. ++ */ ++static void bond_fold_stats(struct rtnl_link_stats64 *_res, ++ const struct rtnl_link_stats64 *_new, ++ const struct rtnl_link_stats64 *_old) ++{ ++ const u64 *new = (const u64 *)_new; ++ const u64 *old = (const u64 *)_old; ++ u64 *res = (u64 *)_res; ++ int i; ++ ++ for (i = 0; i < sizeof(*_res) / sizeof(u64); i++) { ++ u64 nv = new[i]; ++ u64 ov = old[i]; ++ ++ /* detects if this particular field is 32bit only */ ++ if (((nv | ov) >> 32) == 0) ++ res[i] += (u32)nv - (u32)ov; ++ else ++ res[i] += nv - ov; ++ } ++} ++ + static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev, + struct rtnl_link_stats64 *stats) + { +@@ -3268,43 +3292,23 @@ static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev, + struct list_head *iter; + struct slave *slave; + ++ spin_lock(&bond->stats_lock); + memcpy(stats, &bond->bond_stats, sizeof(*stats)); + +- bond_for_each_slave(bond, slave, iter) { +- const struct rtnl_link_stats64 *sstats = ++ rcu_read_lock(); ++ bond_for_each_slave_rcu(bond, slave, iter) { ++ const struct rtnl_link_stats64 *new = + dev_get_stats(slave->dev, &temp); +- struct rtnl_link_stats64 *pstats = &slave->slave_stats; +- +- stats->rx_packets += sstats->rx_packets - pstats->rx_packets; +- stats->rx_bytes += sstats->rx_bytes - pstats->rx_bytes; +- stats->rx_errors += sstats->rx_errors - pstats->rx_errors; +- stats->rx_dropped += sstats->rx_dropped - pstats->rx_dropped; +- +- stats->tx_packets += sstats->tx_packets - pstats->tx_packets;; +- stats->tx_bytes += sstats->tx_bytes - pstats->tx_bytes; +- stats->tx_errors += sstats->tx_errors - pstats->tx_errors; +- stats->tx_dropped += sstats->tx_dropped - pstats->tx_dropped; +- +- stats->multicast += sstats->multicast - pstats->multicast; +- stats->collisions += sstats->collisions - pstats->collisions; +- +- stats->rx_length_errors += sstats->rx_length_errors - pstats->rx_length_errors; +- stats->rx_over_errors += sstats->rx_over_errors - pstats->rx_over_errors; +- stats->rx_crc_errors += sstats->rx_crc_errors - pstats->rx_crc_errors; +- stats->rx_frame_errors += sstats->rx_frame_errors - pstats->rx_frame_errors; +- stats->rx_fifo_errors += sstats->rx_fifo_errors - pstats->rx_fifo_errors; +- stats->rx_missed_errors += sstats->rx_missed_errors - pstats->rx_missed_errors; +- +- stats->tx_aborted_errors += sstats->tx_aborted_errors - pstats->tx_aborted_errors; +- stats->tx_carrier_errors += sstats->tx_carrier_errors - pstats->tx_carrier_errors; +- stats->tx_fifo_errors += sstats->tx_fifo_errors - pstats->tx_fifo_errors; +- stats->tx_heartbeat_errors += sstats->tx_heartbeat_errors - pstats->tx_heartbeat_errors; +- stats->tx_window_errors += sstats->tx_window_errors - pstats->tx_window_errors; ++ ++ bond_fold_stats(stats, new, &slave->slave_stats); + + /* save off the slave stats for the next run */ +- memcpy(pstats, sstats, sizeof(*sstats)); ++ memcpy(&slave->slave_stats, new, sizeof(*new)); + } ++ rcu_read_unlock(); ++ + memcpy(&bond->bond_stats, stats, sizeof(*stats)); ++ spin_unlock(&bond->stats_lock); + + return stats; + } +@@ -4118,6 +4122,7 @@ void bond_setup(struct net_device *bond_dev) + struct bonding *bond = netdev_priv(bond_dev); + + spin_lock_init(&bond->mode_lock); ++ spin_lock_init(&bond->stats_lock); + bond->params = bonding_defaults; + + /* Initialize pointers */ +diff --git a/include/net/bonding.h b/include/net/bonding.h +index c1740a2..93abe5f 100644 +--- a/include/net/bonding.h ++++ b/include/net/bonding.h +@@ -214,6 +214,7 @@ struct bonding { + * ALB mode (6) - to sync the use and modifications of its hash table + */ + spinlock_t mode_lock; ++ spinlock_t stats_lock; + u8 send_peer_notif; + u8 igmp_retrans; + #ifdef CONFIG_PROC_FS +-- +2.7.1 + + +From 40b6228016eb59114bc3351086d0325cc259abd9 Mon Sep 17 00:00:00 2001 +From: Paolo Abeni +Date: Tue, 22 Mar 2016 09:19:38 +0100 +Subject: [PATCH 285/384] ipv4: fix broadcast packets reception + +[ Upstream commit ad0ea1989cc4d5905941d0a9e62c63ad6d859cef ] + +Currently, ingress ipv4 broadcast datagrams are dropped since, +in udp_v4_early_demux(), ip_check_mc_rcu() is invoked even on +bcast packets. + +This patch addresses the issue, invoking ip_check_mc_rcu() +only for mcast packets. + +Fixes: 6e5403093261 ("ipv4/udp: Verify multicast group is ours in upd_v4_early_demux()") +Signed-off-by: Paolo Abeni +Acked-by: Hannes Frederic Sowa +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/udp.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c +index 7f8ab46..21fbb54 100644 +--- a/net/ipv4/udp.c ++++ b/net/ipv4/udp.c +@@ -1990,10 +1990,14 @@ void udp_v4_early_demux(struct sk_buff *skb) + if (!in_dev) + return; + +- ours = ip_check_mc_rcu(in_dev, iph->daddr, iph->saddr, +- iph->protocol); +- if (!ours) +- return; ++ /* we are supposed to accept bcast packets */ ++ if (skb->pkt_type == PACKET_MULTICAST) { ++ ours = ip_check_mc_rcu(in_dev, iph->daddr, iph->saddr, ++ iph->protocol); ++ if (!ours) ++ return; ++ } ++ + sk = __udp4_lib_mcast_demux_lookup(net, uh->dest, iph->daddr, + uh->source, iph->saddr, dif); + } else if (skb->pkt_type == PACKET_HOST) { +-- +2.7.1 + + +From 1a194e1c74996ff47823e23d5693382ccc46b2e3 Mon Sep 17 00:00:00 2001 +From: Lance Richardson +Date: Tue, 22 Mar 2016 14:56:57 -0400 +Subject: [PATCH 286/384] ipv4: initialize flowi4_flags before calling + fib_lookup() + +[ Upstream commit 4cfc86f3dae6ca38ed49cdd78f458a03d4d87992 ] + +Field fl4.flowi4_flags is not initialized in fib_compute_spec_dst() +before calling fib_lookup(), which means fib_table_lookup() is +using non-deterministic data at this line: + + if (!(flp->flowi4_flags & FLOWI_FLAG_SKIP_NH_OIF)) { + +Fix by initializing the entire fl4 structure, which will prevent +similar issues as fields are added in the future by ensuring that +all fields are initialized to zero unless explicitly initialized +to another value. + +Fixes: 58189ca7b2741 ("net: Fix vti use case with oif in dst lookups") +Suggested-by: David Ahern +Signed-off-by: Lance Richardson +Acked-by: David Ahern +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/fib_frontend.c | 16 +++++++--------- + 1 file changed, 7 insertions(+), 9 deletions(-) + +diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c +index 21add55..8a9246d 100644 +--- a/net/ipv4/fib_frontend.c ++++ b/net/ipv4/fib_frontend.c +@@ -280,7 +280,6 @@ __be32 fib_compute_spec_dst(struct sk_buff *skb) + struct in_device *in_dev; + struct fib_result res; + struct rtable *rt; +- struct flowi4 fl4; + struct net *net; + int scope; + +@@ -296,14 +295,13 @@ __be32 fib_compute_spec_dst(struct sk_buff *skb) + + scope = RT_SCOPE_UNIVERSE; + if (!ipv4_is_zeronet(ip_hdr(skb)->saddr)) { +- fl4.flowi4_oif = 0; +- fl4.flowi4_iif = LOOPBACK_IFINDEX; +- fl4.daddr = ip_hdr(skb)->saddr; +- fl4.saddr = 0; +- fl4.flowi4_tos = RT_TOS(ip_hdr(skb)->tos); +- fl4.flowi4_scope = scope; +- fl4.flowi4_mark = IN_DEV_SRC_VMARK(in_dev) ? skb->mark : 0; +- fl4.flowi4_tun_key.tun_id = 0; ++ struct flowi4 fl4 = { ++ .flowi4_iif = LOOPBACK_IFINDEX, ++ .daddr = ip_hdr(skb)->saddr, ++ .flowi4_tos = RT_TOS(ip_hdr(skb)->tos), ++ .flowi4_scope = scope, ++ .flowi4_mark = IN_DEV_SRC_VMARK(in_dev) ? skb->mark : 0, ++ }; + if (!fib_lookup(net, &fl4, &res, 0)) + return FIB_RES_PREFSRC(net, res); + } else { +-- +2.7.1 + + +From fa831f5d09a06ee35a0bc4bfad8d9cc1707e0112 Mon Sep 17 00:00:00 2001 +From: Guillaume Nault +Date: Wed, 23 Mar 2016 16:38:55 +0100 +Subject: [PATCH 287/384] ppp: take reference on channels netns + +[ Upstream commit 1f461dcdd296eecedaffffc6bae2bfa90bd7eb89 ] + +Let channels hold a reference on their network namespace. +Some channel types, like ppp_async and ppp_synctty, can have their +userspace controller running in a different namespace. Therefore they +can't rely on them to preclude their netns from being removed from +under them. + +================================================================== +BUG: KASAN: use-after-free in ppp_unregister_channel+0x372/0x3a0 at +addr ffff880064e217e0 +Read of size 8 by task syz-executor/11581 +============================================================================= +BUG net_namespace (Not tainted): kasan: bad access detected +----------------------------------------------------------------------------- + +Disabling lock debugging due to kernel taint +INFO: Allocated in copy_net_ns+0x6b/0x1a0 age=92569 cpu=3 pid=6906 +[< none >] ___slab_alloc+0x4c7/0x500 kernel/mm/slub.c:2440 +[< none >] __slab_alloc+0x4c/0x90 kernel/mm/slub.c:2469 +[< inline >] slab_alloc_node kernel/mm/slub.c:2532 +[< inline >] slab_alloc kernel/mm/slub.c:2574 +[< none >] kmem_cache_alloc+0x23a/0x2b0 kernel/mm/slub.c:2579 +[< inline >] kmem_cache_zalloc kernel/include/linux/slab.h:597 +[< inline >] net_alloc kernel/net/core/net_namespace.c:325 +[< none >] copy_net_ns+0x6b/0x1a0 kernel/net/core/net_namespace.c:360 +[< none >] create_new_namespaces+0x2f6/0x610 kernel/kernel/nsproxy.c:95 +[< none >] copy_namespaces+0x297/0x320 kernel/kernel/nsproxy.c:150 +[< none >] copy_process.part.35+0x1bf4/0x5760 kernel/kernel/fork.c:1451 +[< inline >] copy_process kernel/kernel/fork.c:1274 +[< none >] _do_fork+0x1bc/0xcb0 kernel/kernel/fork.c:1723 +[< inline >] SYSC_clone kernel/kernel/fork.c:1832 +[< none >] SyS_clone+0x37/0x50 kernel/kernel/fork.c:1826 +[< none >] entry_SYSCALL_64_fastpath+0x16/0x7a kernel/arch/x86/entry/entry_64.S:185 + +INFO: Freed in net_drop_ns+0x67/0x80 age=575 cpu=2 pid=2631 +[< none >] __slab_free+0x1fc/0x320 kernel/mm/slub.c:2650 +[< inline >] slab_free kernel/mm/slub.c:2805 +[< none >] kmem_cache_free+0x2a0/0x330 kernel/mm/slub.c:2814 +[< inline >] net_free kernel/net/core/net_namespace.c:341 +[< none >] net_drop_ns+0x67/0x80 kernel/net/core/net_namespace.c:348 +[< none >] cleanup_net+0x4e5/0x600 kernel/net/core/net_namespace.c:448 +[< none >] process_one_work+0x794/0x1440 kernel/kernel/workqueue.c:2036 +[< none >] worker_thread+0xdb/0xfc0 kernel/kernel/workqueue.c:2170 +[< none >] kthread+0x23f/0x2d0 kernel/drivers/block/aoe/aoecmd.c:1303 +[< none >] ret_from_fork+0x3f/0x70 kernel/arch/x86/entry/entry_64.S:468 +INFO: Slab 0xffffea0001938800 objects=3 used=0 fp=0xffff880064e20000 +flags=0x5fffc0000004080 +INFO: Object 0xffff880064e20000 @offset=0 fp=0xffff880064e24200 + +CPU: 1 PID: 11581 Comm: syz-executor Tainted: G B 4.4.0+ +Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS +rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014 + 00000000ffffffff ffff8800662c7790 ffffffff8292049d ffff88003e36a300 + ffff880064e20000 ffff880064e20000 ffff8800662c77c0 ffffffff816f2054 + ffff88003e36a300 ffffea0001938800 ffff880064e20000 0000000000000000 +Call Trace: + [< inline >] __dump_stack kernel/lib/dump_stack.c:15 + [] dump_stack+0x6f/0xa2 kernel/lib/dump_stack.c:50 + [] print_trailer+0xf4/0x150 kernel/mm/slub.c:654 + [] object_err+0x2f/0x40 kernel/mm/slub.c:661 + [< inline >] print_address_description kernel/mm/kasan/report.c:138 + [] kasan_report_error+0x215/0x530 kernel/mm/kasan/report.c:236 + [< inline >] kasan_report kernel/mm/kasan/report.c:259 + [] __asan_report_load8_noabort+0x3e/0x40 kernel/mm/kasan/report.c:280 + [< inline >] ? ppp_pernet kernel/include/linux/compiler.h:218 + [] ? ppp_unregister_channel+0x372/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392 + [< inline >] ppp_pernet kernel/include/linux/compiler.h:218 + [] ppp_unregister_channel+0x372/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392 + [< inline >] ? ppp_pernet kernel/drivers/net/ppp/ppp_generic.c:293 + [] ? ppp_unregister_channel+0xe6/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392 + [] ppp_asynctty_close+0xa3/0x130 kernel/drivers/net/ppp/ppp_async.c:241 + [] ? async_lcp_peek+0x5b0/0x5b0 kernel/drivers/net/ppp/ppp_async.c:1000 + [] tty_ldisc_close.isra.1+0x99/0xe0 kernel/drivers/tty/tty_ldisc.c:478 + [] tty_ldisc_kill+0x40/0x170 kernel/drivers/tty/tty_ldisc.c:744 + [] tty_ldisc_release+0x1b3/0x260 kernel/drivers/tty/tty_ldisc.c:772 + [] tty_release+0xac1/0x13e0 kernel/drivers/tty/tty_io.c:1901 + [] ? release_tty+0x320/0x320 kernel/drivers/tty/tty_io.c:1688 + [] __fput+0x236/0x780 kernel/fs/file_table.c:208 + [] ____fput+0x15/0x20 kernel/fs/file_table.c:244 + [] task_work_run+0x16b/0x200 kernel/kernel/task_work.c:115 + [< inline >] exit_task_work kernel/include/linux/task_work.h:21 + [] do_exit+0x8b5/0x2c60 kernel/kernel/exit.c:750 + [] ? debug_check_no_locks_freed+0x290/0x290 kernel/kernel/locking/lockdep.c:4123 + [] ? mm_update_next_owner+0x6f0/0x6f0 kernel/kernel/exit.c:357 + [] ? __dequeue_signal+0x136/0x470 kernel/kernel/signal.c:550 + [] ? recalc_sigpending_tsk+0x13b/0x180 kernel/kernel/signal.c:145 + [] do_group_exit+0x108/0x330 kernel/kernel/exit.c:880 + [] get_signal+0x5e4/0x14f0 kernel/kernel/signal.c:2307 + [< inline >] ? kretprobe_table_lock kernel/kernel/kprobes.c:1113 + [] ? kprobe_flush_task+0xb5/0x450 kernel/kernel/kprobes.c:1158 + [] do_signal+0x83/0x1c90 kernel/arch/x86/kernel/signal.c:712 + [] ? recycle_rp_inst+0x310/0x310 kernel/include/linux/list.h:655 + [] ? setup_sigcontext+0x780/0x780 kernel/arch/x86/kernel/signal.c:165 + [] ? finish_task_switch+0x424/0x5f0 kernel/kernel/sched/core.c:2692 + [< inline >] ? finish_lock_switch kernel/kernel/sched/sched.h:1099 + [] ? finish_task_switch+0x120/0x5f0 kernel/kernel/sched/core.c:2678 + [< inline >] ? context_switch kernel/kernel/sched/core.c:2807 + [] ? __schedule+0x919/0x1bd0 kernel/kernel/sched/core.c:3283 + [] exit_to_usermode_loop+0xf1/0x1a0 kernel/arch/x86/entry/common.c:247 + [< inline >] prepare_exit_to_usermode kernel/arch/x86/entry/common.c:282 + [] syscall_return_slowpath+0x19f/0x210 kernel/arch/x86/entry/common.c:344 + [] int_ret_from_sys_call+0x25/0x9f kernel/arch/x86/entry/entry_64.S:281 +Memory state around the buggy address: + ffff880064e21680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb + ffff880064e21700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb +>ffff880064e21780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb + ^ + ffff880064e21800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb + ffff880064e21880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb +================================================================== + +Fixes: 273ec51dd7ce ("net: ppp_generic - introduce net-namespace functionality v2") +Reported-by: Baozeng Ding +Signed-off-by: Guillaume Nault +Reviewed-by: Cyrill Gorcunov +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ppp/ppp_generic.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c +index 35e8b5a..174e06e 100644 +--- a/drivers/net/ppp/ppp_generic.c ++++ b/drivers/net/ppp/ppp_generic.c +@@ -2293,7 +2293,7 @@ int ppp_register_net_channel(struct net *net, struct ppp_channel *chan) + + pch->ppp = NULL; + pch->chan = chan; +- pch->chan_net = net; ++ pch->chan_net = get_net(net); + chan->ppp = pch; + init_ppp_file(&pch->file, CHANNEL); + pch->file.hdrlen = chan->hdrlen; +@@ -2390,6 +2390,8 @@ ppp_unregister_channel(struct ppp_channel *chan) + spin_lock_bh(&pn->all_channels_lock); + list_del(&pch->list); + spin_unlock_bh(&pn->all_channels_lock); ++ put_net(pch->chan_net); ++ pch->chan_net = NULL; + + pch->file.dead = 1; + wake_up_interruptible(&pch->file.rwait); +-- +2.7.1 + + +From e880551c8c86b63fa0e27b7f654a62a81bfd6780 Mon Sep 17 00:00:00 2001 +From: "subashab@codeaurora.org" +Date: Wed, 23 Mar 2016 22:39:50 -0600 +Subject: [PATCH 288/384] xfrm: Fix crash observed during device unregistration + and decryption + +[ Upstream commit 071d36bf21bcc837be00cea55bcef8d129e7f609 ] + +A crash is observed when a decrypted packet is processed in receive +path. get_rps_cpus() tries to dereference the skb->dev fields but it +appears that the device is freed from the poison pattern. + +[] get_rps_cpu+0x94/0x2f0 +[] netif_rx_internal+0x140/0x1cc +[] netif_rx+0x74/0x94 +[] xfrm_input+0x754/0x7d0 +[] xfrm_input_resume+0x10/0x1c +[] esp_input_done+0x20/0x30 +[] process_one_work+0x244/0x3fc +[] worker_thread+0x2f8/0x418 +[] kthread+0xe0/0xec + +-013|get_rps_cpu( + | dev = 0xFFFFFFC08B688000, + | skb = 0xFFFFFFC0C76AAC00 -> ( + | dev = 0xFFFFFFC08B688000 -> ( + | name = +"...................................................... + | name_hlist = (next = 0xAAAAAAAAAAAAAAAA, pprev = +0xAAAAAAAAAAA + +Following are the sequence of events observed - + +- Encrypted packet in receive path from netdevice is queued +- Encrypted packet queued for decryption (asynchronous) +- Netdevice brought down and freed +- Packet is decrypted and returned through callback in esp_input_done +- Packet is queued again for process in network stack using netif_rx + +Since the device appears to have been freed, the dereference of +skb->dev in get_rps_cpus() leads to an unhandled page fault +exception. + +Fix this by holding on to device reference when queueing packets +asynchronously and releasing the reference on call back return. + +v2: Make the change generic to xfrm as mentioned by Steffen and +update the title to xfrm + +Suggested-by: Herbert Xu +Signed-off-by: Jerome Stanislaus +Signed-off-by: Subash Abhinov Kasiviswanathan +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/xfrm/xfrm_input.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c +index ad7f5b3..1c4ad47 100644 +--- a/net/xfrm/xfrm_input.c ++++ b/net/xfrm/xfrm_input.c +@@ -292,12 +292,15 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) + XFRM_SKB_CB(skb)->seq.input.hi = seq_hi; + + skb_dst_force(skb); ++ dev_hold(skb->dev); + + nexthdr = x->type->input(x, skb); + + if (nexthdr == -EINPROGRESS) + return 0; + resume: ++ dev_put(skb->dev); ++ + spin_lock(&x->lock); + if (nexthdr <= 0) { + if (nexthdr == -EBADMSG) { +-- +2.7.1 + + +From 7fbfc5dbc7d0f3471fc9c396328703da2311524b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +Date: Mon, 28 Mar 2016 22:38:16 +0200 +Subject: [PATCH 289/384] qmi_wwan: add "D-Link DWM-221 B1" device id +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[ Upstream commit e84810c7b85a2d7897797b3ad3e879168a8e032a ] + +Thomas reports: +"Windows: + +00 diagnostics +01 modem +02 at-port +03 nmea +04 nic + +Linux: + +T: Bus=02 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#= 4 Spd=480 MxCh= 0 +D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 +P: Vendor=2001 ProdID=7e19 Rev=02.32 +S: Manufacturer=Mobile Connect +S: Product=Mobile Connect +S: SerialNumber=0123456789ABCDEF +C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA +I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option +I: If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan +I: If#= 5 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage" + +Reported-by: Thomas Schäfer +Signed-off-by: Bjørn Mork +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/usb/qmi_wwan.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c +index df77467..a34f491 100644 +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -699,6 +699,7 @@ static const struct usb_device_id products[] = { + {QMI_FIXED_INTF(0x19d2, 0x1426, 2)}, /* ZTE MF91 */ + {QMI_FIXED_INTF(0x19d2, 0x1428, 2)}, /* Telewell TW-LTE 4G v2 */ + {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */ ++ {QMI_FIXED_INTF(0x2001, 0x7e19, 4)}, /* D-Link DWM-221 B1 */ + {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */ + {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */ + {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */ +-- +2.7.1 + + +From 85a99589f1608a5a724cc327acf4ddd0d9093ca6 Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Tue, 29 Mar 2016 08:43:41 -0700 +Subject: [PATCH 290/384] ipv6: udp: fix UDP_MIB_IGNOREDMULTI updates + +[ Upstream commit 2d4212261fdf13e29728ddb5ea9d60c342cc92b5 ] + +IPv6 counters updates use a different macro than IPv4. + +Fixes: 36cbb2452cbaf ("udp: Increment UDP_MIB_IGNOREDMULTI for arriving unmatched multicasts") +Signed-off-by: Eric Dumazet +Cc: Rick Jones +Cc: Willem de Bruijn +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv6/udp.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c +index 1e293a5..6665e1a 100644 +--- a/net/ipv6/udp.c ++++ b/net/ipv6/udp.c +@@ -837,8 +837,8 @@ start_lookup: + flush_stack(stack, count, skb, count - 1); + } else { + if (!inner_flushed) +- UDP_INC_STATS_BH(net, UDP_MIB_IGNOREDMULTI, +- proto == IPPROTO_UDPLITE); ++ UDP6_INC_STATS_BH(net, UDP_MIB_IGNOREDMULTI, ++ proto == IPPROTO_UDPLITE); + consume_skb(skb); + } + return 0; +-- +2.7.1 + + +From cc97d3a19655b2affeb247d0dc29e6b0d6004f67 Mon Sep 17 00:00:00 2001 +From: Haishuang Yan +Date: Tue, 29 Mar 2016 18:48:08 +0800 +Subject: [PATCH 291/384] bridge: Allow set bridge ageing time when switchdev + disabled + +[ Upstream commit 5e263f712691615fb802f06c98d7638c378f5d11 ] + +When NET_SWITCHDEV=n, switchdev_port_attr_set will return -EOPNOTSUPP, +we should ignore this error code and continue to set the ageing time. + +Fixes: c62987bbd8a1 ("bridge: push bridge setting ageing_time down to switchdev") +Signed-off-by: Haishuang Yan +Acked-by: Ido Schimmel +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/bridge/br_stp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c +index 0e658f4..eff69cb 100644 +--- a/net/bridge/br_stp.c ++++ b/net/bridge/br_stp.c +@@ -586,7 +586,7 @@ int br_set_ageing_time(struct net_bridge *br, u32 ageing_time) + int err; + + err = switchdev_port_attr_set(br->dev, &attr); +- if (err) ++ if (err && err != -EOPNOTSUPP) + return err; + + br->ageing_time = t; +-- +2.7.1 + + +From aac61a2cf0fa2196572e3d4708caab6fe86b90ab Mon Sep 17 00:00:00 2001 +From: Nicolas Dichtel +Date: Thu, 31 Mar 2016 18:10:31 +0200 +Subject: [PATCH 292/384] rtnl: fix msg size calculation in if_nlmsg_size() + +[ Upstream commit c57c7a95da842807b475b823ed2e5435c42cb3b0 ] + +Size of the attribute IFLA_PHYS_PORT_NAME was missing. + +Fixes: db24a9044ee1 ("net: add support for phys_port_name") +CC: David Ahern +Signed-off-by: Nicolas Dichtel +Acked-by: David Ahern +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/core/rtnetlink.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c +index 34ba7a0..ca966f7 100644 +--- a/net/core/rtnetlink.c ++++ b/net/core/rtnetlink.c +@@ -905,6 +905,7 @@ static noinline size_t if_nlmsg_size(const struct net_device *dev, + + rtnl_link_get_af_size(dev, ext_filter_mask) /* IFLA_AF_SPEC */ + + nla_total_size(MAX_PHYS_ITEM_ID_LEN) /* IFLA_PHYS_PORT_ID */ + + nla_total_size(MAX_PHYS_ITEM_ID_LEN) /* IFLA_PHYS_SWITCH_ID */ ++ + nla_total_size(IFNAMSIZ) /* IFLA_PHYS_PORT_NAME */ + + nla_total_size(1); /* IFLA_PROTO_DOWN */ + + } +-- +2.7.1 + + +From 2636be6c61a47b4a0b720fcfd39f3636663953cc Mon Sep 17 00:00:00 2001 +From: Daniel Borkmann +Date: Thu, 31 Mar 2016 02:13:18 +0200 +Subject: [PATCH 293/384] tun, bpf: fix suspicious RCU usage in tun_{attach, + detach}_filter + +[ Upstream commit 5a5abb1fa3b05dd6aa821525832644c1e7d2905f ] + +Sasha Levin reported a suspicious rcu_dereference_protected() warning +found while fuzzing with trinity that is similar to this one: + + [ 52.765684] net/core/filter.c:2262 suspicious rcu_dereference_protected() usage! + [ 52.765688] other info that might help us debug this: + [ 52.765695] rcu_scheduler_active = 1, debug_locks = 1 + [ 52.765701] 1 lock held by a.out/1525: + [ 52.765704] #0: (rtnl_mutex){+.+.+.}, at: [] rtnl_lock+0x17/0x20 + [ 52.765721] stack backtrace: + [ 52.765728] CPU: 1 PID: 1525 Comm: a.out Not tainted 4.5.0+ #264 + [...] + [ 52.765768] Call Trace: + [ 52.765775] [] dump_stack+0x85/0xc8 + [ 52.765784] [] lockdep_rcu_suspicious+0xd5/0x110 + [ 52.765792] [] sk_detach_filter+0x82/0x90 + [ 52.765801] [] tun_detach_filter+0x35/0x90 [tun] + [ 52.765810] [] __tun_chr_ioctl+0x354/0x1130 [tun] + [ 52.765818] [] ? selinux_file_ioctl+0x130/0x210 + [ 52.765827] [] tun_chr_ioctl+0x13/0x20 [tun] + [ 52.765834] [] do_vfs_ioctl+0x96/0x690 + [ 52.765843] [] ? security_file_ioctl+0x43/0x60 + [ 52.765850] [] SyS_ioctl+0x79/0x90 + [ 52.765858] [] do_syscall_64+0x62/0x140 + [ 52.765866] [] entry_SYSCALL64_slow_path+0x25/0x25 + +Same can be triggered with PROVE_RCU (+ PROVE_RCU_REPEATEDLY) enabled +from tun_attach_filter() when user space calls ioctl(tun_fd, TUN{ATTACH, +DETACH}FILTER, ...) for adding/removing a BPF filter on tap devices. + +Since the fix in f91ff5b9ff52 ("net: sk_{detach|attach}_filter() rcu +fixes") sk_attach_filter()/sk_detach_filter() now dereferences the +filter with rcu_dereference_protected(), checking whether socket lock +is held in control path. + +Since its introduction in 994051625981 ("tun: socket filter support"), +tap filters are managed under RTNL lock from __tun_chr_ioctl(). Thus the +sock_owned_by_user(sk) doesn't apply in this specific case and therefore +triggers the false positive. + +Extend the BPF API with __sk_attach_filter()/__sk_detach_filter() pair +that is used by tap filters and pass in lockdep_rtnl_is_held() for the +rcu_dereference_protected() checks instead. + +Reported-by: Sasha Levin +Signed-off-by: Daniel Borkmann +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/tun.c | 8 +++++--- + include/linux/filter.h | 4 ++++ + net/core/filter.c | 33 +++++++++++++++++++++------------ + 3 files changed, 30 insertions(+), 15 deletions(-) + +diff --git a/drivers/net/tun.c b/drivers/net/tun.c +index f0db770..9bc7b0c 100644 +--- a/drivers/net/tun.c ++++ b/drivers/net/tun.c +@@ -621,7 +621,8 @@ static int tun_attach(struct tun_struct *tun, struct file *file, bool skip_filte + + /* Re-attach the filter to persist device */ + if (!skip_filter && (tun->filter_attached == true)) { +- err = sk_attach_filter(&tun->fprog, tfile->socket.sk); ++ err = __sk_attach_filter(&tun->fprog, tfile->socket.sk, ++ lockdep_rtnl_is_held()); + if (!err) + goto out; + } +@@ -1804,7 +1805,7 @@ static void tun_detach_filter(struct tun_struct *tun, int n) + + for (i = 0; i < n; i++) { + tfile = rtnl_dereference(tun->tfiles[i]); +- sk_detach_filter(tfile->socket.sk); ++ __sk_detach_filter(tfile->socket.sk, lockdep_rtnl_is_held()); + } + + tun->filter_attached = false; +@@ -1817,7 +1818,8 @@ static int tun_attach_filter(struct tun_struct *tun) + + for (i = 0; i < tun->numqueues; i++) { + tfile = rtnl_dereference(tun->tfiles[i]); +- ret = sk_attach_filter(&tun->fprog, tfile->socket.sk); ++ ret = __sk_attach_filter(&tun->fprog, tfile->socket.sk, ++ lockdep_rtnl_is_held()); + if (ret) { + tun_detach_filter(tun, i); + return ret; +diff --git a/include/linux/filter.h b/include/linux/filter.h +index 5972ffe..5110d42 100644 +--- a/include/linux/filter.h ++++ b/include/linux/filter.h +@@ -446,8 +446,12 @@ int bpf_prog_create_from_user(struct bpf_prog **pfp, struct sock_fprog *fprog, + void bpf_prog_destroy(struct bpf_prog *fp); + + int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); ++int __sk_attach_filter(struct sock_fprog *fprog, struct sock *sk, ++ bool locked); + int sk_attach_bpf(u32 ufd, struct sock *sk); + int sk_detach_filter(struct sock *sk); ++int __sk_detach_filter(struct sock *sk, bool locked); ++ + int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, + unsigned int len); + +diff --git a/net/core/filter.c b/net/core/filter.c +index 37157c4..f393a22 100644 +--- a/net/core/filter.c ++++ b/net/core/filter.c +@@ -1139,7 +1139,8 @@ void bpf_prog_destroy(struct bpf_prog *fp) + } + EXPORT_SYMBOL_GPL(bpf_prog_destroy); + +-static int __sk_attach_prog(struct bpf_prog *prog, struct sock *sk) ++static int __sk_attach_prog(struct bpf_prog *prog, struct sock *sk, ++ bool locked) + { + struct sk_filter *fp, *old_fp; + +@@ -1155,10 +1156,8 @@ static int __sk_attach_prog(struct bpf_prog *prog, struct sock *sk) + return -ENOMEM; + } + +- old_fp = rcu_dereference_protected(sk->sk_filter, +- sock_owned_by_user(sk)); ++ old_fp = rcu_dereference_protected(sk->sk_filter, locked); + rcu_assign_pointer(sk->sk_filter, fp); +- + if (old_fp) + sk_filter_uncharge(sk, old_fp); + +@@ -1175,7 +1174,8 @@ static int __sk_attach_prog(struct bpf_prog *prog, struct sock *sk) + * occurs or there is insufficient memory for the filter a negative + * errno code is returned. On success the return is zero. + */ +-int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) ++int __sk_attach_filter(struct sock_fprog *fprog, struct sock *sk, ++ bool locked) + { + unsigned int fsize = bpf_classic_proglen(fprog); + unsigned int bpf_fsize = bpf_prog_size(fprog->len); +@@ -1213,7 +1213,7 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) + if (IS_ERR(prog)) + return PTR_ERR(prog); + +- err = __sk_attach_prog(prog, sk); ++ err = __sk_attach_prog(prog, sk, locked); + if (err < 0) { + __bpf_prog_release(prog); + return err; +@@ -1221,7 +1221,12 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) + + return 0; + } +-EXPORT_SYMBOL_GPL(sk_attach_filter); ++EXPORT_SYMBOL_GPL(__sk_attach_filter); ++ ++int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) ++{ ++ return __sk_attach_filter(fprog, sk, sock_owned_by_user(sk)); ++} + + int sk_attach_bpf(u32 ufd, struct sock *sk) + { +@@ -1240,7 +1245,7 @@ int sk_attach_bpf(u32 ufd, struct sock *sk) + return -EINVAL; + } + +- err = __sk_attach_prog(prog, sk); ++ err = __sk_attach_prog(prog, sk, sock_owned_by_user(sk)); + if (err < 0) { + bpf_prog_put(prog); + return err; +@@ -1913,7 +1918,7 @@ static int __init register_sk_filter_ops(void) + } + late_initcall(register_sk_filter_ops); + +-int sk_detach_filter(struct sock *sk) ++int __sk_detach_filter(struct sock *sk, bool locked) + { + int ret = -ENOENT; + struct sk_filter *filter; +@@ -1921,8 +1926,7 @@ int sk_detach_filter(struct sock *sk) + if (sock_flag(sk, SOCK_FILTER_LOCKED)) + return -EPERM; + +- filter = rcu_dereference_protected(sk->sk_filter, +- sock_owned_by_user(sk)); ++ filter = rcu_dereference_protected(sk->sk_filter, locked); + if (filter) { + RCU_INIT_POINTER(sk->sk_filter, NULL); + sk_filter_uncharge(sk, filter); +@@ -1931,7 +1935,12 @@ int sk_detach_filter(struct sock *sk) + + return ret; + } +-EXPORT_SYMBOL_GPL(sk_detach_filter); ++EXPORT_SYMBOL_GPL(__sk_detach_filter); ++ ++int sk_detach_filter(struct sock *sk) ++{ ++ return __sk_detach_filter(sk, sock_owned_by_user(sk)); ++} + + int sk_get_filter(struct sock *sk, struct sock_filter __user *ubuf, + unsigned int len) +-- +2.7.1 + + +From 0f8967351d7f193d23d473942e70305247a45ac0 Mon Sep 17 00:00:00 2001 +From: Jason Wang +Date: Fri, 8 Apr 2016 13:26:48 +0800 +Subject: [PATCH 294/384] tuntap: restore default qdisc + +[ Upstream commit 016adb7260f481168c03e09f785184d6d5278894 ] + +After commit f84bb1eac027 ("net: fix IFF_NO_QUEUE for drivers using +alloc_netdev"), default qdisc was changed to noqueue because +tuntap does not set tx_queue_len during .setup(). This patch restores +default qdisc by setting tx_queue_len in tun_setup(). + +Fixes: f84bb1eac027 ("net: fix IFF_NO_QUEUE for drivers using alloc_netdev") +Cc: Phil Sutter +Signed-off-by: Jason Wang +Acked-by: Michael S. Tsirkin +Acked-by: Phil Sutter +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/tun.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/tun.c b/drivers/net/tun.c +index 9bc7b0c..2d186bd 100644 +--- a/drivers/net/tun.c ++++ b/drivers/net/tun.c +@@ -1001,7 +1001,6 @@ static void tun_net_init(struct net_device *dev) + /* Zero header length */ + dev->type = ARPHRD_NONE; + dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST; +- dev->tx_queue_len = TUN_READQ_SIZE; /* We prefer our own queue length */ + break; + + case IFF_TAP: +@@ -1013,7 +1012,6 @@ static void tun_net_init(struct net_device *dev) + + eth_hw_addr_random(dev); + +- dev->tx_queue_len = TUN_READQ_SIZE; /* We prefer our own queue length */ + break; + } + } +@@ -1464,6 +1462,8 @@ static void tun_setup(struct net_device *dev) + + dev->ethtool_ops = &tun_ethtool_ops; + dev->destructor = tun_free_netdev; ++ /* We prefer our own queue length */ ++ dev->tx_queue_len = TUN_READQ_SIZE; + } + + /* Trivial set of netlink ops to allow deleting tun or tap +-- +2.7.1 + + +From 45c4aa4560a97468cb6f0665bbb6f9b8896f83de Mon Sep 17 00:00:00 2001 +From: Haishuang Yan +Date: Sun, 3 Apr 2016 22:09:23 +0800 +Subject: [PATCH 295/384] ipv4: l2tp: fix a potential issue in l2tp_ip_recv + +[ Upstream commit 5745b8232e942abd5e16e85fa9b27cc21324acf0 ] + +pskb_may_pull() can change skb->data, so we have to load ptr/optr at the +right place. + +Signed-off-by: Haishuang Yan +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/l2tp/l2tp_ip.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c +index ec22078..42de4cc 100644 +--- a/net/l2tp/l2tp_ip.c ++++ b/net/l2tp/l2tp_ip.c +@@ -123,12 +123,11 @@ static int l2tp_ip_recv(struct sk_buff *skb) + struct l2tp_tunnel *tunnel = NULL; + int length; + +- /* Point to L2TP header */ +- optr = ptr = skb->data; +- + if (!pskb_may_pull(skb, 4)) + goto discard; + ++ /* Point to L2TP header */ ++ optr = ptr = skb->data; + session_id = ntohl(*((__be32 *) ptr)); + ptr += 4; + +@@ -156,6 +155,9 @@ static int l2tp_ip_recv(struct sk_buff *skb) + if (!pskb_may_pull(skb, length)) + goto discard; + ++ /* Point to L2TP header */ ++ optr = ptr = skb->data; ++ ptr += 4; + pr_debug("%s: ip recv\n", tunnel->name); + print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, ptr, length); + } +-- +2.7.1 + + +From 6e4422311e5437b9cff61a5f4e60f395440cb506 Mon Sep 17 00:00:00 2001 +From: Haishuang Yan +Date: Sun, 3 Apr 2016 22:09:24 +0800 +Subject: [PATCH 296/384] ipv6: l2tp: fix a potential issue in l2tp_ip6_recv + +[ Upstream commit be447f305494e019dfc37ea4cdf3b0e4200b4eba ] + +pskb_may_pull() can change skb->data, so we have to load ptr/optr at the +right place. + +Signed-off-by: Haishuang Yan +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/l2tp/l2tp_ip6.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c +index a2c8747..9ee4ddb 100644 +--- a/net/l2tp/l2tp_ip6.c ++++ b/net/l2tp/l2tp_ip6.c +@@ -135,12 +135,11 @@ static int l2tp_ip6_recv(struct sk_buff *skb) + struct l2tp_tunnel *tunnel = NULL; + int length; + +- /* Point to L2TP header */ +- optr = ptr = skb->data; +- + if (!pskb_may_pull(skb, 4)) + goto discard; + ++ /* Point to L2TP header */ ++ optr = ptr = skb->data; + session_id = ntohl(*((__be32 *) ptr)); + ptr += 4; + +@@ -168,6 +167,9 @@ static int l2tp_ip6_recv(struct sk_buff *skb) + if (!pskb_may_pull(skb, length)) + goto discard; + ++ /* Point to L2TP header */ ++ optr = ptr = skb->data; ++ ptr += 4; + pr_debug("%s: ip recv\n", tunnel->name); + print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, ptr, length); + } +-- +2.7.1 + + +From 44f238837497c8c5bec2328c72080923cbb28a46 Mon Sep 17 00:00:00 2001 +From: Thadeu Lima de Souza Cascardo +Date: Fri, 1 Apr 2016 17:17:50 -0300 +Subject: [PATCH 297/384] ip6_tunnel: set rtnl_link_ops before calling + register_netdevice + +[ Upstream commit b6ee376cb0b7fb4e7e07d6cd248bd40436fb9ba6 ] + +When creating an ip6tnl tunnel with ip tunnel, rtnl_link_ops is not set +before ip6_tnl_create2 is called. When register_netdevice is called, there +is no linkinfo attribute in the NEWLINK message because of that. + +Setting rtnl_link_ops before calling register_netdevice fixes that. + +Fixes: 0b112457229d ("ip6tnl: add support of link creation via rtnl") +Signed-off-by: Thadeu Lima de Souza Cascardo +Acked-by: Nicolas Dichtel +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv6/ip6_tunnel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c +index 6c5dfec..3991b21 100644 +--- a/net/ipv6/ip6_tunnel.c ++++ b/net/ipv6/ip6_tunnel.c +@@ -343,12 +343,12 @@ static int ip6_tnl_create2(struct net_device *dev) + + t = netdev_priv(dev); + ++ dev->rtnl_link_ops = &ip6_link_ops; + err = register_netdevice(dev); + if (err < 0) + goto out; + + strcpy(t->parms.name, dev->name); +- dev->rtnl_link_ops = &ip6_link_ops; + + dev_hold(dev); + ip6_tnl_link(ip6n, t); +-- +2.7.1 + + +From 75abb185e7c3863997348b58ebd80b70b2f1a5bd Mon Sep 17 00:00:00 2001 +From: Jakub Sitnicki +Date: Tue, 5 Apr 2016 18:41:08 +0200 +Subject: [PATCH 298/384] ipv6: Count in extension headers in + skb->network_header + +[ Upstream commit 3ba3458fb9c050718b95275a3310b74415e767e2 ] + +When sending a UDPv6 message longer than MTU, account for the length +of fragmentable IPv6 extension headers in skb->network_header offset. +Same as we do in alloc_new_skb path in __ip6_append_data(). + +This ensures that later on __ip6_make_skb() will make space in +headroom for fragmentable extension headers: + + /* move skb->data to ip header from ext header */ + if (skb->data < skb_network_header(skb)) + __skb_pull(skb, skb_network_offset(skb)); + +Prevents a splat due to skb_under_panic: + +skbuff: skb_under_panic: text:ffffffff8143397b len:2126 put:14 \ +head:ffff880005bacf50 data:ffff880005bacf4a tail:0x48 end:0xc0 dev:lo +------------[ cut here ]------------ +kernel BUG at net/core/skbuff.c:104! +invalid opcode: 0000 [#1] KASAN +CPU: 0 PID: 160 Comm: reproducer Not tainted 4.6.0-rc2 #65 +[...] +Call Trace: + [] skb_push+0x79/0x80 + [] eth_header+0x2b/0x100 + [] neigh_resolve_output+0x210/0x310 + [] ip6_finish_output2+0x4a7/0x7c0 + [] ip6_output+0x16a/0x280 + [] ip6_local_out+0xb1/0xf0 + [] ip6_send_skb+0x45/0xd0 + [] udp_v6_send_skb+0x246/0x5d0 + [] udpv6_sendmsg+0xa6e/0x1090 +[...] + +Reported-by: Ji Jianwen +Signed-off-by: Jakub Sitnicki +Acked-by: Hannes Frederic Sowa +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv6/ip6_output.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c +index 31144c4..a175152 100644 +--- a/net/ipv6/ip6_output.c ++++ b/net/ipv6/ip6_output.c +@@ -1091,8 +1091,8 @@ static inline int ip6_ufo_append_data(struct sock *sk, + int getfrag(void *from, char *to, int offset, int len, + int odd, struct sk_buff *skb), + void *from, int length, int hh_len, int fragheaderlen, +- int transhdrlen, int mtu, unsigned int flags, +- const struct flowi6 *fl6) ++ int exthdrlen, int transhdrlen, int mtu, ++ unsigned int flags, const struct flowi6 *fl6) + + { + struct sk_buff *skb; +@@ -1117,7 +1117,7 @@ static inline int ip6_ufo_append_data(struct sock *sk, + skb_put(skb, fragheaderlen + transhdrlen); + + /* initialize network header pointer */ +- skb_reset_network_header(skb); ++ skb_set_network_header(skb, exthdrlen); + + /* initialize protocol header pointer */ + skb->transport_header = skb->network_header + fragheaderlen; +@@ -1359,7 +1359,7 @@ emsgsize: + (rt->dst.dev->features & NETIF_F_UFO) && + (sk->sk_type == SOCK_DGRAM) && !udp_get_no_check6_tx(sk)) { + err = ip6_ufo_append_data(sk, queue, getfrag, from, length, +- hh_len, fragheaderlen, ++ hh_len, fragheaderlen, exthdrlen, + transhdrlen, mtu, flags, fl6); + if (err) + goto error; +-- +2.7.1 + + +From 0e03ce4ebda6680964328b7fe6dcc3b40d1f45b4 Mon Sep 17 00:00:00 2001 +From: Roopa Prabhu +Date: Thu, 7 Apr 2016 21:28:38 -0700 +Subject: [PATCH 299/384] mpls: find_outdev: check for err ptr in addition to + NULL check + +[ Upstream commit 94a57f1f8a9de90ab4b0f8748361ff8be706c80c ] + +find_outdev calls inet{,6}_fib_lookup_dev() or dev_get_by_index() to +find the output device. In case of an error, inet{,6}_fib_lookup_dev() +returns error pointer and dev_get_by_index() returns NULL. But the function +only checks for NULL and thus can end up calling dev_put on an ERR_PTR. +This patch adds an additional check for err ptr after the NULL check. + +Before: Trying to add an mpls route with no oif from user, no available +path to 10.1.1.8 and no default route: +$ip -f mpls route add 100 as 200 via inet 10.1.1.8 +[ 822.337195] BUG: unable to handle kernel NULL pointer dereference at +00000000000003a3 +[ 822.340033] IP: [] mpls_nh_assign_dev+0x10b/0x182 +[ 822.340033] PGD 1db38067 PUD 1de9e067 PMD 0 +[ 822.340033] Oops: 0000 [#1] SMP +[ 822.340033] Modules linked in: +[ 822.340033] CPU: 0 PID: 11148 Comm: ip Not tainted 4.5.0-rc7+ #54 +[ 822.340033] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), +BIOS rel-1.7.5.1-0-g8936dbb-20141113_115728-nilsson.home.kraxel.org +04/01/2014 +[ 822.340033] task: ffff88001db82580 ti: ffff88001dad4000 task.ti: +ffff88001dad4000 +[ 822.340033] RIP: 0010:[] [] +mpls_nh_assign_dev+0x10b/0x182 +[ 822.340033] RSP: 0018:ffff88001dad7a88 EFLAGS: 00010282 +[ 822.340033] RAX: ffffffffffffff9b RBX: ffffffffffffff9b RCX: +0000000000000002 +[ 822.340033] RDX: 00000000ffffff9b RSI: 0000000000000008 RDI: +0000000000000000 +[ 822.340033] RBP: ffff88001ddc9ea0 R08: ffff88001e9f1768 R09: +0000000000000000 +[ 822.340033] R10: ffff88001d9c1100 R11: ffff88001e3c89f0 R12: +ffffffff8187e0c0 +[ 822.340033] R13: ffffffff8187e0c0 R14: ffff88001ddc9e80 R15: +0000000000000004 +[ 822.340033] FS: 00007ff9ed798700(0000) GS:ffff88001fc00000(0000) +knlGS:0000000000000000 +[ 822.340033] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +[ 822.340033] CR2: 00000000000003a3 CR3: 000000001de89000 CR4: +00000000000006f0 +[ 822.340033] Stack: +[ 822.340033] 0000000000000000 0000000100000000 0000000000000000 +0000000000000000 +[ 822.340033] 0000000000000000 0801010a00000000 0000000000000000 +0000000000000000 +[ 822.340033] 0000000000000004 ffffffff8148749b ffffffff8187e0c0 +000000000000001c +[ 822.340033] Call Trace: +[ 822.340033] [] ? mpls_rt_alloc+0x2b/0x3e +[ 822.340033] [] ? mpls_rtm_newroute+0x358/0x3e2 +[ 822.340033] [] ? get_page+0x5/0xa +[ 822.340033] [] ? rtnetlink_rcv_msg+0x17e/0x191 +[ 822.340033] [] ? __kmalloc_track_caller+0x8c/0x9e +[ 822.340033] [] ? +rht_key_hashfn.isra.20.constprop.57+0x14/0x1f +[ 822.340033] [] ? __rtnl_unlock+0xc/0xc +[ 822.340033] [] ? netlink_rcv_skb+0x36/0x82 +[ 822.340033] [] ? rtnetlink_rcv+0x1f/0x28 +[ 822.340033] [] ? netlink_unicast+0x106/0x189 +[ 822.340033] [] ? netlink_sendmsg+0x27f/0x2c8 +[ 822.340033] [] ? sock_sendmsg_nosec+0x10/0x1b +[ 822.340033] [] ? ___sys_sendmsg+0x182/0x1e3 +[ 822.340033] [] ? +__alloc_pages_nodemask+0x11c/0x1e4 +[ 822.340033] [] ? PageAnon+0x5/0xd +[ 822.340033] [] ? __page_set_anon_rmap+0x45/0x52 +[ 822.340033] [] ? get_page+0x5/0xa +[ 822.340033] [] ? __lru_cache_add+0x1a/0x3a +[ 822.340033] [] ? current_kernel_time64+0x9/0x30 +[ 822.340033] [] ? __sys_sendmsg+0x3c/0x5a +[ 822.340033] [] ? +entry_SYSCALL_64_fastpath+0x12/0x6a +[ 822.340033] Code: 83 08 04 00 00 65 ff 00 48 8b 3c 24 e8 40 7c f2 ff +eb 13 48 c7 c3 9f ff ff ff eb 0f 89 ce e8 f1 ae f1 ff 48 89 c3 48 85 db +74 15 <48> 8b 83 08 04 00 00 65 ff 08 48 81 fb 00 f0 ff ff 76 0d eb 07 +[ 822.340033] RIP [] mpls_nh_assign_dev+0x10b/0x182 +[ 822.340033] RSP +[ 822.340033] CR2: 00000000000003a3 +[ 822.435363] ---[ end trace 98cc65e6f6b8bf11 ]--- + +After patch: +$ip -f mpls route add 100 as 200 via inet 10.1.1.8 +RTNETLINK answers: Network is unreachable + +Signed-off-by: Roopa Prabhu +Reported-by: David Miller +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/mpls/af_mpls.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c +index c32fc41..881bc20 100644 +--- a/net/mpls/af_mpls.c ++++ b/net/mpls/af_mpls.c +@@ -518,6 +518,9 @@ static struct net_device *find_outdev(struct net *net, + if (!dev) + return ERR_PTR(-ENODEV); + ++ if (IS_ERR(dev)) ++ return dev; ++ + /* The caller is holding rtnl anyways, so release the dev reference */ + dev_put(dev); + +-- +2.7.1 + + +From 4f04aaea10b8fecfd531d4f74b4469847d5768b1 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 12 Apr 2016 12:27:08 +0200 +Subject: [PATCH 300/384] USB: uas: Limit qdepth at the scsi-host level + +commit 198de51dbc3454d95b015ca0a055b673f85f01bb upstream. + +Commit 64d513ac31bd ("scsi: use host wide tags by default") causes +the SCSI core to queue more commands then we can handle on devices with +multiple LUNs, limit the queue depth at the scsi-host level instead of +per slave to fix this. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1315013 +Signed-off-by: Hans de Goede +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/storage/uas.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c +index ce0cd6e..31872bc 100644 +--- a/drivers/usb/storage/uas.c ++++ b/drivers/usb/storage/uas.c +@@ -800,7 +800,6 @@ static int uas_slave_configure(struct scsi_device *sdev) + if (devinfo->flags & US_FL_BROKEN_FUA) + sdev->broken_fua = 1; + +- scsi_change_queue_depth(sdev, devinfo->qdepth - 2); + return 0; + } + +@@ -932,6 +931,12 @@ static int uas_probe(struct usb_interface *intf, const struct usb_device_id *id) + if (result) + goto set_alt0; + ++ /* ++ * 1 tag is reserved for untagged commands + ++ * 1 tag to avoid off by one errors in some bridge firmwares ++ */ ++ shost->can_queue = devinfo->qdepth - 2; ++ + usb_set_intfdata(intf, shost); + result = scsi_add_host(shost, &intf->dev); + if (result) +-- +2.7.1 + + +From 5f10737115bf964d04336e13a3b46081d5f752c2 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 12 Apr 2016 12:27:09 +0200 +Subject: [PATCH 301/384] USB: uas: Add a new NO_REPORT_LUNS quirk + +commit 1363074667a6b7d0507527742ccd7bbed5e3ceaa upstream. + +Add a new NO_REPORT_LUNS quirk and set it for Seagate drives with +an usb-id of: 0bc2:331a, as these will fail to respond to a +REPORT_LUNS command. + +Reported-and-tested-by: David Webb +Signed-off-by: Hans de Goede +Acked-by: Alan Stern +Signed-off-by: Greg Kroah-Hartman +--- + Documentation/kernel-parameters.txt | 2 ++ + drivers/usb/storage/uas.c | 14 +++++++++++++- + drivers/usb/storage/unusual_uas.h | 7 +++++++ + drivers/usb/storage/usb.c | 5 ++++- + include/linux/usb_usual.h | 2 ++ + 5 files changed, 28 insertions(+), 2 deletions(-) + +diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt +index bcaf28e..26b5f39 100644 +--- a/Documentation/kernel-parameters.txt ++++ b/Documentation/kernel-parameters.txt +@@ -3937,6 +3937,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. + sector if the number is odd); + i = IGNORE_DEVICE (don't bind to this + device); ++ j = NO_REPORT_LUNS (don't use report luns ++ command, uas only); + l = NOT_LOCKABLE (don't try to lock and + unlock ejectable media); + m = MAX_SECTORS_64 (don't transfer more +diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c +index 31872bc..9baf081 100644 +--- a/drivers/usb/storage/uas.c ++++ b/drivers/usb/storage/uas.c +@@ -2,7 +2,7 @@ + * USB Attached SCSI + * Note that this is not the same as the USB Mass Storage driver + * +- * Copyright Hans de Goede for Red Hat, Inc. 2013 - 2014 ++ * Copyright Hans de Goede for Red Hat, Inc. 2013 - 2016 + * Copyright Matthew Wilcox for Intel Corp, 2010 + * Copyright Sarah Sharp for Intel Corp, 2010 + * +@@ -757,6 +757,17 @@ static int uas_eh_bus_reset_handler(struct scsi_cmnd *cmnd) + return SUCCESS; + } + ++static int uas_target_alloc(struct scsi_target *starget) ++{ ++ struct uas_dev_info *devinfo = (struct uas_dev_info *) ++ dev_to_shost(starget->dev.parent)->hostdata; ++ ++ if (devinfo->flags & US_FL_NO_REPORT_LUNS) ++ starget->no_report_luns = 1; ++ ++ return 0; ++} ++ + static int uas_slave_alloc(struct scsi_device *sdev) + { + struct uas_dev_info *devinfo = +@@ -807,6 +818,7 @@ static struct scsi_host_template uas_host_template = { + .module = THIS_MODULE, + .name = "uas", + .queuecommand = uas_queuecommand, ++ .target_alloc = uas_target_alloc, + .slave_alloc = uas_slave_alloc, + .slave_configure = uas_slave_configure, + .eh_abort_handler = uas_eh_abort_handler, +diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h +index ccc113e..53341a7 100644 +--- a/drivers/usb/storage/unusual_uas.h ++++ b/drivers/usb/storage/unusual_uas.h +@@ -64,6 +64,13 @@ UNUSUAL_DEV(0x0bc2, 0x3312, 0x0000, 0x9999, + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_NO_ATA_1X), + ++/* Reported-by: David Webb */ ++UNUSUAL_DEV(0x0bc2, 0x331a, 0x0000, 0x9999, ++ "Seagate", ++ "Expansion Desk", ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL, ++ US_FL_NO_REPORT_LUNS), ++ + /* Reported-by: Hans de Goede */ + UNUSUAL_DEV(0x0bc2, 0x3320, 0x0000, 0x9999, + "Seagate", +diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c +index 43576ed..9de988a 100644 +--- a/drivers/usb/storage/usb.c ++++ b/drivers/usb/storage/usb.c +@@ -482,7 +482,7 @@ void usb_stor_adjust_quirks(struct usb_device *udev, unsigned long *fflags) + US_FL_NO_READ_DISC_INFO | US_FL_NO_READ_CAPACITY_16 | + US_FL_INITIAL_READ10 | US_FL_WRITE_CACHE | + US_FL_NO_ATA_1X | US_FL_NO_REPORT_OPCODES | +- US_FL_MAX_SECTORS_240); ++ US_FL_MAX_SECTORS_240 | US_FL_NO_REPORT_LUNS); + + p = quirks; + while (*p) { +@@ -532,6 +532,9 @@ void usb_stor_adjust_quirks(struct usb_device *udev, unsigned long *fflags) + case 'i': + f |= US_FL_IGNORE_DEVICE; + break; ++ case 'j': ++ f |= US_FL_NO_REPORT_LUNS; ++ break; + case 'l': + f |= US_FL_NOT_LOCKABLE; + break; +diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h +index 7f5f78b..245f57d 100644 +--- a/include/linux/usb_usual.h ++++ b/include/linux/usb_usual.h +@@ -79,6 +79,8 @@ + /* Cannot handle MI_REPORT_SUPPORTED_OPERATION_CODES */ \ + US_FLAG(MAX_SECTORS_240, 0x08000000) \ + /* Sets max_sectors to 240 */ \ ++ US_FLAG(NO_REPORT_LUNS, 0x10000000) \ ++ /* Cannot handle REPORT_LUNS */ \ + + #define US_FLAG(name, value) US_FL_##name = value , + enum { US_DO_ALL_FLAGS }; +-- +2.7.1 + + +From 55fcd45bb4421cbd0090ca243b56d371d28f8a06 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Thu, 7 Jan 2016 11:01:00 +0100 +Subject: [PATCH 302/384] cdc-acm: fix NULL pointer reference + +commit 29c6dd591bbd592472247441de9fa694acdabae8 upstream. + +The union descriptor must be checked. Its usage was conditional +before the parser was introduced. This is important, because +many RNDIS device, which also use the common parser, have +bogus extra descriptors. + +Signed-off-by: Oliver Neukum +Tested-by: Vasily Galkin +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/usb/cdc_ether.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c +index 3da70bf..7cba2c3 100644 +--- a/drivers/net/usb/cdc_ether.c ++++ b/drivers/net/usb/cdc_ether.c +@@ -160,6 +160,12 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) + info->u = header.usb_cdc_union_desc; + info->header = header.usb_cdc_header_desc; + info->ether = header.usb_cdc_ether_desc; ++ if (!info->u) { ++ if (rndis) ++ goto skip; ++ else /* in that case a quirk is mandatory */ ++ goto bad_desc; ++ } + /* we need a master/control interface (what we're + * probed with) and a slave/data interface; union + * descriptors sort this all out. +@@ -256,7 +262,7 @@ skip: + goto bad_desc; + } + +- } else if (!info->header || !info->u || (!rndis && !info->ether)) { ++ } else if (!info->header || (!rndis && !info->ether)) { + dev_dbg(&intf->dev, "missing cdc %s%s%sdescriptor\n", + info->header ? "" : "header ", + info->u ? "" : "union ", +-- +2.7.1 + + +From 96676d6a509acd785f8c8876f046030a7fcf59fc Mon Sep 17 00:00:00 2001 +From: Yuki Shibuya +Date: Thu, 24 Mar 2016 05:17:03 +0000 +Subject: [PATCH 303/384] KVM: x86: Inject pending interrupt even if pending + nmi exist + +commit 321c5658c5e9192dea0d58ab67cf1791e45b2b26 upstream. + +Non maskable interrupts (NMI) are preferred to interrupts in current +implementation. If a NMI is pending and NMI is blocked by the result +of nmi_allowed(), pending interrupt is not injected and +enable_irq_window() is not executed, even if interrupts injection is +allowed. + +In old kernel (e.g. 2.6.32), schedule() is often called in NMI context. +In this case, interrupts are needed to execute iret that intends end +of NMI. The flag of blocking new NMI is not cleared until the guest +execute the iret, and interrupts are blocked by pending NMI. Due to +this, iret can't be invoked in the guest, and the guest is starved +until block is cleared by some events (e.g. canceling injection). + +This patch injects pending interrupts, when it's allowed, even if NMI +is blocked. And, If an interrupts is pending after executing +inject_pending_event(), enable_irq_window() is executed regardless of +NMI pending counter. + +Signed-off-by: Yuki Shibuya +Suggested-by: Paolo Bonzini +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kvm/x86.c | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c +index 7ee7b76..472cf18 100644 +--- a/arch/x86/kvm/x86.c ++++ b/arch/x86/kvm/x86.c +@@ -6031,12 +6031,10 @@ static int inject_pending_event(struct kvm_vcpu *vcpu, bool req_int_win) + } + + /* try to inject new event if pending */ +- if (vcpu->arch.nmi_pending) { +- if (kvm_x86_ops->nmi_allowed(vcpu)) { +- --vcpu->arch.nmi_pending; +- vcpu->arch.nmi_injected = true; +- kvm_x86_ops->set_nmi(vcpu); +- } ++ if (vcpu->arch.nmi_pending && kvm_x86_ops->nmi_allowed(vcpu)) { ++ --vcpu->arch.nmi_pending; ++ vcpu->arch.nmi_injected = true; ++ kvm_x86_ops->set_nmi(vcpu); + } else if (kvm_cpu_has_injectable_intr(vcpu)) { + /* + * Because interrupts can be injected asynchronously, we are +@@ -6481,10 +6479,12 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) + if (inject_pending_event(vcpu, req_int_win) != 0) + req_immediate_exit = true; + /* enable NMI/IRQ window open exits if needed */ +- else if (vcpu->arch.nmi_pending) +- kvm_x86_ops->enable_nmi_window(vcpu); +- else if (kvm_cpu_has_injectable_intr(vcpu) || req_int_win) +- kvm_x86_ops->enable_irq_window(vcpu); ++ else { ++ if (vcpu->arch.nmi_pending) ++ kvm_x86_ops->enable_nmi_window(vcpu); ++ if (kvm_cpu_has_injectable_intr(vcpu) || req_int_win) ++ kvm_x86_ops->enable_irq_window(vcpu); ++ } + + if (kvm_lapic_enabled(vcpu)) { + update_cr8_intercept(vcpu); +-- +2.7.1 + + +From 0e061382173794619623f036b4c08c2d5ecfd5a7 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Tue, 29 Mar 2016 17:56:57 +0200 +Subject: [PATCH 304/384] KVM: x86: reduce default value of halt_poll_ns + parameter + +commit 14ebda3394fd3e5388747e742e510b0802a65d24 upstream. + +Windows lets applications choose the frequency of the timer tick, +and in Windows 10 the maximum rate was changed from 1024 Hz to +2048 Hz. Unfortunately, because of the way the Windows API +works, most applications who need a higher rate than the default +64 Hz will just do + + timeGetDevCaps(&tc, sizeof(tc)); + timeBeginPeriod(tc.wPeriodMin); + +and pick the maximum rate. This causes very high CPU usage when +playing media or games on Windows 10, even if the guest does not +actually use the CPU very much, because the frequent timer tick +causes halt_poll_ns to kick in. + +There is no really good solution, especially because Microsoft +could sooner or later bump the limit to 4096 Hz, but for now +the best we can do is lower a bit the upper limit for +halt_poll_ns. :-( + +Reported-by: Jon Panozzo +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/include/asm/kvm_host.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h +index 30cfd64..9d2abb2 100644 +--- a/arch/x86/include/asm/kvm_host.h ++++ b/arch/x86/include/asm/kvm_host.h +@@ -41,7 +41,7 @@ + + #define KVM_PIO_PAGE_OFFSET 1 + #define KVM_COALESCED_MMIO_PAGE_OFFSET 2 +-#define KVM_HALT_POLL_NS_DEFAULT 500000 ++#define KVM_HALT_POLL_NS_DEFAULT 400000 + + #define KVM_IRQCHIP_NUM_PINS KVM_IOAPIC_NUM_PINS + +-- +2.7.1 + + +From 469e4b66d97eb37be44b9bdd0c9bd3506abdc6c8 Mon Sep 17 00:00:00 2001 +From: Paul Burton +Date: Wed, 3 Feb 2016 03:35:49 +0000 +Subject: [PATCH 305/384] MIPS: Fix MSA ld unaligned failure cases + +commit fa8ff601d72bad3078ddf5ef17a5547700d06908 upstream. + +Copying the content of an MSA vector from user memory may involve TLB +faults & mapping in pages. This will fail when preemption is disabled +due to an inability to acquire mmap_sem from do_page_fault, which meant +such vector loads to unmapped pages would always fail to be emulated. +Fix this by disabling preemption later only around the updating of +vector register state. + +This change does however introduce a race between performing the load +into thread context & the thread being preempted, saving its current +live context & clobbering the loaded value. This should be a rare +occureence, so optimise for the fast path by simply repeating the load if +we are preempted. + +Additionally if the copy failed then the failure path was taken with +preemption left disabled, leading to the kernel typically encountering +further issues around sleeping whilst atomic. The change to where +preemption is disabled avoids this issue. + +Fixes: e4aa1f153add "MIPS: MSA unaligned memory access support" +Reported-by: James Hogan +Signed-off-by: Paul Burton +Reviewed-by: James Hogan +Cc: Leonid Yegoshin +Cc: Maciej W. Rozycki +Cc: James Cowgill +Cc: Markos Chandras +Cc: linux-mips@linux-mips.org +Cc: linux-kernel@vger.kernel.org +Patchwork: https://patchwork.linux-mips.org/patch/12345/ +Signed-off-by: Ralf Baechle +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/kernel/unaligned.c | 51 ++++++++++++++++++++++++++------------------ + 1 file changed, 30 insertions(+), 21 deletions(-) + +diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c +index 490cea5..5c62065 100644 +--- a/arch/mips/kernel/unaligned.c ++++ b/arch/mips/kernel/unaligned.c +@@ -885,7 +885,7 @@ static void emulate_load_store_insn(struct pt_regs *regs, + { + union mips_instruction insn; + unsigned long value; +- unsigned int res; ++ unsigned int res, preempted; + unsigned long origpc; + unsigned long orig31; + void __user *fault_addr = NULL; +@@ -1226,27 +1226,36 @@ static void emulate_load_store_insn(struct pt_regs *regs, + if (!access_ok(VERIFY_READ, addr, sizeof(*fpr))) + goto sigbus; + +- /* +- * Disable preemption to avoid a race between copying +- * state from userland, migrating to another CPU and +- * updating the hardware vector register below. +- */ +- preempt_disable(); +- +- res = __copy_from_user_inatomic(fpr, addr, +- sizeof(*fpr)); +- if (res) +- goto fault; +- +- /* +- * Update the hardware register if it is in use by the +- * task in this quantum, in order to avoid having to +- * save & restore the whole vector context. +- */ +- if (test_thread_flag(TIF_USEDMSA)) +- write_msa_wr(wd, fpr, df); ++ do { ++ /* ++ * If we have live MSA context keep track of ++ * whether we get preempted in order to avoid ++ * the register context we load being clobbered ++ * by the live context as it's saved during ++ * preemption. If we don't have live context ++ * then it can't be saved to clobber the value ++ * we load. ++ */ ++ preempted = test_thread_flag(TIF_USEDMSA); ++ ++ res = __copy_from_user_inatomic(fpr, addr, ++ sizeof(*fpr)); ++ if (res) ++ goto fault; + +- preempt_enable(); ++ /* ++ * Update the hardware register if it is in use ++ * by the task in this quantum, in order to ++ * avoid having to save & restore the whole ++ * vector context. ++ */ ++ preempt_disable(); ++ if (test_thread_flag(TIF_USEDMSA)) { ++ write_msa_wr(wd, fpr, df); ++ preempted = 0; ++ } ++ preempt_enable(); ++ } while (preempted); + break; + + case msa_st_op: +-- +2.7.1 + + +From 9dbe5076f934b9292fa9f506e6fc111120ea6ed5 Mon Sep 17 00:00:00 2001 +From: Govindraj Raja +Date: Fri, 4 Mar 2016 15:28:22 +0000 +Subject: [PATCH 306/384] pinctrl: pistachio: fix mfio84-89 function + description and pinmux. + +commit e9adb336d0bf391be23e820975ca5cd12c31d781 upstream. + +mfio 84 to 89 are described wrongly, fix it to describe +the right pin and add them to right pin-mux group. + +The correct order is: + pll1_lock => mips_pll -- MFIO_83 + pll2_lock => audio_pll -- MFIO_84 + pll3_lock => rpu_v_pll -- MFIO_85 + pll4_lock => rpu_l_pll -- MFIO_86 + pll5_lock => sys_pll -- MFIO_87 + pll6_lock => wifi_pll -- MFIO_88 + pll7_lock => bt_pll -- MFIO_89 + +Cc: linux-gpio@vger.kernel.org +Cc: devicetree@vger.kernel.org +Cc: linux-mips@linux-mips.org +Cc: James Hartley +Fixes: cefc03e5995e("pinctrl: Add Pistachio SoC pin control driver") +Signed-off-by: Govindraj Raja +Acked-by: Andrew Bresticker +Acked-by: Rob Herring +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman +--- + .../bindings/pinctrl/img,pistachio-pinctrl.txt | 12 +++++------ + drivers/pinctrl/pinctrl-pistachio.c | 24 +++++++++++----------- + 2 files changed, 18 insertions(+), 18 deletions(-) + +diff --git a/Documentation/devicetree/bindings/pinctrl/img,pistachio-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/img,pistachio-pinctrl.txt +index 08a4a32..0326154 100644 +--- a/Documentation/devicetree/bindings/pinctrl/img,pistachio-pinctrl.txt ++++ b/Documentation/devicetree/bindings/pinctrl/img,pistachio-pinctrl.txt +@@ -134,12 +134,12 @@ mfio80 ddr_debug, mips_trace_data, mips_debug + mfio81 dreq0, mips_trace_data, eth_debug + mfio82 dreq1, mips_trace_data, eth_debug + mfio83 mips_pll_lock, mips_trace_data, usb_debug +-mfio84 sys_pll_lock, mips_trace_data, usb_debug +-mfio85 wifi_pll_lock, mips_trace_data, sdhost_debug +-mfio86 bt_pll_lock, mips_trace_data, sdhost_debug +-mfio87 rpu_v_pll_lock, dreq2, socif_debug +-mfio88 rpu_l_pll_lock, dreq3, socif_debug +-mfio89 audio_pll_lock, dreq4, dreq5 ++mfio84 audio_pll_lock, mips_trace_data, usb_debug ++mfio85 rpu_v_pll_lock, mips_trace_data, sdhost_debug ++mfio86 rpu_l_pll_lock, mips_trace_data, sdhost_debug ++mfio87 sys_pll_lock, dreq2, socif_debug ++mfio88 wifi_pll_lock, dreq3, socif_debug ++mfio89 bt_pll_lock, dreq4, dreq5 + tck + trstn + tdi +diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c +index 85c9046..6b1a47f 100644 +--- a/drivers/pinctrl/pinctrl-pistachio.c ++++ b/drivers/pinctrl/pinctrl-pistachio.c +@@ -469,27 +469,27 @@ static const char * const pistachio_mips_pll_lock_groups[] = { + "mfio83", + }; + +-static const char * const pistachio_sys_pll_lock_groups[] = { ++static const char * const pistachio_audio_pll_lock_groups[] = { + "mfio84", + }; + +-static const char * const pistachio_wifi_pll_lock_groups[] = { ++static const char * const pistachio_rpu_v_pll_lock_groups[] = { + "mfio85", + }; + +-static const char * const pistachio_bt_pll_lock_groups[] = { ++static const char * const pistachio_rpu_l_pll_lock_groups[] = { + "mfio86", + }; + +-static const char * const pistachio_rpu_v_pll_lock_groups[] = { ++static const char * const pistachio_sys_pll_lock_groups[] = { + "mfio87", + }; + +-static const char * const pistachio_rpu_l_pll_lock_groups[] = { ++static const char * const pistachio_wifi_pll_lock_groups[] = { + "mfio88", + }; + +-static const char * const pistachio_audio_pll_lock_groups[] = { ++static const char * const pistachio_bt_pll_lock_groups[] = { + "mfio89", + }; + +@@ -559,12 +559,12 @@ enum pistachio_mux_option { + PISTACHIO_FUNCTION_DREQ4, + PISTACHIO_FUNCTION_DREQ5, + PISTACHIO_FUNCTION_MIPS_PLL_LOCK, ++ PISTACHIO_FUNCTION_AUDIO_PLL_LOCK, ++ PISTACHIO_FUNCTION_RPU_V_PLL_LOCK, ++ PISTACHIO_FUNCTION_RPU_L_PLL_LOCK, + PISTACHIO_FUNCTION_SYS_PLL_LOCK, + PISTACHIO_FUNCTION_WIFI_PLL_LOCK, + PISTACHIO_FUNCTION_BT_PLL_LOCK, +- PISTACHIO_FUNCTION_RPU_V_PLL_LOCK, +- PISTACHIO_FUNCTION_RPU_L_PLL_LOCK, +- PISTACHIO_FUNCTION_AUDIO_PLL_LOCK, + PISTACHIO_FUNCTION_DEBUG_RAW_CCA_IND, + PISTACHIO_FUNCTION_DEBUG_ED_SEC20_CCA_IND, + PISTACHIO_FUNCTION_DEBUG_ED_SEC40_CCA_IND, +@@ -620,12 +620,12 @@ static const struct pistachio_function pistachio_functions[] = { + FUNCTION(dreq4), + FUNCTION(dreq5), + FUNCTION(mips_pll_lock), ++ FUNCTION(audio_pll_lock), ++ FUNCTION(rpu_v_pll_lock), ++ FUNCTION(rpu_l_pll_lock), + FUNCTION(sys_pll_lock), + FUNCTION(wifi_pll_lock), + FUNCTION(bt_pll_lock), +- FUNCTION(rpu_v_pll_lock), +- FUNCTION(rpu_l_pll_lock), +- FUNCTION(audio_pll_lock), + FUNCTION(debug_raw_cca_ind), + FUNCTION(debug_ed_sec20_cca_ind), + FUNCTION(debug_ed_sec40_cca_ind), +-- +2.7.1 + + +From f305630cb08b3948ec7c6aae8e9f52af79bff725 Mon Sep 17 00:00:00 2001 +From: Wolfram Sang +Date: Mon, 7 Mar 2016 19:40:57 +0100 +Subject: [PATCH 307/384] pinctrl: sh-pfc: only use dummy states for non-DT + platforms + +commit 0129801be4b87226bf502f18f5a9eabd356d1058 upstream. + +If pinctrl_provide_dummies() is used unconditionally, then the dummy +state will be used even on DT platforms when the "init" state was +intentionally left out. Instead of "default", the dummy "init" state +will then be used during probe. Thus, when probing an I2C controller on +cold boot, communication triggered by bus notifiers broke because the +pins were not initialized. + +Do it like OMAP2: use the dummy state only for non-DT platforms. + +Fixes: ef0eebc05130 ("drivers/pinctrl: Add the concept of an "init" state") +Reported-by: Geert Uytterhoeven +Signed-off-by: Wolfram Sang +Acked-by: Sergei Shtylyov +Tested-by: Geert Uytterhoeven +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman +--- + drivers/pinctrl/sh-pfc/core.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/pinctrl/sh-pfc/core.c b/drivers/pinctrl/sh-pfc/core.c +index 181ea98..2b0d702 100644 +--- a/drivers/pinctrl/sh-pfc/core.c ++++ b/drivers/pinctrl/sh-pfc/core.c +@@ -545,7 +545,9 @@ static int sh_pfc_probe(struct platform_device *pdev) + return ret; + } + +- pinctrl_provide_dummies(); ++ /* Enable dummy states for those platforms without pinctrl support */ ++ if (!of_have_populated_dt()) ++ pinctrl_provide_dummies(); + + ret = sh_pfc_init_ranges(pfc); + if (ret < 0) +-- +2.7.1 + + +From 18eaadfb0dd67ea88fa33f69ca76ce0127b72e1b Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sat, 12 Mar 2016 19:44:57 +0100 +Subject: [PATCH 308/384] pinctrl: sunxi: Fix A33 external interrupts not + working + +commit 5e7515ba78fff2f5407eaa2f97c1d5c07801ac3d upstream. + +pinctrl-sun8i-a33.c (and the dts) declare only 2 interrupt banks, +where as the closely related a23 has 3 banks. This matches with the +datasheet for the A33 where only interrupt banks B and G are specified +where as the A23 has banks A, B and G. + +However the A33 being the A23 derative it is means that the interrupt +configure/status io-addresses for the 2 banks it has are not changed +from the A23, iow they have the same address as if bank A was still +present. Where as the sunxi pinctrl currently tries to use the A23 bank +A addresses for bank B, since the pinctrl code does not know about the +removed bank A. + +Add a irq_bank_base parameter and use this where appropriate to take +the missing bank A into account. + +This fixes external interrupts not working on the A33 (tested with +an i2c touchscreen controller which uses an external interrupt). + +Signed-off-by: Hans de Goede +Acked-by: Maxime Ripard +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman +--- + drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c | 1 + + drivers/pinctrl/sunxi/pinctrl-sunxi.c | 17 ++++++++++------- + drivers/pinctrl/sunxi/pinctrl-sunxi.h | 21 +++++++++++---------- + 3 files changed, 22 insertions(+), 17 deletions(-) + +diff --git a/drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c b/drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c +index 00265f0..8b381d6 100644 +--- a/drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c ++++ b/drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c +@@ -485,6 +485,7 @@ static const struct sunxi_pinctrl_desc sun8i_a33_pinctrl_data = { + .pins = sun8i_a33_pins, + .npins = ARRAY_SIZE(sun8i_a33_pins), + .irq_banks = 2, ++ .irq_bank_base = 1, + }; + + static int sun8i_a33_pinctrl_probe(struct platform_device *pdev) +diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c +index dead97d..a4a5b50 100644 +--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c ++++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c +@@ -578,7 +578,7 @@ static void sunxi_pinctrl_irq_release_resources(struct irq_data *d) + static int sunxi_pinctrl_irq_set_type(struct irq_data *d, unsigned int type) + { + struct sunxi_pinctrl *pctl = irq_data_get_irq_chip_data(d); +- u32 reg = sunxi_irq_cfg_reg(d->hwirq); ++ u32 reg = sunxi_irq_cfg_reg(d->hwirq, pctl->desc->irq_bank_base); + u8 index = sunxi_irq_cfg_offset(d->hwirq); + unsigned long flags; + u32 regval; +@@ -625,7 +625,8 @@ static int sunxi_pinctrl_irq_set_type(struct irq_data *d, unsigned int type) + static void sunxi_pinctrl_irq_ack(struct irq_data *d) + { + struct sunxi_pinctrl *pctl = irq_data_get_irq_chip_data(d); +- u32 status_reg = sunxi_irq_status_reg(d->hwirq); ++ u32 status_reg = sunxi_irq_status_reg(d->hwirq, ++ pctl->desc->irq_bank_base); + u8 status_idx = sunxi_irq_status_offset(d->hwirq); + + /* Clear the IRQ */ +@@ -635,7 +636,7 @@ static void sunxi_pinctrl_irq_ack(struct irq_data *d) + static void sunxi_pinctrl_irq_mask(struct irq_data *d) + { + struct sunxi_pinctrl *pctl = irq_data_get_irq_chip_data(d); +- u32 reg = sunxi_irq_ctrl_reg(d->hwirq); ++ u32 reg = sunxi_irq_ctrl_reg(d->hwirq, pctl->desc->irq_bank_base); + u8 idx = sunxi_irq_ctrl_offset(d->hwirq); + unsigned long flags; + u32 val; +@@ -652,7 +653,7 @@ static void sunxi_pinctrl_irq_mask(struct irq_data *d) + static void sunxi_pinctrl_irq_unmask(struct irq_data *d) + { + struct sunxi_pinctrl *pctl = irq_data_get_irq_chip_data(d); +- u32 reg = sunxi_irq_ctrl_reg(d->hwirq); ++ u32 reg = sunxi_irq_ctrl_reg(d->hwirq, pctl->desc->irq_bank_base); + u8 idx = sunxi_irq_ctrl_offset(d->hwirq); + unsigned long flags; + u32 val; +@@ -744,7 +745,7 @@ static void sunxi_pinctrl_irq_handler(struct irq_desc *desc) + if (bank == pctl->desc->irq_banks) + return; + +- reg = sunxi_irq_status_reg_from_bank(bank); ++ reg = sunxi_irq_status_reg_from_bank(bank, pctl->desc->irq_bank_base); + val = readl(pctl->membase + reg); + + if (val) { +@@ -1023,9 +1024,11 @@ int sunxi_pinctrl_init(struct platform_device *pdev, + + for (i = 0; i < pctl->desc->irq_banks; i++) { + /* Mask and clear all IRQs before registering a handler */ +- writel(0, pctl->membase + sunxi_irq_ctrl_reg_from_bank(i)); ++ writel(0, pctl->membase + sunxi_irq_ctrl_reg_from_bank(i, ++ pctl->desc->irq_bank_base)); + writel(0xffffffff, +- pctl->membase + sunxi_irq_status_reg_from_bank(i)); ++ pctl->membase + sunxi_irq_status_reg_from_bank(i, ++ pctl->desc->irq_bank_base)); + + irq_set_chained_handler_and_data(pctl->irq[i], + sunxi_pinctrl_irq_handler, +diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.h b/drivers/pinctrl/sunxi/pinctrl-sunxi.h +index e248e81..0afce1a 100644 +--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.h ++++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.h +@@ -97,6 +97,7 @@ struct sunxi_pinctrl_desc { + int npins; + unsigned pin_base; + unsigned irq_banks; ++ unsigned irq_bank_base; + bool irq_read_needs_mux; + }; + +@@ -233,12 +234,12 @@ static inline u32 sunxi_pull_offset(u16 pin) + return pin_num * PULL_PINS_BITS; + } + +-static inline u32 sunxi_irq_cfg_reg(u16 irq) ++static inline u32 sunxi_irq_cfg_reg(u16 irq, unsigned bank_base) + { + u8 bank = irq / IRQ_PER_BANK; + u8 reg = (irq % IRQ_PER_BANK) / IRQ_CFG_IRQ_PER_REG * 0x04; + +- return IRQ_CFG_REG + bank * IRQ_MEM_SIZE + reg; ++ return IRQ_CFG_REG + (bank_base + bank) * IRQ_MEM_SIZE + reg; + } + + static inline u32 sunxi_irq_cfg_offset(u16 irq) +@@ -247,16 +248,16 @@ static inline u32 sunxi_irq_cfg_offset(u16 irq) + return irq_num * IRQ_CFG_IRQ_BITS; + } + +-static inline u32 sunxi_irq_ctrl_reg_from_bank(u8 bank) ++static inline u32 sunxi_irq_ctrl_reg_from_bank(u8 bank, unsigned bank_base) + { +- return IRQ_CTRL_REG + bank * IRQ_MEM_SIZE; ++ return IRQ_CTRL_REG + (bank_base + bank) * IRQ_MEM_SIZE; + } + +-static inline u32 sunxi_irq_ctrl_reg(u16 irq) ++static inline u32 sunxi_irq_ctrl_reg(u16 irq, unsigned bank_base) + { + u8 bank = irq / IRQ_PER_BANK; + +- return sunxi_irq_ctrl_reg_from_bank(bank); ++ return sunxi_irq_ctrl_reg_from_bank(bank, bank_base); + } + + static inline u32 sunxi_irq_ctrl_offset(u16 irq) +@@ -265,16 +266,16 @@ static inline u32 sunxi_irq_ctrl_offset(u16 irq) + return irq_num * IRQ_CTRL_IRQ_BITS; + } + +-static inline u32 sunxi_irq_status_reg_from_bank(u8 bank) ++static inline u32 sunxi_irq_status_reg_from_bank(u8 bank, unsigned bank_base) + { +- return IRQ_STATUS_REG + bank * IRQ_MEM_SIZE; ++ return IRQ_STATUS_REG + (bank_base + bank) * IRQ_MEM_SIZE; + } + +-static inline u32 sunxi_irq_status_reg(u16 irq) ++static inline u32 sunxi_irq_status_reg(u16 irq, unsigned bank_base) + { + u8 bank = irq / IRQ_PER_BANK; + +- return sunxi_irq_status_reg_from_bank(bank); ++ return sunxi_irq_status_reg_from_bank(bank, bank_base); + } + + static inline u32 sunxi_irq_status_offset(u16 irq) +-- +2.7.1 + + +From 68435dcd3c32ef585c37817274527e33031e0407 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Thu, 24 Mar 2016 13:15:45 +0100 +Subject: [PATCH 309/384] pinctrl: nomadik: fix pull debug print inversion + +commit 6ee334559324a55725e22463de633b99ad99fcad upstream. + +Pull up was reported as pull down and vice versa. Fix this. + +Fixes: 8f1774a2a971 "pinctrl: nomadik: improve GPIO debug prints" +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman +--- + drivers/pinctrl/nomadik/pinctrl-nomadik.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c +index eebfae0..f844b4a 100644 +--- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c ++++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c +@@ -995,7 +995,7 @@ static void nmk_gpio_dbg_show_one(struct seq_file *s, + int val; + + if (pull) +- pullidx = data_out ? 1 : 2; ++ pullidx = data_out ? 2 : 1; + + seq_printf(s, " gpio-%-3d (%-20.20s) in %s %s", + gpio, +-- +2.7.1 + + +From 789eb67c16efed4787f951bfa120030d97ef0dcd Mon Sep 17 00:00:00 2001 +From: Vladimir Zapolskiy +Date: Wed, 9 Mar 2016 02:45:36 +0200 +Subject: [PATCH 310/384] pinctrl: freescale: imx: fix bogus check of + of_iomap() return value + +commit 9a4f424531dabd877259ae0071b8bcc4dede9eb5 upstream. + +On error path of_iomap() returns NULL, hence IS_ERR() check is invalid +and may cause a NULL pointer dereference, the change fixes this +problem. + +While we are here invert a device node check to simplify the code. + +Fixes: 26d8cde5260b ("pinctrl: freescale: imx: add shared input select reg support") +Signed-off-by: Vladimir Zapolskiy +Acked-by: Shawn Guo +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman +--- + drivers/pinctrl/freescale/pinctrl-imx.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c +index a5bb939..1029aa7 100644 +--- a/drivers/pinctrl/freescale/pinctrl-imx.c ++++ b/drivers/pinctrl/freescale/pinctrl-imx.c +@@ -726,19 +726,18 @@ int imx_pinctrl_probe(struct platform_device *pdev, + + if (of_property_read_bool(dev_np, "fsl,input-sel")) { + np = of_parse_phandle(dev_np, "fsl,input-sel", 0); +- if (np) { +- ipctl->input_sel_base = of_iomap(np, 0); +- if (IS_ERR(ipctl->input_sel_base)) { +- of_node_put(np); +- dev_err(&pdev->dev, +- "iomuxc input select base address not found\n"); +- return PTR_ERR(ipctl->input_sel_base); +- } +- } else { ++ if (!np) { + dev_err(&pdev->dev, "iomuxc fsl,input-sel property not found\n"); + return -EINVAL; + } ++ ++ ipctl->input_sel_base = of_iomap(np, 0); + of_node_put(np); ++ if (!ipctl->input_sel_base) { ++ dev_err(&pdev->dev, ++ "iomuxc input select base address not found\n"); ++ return -ENOMEM; ++ } + } + + imx_pinctrl_desc.name = dev_name(&pdev->dev); +-- +2.7.1 + + +From dcdcaa06615f46a6ef9ccf2ef082749c20199ab8 Mon Sep 17 00:00:00 2001 +From: Shuah Khan +Date: Tue, 22 Mar 2016 01:04:05 -0300 +Subject: [PATCH 311/384] au0828: fix au0828_v4l2_close() dev_state race + condition + +commit ed940cd27416f9887864b95e1f8f8845aa9d6391 upstream. + +au0828_v4l2_close() check for dev_state == DEV_DISCONNECTED will fail to +detect the device disconnected state correctly, if au0828_v4l2_open() runs +to set the DEV_INITIALIZED bit. A loop test of bind/unbind found this bug +by increasing the likelihood of au0828_v4l2_open() occurring while unbind +is in progress. When au0828_v4l2_close() fails to detect that the device +is in disconnect state, it attempts to power down the device and fails with +the following general protection fault: + +[ 260.992962] Call Trace: +[ 260.993008] [] ? xc5000_sleep+0x8f/0xd0 [xc5000] +[ 260.993095] [] ? fe_standby+0x3c/0x50 [tuner] +[ 260.993186] [] au0828_v4l2_close+0x53c/0x620 [au0828] +[ 260.993298] [] v4l2_release+0xf0/0x210 [videodev] +[ 260.993382] [] __fput+0x1fc/0x6c0 +[ 260.993449] [] ____fput+0xe/0x10 +[ 260.993519] [] task_work_run+0x133/0x1f0 +[ 260.993602] [] exit_to_usermode_loop+0x140/0x170 +[ 260.993681] [] syscall_return_slowpath+0x16a/0x1a0 +[ 260.993754] [] entry_SYSCALL_64_fastpath+0xa6/0xa8 + +Signed-off-by: Shuah Khan +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/usb/au0828/au0828-video.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c +index 45c622e..36fde46 100644 +--- a/drivers/media/usb/au0828/au0828-video.c ++++ b/drivers/media/usb/au0828/au0828-video.c +@@ -1007,7 +1007,7 @@ static int au0828_v4l2_close(struct file *filp) + del_timer_sync(&dev->vbi_timeout); + } + +- if (dev->dev_state == DEV_DISCONNECTED) ++ if (dev->dev_state & DEV_DISCONNECTED) + goto end; + + if (dev->users == 1) { +-- +2.7.1 + + +From d8fc5c1236c05fddc17f015280be847140b4155f Mon Sep 17 00:00:00 2001 +From: Mauro Carvalho Chehab +Date: Tue, 22 Mar 2016 09:21:57 -0300 +Subject: [PATCH 312/384] au0828: Fix dev_state handling + +commit e8e3039f5b941f7825d335f8ca11c12a8104db11 upstream. + +The au0828 dev_state is actually a bit mask. It should not be +checking with "==" but, instead, with a logic and. There are some +places where it was doing it wrong. + +Fix that by replacing the dev_state set/clear/test with the +bitops. + +As reviewed by Shuah: + "Looks good. Tested running bind/unbind au0828 loop for 1000 times. + Didn't see any problems and the v4l2_querycap() problem has been + fixed with this patch. + + After the above test, ran bind/unbind snd_usb_audio 1000 times. + Didn't see any problems. Generated media graph and the graph + looks good." + +Reviewed-by: Shuah Khan +Tested-by: Shuah Khan +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/usb/au0828/au0828-core.c | 2 +- + drivers/media/usb/au0828/au0828-input.c | 4 +-- + drivers/media/usb/au0828/au0828-video.c | 63 ++++++++++++++++----------------- + drivers/media/usb/au0828/au0828.h | 9 ++--- + 4 files changed, 39 insertions(+), 39 deletions(-) + +diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c +index 0934024..d91ded7 100644 +--- a/drivers/media/usb/au0828/au0828-core.c ++++ b/drivers/media/usb/au0828/au0828-core.c +@@ -159,7 +159,7 @@ static void au0828_usb_disconnect(struct usb_interface *interface) + Set the status so poll routines can check and avoid + access after disconnect. + */ +- dev->dev_state = DEV_DISCONNECTED; ++ set_bit(DEV_DISCONNECTED, &dev->dev_state); + + au0828_rc_unregister(dev); + /* Digital TV */ +diff --git a/drivers/media/usb/au0828/au0828-input.c b/drivers/media/usb/au0828/au0828-input.c +index b0f0679..3d6687f 100644 +--- a/drivers/media/usb/au0828/au0828-input.c ++++ b/drivers/media/usb/au0828/au0828-input.c +@@ -130,7 +130,7 @@ static int au0828_get_key_au8522(struct au0828_rc *ir) + bool first = true; + + /* do nothing if device is disconnected */ +- if (ir->dev->dev_state == DEV_DISCONNECTED) ++ if (test_bit(DEV_DISCONNECTED, &ir->dev->dev_state)) + return 0; + + /* Check IR int */ +@@ -260,7 +260,7 @@ static void au0828_rc_stop(struct rc_dev *rc) + cancel_delayed_work_sync(&ir->work); + + /* do nothing if device is disconnected */ +- if (ir->dev->dev_state != DEV_DISCONNECTED) { ++ if (!test_bit(DEV_DISCONNECTED, &ir->dev->dev_state)) { + /* Disable IR */ + au8522_rc_clear(ir, 0xe0, 1 << 4); + } +diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c +index 36fde46..7b2fe1b 100644 +--- a/drivers/media/usb/au0828/au0828-video.c ++++ b/drivers/media/usb/au0828/au0828-video.c +@@ -104,14 +104,13 @@ static inline void print_err_status(struct au0828_dev *dev, + + static int check_dev(struct au0828_dev *dev) + { +- if (dev->dev_state & DEV_DISCONNECTED) { ++ if (test_bit(DEV_DISCONNECTED, &dev->dev_state)) { + pr_info("v4l2 ioctl: device not present\n"); + return -ENODEV; + } + +- if (dev->dev_state & DEV_MISCONFIGURED) { +- pr_info("v4l2 ioctl: device is misconfigured; " +- "close and open it again\n"); ++ if (test_bit(DEV_MISCONFIGURED, &dev->dev_state)) { ++ pr_info("v4l2 ioctl: device is misconfigured; close and open it again\n"); + return -EIO; + } + return 0; +@@ -519,8 +518,8 @@ static inline int au0828_isoc_copy(struct au0828_dev *dev, struct urb *urb) + if (!dev) + return 0; + +- if ((dev->dev_state & DEV_DISCONNECTED) || +- (dev->dev_state & DEV_MISCONFIGURED)) ++ if (test_bit(DEV_DISCONNECTED, &dev->dev_state) || ++ test_bit(DEV_MISCONFIGURED, &dev->dev_state)) + return 0; + + if (urb->status < 0) { +@@ -766,10 +765,10 @@ static int au0828_stream_interrupt(struct au0828_dev *dev) + int ret = 0; + + dev->stream_state = STREAM_INTERRUPT; +- if (dev->dev_state == DEV_DISCONNECTED) ++ if (test_bit(DEV_DISCONNECTED, &dev->dev_state)) + return -ENODEV; + else if (ret) { +- dev->dev_state = DEV_MISCONFIGURED; ++ set_bit(DEV_MISCONFIGURED, &dev->dev_state); + dprintk(1, "%s device is misconfigured!\n", __func__); + return ret; + } +@@ -958,7 +957,7 @@ static int au0828_v4l2_open(struct file *filp) + int ret; + + dprintk(1, +- "%s called std_set %d dev_state %d stream users %d users %d\n", ++ "%s called std_set %d dev_state %ld stream users %d users %d\n", + __func__, dev->std_set_in_tuner_core, dev->dev_state, + dev->streaming_users, dev->users); + +@@ -977,7 +976,7 @@ static int au0828_v4l2_open(struct file *filp) + au0828_analog_stream_enable(dev); + au0828_analog_stream_reset(dev); + dev->stream_state = STREAM_OFF; +- dev->dev_state |= DEV_INITIALIZED; ++ set_bit(DEV_INITIALIZED, &dev->dev_state); + } + dev->users++; + mutex_unlock(&dev->lock); +@@ -991,7 +990,7 @@ static int au0828_v4l2_close(struct file *filp) + struct video_device *vdev = video_devdata(filp); + + dprintk(1, +- "%s called std_set %d dev_state %d stream users %d users %d\n", ++ "%s called std_set %d dev_state %ld stream users %d users %d\n", + __func__, dev->std_set_in_tuner_core, dev->dev_state, + dev->streaming_users, dev->users); + +@@ -1007,7 +1006,7 @@ static int au0828_v4l2_close(struct file *filp) + del_timer_sync(&dev->vbi_timeout); + } + +- if (dev->dev_state & DEV_DISCONNECTED) ++ if (test_bit(DEV_DISCONNECTED, &dev->dev_state)) + goto end; + + if (dev->users == 1) { +@@ -1036,7 +1035,7 @@ static void au0828_init_tuner(struct au0828_dev *dev) + .type = V4L2_TUNER_ANALOG_TV, + }; + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + if (dev->std_set_in_tuner_core) +@@ -1108,7 +1107,7 @@ static int vidioc_querycap(struct file *file, void *priv, + struct video_device *vdev = video_devdata(file); + struct au0828_dev *dev = video_drvdata(file); + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + strlcpy(cap->driver, "au0828", sizeof(cap->driver)); +@@ -1151,7 +1150,7 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *priv, + { + struct au0828_dev *dev = video_drvdata(file); + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + f->fmt.pix.width = dev->width; +@@ -1170,7 +1169,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, + { + struct au0828_dev *dev = video_drvdata(file); + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + return au0828_set_format(dev, VIDIOC_TRY_FMT, f); +@@ -1182,7 +1181,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, + struct au0828_dev *dev = video_drvdata(file); + int rc; + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + rc = check_dev(dev); +@@ -1204,7 +1203,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm) + { + struct au0828_dev *dev = video_drvdata(file); + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + if (norm == dev->std) +@@ -1236,7 +1235,7 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *norm) + { + struct au0828_dev *dev = video_drvdata(file); + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + *norm = dev->std; +@@ -1259,7 +1258,7 @@ static int vidioc_enum_input(struct file *file, void *priv, + [AU0828_VMUX_DEBUG] = "tv debug" + }; + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + tmp = input->index; +@@ -1289,7 +1288,7 @@ static int vidioc_g_input(struct file *file, void *priv, unsigned int *i) + { + struct au0828_dev *dev = video_drvdata(file); + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + *i = dev->ctrl_input; +@@ -1300,7 +1299,7 @@ static void au0828_s_input(struct au0828_dev *dev, int index) + { + int i; + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + switch (AUVI_INPUT(index).type) { +@@ -1385,7 +1384,7 @@ static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a) + { + struct au0828_dev *dev = video_drvdata(file); + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + a->index = dev->ctrl_ainput; +@@ -1405,7 +1404,7 @@ static int vidioc_s_audio(struct file *file, void *priv, const struct v4l2_audio + if (a->index != dev->ctrl_ainput) + return -EINVAL; + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + return 0; + } +@@ -1417,7 +1416,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t) + if (t->index != 0) + return -EINVAL; + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + strcpy(t->name, "Auvitek tuner"); +@@ -1437,7 +1436,7 @@ static int vidioc_s_tuner(struct file *file, void *priv, + if (t->index != 0) + return -EINVAL; + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + au0828_init_tuner(dev); +@@ -1459,7 +1458,7 @@ static int vidioc_g_frequency(struct file *file, void *priv, + + if (freq->tuner != 0) + return -EINVAL; +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + freq->frequency = dev->ctrl_freq; + return 0; +@@ -1474,7 +1473,7 @@ static int vidioc_s_frequency(struct file *file, void *priv, + if (freq->tuner != 0) + return -EINVAL; + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + au0828_init_tuner(dev); +@@ -1500,7 +1499,7 @@ static int vidioc_g_fmt_vbi_cap(struct file *file, void *priv, + { + struct au0828_dev *dev = video_drvdata(file); + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + format->fmt.vbi.samples_per_line = dev->vbi_width; +@@ -1526,7 +1525,7 @@ static int vidioc_cropcap(struct file *file, void *priv, + if (cc->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) + return -EINVAL; + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + cc->bounds.left = 0; +@@ -1548,7 +1547,7 @@ static int vidioc_g_register(struct file *file, void *priv, + { + struct au0828_dev *dev = video_drvdata(file); + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + reg->val = au0828_read(dev, reg->reg); +@@ -1561,7 +1560,7 @@ static int vidioc_s_register(struct file *file, void *priv, + { + struct au0828_dev *dev = video_drvdata(file); + +- dprintk(1, "%s called std_set %d dev_state %d\n", __func__, ++ dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, + dev->std_set_in_tuner_core, dev->dev_state); + + return au0828_writereg(dev, reg->reg, reg->val); +diff --git a/drivers/media/usb/au0828/au0828.h b/drivers/media/usb/au0828/au0828.h +index 60b5939..d1b6405a 100644 +--- a/drivers/media/usb/au0828/au0828.h ++++ b/drivers/media/usb/au0828/au0828.h +@@ -21,6 +21,7 @@ + + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +@@ -122,9 +123,9 @@ enum au0828_stream_state { + + /* device state */ + enum au0828_dev_state { +- DEV_INITIALIZED = 0x01, +- DEV_DISCONNECTED = 0x02, +- DEV_MISCONFIGURED = 0x04 ++ DEV_INITIALIZED = 0, ++ DEV_DISCONNECTED = 1, ++ DEV_MISCONFIGURED = 2 + }; + + struct au0828_dev; +@@ -248,7 +249,7 @@ struct au0828_dev { + int input_type; + int std_set_in_tuner_core; + unsigned int ctrl_input; +- enum au0828_dev_state dev_state; ++ long unsigned int dev_state; /* defined at enum au0828_dev_state */; + enum au0828_stream_state stream_state; + wait_queue_head_t open; + +-- +2.7.1 + + +From e3ac6ccb793e34f63321326b86ac95766afd91f9 Mon Sep 17 00:00:00 2001 +From: Philipp Zabel +Date: Fri, 26 Feb 2016 08:21:35 -0300 +Subject: [PATCH 313/384] coda: fix error path in case of missing pdata on + non-DT platform + +commit bc717d5e92c8c079280eb4acbe335c6f25041aa2 upstream. + +If we bail out this early, v4l2_device_register() has not been called +yet, so no need to call v4l2_device_unregister(). + +Fixes: b7bd660a51f0 ("[media] coda: Call v4l2_device_unregister() from a single location") + +Reported-by: Michael Olbrich +Signed-off-by: Philipp Zabel +Reviewed-by: Fabio Estevam +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/platform/coda/coda-common.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c +index 15516a6..323aad3 100644 +--- a/drivers/media/platform/coda/coda-common.c ++++ b/drivers/media/platform/coda/coda-common.c +@@ -2119,14 +2119,12 @@ static int coda_probe(struct platform_device *pdev) + + pdev_id = of_id ? of_id->data : platform_get_device_id(pdev); + +- if (of_id) { ++ if (of_id) + dev->devtype = of_id->data; +- } else if (pdev_id) { ++ else if (pdev_id) + dev->devtype = &coda_devdata[pdev_id->driver_data]; +- } else { +- ret = -EINVAL; +- goto err_v4l2_register; +- } ++ else ++ return -EINVAL; + + spin_lock_init(&dev->irqlock); + INIT_LIST_HEAD(&dev->instances); +-- +2.7.1 + + +From 93d0570da94c1c1a1480c9cd266a54ebae3b6fa0 Mon Sep 17 00:00:00 2001 +From: Laurent Pinchart +Date: Wed, 9 Sep 2015 11:38:56 -0300 +Subject: [PATCH 314/384] v4l: vsp1: Set the SRU CTRL0 register when starting + the stream + +commit f6acfcdc5b8cdc9ddd53a459361820b9efe958c4 upstream. + +Commit 58f896d859ce ("[media] v4l: vsp1: sru: Make the intensity +controllable during streaming") refactored the stream start code and +removed the SRU CTRL0 register write by mistake. Add it back. + +Fixes: 58f896d859ce ("[media] v4l: vsp1: sru: Make the intensity controllable during streaming") + +Signed-off-by: Laurent Pinchart +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/platform/vsp1/vsp1_sru.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/media/platform/vsp1/vsp1_sru.c b/drivers/media/platform/vsp1/vsp1_sru.c +index 6310aca..d41ae95 100644 +--- a/drivers/media/platform/vsp1/vsp1_sru.c ++++ b/drivers/media/platform/vsp1/vsp1_sru.c +@@ -154,6 +154,7 @@ static int sru_s_stream(struct v4l2_subdev *subdev, int enable) + mutex_lock(sru->ctrls.lock); + ctrl0 |= vsp1_sru_read(sru, VI6_SRU_CTRL0) + & (VI6_SRU_CTRL0_PARAM0_MASK | VI6_SRU_CTRL0_PARAM1_MASK); ++ vsp1_sru_write(sru, VI6_SRU_CTRL0, ctrl0); + mutex_unlock(sru->ctrls.lock); + + vsp1_sru_write(sru, VI6_SRU_CTRL1, VI6_SRU_CTRL1_PARAM5); +-- +2.7.1 + + +From 8329c6f64df4fbc6332a01fdf57b34a26adf1020 Mon Sep 17 00:00:00 2001 +From: Manuel Lauss +Date: Wed, 2 Mar 2016 10:34:43 +0100 +Subject: [PATCH 315/384] pcmcia: db1xxx_ss: fix last irq_to_gpio user + +commit e34b6fcf9b09ec9d93503edd5f81489791ffd602 upstream. + +remove the usage of removed irq_to_gpio() function. On pre-DB1200 +boards, pass the actual carddetect GPIO number instead of the IRQ, +because we need the gpio to actually test card status (inserted or +not) and can get the irq number with gpio_to_irq() instead. + +Tested on DB1300 and DB1500, this patch fixes PCMCIA on the DB1500, +which used irq_to_gpio(). + +Fixes: 832f5dacfa0b ("MIPS: Remove all the uses of custom gpio.h") +Signed-off-by: Manuel Lauss +Acked-by: Arnd Bergmann +Reviewed-by: Linus Walleij +Cc: linux-pcmcia@lists.infradead.org +Cc: Linux-MIPS +Patchwork: https://patchwork.linux-mips.org/patch/12747/ +Signed-off-by: Ralf Baechle +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/alchemy/devboards/db1000.c | 18 ++++++++---------- + arch/mips/alchemy/devboards/db1550.c | 4 ++-- + drivers/pcmcia/db1xxx_ss.c | 11 +++++++++-- + 3 files changed, 19 insertions(+), 14 deletions(-) + +diff --git a/arch/mips/alchemy/devboards/db1000.c b/arch/mips/alchemy/devboards/db1000.c +index bdeed9d..433c4b9 100644 +--- a/arch/mips/alchemy/devboards/db1000.c ++++ b/arch/mips/alchemy/devboards/db1000.c +@@ -503,15 +503,15 @@ int __init db1000_dev_setup(void) + if (board == BCSR_WHOAMI_DB1500) { + c0 = AU1500_GPIO2_INT; + c1 = AU1500_GPIO5_INT; +- d0 = AU1500_GPIO0_INT; +- d1 = AU1500_GPIO3_INT; ++ d0 = 0; /* GPIO number, NOT irq! */ ++ d1 = 3; /* GPIO number, NOT irq! */ + s0 = AU1500_GPIO1_INT; + s1 = AU1500_GPIO4_INT; + } else if (board == BCSR_WHOAMI_DB1100) { + c0 = AU1100_GPIO2_INT; + c1 = AU1100_GPIO5_INT; +- d0 = AU1100_GPIO0_INT; +- d1 = AU1100_GPIO3_INT; ++ d0 = 0; /* GPIO number, NOT irq! */ ++ d1 = 3; /* GPIO number, NOT irq! */ + s0 = AU1100_GPIO1_INT; + s1 = AU1100_GPIO4_INT; + +@@ -545,15 +545,15 @@ int __init db1000_dev_setup(void) + } else if (board == BCSR_WHOAMI_DB1000) { + c0 = AU1000_GPIO2_INT; + c1 = AU1000_GPIO5_INT; +- d0 = AU1000_GPIO0_INT; +- d1 = AU1000_GPIO3_INT; ++ d0 = 0; /* GPIO number, NOT irq! */ ++ d1 = 3; /* GPIO number, NOT irq! */ + s0 = AU1000_GPIO1_INT; + s1 = AU1000_GPIO4_INT; + platform_add_devices(db1000_devs, ARRAY_SIZE(db1000_devs)); + } else if ((board == BCSR_WHOAMI_PB1500) || + (board == BCSR_WHOAMI_PB1500R2)) { + c0 = AU1500_GPIO203_INT; +- d0 = AU1500_GPIO201_INT; ++ d0 = 1; /* GPIO number, NOT irq! */ + s0 = AU1500_GPIO202_INT; + twosocks = 0; + flashsize = 64; +@@ -566,7 +566,7 @@ int __init db1000_dev_setup(void) + */ + } else if (board == BCSR_WHOAMI_PB1100) { + c0 = AU1100_GPIO11_INT; +- d0 = AU1100_GPIO9_INT; ++ d0 = 9; /* GPIO number, NOT irq! */ + s0 = AU1100_GPIO10_INT; + twosocks = 0; + flashsize = 64; +@@ -583,7 +583,6 @@ int __init db1000_dev_setup(void) + } else + return 0; /* unknown board, no further dev setup to do */ + +- irq_set_irq_type(d0, IRQ_TYPE_EDGE_BOTH); + irq_set_irq_type(c0, IRQ_TYPE_LEVEL_LOW); + irq_set_irq_type(s0, IRQ_TYPE_LEVEL_LOW); + +@@ -597,7 +596,6 @@ int __init db1000_dev_setup(void) + c0, d0, /*s0*/0, 0, 0); + + if (twosocks) { +- irq_set_irq_type(d1, IRQ_TYPE_EDGE_BOTH); + irq_set_irq_type(c1, IRQ_TYPE_LEVEL_LOW); + irq_set_irq_type(s1, IRQ_TYPE_LEVEL_LOW); + +diff --git a/arch/mips/alchemy/devboards/db1550.c b/arch/mips/alchemy/devboards/db1550.c +index 5740bcf..6c37b93 100644 +--- a/arch/mips/alchemy/devboards/db1550.c ++++ b/arch/mips/alchemy/devboards/db1550.c +@@ -514,7 +514,7 @@ static void __init db1550_devices(void) + AU1000_PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1, + AU1000_PCMCIA_IO_PHYS_ADDR, + AU1000_PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1, +- AU1550_GPIO3_INT, AU1550_GPIO0_INT, ++ AU1550_GPIO3_INT, 0, + /*AU1550_GPIO21_INT*/0, 0, 0); + + db1x_register_pcmcia_socket( +@@ -524,7 +524,7 @@ static void __init db1550_devices(void) + AU1000_PCMCIA_MEM_PHYS_ADDR + 0x004400000 - 1, + AU1000_PCMCIA_IO_PHYS_ADDR + 0x004000000, + AU1000_PCMCIA_IO_PHYS_ADDR + 0x004010000 - 1, +- AU1550_GPIO5_INT, AU1550_GPIO1_INT, ++ AU1550_GPIO5_INT, 1, + /*AU1550_GPIO22_INT*/0, 0, 1); + + platform_device_register(&db1550_nand_dev); +diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c +index 4c2fa05..944674e 100644 +--- a/drivers/pcmcia/db1xxx_ss.c ++++ b/drivers/pcmcia/db1xxx_ss.c +@@ -56,6 +56,7 @@ struct db1x_pcmcia_sock { + int stschg_irq; /* card-status-change irq */ + int card_irq; /* card irq */ + int eject_irq; /* db1200/pb1200 have these */ ++ int insert_gpio; /* db1000 carddetect gpio */ + + #define BOARD_TYPE_DEFAULT 0 /* most boards */ + #define BOARD_TYPE_DB1200 1 /* IRQs aren't gpios */ +@@ -83,7 +84,7 @@ static int db1200_card_inserted(struct db1x_pcmcia_sock *sock) + /* carddetect gpio: low-active */ + static int db1000_card_inserted(struct db1x_pcmcia_sock *sock) + { +- return !gpio_get_value(irq_to_gpio(sock->insert_irq)); ++ return !gpio_get_value(sock->insert_gpio); + } + + static int db1x_card_inserted(struct db1x_pcmcia_sock *sock) +@@ -457,9 +458,15 @@ static int db1x_pcmcia_socket_probe(struct platform_device *pdev) + r = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "card"); + sock->card_irq = r ? r->start : 0; + +- /* insert: irq which triggers on card insertion/ejection */ ++ /* insert: irq which triggers on card insertion/ejection ++ * BIG FAT NOTE: on DB1000/1100/1500/1550 we pass a GPIO here! ++ */ + r = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "insert"); + sock->insert_irq = r ? r->start : -1; ++ if (sock->board_type == BOARD_TYPE_DEFAULT) { ++ sock->insert_gpio = r ? r->start : -1; ++ sock->insert_irq = r ? gpio_to_irq(r->start) : -1; ++ } + + /* stschg: irq which trigger on card status change (optional) */ + r = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "stschg"); +-- +2.7.1 + + +From fa7ca100a4b26bc2a742adf5a29f7b32b1b22c9d Mon Sep 17 00:00:00 2001 +From: David Disseldorp +Date: Tue, 5 Apr 2016 11:13:39 +0200 +Subject: [PATCH 316/384] rbd: use GFP_NOIO consistently for request + allocations + +commit 2224d879c7c0f85c14183ef82eb48bd875ceb599 upstream. + +As of 5a60e87603c4c533492c515b7f62578189b03c9c, RBD object request +allocations are made via rbd_obj_request_create() with GFP_NOIO. +However, subsequent OSD request allocations in rbd_osd_req_create*() +use GFP_ATOMIC. + +With heavy page cache usage (e.g. OSDs running on same host as krbd +client), rbd_osd_req_create() order-1 GFP_ATOMIC allocations have been +observed to fail, where direct reclaim would have allowed GFP_NOIO +allocations to succeed. + +Suggested-by: Vlastimil Babka +Suggested-by: Neil Brown +Signed-off-by: David Disseldorp +Signed-off-by: Ilya Dryomov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/block/rbd.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c +index 81ea69f..fbdddd6 100644 +--- a/drivers/block/rbd.c ++++ b/drivers/block/rbd.c +@@ -1955,7 +1955,7 @@ static struct ceph_osd_request *rbd_osd_req_create( + + osdc = &rbd_dev->rbd_client->client->osdc; + osd_req = ceph_osdc_alloc_request(osdc, snapc, num_ops, false, +- GFP_ATOMIC); ++ GFP_NOIO); + if (!osd_req) + return NULL; /* ENOMEM */ + +@@ -2004,7 +2004,7 @@ rbd_osd_req_create_copyup(struct rbd_obj_request *obj_request) + rbd_dev = img_request->rbd_dev; + osdc = &rbd_dev->rbd_client->client->osdc; + osd_req = ceph_osdc_alloc_request(osdc, snapc, num_osd_ops, +- false, GFP_ATOMIC); ++ false, GFP_NOIO); + if (!osd_req) + return NULL; /* ENOMEM */ + +@@ -2506,7 +2506,7 @@ static int rbd_img_request_fill(struct rbd_img_request *img_request, + bio_chain_clone_range(&bio_list, + &bio_offset, + clone_size, +- GFP_ATOMIC); ++ GFP_NOIO); + if (!obj_request->bio_list) + goto out_unwind; + } else if (type == OBJ_REQUEST_PAGES) { +-- +2.7.1 + + +From 50c3d20117348cdb7e1c7f8478a7b1a84b747f75 Mon Sep 17 00:00:00 2001 +From: "Michael S. Tsirkin" +Date: Sun, 3 Apr 2016 15:23:37 +0300 +Subject: [PATCH 317/384] virtio: virtio 1.0 cs04 spec compliance for reset + +commit 05dbcb430795b2e1fb1d5c757f8619d3dbed0a1c upstream. + +The spec says: after writing 0 to device_status, the driver MUST wait +for a read of device_status to return 0 before reinitializing the +device. + +Signed-off-by: Michael S. Tsirkin +Acked-by: Jason Wang +Signed-off-by: Greg Kroah-Hartman +--- + drivers/virtio/virtio_pci_modern.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c +index 8e5cf19..4469202 100644 +--- a/drivers/virtio/virtio_pci_modern.c ++++ b/drivers/virtio/virtio_pci_modern.c +@@ -17,6 +17,7 @@ + * + */ + ++#include + #define VIRTIO_PCI_NO_LEGACY + #include "virtio_pci_common.h" + +@@ -271,9 +272,13 @@ static void vp_reset(struct virtio_device *vdev) + struct virtio_pci_device *vp_dev = to_vp_device(vdev); + /* 0 status means a reset. */ + vp_iowrite8(0, &vp_dev->common->device_status); +- /* Flush out the status write, and flush in device writes, +- * including MSI-X interrupts, if any. */ +- vp_ioread8(&vp_dev->common->device_status); ++ /* After writing 0 to device_status, the driver MUST wait for a read of ++ * device_status to return 0 before reinitializing the device. ++ * This will flush out the status write, and flush in device writes, ++ * including MSI-X interrupts, if any. ++ */ ++ while (vp_ioread8(&vp_dev->common->device_status)) ++ msleep(1); + /* Flush pending VQ/configuration callbacks. */ + vp_synchronize_vectors(vdev); + } +-- +2.7.1 + + +From 18cd935699d54c13f43ad8b6394aed212f545a95 Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Thu, 31 Mar 2016 17:22:45 +0200 +Subject: [PATCH 318/384] mac80211: properly deal with station hashtable insert + errors + +commit 62b14b241ca6f790a17ccd9dd9f62ce1b006d406 upstream. + +The original hand-implemented hash-table in mac80211 couldn't result +in insertion errors, and while converting to rhashtable I evidently +forgot to check the errors. + +This surfaced now only because Ben is adding many identical keys and +that resulted in hidden insertion errors. + +Fixes: 7bedd0cfad4e1 ("mac80211: use rhashtable for station table") +Reported-by: Ben Greear +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman +--- + net/mac80211/sta_info.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c +index f91d187..4e2dbe5 100644 +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -256,11 +256,11 @@ void sta_info_free(struct ieee80211_local *local, struct sta_info *sta) + } + + /* Caller must hold local->sta_mtx */ +-static void sta_info_hash_add(struct ieee80211_local *local, +- struct sta_info *sta) ++static int sta_info_hash_add(struct ieee80211_local *local, ++ struct sta_info *sta) + { +- rhashtable_insert_fast(&local->sta_hash, &sta->hash_node, +- sta_rht_params); ++ return rhashtable_insert_fast(&local->sta_hash, &sta->hash_node, ++ sta_rht_params); + } + + static void sta_deliver_ps_frames(struct work_struct *wk) +@@ -503,7 +503,9 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU) + set_sta_flag(sta, WLAN_STA_BLOCK_BA); + + /* make the station visible */ +- sta_info_hash_add(local, sta); ++ err = sta_info_hash_add(local, sta); ++ if (err) ++ goto out_drop_sta; + + list_add_tail_rcu(&sta->list, &local->sta_list); + +@@ -538,6 +540,7 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU) + out_remove: + sta_info_hash_del(local, sta); + list_del_rcu(&sta->list); ++ out_drop_sta: + local->num_sta--; + synchronize_net(); + __cleanup_single_sta(sta); +-- +2.7.1 + + +From b4cb894aecc955a0ebec46d34ff4f930a60c8047 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Tue, 26 Jan 2016 23:05:31 +0100 +Subject: [PATCH 319/384] mac80211: avoid excessive stack usage in sta_info + +commit 0ef049dc1167fe834d0ad5d63f89eddc5c70f6e4 upstream. + +When CONFIG_OPTIMIZE_INLINING is set, the sta_info_insert_finish +function consumes more stack than normally, exceeding the +1024 byte limit on ARM: + +net/mac80211/sta_info.c: In function 'sta_info_insert_finish': +net/mac80211/sta_info.c:561:1: error: the frame size of 1080 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] + +It turns out that there are two functions that put a 'struct station_info' +on the stack: __sta_info_destroy_part2 and sta_info_insert_finish, and +this structure alone requires up to 792 bytes. + +Hoping that both are called rarely enough, this replaces the +on-stack structure with a dynamic allocation, which unfortunately +requires some suboptimal error handling for out-of-memory. + +The __sta_info_destroy_part2 function is actually affected by the +stack usage twice because it calls cfg80211_del_sta_sinfo(), which +has another instance of struct station_info on its stack. + +Signed-off-by: Arnd Bergmann +Fixes: 98b6218388e3 ("mac80211/cfg80211: add station events") +Fixes: 6f7a8d26e266 ("mac80211: send statistics with delete station event") +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman +--- + net/mac80211/sta_info.c | 24 ++++++++++++++++-------- + 1 file changed, 16 insertions(+), 8 deletions(-) + +diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c +index 4e2dbe5..67066d0 100644 +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -484,11 +484,17 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU) + { + struct ieee80211_local *local = sta->local; + struct ieee80211_sub_if_data *sdata = sta->sdata; +- struct station_info sinfo; ++ struct station_info *sinfo; + int err = 0; + + lockdep_assert_held(&local->sta_mtx); + ++ sinfo = kzalloc(sizeof(struct station_info), GFP_KERNEL); ++ if (!sinfo) { ++ err = -ENOMEM; ++ goto out_err; ++ } ++ + /* check if STA exists already */ + if (sta_info_get_bss(sdata, sta->sta.addr)) { + err = -EEXIST; +@@ -522,10 +528,9 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU) + ieee80211_sta_debugfs_add(sta); + rate_control_add_sta_debugfs(sta); + +- memset(&sinfo, 0, sizeof(sinfo)); +- sinfo.filled = 0; +- sinfo.generation = local->sta_generation; +- cfg80211_new_sta(sdata->dev, sta->sta.addr, &sinfo, GFP_KERNEL); ++ sinfo->generation = local->sta_generation; ++ cfg80211_new_sta(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL); ++ kfree(sinfo); + + sta_dbg(sdata, "Inserted STA %pM\n", sta->sta.addr); + +@@ -885,7 +890,7 @@ static void __sta_info_destroy_part2(struct sta_info *sta) + { + struct ieee80211_local *local = sta->local; + struct ieee80211_sub_if_data *sdata = sta->sdata; +- struct station_info sinfo = {}; ++ struct station_info *sinfo; + int ret; + + /* +@@ -923,8 +928,11 @@ static void __sta_info_destroy_part2(struct sta_info *sta) + + sta_dbg(sdata, "Removed STA %pM\n", sta->sta.addr); + +- sta_set_sinfo(sta, &sinfo); +- cfg80211_del_sta_sinfo(sdata->dev, sta->sta.addr, &sinfo, GFP_KERNEL); ++ sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL); ++ if (sinfo) ++ sta_set_sinfo(sta, sinfo); ++ cfg80211_del_sta_sinfo(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL); ++ kfree(sinfo); + + rate_control_remove_sta_debugfs(sta); + ieee80211_sta_debugfs_remove(sta); +-- +2.7.1 + + +From 69f1f0abd7137b08132b53a707edc914206b0882 Mon Sep 17 00:00:00 2001 +From: Sara Sharon +Date: Mon, 25 Jan 2016 15:46:35 +0200 +Subject: [PATCH 320/384] mac80211: fix ibss scan parameters + +commit d321cd014e51baab475efbdec468255b9e0ec822 upstream. + +When joining IBSS a full scan should be initiated in order to search +for existing cell, unless the fixed_channel parameter was set. +A default channel to create the IBSS on if no cell was found is +provided as well. +However - a scan is initiated only on the default channel provided +regardless of whether ifibss->fixed_channel is set or not, with the +obvious result of the cell not joining existing IBSS cell that is +on another channel. + +Fixes: 76bed0f43b27 ("mac80211: IBSS fix scan request") +Signed-off-by: Sara Sharon +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman +--- + net/mac80211/ibss.c | 22 +++++++++++++++------- + 1 file changed, 15 insertions(+), 7 deletions(-) + +diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c +index 6a12b0f..980e9e9 100644 +--- a/net/mac80211/ibss.c ++++ b/net/mac80211/ibss.c +@@ -7,6 +7,7 @@ + * Copyright 2007, Michael Wu + * Copyright 2009, Johannes Berg + * Copyright 2013-2014 Intel Mobile Communications GmbH ++ * Copyright(c) 2016 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as +@@ -1484,14 +1485,21 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) + + sdata_info(sdata, "Trigger new scan to find an IBSS to join\n"); + +- num = ieee80211_ibss_setup_scan_channels(local->hw.wiphy, +- &ifibss->chandef, +- channels, +- ARRAY_SIZE(channels)); + scan_width = cfg80211_chandef_to_scan_width(&ifibss->chandef); +- ieee80211_request_ibss_scan(sdata, ifibss->ssid, +- ifibss->ssid_len, channels, num, +- scan_width); ++ ++ if (ifibss->fixed_channel) { ++ num = ieee80211_ibss_setup_scan_channels(local->hw.wiphy, ++ &ifibss->chandef, ++ channels, ++ ARRAY_SIZE(channels)); ++ ieee80211_request_ibss_scan(sdata, ifibss->ssid, ++ ifibss->ssid_len, channels, ++ num, scan_width); ++ } else { ++ ieee80211_request_ibss_scan(sdata, ifibss->ssid, ++ ifibss->ssid_len, NULL, ++ 0, scan_width); ++ } + } else { + int interval = IEEE80211_SCAN_INTERVAL; + +-- +2.7.1 + + +From 365caa3ed7d4a046755d6e612faf15bec340d214 Mon Sep 17 00:00:00 2001 +From: Michal Kazior +Date: Mon, 25 Jan 2016 14:43:24 +0100 +Subject: [PATCH 321/384] mac80211: fix unnecessary frame drops in mesh fwding + +commit cf44012810ccdd8fd947518e965cb04b7b8498be upstream. + +The ieee80211_queue_stopped() expects hw queue +number but it was given raw WMM AC number instead. + +This could cause frame drops and problems with +traffic in some cases - most notably if driver +doesn't map AC numbers to queue numbers 1:1 and +uses ieee80211_stop_queues() and +ieee80211_wake_queue() only without ever calling +ieee80211_wake_queues(). + +On ath10k it was possible to hit this problem in +the following case: + + 1. wlan0 uses queue 0 + (ath10k maps queues per vif) + 2. offchannel uses queue 15 + 3. queues 1-14 are unused + 4. ieee80211_stop_queues() + 5. ieee80211_wake_queue(q=0) + 6. ieee80211_wake_queue(q=15) + (other queues are not woken up because both + driver and mac80211 know other queues are + unused) + 7. ieee80211_rx_h_mesh_fwding() + 8. ieee80211_select_queue_80211() returns 2 + 9. ieee80211_queue_stopped(q=2) returns true + 10. frame is dropped (oops!) + +Fixes: d3c1597b8d1b ("mac80211: fix forwarded mesh frame queue mapping") +Signed-off-by: Michal Kazior +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman +--- + net/mac80211/rx.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c +index 0e9e264..3be97739 100644 +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -2250,7 +2250,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) + struct ieee80211_local *local = rx->local; + struct ieee80211_sub_if_data *sdata = rx->sdata; + struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; +- u16 q, hdrlen; ++ u16 ac, q, hdrlen; + + hdr = (struct ieee80211_hdr *) skb->data; + hdrlen = ieee80211_hdrlen(hdr->frame_control); +@@ -2319,7 +2319,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) + ether_addr_equal(sdata->vif.addr, hdr->addr3)) + return RX_CONTINUE; + +- q = ieee80211_select_queue_80211(sdata, skb, hdr); ++ ac = ieee80211_select_queue_80211(sdata, skb, hdr); ++ q = sdata->vif.hw_queue[ac]; + if (ieee80211_queue_stopped(&local->hw, q)) { + IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_congestion); + return RX_DROP_MONITOR; +-- +2.7.1 + + +From 5040488dfa173f4067cd766838d209af4f1bfbc3 Mon Sep 17 00:00:00 2001 +From: Michal Kazior +Date: Thu, 21 Jan 2016 14:23:07 +0100 +Subject: [PATCH 322/384] mac80211: fix txq queue related crashes + +commit 2a58d42c1e018ad514d4e23fd33fb2ded95d3ee6 upstream. + +The driver can access the queue simultanously +while mac80211 tears down the interface. Without +spinlock protection this could lead to corrupting +sk_buff_head and subsequently to an invalid +pointer dereference. + +Fixes: ba8c3d6f16a1 ("mac80211: add an intermediate software queue implementation") +Signed-off-by: Michal Kazior +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman +--- + net/mac80211/iface.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c +index c9e325d..7a2b791 100644 +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -977,7 +977,10 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, + if (sdata->vif.txq) { + struct txq_info *txqi = to_txq_info(sdata->vif.txq); + ++ spin_lock_bh(&txqi->queue.lock); + ieee80211_purge_tx_queue(&local->hw, &txqi->queue); ++ spin_unlock_bh(&txqi->queue.lock); ++ + atomic_set(&sdata->txqs_len[txqi->txq.ac], 0); + } + +-- +2.7.1 + + +From cb23a9fd98a5bb1dd39f7cb55c3644dbfba23bf1 Mon Sep 17 00:00:00 2001 +From: Yoshihiro Shimoda +Date: Thu, 10 Mar 2016 11:30:14 +0900 +Subject: [PATCH 323/384] usb: renesas_usbhs: avoid NULL pointer derefernce in + usbhsf_pkt_handler() + +commit 894f2fc44f2f3f48c36c973b1123f6ab298be160 upstream. + +When unexpected situation happened (e.g. tx/rx irq happened while +DMAC is used), the usbhsf_pkt_handler() was possible to cause NULL +pointer dereference like the followings: + +Unable to handle kernel NULL pointer dereference at virtual address 00000000 +pgd = c0004000 +[00000000] *pgd=00000000 +Internal error: Oops: 80000007 [#1] SMP ARM +Modules linked in: usb_f_acm u_serial g_serial libcomposite +CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.5.0-rc6-00842-gac57066-dirty #63 +Hardware name: Generic R8A7790 (Flattened Device Tree) +task: c0729c00 ti: c0724000 task.ti: c0724000 +PC is at 0x0 +LR is at usbhsf_pkt_handler+0xac/0x118 +pc : [<00000000>] lr : [] psr: 60000193 +sp : c0725db8 ip : 00000000 fp : c0725df4 +r10: 00000001 r9 : 00000193 r8 : ef3ccab4 +r7 : ef3cca10 r6 : eea4586c r5 : 00000000 r4 : ef19ceb4 +r3 : 00000000 r2 : 0000009c r1 : c0725dc4 r0 : ef19ceb4 + +This patch adds a condition to avoid the dereference. + +Fixes: e73a989 ("usb: renesas_usbhs: add DMAEngine support") +Signed-off-by: Yoshihiro Shimoda +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/renesas_usbhs/fifo.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c +index c0f5c65..32df738 100644 +--- a/drivers/usb/renesas_usbhs/fifo.c ++++ b/drivers/usb/renesas_usbhs/fifo.c +@@ -190,7 +190,8 @@ static int usbhsf_pkt_handler(struct usbhs_pipe *pipe, int type) + goto __usbhs_pkt_handler_end; + } + +- ret = func(pkt, &is_done); ++ if (likely(func)) ++ ret = func(pkt, &is_done); + + if (is_done) + __usbhsf_pkt_del(pkt); +-- +2.7.1 + + +From 1904e689a1442f079701f3dace525132c618c588 Mon Sep 17 00:00:00 2001 +From: Yoshihiro Shimoda +Date: Thu, 10 Mar 2016 11:30:15 +0900 +Subject: [PATCH 324/384] usb: renesas_usbhs: disable TX IRQ before starting TX + DMAC transfer + +commit 6490865c67825277b29638e839850882600b48ec upstream. + +This patch adds a code to surely disable TX IRQ of the pipe before +starting TX DMAC transfer. Otherwise, a lot of unnecessary TX IRQs +may happen in rare cases when DMAC is used. + +Fixes: e73a989 ("usb: renesas_usbhs: add DMAEngine support") +Signed-off-by: Yoshihiro Shimoda +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/renesas_usbhs/fifo.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c +index 32df738..f1893e0 100644 +--- a/drivers/usb/renesas_usbhs/fifo.c ++++ b/drivers/usb/renesas_usbhs/fifo.c +@@ -890,6 +890,7 @@ static int usbhsf_dma_prepare_push(struct usbhs_pkt *pkt, int *is_done) + + pkt->trans = len; + ++ usbhsf_tx_irq_ctrl(pipe, 0); + INIT_WORK(&pkt->work, xfer_work); + schedule_work(&pkt->work); + +-- +2.7.1 + + +From 480a2d55bf8594f11a0156a36002537a643efbbf Mon Sep 17 00:00:00 2001 +From: Yoshihiro Shimoda +Date: Mon, 4 Apr 2016 20:40:20 +0900 +Subject: [PATCH 325/384] usb: renesas_usbhs: fix to avoid using a disabled ep + in usbhsg_queue_done() + +commit 4fccb0767fdbdb781a9c5b5c15ee7b219443c89d upstream. + +This patch fixes an issue that usbhsg_queue_done() may cause kernel +panic when dma callback is running and usb_ep_disable() is called +by interrupt handler. (Especially, we can reproduce this issue using +g_audio with usb-dmac driver.) + +For example of a flow: + usbhsf_dma_complete (on tasklet) + --> usbhsf_pkt_handler (on tasklet) + --> usbhsg_queue_done (on tasklet) + *** interrupt happened and usb_ep_disable() is called *** + --> usbhsg_queue_pop (on tasklet) + Then, oops happened. + +Fixes: e73a989 ("usb: renesas_usbhs: add DMAEngine support") +Signed-off-by: Yoshihiro Shimoda +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/renesas_usbhs/mod_gadget.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c +index 8f7a78e..fa14198 100644 +--- a/drivers/usb/renesas_usbhs/mod_gadget.c ++++ b/drivers/usb/renesas_usbhs/mod_gadget.c +@@ -158,10 +158,14 @@ static void usbhsg_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt) + struct usbhs_pipe *pipe = pkt->pipe; + struct usbhsg_uep *uep = usbhsg_pipe_to_uep(pipe); + struct usbhsg_request *ureq = usbhsg_pkt_to_ureq(pkt); ++ unsigned long flags; + + ureq->req.actual = pkt->actual; + +- usbhsg_queue_pop(uep, ureq, 0); ++ usbhs_lock(priv, flags); ++ if (uep) ++ __usbhsg_queue_pop(uep, ureq, 0); ++ usbhs_unlock(priv, flags); + } + + static void usbhsg_queue_push(struct usbhsg_uep *uep, +-- +2.7.1 + + +From 63f0e4e6d7e5fdbf7caefe7a307f5d04a95036a5 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Tue, 29 Mar 2016 22:27:27 +0200 +Subject: [PATCH 326/384] iio: st_magn: always define ST_MAGN_TRIGGER_SET_STATE + +commit 9b090a98e95c2530ef0ce474e3b6218621b8ae25 upstream. + +When CONFIG_IIO_TRIGGER is enabled but CONFIG_IIO_BUFFER is +not, we get a build error in the st_magn driver: + +drivers/iio/magnetometer/st_magn_core.c:573:23: error: 'ST_MAGN_TRIGGER_SET_STATE' undeclared here (not in a function) + .set_trigger_state = ST_MAGN_TRIGGER_SET_STATE, + ^~~~~~~~~~~~~~~~~~~~~~~~~ + +Apparently, this ST_MAGN_TRIGGER_SET_STATE macro was meant to +be set to NULL when the definition is not available because +st_magn_buffer.c is not compiled, but the alternative definition +was not included in the original patch. This adds it. + +Signed-off-by: Arnd Bergmann +Fixes: 74f5683f35fe ("iio: st_magn: Add irq trigger handling") +Acked-by: Denis Ciocca +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/magnetometer/st_magn.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/iio/magnetometer/st_magn.h b/drivers/iio/magnetometer/st_magn.h +index 06a4d9c..9daca46 100644 +--- a/drivers/iio/magnetometer/st_magn.h ++++ b/drivers/iio/magnetometer/st_magn.h +@@ -44,6 +44,7 @@ static inline int st_magn_allocate_ring(struct iio_dev *indio_dev) + static inline void st_magn_deallocate_ring(struct iio_dev *indio_dev) + { + } ++#define ST_MAGN_TRIGGER_SET_STATE NULL + #endif /* CONFIG_IIO_BUFFER */ + + #endif /* ST_MAGN_H */ +-- +2.7.1 + + +From b24e295db83d6fd43e5428aeb31fb3039550afe1 Mon Sep 17 00:00:00 2001 +From: Irina Tirdea +Date: Tue, 29 Mar 2016 15:35:45 +0300 +Subject: [PATCH 327/384] iio: accel: bmc150: fix endianness when reading axes + +commit 2215f31dc6f88634c1916362e922b1ecdce0a6b3 upstream. + +For big endian platforms, reading the axes will return +invalid values. + +The device stores each axis value in a 16 bit little +endian register. The driver uses regmap_read_bulk to get +the axis value, resulting in a 16 bit little endian value. +This needs to be converted to cpu endianness to work +on big endian platforms. + +Fix endianness for big endian platforms by converting +the values for the axes read from little endian to +cpu. + +This is also partially fixed in commit b6fb9b6d6552 ("iio: +accel: bmc150: optimize transfers in trigger handler"). + +Signed-off-by: Irina Tirdea +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/accel/bmc150-accel-core.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c +index 2d33f1e..291c61a 100644 +--- a/drivers/iio/accel/bmc150-accel-core.c ++++ b/drivers/iio/accel/bmc150-accel-core.c +@@ -547,7 +547,7 @@ static int bmc150_accel_get_axis(struct bmc150_accel_data *data, + { + int ret; + int axis = chan->scan_index; +- unsigned int raw_val; ++ __le16 raw_val; + + mutex_lock(&data->mutex); + ret = bmc150_accel_set_power_state(data, true); +@@ -557,14 +557,14 @@ static int bmc150_accel_get_axis(struct bmc150_accel_data *data, + } + + ret = regmap_bulk_read(data->regmap, BMC150_ACCEL_AXIS_TO_REG(axis), +- &raw_val, 2); ++ &raw_val, sizeof(raw_val)); + if (ret < 0) { + dev_err(data->dev, "Error reading axis %d\n", axis); + bmc150_accel_set_power_state(data, false); + mutex_unlock(&data->mutex); + return ret; + } +- *val = sign_extend32(raw_val >> chan->scan_type.shift, ++ *val = sign_extend32(le16_to_cpu(raw_val) >> chan->scan_type.shift, + chan->scan_type.realbits - 1); + ret = bmc150_accel_set_power_state(data, false); + mutex_unlock(&data->mutex); +@@ -988,6 +988,7 @@ static const struct iio_event_spec bmc150_accel_event = { + .realbits = (bits), \ + .storagebits = 16, \ + .shift = 16 - (bits), \ ++ .endianness = IIO_LE, \ + }, \ + .event_spec = &bmc150_accel_event, \ + .num_event_specs = 1 \ +-- +2.7.1 + + +From e2e97b0377fc75689d95716867303c23b7adba2d Mon Sep 17 00:00:00 2001 +From: Irina Tirdea +Date: Mon, 28 Mar 2016 20:15:46 +0300 +Subject: [PATCH 328/384] iio: gyro: bmg160: fix buffer read values + +commit b475c59b113db1e66eb9527ffdec3c5241c847e5 upstream. + +When reading gyroscope axes using iio buffers, the values +returned are always 0. In the interrupt handler, the return +value of the read operation is returned to the user instead +of the value read. Return the value read to the user. + +This is also fixed in commit 82d8e5da1a33 ("iio: +accel: bmg160: optimize transfers in trigger handler"). + +Signed-off-by: Irina Tirdea +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/gyro/bmg160_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c +index 02ff789..0d3edf9 100644 +--- a/drivers/iio/gyro/bmg160_core.c ++++ b/drivers/iio/gyro/bmg160_core.c +@@ -780,7 +780,7 @@ static irqreturn_t bmg160_trigger_handler(int irq, void *p) + mutex_unlock(&data->mutex); + goto err; + } +- data->buffer[i++] = ret; ++ data->buffer[i++] = val; + } + mutex_unlock(&data->mutex); + +-- +2.7.1 + + +From fc70fe969d0a454df0314d292f249dbdd252d2aa Mon Sep 17 00:00:00 2001 +From: Irina Tirdea +Date: Tue, 29 Mar 2016 15:37:30 +0300 +Subject: [PATCH 329/384] iio: gyro: bmg160: fix endianness when reading axes + +commit 95e7ff034175db7d8aefabe7716c4d42bea24fde upstream. + +For big endian platforms, reading the axes will return +invalid values. + +The device stores each axis value in a 16 bit little +endian register. The driver uses regmap_read_bulk to get +the axis value, resulting in a 16 bit little endian value. +This needs to be converted to cpu endianness to work +on big endian platforms. + +Fix endianness for big endian platforms by converting +the values for the axes read from little endian to +cpu. + +This is also partially fixed in commit 82d8e5da1a33 ("iio: +accel: bmg160: optimize transfers in trigger handler"). + +Signed-off-by: Irina Tirdea +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/gyro/bmg160_core.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c +index 0d3edf9..acb3b30 100644 +--- a/drivers/iio/gyro/bmg160_core.c ++++ b/drivers/iio/gyro/bmg160_core.c +@@ -452,7 +452,7 @@ static int bmg160_get_temp(struct bmg160_data *data, int *val) + static int bmg160_get_axis(struct bmg160_data *data, int axis, int *val) + { + int ret; +- unsigned int raw_val; ++ __le16 raw_val; + + mutex_lock(&data->mutex); + ret = bmg160_set_power_state(data, true); +@@ -462,7 +462,7 @@ static int bmg160_get_axis(struct bmg160_data *data, int axis, int *val) + } + + ret = regmap_bulk_read(data->regmap, BMG160_AXIS_TO_REG(axis), &raw_val, +- 2); ++ sizeof(raw_val)); + if (ret < 0) { + dev_err(data->dev, "Error reading axis %d\n", axis); + bmg160_set_power_state(data, false); +@@ -470,7 +470,7 @@ static int bmg160_get_axis(struct bmg160_data *data, int axis, int *val) + return ret; + } + +- *val = sign_extend32(raw_val, 15); ++ *val = sign_extend32(le16_to_cpu(raw_val), 15); + ret = bmg160_set_power_state(data, false); + mutex_unlock(&data->mutex); + if (ret < 0) +@@ -733,6 +733,7 @@ static const struct iio_event_spec bmg160_event = { + .sign = 's', \ + .realbits = 16, \ + .storagebits = 16, \ ++ .endianness = IIO_LE, \ + }, \ + .event_spec = &bmg160_event, \ + .num_event_specs = 1 \ +-- +2.7.1 + + +From a269b25abbcb4ef84fb3d21387265f2829a62865 Mon Sep 17 00:00:00 2001 +From: "Martin K. Petersen" +Date: Mon, 28 Mar 2016 21:18:56 -0400 +Subject: [PATCH 330/384] sd: Fix excessive capacity printing on devices with + blocks bigger than 512 bytes + +commit f08bb1e0dbdd0297258d0b8cd4dbfcc057e57b2a upstream. + +During revalidate we check whether device capacity has changed before we +decide whether to output disk information or not. + +The check for old capacity failed to take into account that we scaled +sdkp->capacity based on the reported logical block size. And therefore +the capacity test would always fail for devices with sectors bigger than +512 bytes and we would print several copies of the same discovery +information. + +Avoid scaling sdkp->capacity and instead adjust the value on the fly +when setting the block device capacity and generating fake C/H/S +geometry. + +Signed-off-by: Martin K. Petersen +Reported-by: Hannes Reinecke +Reviewed-by: Hannes Reinicke +Reviewed-by: Ewan Milne +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/sd.c | 28 ++++++++-------------------- + drivers/scsi/sd.h | 7 ++++++- + 2 files changed, 14 insertions(+), 21 deletions(-) + +diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c +index cc84ea7..0d7c6e8 100644 +--- a/drivers/scsi/sd.c ++++ b/drivers/scsi/sd.c +@@ -1275,18 +1275,19 @@ static int sd_getgeo(struct block_device *bdev, struct hd_geometry *geo) + struct scsi_disk *sdkp = scsi_disk(bdev->bd_disk); + struct scsi_device *sdp = sdkp->device; + struct Scsi_Host *host = sdp->host; ++ sector_t capacity = logical_to_sectors(sdp, sdkp->capacity); + int diskinfo[4]; + + /* default to most commonly used values */ +- diskinfo[0] = 0x40; /* 1 << 6 */ +- diskinfo[1] = 0x20; /* 1 << 5 */ +- diskinfo[2] = sdkp->capacity >> 11; +- ++ diskinfo[0] = 0x40; /* 1 << 6 */ ++ diskinfo[1] = 0x20; /* 1 << 5 */ ++ diskinfo[2] = capacity >> 11; ++ + /* override with calculated, extended default, or driver values */ + if (host->hostt->bios_param) +- host->hostt->bios_param(sdp, bdev, sdkp->capacity, diskinfo); ++ host->hostt->bios_param(sdp, bdev, capacity, diskinfo); + else +- scsicam_bios_param(bdev, sdkp->capacity, diskinfo); ++ scsicam_bios_param(bdev, capacity, diskinfo); + + geo->heads = diskinfo[0]; + geo->sectors = diskinfo[1]; +@@ -2337,14 +2338,6 @@ got_data: + if (sdkp->capacity > 0xffffffff) + sdp->use_16_for_rw = 1; + +- /* Rescale capacity to 512-byte units */ +- if (sector_size == 4096) +- sdkp->capacity <<= 3; +- else if (sector_size == 2048) +- sdkp->capacity <<= 2; +- else if (sector_size == 1024) +- sdkp->capacity <<= 1; +- + blk_queue_physical_block_size(sdp->request_queue, + sdkp->physical_block_size); + sdkp->device->sector_size = sector_size; +@@ -2812,11 +2805,6 @@ static int sd_try_extended_inquiry(struct scsi_device *sdp) + return 0; + } + +-static inline u32 logical_to_sectors(struct scsi_device *sdev, u32 blocks) +-{ +- return blocks << (ilog2(sdev->sector_size) - 9); +-} +- + /** + * sd_revalidate_disk - called the first time a new disk is seen, + * performs disk spin up, read_capacity, etc. +@@ -2900,7 +2888,7 @@ static int sd_revalidate_disk(struct gendisk *disk) + /* Combine with controller limits */ + q->limits.max_sectors = min(rw_max, queue_max_hw_sectors(q)); + +- set_capacity(disk, sdkp->capacity); ++ set_capacity(disk, logical_to_sectors(sdp, sdkp->capacity)); + sd_config_write_same(sdkp); + kfree(buffer); + +diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h +index 5f2a84a..654630b 100644 +--- a/drivers/scsi/sd.h ++++ b/drivers/scsi/sd.h +@@ -65,7 +65,7 @@ struct scsi_disk { + struct device dev; + struct gendisk *disk; + atomic_t openers; +- sector_t capacity; /* size in 512-byte sectors */ ++ sector_t capacity; /* size in logical blocks */ + u32 max_xfer_blocks; + u32 opt_xfer_blocks; + u32 max_ws_blocks; +@@ -146,6 +146,11 @@ static inline int scsi_medium_access_command(struct scsi_cmnd *scmd) + return 0; + } + ++static inline sector_t logical_to_sectors(struct scsi_device *sdev, sector_t blocks) ++{ ++ return blocks << (ilog2(sdev->sector_size) - 9); ++} ++ + /* + * A DIF-capable target device can be formatted with different + * protection schemes. Currently 0 through 3 are defined: +-- +2.7.1 + + +From 7bece03f213d293226c737133900c910864897eb Mon Sep 17 00:00:00 2001 +From: Miklos Szeredi +Date: Sat, 26 Mar 2016 16:14:37 -0400 +Subject: [PATCH 331/384] fs: add file_dentry() + +commit d101a125954eae1d397adda94ca6319485a50493 upstream. + +This series fixes bugs in nfs and ext4 due to 4bacc9c9234c ("overlayfs: +Make f_path always point to the overlay and f_inode to the underlay"). + +Regular files opened on overlayfs will result in the file being opened on +the underlying filesystem, while f_path points to the overlayfs +mount/dentry. + +This confuses filesystems which get the dentry from struct file and assume +it's theirs. + +Add a new helper, file_dentry() [*], to get the filesystem's own dentry +from the file. This checks file->f_path.dentry->d_flags against +DCACHE_OP_REAL, and returns file->f_path.dentry if DCACHE_OP_REAL is not +set (this is the common, non-overlayfs case). + +In the uncommon case it will call into overlayfs's ->d_real() to get the +underlying dentry, matching file_inode(file). + +The reason we need to check against the inode is that if the file is copied +up while being open, d_real() would return the upper dentry, while the open +file comes from the lower dentry. + +[*] If possible, it's better simply to use file_inode() instead. + +Signed-off-by: Miklos Szeredi +Signed-off-by: Theodore Ts'o +Tested-by: Goldwyn Rodrigues +Reviewed-by: Trond Myklebust +Cc: David Howells +Cc: Al Viro +Cc: Daniel Axtens +Signed-off-by: Greg Kroah-Hartman +--- + fs/dcache.c | 5 ++++- + fs/overlayfs/super.c | 33 +++++++++++++++++++++++++++++++++ + include/linux/dcache.h | 10 ++++++++++ + include/linux/fs.h | 10 ++++++++++ + 4 files changed, 57 insertions(+), 1 deletion(-) + +diff --git a/fs/dcache.c b/fs/dcache.c +index 671e0f8..40c5611 100644 +--- a/fs/dcache.c ++++ b/fs/dcache.c +@@ -1667,7 +1667,8 @@ void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op) + DCACHE_OP_REVALIDATE | + DCACHE_OP_WEAK_REVALIDATE | + DCACHE_OP_DELETE | +- DCACHE_OP_SELECT_INODE)); ++ DCACHE_OP_SELECT_INODE | ++ DCACHE_OP_REAL)); + dentry->d_op = op; + if (!op) + return; +@@ -1685,6 +1686,8 @@ void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op) + dentry->d_flags |= DCACHE_OP_PRUNE; + if (op->d_select_inode) + dentry->d_flags |= DCACHE_OP_SELECT_INODE; ++ if (op->d_real) ++ dentry->d_flags |= DCACHE_OP_REAL; + + } + EXPORT_SYMBOL(d_set_d_op); +diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c +index 000b2ed..a1acc60 100644 +--- a/fs/overlayfs/super.c ++++ b/fs/overlayfs/super.c +@@ -276,6 +276,37 @@ static void ovl_dentry_release(struct dentry *dentry) + } + } + ++static struct dentry *ovl_d_real(struct dentry *dentry, struct inode *inode) ++{ ++ struct dentry *real; ++ ++ if (d_is_dir(dentry)) { ++ if (!inode || inode == d_inode(dentry)) ++ return dentry; ++ goto bug; ++ } ++ ++ real = ovl_dentry_upper(dentry); ++ if (real && (!inode || inode == d_inode(real))) ++ return real; ++ ++ real = ovl_dentry_lower(dentry); ++ if (!real) ++ goto bug; ++ ++ if (!inode || inode == d_inode(real)) ++ return real; ++ ++ /* Handle recursion */ ++ if (real->d_flags & DCACHE_OP_REAL) ++ return real->d_op->d_real(real, inode); ++ ++bug: ++ WARN(1, "ovl_d_real(%pd4, %s:%lu\n): real dentry not found\n", dentry, ++ inode ? inode->i_sb->s_id : "NULL", inode ? inode->i_ino : 0); ++ return dentry; ++} ++ + static int ovl_dentry_revalidate(struct dentry *dentry, unsigned int flags) + { + struct ovl_entry *oe = dentry->d_fsdata; +@@ -320,11 +351,13 @@ static int ovl_dentry_weak_revalidate(struct dentry *dentry, unsigned int flags) + static const struct dentry_operations ovl_dentry_operations = { + .d_release = ovl_dentry_release, + .d_select_inode = ovl_d_select_inode, ++ .d_real = ovl_d_real, + }; + + static const struct dentry_operations ovl_reval_dentry_operations = { + .d_release = ovl_dentry_release, + .d_select_inode = ovl_d_select_inode, ++ .d_real = ovl_d_real, + .d_revalidate = ovl_dentry_revalidate, + .d_weak_revalidate = ovl_dentry_weak_revalidate, + }; +diff --git a/include/linux/dcache.h b/include/linux/dcache.h +index 8a2e009..f513dd8 100644 +--- a/include/linux/dcache.h ++++ b/include/linux/dcache.h +@@ -161,6 +161,7 @@ struct dentry_operations { + struct vfsmount *(*d_automount)(struct path *); + int (*d_manage)(struct dentry *, bool); + struct inode *(*d_select_inode)(struct dentry *, unsigned); ++ struct dentry *(*d_real)(struct dentry *, struct inode *); + } ____cacheline_aligned; + + /* +@@ -227,6 +228,7 @@ struct dentry_operations { + #define DCACHE_MAY_FREE 0x00800000 + #define DCACHE_FALLTHRU 0x01000000 /* Fall through to lower layer */ + #define DCACHE_OP_SELECT_INODE 0x02000000 /* Unioned entry: dcache op selects inode */ ++#define DCACHE_OP_REAL 0x08000000 + + extern seqlock_t rename_lock; + +@@ -582,4 +584,12 @@ static inline struct dentry *d_backing_dentry(struct dentry *upper) + return upper; + } + ++static inline struct dentry *d_real(struct dentry *dentry) ++{ ++ if (unlikely(dentry->d_flags & DCACHE_OP_REAL)) ++ return dentry->d_op->d_real(dentry, NULL); ++ else ++ return dentry; ++} ++ + #endif /* __LINUX_DCACHE_H */ +diff --git a/include/linux/fs.h b/include/linux/fs.h +index 22c5a0c..ab3d8d9 100644 +--- a/include/linux/fs.h ++++ b/include/linux/fs.h +@@ -1207,6 +1207,16 @@ static inline struct inode *file_inode(const struct file *f) + return f->f_inode; + } + ++static inline struct dentry *file_dentry(const struct file *file) ++{ ++ struct dentry *dentry = file->f_path.dentry; ++ ++ if (unlikely(dentry->d_flags & DCACHE_OP_REAL)) ++ return dentry->d_op->d_real(dentry, file_inode(file)); ++ else ++ return dentry; ++} ++ + static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl) + { + return locks_lock_inode_wait(file_inode(filp), fl); +-- +2.7.1 + + +From 88f6059553a4f86d6a175a00efb11bb201027499 Mon Sep 17 00:00:00 2001 +From: Miklos Szeredi +Date: Sat, 26 Mar 2016 16:14:39 -0400 +Subject: [PATCH 332/384] nfs: use file_dentry() + +commit be62a1a8fd116f5cd9e53726601f970e16e17558 upstream. + +NFS may be used as lower layer of overlayfs and accessing f_path.dentry can +lead to a crash. + +Fix by replacing direct access of file->f_path.dentry with the +file_dentry() accessor, which will always return a native object. + +Fixes: 4bacc9c9234c ("overlayfs: Make f_path always point to the overlay and f_inode to the underlay") +Signed-off-by: Miklos Szeredi +Tested-by: Goldwyn Rodrigues +Acked-by: Trond Myklebust +Signed-off-by: Theodore Ts'o +Cc: David Howells +Cc: Al Viro +Signed-off-by: Greg Kroah-Hartman +--- + fs/nfs/dir.c | 6 +++--- + fs/nfs/inode.c | 2 +- + fs/nfs/nfs4file.c | 4 ++-- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c +index ce5a218..5fc2162 100644 +--- a/fs/nfs/dir.c ++++ b/fs/nfs/dir.c +@@ -377,7 +377,7 @@ int nfs_readdir_xdr_filler(struct page **pages, nfs_readdir_descriptor_t *desc, + again: + timestamp = jiffies; + gencount = nfs_inc_attr_generation_counter(); +- error = NFS_PROTO(inode)->readdir(file->f_path.dentry, cred, entry->cookie, pages, ++ error = NFS_PROTO(inode)->readdir(file_dentry(file), cred, entry->cookie, pages, + NFS_SERVER(inode)->dtsize, desc->plus); + if (error < 0) { + /* We requested READDIRPLUS, but the server doesn't grok it */ +@@ -560,7 +560,7 @@ int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *en + count++; + + if (desc->plus != 0) +- nfs_prime_dcache(desc->file->f_path.dentry, entry); ++ nfs_prime_dcache(file_dentry(desc->file), entry); + + status = nfs_readdir_add_to_array(entry, page); + if (status != 0) +@@ -864,7 +864,7 @@ static bool nfs_dir_mapping_need_revalidate(struct inode *dir) + */ + static int nfs_readdir(struct file *file, struct dir_context *ctx) + { +- struct dentry *dentry = file->f_path.dentry; ++ struct dentry *dentry = file_dentry(file); + struct inode *inode = d_inode(dentry); + nfs_readdir_descriptor_t my_desc, + *desc = &my_desc; +diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c +index 3e2071a..f714b98 100644 +--- a/fs/nfs/inode.c ++++ b/fs/nfs/inode.c +@@ -927,7 +927,7 @@ int nfs_open(struct inode *inode, struct file *filp) + { + struct nfs_open_context *ctx; + +- ctx = alloc_nfs_open_context(filp->f_path.dentry, filp->f_mode); ++ ctx = alloc_nfs_open_context(file_dentry(filp), filp->f_mode); + if (IS_ERR(ctx)) + return PTR_ERR(ctx); + nfs_file_set_open_context(filp, ctx); +diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c +index db9b5fe..679e003 100644 +--- a/fs/nfs/nfs4file.c ++++ b/fs/nfs/nfs4file.c +@@ -26,7 +26,7 @@ static int + nfs4_file_open(struct inode *inode, struct file *filp) + { + struct nfs_open_context *ctx; +- struct dentry *dentry = filp->f_path.dentry; ++ struct dentry *dentry = file_dentry(filp); + struct dentry *parent = NULL; + struct inode *dir; + unsigned openflags = filp->f_flags; +@@ -57,7 +57,7 @@ nfs4_file_open(struct inode *inode, struct file *filp) + parent = dget_parent(dentry); + dir = d_inode(parent); + +- ctx = alloc_nfs_open_context(filp->f_path.dentry, filp->f_mode); ++ ctx = alloc_nfs_open_context(file_dentry(filp), filp->f_mode); + err = PTR_ERR(ctx); + if (IS_ERR(ctx)) + goto out; +-- +2.7.1 + + +From 116e673eaedc86684a9a10bec9462b72fcaa6c6f Mon Sep 17 00:00:00 2001 +From: Filipe Manana +Date: Wed, 30 Mar 2016 19:03:13 -0400 +Subject: [PATCH 333/384] btrfs: fix crash/invalid memory access on fsync when + using overlayfs + +commit de17e793b104d690e1d007dfc5cb6b4f649598ca upstream. + +If the lower or upper directory of an overlayfs mount belong to a btrfs +file system and we fsync the file through the overlayfs' merged directory +we ended up accessing an inode that didn't belong to btrfs as if it were +a btrfs inode at btrfs_sync_file() resulting in a crash like the following: + +[ 7782.588845] BUG: unable to handle kernel NULL pointer dereference at 0000000000000544 +[ 7782.590624] IP: [] btrfs_sync_file+0x11b/0x3e9 [btrfs] +[ 7782.591931] PGD 4d954067 PUD 1e878067 PMD 0 +[ 7782.592016] Oops: 0002 [#6] PREEMPT SMP DEBUG_PAGEALLOC +[ 7782.592016] Modules linked in: btrfs overlay ppdev crc32c_generic evdev xor raid6_pq psmouse pcspkr sg serio_raw acpi_cpufreq parport_pc parport tpm_tis i2c_piix4 tpm i2c_core processor button loop autofs4 ext4 crc16 mbcache jbd2 sr_mod cdrom sd_mod ata_generic virtio_scsi ata_piix virtio_pci libata virtio_ring virtio scsi_mod e1000 floppy [last unloaded: btrfs] +[ 7782.592016] CPU: 10 PID: 16437 Comm: xfs_io Tainted: G D 4.5.0-rc6-btrfs-next-26+ #1 +[ 7782.592016] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS by qemu-project.org 04/01/2014 +[ 7782.592016] task: ffff88001b8d40c0 ti: ffff880137488000 task.ti: ffff880137488000 +[ 7782.592016] RIP: 0010:[] [] btrfs_sync_file+0x11b/0x3e9 [btrfs] +[ 7782.592016] RSP: 0018:ffff88013748be40 EFLAGS: 00010286 +[ 7782.592016] RAX: 0000000080000000 RBX: ffff880133b30c88 RCX: 0000000000000001 +[ 7782.592016] RDX: 0000000000000001 RSI: ffffffff8148fec0 RDI: 00000000ffffffff +[ 7782.592016] RBP: ffff88013748bec0 R08: 0000000000000001 R09: 0000000000000000 +[ 7782.624248] R10: ffff88013748be40 R11: 0000000000000246 R12: 0000000000000000 +[ 7782.624248] R13: 0000000000000000 R14: 00000000009305a0 R15: ffff880015e3be40 +[ 7782.624248] FS: 00007fa83b9cb700(0000) GS:ffff88023ed40000(0000) knlGS:0000000000000000 +[ 7782.624248] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +[ 7782.624248] CR2: 0000000000000544 CR3: 00000001fa652000 CR4: 00000000000006e0 +[ 7782.624248] Stack: +[ 7782.624248] ffffffff8108b5cc ffff88013748bec0 0000000000000246 ffff8800b005ded0 +[ 7782.624248] ffff880133b30d60 8000000000000000 7fffffffffffffff 0000000000000246 +[ 7782.624248] 0000000000000246 ffffffff81074f9b ffffffff8104357c ffff880015e3be40 +[ 7782.624248] Call Trace: +[ 7782.624248] [] ? arch_local_irq_save+0x9/0xc +[ 7782.624248] [] ? ___might_sleep+0xce/0x217 +[ 7782.624248] [] ? __do_page_fault+0x3c0/0x43a +[ 7782.624248] [] vfs_fsync_range+0x8c/0x9e +[ 7782.624248] [] vfs_fsync+0x1c/0x1e +[ 7782.624248] [] do_fsync+0x31/0x4a +[ 7782.624248] [] SyS_fsync+0x10/0x14 +[ 7782.624248] [] entry_SYSCALL_64_fastpath+0x12/0x6b +[ 7782.624248] Code: 85 c0 0f 85 e2 02 00 00 48 8b 45 b0 31 f6 4c 29 e8 48 ff c0 48 89 45 a8 48 8d 83 d8 00 00 00 48 89 c7 48 89 45 a0 e8 fc 43 18 e1 41 ff 84 24 44 05 00 00 48 8b 83 58 ff ff ff 48 c1 e8 07 83 +[ 7782.624248] RIP [] btrfs_sync_file+0x11b/0x3e9 [btrfs] +[ 7782.624248] RSP +[ 7782.624248] CR2: 0000000000000544 +[ 7782.661994] ---[ end trace 721e14960eb939bc ]--- + +This started happening since commit 4bacc9c9234 (overlayfs: Make f_path +always point to the overlay and f_inode to the underlay) and even though +after this change we could still access the btrfs inode through +struct file->f_mapping->host or struct file->f_inode, we would end up +resulting in more similar issues later on at check_parent_dirs_for_sync() +because the dentry we got (from struct file->f_path.dentry) was from +overlayfs and not from btrfs, that is, we had no way of getting the dentry +that belonged to btrfs (we always got the dentry that belonged to +overlayfs). + +The new patch from Miklos Szeredi, titled "vfs: add file_dentry()" and +recently submitted to linux-fsdevel, adds a file_dentry() API that allows +us to get the btrfs dentry from the input file and therefore being able +to fsync when the upper and lower directories belong to btrfs filesystems. + +This issue has been reported several times by users in the mailing list +and bugzilla. A test case for xfstests is being submitted as well. + +Fixes: 4bacc9c9234c ("overlayfs: Make f_path always point to the overlay and f_inode to the underlay") +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=101951 +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=109791 +Signed-off-by: Filipe Manana +Signed-off-by: Chris Mason +Signed-off-by: Greg Kroah-Hartman +--- + fs/btrfs/file.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c +index 0f09526..5e5db36 100644 +--- a/fs/btrfs/file.c ++++ b/fs/btrfs/file.c +@@ -1885,7 +1885,7 @@ static int start_ordered_ops(struct inode *inode, loff_t start, loff_t end) + */ + int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync) + { +- struct dentry *dentry = file->f_path.dentry; ++ struct dentry *dentry = file_dentry(file); + struct inode *inode = d_inode(dentry); + struct btrfs_root *root = BTRFS_I(inode)->root; + struct btrfs_trans_handle *trans; +-- +2.7.1 + + +From a5f6c436248ca974ea8be8cc8f3191006a981163 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Fri, 1 Apr 2016 01:31:28 -0400 +Subject: [PATCH 334/384] ext4: add lockdep annotations for i_data_sem + +commit daf647d2dd58cec59570d7698a45b98e580f2076 upstream. + +With the internal Quota feature, mke2fs creates empty quota inodes and +quota usage tracking is enabled as soon as the file system is mounted. +Since quotacheck is no longer preallocating all of the blocks in the +quota inode that are likely needed to be written to, we are now seeing +a lockdep false positive caused by needing to allocate a quota block +from inside ext4_map_blocks(), while holding i_data_sem for a data +inode. This results in this complaint: + + Possible unsafe locking scenario: + + CPU0 CPU1 + ---- ---- + lock(&ei->i_data_sem); + lock(&s->s_dquot.dqio_mutex); + lock(&ei->i_data_sem); + lock(&s->s_dquot.dqio_mutex); + +Google-Bug-Id: 27907753 + +Signed-off-by: Theodore Ts'o +Signed-off-by: Greg Kroah-Hartman +--- + fs/ext4/ext4.h | 23 +++++++++++++++++++++++ + fs/ext4/move_extent.c | 11 +++++++++-- + fs/ext4/super.c | 25 +++++++++++++++++++++++-- + 3 files changed, 55 insertions(+), 4 deletions(-) + +diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h +index cc7ca4e..d4156e1 100644 +--- a/fs/ext4/ext4.h ++++ b/fs/ext4/ext4.h +@@ -850,6 +850,29 @@ do { \ + #include "extents_status.h" + + /* ++ * Lock subclasses for i_data_sem in the ext4_inode_info structure. ++ * ++ * These are needed to avoid lockdep false positives when we need to ++ * allocate blocks to the quota inode during ext4_map_blocks(), while ++ * holding i_data_sem for a normal (non-quota) inode. Since we don't ++ * do quota tracking for the quota inode, this avoids deadlock (as ++ * well as infinite recursion, since it isn't turtles all the way ++ * down...) ++ * ++ * I_DATA_SEM_NORMAL - Used for most inodes ++ * I_DATA_SEM_OTHER - Used by move_inode.c for the second normal inode ++ * where the second inode has larger inode number ++ * than the first ++ * I_DATA_SEM_QUOTA - Used for quota inodes only ++ */ ++enum { ++ I_DATA_SEM_NORMAL = 0, ++ I_DATA_SEM_OTHER, ++ I_DATA_SEM_QUOTA, ++}; ++ ++ ++/* + * fourth extended file system inode data in memory + */ + struct ext4_inode_info { +diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c +index e032a04..9bdbf98 100644 +--- a/fs/ext4/move_extent.c ++++ b/fs/ext4/move_extent.c +@@ -60,10 +60,10 @@ ext4_double_down_write_data_sem(struct inode *first, struct inode *second) + { + if (first < second) { + down_write(&EXT4_I(first)->i_data_sem); +- down_write_nested(&EXT4_I(second)->i_data_sem, SINGLE_DEPTH_NESTING); ++ down_write_nested(&EXT4_I(second)->i_data_sem, I_DATA_SEM_OTHER); + } else { + down_write(&EXT4_I(second)->i_data_sem); +- down_write_nested(&EXT4_I(first)->i_data_sem, SINGLE_DEPTH_NESTING); ++ down_write_nested(&EXT4_I(first)->i_data_sem, I_DATA_SEM_OTHER); + + } + } +@@ -483,6 +483,13 @@ mext_check_arguments(struct inode *orig_inode, + return -EBUSY; + } + ++ if (IS_NOQUOTA(orig_inode) || IS_NOQUOTA(donor_inode)) { ++ ext4_debug("ext4 move extent: The argument files should " ++ "not be quota files [ino:orig %lu, donor %lu]\n", ++ orig_inode->i_ino, donor_inode->i_ino); ++ return -EBUSY; ++ } ++ + /* Ext4 move extent supports only extent based file */ + if (!(ext4_test_inode_flag(orig_inode, EXT4_INODE_EXTENTS))) { + ext4_debug("ext4 move extent: orig file is not extents " +diff --git a/fs/ext4/super.c b/fs/ext4/super.c +index c9ab67d..b54cb00 100644 +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -4936,6 +4936,20 @@ static int ext4_quota_on_mount(struct super_block *sb, int type) + EXT4_SB(sb)->s_jquota_fmt, type); + } + ++static void lockdep_set_quota_inode(struct inode *inode, int subclass) ++{ ++ struct ext4_inode_info *ei = EXT4_I(inode); ++ ++ /* The first argument of lockdep_set_subclass has to be ++ * *exactly* the same as the argument to init_rwsem() --- in ++ * this case, in init_once() --- or lockdep gets unhappy ++ * because the name of the lock is set using the ++ * stringification of the argument to init_rwsem(). ++ */ ++ (void) ei; /* shut up clang warning if !CONFIG_LOCKDEP */ ++ lockdep_set_subclass(&ei->i_data_sem, subclass); ++} ++ + /* + * Standard function to be called on quota_on + */ +@@ -4975,8 +4989,12 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id, + if (err) + return err; + } +- +- return dquot_quota_on(sb, type, format_id, path); ++ lockdep_set_quota_inode(path->dentry->d_inode, I_DATA_SEM_QUOTA); ++ err = dquot_quota_on(sb, type, format_id, path); ++ if (err) ++ lockdep_set_quota_inode(path->dentry->d_inode, ++ I_DATA_SEM_NORMAL); ++ return err; + } + + static int ext4_quota_enable(struct super_block *sb, int type, int format_id, +@@ -5002,8 +5020,11 @@ static int ext4_quota_enable(struct super_block *sb, int type, int format_id, + + /* Don't account quota for quota files to avoid recursion */ + qf_inode->i_flags |= S_NOQUOTA; ++ lockdep_set_quota_inode(qf_inode, I_DATA_SEM_QUOTA); + err = dquot_enable(qf_inode, type, format_id, flags); + iput(qf_inode); ++ if (err) ++ lockdep_set_quota_inode(qf_inode, I_DATA_SEM_NORMAL); + + return err; + } +-- +2.7.1 + + +From 9c67edcd30c6c46ae452abc5271eae1f467ca577 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Sun, 3 Apr 2016 17:03:37 -0400 +Subject: [PATCH 335/384] ext4: ignore quota mount options if the quota feature + is enabled + +commit c325a67c72903e1cc30e990a15ce745bda0dbfde upstream. + +Previously, ext4 would fail the mount if the file system had the quota +feature enabled and quota mount options (used for the older quota +setups) were present. This broke xfstests, since xfs silently ignores +the usrquote and grpquota mount options if they are specified. This +commit changes things so that we are consistent with xfs; having the +mount options specified is harmless, so no sense break users by +forbidding them. + +Signed-off-by: Theodore Ts'o +Signed-off-by: Greg Kroah-Hartman +--- + fs/ext4/super.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/fs/ext4/super.c b/fs/ext4/super.c +index b54cb00..ba1cf0b 100644 +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -1292,9 +1292,9 @@ static int set_qf_name(struct super_block *sb, int qtype, substring_t *args) + return -1; + } + if (ext4_has_feature_quota(sb)) { +- ext4_msg(sb, KERN_ERR, "Cannot set journaled quota options " +- "when QUOTA feature is enabled"); +- return -1; ++ ext4_msg(sb, KERN_INFO, "Journaled quota options " ++ "ignored when QUOTA feature is enabled"); ++ return 1; + } + qname = match_strdup(args); + if (!qname) { +@@ -1657,10 +1657,10 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token, + return -1; + } + if (ext4_has_feature_quota(sb)) { +- ext4_msg(sb, KERN_ERR, +- "Cannot set journaled quota options " ++ ext4_msg(sb, KERN_INFO, ++ "Quota format mount options ignored " + "when QUOTA feature is enabled"); +- return -1; ++ return 1; + } + sbi->s_jquota_fmt = m->mount_opt; + #endif +@@ -1721,11 +1721,11 @@ static int parse_options(char *options, struct super_block *sb, + #ifdef CONFIG_QUOTA + if (ext4_has_feature_quota(sb) && + (test_opt(sb, USRQUOTA) || test_opt(sb, GRPQUOTA))) { +- ext4_msg(sb, KERN_ERR, "Cannot set quota options when QUOTA " +- "feature is enabled"); +- return 0; +- } +- if (sbi->s_qf_names[USRQUOTA] || sbi->s_qf_names[GRPQUOTA]) { ++ ext4_msg(sb, KERN_INFO, "Quota feature enabled, usrquota and grpquota " ++ "mount options ignored."); ++ clear_opt(sb, USRQUOTA); ++ clear_opt(sb, GRPQUOTA); ++ } else if (sbi->s_qf_names[USRQUOTA] || sbi->s_qf_names[GRPQUOTA]) { + if (test_opt(sb, USRQUOTA) && sbi->s_qf_names[USRQUOTA]) + clear_opt(sb, USRQUOTA); + +-- +2.7.1 + + +From ba98356f1a36650adc2562f7b2abc5a2481a1783 Mon Sep 17 00:00:00 2001 +From: Joerg Roedel +Date: Mon, 4 Apr 2016 15:47:48 +0200 +Subject: [PATCH 336/384] iommu: Don't overwrite domain pointer when there is + no default_domain + +commit eebb8034a5be8c2177cbf07ca2ecd2ff8a058958 upstream. + +IOMMU drivers that do not support default domains, but make +use of the the group->domain pointer can get that pointer +overwritten with NULL on device add/remove. + +Make sure this can't happen by only overwriting the domain +pointer when it is NULL. + +Fixes: 1228236de5f9 ('iommu: Move default domain allocation to iommu_group_get_for_dev()') +Signed-off-by: Joerg Roedel +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iommu/iommu.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c +index 0e3b009..515bb8b 100644 +--- a/drivers/iommu/iommu.c ++++ b/drivers/iommu/iommu.c +@@ -848,7 +848,8 @@ struct iommu_group *iommu_group_get_for_dev(struct device *dev) + if (!group->default_domain) { + group->default_domain = __iommu_domain_alloc(dev->bus, + IOMMU_DOMAIN_DMA); +- group->domain = group->default_domain; ++ if (!group->domain) ++ group->domain = group->default_domain; + } + + ret = iommu_group_add_device(group, dev); +-- +2.7.1 + + +From 309e00ce992f6164adc9d0c900204bd51d4b52e5 Mon Sep 17 00:00:00 2001 +From: Filipe Manana +Date: Wed, 30 Mar 2016 23:37:21 +0100 +Subject: [PATCH 337/384] Btrfs: fix file/data loss caused by fsync after + rename and new inode + +commit 56f23fdbb600e6087db7b009775b95ce07cc3195 upstream. + +If we rename an inode A (be it a file or a directory), create a new +inode B with the old name of inode A and under the same parent directory, +fsync inode B and then power fail, at log tree replay time we end up +removing inode A completely. If inode A is a directory then all its files +are gone too. + +Example scenarios where this happens: +This is reproducible with the following steps, taken from a couple of +test cases written for fstests which are going to be submitted upstream +soon: + + # Scenario 1 + + mkfs.btrfs -f /dev/sdc + mount /dev/sdc /mnt + mkdir -p /mnt/a/x + echo "hello" > /mnt/a/x/foo + echo "world" > /mnt/a/x/bar + sync + mv /mnt/a/x /mnt/a/y + mkdir /mnt/a/x + xfs_io -c fsync /mnt/a/x + + + The next time the fs is mounted, log tree replay happens and + the directory "y" does not exist nor do the files "foo" and + "bar" exist anywhere (neither in "y" nor in "x", nor the root + nor anywhere). + + # Scenario 2 + + mkfs.btrfs -f /dev/sdc + mount /dev/sdc /mnt + mkdir /mnt/a + echo "hello" > /mnt/a/foo + sync + mv /mnt/a/foo /mnt/a/bar + echo "world" > /mnt/a/foo + xfs_io -c fsync /mnt/a/foo + + + The next time the fs is mounted, log tree replay happens and the + file "bar" does not exists anymore. A file with the name "foo" + exists and it matches the second file we created. + +Another related problem that does not involve file/data loss is when a +new inode is created with the name of a deleted snapshot and we fsync it: + + mkfs.btrfs -f /dev/sdc + mount /dev/sdc /mnt + mkdir /mnt/testdir + btrfs subvolume snapshot /mnt /mnt/testdir/snap + btrfs subvolume delete /mnt/testdir/snap + rmdir /mnt/testdir + mkdir /mnt/testdir + xfs_io -c fsync /mnt/testdir # or fsync some file inside /mnt/testdir + + + The next time the fs is mounted the log replay procedure fails because + it attempts to delete the snapshot entry (which has dir item key type + of BTRFS_ROOT_ITEM_KEY) as if it were a regular (non-root) entry, + resulting in the following error that causes mount to fail: + + [52174.510532] BTRFS info (device dm-0): failed to delete reference to snap, inode 257 parent 257 + [52174.512570] ------------[ cut here ]------------ + [52174.513278] WARNING: CPU: 12 PID: 28024 at fs/btrfs/inode.c:3986 __btrfs_unlink_inode+0x178/0x351 [btrfs]() + [52174.514681] BTRFS: Transaction aborted (error -2) + [52174.515630] Modules linked in: btrfs dm_flakey dm_mod overlay crc32c_generic ppdev xor raid6_pq acpi_cpufreq parport_pc tpm_tis sg parport tpm evdev i2c_piix4 proc + [52174.521568] CPU: 12 PID: 28024 Comm: mount Tainted: G W 4.5.0-rc6-btrfs-next-27+ #1 + [52174.522805] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS by qemu-project.org 04/01/2014 + [52174.524053] 0000000000000000 ffff8801df2a7710 ffffffff81264e93 ffff8801df2a7758 + [52174.524053] 0000000000000009 ffff8801df2a7748 ffffffff81051618 ffffffffa03591cd + [52174.524053] 00000000fffffffe ffff88015e6e5000 ffff88016dbc3c88 ffff88016dbc3c88 + [52174.524053] Call Trace: + [52174.524053] [] dump_stack+0x67/0x90 + [52174.524053] [] warn_slowpath_common+0x99/0xb2 + [52174.524053] [] ? __btrfs_unlink_inode+0x178/0x351 [btrfs] + [52174.524053] [] warn_slowpath_fmt+0x48/0x50 + [52174.524053] [] __btrfs_unlink_inode+0x178/0x351 [btrfs] + [52174.524053] [] ? iput+0xb0/0x284 + [52174.524053] [] btrfs_unlink_inode+0x1c/0x3d [btrfs] + [52174.524053] [] check_item_in_log+0x1fe/0x29b [btrfs] + [52174.524053] [] replay_dir_deletes+0x167/0x1cf [btrfs] + [52174.524053] [] fixup_inode_link_count+0x289/0x2aa [btrfs] + [52174.524053] [] fixup_inode_link_counts+0xcb/0x105 [btrfs] + [52174.524053] [] btrfs_recover_log_trees+0x258/0x32c [btrfs] + [52174.524053] [] ? replay_one_extent+0x511/0x511 [btrfs] + [52174.524053] [] open_ctree+0x1dd4/0x21b9 [btrfs] + [52174.524053] [] btrfs_mount+0x97e/0xaed [btrfs] + [52174.524053] [] ? trace_hardirqs_on+0xd/0xf + [52174.524053] [] mount_fs+0x67/0x131 + [52174.524053] [] vfs_kern_mount+0x6c/0xde + [52174.524053] [] btrfs_mount+0x1ac/0xaed [btrfs] + [52174.524053] [] ? trace_hardirqs_on+0xd/0xf + [52174.524053] [] ? lockdep_init_map+0xb9/0x1b3 + [52174.524053] [] mount_fs+0x67/0x131 + [52174.524053] [] vfs_kern_mount+0x6c/0xde + [52174.524053] [] do_mount+0x8a6/0x9e8 + [52174.524053] [] ? strndup_user+0x3f/0x59 + [52174.524053] [] SyS_mount+0x77/0x9f + [52174.524053] [] entry_SYSCALL_64_fastpath+0x12/0x6b + [52174.561288] ---[ end trace 6b53049efb1a3ea6 ]--- + +Fix this by forcing a transaction commit when such cases happen. +This means we check in the commit root of the subvolume tree if there +was any other inode with the same reference when the inode we are +fsync'ing is a new inode (created in the current transaction). + +Test cases for fstests, covering all the scenarios given above, were +submitted upstream for fstests: + + * fstests: generic test for fsync after renaming directory + https://patchwork.kernel.org/patch/8694281/ + + * fstests: generic test for fsync after renaming file + https://patchwork.kernel.org/patch/8694301/ + + * fstests: add btrfs test for fsync after snapshot deletion + https://patchwork.kernel.org/patch/8670671/ + +Signed-off-by: Filipe Manana +Signed-off-by: Chris Mason +Signed-off-by: Greg Kroah-Hartman +--- + fs/btrfs/tree-log.c | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 137 insertions(+) + +diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c +index 323e12c..0e044d7 100644 +--- a/fs/btrfs/tree-log.c ++++ b/fs/btrfs/tree-log.c +@@ -4406,6 +4406,127 @@ static int btrfs_log_trailing_hole(struct btrfs_trans_handle *trans, + return ret; + } + ++/* ++ * When we are logging a new inode X, check if it doesn't have a reference that ++ * matches the reference from some other inode Y created in a past transaction ++ * and that was renamed in the current transaction. If we don't do this, then at ++ * log replay time we can lose inode Y (and all its files if it's a directory): ++ * ++ * mkdir /mnt/x ++ * echo "hello world" > /mnt/x/foobar ++ * sync ++ * mv /mnt/x /mnt/y ++ * mkdir /mnt/x # or touch /mnt/x ++ * xfs_io -c fsync /mnt/x ++ * ++ * mount fs, trigger log replay ++ * ++ * After the log replay procedure, we would lose the first directory and all its ++ * files (file foobar). ++ * For the case where inode Y is not a directory we simply end up losing it: ++ * ++ * echo "123" > /mnt/foo ++ * sync ++ * mv /mnt/foo /mnt/bar ++ * echo "abc" > /mnt/foo ++ * xfs_io -c fsync /mnt/foo ++ * ++ * ++ * We also need this for cases where a snapshot entry is replaced by some other ++ * entry (file or directory) otherwise we end up with an unreplayable log due to ++ * attempts to delete the snapshot entry (entry of type BTRFS_ROOT_ITEM_KEY) as ++ * if it were a regular entry: ++ * ++ * mkdir /mnt/x ++ * btrfs subvolume snapshot /mnt /mnt/x/snap ++ * btrfs subvolume delete /mnt/x/snap ++ * rmdir /mnt/x ++ * mkdir /mnt/x ++ * fsync /mnt/x or fsync some new file inside it ++ * ++ * ++ * The snapshot delete, rmdir of x, mkdir of a new x and the fsync all happen in ++ * the same transaction. ++ */ ++static int btrfs_check_ref_name_override(struct extent_buffer *eb, ++ const int slot, ++ const struct btrfs_key *key, ++ struct inode *inode) ++{ ++ int ret; ++ struct btrfs_path *search_path; ++ char *name = NULL; ++ u32 name_len = 0; ++ u32 item_size = btrfs_item_size_nr(eb, slot); ++ u32 cur_offset = 0; ++ unsigned long ptr = btrfs_item_ptr_offset(eb, slot); ++ ++ search_path = btrfs_alloc_path(); ++ if (!search_path) ++ return -ENOMEM; ++ search_path->search_commit_root = 1; ++ search_path->skip_locking = 1; ++ ++ while (cur_offset < item_size) { ++ u64 parent; ++ u32 this_name_len; ++ u32 this_len; ++ unsigned long name_ptr; ++ struct btrfs_dir_item *di; ++ ++ if (key->type == BTRFS_INODE_REF_KEY) { ++ struct btrfs_inode_ref *iref; ++ ++ iref = (struct btrfs_inode_ref *)(ptr + cur_offset); ++ parent = key->offset; ++ this_name_len = btrfs_inode_ref_name_len(eb, iref); ++ name_ptr = (unsigned long)(iref + 1); ++ this_len = sizeof(*iref) + this_name_len; ++ } else { ++ struct btrfs_inode_extref *extref; ++ ++ extref = (struct btrfs_inode_extref *)(ptr + ++ cur_offset); ++ parent = btrfs_inode_extref_parent(eb, extref); ++ this_name_len = btrfs_inode_extref_name_len(eb, extref); ++ name_ptr = (unsigned long)&extref->name; ++ this_len = sizeof(*extref) + this_name_len; ++ } ++ ++ if (this_name_len > name_len) { ++ char *new_name; ++ ++ new_name = krealloc(name, this_name_len, GFP_NOFS); ++ if (!new_name) { ++ ret = -ENOMEM; ++ goto out; ++ } ++ name_len = this_name_len; ++ name = new_name; ++ } ++ ++ read_extent_buffer(eb, name, name_ptr, this_name_len); ++ di = btrfs_lookup_dir_item(NULL, BTRFS_I(inode)->root, ++ search_path, parent, ++ name, this_name_len, 0); ++ if (di && !IS_ERR(di)) { ++ ret = 1; ++ goto out; ++ } else if (IS_ERR(di)) { ++ ret = PTR_ERR(di); ++ goto out; ++ } ++ btrfs_release_path(search_path); ++ ++ cur_offset += this_len; ++ } ++ ret = 0; ++out: ++ btrfs_free_path(search_path); ++ kfree(name); ++ return ret; ++} ++ + /* log a single inode in the tree log. + * At least one parent directory for this inode must exist in the tree + * or be logged already. +@@ -4578,6 +4699,22 @@ again: + if (min_key.type == BTRFS_INODE_ITEM_KEY) + need_log_inode_item = false; + ++ if ((min_key.type == BTRFS_INODE_REF_KEY || ++ min_key.type == BTRFS_INODE_EXTREF_KEY) && ++ BTRFS_I(inode)->generation == trans->transid) { ++ ret = btrfs_check_ref_name_override(path->nodes[0], ++ path->slots[0], ++ &min_key, inode); ++ if (ret < 0) { ++ err = ret; ++ goto out_unlock; ++ } else if (ret > 0) { ++ err = 1; ++ btrfs_set_log_full_commit(root->fs_info, trans); ++ goto out_unlock; ++ } ++ } ++ + /* Skip xattrs, we log them later with btrfs_log_all_xattrs() */ + if (min_key.type == BTRFS_XATTR_ITEM_KEY) { + if (ins_nr == 0) +-- +2.7.1 + + +From 7bcc12e9fbd572fbc43d9415fd006f3b89a3d8d1 Mon Sep 17 00:00:00 2001 +From: Peter Zijlstra +Date: Wed, 24 Feb 2016 18:45:41 +0100 +Subject: [PATCH 338/384] perf: Do not double free + +commit 130056275ade730e7a79c110212c8815202773ee upstream. + +In case of: err_file: fput(event_file), we'll end up calling +perf_release() which in turn will free the event. + +Do not then free the event _again_. + +Tested-by: Alexander Shishkin +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Alexander Shishkin +Cc: Arnaldo Carvalho de Melo +Cc: Jiri Olsa +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Cc: dvyukov@google.com +Cc: eranian@google.com +Cc: oleg@redhat.com +Cc: panand@redhat.com +Cc: sasha.levin@oracle.com +Cc: vince@deater.net +Link: http://lkml.kernel.org/r/20160224174947.697350349@infradead.org +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + kernel/events/core.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/kernel/events/core.c b/kernel/events/core.c +index 53a4b55..8464fe7 100644 +--- a/kernel/events/core.c ++++ b/kernel/events/core.c +@@ -8585,7 +8585,12 @@ err_context: + perf_unpin_context(ctx); + put_ctx(ctx); + err_alloc: +- free_event(event); ++ /* ++ * If event_file is set, the fput() above will have called ->release() ++ * and that will take care of freeing the event. ++ */ ++ if (!event_file) ++ free_event(event); + err_cpus: + put_online_cpus(); + err_task: +-- +2.7.1 + + +From 468a07077124506dc9e4bfed400e1e587767e43e Mon Sep 17 00:00:00 2001 +From: Peter Zijlstra +Date: Wed, 24 Feb 2016 18:45:46 +0100 +Subject: [PATCH 339/384] perf: Cure event->pending_disable race + +commit 28a967c3a2f99fa3b5f762f25cb2a319d933571b upstream. + +Because event_sched_out() checks event->pending_disable _before_ +actually disabling the event, it can happen that the event fires after +it checks but before it gets disabled. + +This would leave event->pending_disable set and the queued irq_work +will try and process it. + +However, if the event trigger was during schedule(), the event might +have been de-scheduled by the time the irq_work runs, and +perf_event_disable_local() will fail. + +Fix this by checking event->pending_disable _after_ we call +event->pmu->del(). This depends on the latter being a compiler +barrier, such that the compiler does not lift the load and re-creates +the problem. + +Tested-by: Alexander Shishkin +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Alexander Shishkin +Cc: Arnaldo Carvalho de Melo +Cc: Jiri Olsa +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Cc: dvyukov@google.com +Cc: eranian@google.com +Cc: oleg@redhat.com +Cc: panand@redhat.com +Cc: sasha.levin@oracle.com +Cc: vince@deater.net +Link: http://lkml.kernel.org/r/20160224174948.040469884@infradead.org +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + kernel/events/core.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/kernel/events/core.c b/kernel/events/core.c +index 8464fe7..36f88ec 100644 +--- a/kernel/events/core.c ++++ b/kernel/events/core.c +@@ -1581,14 +1581,14 @@ event_sched_out(struct perf_event *event, + + perf_pmu_disable(event->pmu); + ++ event->tstamp_stopped = tstamp; ++ event->pmu->del(event, 0); ++ event->oncpu = -1; + event->state = PERF_EVENT_STATE_INACTIVE; + if (event->pending_disable) { + event->pending_disable = 0; + event->state = PERF_EVENT_STATE_OFF; + } +- event->tstamp_stopped = tstamp; +- event->pmu->del(event, 0); +- event->oncpu = -1; + + if (!is_software_event(event)) + cpuctx->active_oncpu--; +-- +2.7.1 + + +From dae3b6318b12ab5b3e60c482e14741196704415e Mon Sep 17 00:00:00 2001 +From: Adrian Hunter +Date: Mon, 4 Apr 2016 12:40:37 +0300 +Subject: [PATCH 340/384] mmc: sdhci-pci: Add support and PCI IDs for more + Broxton host controllers + +commit 01d6b2a40a0fa73c90e05b1033f181a51fec9292 upstream. + +Add support and PCI IDs for more Broxton host controllers + +Other BXT IDs were added in v4.4 so cc'ing stable. This patch +is dependent on commit 163cbe31e516 ("mmc: sdhci-pci: Fix card +detect race for Intel BXT/APL") but that is already in stable +since v4.4.4. + +Signed-off-by: Adrian Hunter +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/host/sdhci-pci-core.c | 25 +++++++++++++++++++++++++ + drivers/mmc/host/sdhci-pci.h | 3 +++ + 2 files changed, 28 insertions(+) + +diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c +index df3b8ec..a04d0f7 100644 +--- a/drivers/mmc/host/sdhci-pci-core.c ++++ b/drivers/mmc/host/sdhci-pci-core.c +@@ -390,6 +390,7 @@ static int byt_sd_probe_slot(struct sdhci_pci_slot *slot) + slot->cd_idx = 0; + slot->cd_override_level = true; + if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXT_SD || ++ slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXTM_SD || + slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_APL_SD) + slot->host->mmc_host_ops.get_cd = bxt_get_cd; + +@@ -1173,6 +1174,30 @@ static const struct pci_device_id pci_ids[] = { + + { + .vendor = PCI_VENDOR_ID_INTEL, ++ .device = PCI_DEVICE_ID_INTEL_BXTM_EMMC, ++ .subvendor = PCI_ANY_ID, ++ .subdevice = PCI_ANY_ID, ++ .driver_data = (kernel_ulong_t)&sdhci_intel_byt_emmc, ++ }, ++ ++ { ++ .vendor = PCI_VENDOR_ID_INTEL, ++ .device = PCI_DEVICE_ID_INTEL_BXTM_SDIO, ++ .subvendor = PCI_ANY_ID, ++ .subdevice = PCI_ANY_ID, ++ .driver_data = (kernel_ulong_t)&sdhci_intel_byt_sdio, ++ }, ++ ++ { ++ .vendor = PCI_VENDOR_ID_INTEL, ++ .device = PCI_DEVICE_ID_INTEL_BXTM_SD, ++ .subvendor = PCI_ANY_ID, ++ .subdevice = PCI_ANY_ID, ++ .driver_data = (kernel_ulong_t)&sdhci_intel_byt_sd, ++ }, ++ ++ { ++ .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_APL_EMMC, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, +diff --git a/drivers/mmc/host/sdhci-pci.h b/drivers/mmc/host/sdhci-pci.h +index d1a0b4d..89e7151 100644 +--- a/drivers/mmc/host/sdhci-pci.h ++++ b/drivers/mmc/host/sdhci-pci.h +@@ -28,6 +28,9 @@ + #define PCI_DEVICE_ID_INTEL_BXT_SD 0x0aca + #define PCI_DEVICE_ID_INTEL_BXT_EMMC 0x0acc + #define PCI_DEVICE_ID_INTEL_BXT_SDIO 0x0ad0 ++#define PCI_DEVICE_ID_INTEL_BXTM_SD 0x1aca ++#define PCI_DEVICE_ID_INTEL_BXTM_EMMC 0x1acc ++#define PCI_DEVICE_ID_INTEL_BXTM_SDIO 0x1ad0 + #define PCI_DEVICE_ID_INTEL_APL_SD 0x5aca + #define PCI_DEVICE_ID_INTEL_APL_EMMC 0x5acc + #define PCI_DEVICE_ID_INTEL_APL_SDIO 0x5ad0 +-- +2.7.1 + + +From 29803d09a602ac330c50e38851d04350a44362d3 Mon Sep 17 00:00:00 2001 +From: David Henningsson +Date: Thu, 25 Feb 2016 09:37:05 +0100 +Subject: [PATCH 341/384] ALSA: hda - Fixup speaker pass-through control for + nid 0x14 on ALC225 + +commit 2ae955774f29bbd7d16149cb0ae8d0319bf2ecc4 upstream. + +On one of the machines we enable, we found that the actual speaker volume +did not always correspond to the volume set in alsamixer. This patch +fixes that problem. + +This patch was orginally written by Kailang @ Realtek, I've rebased it +to fit sound git master. + +BugLink: https://bugs.launchpad.net/bugs/1549660 +Co-Authored-By: Kailang +Signed-off-by: David Henningsson +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 23 +++++++++++++++++++++-- + 1 file changed, 21 insertions(+), 2 deletions(-) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index 3671eb8..c709efc 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -3801,6 +3801,10 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, + + static void alc_headset_mode_default(struct hda_codec *codec) + { ++ static struct coef_fw coef0225[] = { ++ UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), ++ {} ++ }; + static struct coef_fw coef0255[] = { + WRITE_COEF(0x45, 0xc089), + WRITE_COEF(0x45, 0xc489), +@@ -3842,6 +3846,9 @@ static void alc_headset_mode_default(struct hda_codec *codec) + }; + + switch (codec->core.vendor_id) { ++ case 0x10ec0225: ++ alc_process_coef_fw(codec, coef0225); ++ break; + case 0x10ec0255: + case 0x10ec0256: + alc_process_coef_fw(codec, coef0255); +@@ -4750,6 +4757,7 @@ enum { + ALC293_FIXUP_LENOVO_SPK_NOISE, + ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, + ALC255_FIXUP_DELL_SPK_NOISE, ++ ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, + }; + + static const struct hda_fixup alc269_fixups[] = { +@@ -5375,6 +5383,17 @@ static const struct hda_fixup alc269_fixups[] = { + .chained = true, + .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE + }, ++ [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = { ++ .type = HDA_FIXUP_VERBS, ++ .v.verbs = (const struct hda_verb[]) { ++ /* Disable pass-through path for FRONT 14h */ ++ { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, ++ { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, ++ {} ++ }, ++ .chained = true, ++ .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE ++ }, + }; + + static const struct snd_pci_quirk alc269_fixup_tbl[] = { +@@ -5648,10 +5667,10 @@ static const struct hda_model_fixup alc269_fixup_models[] = { + {0x21, 0x03211020} + + static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { +- SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, ++ SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, + ALC225_STANDARD_PINS, + {0x14, 0x901701a0}), +- SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, ++ SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, + ALC225_STANDARD_PINS, + {0x14, 0x901701b0}), + SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, +-- +2.7.1 + + +From 7e214695660f0638f4969cb8b6dead8097543d0e Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 25 Feb 2016 14:31:59 +0100 +Subject: [PATCH 342/384] ALSA: hda - Fix headset support and noise on HP + EliteBook 755 G2 + +commit f883982dc1b117f04579f0896821cd9f2e397f94 upstream. + +HP EliteBook 755 G2 with ALC3228 (ALC280) codec [103c:221c] requires +the known fixup (ALC269_FIXUP_HEADSET_MIC) for making the headset mic +working. Also, it suffers from the loopback noise problem, so we +should disable aamix path as well. + +Reported-by: Derick Eddington +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index c709efc..73978c7 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -4758,6 +4758,7 @@ enum { + ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, + ALC255_FIXUP_DELL_SPK_NOISE, + ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, ++ ALC280_FIXUP_HP_HEADSET_MIC, + }; + + static const struct hda_fixup alc269_fixups[] = { +@@ -5394,6 +5395,12 @@ static const struct hda_fixup alc269_fixups[] = { + .chained = true, + .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE + }, ++ [ALC280_FIXUP_HP_HEADSET_MIC] = { ++ .type = HDA_FIXUP_FUNC, ++ .v.func = alc_fixup_disable_aamix, ++ .chained = true, ++ .chain_id = ALC269_FIXUP_HEADSET_MIC, ++ }, + }; + + static const struct snd_pci_quirk alc269_fixup_tbl[] = { +@@ -5498,6 +5505,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { + SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), + SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), + SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), ++ SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), + SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), + SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), + SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), +-- +2.7.1 + + +From 9d84c31455b60a50b4fb8ee076d63e76786143c6 Mon Sep 17 00:00:00 2001 +From: Hui Wang +Date: Fri, 1 Apr 2016 11:00:15 +0800 +Subject: [PATCH 343/384] ALSA: hda - fix front mic problem for a HP desktop + +commit e549d190f7b5f94e9ab36bd965028112914d010d upstream. + +The front mic jack (pink color) can't detect any plug or unplug. After +applying this fix, both detecting function and recording function +work well. + +BugLink: https://bugs.launchpad.net/bugs/1564712 +Signed-off-by: Hui Wang +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index 73978c7..fefe83f 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -4759,6 +4759,7 @@ enum { + ALC255_FIXUP_DELL_SPK_NOISE, + ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, + ALC280_FIXUP_HP_HEADSET_MIC, ++ ALC221_FIXUP_HP_FRONT_MIC, + }; + + static const struct hda_fixup alc269_fixups[] = { +@@ -5401,6 +5402,13 @@ static const struct hda_fixup alc269_fixups[] = { + .chained = true, + .chain_id = ALC269_FIXUP_HEADSET_MIC, + }, ++ [ALC221_FIXUP_HP_FRONT_MIC] = { ++ .type = HDA_FIXUP_PINS, ++ .v.pins = (const struct hda_pintbl[]) { ++ { 0x19, 0x02a19020 }, /* Front Mic */ ++ { } ++ }, ++ }, + }; + + static const struct snd_pci_quirk alc269_fixup_tbl[] = { +@@ -5506,6 +5514,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { + SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), + SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), + SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), ++ SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), + SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), + SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), + SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), +-- +2.7.1 + + +From 7f8c616ae5874669a71003bfbc64233a8426af6c Mon Sep 17 00:00:00 2001 +From: Sven Eckelmann +Date: Mon, 11 Apr 2016 16:55:26 +0200 +Subject: [PATCH 344/384] ALSA: hda/realtek - Enable the ALC292 dock fixup on + the Thinkpad T460s + +commit c636b95ec5980345674ad7960a3c67135a84b687 upstream. + +The Lenovo Thinkpad T460s requires the alc_fixup_tpt440_dock as well in +order to get working sound output on the docking stations headphone jack. + +Patch tested on a Thinkpad T460s (20F9CT01WW) using a ThinkPad Ultradock +on kernel 4.4.6. + +Signed-off-by: Sven Eckelmann +Tested-by: Simon Wunderlich +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index fefe83f..1402ba9 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -4760,6 +4760,7 @@ enum { + ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, + ALC280_FIXUP_HP_HEADSET_MIC, + ALC221_FIXUP_HP_FRONT_MIC, ++ ALC292_FIXUP_TPT460, + }; + + static const struct hda_fixup alc269_fixups[] = { +@@ -5409,6 +5410,12 @@ static const struct hda_fixup alc269_fixups[] = { + { } + }, + }, ++ [ALC292_FIXUP_TPT460] = { ++ .type = HDA_FIXUP_FUNC, ++ .v.func = alc_fixup_tpt440_dock, ++ .chained = true, ++ .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, ++ }, + }; + + static const struct snd_pci_quirk alc269_fixup_tbl[] = { +@@ -5563,7 +5570,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { + SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK), + SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), + SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), +- SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), ++ SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), + SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), + SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), + SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), +@@ -5658,6 +5665,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = { + {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, + {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, + {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, ++ {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, + {} + }; + #define ALC225_STANDARD_PINS \ +-- +2.7.1 + + +From 8c25e4c2c6f6d7e718ae437f59586f9f2d867028 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 4 Apr 2016 11:47:50 +0200 +Subject: [PATCH 345/384] ALSA: usb-audio: Add a sample rate quirk for Phoenix + Audio TMX320 + +commit f03b24a851d32ca85dacab01785b24a7ee717d37 upstream. + +Phoenix Audio TMX320 gives the similar error when the sample rate is +asked: + usb 2-1.3: 2:1: cannot get freq at ep 0x85 + usb 2-1.3: 1:1: cannot get freq at ep 0x2 + .... + +Add the corresponding USB-device ID (1de7:0014) to +snd_usb_get_sample_rate_quirk() list. + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=110221 +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/quirks.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c +index cd7eac2..4f2dedf 100644 +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -1138,6 +1138,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) + case USB_ID(0x047F, 0xAA05): /* Plantronics DA45 */ + case USB_ID(0x04D8, 0xFEEA): /* Benchmark DAC1 Pre */ + case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */ ++ case USB_ID(0x1de7, 0x0014): /* Phoenix Audio TMX320 */ + case USB_ID(0x21B4, 0x0081): /* AudioQuest DragonFly */ + return true; + } +-- +2.7.1 + + +From 4030a5923f83c9e38206d34813bc82d1e31e1045 Mon Sep 17 00:00:00 2001 +From: Dennis Kadioglu +Date: Wed, 6 Apr 2016 08:39:01 +0200 +Subject: [PATCH 346/384] ALSA: usb-audio: Add a quirk for Plantronics BT300 + +commit b4203ff5464da00b7812e7b480192745b0d66bbf upstream. + +Plantronics BT300 does not support reading the sample rate which leads +to many lines of "cannot get freq at ep 0x1". This patch adds the USB +ID of the BT300 to quirks.c and avoids those error messages. + +Signed-off-by: Dennis Kadioglu +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/quirks.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c +index 4f2dedf..001fb4d 100644 +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -1135,6 +1135,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) + case USB_ID(0x045E, 0x076F): /* MS Lifecam HD-6000 */ + case USB_ID(0x045E, 0x0772): /* MS Lifecam Studio */ + case USB_ID(0x045E, 0x0779): /* MS Lifecam HD-3000 */ ++ case USB_ID(0x047F, 0x0415): /* Plantronics BT-300 */ + case USB_ID(0x047F, 0xAA05): /* Plantronics DA45 */ + case USB_ID(0x04D8, 0xFEEA): /* Benchmark DAC1 Pre */ + case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */ +-- +2.7.1 + + +From 6a0150f55c4fe921585b6f40f46e2b555a073fcc Mon Sep 17 00:00:00 2001 +From: Kailang Yang +Date: Tue, 12 Apr 2016 10:55:03 +0800 +Subject: [PATCH 347/384] ALSA: usb-audio: Skip volume controls triggers hangup + on Dell USB Dock + +commit adcdd0d5a1cb779f6d455ae70882c19c527627a8 upstream. + +This is Dell usb dock audio workaround. +It was fixed the master volume keep lower. + +[Some background: the patch essentially skips the controls of a couple + of FU volumes. Although the firmware exposes the dB and the value + information via the usb descriptor, changing the values (we set the + min volume as default) screws up the device. Although this has been + fixed in the newer firmware, the devices are shipped with the old + firmware, thus we need the workaround in the driver side. -- tiwai] + +Signed-off-by: Kailang Yang +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/mixer_maps.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c +index ddca654..1f8fb0d9 100644 +--- a/sound/usb/mixer_maps.c ++++ b/sound/usb/mixer_maps.c +@@ -349,6 +349,16 @@ static struct usbmix_name_map bose_companion5_map[] = { + }; + + /* ++ * Dell usb dock with ALC4020 codec had a firmware problem where it got ++ * screwed up when zero volume is passed; just skip it as a workaround ++ */ ++static const struct usbmix_name_map dell_alc4020_map[] = { ++ { 16, NULL }, ++ { 19, NULL }, ++ { 0 } ++}; ++ ++/* + * Control map entries + */ + +@@ -431,6 +441,10 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = { + .map = aureon_51_2_map, + }, + { ++ .id = USB_ID(0x0bda, 0x4014), ++ .map = dell_alc4020_map, ++ }, ++ { + .id = USB_ID(0x0dba, 0x1000), + .map = mbox1_map, + }, +-- +2.7.1 + + +From 72a32fc089b37af192ef6989f25206e54dd48a05 Mon Sep 17 00:00:00 2001 +From: Benjamin Tissoires +Date: Fri, 25 Mar 2016 15:26:55 +0100 +Subject: [PATCH 348/384] HID: wacom: fix Bamboo ONE oops + +commit 580549ef6b3e3fb3b958de490ca99f43a089a2cf upstream. + +Looks like recent changes in the Wacom driver made the Bamboo ONE crashes. +The tablet behaves as if it was a regular Bamboo device with pen, touch +and pad, but there is no physical pad connected to it. +The weird part is that the pad is still sending events and given that +there is no input node connected to it, we get anull pointer exception. + +Link: https://bugzilla.redhat.com/show_bug.cgi?id=1317116 + +Signed-off-by: Benjamin Tissoires +Acked-by: Ping Cheng +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hid/wacom_wac.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c +index 01a4f05..3c0f47a 100644 +--- a/drivers/hid/wacom_wac.c ++++ b/drivers/hid/wacom_wac.c +@@ -2493,6 +2493,17 @@ void wacom_setup_device_quirks(struct wacom *wacom) + } + + /* ++ * Hack for the Bamboo One: ++ * the device presents a PAD/Touch interface as most Bamboos and even ++ * sends ghosts PAD data on it. However, later, we must disable this ++ * ghost interface, and we can not detect it unless we set it here ++ * to WACOM_DEVICETYPE_PAD or WACOM_DEVICETYPE_TOUCH. ++ */ ++ if (features->type == BAMBOO_PEN && ++ features->pktlen == WACOM_PKGLEN_BBTOUCH3) ++ features->device_type |= WACOM_DEVICETYPE_PAD; ++ ++ /* + * Raw Wacom-mode pen and touch events both come from interface + * 0, whose HID descriptor has an application usage of 0xFF0D + * (i.e., WACOM_VENDORDEFINED_PEN). We route pen packets back +-- +2.7.1 + + +From d7c7e0ef4cda72bc526f221c91b2073c83b2afa9 Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Wed, 23 Mar 2016 12:17:09 -0400 +Subject: [PATCH 349/384] HID: usbhid: fix inconsistent + reset/resume/reset-resume behavior + +commit 972e6a993f278b416a8ee3ec65475724fc36feb2 upstream. + +The usbhid driver has inconsistently duplicated code in its post-reset, +resume, and reset-resume pathways. + + reset-resume doesn't check HID_STARTED before trying to + restart the I/O queues. + + resume fails to clear the HID_SUSPENDED flag if HID_STARTED + isn't set. + + resume calls usbhid_restart_queues() with usbhid->lock held + and the others call it without holding the lock. + +The first item in particular causes a problem following a reset-resume +if the driver hasn't started up its I/O. URB submission fails because +usbhid->urbin is NULL, and this triggers an unending reset-retry loop. + +This patch fixes the problem by creating a new subroutine, +hid_restart_io(), to carry out all the common activities. It also +adds some checks that were missing in the original code: + + After a reset, there's no need to clear any halted endpoints. + + After a resume, if a reset is pending there's no need to + restart any I/O until the reset is finished. + + After a resume, if the interrupt-IN endpoint is halted there's + no need to submit the input URB until the halt has been + cleared. + +Signed-off-by: Alan Stern +Reported-by: Daniel Fraga +Tested-by: Daniel Fraga +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hid/usbhid/hid-core.c | 73 ++++++++++++++++++++++--------------------- + 1 file changed, 37 insertions(+), 36 deletions(-) + +diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c +index 5dd426f..0df32fe 100644 +--- a/drivers/hid/usbhid/hid-core.c ++++ b/drivers/hid/usbhid/hid-core.c +@@ -951,14 +951,6 @@ static int usbhid_output_report(struct hid_device *hid, __u8 *buf, size_t count) + return ret; + } + +-static void usbhid_restart_queues(struct usbhid_device *usbhid) +-{ +- if (usbhid->urbout && !test_bit(HID_OUT_RUNNING, &usbhid->iofl)) +- usbhid_restart_out_queue(usbhid); +- if (!test_bit(HID_CTRL_RUNNING, &usbhid->iofl)) +- usbhid_restart_ctrl_queue(usbhid); +-} +- + static void hid_free_buffers(struct usb_device *dev, struct hid_device *hid) + { + struct usbhid_device *usbhid = hid->driver_data; +@@ -1404,6 +1396,37 @@ static void hid_cease_io(struct usbhid_device *usbhid) + usb_kill_urb(usbhid->urbout); + } + ++static void hid_restart_io(struct hid_device *hid) ++{ ++ struct usbhid_device *usbhid = hid->driver_data; ++ int clear_halt = test_bit(HID_CLEAR_HALT, &usbhid->iofl); ++ int reset_pending = test_bit(HID_RESET_PENDING, &usbhid->iofl); ++ ++ spin_lock_irq(&usbhid->lock); ++ clear_bit(HID_SUSPENDED, &usbhid->iofl); ++ usbhid_mark_busy(usbhid); ++ ++ if (clear_halt || reset_pending) ++ schedule_work(&usbhid->reset_work); ++ usbhid->retry_delay = 0; ++ spin_unlock_irq(&usbhid->lock); ++ ++ if (reset_pending || !test_bit(HID_STARTED, &usbhid->iofl)) ++ return; ++ ++ if (!clear_halt) { ++ if (hid_start_in(hid) < 0) ++ hid_io_error(hid); ++ } ++ ++ spin_lock_irq(&usbhid->lock); ++ if (usbhid->urbout && !test_bit(HID_OUT_RUNNING, &usbhid->iofl)) ++ usbhid_restart_out_queue(usbhid); ++ if (!test_bit(HID_CTRL_RUNNING, &usbhid->iofl)) ++ usbhid_restart_ctrl_queue(usbhid); ++ spin_unlock_irq(&usbhid->lock); ++} ++ + /* Treat USB reset pretty much the same as suspend/resume */ + static int hid_pre_reset(struct usb_interface *intf) + { +@@ -1453,14 +1476,14 @@ static int hid_post_reset(struct usb_interface *intf) + return 1; + } + ++ /* No need to do another reset or clear a halted endpoint */ + spin_lock_irq(&usbhid->lock); + clear_bit(HID_RESET_PENDING, &usbhid->iofl); ++ clear_bit(HID_CLEAR_HALT, &usbhid->iofl); + spin_unlock_irq(&usbhid->lock); + hid_set_idle(dev, intf->cur_altsetting->desc.bInterfaceNumber, 0, 0); +- status = hid_start_in(hid); +- if (status < 0) +- hid_io_error(hid); +- usbhid_restart_queues(usbhid); ++ ++ hid_restart_io(hid); + + return 0; + } +@@ -1483,25 +1506,9 @@ void usbhid_put_power(struct hid_device *hid) + #ifdef CONFIG_PM + static int hid_resume_common(struct hid_device *hid, bool driver_suspended) + { +- struct usbhid_device *usbhid = hid->driver_data; +- int status; +- +- spin_lock_irq(&usbhid->lock); +- clear_bit(HID_SUSPENDED, &usbhid->iofl); +- usbhid_mark_busy(usbhid); +- +- if (test_bit(HID_CLEAR_HALT, &usbhid->iofl) || +- test_bit(HID_RESET_PENDING, &usbhid->iofl)) +- schedule_work(&usbhid->reset_work); +- usbhid->retry_delay = 0; +- +- usbhid_restart_queues(usbhid); +- spin_unlock_irq(&usbhid->lock); +- +- status = hid_start_in(hid); +- if (status < 0) +- hid_io_error(hid); ++ int status = 0; + ++ hid_restart_io(hid); + if (driver_suspended && hid->driver && hid->driver->resume) + status = hid->driver->resume(hid); + return status; +@@ -1570,12 +1577,8 @@ static int hid_suspend(struct usb_interface *intf, pm_message_t message) + static int hid_resume(struct usb_interface *intf) + { + struct hid_device *hid = usb_get_intfdata (intf); +- struct usbhid_device *usbhid = hid->driver_data; + int status; + +- if (!test_bit(HID_STARTED, &usbhid->iofl)) +- return 0; +- + status = hid_resume_common(hid, true); + dev_dbg(&intf->dev, "resume status %d\n", status); + return 0; +@@ -1584,10 +1587,8 @@ static int hid_resume(struct usb_interface *intf) + static int hid_reset_resume(struct usb_interface *intf) + { + struct hid_device *hid = usb_get_intfdata(intf); +- struct usbhid_device *usbhid = hid->driver_data; + int status; + +- clear_bit(HID_SUSPENDED, &usbhid->iofl); + status = hid_post_reset(intf); + if (status >= 0 && hid->driver && hid->driver->reset_resume) { + int ret = hid->driver->reset_resume(hid); +-- +2.7.1 + + +From 342f2c7913c5eb2a7548567e95c9520a114a52a9 Mon Sep 17 00:00:00 2001 +From: Bjorn Helgaas +Date: Wed, 17 Feb 2016 12:26:33 -0600 +Subject: [PATCH 350/384] Revert "x86/PCI: Don't alloc pcibios-irq when MSI is + enabled" + +commit fe25d078874f2c29c38f4160467d74f5756537c9 upstream. + +Revert 8affb487d4a4 ("x86/PCI: Don't alloc pcibios-irq when MSI is +enabled"). + +This is part of reverting 991de2e59090 ("PCI, x86: Implement +pcibios_alloc_irq() and pcibios_free_irq()") to fix regressions it +introduced. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=111211 +Fixes: 991de2e59090 ("PCI, x86: Implement pcibios_alloc_irq() and pcibios_free_irq()") +Signed-off-by: Bjorn Helgaas +Acked-by: Rafael J. Wysocki +CC: Jiang Liu +CC: Joerg Roedel +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/pci/common.c | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c +index eccd4d9..dc78a4a 100644 +--- a/arch/x86/pci/common.c ++++ b/arch/x86/pci/common.c +@@ -675,14 +675,6 @@ int pcibios_add_device(struct pci_dev *dev) + + int pcibios_alloc_irq(struct pci_dev *dev) + { +- /* +- * If the PCI device was already claimed by core code and has +- * MSI enabled, probing of the pcibios IRQ will overwrite +- * dev->irq. So bail out if MSI is already enabled. +- */ +- if (pci_dev_msi_enabled(dev)) +- return -EBUSY; +- + return pcibios_enable_irq(dev); + } + +-- +2.7.1 + + +From 501e2001d6cd3954837001834b89d91bef6c6ce8 Mon Sep 17 00:00:00 2001 +From: Bjorn Helgaas +Date: Wed, 17 Feb 2016 12:26:38 -0600 +Subject: [PATCH 351/384] Revert "PCI: Add helpers to manage pci_dev->irq and + pci_dev->irq_managed" + +commit 67b4eab91caf2ad574cab1b17ae09180ea2e116e upstream. + +Revert 811a4e6fce09 ("PCI: Add helpers to manage pci_dev->irq and +pci_dev->irq_managed"). + +This is part of reverting 991de2e59090 ("PCI, x86: Implement +pcibios_alloc_irq() and pcibios_free_irq()") to fix regressions it +introduced. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=111211 +Fixes: 991de2e59090 ("PCI, x86: Implement pcibios_alloc_irq() and pcibios_free_irq()") +Signed-off-by: Bjorn Helgaas +Acked-by: Rafael J. Wysocki +CC: Jiang Liu +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/pci/intel_mid_pci.c | 4 ++-- + arch/x86/pci/irq.c | 10 ++++++---- + drivers/acpi/pci_irq.c | 10 ++++++---- + include/linux/pci.h | 17 ----------------- + 4 files changed, 14 insertions(+), 27 deletions(-) + +diff --git a/arch/x86/pci/intel_mid_pci.c b/arch/x86/pci/intel_mid_pci.c +index 0d24e7c..8826ff5 100644 +--- a/arch/x86/pci/intel_mid_pci.c ++++ b/arch/x86/pci/intel_mid_pci.c +@@ -215,7 +215,7 @@ static int intel_mid_pci_irq_enable(struct pci_dev *dev) + int polarity; + int ret; + +- if (pci_has_managed_irq(dev)) ++ if (dev->irq_managed && dev->irq > 0) + return 0; + + switch (intel_mid_identify_cpu()) { +@@ -256,7 +256,7 @@ static int intel_mid_pci_irq_enable(struct pci_dev *dev) + + static void intel_mid_pci_irq_disable(struct pci_dev *dev) + { +- if (pci_has_managed_irq(dev)) { ++ if (dev->irq_managed && dev->irq > 0) { + mp_unmap_irq(dev->irq); + dev->irq_managed = 0; + /* +diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c +index 32e7034..72108f0 100644 +--- a/arch/x86/pci/irq.c ++++ b/arch/x86/pci/irq.c +@@ -1202,7 +1202,7 @@ static int pirq_enable_irq(struct pci_dev *dev) + struct pci_dev *temp_dev; + int irq; + +- if (pci_has_managed_irq(dev)) ++ if (dev->irq_managed && dev->irq > 0) + return 0; + + irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, +@@ -1230,7 +1230,8 @@ static int pirq_enable_irq(struct pci_dev *dev) + } + dev = temp_dev; + if (irq >= 0) { +- pci_set_managed_irq(dev, irq); ++ dev->irq_managed = 1; ++ dev->irq = irq; + dev_info(&dev->dev, "PCI->APIC IRQ transform: " + "INT %c -> IRQ %d\n", 'A' + pin - 1, irq); + return 0; +@@ -1258,8 +1259,9 @@ static int pirq_enable_irq(struct pci_dev *dev) + + static void pirq_disable_irq(struct pci_dev *dev) + { +- if (io_apic_assign_pci_irqs && pci_has_managed_irq(dev)) { ++ if (io_apic_assign_pci_irqs && dev->irq_managed && dev->irq) { + mp_unmap_irq(dev->irq); +- pci_reset_managed_irq(dev); ++ dev->irq = 0; ++ dev->irq_managed = 0; + } + } +diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c +index c933675..172b74d 100644 +--- a/drivers/acpi/pci_irq.c ++++ b/drivers/acpi/pci_irq.c +@@ -409,7 +409,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev) + return 0; + } + +- if (pci_has_managed_irq(dev)) ++ if (dev->irq_managed && dev->irq > 0) + return 0; + + entry = acpi_pci_irq_lookup(dev, pin); +@@ -454,7 +454,8 @@ int acpi_pci_irq_enable(struct pci_dev *dev) + kfree(entry); + return rc; + } +- pci_set_managed_irq(dev, rc); ++ dev->irq = rc; ++ dev->irq_managed = 1; + + if (link) + snprintf(link_desc, sizeof(link_desc), " -> Link[%s]", link); +@@ -477,7 +478,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev) + u8 pin; + + pin = dev->pin; +- if (!pin || !pci_has_managed_irq(dev)) ++ if (!pin || !dev->irq_managed || dev->irq <= 0) + return; + + entry = acpi_pci_irq_lookup(dev, pin); +@@ -499,6 +500,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev) + dev_dbg(&dev->dev, "PCI INT %c disabled\n", pin_name(pin)); + if (gsi >= 0) { + acpi_unregister_gsi(gsi); +- pci_reset_managed_irq(dev); ++ dev->irq_managed = 0; ++ dev->irq = 0; + } + } +diff --git a/include/linux/pci.h b/include/linux/pci.h +index 4e554bf..e89c7ee 100644 +--- a/include/linux/pci.h ++++ b/include/linux/pci.h +@@ -989,23 +989,6 @@ static inline int pci_is_managed(struct pci_dev *pdev) + return pdev->is_managed; + } + +-static inline void pci_set_managed_irq(struct pci_dev *pdev, unsigned int irq) +-{ +- pdev->irq = irq; +- pdev->irq_managed = 1; +-} +- +-static inline void pci_reset_managed_irq(struct pci_dev *pdev) +-{ +- pdev->irq = 0; +- pdev->irq_managed = 0; +-} +- +-static inline bool pci_has_managed_irq(struct pci_dev *pdev) +-{ +- return pdev->irq_managed && pdev->irq > 0; +-} +- + void pci_disable_device(struct pci_dev *dev); + + extern unsigned int pcibios_max_latency; +-- +2.7.1 + + +From 2979fbb4f75dadefa111cd2fe76f764fb3630a9b Mon Sep 17 00:00:00 2001 +From: Bjorn Helgaas +Date: Wed, 17 Feb 2016 12:26:42 -0600 +Subject: [PATCH 352/384] Revert "PCI, x86: Implement pcibios_alloc_irq() and + pcibios_free_irq()" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit 6c777e8799a93e3bdb67bec622429e1b48dc90fb upstream. + +991de2e59090 ("PCI, x86: Implement pcibios_alloc_irq() and +pcibios_free_irq()") appeared in v4.3 and helps support IOAPIC hotplug. + +Олег reported that the Elcus-1553 TA1-PCI driver worked in v4.2 but not +v4.3 and bisected it to 991de2e59090. Sunjin reported that the RocketRAID +272x driver worked in v4.2 but not v4.3. In both cases booting with +"pci=routirq" is a workaround. + +I think the problem is that after 991de2e59090, we no longer call +pcibios_enable_irq() for upstream bridges. Prior to 991de2e59090, when a +driver called pci_enable_device(), we recursively called +pcibios_enable_irq() for upstream bridges via pci_enable_bridge(). + +After 991de2e59090, we call pcibios_enable_irq() from pci_device_probe() +instead of the pci_enable_device() path, which does *not* call +pcibios_enable_irq() for upstream bridges. + +Revert 991de2e59090 to fix these driver regressions. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=111211 +Fixes: 991de2e59090 ("PCI, x86: Implement pcibios_alloc_irq() and pcibios_free_irq()") +Reported-and-tested-by: Олег Мороз +Reported-by: Sunjin Yang +Signed-off-by: Bjorn Helgaas +Acked-by: Rafael J. Wysocki +CC: Jiang Liu +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/include/asm/pci_x86.h | 2 ++ + arch/x86/pci/common.c | 20 +++++++++++--------- + arch/x86/pci/intel_mid_pci.c | 7 ++----- + arch/x86/pci/irq.c | 15 ++++++++++++++- + drivers/acpi/pci_irq.c | 9 ++++++++- + 5 files changed, 37 insertions(+), 16 deletions(-) + +diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h +index fa1195d..164e3f8 100644 +--- a/arch/x86/include/asm/pci_x86.h ++++ b/arch/x86/include/asm/pci_x86.h +@@ -93,6 +93,8 @@ extern raw_spinlock_t pci_config_lock; + extern int (*pcibios_enable_irq)(struct pci_dev *dev); + extern void (*pcibios_disable_irq)(struct pci_dev *dev); + ++extern bool mp_should_keep_irq(struct device *dev); ++ + struct pci_raw_ops { + int (*read)(unsigned int domain, unsigned int bus, unsigned int devfn, + int reg, int len, u32 *val); +diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c +index dc78a4a..8fd6f44 100644 +--- a/arch/x86/pci/common.c ++++ b/arch/x86/pci/common.c +@@ -673,20 +673,22 @@ int pcibios_add_device(struct pci_dev *dev) + return 0; + } + +-int pcibios_alloc_irq(struct pci_dev *dev) ++int pcibios_enable_device(struct pci_dev *dev, int mask) + { +- return pcibios_enable_irq(dev); +-} ++ int err; + +-void pcibios_free_irq(struct pci_dev *dev) +-{ +- if (pcibios_disable_irq) +- pcibios_disable_irq(dev); ++ if ((err = pci_enable_resources(dev, mask)) < 0) ++ return err; ++ ++ if (!pci_dev_msi_enabled(dev)) ++ return pcibios_enable_irq(dev); ++ return 0; + } + +-int pcibios_enable_device(struct pci_dev *dev, int mask) ++void pcibios_disable_device (struct pci_dev *dev) + { +- return pci_enable_resources(dev, mask); ++ if (!pci_dev_msi_enabled(dev) && pcibios_disable_irq) ++ pcibios_disable_irq(dev); + } + + int pci_ext_cfg_avail(void) +diff --git a/arch/x86/pci/intel_mid_pci.c b/arch/x86/pci/intel_mid_pci.c +index 8826ff5..8b93e63 100644 +--- a/arch/x86/pci/intel_mid_pci.c ++++ b/arch/x86/pci/intel_mid_pci.c +@@ -256,13 +256,10 @@ static int intel_mid_pci_irq_enable(struct pci_dev *dev) + + static void intel_mid_pci_irq_disable(struct pci_dev *dev) + { +- if (dev->irq_managed && dev->irq > 0) { ++ if (!mp_should_keep_irq(&dev->dev) && dev->irq_managed && ++ dev->irq > 0) { + mp_unmap_irq(dev->irq); + dev->irq_managed = 0; +- /* +- * Don't reset dev->irq here, otherwise +- * intel_mid_pci_irq_enable() will fail on next call. +- */ + } + } + +diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c +index 72108f0..9bd1154 100644 +--- a/arch/x86/pci/irq.c ++++ b/arch/x86/pci/irq.c +@@ -1257,9 +1257,22 @@ static int pirq_enable_irq(struct pci_dev *dev) + return 0; + } + ++bool mp_should_keep_irq(struct device *dev) ++{ ++ if (dev->power.is_prepared) ++ return true; ++#ifdef CONFIG_PM ++ if (dev->power.runtime_status == RPM_SUSPENDING) ++ return true; ++#endif ++ ++ return false; ++} ++ + static void pirq_disable_irq(struct pci_dev *dev) + { +- if (io_apic_assign_pci_irqs && dev->irq_managed && dev->irq) { ++ if (io_apic_assign_pci_irqs && !mp_should_keep_irq(&dev->dev) && ++ dev->irq_managed && dev->irq) { + mp_unmap_irq(dev->irq); + dev->irq = 0; + dev->irq_managed = 0; +diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c +index 172b74d..8a10a7a 100644 +--- a/drivers/acpi/pci_irq.c ++++ b/drivers/acpi/pci_irq.c +@@ -481,6 +481,14 @@ void acpi_pci_irq_disable(struct pci_dev *dev) + if (!pin || !dev->irq_managed || dev->irq <= 0) + return; + ++ /* Keep IOAPIC pin configuration when suspending */ ++ if (dev->dev.power.is_prepared) ++ return; ++#ifdef CONFIG_PM ++ if (dev->dev.power.runtime_status == RPM_SUSPENDING) ++ return; ++#endif ++ + entry = acpi_pci_irq_lookup(dev, pin); + if (!entry) + return; +@@ -501,6 +509,5 @@ void acpi_pci_irq_disable(struct pci_dev *dev) + if (gsi >= 0) { + acpi_unregister_gsi(gsi); + dev->irq_managed = 0; +- dev->irq = 0; + } + } +-- +2.7.1 + + +From efd7f9c0622e8a5f49f23d0981a9f4f7adc2ce5f Mon Sep 17 00:00:00 2001 +From: Liviu Dudau +Date: Thu, 21 Jan 2016 11:57:47 +0000 +Subject: [PATCH 353/384] staging: android: ion: Set the length of the DMA sg + entries in buffer + +commit 70bc916b2c80913753fb188d4daee50a64d21ba0 upstream. + +ion_buffer_create() will allocate a buffer and then create a DMA +mapping for it, but it forgot to set the length of the page entries. + +Signed-off-by: Liviu Dudau +Signed-off-by: Jon Medhurst +Acked-by: Laura Abbott +Cc: Shawn Guo +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/android/ion/ion.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c +index e237e9f..df56021 100644 +--- a/drivers/staging/android/ion/ion.c ++++ b/drivers/staging/android/ion/ion.c +@@ -251,8 +251,10 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, + * memory coming from the heaps is ready for dma, ie if it has a + * cached mapping that mapping has been invalidated + */ +- for_each_sg(buffer->sg_table->sgl, sg, buffer->sg_table->nents, i) ++ for_each_sg(buffer->sg_table->sgl, sg, buffer->sg_table->nents, i) { + sg_dma_address(sg) = sg_phys(sg); ++ sg_dma_len(sg) = sg->length; ++ } + mutex_lock(&dev->buffer_lock); + ion_buffer_add(dev, buffer); + mutex_unlock(&dev->buffer_lock); +-- +2.7.1 + + +From ad24e915781ae2a9361f9e7db2469455e9258012 Mon Sep 17 00:00:00 2001 +From: Vladis Dronov +Date: Mon, 16 Nov 2015 15:55:11 -0200 +Subject: [PATCH 354/384] usbvision: fix crash on detecting device with invalid + configuration + +commit fa52bd506f274b7619955917abfde355e3d19ffe upstream. + +The usbvision driver crashes when a specially crafted usb device with invalid +number of interfaces or endpoints is detected. This fix adds checks that the +device has proper configuration expected by the driver. + +Reported-by: Ralf Spenneberg +Signed-off-by: Vladis Dronov +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/usb/usbvision/usbvision-video.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c +index b693206..d1dc1a1 100644 +--- a/drivers/media/usb/usbvision/usbvision-video.c ++++ b/drivers/media/usb/usbvision/usbvision-video.c +@@ -1463,9 +1463,23 @@ static int usbvision_probe(struct usb_interface *intf, + + if (usbvision_device_data[model].interface >= 0) + interface = &dev->actconfig->interface[usbvision_device_data[model].interface]->altsetting[0]; +- else ++ else if (ifnum < dev->actconfig->desc.bNumInterfaces) + interface = &dev->actconfig->interface[ifnum]->altsetting[0]; ++ else { ++ dev_err(&intf->dev, "interface %d is invalid, max is %d\n", ++ ifnum, dev->actconfig->desc.bNumInterfaces - 1); ++ ret = -ENODEV; ++ goto err_usb; ++ } ++ ++ if (interface->desc.bNumEndpoints < 2) { ++ dev_err(&intf->dev, "interface %d has %d endpoints, but must" ++ " have minimum 2\n", ifnum, interface->desc.bNumEndpoints); ++ ret = -ENODEV; ++ goto err_usb; ++ } + endpoint = &interface->endpoint[1].desc; ++ + if (!usb_endpoint_xfer_isoc(endpoint)) { + dev_err(&intf->dev, "%s: interface %d. has non-ISO endpoint!\n", + __func__, ifnum); +-- +2.7.1 + + +From e74104b3db0dc75a5ed3d380e3804edd68df531c Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Sat, 20 Feb 2016 14:19:34 -0800 +Subject: [PATCH 355/384] Revert "usb: hub: do not clear BOS field during reset + device" + +commit e5bdfd50d6f76077bf8441d130c606229e100d40 upstream. + +This reverts commit d8f00cd685f5c8e0def8593e520a7fef12c22407. + +Tony writes: + +This upstream commit is causing an oops: +d8f00cd685f5 ("usb: hub: do not clear BOS field during reset device") + +This patch has already been included in several -stable kernels. Here +are the affected kernels: +4.5.0-rc4 (current git) +4.4.2 +4.3.6 (currently in review) +4.1.18 +3.18.27 +3.14.61 + +How to reproduce the problem: +Boot kernel with slub debugging enabled (otherwise memory corruption +will cause random oopses later instead of immediately) +Plug in USB 3.0 disk to xhci USB 3.0 port +dd if=/dev/sdc of=/dev/null bs=65536 +(where /dev/sdc is the USB 3.0 disk) +Unplug USB cable while dd is still going +Oops is immediate: + +Reported-by: Tony Battersby +Cc: Du, Changbin +Cc: Roger Quadros +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/core/hub.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c +index 2a27488..84df093 100644 +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -5392,6 +5392,7 @@ static int usb_reset_and_verify_device(struct usb_device *udev) + } + + bos = udev->bos; ++ udev->bos = NULL; + + for (i = 0; i < SET_CONFIG_TRIES; ++i) { + +@@ -5484,11 +5485,8 @@ done: + usb_set_usb2_hardware_lpm(udev, 1); + usb_unlocked_enable_lpm(udev); + usb_enable_ltm(udev); +- /* release the new BOS descriptor allocated by hub_port_init() */ +- if (udev->bos != bos) { +- usb_release_bos_descriptor(udev); +- udev->bos = bos; +- } ++ usb_release_bos_descriptor(udev); ++ udev->bos = bos; + return 0; + + re_enumerate: +-- +2.7.1 + + +From 9446914d4b74a93cf8476adfd9673dc4e42e3156 Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Wed, 20 Apr 2016 15:44:02 +0900 +Subject: [PATCH 356/384] Linux 4.4.8 + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 126971f..f5f8292 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + VERSION = 4 + PATCHLEVEL = 4 +-SUBLEVEL = 7 ++SUBLEVEL = 8 + EXTRAVERSION = + NAME = Blurry Fish Butt + +-- +2.7.1 + + +From 6d57ab150c1061dbd44ed6db9437c9c7d9933a16 Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Fri, 22 Apr 2016 13:11:34 +0200 +Subject: [PATCH 357/384] mxc-hdmi-core: disable hdmi audio on modes where + calculated cts/n value is out of specs. enable once cts/n are fine again. + +--- + drivers/mfd/mxc-hdmi-core.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +diff --git a/drivers/mfd/mxc-hdmi-core.c b/drivers/mfd/mxc-hdmi-core.c +index 2349e0f..10edba9 100644 +--- a/drivers/mfd/mxc-hdmi-core.c ++++ b/drivers/mfd/mxc-hdmi-core.c +@@ -221,9 +221,13 @@ int mxc_hdmi_register_audio(struct snd_pcm_substream *substream) + if (hdmi_audio_stream_playback) { + pr_err("%s unconsist hdmi auido stream!\n", __func__); + ret = -EINVAL; ++ } else if (hdmi_abort_state) { ++ pr_err("%s audio disabled for this mode!\n", __func__); ++ ret = -EINVAL; ++ } else { ++ hdmi_audio_stream_playback = substream; ++ hdmi_abort_state = !hdmi_blank_state; + } +- hdmi_audio_stream_playback = substream; +- hdmi_abort_state = !hdmi_blank_state; + spin_unlock_irqrestore(&hdmi_audio_lock, flags1); + } else + ret = -EINVAL; +@@ -519,8 +523,11 @@ static void hdmi_set_clk_regenerator(void) + if (clk_cts == 0 && hdmi_compute_cts_n(sample_rate, pixel_clk_rate, &clk_n, &clk_cts)) + pr_debug("%s: pixel clock not supported - using fallback calculation.\n", __func__); + else if (clk_cts == 0) { +- pr_debug("%s: cts/n fallback calculation out of safe values\n", __func__); ++ pr_err("%s: cts/n fallback calculation out of safe values, disabling hdmi audio\n", __func__); ++ + mxc_hdmi_abort_stream(); ++ if (!hdmi_audio_stream_playback) ++ hdmi_abort_state = 1; + return; + } + +@@ -533,6 +540,9 @@ static void hdmi_set_clk_regenerator(void) + + hdmi_set_clock_regenerator_cts(clk_cts); + hdmi_set_clock_regenerator_n(clk_n); ++ ++ if (hdmi_abort_state && !hdmi_audio_stream_playback) ++ hdmi_abort_state = 0; + } + + static int hdmi_core_get_of_property(struct platform_device *pdev) +-- +2.7.1 + + +From bb953a845c8ce992b6d997c3c4ad891cebf0762f Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Fri, 22 Apr 2016 13:12:55 +0200 +Subject: [PATCH 358/384] sdma-imx6q.bin: patch to sdma firmware 3.3 + +--- + firmware/imx/sdma/sdma-imx6q.bin.ihex | 255 ++++++++++++++++++---------------- + 1 file changed, 132 insertions(+), 123 deletions(-) + +diff --git a/firmware/imx/sdma/sdma-imx6q.bin.ihex b/firmware/imx/sdma/sdma-imx6q.bin.ihex +index 97a0908..d296f8f 100755 +--- a/firmware/imx/sdma/sdma-imx6q.bin.ihex ++++ b/firmware/imx/sdma/sdma-imx6q.bin.ihex +@@ -1,130 +1,139 @@ +-:1000000053444D4103000000010000001C000000AB +-:1000100029000000C0000000480700008202000024 +-:10002000FFFFFFFF00000000FFFFFFFFFFFFFFFFDC ++:1000000053444D4103000000030000001C000000A9 ++:1000100029000000C0000000D40700008202000098 ++:10002000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 + :10003000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0 +-:10004000FFFFFFFFFFFFFFFFFA1900004B04000056 +-:10005000EB020000A8180000FFFFFFFF581A000085 ++:10004000FFFFFFFFFFFFFFFF421A0000FFFFFFFF60 ++:10005000EB020000B4180000FFFFFFFF9E1A000033 + :10006000FFFFFFFFC0030000FFFFFFFFFFFFFFFFD9 + :10007000FFFFFFFFAB020000FFFFFFFF7B0300005D + :10008000FFFFFFFFFFFFFFFF4C0400006E040000B6 + :10009000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70 +-:1000A00000000000001800004F180000A619000012 +-:1000B000071B0000A21A00003E1B000000180000F1 ++:1000A000FFFFFFFF001800005B180000EE190000C2 ++:1000B0004D1B0000E81A0000841B0000001800001F + :1000C000E3C1DB57F352016AFB52D36AFB521C1A9D +-:1000D000C36AE8621102FF3A3008D002337C8F0015 +-:1000E000D500017D8D00A005EB5D7804037D7904CA +-:1000F0001C7D207C7904157CEE566006057D096523 +-:10010000287E0A62267E28980A62237E0965217E5F +-:1001100012051205AD02C86A1C7F03200048ED7C61 +-:10012000409802780962C86A3F98150002780A620E +-:10013000C86A3F981500150002780B62C86A097CEE +-:10014000DF6D077F0000EB55004D077DFAC1DB57DF +-:1001500006980700CC680C6813C20AC20198D9C17E +-:10016000E3C1DB57E35FE357F352216A8F00D50009 +-:10017000017D8D00A005EB5DFB567804037D7904BD +-:100180002A7D317C7904207C700B1103EB53000F26 +-:100190006003057D0965377E0A62357E73980A62C1 +-:1001A000327E0965307E12051205AD026007027CC1 +-:1001B000065A7B98265A277F011F03200048E87CB7 +-:1001C000700B110313539C98150004780962065AAA +-:1001D0000962265A9B981500150004780A62065A8F +-:1001E0000A62265A9B9815001500150004780B62C8 +-:1001F000065A0B62265A077C0000EB55004D067D1F +-:10020000FAC1E357569807000C6813C20AC2539804 +-:10021000700B110313536C07017CD9C1FB5E8A0676 +-:100220006B07017CD9C1F35EDB59D3588F011001F4 +-:100230000F398B003CC12B7DC05AC85B4EC1277C57 +-:1002400088038906E35CFF0D1105FF1DBC053E0711 +-:10025000004D187D700811007E07097D7D07027D25 +-:100260002852D398F852DB54BC02CC02097C7C079C +-:10027000027D2852DC98F852D354BC02CC02097D8E +-:100280000004CA988B00C052C85359C1D67D0002E1 +-:10029000BA98FF08BF007F07157D8804D500017D4F +-:1002A0008D00A005EB5D8F0212021202FF3ADA0503 +-:1002B000027C3E070599A402DD02027D3E070599F6 +-:1002C0005E070599EB559805EB5DF352FB546A0701 +-:1002D000267D6C07017D42996B07577C6907047D79 +-:1002E0006807027D010E1C999358D600017D8E008F +-:1002F0009355A005935DA00602780255045D1D7C10 +-:10030000004E087C6907037D0255177E2999045D1C +-:10031000147F890693500048017D14998D9915002A +-:1003200006780255045D4F070255245D2F07017CB6 +-:100330008D9917006F07017C012093559D000700E0 +-:1003400094D9E298D36C6907047D6807027D010E99 +-:1003500051999358D600017D8E009355A005935D69 +-:10036000A00602780255C86D0F7C004E087C690714 +-:10037000037D0255097E5E99C86D067F89069350FC +-:100380000048017D49998D998799C36A6907047D61 +-:100390006807027D010E74999358D600017D8E0086 +-:1003A0009355A005935DA0060278C865045D0F7C97 +-:1003B000004E087C6907037DC865097E8199045D4C +-:1003C000067F890693500048017D6C998D9993555D +-:1003D0009D000700FF6C94D9E2980000E354EB55B0 +-:1003E000004D017CE298CA98E354EB55FF0A1102D4 +-:1003F000FF1A7F07027CA005A1999D008C05BA0514 +-:10040000A0051002BA04AD0454040600D9C1E3C12A +-:10041000DB57F352056A8F00D500017D8D00A005E2 +-:10042000FB567804037D7904297D1F7C79042E7C9A +-:10043000E35D700D1105ED55000F6007027D06525A +-:10044000C2992652337E6005027D10021202096AAB +-:100450002D7F1202096A2A7F1202096A277F011F73 +-:1004600003200048EA7CE355ED99150015001500BE +-:10047000047806520B6A26520B6AEC991500150097 +-:10048000047806520A6A26520A6AEC991500047822 +-:100490000652096A2652096A097C286A077F000009 +-:1004A000DB57004D057DFAC1DB57AB9977C2540489 +-:1004B0000AC2A899E3C1DB57F352056AFB568E02C4 +-:1004C000941AC36AC8626902267D941EC36ED36EF5 +-:1004D000C8624802C86A9426981EC36EC8629826ED +-:1004E000C36E60020E7D981EC36EC8626C02037DEF +-:1004F0009826C36E3B9A4C02D36EC86A9826C36E88 +-:100500004B9AC8626E02017C459A096A1A7F0125DE +-:10051000004D217D0C9AE36E8F00D805017D8D0082 +-:10052000C8626E02127D096A0C7F01250120F87CE9 +-:10053000DB57004D107D286A047F0000FAC1DB57AD +-:10054000FE99070004620C6A489A286AFA7F0462DE +-:100550007AC258045404FF081100FF18BC00CD00F3 +-:10056000017C3B9A286AED7F04627AC20AC2FB9939 +-:10057000D9C1E3C1DB57F352056AFB568E02941AC8 +-:10058000025269021D7D941E06524802065A9426A4 +-:10059000981E06524C02065A9826981E0652600271 +-:1005A0000A7C982606526E02237D096A1D7F01256A +-:1005B000004D247D6D9A286A177F04627AC29E9A44 +-:1005C0008F00D805017D8D00A00506526E02107DBA +-:1005D000096A0A7F0120F97C286A067F0000004D25 +-:1005E0000D7DFAC1DB575D9A070004620C6A9B9A85 +-:1005F000286AFA7F04627AC258045404286AF47F95 +-:100600000AC25A9AE6DADB57F352056AC7698F00C5 +-:10061000D500017D8D00A0057804037D79041C7D43 +-:10062000157C79041E7CEE56C862287E6006027D29 +-:1006300010021202096A227F1202096A1F7F120247 +-:10064000096A1C7F03200048EF7CD59A150015002D +-:100650000278C8620B6AD49A15000278C8620A6AE6 +-:10066000D49A0278C862096A097C286A077F004D1B +-:10067000077DD352010802580004A69A77C2540499 +-:10068000D352010802580104FEDAA39A700B110339 +-:100690001353DB5F0A07D3588B00FB5E3CC1157D0B +-:1006A000C05AC85B4EC1117C8803F05DFF0D110577 +-:1006B000FF1DBC05004D047DFD9A0807DB5F0A079E +-:1006C0008B00C352CB5359C1EC7D0002EE9A016EF0 +-:1006D0000B612F7E0B622D7E0B632B7E0C0D17049E +-:1006E000170417049D04081DCC05017C0C0DD16A6C +-:1006F000000F4207C86FDD6F1C7F8E009D000168F0 +-:100700000B67177ED56B04080278C86F1207117C3F +-:100710000B670F7E04080278C86F12070A7CDD6F32 +-:10072000087FD169010FC86FDD6F037F01010004ED +-:10073000139B0700FF680C680002139B83DBDB57E9 +-:10074000F352056AFB52C76A8F00D500017D8D0008 +-:10075000A0057804037D79041C7D157C79041E7C3A +-:10076000EE56C862287E6006027D10021202096AF7 +-:10077000227F1202096A1F7F1202096A1C7F03206E +-:100780000048EF7C729B150015000278C8620B6A66 +-:10079000719B15000278C8620A6A719B0278C86270 +-:1007A000096A097C286A077F004D077DD35201083A +-:1007B00002580004429B77C25404D35201080258E5 +-:1007C00001049BDB3F9B700B11031353DB5F0A0794 +-:1007D000D3588B00FB5E3CC1157DC05AC85B4EC12F +-:1007E000117C8803F05DFF0D1105FF1DBC05004D58 +-:1007F000047D9A9B0807DB5F0A078B00C352CB532B +-:0808000059C1EC7D00028B9B45 ++:1000D000C36AE8621102FF3A3008D0023F7C8F0009 ++:1000E0003F00D500017D8D00A005EB5D7804037D08 ++:1000F00079041C7D207C7904157CEE566006057D14 ++:100100000965337E0A62317E29980A622E7E09656E ++:100110002C7E12051205AD02C86A277F0320004815 ++:10012000ED7C419802780962C86A4098150002780F ++:100130000A62C86A40981500150002780B62C86A06 ++:10014000147CDF6D127F7F07097DFB52041AC36A9E ++:10015000D36AC862042AC86AFB52D36A0000EB550E ++:10016000004D077DFAC1DB5706980700CC680C6884 ++:1001700013C20AC20198D9C1E3C1DB57E35FE35759 ++:10018000F352216A8F00D500017D8D00A005EB5D43 ++:10019000FB567804037D79042A7D317C7904207C28 ++:1001A000700B1103EB53000F6003057D0965377E6B ++:1001B0000A62357E7F980A62327E0965307E1205BA ++:1001C0001205AD026007027C065A8798265A277FDF ++:1001D000011F03200048E87C700B11031353A898FB ++:1001E000150004780962065A0962265AA798150074 ++:1001F000150004780A62065A0A62265AA798150062 ++:100200001500150004780B62065A0B62265A077C0B ++:100210000000EB55004D067DFAC1E35762980700D8 ++:100220000C6813C20AC25F98700B110313536C075A ++:10023000017CD9C1FB5E8A066B07017CD9C1F35EE4 ++:10024000DB59D3588F0110010F398B003CC12B7D36 ++:10025000C05AC85B4EC1277C88038906E35CFF0D4A ++:100260001105FF1DBC053E07004D187D70081100EB ++:100270007E07097D7D07027D2852DF98F852DB5406 ++:10028000BC02CC02097C7C07027D2852E898F85217 ++:10029000D354BC02CC02097D0004D6988B00C05216 ++:1002A000C85359C1D67D0002C698FF08BF007F071A ++:1002B000157D8804D500017D8D00A005EB5D8F02C2 ++:1002C00012021202FF3ADA05027C3E071399A402D9 ++:1002D000DD02027D3E0713995E071399EB55004D31 ++:1002E000027C9805EB5DF352FB546A07387D6C077E ++:1002F000017D62996B077D7C6907047D6807027D3B ++:10030000010E2A999358D600017D8E009355A005C1 ++:10031000935DA0066D07067D6E070B7D0278025582 ++:10032000045D3F99150004780255045D2255045D73 ++:100330003F99150004780255045D0255245D1D7C2B ++:10034000004E087C6907037D0255177E4999045DBC ++:10035000147F890693500048017D2299D599150094 ++:1003600006780255045D4F070255245D2F07017C76 ++:10037000D59917006F07017C012093559D00070058 ++:10038000DCD9EE986907047D6807027D010E70993B ++:100390009358D600017D8E009355A005935DA0066D ++:1003A0006D07077D6E070D7DD36C02780255C86D11 ++:1003B00088991500D36C04780255C86D2255C86D14 ++:1003C000889915000578D76C0255C86D0255C86D1F ++:1003D0000F7C004E087C6907037D0255097E9299C7 ++:1003E000C86D067F890693500048017D6899D599AC ++:1003F000CF996907047D6807027D010EA79993587C ++:10040000D600017D8E009355A005935DA0066D0773 ++:10041000077D6E070D7DC36A0278C865045DBF99CC ++:1004200015000578C76AC865045DC865045DBF9995 ++:100430001500C36A0478C865045DC865245D0F7C37 ++:10044000004E087C6907037DC865097EC999045D73 ++:10045000067F890693500048017D9F99D599935551 ++:100460009D000700FF6CDCD9EE980000E354EB55CB ++:10047000004D017CEE98D698E354EB55FF0A11022B ++:10048000FF1A7F07027CA005E9999D008C05BA053B ++:10049000A0051002BA04AD0454040600D9C1E3C19A ++:1004A000DB57F352056A8F00D500017D8D00A00552 ++:1004B000FB567804037D7904297D1F7C79042E7C0A ++:1004C000E35D700D1105ED55000F6007027D0652CA ++:1004D0000A9A2652337E6005027D10021202096AD2 ++:1004E0002D7F1202096A2A7F1202096A277F011FE3 ++:1004F00003200048EA7CE355359A150015001500E5 ++:10050000047806520B6A26520B6A349A15001500BD ++:10051000047806520A6A26520A6A349A1500047848 ++:100520000652096A2652096A097C286A077F000078 ++:10053000DB57004D057DFAC1DB57F39977C25404B0 ++:100540000AC2F099E3C1DB57F352056AFB568E02EB ++:10055000941AC36AC8626902267D941EC36ED36E64 ++:10056000C862010A1102C86A9426981EC36EC86246 ++:100570009826C36E60020F7D981EC36EC8626C021F ++:10058000037D9826C36E819A100A1102D36EC86A41 ++:100590009826C36E919AC8626D9A096A187F0125E0 ++:1005A000004D1F7D559AE36E8F00D805017D8D00AB ++:1005B000C862096A0C7F01250120FA7CDB57004DD7 ++:1005C000107D286A047F0000FAC1DB57469A0700B5 ++:1005D00004620C6A8E9A286AFA7F04627AC258040E ++:1005E0005404FF081100FF18BC00CD00017C819A63 ++:1005F000286AED7F04627AC20AC2439AD9C1E3C174 ++:10060000DB57F352056AFB568E02941A02526902B6 ++:100610001D7D941E06524802065A9426981E0652C4 ++:100620004C02065A9826981E065260020A7C9826AA ++:1006300006526E02237D096A1D7F0125004D247D2F ++:10064000B39A286A177F04627AC2E49A8F00D805A9 ++:10065000017D8D00A00506526E02107D096A0A7F99 ++:100660000120F97C286A067F0000004D0D7DFAC14B ++:10067000DB57A39A070004620C6AE19A286AFA7FA2 ++:1006800004627AC258045404286AF47F0AC2A09A09 ++:100690002CDBDB57F352056AC7698F00D500017D5B ++:1006A0008D00A0057804037D79041C7D157C7904F8 ++:1006B0001E7CEE56C862287E6006027D1002120281 ++:1006C000096A227F1202096A1F7F1202096A1C7FCF ++:1006D00003200048EF7C1B9B150015000278C862C0 ++:1006E0000B6A1A9B15000278C8620A6A1A9B027884 ++:1006F000C862096A097C286A077F004D077DD352CA ++:10070000010802580004EC9A77C25404D35201083D ++:100710000258010444DBE99A700B11031353DB5FA9 ++:100720000A07D3588B00FB5E3CC1157DC05AC85BDD ++:100730004EC1117C8803F05DFF0D1105FF1DBC0546 ++:10074000004D047D439B0807DB5F0A078B00C35203 ++:10075000CB5359C1EC7D0002349B016E0B612F7E9F ++:100760000B622D7E0B632B7E0C0D170417041704F0 ++:100770009D04081DCC05017C0C0DD16A000F4207B9 ++:10078000C86FDD6F1C7F8E009D0001680B67177EB0 ++:10079000D56B04080278C86F1207117C0B670F7EB7 ++:1007A00004080278C86F12070A7CDD6F087FD169E0 ++:1007B000010FC86FDD6F037F01010004599B070023 ++:1007C000FF680C680002599BC9DBDB57F352056ACE ++:1007D000FB52C76A8F00D500017D8D00A00578040B ++:1007E000037D79041C7D157C79041E7CEE56C8625D ++:1007F000287E6006027D10021202096A227F120220 ++:10080000096A1F7F1202096A1C7F03200048EF7CDF ++:10081000B89B150015000278C8620B6AB79B1500DB ++:100820000278C8620A6AB79B0278C862096A097CC2 ++:10083000286A077F004D077DD35201080258000443 ++:10084000889B77C25404D352010802580104E1DBAB ++:10085000859B700B11031353DB5F0A07D3588B0082 ++:10086000FB5E3CC1157DC05AC85B4EC1117C88033C ++:10087000F05DFF0D1105FF1DBC05004D047DE09BE3 ++:100880000807DB5F0A078B00C352CB5359C1EC7DCD ++:040890000002D19BF6 + :00000001FF +-- +2.7.1 + + +From d71f8a758ce5b3fe3c98651433772a0a10eca560 Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Sat, 23 Apr 2016 16:52:23 +0200 +Subject: [PATCH 359/384] lirc_atiusb/hb/xbox: fix data types + +--- + drivers/staging/media/lirc/lirc_atiusb.c | 4 ++-- + drivers/staging/media/lirc/lirc_hb.c | 6 +++--- + drivers/staging/media/lirc/lirc_xbox.c | 4 ++-- + 3 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/drivers/staging/media/lirc/lirc_atiusb.c b/drivers/staging/media/lirc/lirc_atiusb.c +index 302dc39..e94334e 100644 +--- a/drivers/staging/media/lirc/lirc_atiusb.c ++++ b/drivers/staging/media/lirc/lirc_atiusb.c +@@ -1296,13 +1296,13 @@ MODULE_AUTHOR(DRIVER_AUTHOR); + MODULE_LICENSE("GPL"); + MODULE_DEVICE_TABLE(usb, usb_remote_table); + +-module_param(debug, bool, S_IRUGO | S_IWUSR); ++module_param(debug, int, S_IRUGO | S_IWUSR); + MODULE_PARM_DESC(debug, "Debug enabled or not (default: 0)"); + + module_param(mask, int, S_IRUGO | S_IWUSR); + MODULE_PARM_DESC(mask, "Set channel acceptance bit mask (default: 0xFFFF)"); + +-module_param(unique, bool, S_IRUGO | S_IWUSR); ++module_param(unique, int, S_IRUGO | S_IWUSR); + MODULE_PARM_DESC(unique, "Enable channel-specific codes (default: 0)"); + + module_param(repeat, int, S_IRUGO | S_IWUSR); +diff --git a/drivers/staging/media/lirc/lirc_hb.c b/drivers/staging/media/lirc/lirc_hb.c +index 49dde0a..b1f4e70 100644 +--- a/drivers/staging/media/lirc/lirc_hb.c ++++ b/drivers/staging/media/lirc/lirc_hb.c +@@ -672,12 +672,12 @@ module_param(gpio_in_pin, int, S_IRUGO); + MODULE_PARM_DESC(gpio_in_pin, "GPIO input pin number of the BCM processor." + " Valid pin numbers are: 1, 73, 72, 71, 70, 194, 195, 67, default 72"); + +-module_param(sense, bool, S_IRUGO); ++module_param(sense, int, S_IRUGO); + MODULE_PARM_DESC(sense, "Override autodetection of IR receiver circuit" + " (0 = active high, 1 = active low )"); + +-module_param(softcarrier, bool, S_IRUGO); ++module_param(softcarrier, int, S_IRUGO); + MODULE_PARM_DESC(softcarrier, "Software carrier (0 = off, 1 = on, default on)"); + +-module_param(debug, bool, S_IRUGO | S_IWUSR); ++module_param(debug, int, S_IRUGO | S_IWUSR); + MODULE_PARM_DESC(debug, "Enable debugging messages"); +diff --git a/drivers/staging/media/lirc/lirc_xbox.c b/drivers/staging/media/lirc/lirc_xbox.c +index 4f2fefa..9899a7e 100644 +--- a/drivers/staging/media/lirc/lirc_xbox.c ++++ b/drivers/staging/media/lirc/lirc_xbox.c +@@ -980,13 +980,13 @@ MODULE_AUTHOR(DRIVER_AUTHOR); + MODULE_LICENSE("GPL"); + MODULE_DEVICE_TABLE(usb, usb_remote_table); + +-module_param(debug, bool, S_IRUGO | S_IWUSR); ++module_param(debug, int, S_IRUGO | S_IWUSR); + MODULE_PARM_DESC(debug, "Debug enabled or not (default: 0)"); + + module_param(mask, int, S_IRUGO | S_IWUSR); + MODULE_PARM_DESC(mask, "Set channel acceptance bit mask (default: 0xFFFF)"); + +-module_param(unique, bool, S_IRUGO | S_IWUSR); ++module_param(unique, int, S_IRUGO | S_IWUSR); + MODULE_PARM_DESC(unique, "Enable channel-specific codes (default: 0)"); + + module_param(repeat, int, S_IRUGO | S_IWUSR); +-- +2.7.1 + + +From 35996b893ef31492e4f71bbcbeae898a26f60501 Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Sat, 23 Apr 2016 16:58:13 +0200 +Subject: [PATCH 360/384] arch/arm/mach-imx/Kconfig: align with upstream + +--- + arch/arm/mach-imx/Kconfig | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig +index 8bee527..ff3ab03 100644 +--- a/arch/arm/mach-imx/Kconfig ++++ b/arch/arm/mach-imx/Kconfig +@@ -8,7 +8,6 @@ menuconfig ARCH_MXC + select PM_OPP if PM + select SOC_BUS + select SRAM +- select ZONE_DMA + help + Support for Freescale MXC/iMX-based family of processors + +-- +2.7.1 + + +From 06ba31d8046b9fd0fcb98bcb0df0016f7d4ec3ea Mon Sep 17 00:00:00 2001 +From: Haibo Chen +Date: Mon, 1 Feb 2016 18:15:27 +0800 +Subject: [PATCH 361/384] MLK-12345 mmc: sdhci-esdhc-imx: reset tuning circurt + when insert sd card + +Current driver do not clear the tuning related register setting, +this will impact the timing and let the card inserted later meet +CRC error. + +Take the DDR50 card as example, if plug out an SDR104 card and +then plug in this DDR50 card, we will meet the following error log: + +mmc2: new ultra high speed DDR50 SDHC card at address aaaa +mmcblk2: mmc2:aaaa SE08G 7.40 GiB +mmcblk2: error -84 transferring data, sector 0, nr 8, cmd response 0x900, card status 0xb00 +mmc2: tried to reset card + mmcblk2: p1 p2 + +Logictally, we should reset the tuning circurt everytime when we +plug in a sd card. + +Signed-off-by: Haibo Chen +(cherry picked from commit 1f47730e8e30f37ed0289b2900e524db60456ae4) +(cherry picked from commit 6a983bfb6fe5c15745efff8084d1c6e19309082d) +Signed-off-by: Matus Kral +--- + drivers/mmc/host/sdhci-esdhc-imx.c | 27 ++++++++++++++++++++++++++- + 1 file changed, 26 insertions(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c +index 83632d2..acd754b 100644 +--- a/drivers/mmc/host/sdhci-esdhc-imx.c ++++ b/drivers/mmc/host/sdhci-esdhc-imx.c +@@ -916,6 +916,30 @@ static void esdhc_reset(struct sdhci_host *host, u8 mask) + sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE); + } + ++static void esdhc_hw_reset(struct sdhci_host *host) ++{ ++ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); ++ struct pltfm_imx_data *imx_data = pltfm_host->priv; ++ u16 ctrl; ++ ++ sdhci_reset(host, SDHCI_RESET_ALL); ++ ++ /* Rest the tuning circurt */ ++ if (esdhc_is_usdhc(imx_data)) { ++ if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) { ++ ctrl = readl(host->ioaddr + ESDHC_MIX_CTRL); ++ ctrl &= ~ESDHC_MIX_CTRL_SMPCLK_SEL; ++ ctrl &= ~ESDHC_MIX_CTRL_FBCLK_SEL; ++ writel(ctrl, host->ioaddr + ESDHC_MIX_CTRL); ++ writel(0 << 8, host->ioaddr + ESDHC_TUNE_CTRL_STATUS); ++ } else if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING) { ++ ctrl = readl(host->ioaddr + SDHCI_ACMD12_ERR); ++ ctrl &= ~ESDHC_MIX_CTRL_SMPCLK_SEL; ++ writel(ctrl, host->ioaddr + SDHCI_ACMD12_ERR); ++ } ++ } ++} ++ + static unsigned int esdhc_get_max_timeout_count(struct sdhci_host *host) + { + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); +@@ -949,6 +973,7 @@ static struct sdhci_ops sdhci_esdhc_ops = { + .set_bus_width = esdhc_pltfm_set_bus_width, + .set_uhs_signaling = esdhc_set_uhs_signaling, + .reset = esdhc_reset, ++ .hw_reset = esdhc_hw_reset, + }; + + static const struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = { +@@ -1177,7 +1202,7 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) + writel(0x10401040, host->ioaddr + ESDHC_WTMK_LVL); + + host->quirks2 |= SDHCI_QUIRK2_PRESET_VALUE_BROKEN; +- host->mmc->caps |= MMC_CAP_1_8V_DDR; ++ host->mmc->caps |= MMC_CAP_1_8V_DDR | MMC_CAP_HW_RESET; + + /* + * ROM code will change the bit burst_length_enable setting +-- +2.7.1 + + +From 6eb5b635643acce4afbd4b1b5f5e7f9dedbbaba7 Mon Sep 17 00:00:00 2001 +From: Dong Aisheng +Date: Thu, 9 Apr 2015 16:23:24 +0800 +Subject: [PATCH 362/384] MLK-10629-4 mmc: sdhci: remove MMC_CAP_NEEDS_POLL + +This will cause meaningless CPU overhead by polling the card at backgroud +if the CD is broken. +Most board does not intend to use this function, so remove it. +Platform driver could add it for test if needed. + +Signed-off-by: Dong Aisheng +Signed-off-by: Matus Kral + +Conflicts: + drivers/mmc/host/sdhci.c + +(cherry picked from commit fbe95c4bfb6c2b29f666b5c1d18c5ec8516297c7) +Signed-off-by: Matus Kral +--- + drivers/mmc/host/sdhci.c | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c +index 62696e6..f778f9f 100644 +--- a/drivers/mmc/host/sdhci.c ++++ b/drivers/mmc/host/sdhci.c +@@ -3142,11 +3142,6 @@ int sdhci_add_host(struct sdhci_host *host) + if (caps[0] & SDHCI_CAN_DO_HISPD) + mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; + +- if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) && +- !(mmc->caps & MMC_CAP_NONREMOVABLE) && +- IS_ERR_VALUE(mmc_gpio_get_cd(host->mmc))) +- mmc->caps |= MMC_CAP_NEEDS_POLL; +- + /* If there are external regulators, get them */ + if (mmc_regulator_get_supply(mmc) == -EPROBE_DEFER) + return -EPROBE_DEFER; +-- +2.7.1 + + +From d8cc0e20f54dd3f02fb93efdf97f33feb971692b Mon Sep 17 00:00:00 2001 +From: Dong Aisheng +Date: Thu, 14 Jan 2016 20:33:17 +0800 +Subject: [PATCH 363/384] MLK-12168 mmc: sdhci: check SDHCI_QUIRK2_NO_1_8_V + when do voltage switch + +Currently when card type supports EXT_CSD_CARD_TYPE_DDR_1_8V which means +can work on DDR mode with either 3.3v IO or 1.8v IO voltage, unlike before, +currently MMC core will first try 1.8v then 3.3v. +And the host driver voltage switch code does not check NO_1_8_V quirk +which may set a wrong 1.8v and causes the card unwork. + +Checking 1.8V quirk before setting it to avoid such issue. + +Note: This is a quick workaround solution. Directly putting +the quirk check in host layer is not very good. (That quirk is +going to be deprecated) and current MMC core does not support +3.3V DDR mode well, need further restructure later. + +Signed-off-by: Dong Aisheng +(cherry picked from commit 0aa8f29a4cc251512d65c0c370572d9c58797fe1) +Signed-off-by: Matus Kral +--- + drivers/mmc/host/sdhci.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c +index f778f9f..8e91d17 100644 +--- a/drivers/mmc/host/sdhci.c ++++ b/drivers/mmc/host/sdhci.c +@@ -1797,6 +1797,9 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host, + + return -EAGAIN; + case MMC_SIGNAL_VOLTAGE_180: ++ if (host->quirks2 & SDHCI_QUIRK2_NO_1_8_V) ++ return -EIO; ++ + if (!IS_ERR(mmc->supply.vqmmc)) { + ret = regulator_set_voltage(mmc->supply.vqmmc, + 1700000, 1950000); +-- +2.7.1 + + +From 7112062148366bba06913d45c4e328ff53372e1e Mon Sep 17 00:00:00 2001 +From: Haibo Chen +Date: Mon, 18 Jan 2016 10:33:30 +0800 +Subject: [PATCH 364/384] MLK-12171 mmc: sdhci-esdhc-imx.c: increase the pad + eletric drive for DDR50 card + +Currently for DDR50 card, we only use the default pin state, and we meet some +data CRC error. Now we increase the pad eletric drive for DDR50 card, and use +pins_100mhz. This pad eletric drive pass the two days reboot stress test, over +12000 times without issue. + +Signed-off-by: Haibo Chen +(cherry picked from commit fed841b319fb776dee009084d7b535e523b1c500) +Signed-off-by: Matus Kral +--- + drivers/mmc/host/sdhci-esdhc-imx.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c +index acd754b..6d5f97f 100644 +--- a/drivers/mmc/host/sdhci-esdhc-imx.c ++++ b/drivers/mmc/host/sdhci-esdhc-imx.c +@@ -809,6 +809,7 @@ static int esdhc_change_pinstate(struct sdhci_host *host, + + switch (uhs) { + case MMC_TIMING_UHS_SDR50: ++ case MMC_TIMING_UHS_DDR50: + pinctrl = imx_data->pins_100mhz; + break; + case MMC_TIMING_UHS_SDR104: +-- +2.7.1 + + +From 310e398dd876ad3b503bb697ffe286a65b7041af Mon Sep 17 00:00:00 2001 +From: Dong Aisheng +Date: Mon, 14 Dec 2015 15:31:43 +0800 +Subject: [PATCH 365/384] MLK-12000 mmc: sdhci-esdhci-imx: disable DLL delay + line settings explicitly + +Disable DLL delay line settings explicitly during driver initialization +in case ROM/uBoot had set an invalid delay. +e.g. MX6DL ROM has set the default delay line(DLLCTRL) to 0x1000021, +the uSDHC clock timing will become marginal when works on DDR mode +due to default delay and will possibly see CRC errors in cause the board +is not perfectly designed on the eMMC chip layout. + +Signed-off-by: Dong Aisheng +(cherry picked from commit 6df6f1b26eaaf709b0eacb6f0bc6366942baaae9) +Signed-off-by: Matus Kral +--- + drivers/mmc/host/sdhci-esdhc-imx.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c +index 6d5f97f..b46a16f 100644 +--- a/drivers/mmc/host/sdhci-esdhc-imx.c ++++ b/drivers/mmc/host/sdhci-esdhc-imx.c +@@ -1229,6 +1229,9 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) + */ + writel(readl(host->ioaddr + 0x6c) | BIT(7), + host->ioaddr + 0x6c); ++ ++ /* disable DLL_CTRL delay line settings */ ++ writel(0x0, host->ioaddr + ESDHC_DLL_CTRL); + } + + if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) +-- +2.7.1 + + +From 23dcab42e6da4bc6b270c36ce268b22f6a822f37 Mon Sep 17 00:00:00 2001 +From: Haibo Chen +Date: Thu, 29 Oct 2015 17:21:37 +0800 +Subject: [PATCH 366/384] MLK-11789 mmc: sdhci: Add 1ms delay in eMMC tuning + procedure + +On 4.1 kernel, some eMMC on i.MX7D-SDB board can't pass HS400 tuning, +the same eMMC can pass HS400 tuning on 3.14 kernel. The difference +is that 4.1 kernel does not have 1ms delay for eMMC during the +tuning procedure. The root cause still not find, add back the +1ms delay first. + +Signed-off-by: Haibo Chen +(cherry picked from commit d50b04942cada19b0c0df1097470c0f5c440339e) +Signed-off-by: Matus Kral +--- + drivers/mmc/host/sdhci.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c +index 8e91d17..0cd8131 100644 +--- a/drivers/mmc/host/sdhci.c ++++ b/drivers/mmc/host/sdhci.c +@@ -2040,9 +2040,8 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode) + + ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); + +- /* eMMC spec does not require a delay between tuning cycles */ +- if (opcode == MMC_SEND_TUNING_BLOCK) +- mdelay(1); ++ /* Add 1ms delay for SD and eMMC */ ++ mdelay(1); + } while (ctrl & SDHCI_CTRL_EXEC_TUNING); + + /* +-- +2.7.1 + + +From 7735efde141072fe00ee79bf612062426f8de51e Mon Sep 17 00:00:00 2001 +From: Dong Aisheng +Date: Fri, 5 Feb 2016 17:58:16 +0800 +Subject: [PATCH 367/384] MLK-12391-1 mmc: sdhci-esdhc-imx: back to + STROBE_DLL_CTRL_SLV_DLY_TARGET of 1 + +We see CRCs with SLV_DLY_TARGET of 7 during driver runtime suspend/resume +if disable sw auto retuning. Back to SLV_DLY_TARGET of 1 which is used +in 3.14 kernel and don't have such issue. + +Signed-off-by: Dong Aisheng +(cherry picked from commit cfcd9c369186ddc8c9e25e7c7573f91a4516449d) +(cherry picked from commit e0011f5cbf4ec856c9b8bb47fdf1099be5af8758) +Signed-off-by: Matus Kral +--- + drivers/mmc/host/sdhci-esdhc-imx.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c +index b46a16f..f8b72cc 100644 +--- a/drivers/mmc/host/sdhci-esdhc-imx.c ++++ b/drivers/mmc/host/sdhci-esdhc-imx.c +@@ -66,6 +66,7 @@ + #define ESDHC_STROBE_DLL_CTRL 0x70 + #define ESDHC_STROBE_DLL_CTRL_ENABLE (1 << 0) + #define ESDHC_STROBE_DLL_CTRL_RESET (1 << 1) ++#define ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET 0x1 + #define ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET_SHIFT 3 + + #define ESDHC_STROBE_DLL_STATUS 0x74 +@@ -849,7 +850,8 @@ static void esdhc_set_strobe_dll(struct sdhci_host *host) + * for the uSDHC loopback read clock + */ + v = ESDHC_STROBE_DLL_CTRL_ENABLE | +- (7 << ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET_SHIFT); ++ (ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET ++ << ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET_SHIFT); + writel(v, host->ioaddr + ESDHC_STROBE_DLL_CTRL); + /* wait 1us to make sure strobe dll status register stable */ + udelay(1); +-- +2.7.1 + + +From 53d0653ce072ae059bdf1b9337cf19e550b266bd Mon Sep 17 00:00:00 2001 +From: Dong Aisheng +Date: Fri, 5 Feb 2016 19:55:28 +0800 +Subject: [PATCH 368/384] MLK-12391-2 mmc: sdhci: add standard hw auto retuning + support + +If HW supports SDHCI_TUNING_MODE_3 which is auto retuning, we won't +retune during runtime suspend and resume, instead we use Re-tuning +Request signaled via SDHCI_INT_RETUNE interrupt to do retuning and +hw auto retuning during data transfer to guarantee the signal sample +window correction. + +This can avoid a mass of repeatly retuning during small file system +data access and improve the performance. + +Signed-off-by: Dong Aisheng +(cherry picked from commit 89c224b34d3a63797d956969c2fdf4ccb7ff25bf) +(cherry picked from commit 7e9b6c386bf2ba9b39305ae982742936e886cdf7) +Signed-off-by: Matus Kral +--- + drivers/mmc/host/sdhci.c | 18 ++++++++++++++---- + drivers/mmc/host/sdhci.h | 3 +++ + 2 files changed, 17 insertions(+), 4 deletions(-) + +diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c +index 0cd8131..87387e8 100644 +--- a/drivers/mmc/host/sdhci.c ++++ b/drivers/mmc/host/sdhci.c +@@ -238,6 +238,9 @@ static void sdhci_init(struct sdhci_host *host, int soft) + SDHCI_INT_TIMEOUT | SDHCI_INT_DATA_END | + SDHCI_INT_RESPONSE; + ++ if (host->tuning_mode == SDHCI_TUNING_MODE_3) ++ host->ier |= SDHCI_INT_RETUNE; ++ + sdhci_writel(host, host->ier, SDHCI_INT_ENABLE); + sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE); + +@@ -2612,6 +2615,9 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) + pr_err("%s: Card is consuming too much power!\n", + mmc_hostname(host->mmc)); + ++ if (intmask & SDHCI_INT_RETUNE) ++ mmc_retune_needed(host->mmc); ++ + if (intmask & SDHCI_INT_CARD_INT) { + sdhci_enable_sdio_irq_nolock(host, false); + host->thread_isr |= SDHCI_INT_CARD_INT; +@@ -2710,8 +2716,10 @@ int sdhci_suspend_host(struct sdhci_host *host) + { + sdhci_disable_card_detection(host); + +- mmc_retune_timer_stop(host->mmc); +- mmc_retune_needed(host->mmc); ++ if (host->tuning_mode == SDHCI_TUNING_MODE_1) { ++ mmc_retune_timer_stop(host->mmc); ++ mmc_retune_needed(host->mmc); ++ } + + if (!device_may_wakeup(mmc_dev(host->mmc))) { + host->ier = 0; +@@ -2797,8 +2805,10 @@ int sdhci_runtime_suspend_host(struct sdhci_host *host) + { + unsigned long flags; + +- mmc_retune_timer_stop(host->mmc); +- mmc_retune_needed(host->mmc); ++ if (host->tuning_mode == SDHCI_TUNING_MODE_1) { ++ mmc_retune_timer_stop(host->mmc); ++ mmc_retune_needed(host->mmc); ++ } + + spin_lock_irqsave(&host->lock, flags); + host->ier &= SDHCI_INT_CARD_INT; +diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h +index 0115e99..cc02e8d 100644 +--- a/drivers/mmc/host/sdhci.h ++++ b/drivers/mmc/host/sdhci.h +@@ -128,6 +128,7 @@ + #define SDHCI_INT_CARD_INSERT 0x00000040 + #define SDHCI_INT_CARD_REMOVE 0x00000080 + #define SDHCI_INT_CARD_INT 0x00000100 ++#define SDHCI_INT_RETUNE 0x00001000 + #define SDHCI_INT_ERROR 0x00008000 + #define SDHCI_INT_TIMEOUT 0x00010000 + #define SDHCI_INT_CRC 0x00020000 +@@ -514,6 +515,8 @@ struct sdhci_host { + unsigned int tuning_count; /* Timer count for re-tuning */ + unsigned int tuning_mode; /* Re-tuning mode supported by host */ + #define SDHCI_TUNING_MODE_1 0 ++#define SDHCI_TUNING_MODE_2 1 ++#define SDHCI_TUNING_MODE_3 2 + + unsigned long private[0] ____cacheline_aligned; + }; +-- +2.7.1 + + +From 1aefb1b082b8050f31d0d882dedcad402839b44c Mon Sep 17 00:00:00 2001 +From: Dong Aisheng +Date: Fri, 5 Feb 2016 20:03:48 +0800 +Subject: [PATCH 369/384] MLK-12391-3 mmc: sdhci-esdhc-imx: enable hw auto + retuning for STD_TUNING + +Enable HW auto retuning when set SDHCI_CTRL_EXEC_TUNING and clear it +when clear SDHCI_CTRL_TUNED_CLK. + +Signed-off-by: Dong Aisheng +(cherry picked from commit d07db4fdf967ad8ecebb751f2ea24a578dfb9395) +(cherry picked from commit 3af8a84a115af377b00ceb610c54ebb344e0796c) +Signed-off-by: Matus Kral +--- + drivers/mmc/host/sdhci-esdhc-imx.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c +index f8b72cc..e7320cc 100644 +--- a/drivers/mmc/host/sdhci-esdhc-imx.c ++++ b/drivers/mmc/host/sdhci-esdhc-imx.c +@@ -44,6 +44,7 @@ + #define ESDHC_MIX_CTRL_AC23EN (1 << 7) + #define ESDHC_MIX_CTRL_EXE_TUNE (1 << 22) + #define ESDHC_MIX_CTRL_SMPCLK_SEL (1 << 23) ++#define ESDHC_MIX_CTRL_AUTO_TUNE_EN (1 << 24) + #define ESDHC_MIX_CTRL_FBCLK_SEL (1 << 25) + #define ESDHC_MIX_CTRL_HS400_EN (1 << 26) + /* Bits 3 and 6 are not SDHCI standard definitions */ +@@ -486,11 +487,13 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg) + } else { + v &= ~ESDHC_MIX_CTRL_SMPCLK_SEL; + m &= ~ESDHC_MIX_CTRL_FBCLK_SEL; ++ m &= ~ESDHC_MIX_CTRL_AUTO_TUNE_EN; + } + + if (val & SDHCI_CTRL_EXEC_TUNING) { + v |= ESDHC_MIX_CTRL_EXE_TUNE; + m |= ESDHC_MIX_CTRL_FBCLK_SEL; ++ m |= ESDHC_MIX_CTRL_AUTO_TUNE_EN; + tuning_ctrl = readl(host->ioaddr + ESDHC_TUNING_CTRL); + tuning_ctrl |= ESDHC_STD_TUNING_EN | ESDHC_TUNING_START_TAP; + if (imx_data->boarddata.tuning_step) { +-- +2.7.1 + + +From f18819cce05995e795a235206f5a558bf984c88a Mon Sep 17 00:00:00 2001 +From: Dong Aisheng +Date: Fri, 5 Feb 2016 19:27:09 +0800 +Subject: [PATCH 370/384] MLK-12391-4 mmc: sdhci-esdhc-imx: enable hw auto + retuning for MAN_TUNING + +Fake one caps_1 register indicating hw auto retuning support since mx6qdl +does not have it and enable auto retuning in post_tuning process. + +Signed-off-by: Dong Aisheng +(cherry picked from commit b46b1ee480ce731165843f43481809b028203dd1) +(cherry picked from commit 7fd37e87dd714f93d98a61adab4c7dc5621d2e41) +Signed-off-by: Matus Kral +--- + drivers/mmc/host/sdhci-esdhc-imx.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c +index e7320cc..79c07be 100644 +--- a/drivers/mmc/host/sdhci-esdhc-imx.c ++++ b/drivers/mmc/host/sdhci-esdhc-imx.c +@@ -303,7 +303,8 @@ static u32 esdhc_readl_le(struct sdhci_host *host, int reg) + /* imx6q/dl does not have cap_1 register, fake one */ + val = SDHCI_SUPPORT_DDR50 | SDHCI_SUPPORT_SDR104 + | SDHCI_SUPPORT_SDR50 +- | SDHCI_USE_SDR50_TUNING; ++ | SDHCI_USE_SDR50_TUNING ++ | (SDHCI_TUNING_MODE_3 << SDHCI_RETUNING_MODE_SHIFT); + + if (imx_data->socdata->flags & ESDHC_FLAG_HS400) + val |= SDHCI_SUPPORT_HS400; +@@ -473,10 +474,13 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg) + writel(new_val, host->ioaddr + ESDHC_VENDOR_SPEC); + if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) { + new_val = readl(host->ioaddr + ESDHC_MIX_CTRL); +- if (val & SDHCI_CTRL_TUNED_CLK) ++ if (val & SDHCI_CTRL_TUNED_CLK) { + new_val |= ESDHC_MIX_CTRL_SMPCLK_SEL; +- else ++ new_val |= ESDHC_MIX_CTRL_AUTO_TUNE_EN; ++ } else { + new_val &= ~ESDHC_MIX_CTRL_SMPCLK_SEL; ++ new_val &= ~ESDHC_MIX_CTRL_AUTO_TUNE_EN; ++ } + writel(new_val , host->ioaddr + ESDHC_MIX_CTRL); + } else if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING) { + u32 v = readl(host->ioaddr + SDHCI_ACMD12_ERR); +@@ -757,6 +761,7 @@ static void esdhc_post_tuning(struct sdhci_host *host) + + reg = readl(host->ioaddr + ESDHC_MIX_CTRL); + reg &= ~ESDHC_MIX_CTRL_EXE_TUNE; ++ reg |= ESDHC_MIX_CTRL_AUTO_TUNE_EN; + writel(reg, host->ioaddr + ESDHC_MIX_CTRL); + } + +-- +2.7.1 + + +From 5c86cd9c2c75e183af04810a4239e667df4f4090 Mon Sep 17 00:00:00 2001 +From: Dong Aisheng +Date: Tue, 16 Feb 2016 15:45:18 +0800 +Subject: [PATCH 371/384] MLK-12404-1 mmc: sdhci-esdhc-imx: fix strobe DLL lock + wrong clock issue + +When enable DDR, the clock factor definition is changed. +e.g. original 200Mhz will be changed to 100Mhz if set MIX_CTRL_DDREN bit. +So we need to update the clock setting for strobe dll to lock +the correct clock rate. + +Additionally we also need disable the clock before locking strobe dll. + +Signed-off-by: Dong Aisheng +(cherry picked from commit 4d8095a6e860f773f5d2e4d5b62a6f4ba1a92431) +(cherry picked from commit 392a2ec58fa88dc36fa582a6ebeaaaaca13ff245) +Signed-off-by: Matus Kral +--- + drivers/mmc/host/sdhci-esdhc-imx.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c +index 79c07be..e94ef89 100644 +--- a/drivers/mmc/host/sdhci-esdhc-imx.c ++++ b/drivers/mmc/host/sdhci-esdhc-imx.c +@@ -850,6 +850,11 @@ static void esdhc_set_strobe_dll(struct sdhci_host *host) + u32 v; + + if (host->mmc->actual_clock > ESDHC_STROBE_DLL_CLK_FREQ) { ++ /* disable clock before enabling strobe dll */ ++ writel(readl(host->ioaddr + ESDHC_VENDOR_SPEC) & ++ (~ESDHC_VENDOR_SPEC_FRC_SDCLK_ON), ++ host->ioaddr + ESDHC_VENDOR_SPEC); ++ + /* force a reset on strobe dll */ + writel(ESDHC_STROBE_DLL_CTRL_RESET, + host->ioaddr + ESDHC_STROBE_DLL_CTRL); +@@ -912,6 +917,8 @@ static void esdhc_set_uhs_signaling(struct sdhci_host *host, unsigned timing) + m |= ESDHC_MIX_CTRL_DDREN | ESDHC_MIX_CTRL_HS400_EN; + writel(m, host->ioaddr + ESDHC_MIX_CTRL); + imx_data->is_ddr = 1; ++ /* update clock after enable DDR for strobe DLL lock */ ++ host->ops->set_clock(host, host->clock); + esdhc_set_strobe_dll(host); + break; + } +-- +2.7.1 + + +From 6567e7c26905f55eee0c7f86b5909184d83296ae Mon Sep 17 00:00:00 2001 +From: Dong Aisheng +Date: Tue, 16 Feb 2016 19:05:17 +0800 +Subject: [PATCH 372/384] MLK-12404-2 mmc: sdhci-esdhc-imx: change + SLV_DLY_TARGET to value 0x7 + +Change SLV_DLY_TARGET to IC recommended value 0x7(4/1 cycle) +according to spec. +The old value 0x1 is not robust and may fail in some critical +circumstance. + +Signed-off-by: Dong Aisheng +(cherry picked from commit 3c755f08de810824250c935d099f3f8c7def4946) +(cherry picked from commit b63b738ca6f850c119ef0ea6b3f5f18b1ad6b64c) +Signed-off-by: Matus Kral +--- + drivers/mmc/host/sdhci-esdhc-imx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c +index e94ef89..664c165 100644 +--- a/drivers/mmc/host/sdhci-esdhc-imx.c ++++ b/drivers/mmc/host/sdhci-esdhc-imx.c +@@ -67,7 +67,7 @@ + #define ESDHC_STROBE_DLL_CTRL 0x70 + #define ESDHC_STROBE_DLL_CTRL_ENABLE (1 << 0) + #define ESDHC_STROBE_DLL_CTRL_RESET (1 << 1) +-#define ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET 0x1 ++#define ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET 0x7 + #define ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET_SHIFT 3 + + #define ESDHC_STROBE_DLL_STATUS 0x74 +-- +2.7.1 + + +From 14ab952b26f98b5fbd89127c886c8c9b00bfdb4a Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Sun, 24 Apr 2016 00:47:21 +0200 +Subject: [PATCH 373/384] The Linux Scheduler: a Decade of Wasted Cores As a + central part of resource management, the OS thread scheduler must maintain + the following, simple, invariant: make sure that ready threads are scheduled + on available cores. As simple as it may seem, we found that this invariant is + often broken in Linux. Cores may stay idle for seconds while ready threads + are waiting in runqueues. In our experiments, these performance bugs caused + many-fold performance degradation for synchronization-heavy scientific + applications, 13% higher latency for kernel make, and a 14-23% decrease in + TPC-H throughput for a widely used commercial database. The main contribution + of this work is the discovery and analysis of .... + +--- + arch/x86/kernel/smpboot.c | 5 ++ + kernel/sched/core.c | 91 ++++++++++++----------- + kernel/sched/fair.c | 182 +++++++++++++++------------------------------- + 3 files changed, 113 insertions(+), 165 deletions(-) + +diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c +index fbabe4f..b0256e0 100644 +--- a/arch/x86/kernel/smpboot.c ++++ b/arch/x86/kernel/smpboot.c +@@ -429,7 +429,12 @@ void set_cpu_sibling_map(int cpu) + } else if (i != cpu && !c->booted_cores) + c->booted_cores = cpu_data(i).booted_cores; + } ++#ifndef CONFIG_NUMA + if (match_die(c, o) && !topology_same_node(c, o)) ++#else ++ if (match_die(c, o) && !topology_same_node(c, o) ++ && sched_max_numa_distance == -1) ++#endif + primarily_use_numa_for_topology(); + } + } +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index da96d97..9d61f15 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -6385,61 +6385,66 @@ build_overlap_sched_groups(struct sched_domain *sd, int cpu) + struct sd_data *sdd = sd->private; + struct sched_domain *sibling; + int i; ++ int tries; + + cpumask_clear(covered); + +- for_each_cpu(i, span) { +- struct cpumask *sg_span; ++ for(tries = 0; tries < 2; tries++) { ++ for_each_cpu(i, span) { ++ struct cpumask *sg_span; ++ if(tries == 0 && i != cpu) ++ continue; + +- if (cpumask_test_cpu(i, covered)) +- continue; ++ if (cpumask_test_cpu(i, covered)) ++ continue; + +- sibling = *per_cpu_ptr(sdd->sd, i); ++ sibling = *per_cpu_ptr(sdd->sd, i); + +- /* See the comment near build_group_mask(). */ +- if (!cpumask_test_cpu(i, sched_domain_span(sibling))) +- continue; ++ /* See the comment near build_group_mask(). */ ++ if (!cpumask_test_cpu(i, sched_domain_span(sibling))) ++ continue; + +- sg = kzalloc_node(sizeof(struct sched_group) + cpumask_size(), +- GFP_KERNEL, cpu_to_node(cpu)); ++ sg = kzalloc_node(sizeof(struct sched_group) + cpumask_size(), ++ GFP_KERNEL, cpu_to_node(cpu)); + +- if (!sg) +- goto fail; ++ if (!sg) ++ goto fail; + +- sg_span = sched_group_cpus(sg); +- if (sibling->child) +- cpumask_copy(sg_span, sched_domain_span(sibling->child)); +- else +- cpumask_set_cpu(i, sg_span); ++ sg_span = sched_group_cpus(sg); ++ if (sibling->child) ++ cpumask_copy(sg_span, sched_domain_span(sibling->child)); ++ else ++ cpumask_set_cpu(i, sg_span); + +- cpumask_or(covered, covered, sg_span); ++ cpumask_or(covered, covered, sg_span); + +- sg->sgc = *per_cpu_ptr(sdd->sgc, i); +- if (atomic_inc_return(&sg->sgc->ref) == 1) +- build_group_mask(sd, sg); ++ sg->sgc = *per_cpu_ptr(sdd->sgc, i); ++ if (atomic_inc_return(&sg->sgc->ref) == 1) ++ build_group_mask(sd, sg); + +- /* +- * Initialize sgc->capacity such that even if we mess up the +- * domains and no possible iteration will get us here, we won't +- * die on a /0 trap. +- */ +- sg->sgc->capacity = SCHED_CAPACITY_SCALE * cpumask_weight(sg_span); +- +- /* +- * Make sure the first group of this domain contains the +- * canonical balance cpu. Otherwise the sched_domain iteration +- * breaks. See update_sg_lb_stats(). +- */ +- if ((!groups && cpumask_test_cpu(cpu, sg_span)) || +- group_balance_cpu(sg) == cpu) +- groups = sg; ++ /* ++ * Initialize sgc->capacity such that even if we mess up the ++ * domains and no possible iteration will get us here, we won't ++ * die on a /0 trap. ++ */ ++ sg->sgc->capacity = SCHED_CAPACITY_SCALE * cpumask_weight(sg_span); + +- if (!first) +- first = sg; +- if (last) +- last->next = sg; +- last = sg; +- last->next = first; ++ /* ++ * Make sure the first group of this domain contains the ++ * canonical balance cpu. Otherwise the sched_domain iteration ++ * breaks. See update_sg_lb_stats(). ++ */ ++ if ((!groups && cpumask_test_cpu(cpu, sg_span)) || ++ group_balance_cpu(sg) == cpu) ++ groups = sg; ++ ++ if (!first) ++ first = sg; ++ if (last) ++ last->next = sg; ++ last = sg; ++ last->next = first; ++ } + } + sd->groups = groups; + +@@ -6648,7 +6653,7 @@ static void claim_allocations(int cpu, struct sched_domain *sd) + static int sched_domains_numa_levels; + enum numa_topology_type sched_numa_topology_type; + static int *sched_domains_numa_distance; +-int sched_max_numa_distance; ++int sched_max_numa_distance = -1; + static struct cpumask ***sched_domains_numa_masks; + static int sched_domains_curr_level; + #endif +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c +index 8c71e62..65c7955 100644 +--- a/kernel/sched/fair.c ++++ b/kernel/sched/fair.c +@@ -4931,10 +4931,39 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f + int want_affine = 0; + int sync = wake_flags & WF_SYNC; + ++ int _cpu; ++ u64 oldest_idle_stamp = 0xfffffffffffffff; ++ int oldest_idle_stamp_cpu; ++ + if (sd_flag & SD_BALANCE_WAKE) + want_affine = !wake_wide(p) && cpumask_test_cpu(cpu, tsk_cpus_allowed(p)); + + rcu_read_lock(); ++ ++ if (!cpu_rq(prev_cpu)->nr_running) ++ { ++ new_cpu = prev_cpu; ++ goto unlock; ++ } ++ ++ for_each_online_cpu(_cpu) ++ { ++ if (!cpumask_test_cpu(_cpu, tsk_cpus_allowed(p)) || ++ cpu_rq(_cpu)->nr_running) continue; ++ ++ if (cpu_rq(_cpu)->idle_stamp < oldest_idle_stamp) ++ { ++ oldest_idle_stamp = cpu_rq(_cpu)->idle_stamp; ++ oldest_idle_stamp_cpu = _cpu; ++ } ++ } ++ ++ if (oldest_idle_stamp != 0xfffffffffffffff) ++ { ++ new_cpu = oldest_idle_stamp_cpu; ++ goto unlock; ++ } ++ + for_each_domain(cpu, tmp) { + if (!(tmp->flags & SD_LOAD_BALANCE)) + break; +@@ -4999,6 +5028,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f + } + /* while loop will break here if sd == NULL */ + } ++unlock: + rcu_read_unlock(); + + return new_cpu; +@@ -6003,6 +6033,8 @@ struct sg_lb_stats { + unsigned int sum_nr_running; /* Nr tasks running in the group */ + unsigned int idle_cpus; + unsigned int group_weight; ++ unsigned long min_load; ++ unsigned long max_load; + enum group_type group_type; + int group_no_capacity; + #ifdef CONFIG_NUMA_BALANCING +@@ -6302,6 +6334,8 @@ static inline void update_sg_lb_stats(struct lb_env *env, + bool *overload) + { + unsigned long load; ++ unsigned long min_load = ULONG_MAX; ++ unsigned long max_load = 0UL; + int i; + + memset(sgs, 0, sizeof(*sgs)); +@@ -6315,6 +6349,11 @@ static inline void update_sg_lb_stats(struct lb_env *env, + else + load = source_load(i, load_idx); + ++ if (load < min_load) ++ min_load = load; ++ if(load > max_load) ++ max_load = load; ++ + sgs->group_load += load; + sgs->group_util += cpu_util(i); + sgs->sum_nr_running += rq->cfs.h_nr_running; +@@ -6335,6 +6374,9 @@ static inline void update_sg_lb_stats(struct lb_env *env, + sgs->group_capacity = group->sgc->capacity; + sgs->avg_load = (sgs->group_load*SCHED_CAPACITY_SCALE) / sgs->group_capacity; + ++ sgs->min_load = min_load; ++ sgs->max_load = max_load; ++ + if (sgs->sum_nr_running) + sgs->load_per_task = sgs->sum_weighted_load / sgs->sum_nr_running; + +@@ -6364,14 +6406,15 @@ static bool update_sd_pick_busiest(struct lb_env *env, + { + struct sg_lb_stats *busiest = &sds->busiest_stat; + +- if (sgs->group_type > busiest->group_type) +- return true; ++ /* Not sure we want to keep that or not */ ++ /*if (sgs->group_type > busiest->group_type) ++ return true;*/ + +- if (sgs->group_type < busiest->group_type) +- return false; ++ if (sgs->min_load <= busiest->min_load) ++ return true; + +- if (sgs->avg_load <= busiest->avg_load) +- return false; ++ if (sgs->group_type == group_imbalanced) ++ return true; + + /* This is the busiest node in its class. */ + if (!(env->sd->flags & SD_ASYM_PACKING)) +@@ -6624,69 +6667,19 @@ void fix_small_imbalance(struct lb_env *env, struct sd_lb_stats *sds) + */ + static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *sds) + { +- unsigned long max_pull, load_above_capacity = ~0UL; + struct sg_lb_stats *local, *busiest; + + local = &sds->local_stat; + busiest = &sds->busiest_stat; + +- if (busiest->group_type == group_imbalanced) { +- /* +- * In the group_imb case we cannot rely on group-wide averages +- * to ensure cpu-load equilibrium, look at wider averages. XXX +- */ +- busiest->load_per_task = +- min(busiest->load_per_task, sds->avg_load); +- } +- +- /* +- * In the presence of smp nice balancing, certain scenarios can have +- * max load less than avg load(as we skip the groups at or below +- * its cpu_capacity, while calculating max_load..) +- */ +- if (busiest->avg_load <= sds->avg_load || +- local->avg_load >= sds->avg_load) { ++ if(local->min_load >= busiest->max_load) { + env->imbalance = 0; +- return fix_small_imbalance(env, sds); + } +- +- /* +- * If there aren't any idle cpus, avoid creating some. +- */ +- if (busiest->group_type == group_overloaded && +- local->group_type == group_overloaded) { +- load_above_capacity = busiest->sum_nr_running * +- SCHED_LOAD_SCALE; +- if (load_above_capacity > busiest->group_capacity) +- load_above_capacity -= busiest->group_capacity; +- else +- load_above_capacity = ~0UL; ++ else { ++ env->imbalance = (busiest->max_load - local->min_load) / 2; + } + +- /* +- * We're trying to get all the cpus to the average_load, so we don't +- * want to push ourselves above the average load, nor do we wish to +- * reduce the max loaded cpu below the average load. At the same time, +- * we also don't want to reduce the group load below the group capacity +- * (so that we can implement power-savings policies etc). Thus we look +- * for the minimum possible imbalance. +- */ +- max_pull = min(busiest->avg_load - sds->avg_load, load_above_capacity); +- +- /* How much load to actually move to equalise the imbalance */ +- env->imbalance = min( +- max_pull * busiest->group_capacity, +- (sds->avg_load - local->avg_load) * local->group_capacity +- ) / SCHED_CAPACITY_SCALE; +- +- /* +- * if *imbalance is less than the average load per runnable task +- * there is no guarantee that any tasks will be moved so we'll have +- * a think about bumping its value to force at least one task to be +- * moved +- */ +- if (env->imbalance < busiest->load_per_task) +- return fix_small_imbalance(env, sds); ++ return; + } + + /******* find_busiest_group() helpers end here *********************/ +@@ -6748,39 +6741,13 @@ static struct sched_group *find_busiest_group(struct lb_env *env) + busiest->group_no_capacity) + goto force_balance; + +- /* +- * If the local group is busier than the selected busiest group +- * don't try and pull any tasks. +- */ +- if (local->avg_load >= busiest->avg_load) +- goto out_balanced; +- +- /* +- * Don't pull any tasks if this group is already above the domain +- * average load. +- */ +- if (local->avg_load >= sds.avg_load) ++ if(local->min_load < busiest->min_load) ++ { ++ goto force_balance; ++ } ++ else ++ { + goto out_balanced; +- +- if (env->idle == CPU_IDLE) { +- /* +- * This cpu is idle. If the busiest group is not overloaded +- * and there is no imbalance between this and busiest group +- * wrt idle cpus, it is balanced. The imbalance becomes +- * significant if the diff is greater than 1 otherwise we +- * might end up to just move the imbalance on another group +- */ +- if ((busiest->group_type != group_overloaded) && +- (local->idle_cpus <= (busiest->idle_cpus + 1))) +- goto out_balanced; +- } else { +- /* +- * In the CPU_NEWLY_IDLE, CPU_NOT_IDLE cases, use +- * imbalance_pct to be conservative. +- */ +- if (100 * busiest->avg_load <= +- env->sd->imbalance_pct * local->avg_load) +- goto out_balanced; + } + + force_balance: +@@ -6910,36 +6877,7 @@ static int active_load_balance_cpu_stop(void *data); + + static int should_we_balance(struct lb_env *env) + { +- struct sched_group *sg = env->sd->groups; +- struct cpumask *sg_cpus, *sg_mask; +- int cpu, balance_cpu = -1; +- +- /* +- * In the newly idle case, we will allow all the cpu's +- * to do the newly idle load balance. +- */ +- if (env->idle == CPU_NEWLY_IDLE) +- return 1; +- +- sg_cpus = sched_group_cpus(sg); +- sg_mask = sched_group_mask(sg); +- /* Try to find first idle cpu */ +- for_each_cpu_and(cpu, sg_cpus, env->cpus) { +- if (!cpumask_test_cpu(cpu, sg_mask) || !idle_cpu(cpu)) +- continue; +- +- balance_cpu = cpu; +- break; +- } +- +- if (balance_cpu == -1) +- balance_cpu = group_balance_cpu(sg); +- +- /* +- * First idle cpu or the first cpu(busiest) in this sched group +- * is eligible for doing load balancing at this and above domains. +- */ +- return balance_cpu == env->dst_cpu; ++ return 1; + } + + /* +-- +2.7.1 + + +From f44f8ae14e8d44ef659405e790fea633ec74366d Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Sun, 24 Apr 2016 10:49:50 +0200 +Subject: [PATCH 374/384] mxc_edid: fix mode flags + +--- + drivers/video/mxc/mxc_edid.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/video/mxc/mxc_edid.c b/drivers/video/mxc/mxc_edid.c +index 6106dc1..e60edcb 100644 +--- a/drivers/video/mxc/mxc_edid.c ++++ b/drivers/video/mxc/mxc_edid.c +@@ -43,7 +43,7 @@ const struct fb_videomode mxc_cea_mode[64] = { + /* #1: 640x480p@59.94/60Hz 4:3 */ + [1] = { + NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2, 0, +- FB_VMODE_DOUBLE | FB_VMODE_NONINTERLACED | FB_VMODE_ASPECT_4_3, 0, ++ FB_VMODE_NONINTERLACED | FB_VMODE_ASPECT_4_3, 0, + }, + /* #2: 720x480p@59.94/60Hz 4:3 */ + [2] = { +-- +2.7.1 + + +From 82a808178ed0cb991c810ed2a64c601fff5bf4f0 Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Sun, 24 Apr 2016 10:50:56 +0200 +Subject: [PATCH 375/384] mxc_edid/mxc_fb_find_nearest_mode(): add support to + (auto)relax ASPECT RATIO + +--- + drivers/video/mxc/mxc_edid.c | 11 +++++++---- + drivers/video/mxc/mxc_hdmi.c | 6 +++--- + include/video/mxc_edid.h | 2 +- + 3 files changed, 11 insertions(+), 8 deletions(-) + +diff --git a/drivers/video/mxc/mxc_edid.c b/drivers/video/mxc/mxc_edid.c +index e60edcb..66e99b8 100644 +--- a/drivers/video/mxc/mxc_edid.c ++++ b/drivers/video/mxc/mxc_edid.c +@@ -861,14 +861,15 @@ int mxc_edid_read(struct i2c_adapter *adp, unsigned short addr, + EXPORT_SYMBOL(mxc_edid_read); + + const struct fb_videomode *mxc_fb_find_nearest_mode(const struct fb_videomode *mode, +- struct list_head *head, bool relax) ++ struct list_head *head) + { + struct list_head *pos; + struct fb_modelist *modelist; + struct fb_videomode *cmode; + static struct fb_videomode *best; + static u32 diff, diff_refresh; +- u32 mask = relax ? FB_VMODE_MASK_SIMPLE | FB_VMODE_ASPECT_MASK : ~0; ++ static int relax; ++ u32 mask = relax == 2 ? FB_VMODE_MASK_SIMPLE : (relax ? FB_VMODE_MASK_SIMPLE | FB_VMODE_ASPECT_MASK : ~0); + + if (!relax) { + diff = -1; +@@ -900,8 +901,10 @@ const struct fb_videomode *mxc_fb_find_nearest_mode(const struct fb_videomode *m + } + } + +- if (!relax && (diff_refresh || diff || !best)) +- mxc_fb_find_nearest_mode(mode, head, true); ++ if (relax++ < 2 && (diff_refresh || diff || !best)) ++ mxc_fb_find_nearest_mode(mode, head); ++ ++ relax--; + + return best; + } +diff --git a/drivers/video/mxc/mxc_hdmi.c b/drivers/video/mxc/mxc_hdmi.c +index 5cc3c54..269b295 100644 +--- a/drivers/video/mxc/mxc_hdmi.c ++++ b/drivers/video/mxc/mxc_hdmi.c +@@ -2275,7 +2275,7 @@ static void mxc_hdmi_set_mode(struct mxc_hdmi *hdmi, int edid_status) + + fb_var_to_videomode(&m, &var); + dump_fb_videomode(&m, hdmi); +- mode = mxc_fb_find_nearest_mode(&m, &hdmi->fbi->modelist, false); ++ mode = mxc_fb_find_nearest_mode(&m, &hdmi->fbi->modelist); + + if (mode) { + hdmi->fbi->mode = (struct fb_videomode *)mode; +@@ -2623,7 +2623,7 @@ static void mxc_hdmi_setup(struct mxc_hdmi *hdmi, unsigned long event) + else + memset(&hdmi->prev_virtual, 0, sizeof(hdmi->prev_virtual)); + if (!list_empty(&hdmi->fbi->modelist)) { +- edid_mode = mxc_fb_find_nearest_mode(&m, &hdmi->fbi->modelist, false); ++ edid_mode = mxc_fb_find_nearest_mode(&m, &hdmi->fbi->modelist); + pr_debug("edid mode vx:%d vy:%d", hdmi->fbi->var.xres_virtual, hdmi->fbi->var.yres_virtual); + dump_fb_videomode((struct fb_videomode *)edid_mode, hdmi); + /* update fbi mode */ +@@ -3085,7 +3085,7 @@ static int mxc_hdmi_disp_init(struct mxc_dispdrv_handle *disp, + fb_var_to_videomode(&m, &hdmi->fbi->var); + hdmi->dft_mode_set = false; + +- mode = mxc_fb_find_nearest_mode(&m, &hdmi->fbi->modelist, false); ++ mode = mxc_fb_find_nearest_mode(&m, &hdmi->fbi->modelist); + if (!mode) { + pr_err("%s: could not find mode in modelist\n", __func__); + ret = -ENOENT; +diff --git a/include/video/mxc_edid.h b/include/video/mxc_edid.h +index cd8a729..5e56ce9 100644 +--- a/include/video/mxc_edid.h ++++ b/include/video/mxc_edid.h +@@ -132,7 +132,7 @@ int mxc_edid_read(struct i2c_adapter *adp, unsigned short addr, + int mxc_edid_parse_ext_blk(unsigned char *edid, struct mxc_edid_cfg *cfg, + struct fb_monspecs *specs); + const struct fb_videomode *mxc_fb_find_nearest_mode(const struct fb_videomode *mode, +- struct list_head *head, bool relax); ++ struct list_head *head); + int mxc_edid_fb_mode_is_equal(bool use_aspect, const struct fb_videomode *mode1, + const struct fb_videomode *mode2, u32 mode_mask); + int mxc_fb_mode_is_equal_res(const struct fb_videomode *mode1, +-- +2.7.1 + + +From 098ce75aef5af4ebf6a352aca00b9e2343e0c8cd Mon Sep 17 00:00:00 2001 +From: Shengjiu Wang +Date: Tue, 23 Jun 2015 18:23:53 +0800 +Subject: [PATCH 376/384] ASoC: fsl: Add dedicated DMA buffer size for each cpu + dai + +Upstream-commit: fc9459ca226f713ebac9afd8b9c1fdf96f90c334 + +As the ssi is not the only cpu dai, there are esai, spdif, sai. +and imx_pcm_dma can be used by all of them. Especially ESAI need +a larger DMA buffer size. So Add dedicated DMA buffer for each cpu +dai. + +Signed-off-by: Shengjiu Wang +Acked-by: Nicolin Chen +Acked-by: Timur Tabi +Signed-off-by: Mark Brown +--- + sound/soc/fsl/imx-pcm.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/sound/soc/fsl/imx-pcm.h b/sound/soc/fsl/imx-pcm.h +index f8a9ef2..4382b1f 100644 +--- a/sound/soc/fsl/imx-pcm.h ++++ b/sound/soc/fsl/imx-pcm.h +@@ -29,6 +29,11 @@ + #define IMX_SPDIF_DMABUF_SIZE (64 * 1024) + #define IMX_ESAI_DMABUF_SIZE (256 * 1024) + ++#define IMX_DEFAULT_DMABUF_SIZE (64 * 1024) ++#define IMX_SAI_DMABUF_SIZE (64 * 1024) ++#define IMX_SPDIF_DMABUF_SIZE (64 * 1024) ++#define IMX_ESAI_DMABUF_SIZE (256 * 1024) ++ + static inline void + imx_pcm_dma_params_init_data(struct imx_dma_data *dma_data, + int dma, enum sdma_peripheral_type peripheral_type) +-- +2.7.1 + + +From e55bdaebf379c92499a6bd3c7423fab355be5d17 Mon Sep 17 00:00:00 2001 +From: Zidan Wang +Date: Fri, 26 Jun 2015 16:06:45 +0800 +Subject: [PATCH 377/384] MLK-11179 ASoC: fsl: implement specify audio DMA + buffer size from devicetree + +Upstream-commit: a5448665ea3324bc007c828acc3fce0220c557ea + +If the property "fsl,dma-buffer-size" is present, using the specified buffer size. +Otherwise, using the default audio buffer size. + +Signed-off-by: Zidan Wang +(cherry picked from commit bba153dd92a4f58b81c4c26fb3a95c45445c65e0) +--- + Documentation/devicetree/bindings/sound/fsl,esai.txt | 4 ++++ + Documentation/devicetree/bindings/sound/fsl,spdif.txt | 4 ++++ + Documentation/devicetree/bindings/sound/fsl,ssi.txt | 4 ++++ + sound/soc/fsl/fsl_esai.c | 8 ++++++-- + sound/soc/fsl/fsl_sai.c | 6 +++++- + sound/soc/fsl/fsl_spdif.c | 6 +++++- + sound/soc/fsl/fsl_ssi.c | 6 +++++- + 7 files changed, 33 insertions(+), 5 deletions(-) + +diff --git a/Documentation/devicetree/bindings/sound/fsl,esai.txt b/Documentation/devicetree/bindings/sound/fsl,esai.txt +index d3b6b5f..80a6ee9 100644 +--- a/Documentation/devicetree/bindings/sound/fsl,esai.txt ++++ b/Documentation/devicetree/bindings/sound/fsl,esai.txt +@@ -41,6 +41,10 @@ Required properties: + will be in use as default, or the big endian mode + will be in use for all the device registers. + ++ - fsl,dma-buffer-size: It specify the audio buffer size of playback and ++ capture. If this property is absent, using the default value of audio buffer ++ size. ++ + Example: + + esai: esai@02024000 { +diff --git a/Documentation/devicetree/bindings/sound/fsl,spdif.txt b/Documentation/devicetree/bindings/sound/fsl,spdif.txt +index b5ee32e..89dfabd 100644 +--- a/Documentation/devicetree/bindings/sound/fsl,spdif.txt ++++ b/Documentation/devicetree/bindings/sound/fsl,spdif.txt +@@ -32,6 +32,10 @@ Required properties: + will be in use as default, or the big endian mode + will be in use for all the device registers. + ++ - fsl,dma-buffer-size: It specify the audio buffer size of playback and ++ capture. If this property is absent, using the default value of audio buffer ++ size. ++ + Example: + + spdif: spdif@02004000 { +diff --git a/Documentation/devicetree/bindings/sound/fsl,ssi.txt b/Documentation/devicetree/bindings/sound/fsl,ssi.txt +index 5b76be4..3ad1096 100644 +--- a/Documentation/devicetree/bindings/sound/fsl,ssi.txt ++++ b/Documentation/devicetree/bindings/sound/fsl,ssi.txt +@@ -62,6 +62,10 @@ Optional properties: + "ac97-slave" - AC97 mode, SSI is clock slave + "ac97-master" - AC97 mode, SSI is clock master + ++- fsl,dma-buffer-size: It specify the audio buffer size of playback and ++ capture. If this property is absent, using the default value of audio buffer ++ size. ++ + Child 'codec' node required properties: + - compatible: Compatible list, contains the name of the codec + +diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c +index 8973e3e..5f39f0a 100644 +--- a/sound/soc/fsl/fsl_esai.c ++++ b/sound/soc/fsl/fsl_esai.c +@@ -1,7 +1,7 @@ + /* + * Freescale ESAI ALSA SoC Digital Audio Interface (DAI) driver + * +- * Copyright (C) 2014 Freescale Semiconductor, Inc. ++ * Copyright (C) 2014-2015 Freescale Semiconductor, Inc. + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any +@@ -886,6 +886,7 @@ static int fsl_esai_probe(struct platform_device *pdev) + const uint32_t *iprop; + void __iomem *regs; + int irq, ret; ++ u32 buffer_size; + + esai_priv = devm_kzalloc(&pdev->dev, sizeof(*esai_priv), GFP_KERNEL); + if (!esai_priv) +@@ -997,7 +998,10 @@ static int fsl_esai_probe(struct platform_device *pdev) + return ret; + } + +- ret = imx_pcm_dma_init(pdev, IMX_ESAI_DMABUF_SIZE); ++ if (of_property_read_u32(np, "fsl,dma-buffer-size", &buffer_size)) ++ buffer_size = IMX_ESAI_DMABUF_SIZE; ++ ++ ret = imx_pcm_dma_init(pdev, buffer_size); + if (ret) + dev_err(&pdev->dev, "failed to init imx pcm dma: %d\n", ret); + +diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c +index 08b460b..a85d093 100644 +--- a/sound/soc/fsl/fsl_sai.c ++++ b/sound/soc/fsl/fsl_sai.c +@@ -713,6 +713,7 @@ static int fsl_sai_probe(struct platform_device *pdev) + void __iomem *base; + char tmp[8]; + int irq, ret, i; ++ u32 buffer_size; + + sai = devm_kzalloc(&pdev->dev, sizeof(*sai), GFP_KERNEL); + if (!sai) +@@ -812,8 +813,11 @@ static int fsl_sai_probe(struct platform_device *pdev) + if (ret) + return ret; + ++ if (of_property_read_u32(np, "fsl,dma-buffer-size", &buffer_size)) ++ buffer_size = IMX_SAI_DMABUF_SIZE; ++ + if (sai->sai_on_imx) +- return imx_pcm_dma_init(pdev, IMX_SAI_DMABUF_SIZE); ++ return imx_pcm_dma_init(pdev, buffer_size); + else + return devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0); + } +diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c +index 3d59bb6..485c4ef 100644 +--- a/sound/soc/fsl/fsl_spdif.c ++++ b/sound/soc/fsl/fsl_spdif.c +@@ -1207,6 +1207,7 @@ static int fsl_spdif_probe(struct platform_device *pdev) + struct resource *res; + void __iomem *regs; + int irq, ret, i; ++ u32 buffer_size; + + if (!np) + return -ENODEV; +@@ -1304,7 +1305,10 @@ static int fsl_spdif_probe(struct platform_device *pdev) + return ret; + } + +- ret = imx_pcm_dma_init(pdev, IMX_SPDIF_DMABUF_SIZE); ++ if (of_property_read_u32(np, "fsl,dma-buffer-size", &buffer_size)) ++ buffer_size = IMX_SPDIF_DMABUF_SIZE; ++ ++ ret = imx_pcm_dma_init(pdev, buffer_size); + if (ret) + dev_err(&pdev->dev, "imx_pcm_dma_init failed: %d\n", ret); + +diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c +index a709626..622d161 100644 +--- a/sound/soc/fsl/fsl_ssi.c ++++ b/sound/soc/fsl/fsl_ssi.c +@@ -1275,6 +1275,7 @@ static int fsl_ssi_imx_probe(struct platform_device *pdev, + struct device_node *np = pdev->dev.of_node; + u32 dmas[4]; + int ret; ++ u32 buffer_size; + + if (ssi_private->has_ipg_clk_name) + ssi_private->clk = devm_clk_get(&pdev->dev, "ipg"); +@@ -1321,6 +1322,9 @@ static int fsl_ssi_imx_probe(struct platform_device *pdev, + ssi_private->dma_params_rx.maxburst &= ~0x1; + } + ++ if (of_property_read_u32(np, "fsl,dma-buffer-size", &buffer_size)) ++ buffer_size = IMX_SSI_DMABUF_SIZE; ++ + if (!ssi_private->use_dma) { + + /* +@@ -1341,7 +1345,7 @@ static int fsl_ssi_imx_probe(struct platform_device *pdev, + if (ret) + goto error_pcm; + } else { +- ret = imx_pcm_dma_init(pdev, IMX_SSI_DMABUF_SIZE); ++ ret = imx_pcm_dma_init(pdev, buffer_size); + if (ret) + goto error_pcm; + } +-- +2.7.1 + + +From 2bfeef1861afb53cd35bd7fa8a494675ad5009ca Mon Sep 17 00:00:00 2001 +From: Shengjiu Wang +Date: Tue, 16 Sep 2014 19:18:49 +0800 +Subject: [PATCH 378/384] MLK-11429-1: ASoC: fsl_spdif: don't change the root + clock rate of spdif in driver + +Upstream-commit: 00cffc88fb80e212f6fbe2a4fe163bd012cd92f8 + +cherry-pick below patch from imx_3.14.y +ENGR00331799-2 ASoC: fsl_spdif: don't change the root clock rate of spdif in driver + +The spdif root clock may be used by other module or defined with +CLK_SET_RATE_GATE, so we can't change the clock rate in driver. +In this patch remove the clk_set_rate and clk_round_rate to protect the +clock. + +Signed-off-by: Shengjiu Wang +(cherry picked from commit c77170b2c9a9737f6fd61a5ea85a43b90e8ef02b) +--- + sound/soc/fsl/fsl_spdif.c | 24 +++--------------------- + 1 file changed, 3 insertions(+), 21 deletions(-) + +diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c +index 485c4ef..023c1b9 100644 +--- a/sound/soc/fsl/fsl_spdif.c ++++ b/sound/soc/fsl/fsl_spdif.c +@@ -1,7 +1,7 @@ + /* + * Freescale S/PDIF ALSA SoC Digital Audio Interface (DAI) driver + * +- * Copyright (C) 2013 Freescale Semiconductor, Inc. ++ * Copyright (C) 2013-2015 Freescale Semiconductor, Inc. + * + * Based on stmp3xxx_spdif_dai.c + * Vladimir Barinov +@@ -379,7 +379,6 @@ static int spdif_set_sample_rate(struct snd_pcm_substream *substream, + unsigned long csfs = 0; + u32 stc, mask, rate; + u8 clk, txclk_df, sysclk_df; +- int ret; + + switch (sample_rate) { + case 32000: +@@ -421,19 +420,6 @@ static int spdif_set_sample_rate(struct snd_pcm_substream *substream, + + sysclk_df = spdif_priv->sysclk_df[rate]; + +- /* Don't mess up the clocks from other modules */ +- if (clk != STC_TXCLK_SPDIF_ROOT) +- goto clk_set_bypass; +- +- /* The S/PDIF block needs a clock of 64 * fs * txclk_df */ +- ret = clk_set_rate(spdif_priv->txclk[rate], +- 64 * sample_rate * txclk_df); +- if (ret) { +- dev_err(&pdev->dev, "failed to set tx clock rate\n"); +- return ret; +- } +- +-clk_set_bypass: + dev_dbg(&pdev->dev, "expected clock rate = %d\n", + (64 * sample_rate * txclk_df * sysclk_df)); + dev_dbg(&pdev->dev, "actual clock rate = %ld\n", +@@ -1097,7 +1083,7 @@ static u32 fsl_spdif_txclk_caldiv(struct fsl_spdif_priv *spdif_priv, + { + const u32 rate[] = { 32000, 44100, 48000, 96000, 192000 }; + bool is_sysclk = clk_is_match(clk, spdif_priv->sysclk); +- u64 rate_ideal, rate_actual, sub; ++ u64 rate_actual, sub; + u32 sysclk_dfmin, sysclk_dfmax; + u32 txclk_df, sysclk_df, arate; + +@@ -1107,11 +1093,7 @@ static u32 fsl_spdif_txclk_caldiv(struct fsl_spdif_priv *spdif_priv, + + for (sysclk_df = sysclk_dfmin; sysclk_df <= sysclk_dfmax; sysclk_df++) { + for (txclk_df = 1; txclk_df <= 128; txclk_df++) { +- rate_ideal = rate[index] * txclk_df * 64; +- if (round) +- rate_actual = clk_round_rate(clk, rate_ideal); +- else +- rate_actual = clk_get_rate(clk); ++ rate_actual = clk_get_rate(clk); + + arate = rate_actual / 64; + arate /= txclk_df * sysclk_df; +-- +2.7.1 + + +From ce39d57690b3b21d2482154978f0cc9cb3d1da67 Mon Sep 17 00:00:00 2001 +From: Shengjiu Wang +Date: Wed, 17 Sep 2014 16:42:51 +0800 +Subject: [PATCH 379/384] MLK-11429-5: ASoC: fsl_spdif: add spba clk support + +Upstream-commit: d07b635d185b670f3fa03701c922c60f31605eab + +cherry-pick below patch from imx_3.14.y +ENGR00331799-6: ASoC: fsl_spdif: add spba clk support + +spdif need to enable the spba clock, when sdma is using share peripheral +script. If don't enable it, may cause the read/write wrong data from/to +registers. + +Signed-off-by: Shengjiu Wang +(cherry picked from commit 5243b31572ef6be5b0bef9d3db0028d97fb19242) +--- + sound/soc/fsl/fsl_spdif.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c +index 023c1b9..c733a74 100644 +--- a/sound/soc/fsl/fsl_spdif.c ++++ b/sound/soc/fsl/fsl_spdif.c +@@ -106,6 +106,7 @@ struct fsl_spdif_priv { + struct clk *rxclk; + struct clk *coreclk; + struct clk *sysclk; ++ struct clk *dmaclk; + struct snd_dmaengine_dai_dma_data dma_params_tx; + struct snd_dmaengine_dai_dma_data dma_params_rx; + /* regcache for SRPC */ +@@ -460,6 +461,12 @@ static int fsl_spdif_startup(struct snd_pcm_substream *substream, + return ret; + } + ++ ret = clk_prepare_enable(spdif_priv->dmaclk); ++ if (ret) { ++ dev_err(&pdev->dev, "failed to enable dma clock\n"); ++ return ret; ++ } ++ + ret = spdif_softreset(spdif_priv); + if (ret) { + dev_err(&pdev->dev, "failed to soft reset\n"); +@@ -534,6 +541,7 @@ static void fsl_spdif_shutdown(struct snd_pcm_substream *substream, + spdif_intr_status_clear(spdif_priv); + regmap_update_bits(regmap, REG_SPDIF_SCR, + SCR_LOW_POWER, SCR_LOW_POWER); ++ clk_disable_unprepare(spdif_priv->dmaclk); + clk_disable_unprepare(spdif_priv->coreclk); + } + } +@@ -1244,6 +1252,13 @@ static int fsl_spdif_probe(struct platform_device *pdev) + return PTR_ERR(spdif_priv->coreclk); + } + ++ /* Get dma clock for dma script operation */ ++ spdif_priv->dmaclk = devm_clk_get(&pdev->dev, "dma"); ++ if (IS_ERR(spdif_priv->dmaclk)) { ++ dev_err(&pdev->dev, "no dma clock in devicetree\n"); ++ return PTR_ERR(spdif_priv->dmaclk); ++ } ++ + /* Select clock source for rx/tx clock */ + spdif_priv->rxclk = devm_clk_get(&pdev->dev, "rxtx1"); + if (IS_ERR(spdif_priv->rxclk)) { +-- +2.7.1 + + +From 8b3880f65d0c9d04c994f254bb524b2bfc921c3e Mon Sep 17 00:00:00 2001 +From: Shengjiu Wang +Date: Tue, 3 Sep 2013 18:01:52 +0800 +Subject: [PATCH 380/384] MLK-11429-7: ASoC: fsl_spdif: add pm runtime for + spdif + +Upstream-commit: adef01473b52add70a64d78275ecc0867afd88b7 + +cherry-pick below patch from imx_3.14.y +ENGR00331799-8: ASoC: fsl_spdif: add pm runtime for spdif + +Add pm runtime for spdif. + +Signed-off-by: Shengjiu Wang +(cherry picked from commit 91136d03edf45355b6b0075a486f78f573c97c52) +--- + sound/soc/fsl/fsl_spdif.c | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c +index c733a74..511d45f 100644 +--- a/sound/soc/fsl/fsl_spdif.c ++++ b/sound/soc/fsl/fsl_spdif.c +@@ -20,6 +20,8 @@ + #include + #include + #include ++#include ++#include + + #include + #include +@@ -453,6 +455,8 @@ static int fsl_spdif_startup(struct snd_pcm_substream *substream, + int i; + int ret; + ++ pm_runtime_get_sync(cpu_dai->dev); ++ + /* Reset module and interrupts only for first initialization */ + if (!cpu_dai->active) { + ret = clk_prepare_enable(spdif_priv->coreclk); +@@ -544,6 +548,8 @@ static void fsl_spdif_shutdown(struct snd_pcm_substream *substream, + clk_disable_unprepare(spdif_priv->dmaclk); + clk_disable_unprepare(spdif_priv->coreclk); + } ++ ++ pm_runtime_put_sync(cpu_dai->dev); + } + + static int fsl_spdif_hw_params(struct snd_pcm_substream *substream, +@@ -1292,6 +1298,8 @@ static int fsl_spdif_probe(struct platform_device *pdev) + spdif_priv->dma_params_tx.addr = res->start + REG_SPDIF_STL; + spdif_priv->dma_params_rx.addr = res->start + REG_SPDIF_SRL; + ++ pm_runtime_enable(&pdev->dev); ++ + /* Register with ASoC */ + dev_set_drvdata(&pdev->dev, spdif_priv); + +@@ -1340,8 +1348,27 @@ static int fsl_spdif_resume(struct device *dev) + } + #endif /* CONFIG_PM_SLEEP */ + ++#ifdef CONFIG_PM ++static int fsl_spdif_runtime_resume(struct device *dev) ++{ ++ request_bus_freq(BUS_FREQ_HIGH); ++ return 0; ++} ++ ++static int fsl_spdif_runtime_suspend(struct device *dev) ++{ ++ release_bus_freq(BUS_FREQ_HIGH); ++ return 0; ++} ++#endif ++ + static const struct dev_pm_ops fsl_spdif_pm = { + SET_SYSTEM_SLEEP_PM_OPS(fsl_spdif_suspend, fsl_spdif_resume) ++#ifdef CONFIG_PM ++ SET_RUNTIME_PM_OPS(fsl_spdif_runtime_suspend, ++ fsl_spdif_runtime_resume, ++ NULL) ++#endif + }; + + static const struct of_device_id fsl_spdif_dt_ids[] = { +-- +2.7.1 + + +From aad2efdcfcbf1d5efa2ae33216a1b1987dda77db Mon Sep 17 00:00:00 2001 +From: Shengjiu Wang +Date: Tue, 19 May 2015 13:34:32 +0800 +Subject: [PATCH 381/384] MLK-10903-1: ASoC: fsl_spdif: remove cache only in + suspend/resume + +Upstream-commit: 62f1fe74937e946b817ad35a179f0e145caef72b + +In imx6qp, there is no mega fast. After suspend, but before resume, +there will be spdif interrupt, if set cache only in suspend, then we +can't clear the interrupt, because regmap_write only write to cache. +So the system will hang for the interrupt can't be cleared. + +Signed-off-by: Shengjiu Wang +(cherry picked from commit 2a6a522c86d6c0fe80023c4327ca7ce4792035c8) +--- + sound/soc/fsl/fsl_spdif.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c +index 511d45f..bbfad81 100644 +--- a/sound/soc/fsl/fsl_spdif.c ++++ b/sound/soc/fsl/fsl_spdif.c +@@ -1328,7 +1328,6 @@ static int fsl_spdif_suspend(struct device *dev) + regmap_read(spdif_priv->regmap, REG_SPDIF_SRPC, + &spdif_priv->regcache_srpc); + +- regcache_cache_only(spdif_priv->regmap, true); + regcache_mark_dirty(spdif_priv->regmap); + + return 0; +@@ -1338,8 +1337,6 @@ static int fsl_spdif_resume(struct device *dev) + { + struct fsl_spdif_priv *spdif_priv = dev_get_drvdata(dev); + +- regcache_cache_only(spdif_priv->regmap, false); +- + regmap_update_bits(spdif_priv->regmap, REG_SPDIF_SRPC, + SRPC_CLKSRC_SEL_MASK | SRPC_GAINSEL_MASK, + spdif_priv->regcache_srpc); +-- +2.7.1 + + +From 176274c1e017a3f2ac92816dd2ff39265641f1b6 Mon Sep 17 00:00:00 2001 +From: Zidan Wang +Date: Mon, 26 Oct 2015 15:19:04 +0800 +Subject: [PATCH 382/384] ASoC: fsl_spdif: STL and STR registers are non + volatile + +Upstream-commit: c04bad594131633f0f29cdd96230adb0b90e88dc + +STL and STR registers are writable and not readable. So they are non volatile. +Remove them from volatile list, and add default register value for them. + +Signed-off-by: Zidan Wang +Acked-by: Nicolin Chen +Signed-off-by: Mark Brown +(cherry picked from commit 2a0035113a0f16305476083fc6bacdd0e29b1e5f) +--- + sound/soc/fsl/fsl_spdif.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c +index bbfad81..c2fc952 100644 +--- a/sound/soc/fsl/fsl_spdif.c ++++ b/sound/soc/fsl/fsl_spdif.c +@@ -1006,12 +1006,14 @@ static const struct snd_soc_component_driver fsl_spdif_component = { + + /* FSL SPDIF REGMAP */ + static const struct reg_default fsl_spdif_reg_defaults[] = { +- {0x0, 0x00000400}, +- {0x4, 0x00000000}, +- {0xc, 0x00000000}, +- {0x34, 0x00000000}, +- {0x38, 0x00000000}, +- {0x50, 0x00020f00}, ++ {REG_SPDIF_SCR, 0x00000400}, ++ {REG_SPDIF_SRCD, 0x00000000}, ++ {REG_SPDIF_SIE, 0x00000000}, ++ {REG_SPDIF_STL, 0x00000000}, ++ {REG_SPDIF_STR, 0x00000000}, ++ {REG_SPDIF_STCSCH, 0x00000000}, ++ {REG_SPDIF_STCSCL, 0x00000000}, ++ {REG_SPDIF_STC, 0x00020f00}, + }; + + static bool fsl_spdif_readable_reg(struct device *dev, unsigned int reg) +@@ -1049,8 +1051,6 @@ static bool fsl_spdif_volatile_reg(struct device *dev, unsigned int reg) + case REG_SPDIF_SRCSL: + case REG_SPDIF_SRU: + case REG_SPDIF_SRQ: +- case REG_SPDIF_STL: +- case REG_SPDIF_STR: + case REG_SPDIF_SRFM: + return true; + default: +-- +2.7.1 + + +From d99d750d6ce1019514dc5286968a56b579b6623f Mon Sep 17 00:00:00 2001 +From: Matus Kral +Date: Tue, 26 Apr 2016 14:15:44 +0200 +Subject: [PATCH 383/384] spdif: add DMA clk to DT + +--- + arch/arm/boot/dts/imx6qdl.dtsi | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi +index 5e2c93e..59d9113 100644 +--- a/arch/arm/boot/dts/imx6qdl.dtsi ++++ b/arch/arm/boot/dts/imx6qdl.dtsi +@@ -242,12 +242,12 @@ + <&clks IMX6QDL_CLK_SPDIF>, <&clks IMX6QDL_CLK_DUMMY>, + <&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_DUMMY>, + <&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_DUMMY>, +- <&clks IMX6QDL_CLK_DUMMY>; ++ <&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_SPBA>; + clock-names = "core", "rxtx0", + "rxtx1", "rxtx2", + "rxtx3", "rxtx4", + "rxtx5", "rxtx6", +- "rxtx7"; ++ "rxtx7", "dma"; + status = "disabled"; + }; + +-- +2.7.1 + + +From aec0ddc28dc1ee49377c9c5f7e9610d5694a0f96 Mon Sep 17 00:00:00 2001 +From: Peter Vicman +Date: Tue, 26 Apr 2016 16:15:57 +0200 +Subject: [PATCH 384/384] DT: lvds support for udoo, fix for tbs2910 + +--- + arch/arm/boot/dts/Makefile | 4 ++ + arch/arm/boot/dts/imx6dl-udoo-15lvds.dts | 63 ++++++++++++++++++++++++++++++ + arch/arm/boot/dts/imx6dl-udoo-7lvds.dts | 58 +++++++++++++++++++++++++++ + arch/arm/boot/dts/imx6q-tbs2910.dts | 2 +- + arch/arm/boot/dts/imx6q-udoo-15lvds.dts | 67 ++++++++++++++++++++++++++++++++ + arch/arm/boot/dts/imx6q-udoo-7lvds.dts | 62 +++++++++++++++++++++++++++++ + arch/arm/boot/dts/imx6qdl-udoo.dtsi | 6 +-- + 7 files changed, 258 insertions(+), 4 deletions(-) + create mode 100644 arch/arm/boot/dts/imx6dl-udoo-15lvds.dts + create mode 100644 arch/arm/boot/dts/imx6dl-udoo-7lvds.dts + create mode 100644 arch/arm/boot/dts/imx6q-udoo-15lvds.dts + create mode 100644 arch/arm/boot/dts/imx6q-udoo-7lvds.dts + +diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +index d240cee..e20073a 100644 +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -308,6 +308,8 @@ dtb-$(CONFIG_SOC_IMX6Q) += \ + imx6dl-tx6u-801x.dtb \ + imx6dl-tx6u-811x.dtb \ + imx6dl-udoo.dtb \ ++ imx6dl-udoo-7lvds.dtb \ ++ imx6dl-udoo-15lvds.dtb \ + imx6dl-sbc-fx6.dtb \ + imx6dl-sbc-fx6m.dtb \ + imx6dl-wandboard.dtb \ +@@ -351,6 +353,8 @@ dtb-$(CONFIG_SOC_IMX6Q) += \ + imx6q-tx6q-1020-comtft.dtb \ + imx6q-tx6q-1110.dtb \ + imx6q-udoo.dtb \ ++ imx6q-udoo-7lvds.dtb \ ++ imx6q-udoo-15lvds.dtb \ + imx6q-wandboard.dtb \ + imx6q-wandboard-revb1.dtb \ + imx6dl-vero.dtb +diff --git a/arch/arm/boot/dts/imx6dl-udoo-15lvds.dts b/arch/arm/boot/dts/imx6dl-udoo-15lvds.dts +new file mode 100644 +index 0000000..3b2c7ce +--- /dev/null ++++ b/arch/arm/boot/dts/imx6dl-udoo-15lvds.dts +@@ -0,0 +1,63 @@ ++/* ++ * Copyright 2013 Freescale Semiconductor, Inc. ++ * ++ * Author: Fabio Estevam ++ * Author: Ettore Chimenti ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++/dts-v1/; ++#include "imx6dl.dtsi" ++#include "imx6qdl-udoo.dtsi" ++ ++/ { ++ model = "Udoo i.MX6 Dual-lite Board"; ++ compatible = "udoo,imx6dl-udoo", "fsl,imx6dl"; ++ ++ mxcfb2: fb@1 { ++ compatible = "fsl,mxc_sdc_fb"; ++ disp_dev = "ldb"; ++ interface_pix_fmt = "RGB24"; ++ mode_str = "1360x768M@60"; ++ default_bpp = <32>; ++ int_clk = <0>; ++ late_init = <1>; ++ status = "okay"; ++ }; ++ ++ regulators { ++ reg_lcd0_pwr: regulator@1 { ++ status = "okay"; ++ }; ++ ++ reg_lcd0_backlight: regulator@2 { ++ status = "okay"; ++ }; ++ }; ++}; ++ ++&dcic1 { ++ status = "disabled"; ++}; ++ ++&dcic2 { ++ dcic_id = <0>; ++ status = "okay"; ++}; ++ ++&ldb { ++ status = "okay"; ++ ++ lvds-channel@0 { ++ status = "okay"; ++ fsl,data-width = <24>; ++ ++ display-timings { ++ native-mode = <&timing2>; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/imx6dl-udoo-7lvds.dts b/arch/arm/boot/dts/imx6dl-udoo-7lvds.dts +new file mode 100644 +index 0000000..65114b7 +--- /dev/null ++++ b/arch/arm/boot/dts/imx6dl-udoo-7lvds.dts +@@ -0,0 +1,58 @@ ++/* ++ * Copyright 2013 Freescale Semiconductor, Inc. ++ * ++ * Author: Fabio Estevam ++ * Author: Ettore Chimenti ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++/dts-v1/; ++#include "imx6dl.dtsi" ++#include "imx6qdl-udoo.dtsi" ++ ++/ { ++ model = "Udoo i.MX6 Dual-lite Board"; ++ compatible = "udoo,imx6dl-udoo", "fsl,imx6dl"; ++ ++ mxcfb2: fb@1 { ++ compatible = "fsl,mxc_sdc_fb"; ++ disp_dev = "ldb"; ++ interface_pix_fmt = "RGB666"; ++ mode_str = "800x480M@60"; ++ default_bpp = <32>; ++ int_clk = <0>; ++ late_init = <0>; ++ status = "okay"; ++ }; ++ ++ regulators { ++ reg_lcd0_pwr: regulator@1 { ++ status = "okay"; ++ }; ++ ++ reg_lcd0_backlight: regulator@2 { ++ status = "okay"; ++ }; ++ }; ++}; ++ ++&dcic1 { ++ status = "disabled"; ++}; ++ ++&dcic2 { ++ dcic_id = <0>; ++ status = "okay"; ++}; ++ ++&ldb { ++ status = "okay"; ++ ++ lvds-channel@0 { ++ status = "okay"; ++ }; ++}; +diff --git a/arch/arm/boot/dts/imx6q-tbs2910.dts b/arch/arm/boot/dts/imx6q-tbs2910.dts +index 5645d52..a910249 100644 +--- a/arch/arm/boot/dts/imx6q-tbs2910.dts ++++ b/arch/arm/boot/dts/imx6q-tbs2910.dts +@@ -154,7 +154,7 @@ + status = "okay"; + }; + +-&hdmi { ++&hdmi_core { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_hdmi>; + ddc-i2c-bus = <&i2c2>; +diff --git a/arch/arm/boot/dts/imx6q-udoo-15lvds.dts b/arch/arm/boot/dts/imx6q-udoo-15lvds.dts +new file mode 100644 +index 0000000..182c696 +--- /dev/null ++++ b/arch/arm/boot/dts/imx6q-udoo-15lvds.dts +@@ -0,0 +1,67 @@ ++/* ++ * Copyright 2013 Freescale Semiconductor, Inc. ++ * ++ * Author: Fabio Estevam ++ * Author: Ettore Chimenti ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++/dts-v1/; ++#include "imx6q.dtsi" ++#include "imx6qdl-udoo.dtsi" ++ ++/ { ++ model = "Udoo i.MX6 Quad Board"; ++ compatible = "udoo,imx6q-udoo", "fsl,imx6q"; ++ ++ mxcfb2: fb@1 { ++ compatible = "fsl,mxc_sdc_fb"; ++ disp_dev = "ldb"; ++ interface_pix_fmt = "RGB24"; ++ mode_str = "1360x768M@60"; ++ default_bpp = <32>; ++ int_clk = <0>; ++ late_init = <1>; ++ status = "okay"; ++ }; ++ ++ regulators { ++ reg_lcd0_pwr: regulator@1 { ++ status = "okay"; ++ }; ++ ++ reg_lcd0_backlight: regulator@2 { ++ status = "okay"; ++ }; ++ }; ++}; ++ ++&sata { ++ status = "okay"; ++}; ++ ++&dcic1 { ++ status = "disabled"; ++}; ++ ++&dcic2 { ++ dcic_id = <0>; ++ status = "okay"; ++}; ++ ++&ldb { ++ status = "okay"; ++ ++ lvds-channel@0 { ++ status = "okay"; ++ fsl,data-width = <24>; ++ ++ display-timings { ++ native-mode = <&timing2>; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/imx6q-udoo-7lvds.dts b/arch/arm/boot/dts/imx6q-udoo-7lvds.dts +new file mode 100644 +index 0000000..5ba2ff2 +--- /dev/null ++++ b/arch/arm/boot/dts/imx6q-udoo-7lvds.dts +@@ -0,0 +1,62 @@ ++/* ++ * Copyright 2013 Freescale Semiconductor, Inc. ++ * ++ * Author: Fabio Estevam ++ * Author: Ettore Chimenti ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++/dts-v1/; ++#include "imx6q.dtsi" ++#include "imx6qdl-udoo.dtsi" ++ ++/ { ++ model = "Udoo i.MX6 Quad Board"; ++ compatible = "udoo,imx6q-udoo", "fsl,imx6q"; ++ ++ mxcfb2: fb@1 { ++ compatible = "fsl,mxc_sdc_fb"; ++ disp_dev = "ldb"; ++ interface_pix_fmt = "RGB666"; ++ mode_str = "800x480M@60"; ++ default_bpp = <32>; ++ int_clk = <0>; ++ late_init = <0>; ++ status = "okay"; ++ }; ++ ++ regulators { ++ reg_lcd0_pwr: regulator@1 { ++ status = "okay"; ++ }; ++ ++ reg_lcd0_backlight: regulator@2 { ++ status = "okay"; ++ }; ++ }; ++}; ++ ++&sata { ++ status = "okay"; ++}; ++ ++&dcic1 { ++ status = "disabled"; ++}; ++ ++&dcic2 { ++ dcic_id = <0>; ++ status = "okay"; ++}; ++ ++&ldb { ++ status = "okay"; ++ ++ lvds-channel@0 { ++ status = "okay"; ++ }; ++}; +diff --git a/arch/arm/boot/dts/imx6qdl-udoo.dtsi b/arch/arm/boot/dts/imx6qdl-udoo.dtsi +index 7c64e72..4c201c6a 100755 +--- a/arch/arm/boot/dts/imx6qdl-udoo.dtsi ++++ b/arch/arm/boot/dts/imx6qdl-udoo.dtsi +@@ -202,7 +202,7 @@ + &dcic2 { + dcic_id = <1>; + dcic_mux = "dcic-lvds1"; +- status = "okay"; ++ status = "disabled"; + }; + + &gpc { // General power controller +@@ -254,9 +254,9 @@ + vsync-len = <2>; + }; + +- timing2: 1366x768 { // 15.6" display ++ timing2: 1360x768 { // 15.6" display + clock-frequency = <76000000>; +- hactive = <1366>; ++ hactive = <1360>; // IPU needs x and y modulo 8 + vactive = <768>; + hback-porch = <220>; + hfront-porch = <40>; +-- +2.7.1 + + diff --git a/projects/imx6/patches/linux/4.4-xbian/linux-320-udoo-lvds-support.patch b/projects/imx6/patches/linux/4.4-xbian/linux-320-udoo-lvds-support.patch deleted file mode 100644 index 45a328b84f..0000000000 --- a/projects/imx6/patches/linux/4.4-xbian/linux-320-udoo-lvds-support.patch +++ /dev/null @@ -1,268 +0,0 @@ -device tree for udoo LVDS display - -diff -aurN a/arch/arm/boot/dts/imx6dl-udoo-15lvds.dts b/arch/arm/boot/dts/imx6dl-udoo-15lvds.dts ---- a/arch/arm/boot/dts/imx6dl-udoo-15lvds.dts 1970-01-01 01:00:00.000000000 +0100 -+++ b/arch/arm/boot/dts/imx6dl-udoo-15lvds.dts 2016-02-02 15:33:57.956493214 +0100 -@@ -0,0 +1,54 @@ -+/* -+ * Copyright 2013 Freescale Semiconductor, Inc. -+ * -+ * Author: Fabio Estevam -+ * Author: Ettore Chimenti -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+/dts-v1/; -+#include "imx6dl.dtsi" -+#include "imx6qdl-udoo.dtsi" -+ -+/ { -+ model = "Udoo i.MX6 Dual-lite Board"; -+ compatible = "udoo,imx6dl-udoo", "fsl,imx6dl"; -+ -+ mxcfb2: fb@1 { -+ compatible = "fsl,mxc_sdc_fb"; -+ disp_dev = "ldb"; -+ interface_pix_fmt = "RGB24"; -+ mode_str = "1360x768M@60"; -+ default_bpp = <32>; -+ int_clk = <0>; -+ late_init = <1>; -+ status = "okay"; -+ }; -+ -+ regulators { -+ reg_lcd0_pwr: regulator@1 { -+ status = "okay"; -+ }; -+ -+ reg_lcd0_backlight: regulator@2 { -+ status = "okay"; -+ }; -+ }; -+}; -+ -+&ldb { -+ status = "okay"; -+ -+ lvds-channel@0 { -+ status = "okay"; -+ fsl,data-width = <24>; -+ -+ display-timings { -+ native-mode = <&timing2>; -+ }; -+ }; -+}; -diff -aurN a/arch/arm/boot/dts/imx6dl-udoo-7lvds.dts b/arch/arm/boot/dts/imx6dl-udoo-7lvds.dts ---- a/arch/arm/boot/dts/imx6dl-udoo-7lvds.dts 1970-01-01 01:00:00.000000000 +0100 -+++ b/arch/arm/boot/dts/imx6dl-udoo-7lvds.dts 2016-02-02 15:33:57.956493214 +0100 -@@ -0,0 +1,49 @@ -+/* -+ * Copyright 2013 Freescale Semiconductor, Inc. -+ * -+ * Author: Fabio Estevam -+ * Author: Ettore Chimenti -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+/dts-v1/; -+#include "imx6dl.dtsi" -+#include "imx6qdl-udoo.dtsi" -+ -+/ { -+ model = "Udoo i.MX6 Dual-lite Board"; -+ compatible = "udoo,imx6dl-udoo", "fsl,imx6dl"; -+ -+ mxcfb2: fb@1 { -+ compatible = "fsl,mxc_sdc_fb"; -+ disp_dev = "ldb"; -+ interface_pix_fmt = "RGB666"; -+ mode_str = "800x480M@60"; -+ default_bpp = <32>; -+ int_clk = <0>; -+ late_init = <0>; -+ status = "okay"; -+ }; -+ -+ regulators { -+ reg_lcd0_pwr: regulator@1 { -+ status = "okay"; -+ }; -+ -+ reg_lcd0_backlight: regulator@2 { -+ status = "okay"; -+ }; -+ }; -+}; -+ -+&ldb { -+ status = "okay"; -+ -+ lvds-channel@0 { -+ status = "okay"; -+ }; -+}; -diff -aurN a/arch/arm/boot/dts/imx6qdl-udoo.dtsi b/arch/arm/boot/dts/imx6qdl-udoo.dtsi ---- a/arch/arm/boot/dts/imx6qdl-udoo.dtsi 2016-02-02 15:32:24.208082208 +0100 -+++ b/arch/arm/boot/dts/imx6qdl-udoo.dtsi 2016-02-02 15:35:33.695723590 +0100 -@@ -254,9 +254,9 @@ - vsync-len = <2>; - }; - -- timing2: 1366x768 { // 15.6" display -+ timing2: 1360x768 { // 15.6" display - clock-frequency = <76000000>; -- hactive = <1366>; -+ hactive = <1360>; // IPU needs x and y modulo 8 - vactive = <768>; - hback-porch = <220>; - hfront-porch = <40>; -diff -aurN a/arch/arm/boot/dts/imx6q-udoo-15lvds.dts b/arch/arm/boot/dts/imx6q-udoo-15lvds.dts ---- a/arch/arm/boot/dts/imx6q-udoo-15lvds.dts 1970-01-01 01:00:00.000000000 +0100 -+++ b/arch/arm/boot/dts/imx6q-udoo-15lvds.dts 2016-02-02 15:33:57.956493214 +0100 -@@ -0,0 +1,58 @@ -+/* -+ * Copyright 2013 Freescale Semiconductor, Inc. -+ * -+ * Author: Fabio Estevam -+ * Author: Ettore Chimenti -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+/dts-v1/; -+#include "imx6q.dtsi" -+#include "imx6qdl-udoo.dtsi" -+ -+/ { -+ model = "Udoo i.MX6 Quad Board"; -+ compatible = "udoo,imx6q-udoo", "fsl,imx6q"; -+ -+ mxcfb2: fb@1 { -+ compatible = "fsl,mxc_sdc_fb"; -+ disp_dev = "ldb"; -+ interface_pix_fmt = "RGB24"; -+ mode_str = "1360x768M@60"; -+ default_bpp = <32>; -+ int_clk = <0>; -+ late_init = <1>; -+ status = "okay"; -+ }; -+ -+ regulators { -+ reg_lcd0_pwr: regulator@1 { -+ status = "okay"; -+ }; -+ -+ reg_lcd0_backlight: regulator@2 { -+ status = "okay"; -+ }; -+ }; -+}; -+ -+&sata { -+ status = "okay"; -+}; -+ -+&ldb { -+ status = "okay"; -+ -+ lvds-channel@0 { -+ status = "okay"; -+ fsl,data-width = <24>; -+ -+ display-timings { -+ native-mode = <&timing2>; -+ }; -+ }; -+}; -diff -aurN a/arch/arm/boot/dts/imx6q-udoo-7lvds.dts b/arch/arm/boot/dts/imx6q-udoo-7lvds.dts ---- a/arch/arm/boot/dts/imx6q-udoo-7lvds.dts 1970-01-01 01:00:00.000000000 +0100 -+++ b/arch/arm/boot/dts/imx6q-udoo-7lvds.dts 2016-02-02 15:33:57.956493214 +0100 -@@ -0,0 +1,53 @@ -+/* -+ * Copyright 2013 Freescale Semiconductor, Inc. -+ * -+ * Author: Fabio Estevam -+ * Author: Ettore Chimenti -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ */ -+ -+/dts-v1/; -+#include "imx6q.dtsi" -+#include "imx6qdl-udoo.dtsi" -+ -+/ { -+ model = "Udoo i.MX6 Quad Board"; -+ compatible = "udoo,imx6q-udoo", "fsl,imx6q"; -+ -+ mxcfb2: fb@1 { -+ compatible = "fsl,mxc_sdc_fb"; -+ disp_dev = "ldb"; -+ interface_pix_fmt = "RGB666"; -+ mode_str = "800x480M@60"; -+ default_bpp = <32>; -+ int_clk = <0>; -+ late_init = <0>; -+ status = "okay"; -+ }; -+ -+ regulators { -+ reg_lcd0_pwr: regulator@1 { -+ status = "okay"; -+ }; -+ -+ reg_lcd0_backlight: regulator@2 { -+ status = "okay"; -+ }; -+ }; -+}; -+ -+&sata { -+ status = "okay"; -+}; -+ -+&ldb { -+ status = "okay"; -+ -+ lvds-channel@0 { -+ status = "okay"; -+ }; -+}; -diff -aurN a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile ---- a/arch/arm/boot/dts/Makefile 2016-02-02 15:33:47.144907214 +0100 -+++ b/arch/arm/boot/dts/Makefile 2016-02-02 15:33:57.956493214 +0100 -@@ -308,6 +308,8 @@ - imx6dl-tx6u-801x.dtb \ - imx6dl-tx6u-811x.dtb \ - imx6dl-udoo.dtb \ -+ imx6dl-udoo-7lvds.dtb \ -+ imx6dl-udoo-15lvds.dtb \ - imx6dl-sbc-fx6.dtb \ - imx6dl-sbc-fx6m.dtb \ - imx6dl-wandboard.dtb \ -@@ -351,6 +353,8 @@ - imx6q-tx6q-1020-comtft.dtb \ - imx6q-tx6q-1110.dtb \ - imx6q-udoo.dtb \ -+ imx6q-udoo-7lvds.dtb \ -+ imx6q-udoo-15lvds.dtb \ - imx6q-wandboard.dtb \ - imx6q-wandboard-revb1.dtb \ - imx6dl-vero.dtb diff --git a/projects/imx6/patches/linux/4.4-xbian/linux-330-tbs2910-dts-fix.patch b/projects/imx6/patches/linux/4.4-xbian/linux-330-tbs2910-dts-fix.patch deleted file mode 100644 index 2db33fd839..0000000000 --- a/projects/imx6/patches/linux/4.4-xbian/linux-330-tbs2910-dts-fix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/arch/arm/boot/dts/imx6q-tbs2910.dts 2016-02-05 10:04:37.142403520 +0100 -+++ b/arch/arm/boot/dts/imx6q-tbs2910.dts 2016-02-05 10:04:45.102099522 +0100 -@@ -154,7 +154,7 @@ - status = "okay"; - }; - --&hdmi { -+&hdmi_core { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_hdmi>; - ddc-i2c-bus = <&i2c2>;