All of lore.kernel.org
 help / color / mirror / Atom feed
* Linux 4.9.6
@ 2017-01-26  7:48 Greg KH
  2017-01-26  7:48 ` Greg KH
  2017-02-06 17:30 ` Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box ) Gabriel C
  0 siblings, 2 replies; 52+ messages in thread
From: Greg KH @ 2017-01-26  7:48 UTC (permalink / raw)
  To: linux-kernel, Andrew Morton, torvalds, stable; +Cc: lwn, Jiri Slaby

[-- Attachment #1: Type: text/plain, Size: 19942 bytes --]

I'm announcing the release of the 4.9.6 kernel.

All users of the 4.9 kernel series must upgrade.

The updated 4.9.y git tree can be found at:
	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.9.y
and can be browsed at the normal kernel.org git web browser:
	http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary

thanks,

greg k-h

------------

 Documentation/devicetree/bindings/clock/imx31-clock.txt       |    2 
 Documentation/kernel-parameters.txt                           |    3 
 Makefile                                                      |    2 
 arch/arc/Kconfig                                              |    2 
 arch/arc/include/asm/module.h                                 |    4 
 arch/arc/kernel/module.c                                      |    4 
 arch/arm/boot/dts/Makefile                                    |    1 
 arch/arm/boot/dts/am33xx.dtsi                                 |    1 
 arch/arm/boot/dts/am4372.dtsi                                 |    1 
 arch/arm/boot/dts/bcm283x.dtsi                                |    2 
 arch/arm/boot/dts/da850-evm.dts                               |    1 
 arch/arm/boot/dts/dm814x.dtsi                                 |    1 
 arch/arm/boot/dts/dm816x.dtsi                                 |    1 
 arch/arm/boot/dts/dra7.dtsi                                   |    2 
 arch/arm/boot/dts/imx31.dtsi                                  |   18 
 arch/arm/boot/dts/imx6q-cm-fx6.dts                            |    1 
 arch/arm/boot/dts/imx6qdl-nitrogen6_max.dtsi                  |    4 
 arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts              |   11 
 arch/arm/boot/dts/omap2.dtsi                                  |    1 
 arch/arm/boot/dts/omap3.dtsi                                  |    1 
 arch/arm/boot/dts/omap4.dtsi                                  |    1 
 arch/arm/boot/dts/omap5.dtsi                                  |    2 
 arch/arm/boot/dts/r8a7794.dtsi                                |    7 
 arch/arm/include/asm/cputype.h                                |    3 
 arch/arm/kernel/hw_breakpoint.c                               |   16 
 arch/arm/kernel/smp_tlb.c                                     |    7 
 arch/arm/mach-ux500/pm.c                                      |    4 
 arch/arm64/include/asm/memory.h                               |    2 
 arch/arm64/include/uapi/asm/ptrace.h                          |    1 
 arch/arm64/kernel/entry.S                                     |    2 
 arch/arm64/kernel/ptrace.c                                    |   16 
 arch/arm64/kernel/traps.c                                     |   28 
 arch/arm64/mm/dma-mapping.c                                   |    3 
 arch/arm64/mm/init.c                                          |    5 
 arch/powerpc/include/asm/ppc-opcode.h                         |   10 
 arch/powerpc/kernel/ptrace.c                                  |   14 
 arch/powerpc/perf/power9-events-list.h                        |    2 
 arch/powerpc/sysdev/xics/icp-opal.c                           |   31 
 arch/s390/kvm/kvm-s390.c                                      |    4 
 arch/x86/kernel/apic/io_apic.c                                |    2 
 arch/x86/kernel/pci-swiotlb.c                                 |    2 
 arch/x86/pci/acpi.c                                           |   10 
 arch/x86/xen/pci-swiotlb-xen.c                                |    2 
 drivers/clocksource/exynos_mct.c                              |    1 
 drivers/devfreq/devfreq.c                                     |   15 
 drivers/devfreq/exynos-bus.c                                  |    2 
 drivers/dma/pl330.c                                           |   11 
 drivers/dma/sh/rcar-dmac.c                                    |    8 
 drivers/hid/hid-corsair.c                                     |   60 -
 drivers/infiniband/core/cache.c                               |   16 
 drivers/infiniband/hw/mlx4/ah.c                               |    6 
 drivers/infiniband/hw/mlx4/mad.c                              |   16 
 drivers/infiniband/hw/mlx4/main.c                             |   29 
 drivers/infiniband/hw/mlx4/qp.c                               |    7 
 drivers/infiniband/hw/mlx5/main.c                             |    8 
 drivers/infiniband/hw/mlx5/mr.c                               |   31 
 drivers/infiniband/hw/mlx5/qp.c                               |   29 
 drivers/infiniband/hw/mlx5/srq.c                              |    2 
 drivers/infiniband/sw/rxe/rxe_param.h                         |    2 
 drivers/infiniband/sw/rxe/rxe_req.c                           |   14 
 drivers/infiniband/ulp/ipoib/ipoib_cm.c                       |    2 
 drivers/input/mouse/alps.c                                    |   19 
 drivers/media/platform/Kconfig                                |    2 
 drivers/media/platform/blackfin/ppi.c                         |    2 
 drivers/media/platform/s5p-mfc/s5p_mfc.c                      |    7 
 drivers/media/platform/sti/hva/hva-hw.c                       |    6 
 drivers/media/rc/ite-cir.c                                    |    2 
 drivers/media/spi/gs1662.c                                    |    3 
 drivers/mmc/host/mxs-mmc.c                                    |    6 
 drivers/mmc/host/sdhci-acpi.c                                 |    3 
 drivers/mtd/nand/Kconfig                                      |    2 
 drivers/mtd/nand/lpc32xx_mlc.c                                |    2 
 drivers/mtd/nand/xway_nand.c                                  |    5 
 drivers/mtd/spi-nor/cadence-quadspi.c                         |    6 
 drivers/net/ieee802154/atusb.c                                |   31 
 drivers/nvdimm/namespace_devs.c                               |   23 
 drivers/pci/host/pcie-designware.c                            |   10 
 drivers/pci/probe.c                                           |   12 
 drivers/rpmsg/rpmsg_core.c                                    |    4 
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c                      |    7 
 drivers/scsi/mpt3sas/mpt3sas_base.h                           |   12 
 drivers/scsi/mpt3sas/mpt3sas_scsih.c                          |   40 
 drivers/scsi/qla2xxx/qla_os.c                                 |   16 
 drivers/scsi/ses.c                                            |    2 
 drivers/soc/ti/wkup_m3_ipc.c                                  |    1 
 drivers/spi/spi-pxa2xx.c                                      |    1 
 drivers/staging/media/s5p-cec/s5p_cec.c                       |    4 
 drivers/xen/swiotlb-xen.c                                     |    4 
 fs/ceph/caps.c                                                |   17 
 fs/ceph/dir.c                                                 |    5 
 fs/ceph/inode.c                                               |    3 
 fs/ceph/mds_client.c                                          |    9 
 fs/fuse/dev.c                                                 |    3 
 fs/fuse/dir.c                                                 |    2 
 fs/posix_acl.c                                                |    9 
 fs/ubifs/tnc.c                                                |   25 
 include/dt-bindings/clock/r8a7794-clock.h                     |    3 
 include/linux/rcupdate.h                                      |    4 
 include/linux/sunrpc/svc_xprt.h                               |    1 
 include/linux/swiotlb.h                                       |    8 
 include/trace/events/swiotlb.h                                |   17 
 kernel/rcu/rcu.h                                              |    1 
 kernel/rcu/tiny.c                                             |    4 
 kernel/rcu/tiny_plugin.h                                      |    9 
 kernel/rcu/tree.c                                             |   33 
 kernel/rcu/tree_exp.h                                         |   52 -
 kernel/rcu/tree_plugin.h                                      |    2 
 kernel/rcu/update.c                                           |   38 
 lib/swiotlb.c                                                 |   26 
 net/ceph/auth_x.c                                             |  195 ++--
 net/ceph/auth_x.h                                             |    3 
 net/ceph/crypto.c                                             |  463 ++--------
 net/ceph/crypto.h                                             |   26 
 net/mac80211/rx.c                                             |   26 
 net/sunrpc/auth_gss/svcauth_gss.c                             |    2 
 net/sunrpc/svc_xprt.c                                         |   10 
 net/sunrpc/xprtrdma/frwr_ops.c                                |   13 
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c                       |    2 
 net/sunrpc/xprtrdma/verbs.c                                   |   14 
 net/sunrpc/xprtrdma/xprt_rdma.h                               |   20 
 tools/perf/Makefile.config                                    |    2 
 tools/perf/builtin-mem.c                                      |    4 
 tools/perf/builtin-trace.c                                    |    6 
 tools/perf/trace/beauty/mmap.c                                |    2 
 tools/perf/util/Build                                         |    2 
 tools/perf/util/callchain.c                                   |    2 
 tools/perf/util/callchain.h                                   |    4 
 tools/perf/util/genelf.c                                      |    9 
 tools/perf/util/genelf.h                                      |    2 
 tools/perf/util/symbol.c                                      |    3 
 tools/perf/util/trace-event-scripting.c                       |    6 
 tools/testing/selftests/powerpc/pmu/ebb/pmc56_overflow_test.c |    2 
 tools/virtio/ringtest/run-on-all.sh                           |    5 
 virt/kvm/arm/vgic/vgic-init.c                                 |   18 
 virt/kvm/arm/vgic/vgic-v2.c                                   |    2 
 virt/kvm/arm/vgic/vgic-v3.c                                   |    2 
 136 files changed, 1030 insertions(+), 814 deletions(-)

Adam Ford (2):
      ARM: dts: omap3: Add DTS for Logic PD SOM-LV 37xx Dev Kit
      ARM: dts: omap3: Fix Card Detect and Write Protect on Logic PD SOM-LV

Alexander Graf (1):
      arm64: Fix swiotlb fallback allocation

Andy Shevchenko (1):
      spi: pxa2xx: add missed break

Anton Blanchard (1):
      powerpc: Ignore reserved field in DCSR and PVR reads and writes

Arnaldo Carvalho de Melo (2):
      perf trace: Use the syscall raw_syscalls:sys_enter timestamp
      perf scripting: Avoid leaking the scripting_context variable

Arnd Bergmann (4):
      IB/rxe: avoid putting a large struct rxe_qp on stack
      ARM: ux500: fix prcmu_is_cpu_in_wfi() calculation
      platform: pxa_camera: add VIDEO_V4L2 dependency
      s5p-cec: mark PM functions as __maybe_unused again

Benjamin Herrenschmidt (1):
      powerpc/icp-opal: Fix missing KVM case and harden replay

Bjorn Helgaas (2):
      x86/PCI: Ignore _CRS on Supermicro X8DTH-i/6/iF/6F
      PCI: Enumerate switches below PCI-to-PCIe bridges

Bryant G. Ly (2):
      ibmvscsis: Fix sleeping in interrupt context
      ibmvscsis: Fix max transfer length

Chanwoo Choi (2):
      PM / devfreq: exynos-bus: Fix the wrong return value
      PM / devfreq: Fix the bug of devfreq_add_device when governor is NULL

Christian Borntraeger (1):
      KVM: s390: do not expose random data via facility bitmap

Christopher Spinrath (1):
      ARM: dts: imx6q-cm-fx6: fix fec pinctrl

Chuck Lever (2):
      xprtrdma: Make FRWR send queue entry accounting more accurate
      xprtrdma: Squelch "max send, max recv" messages at connect time

Dan Carpenter (4):
      mtd: spi-nor: Off by one in cqspi_setup_flash()
      mtd: spi-nor: Fix some error codes in cqspi_setup_flash()
      blackfin: check devm_pinctrl_get() for errors
      st-hva: fix some error handling in hva_hw_probe()

Dan Williams (1):
      libnvdimm, namespace: fix pmem namespace leak, delete when size set to zero

Dave Martin (7):
      powerpc/ptrace: Preserve previous fprs/vsrs on short regset write
      powerpc/ptrace: Preserve previous TM fprs/vsrs on short regset write
      arm64/ptrace: Preserve previous registers for short regset write
      arm64/ptrace: Preserve previous registers for short regset write - 2
      arm64/ptrace: Preserve previous registers for short regset write - 3
      arm64/ptrace: Avoid uninitialised struct padding in fpr_set()
      arm64/ptrace: Reject attempts to set incomplete hardware breakpoint fields

David Sheets (1):
      fuse: fix time_to_jiffies nsec sanity check

Eli Cohen (3):
      IB/mlx5: Avoid system crash when enabling many VFs
      IB/mlx5: Fix reported max SGE calculation
      IB/mlx5: Wait for all async command completions to complete

Eran Ben Elisha (2):
      IB/mlx4: When no DMFS for IPoIB, don't allow NET_IF QPs
      IB/mlx4: Check if GRH is available before using it

Ewan D. Milne (1):
      scsi: ses: Fix SAS device detection in enclosure

Fabien Parent (1):
      ARM: dts: da850-evm: fix read access to SPI flash

Gary Bisson (1):
      ARM: dts: imx6qdl-nitrogen6_max: fix sgtl5000 pinctrl init

Geert Uytterhoeven (3):
      ARM: dts: r8a7794: Use SYSC "always-on" PM Domain for sound
      swiotlb: Convert swiotlb_force from int to enum
      swiotlb: Add swiotlb=noforce debug option

Greg Kroah-Hartman (1):
      Linux 4.9.6

Gu Zheng (1):
      tmpfs: clear S_ISGID when setting posix ACLs

Halil Pasic (1):
      tools/virtio/ringtest: fix run-on-all.sh for offline cpus

Hans de Goede (1):
      mmc: sdhci-acpi: Only powered up enabled acpi child devices

Hauke Mehrtens (2):
      mtd: nand: xway: disable module support
      mtd: nand: xway: fix build because of module functions

Ilya Dryomov (12):
      libceph: ceph_x_encrypt_buflen() takes in_len
      libceph: old_key in process_one_ticket() is redundant
      libceph: introduce ceph_x_encrypt_offset()
      libceph: introduce ceph_crypt() for in-place en/decryption
      libceph: rename and align ceph_x_authorizer::reply_buf
      libceph: tweak calcu_signature() a little
      libceph: switch ceph_x_encrypt() to ceph_crypt()
      libceph: switch ceph_x_decrypt() to ceph_crypt()
      libceph: remove now unused ceph_*{en,de}crypt*() functions
      libceph: make sure ceph_aes_crypt() IV is aligned
      libceph: uninline ceph_crypto_key_destroy()
      libceph: stop allocating a new cipher on every crypto request

J. Bruce Fields (1):
      svcrpc: don't leak contexts on PROC_DESTROY

Jack Morgenstein (2):
      IB/mlx4: Fix out-of-range array index in destroy qp flow
      IB/mlx4: Handle well-known-gid in mad_demux processing

James Bottomley (1):
      scsi: mpt3sas: fix hang on ata passthrough commands

Javier Martinez Canillas (9):
      ARM: dts: dra7: Add an empty chosen node to top level DTSI
      ARM: dts: dm816x: Add an empty chosen node to top level DTSI
      ARM: dts: dm814x: Add an empty chosen node to top level DTSI
      ARM: dts: am33xx: Add an empty chosen node to top level DTSI
      ARM: dts: omap4: Add an empty chosen node to top level DTSI
      ARM: dts: omap5: Add an empty chosen node to top level DTSI
      ARM: dts: am4372: Add an empty chosen node to top level DTSI
      ARM: dts: omap3: Add an empty chosen node to top level DTSI
      ARM: dts: omap2: Add an empty chosen node to top level DTSI

Jean-Jacques Hiblot (1):
      ARM: dts: OMAP5 / DRA7: indicate that SATA port 0 is available.

Jeff Layton (3):
      ceph: fix bad endianness handling in parse_reply_info_extra
      ceph: fix endianness of getattr mask in ceph_d_revalidate
      ceph: fix endianness bug in frag_tree_split_cmp

Jiri Olsa (2):
      perf mem: Fix --all-user/--all-kernel options
      perf trace: Check if MAP_32BIT is defined (again)

Johan Hovold (2):
      HID: corsair: fix DMA buffers on stack
      HID: corsair: fix control-transfer error handling

Johannes Berg (1):
      mac80211: implement multicast forwarding on fast-RX path

Joonyoung Shim (1):
      clocksource/exynos_mct: Clear interrupt when cpu is shut down

Kamal Heib (1):
      IB/IPoIB: Remove can't use GFP_NOIO warning

Kan Liang (1):
      perf diff: Do not overwrite valid build id

Leon Romanovsky (1):
      IB/core: Release allocated memory in cache setup failure

Linus Walleij (1):
      ARM: 8613/1: Fix the uaccess crash on PB11MPCore

Loic Pallardy (1):
      rpmsg: virtio_rpmsg_bus: fix channel creation

Maciej Debski (1):
      perf jit: Enable jitdump support without dwarf

Madhavan Srinivasan (2):
      powerpc/perf: Fix PM_BRU_CMPL event code for power9
      selftest/powerpc: Wrong PMC initialized in pmc56_overflow test

Maor Gottlieb (2):
      IB/mlx5: Assign SRQ type earlier
      IB/mlx4: Set traffic class in AH

Marc Zyngier (1):
      KVM: arm/arm64: vgic: Fix deadlock on error handling

Marek Szyprowski (2):
      s5p-mfc: Fix clock management in s5p_mfc_release() function
      dmaengine: pl330: Fix runtime PM support for terminated transfers

Mark Rutland (2):
      ARM: 8634/1: hw_breakpoint: blacklist Scorpion CPUs
      arm64: avoid returning from bad_mode

Murali Karicheri (1):
      PCI: designware: Check for iATU unroll only on platforms that use ATU

Nicolas Iooss (1):
      ite-cir: initialize use_demodulator before using it

Niklas Söderlund (1):
      dmaengine: rcar-dmac: unmap slave resource when channel is freed

Nikolay Borisov (1):
      ceph: fix scheduler warning due to nested blocking

Oleksandr Andrushchenko (1):
      arm64: mm: avoid name clash in __page_to_voff()

Paul Donohue (1):
      Input: ALPS - fix TrackStick support for SS5 hardware

Paul E. McKenney (2):
      rcu: Remove cond_resched() from Tiny synchronize_sched()
      rcu: Narrow early boot window of illegal synchronous grace periods

Quinn Tran (1):
      qla2xxx: Fix crash due to null pointer access

Rabin Vincent (1):
      perf callchain: Fixup help/config for no-unwinding

Richard Weinberger (1):
      ubifs: Fix journal replay wrt. xattr nodes

Ruslan Ruslichenko (1):
      x86/ioapic: Restore IO-APIC irq_chip retrigger callback

Saeed Mahameed (1):
      IB/mlx4: Fix port query for 56Gb Ethernet links

Scott Mayhew (1):
      sunrpc: don't call sleeping functions from the notifier block callbacks

Sergei Shtylyov (1):
      ARM: dts: r8a7794: remove Z clock

Sriharsha Basavapatna (1):
      svcrdma: avoid duplicate dma unmapping during error recovery

Stefan Schmidt (1):
      ieee802154: atusb: do not use the stack for buffers to make them DMA able

Stefan Wahren (2):
      ARM: dts: bcm283x: fix typo in mailbox address
      mmc: mxs-mmc: Fix additional cycles after transmission stop

Tahsin Erdogan (1):
      fuse: clear FR_PENDING flag when moving requests out of pending queue

Vineet Gupta (1):
      ARC: module: Fix !CONFIG_ARC_DW2_UNWIND builds

Vladimir Zapolskiy (4):
      ARM: dts: imx31: fix clock control module interrupts description
      ARM: dts: imx31: move CCM device node to AIPS2 bus devices
      ARM: dts: imx31: fix AVIC base address
      mtd: nand: lpc32xx: fix invalid error handling of a requested irq

Wei Yongjun (2):
      gs1662: drop kfree for memory allocated with devm_kzalloc
      soc: ti: wkup_m3_ipc: Fix error return code in wkup_m3_ipc_probe()

Yan, Zheng (1):
      ceph: fix ceph_get_caps() interruption

Yonatan Cohen (1):
      IB/rxe: Increase max number of completions to 32k


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6
  2017-01-26  7:48 Linux 4.9.6 Greg KH
@ 2017-01-26  7:48 ` Greg KH
  2017-02-06 17:30 ` Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box ) Gabriel C
  1 sibling, 0 replies; 52+ messages in thread
From: Greg KH @ 2017-01-26  7:48 UTC (permalink / raw)
  To: linux-kernel, Andrew Morton, torvalds, stable; +Cc: lwn, Jiri Slaby

diff --git a/Documentation/devicetree/bindings/clock/imx31-clock.txt b/Documentation/devicetree/bindings/clock/imx31-clock.txt
index 19df842c694f..8163d565f697 100644
--- a/Documentation/devicetree/bindings/clock/imx31-clock.txt
+++ b/Documentation/devicetree/bindings/clock/imx31-clock.txt
@@ -77,7 +77,7 @@ Examples:
 clks: ccm@53f80000{
 	compatible = "fsl,imx31-ccm";
 	reg = <0x53f80000 0x4000>;
-	interrupts = <0 31 0x04 0 53 0x04>;
+	interrupts = <31>, <53>;
 	#clock-cells = <1>;
 };
 
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 37babf91f2cb..922dec8fa07e 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -3998,10 +3998,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 			it if 0 is given (See Documentation/cgroup-v1/memory.txt)
 
 	swiotlb=	[ARM,IA-64,PPC,MIPS,X86]
-			Format: { <int> | force }
+			Format: { <int> | force | noforce }
 			<int> -- Number of I/O TLB slabs
 			force -- force using of bounce buffers even if they
 			         wouldn't be automatically used by the kernel
+			noforce -- Never use bounce buffers (for debugging)
 
 	switches=	[HW,M68k]
 
diff --git a/Makefile b/Makefile
index 2a8af8af7b27..ef95231d1625 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 9
-SUBLEVEL = 5
+SUBLEVEL = 6
 EXTRAVERSION =
 NAME = Roaring Lionus
 
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index bd204bfa29ed..249e10190d20 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -28,7 +28,7 @@ config ARC
 	select HAVE_KPROBES
 	select HAVE_KRETPROBES
 	select HAVE_MEMBLOCK
-	select HAVE_MOD_ARCH_SPECIFIC if ARC_DW2_UNWIND
+	select HAVE_MOD_ARCH_SPECIFIC
 	select HAVE_OPROFILE
 	select HAVE_PERF_EVENTS
 	select HANDLE_DOMAIN_IRQ
diff --git a/arch/arc/include/asm/module.h b/arch/arc/include/asm/module.h
index 6e91d8b339c3..567590ea8f6c 100644
--- a/arch/arc/include/asm/module.h
+++ b/arch/arc/include/asm/module.h
@@ -14,13 +14,13 @@
 
 #include <asm-generic/module.h>
 
-#ifdef CONFIG_ARC_DW2_UNWIND
 struct mod_arch_specific {
+#ifdef CONFIG_ARC_DW2_UNWIND
 	void *unw_info;
 	int unw_sec_idx;
+#endif
 	const char *secstr;
 };
-#endif
 
 #define MODULE_PROC_FAMILY "ARC700"
 
diff --git a/arch/arc/kernel/module.c b/arch/arc/kernel/module.c
index 42e964db2967..3d99a6091332 100644
--- a/arch/arc/kernel/module.c
+++ b/arch/arc/kernel/module.c
@@ -32,8 +32,8 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
 #ifdef CONFIG_ARC_DW2_UNWIND
 	mod->arch.unw_sec_idx = 0;
 	mod->arch.unw_info = NULL;
-	mod->arch.secstr = secstr;
 #endif
+	mod->arch.secstr = secstr;
 	return 0;
 }
 
@@ -113,8 +113,10 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
 
 	}
 
+#ifdef CONFIG_ARC_DW2_UNWIND
 	if (strcmp(module->arch.secstr+sechdrs[tgtsec].sh_name, ".eh_frame") == 0)
 		module->arch.unw_sec_idx = tgtsec;
+#endif
 
 	return 0;
 
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index c558ba75cbcc..7037201c5e3a 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -485,6 +485,7 @@ dtb-$(CONFIG_ARCH_OMAP3) += \
 	am3517-evm.dtb \
 	am3517_mt_ventoux.dtb \
 	logicpd-torpedo-37xx-devkit.dtb \
+	logicpd-som-lv-37xx-devkit.dtb \
 	omap3430-sdp.dtb \
 	omap3-beagle.dtb \
 	omap3-beagle-xm.dtb \
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 194d884c9de1..795c1467fa50 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -16,6 +16,7 @@
 	interrupt-parent = <&intc>;
 	#address-cells = <1>;
 	#size-cells = <1>;
+	chosen { };
 
 	aliases {
 		i2c0 = &i2c0;
diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index a275fa956813..a20a71d9d22e 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -16,6 +16,7 @@
 	interrupt-parent = <&wakeupgen>;
 	#address-cells = <1>;
 	#size-cells = <1>;
+	chosen { };
 
 	memory@0 {
 		device_type = "memory";
diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index 46d46d894a44..74dd21b7373c 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -104,7 +104,7 @@
 			reg = <0x7e104000 0x10>;
 		};
 
-		mailbox: mailbox@7e00b800 {
+		mailbox: mailbox@7e00b880 {
 			compatible = "brcm,bcm2835-mbox";
 			reg = <0x7e00b880 0x40>;
 			interrupts = <0 1>;
diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index 41de15fe15a2..78492a0bbbab 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -99,6 +99,7 @@
 				#size-cells = <1>;
 				compatible = "m25p64";
 				spi-max-frequency = <30000000>;
+				m25p,fast-read;
 				reg = <0>;
 				partition@0 {
 					label = "U-Boot-SPL";
diff --git a/arch/arm/boot/dts/dm814x.dtsi b/arch/arm/boot/dts/dm814x.dtsi
index ff90a6ce6bdc..d87efab24fa2 100644
--- a/arch/arm/boot/dts/dm814x.dtsi
+++ b/arch/arm/boot/dts/dm814x.dtsi
@@ -12,6 +12,7 @@
 	interrupt-parent = <&intc>;
 	#address-cells = <1>;
 	#size-cells = <1>;
+	chosen { };
 
 	aliases {
 		i2c0 = &i2c1;
diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi
index f1e0f771ff29..cbdfbc4e4a26 100644
--- a/arch/arm/boot/dts/dm816x.dtsi
+++ b/arch/arm/boot/dts/dm816x.dtsi
@@ -12,6 +12,7 @@
 	interrupt-parent = <&intc>;
 	#address-cells = <1>;
 	#size-cells = <1>;
+	chosen { };
 
 	aliases {
 		i2c0 = &i2c1;
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index d4fcd68f6349..064d84f87e45 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -18,6 +18,7 @@
 
 	compatible = "ti,dra7xx";
 	interrupt-parent = <&crossbar_mpu>;
+	chosen { };
 
 	aliases {
 		i2c0 = &i2c1;
@@ -1376,6 +1377,7 @@
 			phy-names = "sata-phy";
 			clocks = <&sata_ref_clk>;
 			ti,hwmods = "sata";
+			ports-implemented = <0x1>;
 		};
 
 		rtc: rtc@48838000 {
diff --git a/arch/arm/boot/dts/imx31.dtsi b/arch/arm/boot/dts/imx31.dtsi
index 1ce7ae94e7ad..11e9e6bd8abb 100644
--- a/arch/arm/boot/dts/imx31.dtsi
+++ b/arch/arm/boot/dts/imx31.dtsi
@@ -30,11 +30,11 @@
 		};
 	};
 
-	avic: avic-interrupt-controller@60000000 {
+	avic: interrupt-controller@68000000 {
 		compatible = "fsl,imx31-avic", "fsl,avic";
 		interrupt-controller;
 		#interrupt-cells = <1>;
-		reg = <0x60000000 0x100000>;
+		reg = <0x68000000 0x100000>;
 	};
 
 	soc {
@@ -118,13 +118,6 @@
 				interrupts = <19>;
 				clocks = <&clks 25>;
 			};
-
-			clks: ccm@53f80000{
-				compatible = "fsl,imx31-ccm";
-				reg = <0x53f80000 0x4000>;
-				interrupts = <0 31 0x04 0 53 0x04>;
-				#clock-cells = <1>;
-			};
 		};
 
 		aips@53f00000 { /* AIPS2 */
@@ -134,6 +127,13 @@
 			reg = <0x53f00000 0x100000>;
 			ranges;
 
+			clks: ccm@53f80000{
+				compatible = "fsl,imx31-ccm";
+				reg = <0x53f80000 0x4000>;
+				interrupts = <31>, <53>;
+				#clock-cells = <1>;
+			};
+
 			gpt: timer@53f90000 {
 				compatible = "fsl,imx31-gpt";
 				reg = <0x53f90000 0x4000>;
diff --git a/arch/arm/boot/dts/imx6q-cm-fx6.dts b/arch/arm/boot/dts/imx6q-cm-fx6.dts
index 59bc5a4dce17..a150bca84daa 100644
--- a/arch/arm/boot/dts/imx6q-cm-fx6.dts
+++ b/arch/arm/boot/dts/imx6q-cm-fx6.dts
@@ -183,7 +183,6 @@
 			MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK	0x1b0b0
 			MX6QDL_PAD_ENET_MDIO__ENET_MDIO		0x1b0b0
 			MX6QDL_PAD_ENET_MDC__ENET_MDC		0x1b0b0
-			MX6QDL_PAD_GPIO_16__ENET_REF_CLK	0x4001b0a8
 		>;
 	};
 
diff --git a/arch/arm/boot/dts/imx6qdl-nitrogen6_max.dtsi b/arch/arm/boot/dts/imx6qdl-nitrogen6_max.dtsi
index b0b3220a1fd9..01166ba36f27 100644
--- a/arch/arm/boot/dts/imx6qdl-nitrogen6_max.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-nitrogen6_max.dtsi
@@ -319,8 +319,6 @@
 		compatible = "fsl,imx6q-nitrogen6_max-sgtl5000",
 			     "fsl,imx-audio-sgtl5000";
 		model = "imx6q-nitrogen6_max-sgtl5000";
-		pinctrl-names = "default";
-		pinctrl-0 = <&pinctrl_sgtl5000>;
 		ssi-controller = <&ssi1>;
 		audio-codec = <&codec>;
 		audio-routing =
@@ -402,6 +400,8 @@
 
 	codec: sgtl5000@0a {
 		compatible = "fsl,sgtl5000";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_sgtl5000>;
 		reg = <0x0a>;
 		clocks = <&clks IMX6QDL_CLK_CKO>;
 		VDDA-supply = <&reg_2p5v>;
diff --git a/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts b/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts
index da8598402ab8..38faa90007d7 100644
--- a/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts
+++ b/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts
@@ -158,7 +158,7 @@
 &mmc1 {
 	interrupts-extended = <&intc 83 &omap3_pmx_core 0x11a>;
 	pinctrl-names = "default";
-	pinctrl-0 = <&mmc1_pins &mmc1_cd>;
+	pinctrl-0 = <&mmc1_pins>;
 	wp-gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>;		/* gpio_126 */
 	cd-gpios = <&gpio4 14 IRQ_TYPE_LEVEL_LOW>;		/* gpio_110 */
 	vmmc-supply = <&vmmc1>;
@@ -193,7 +193,8 @@
 			OMAP3_CORE1_IOPAD(0x214a, PIN_INPUT | MUX_MODE0)	/* sdmmc1_dat1.sdmmc1_dat1 */
 			OMAP3_CORE1_IOPAD(0x214c, PIN_INPUT | MUX_MODE0)	/* sdmmc1_dat2.sdmmc1_dat2 */
 			OMAP3_CORE1_IOPAD(0x214e, PIN_INPUT | MUX_MODE0)	/* sdmmc1_dat3.sdmmc1_dat3 */
-			OMAP3_CORE1_IOPAD(0x2132, PIN_INPUT_PULLUP | MUX_MODE4)	/* cam_strobe.gpio_126 sdmmc1_wp*/
+			OMAP3_CORE1_IOPAD(0x2132, PIN_INPUT_PULLUP | MUX_MODE4)	/* cam_strobe.gpio_126 */
+			OMAP3_CORE1_IOPAD(0x212c, PIN_INPUT_PULLUP | MUX_MODE4)	/* cam_d11.gpio_110 */
 		>;
 	};
 
@@ -242,12 +243,6 @@
 			OMAP3_WKUP_IOPAD(0x2a16, PIN_OUTPUT | PIN_OFF_OUTPUT_LOW | MUX_MODE4)       /* sys_boot6.gpio_8 */
 		>;
 	};
-
-	mmc1_cd: pinmux_mmc1_cd {
-		pinctrl-single,pins = <
-			OMAP3_WKUP_IOPAD(0x212c, PIN_INPUT_PULLUP | MUX_MODE4)	/* cam_d11.gpio_110 */
-		>;
-	};
 };
 
 
diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi
index 4f793a025a72..f1d6de8b3c19 100644
--- a/arch/arm/boot/dts/omap2.dtsi
+++ b/arch/arm/boot/dts/omap2.dtsi
@@ -17,6 +17,7 @@
 	interrupt-parent = <&intc>;
 	#address-cells = <1>;
 	#size-cells = <1>;
+	chosen { };
 
 	aliases {
 		serial0 = &uart1;
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 353d818ce5a6..2008648b8c9f 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -17,6 +17,7 @@
 	interrupt-parent = <&intc>;
 	#address-cells = <1>;
 	#size-cells = <1>;
+	chosen { };
 
 	aliases {
 		i2c0 = &i2c1;
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 0ced079b7ae3..9c289ddab3df 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -15,6 +15,7 @@
 	interrupt-parent = <&wakeupgen>;
 	#address-cells = <1>;
 	#size-cells = <1>;
+	chosen { };
 
 	aliases {
 		i2c0 = &i2c1;
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 25262118ec3d..1d1d8e90cd80 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -17,6 +17,7 @@
 
 	compatible = "ti,omap5";
 	interrupt-parent = <&wakeupgen>;
+	chosen { };
 
 	aliases {
 		i2c0 = &i2c1;
@@ -985,6 +986,7 @@
 			phy-names = "sata-phy";
 			clocks = <&sata_ref_clk>;
 			ti,hwmods = "sata";
+			ports-implemented = <0x1>;
 		};
 
 		dss: dss@58000000 {
diff --git a/arch/arm/boot/dts/r8a7794.dtsi b/arch/arm/boot/dts/r8a7794.dtsi
index 725ecb3c5fb4..7e860d3737ff 100644
--- a/arch/arm/boot/dts/r8a7794.dtsi
+++ b/arch/arm/boot/dts/r8a7794.dtsi
@@ -319,7 +319,7 @@
 				  "ch12";
 		clocks = <&mstp5_clks R8A7794_CLK_AUDIO_DMAC0>;
 		clock-names = "fck";
-		power-domains = <&cpg_clocks>;
+		power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
 		#dma-cells = <1>;
 		dma-channels = <13>;
 	};
@@ -1025,8 +1025,7 @@
 			clocks = <&extal_clk &usb_extal_clk>;
 			#clock-cells = <1>;
 			clock-output-names = "main", "pll0", "pll1", "pll3",
-					     "lb", "qspi", "sdh", "sd0", "z",
-					     "rcan";
+					     "lb", "qspi", "sdh", "sd0", "rcan";
 			#power-domain-cells = <0>;
 		};
 		/* Variable factor clocks */
@@ -1483,7 +1482,7 @@
 			      "mix.0", "mix.1",
 			      "dvc.0", "dvc.1",
 			      "clk_a", "clk_b", "clk_c", "clk_i";
-		power-domains = <&cpg_clocks>;
+		power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
 
 		status = "disabled";
 
diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h
index 522b5feb4eaa..b62eaeb147aa 100644
--- a/arch/arm/include/asm/cputype.h
+++ b/arch/arm/include/asm/cputype.h
@@ -94,6 +94,9 @@
 #define ARM_CPU_XSCALE_ARCH_V2		0x4000
 #define ARM_CPU_XSCALE_ARCH_V3		0x6000
 
+/* Qualcomm implemented cores */
+#define ARM_CPU_PART_SCORPION		0x510002d0
+
 extern unsigned int processor_id;
 
 #ifdef CONFIG_CPU_CP15
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
index b8df45883cf7..25538a935874 100644
--- a/arch/arm/kernel/hw_breakpoint.c
+++ b/arch/arm/kernel/hw_breakpoint.c
@@ -1066,6 +1066,22 @@ static int __init arch_hw_breakpoint_init(void)
 		return 0;
 	}
 
+	/*
+	 * Scorpion CPUs (at least those in APQ8060) seem to set DBGPRSR.SPD
+	 * whenever a WFI is issued, even if the core is not powered down, in
+	 * violation of the architecture.  When DBGPRSR.SPD is set, accesses to
+	 * breakpoint and watchpoint registers are treated as undefined, so
+	 * this results in boot time and runtime failures when these are
+	 * accessed and we unexpectedly take a trap.
+	 *
+	 * It's not clear if/how this can be worked around, so we blacklist
+	 * Scorpion CPUs to avoid these issues.
+	*/
+	if (read_cpuid_part() == ARM_CPU_PART_SCORPION) {
+		pr_info("Scorpion CPU detected. Hardware breakpoints and watchpoints disabled\n");
+		return 0;
+	}
+
 	has_ossr = core_has_os_save_restore();
 
 	/* Determine how many BRPs/WRPs are available. */
diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c
index 22313cb53362..9af0701f7094 100644
--- a/arch/arm/kernel/smp_tlb.c
+++ b/arch/arm/kernel/smp_tlb.c
@@ -9,6 +9,7 @@
  */
 #include <linux/preempt.h>
 #include <linux/smp.h>
+#include <linux/uaccess.h>
 
 #include <asm/smp_plat.h>
 #include <asm/tlbflush.h>
@@ -40,8 +41,11 @@ static inline void ipi_flush_tlb_mm(void *arg)
 static inline void ipi_flush_tlb_page(void *arg)
 {
 	struct tlb_args *ta = (struct tlb_args *)arg;
+	unsigned int __ua_flags = uaccess_save_and_enable();
 
 	local_flush_tlb_page(ta->ta_vma, ta->ta_start);
+
+	uaccess_restore(__ua_flags);
 }
 
 static inline void ipi_flush_tlb_kernel_page(void *arg)
@@ -54,8 +58,11 @@ static inline void ipi_flush_tlb_kernel_page(void *arg)
 static inline void ipi_flush_tlb_range(void *arg)
 {
 	struct tlb_args *ta = (struct tlb_args *)arg;
+	unsigned int __ua_flags = uaccess_save_and_enable();
 
 	local_flush_tlb_range(ta->ta_vma, ta->ta_start, ta->ta_end);
+
+	uaccess_restore(__ua_flags);
 }
 
 static inline void ipi_flush_tlb_kernel_range(void *arg)
diff --git a/arch/arm/mach-ux500/pm.c b/arch/arm/mach-ux500/pm.c
index 8538910db202..a970e7fcba9e 100644
--- a/arch/arm/mach-ux500/pm.c
+++ b/arch/arm/mach-ux500/pm.c
@@ -134,8 +134,8 @@ bool prcmu_pending_irq(void)
  */
 bool prcmu_is_cpu_in_wfi(int cpu)
 {
-	return readl(PRCM_ARM_WFI_STANDBY) & cpu ? PRCM_ARM_WFI_STANDBY_WFI1 :
-		     PRCM_ARM_WFI_STANDBY_WFI0;
+	return readl(PRCM_ARM_WFI_STANDBY) &
+		(cpu ? PRCM_ARM_WFI_STANDBY_WFI1 : PRCM_ARM_WFI_STANDBY_WFI0);
 }
 
 /*
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
index b71086d25195..53211a0acf0f 100644
--- a/arch/arm64/include/asm/memory.h
+++ b/arch/arm64/include/asm/memory.h
@@ -217,7 +217,7 @@ static inline void *phys_to_virt(phys_addr_t x)
 #define _virt_addr_valid(kaddr)	pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
 #else
 #define __virt_to_pgoff(kaddr)	(((u64)(kaddr) & ~PAGE_OFFSET) / PAGE_SIZE * sizeof(struct page))
-#define __page_to_voff(page)	(((u64)(page) & ~VMEMMAP_START) * PAGE_SIZE / sizeof(struct page))
+#define __page_to_voff(kaddr)	(((u64)(kaddr) & ~VMEMMAP_START) * PAGE_SIZE / sizeof(struct page))
 
 #define page_to_virt(page)	((void *)((__page_to_voff(page)) | PAGE_OFFSET))
 #define virt_to_page(vaddr)	((struct page *)((__virt_to_pgoff(vaddr)) | VMEMMAP_START))
diff --git a/arch/arm64/include/uapi/asm/ptrace.h b/arch/arm64/include/uapi/asm/ptrace.h
index b5c3933ed441..d1ff83dfe5de 100644
--- a/arch/arm64/include/uapi/asm/ptrace.h
+++ b/arch/arm64/include/uapi/asm/ptrace.h
@@ -77,6 +77,7 @@ struct user_fpsimd_state {
 	__uint128_t	vregs[32];
 	__u32		fpsr;
 	__u32		fpcr;
+	__u32		__reserved[2];
 };
 
 struct user_hwdebug_state {
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index 223d54a4d66b..79b0fe24d5b7 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -624,7 +624,7 @@ el0_inv:
 	mov	x0, sp
 	mov	x1, #BAD_SYNC
 	mov	x2, x25
-	bl	bad_mode
+	bl	bad_el0_sync
 	b	ret_to_user
 ENDPROC(el0_sync)
 
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index e0c81da60f76..8eedeef375d6 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -550,6 +550,8 @@ static int hw_break_set(struct task_struct *target,
 	/* (address, ctrl) registers */
 	limit = regset->n * regset->size;
 	while (count && offset < limit) {
+		if (count < PTRACE_HBP_ADDR_SZ)
+			return -EINVAL;
 		ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &addr,
 					 offset, offset + PTRACE_HBP_ADDR_SZ);
 		if (ret)
@@ -559,6 +561,8 @@ static int hw_break_set(struct task_struct *target,
 			return ret;
 		offset += PTRACE_HBP_ADDR_SZ;
 
+		if (!count)
+			break;
 		ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &ctrl,
 					 offset, offset + PTRACE_HBP_CTRL_SZ);
 		if (ret)
@@ -595,7 +599,7 @@ static int gpr_set(struct task_struct *target, const struct user_regset *regset,
 		   const void *kbuf, const void __user *ubuf)
 {
 	int ret;
-	struct user_pt_regs newregs;
+	struct user_pt_regs newregs = task_pt_regs(target)->user_regs;
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &newregs, 0, -1);
 	if (ret)
@@ -625,7 +629,8 @@ static int fpr_set(struct task_struct *target, const struct user_regset *regset,
 		   const void *kbuf, const void __user *ubuf)
 {
 	int ret;
-	struct user_fpsimd_state newstate;
+	struct user_fpsimd_state newstate =
+		target->thread.fpsimd_state.user_fpsimd;
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &newstate, 0, -1);
 	if (ret)
@@ -649,7 +654,7 @@ static int tls_set(struct task_struct *target, const struct user_regset *regset,
 		   const void *kbuf, const void __user *ubuf)
 {
 	int ret;
-	unsigned long tls;
+	unsigned long tls = target->thread.tp_value;
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &tls, 0, -1);
 	if (ret)
@@ -675,7 +680,8 @@ static int system_call_set(struct task_struct *target,
 			   unsigned int pos, unsigned int count,
 			   const void *kbuf, const void __user *ubuf)
 {
-	int syscallno, ret;
+	int syscallno = task_pt_regs(target)->syscallno;
+	int ret;
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &syscallno, 0, -1);
 	if (ret)
@@ -947,7 +953,7 @@ static int compat_tls_set(struct task_struct *target,
 			  const void __user *ubuf)
 {
 	int ret;
-	compat_ulong_t tls;
+	compat_ulong_t tls = target->thread.tp_value;
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &tls, 0, -1);
 	if (ret)
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index c9986b3e0a96..11e5eae088ab 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -596,17 +596,34 @@ const char *esr_get_class_string(u32 esr)
 }
 
 /*
- * bad_mode handles the impossible case in the exception vector.
+ * bad_mode handles the impossible case in the exception vector. This is always
+ * fatal.
  */
 asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
 {
-	siginfo_t info;
-	void __user *pc = (void __user *)instruction_pointer(regs);
 	console_verbose();
 
 	pr_crit("Bad mode in %s handler detected on CPU%d, code 0x%08x -- %s\n",
 		handler[reason], smp_processor_id(), esr,
 		esr_get_class_string(esr));
+
+	die("Oops - bad mode", regs, 0);
+	local_irq_disable();
+	panic("bad mode");
+}
+
+/*
+ * bad_el0_sync handles unexpected, but potentially recoverable synchronous
+ * exceptions taken from EL0. Unlike bad_mode, this returns.
+ */
+asmlinkage void bad_el0_sync(struct pt_regs *regs, int reason, unsigned int esr)
+{
+	siginfo_t info;
+	void __user *pc = (void __user *)instruction_pointer(regs);
+	console_verbose();
+
+	pr_crit("Bad EL0 synchronous exception detected on CPU%d, code 0x%08x -- %s\n",
+		smp_processor_id(), esr, esr_get_class_string(esr));
 	__show_regs(regs);
 
 	info.si_signo = SIGILL;
@@ -614,7 +631,10 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
 	info.si_code  = ILL_ILLOPC;
 	info.si_addr  = pc;
 
-	arm64_notify_die("Oops - bad mode", regs, &info, 0);
+	current->thread.fault_address = 0;
+	current->thread.fault_code = 0;
+
+	force_sig_info(info.si_signo, &info, current);
 }
 
 void __pte_error(const char *file, int line, unsigned long val)
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index 3f74d0d98de6..02265a589ef5 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -524,7 +524,8 @@ EXPORT_SYMBOL(dummy_dma_ops);
 
 static int __init arm64_dma_init(void)
 {
-	if (swiotlb_force || max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT))
+	if (swiotlb_force == SWIOTLB_FORCE ||
+	    max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT))
 		swiotlb = 1;
 
 	return atomic_pool_init();
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 212c4d1e2f26..380ebe705093 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -401,8 +401,11 @@ static void __init free_unused_memmap(void)
  */
 void __init mem_init(void)
 {
-	if (swiotlb_force || max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT))
+	if (swiotlb_force == SWIOTLB_FORCE ||
+	    max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT))
 		swiotlb_init(1);
+	else
+		swiotlb_force = SWIOTLB_NO_FORCE;
 
 	set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
 
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index c56ea8c84abb..c4ced1d01d57 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -157,7 +157,7 @@
 #define PPC_INST_MCRXR			0x7c000400
 #define PPC_INST_MCRXR_MASK		0xfc0007fe
 #define PPC_INST_MFSPR_PVR		0x7c1f42a6
-#define PPC_INST_MFSPR_PVR_MASK		0xfc1fffff
+#define PPC_INST_MFSPR_PVR_MASK		0xfc1ffffe
 #define PPC_INST_MFTMR			0x7c0002dc
 #define PPC_INST_MSGSND			0x7c00019c
 #define PPC_INST_MSGCLR			0x7c0001dc
@@ -174,13 +174,13 @@
 #define PPC_INST_RFDI			0x4c00004e
 #define PPC_INST_RFMCI			0x4c00004c
 #define PPC_INST_MFSPR_DSCR		0x7c1102a6
-#define PPC_INST_MFSPR_DSCR_MASK	0xfc1fffff
+#define PPC_INST_MFSPR_DSCR_MASK	0xfc1ffffe
 #define PPC_INST_MTSPR_DSCR		0x7c1103a6
-#define PPC_INST_MTSPR_DSCR_MASK	0xfc1fffff
+#define PPC_INST_MTSPR_DSCR_MASK	0xfc1ffffe
 #define PPC_INST_MFSPR_DSCR_USER	0x7c0302a6
-#define PPC_INST_MFSPR_DSCR_USER_MASK	0xfc1fffff
+#define PPC_INST_MFSPR_DSCR_USER_MASK	0xfc1ffffe
 #define PPC_INST_MTSPR_DSCR_USER	0x7c0303a6
-#define PPC_INST_MTSPR_DSCR_USER_MASK	0xfc1fffff
+#define PPC_INST_MTSPR_DSCR_USER_MASK	0xfc1ffffe
 #define PPC_INST_MFVSRD			0x7c000066
 #define PPC_INST_MTVSRD			0x7c000166
 #define PPC_INST_SLBFEE			0x7c0007a7
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index b1ec62f2cc31..5c8f12fe9721 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -463,6 +463,10 @@ static int fpr_set(struct task_struct *target, const struct user_regset *regset,
 
 	flush_fp_to_thread(target);
 
+	for (i = 0; i < 32 ; i++)
+		buf[i] = target->thread.TS_FPR(i);
+	buf[32] = target->thread.fp_state.fpscr;
+
 	/* copy to local buffer then write that out */
 	i = user_regset_copyin(&pos, &count, &kbuf, &ubuf, buf, 0, -1);
 	if (i)
@@ -672,6 +676,9 @@ static int vsr_set(struct task_struct *target, const struct user_regset *regset,
 	flush_altivec_to_thread(target);
 	flush_vsx_to_thread(target);
 
+	for (i = 0; i < 32 ; i++)
+		buf[i] = target->thread.fp_state.fpr[i][TS_VSRLOWOFFSET];
+
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 				 buf, 0, 32 * sizeof(double));
 	if (!ret)
@@ -1019,6 +1026,10 @@ static int tm_cfpr_set(struct task_struct *target,
 	flush_fp_to_thread(target);
 	flush_altivec_to_thread(target);
 
+	for (i = 0; i < 32; i++)
+		buf[i] = target->thread.TS_CKFPR(i);
+	buf[32] = target->thread.ckfp_state.fpscr;
+
 	/* copy to local buffer then write that out */
 	i = user_regset_copyin(&pos, &count, &kbuf, &ubuf, buf, 0, -1);
 	if (i)
@@ -1283,6 +1294,9 @@ static int tm_cvsx_set(struct task_struct *target,
 	flush_altivec_to_thread(target);
 	flush_vsx_to_thread(target);
 
+	for (i = 0; i < 32 ; i++)
+		buf[i] = target->thread.ckfp_state.fpr[i][TS_VSRLOWOFFSET];
+
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 				 buf, 0, 32 * sizeof(double));
 	if (!ret)
diff --git a/arch/powerpc/perf/power9-events-list.h b/arch/powerpc/perf/power9-events-list.h
index 6447dc1c3d89..929b56d47ad9 100644
--- a/arch/powerpc/perf/power9-events-list.h
+++ b/arch/powerpc/perf/power9-events-list.h
@@ -16,7 +16,7 @@ EVENT(PM_CYC,					0x0001e)
 EVENT(PM_ICT_NOSLOT_CYC,			0x100f8)
 EVENT(PM_CMPLU_STALL,				0x1e054)
 EVENT(PM_INST_CMPL,				0x00002)
-EVENT(PM_BRU_CMPL,				0x40060)
+EVENT(PM_BRU_CMPL,				0x10012)
 EVENT(PM_BR_MPRED_CMPL,				0x400f6)
 
 /* All L1 D cache load references counted at finish, gated by reject */
diff --git a/arch/powerpc/sysdev/xics/icp-opal.c b/arch/powerpc/sysdev/xics/icp-opal.c
index d38e86fd5720..60c57657c772 100644
--- a/arch/powerpc/sysdev/xics/icp-opal.c
+++ b/arch/powerpc/sysdev/xics/icp-opal.c
@@ -20,6 +20,7 @@
 #include <asm/xics.h>
 #include <asm/io.h>
 #include <asm/opal.h>
+#include <asm/kvm_ppc.h>
 
 static void icp_opal_teardown_cpu(void)
 {
@@ -39,7 +40,26 @@ static void icp_opal_flush_ipi(void)
 	 * Should we be flagging idle loop instead?
 	 * Or creating some task to be scheduled?
 	 */
-	opal_int_eoi((0x00 << 24) | XICS_IPI);
+	if (opal_int_eoi((0x00 << 24) | XICS_IPI) > 0)
+		force_external_irq_replay();
+}
+
+static unsigned int icp_opal_get_xirr(void)
+{
+	unsigned int kvm_xirr;
+	__be32 hw_xirr;
+	int64_t rc;
+
+	/* Handle an interrupt latched by KVM first */
+	kvm_xirr = kvmppc_get_xics_latch();
+	if (kvm_xirr)
+		return kvm_xirr;
+
+	/* Then ask OPAL */
+	rc = opal_int_get_xirr(&hw_xirr, false);
+	if (rc < 0)
+		return 0;
+	return be32_to_cpu(hw_xirr);
 }
 
 static unsigned int icp_opal_get_irq(void)
@@ -47,12 +67,8 @@ static unsigned int icp_opal_get_irq(void)
 	unsigned int xirr;
 	unsigned int vec;
 	unsigned int irq;
-	int64_t rc;
 
-	rc = opal_int_get_xirr(&xirr, false);
-	if (rc < 0)
-		return 0;
-	xirr = be32_to_cpu(xirr);
+	xirr = icp_opal_get_xirr();
 	vec = xirr & 0x00ffffff;
 	if (vec == XICS_IRQ_SPURIOUS)
 		return 0;
@@ -67,7 +83,8 @@ static unsigned int icp_opal_get_irq(void)
 	xics_mask_unknown_vec(vec);
 
 	/* We might learn about it later, so EOI it */
-	opal_int_eoi(xirr);
+	if (opal_int_eoi(xirr) > 0)
+		force_external_irq_replay();
 
 	return 0;
 }
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 9c7a1ecfe6bd..47a1de77b18d 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -916,7 +916,7 @@ static int kvm_s390_get_machine(struct kvm *kvm, struct kvm_device_attr *attr)
 	memcpy(&mach->fac_mask, kvm->arch.model.fac_mask,
 	       S390_ARCH_FAC_LIST_SIZE_BYTE);
 	memcpy((unsigned long *)&mach->fac_list, S390_lowcore.stfle_fac_list,
-	       S390_ARCH_FAC_LIST_SIZE_BYTE);
+	       sizeof(S390_lowcore.stfle_fac_list));
 	if (copy_to_user((void __user *)attr->addr, mach, sizeof(*mach)))
 		ret = -EFAULT;
 	kfree(mach);
@@ -1437,7 +1437,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
 
 	/* Populate the facility mask initially. */
 	memcpy(kvm->arch.model.fac_mask, S390_lowcore.stfle_fac_list,
-	       S390_ARCH_FAC_LIST_SIZE_BYTE);
+	       sizeof(S390_lowcore.stfle_fac_list));
 	for (i = 0; i < S390_ARCH_FAC_LIST_SIZE_U64; i++) {
 		if (i < kvm_s390_fac_list_mask_size())
 			kvm->arch.model.fac_mask[i] &= kvm_s390_fac_list_mask[i];
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 48e6d84f173e..3d8ff40ecc6f 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1876,6 +1876,7 @@ static struct irq_chip ioapic_chip __read_mostly = {
 	.irq_ack		= irq_chip_ack_parent,
 	.irq_eoi		= ioapic_ack_level,
 	.irq_set_affinity	= ioapic_set_affinity,
+	.irq_retrigger		= irq_chip_retrigger_hierarchy,
 	.flags			= IRQCHIP_SKIP_SET_WAKE,
 };
 
@@ -1887,6 +1888,7 @@ static struct irq_chip ioapic_ir_chip __read_mostly = {
 	.irq_ack		= irq_chip_ack_parent,
 	.irq_eoi		= ioapic_ir_ack_level,
 	.irq_set_affinity	= ioapic_set_affinity,
+	.irq_retrigger		= irq_chip_retrigger_hierarchy,
 	.flags			= IRQCHIP_SKIP_SET_WAKE,
 };
 
diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c
index b47edb8f5256..8da13d4e77cc 100644
--- a/arch/x86/kernel/pci-swiotlb.c
+++ b/arch/x86/kernel/pci-swiotlb.c
@@ -70,7 +70,7 @@ int __init pci_swiotlb_detect_override(void)
 {
 	int use_swiotlb = swiotlb | swiotlb_force;
 
-	if (swiotlb_force)
+	if (swiotlb_force == SWIOTLB_FORCE)
 		swiotlb = 1;
 
 	return use_swiotlb;
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 3cd69832d7f4..3961103e9176 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -114,6 +114,16 @@ static const struct dmi_system_id pci_crs_quirks[] __initconst = {
 			DMI_MATCH(DMI_BIOS_VERSION, "6JET85WW (1.43 )"),
 		},
 	},
+	/* https://bugzilla.kernel.org/show_bug.cgi?id=42606 */
+	{
+		.callback = set_nouse_crs,
+		.ident = "Supermicro X8DTH",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Supermicro"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "X8DTH-i/6/iF/6F"),
+			DMI_MATCH(DMI_BIOS_VERSION, "2.0a"),
+		},
+	},
 
 	/* https://bugzilla.kernel.org/show_bug.cgi?id=15362 */
 	{
diff --git a/arch/x86/xen/pci-swiotlb-xen.c b/arch/x86/xen/pci-swiotlb-xen.c
index 0e98e5d241d0..5f8b4b0302b6 100644
--- a/arch/x86/xen/pci-swiotlb-xen.c
+++ b/arch/x86/xen/pci-swiotlb-xen.c
@@ -49,7 +49,7 @@ int __init pci_xen_swiotlb_detect(void)
 	 * activate this IOMMU. If running as PV privileged, activate it
 	 * irregardless.
 	 */
-	if ((xen_initial_domain() || swiotlb || swiotlb_force))
+	if (xen_initial_domain() || swiotlb || swiotlb_force == SWIOTLB_FORCE)
 		xen_swiotlb = 1;
 
 	/* If we are running under Xen, we MUST disable the native SWIOTLB.
diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index 8f3488b80896..7f6fed9f0703 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -495,6 +495,7 @@ static int exynos4_mct_dying_cpu(unsigned int cpu)
 	if (mct_int_type == MCT_INT_SPI) {
 		if (evt->irq != -1)
 			disable_irq_nosync(evt->irq);
+		exynos4_mct_write(0x1, mevt->base + MCT_L_INT_CSTAT_OFFSET);
 	} else {
 		disable_percpu_irq(mct_irqs[MCT_L0_IRQ]);
 	}
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index bf3ea7603a58..712592cef1a2 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -593,11 +593,16 @@ struct devfreq *devfreq_add_device(struct device *dev,
 	list_add(&devfreq->node, &devfreq_list);
 
 	governor = find_devfreq_governor(devfreq->governor_name);
-	if (!IS_ERR(governor))
-		devfreq->governor = governor;
-	if (devfreq->governor)
-		err = devfreq->governor->event_handler(devfreq,
-					DEVFREQ_GOV_START, NULL);
+	if (IS_ERR(governor)) {
+		dev_err(dev, "%s: Unable to find governor for the device\n",
+			__func__);
+		err = PTR_ERR(governor);
+		goto err_init;
+	}
+
+	devfreq->governor = governor;
+	err = devfreq->governor->event_handler(devfreq, DEVFREQ_GOV_START,
+						NULL);
 	if (err) {
 		dev_err(dev, "%s: Unable to start governor for the device\n",
 			__func__);
diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
index 29866f7e6d7e..1b21bb60e797 100644
--- a/drivers/devfreq/exynos-bus.c
+++ b/drivers/devfreq/exynos-bus.c
@@ -498,7 +498,7 @@ static int exynos_bus_probe(struct platform_device *pdev)
 	if (IS_ERR(bus->devfreq)) {
 		dev_err(dev,
 			"failed to add devfreq dev with passive governor\n");
-		ret = -EPROBE_DEFER;
+		ret = PTR_ERR(bus->devfreq);
 		goto err;
 	}
 
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 030fe05ed43b..9f3dbc8c63d2 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -448,6 +448,9 @@ struct dma_pl330_chan {
 
 	/* for cyclic capability */
 	bool cyclic;
+
+	/* for runtime pm tracking */
+	bool active;
 };
 
 struct pl330_dmac {
@@ -2031,6 +2034,7 @@ static void pl330_tasklet(unsigned long data)
 		_stop(pch->thread);
 		spin_unlock(&pch->thread->dmac->lock);
 		power_down = true;
+		pch->active = false;
 	} else {
 		/* Make sure the PL330 Channel thread is active */
 		spin_lock(&pch->thread->dmac->lock);
@@ -2050,6 +2054,7 @@ static void pl330_tasklet(unsigned long data)
 			desc->status = PREP;
 			list_move_tail(&desc->node, &pch->work_list);
 			if (power_down) {
+				pch->active = true;
 				spin_lock(&pch->thread->dmac->lock);
 				_start(pch->thread);
 				spin_unlock(&pch->thread->dmac->lock);
@@ -2164,6 +2169,7 @@ static int pl330_terminate_all(struct dma_chan *chan)
 	unsigned long flags;
 	struct pl330_dmac *pl330 = pch->dmac;
 	LIST_HEAD(list);
+	bool power_down = false;
 
 	pm_runtime_get_sync(pl330->ddma.dev);
 	spin_lock_irqsave(&pch->lock, flags);
@@ -2174,6 +2180,8 @@ static int pl330_terminate_all(struct dma_chan *chan)
 	pch->thread->req[0].desc = NULL;
 	pch->thread->req[1].desc = NULL;
 	pch->thread->req_running = -1;
+	power_down = pch->active;
+	pch->active = false;
 
 	/* Mark all desc done */
 	list_for_each_entry(desc, &pch->submitted_list, node) {
@@ -2191,6 +2199,8 @@ static int pl330_terminate_all(struct dma_chan *chan)
 	list_splice_tail_init(&pch->completed_list, &pl330->desc_pool);
 	spin_unlock_irqrestore(&pch->lock, flags);
 	pm_runtime_mark_last_busy(pl330->ddma.dev);
+	if (power_down)
+		pm_runtime_put_autosuspend(pl330->ddma.dev);
 	pm_runtime_put_autosuspend(pl330->ddma.dev);
 
 	return 0;
@@ -2350,6 +2360,7 @@ static void pl330_issue_pending(struct dma_chan *chan)
 		 * updated on work_list emptiness status.
 		 */
 		WARN_ON(list_empty(&pch->submitted_list));
+		pch->active = true;
 		pm_runtime_get_sync(pch->dmac->ddma.dev);
 	}
 	list_splice_tail_init(&pch->submitted_list, &pch->work_list);
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 2e441d0ccd79..4c357d475465 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -986,6 +986,7 @@ static void rcar_dmac_free_chan_resources(struct dma_chan *chan)
 {
 	struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan);
 	struct rcar_dmac *dmac = to_rcar_dmac(chan->device);
+	struct rcar_dmac_chan_map *map = &rchan->map;
 	struct rcar_dmac_desc_page *page, *_page;
 	struct rcar_dmac_desc *desc;
 	LIST_HEAD(list);
@@ -1019,6 +1020,13 @@ static void rcar_dmac_free_chan_resources(struct dma_chan *chan)
 		free_page((unsigned long)page);
 	}
 
+	/* Remove slave mapping if present. */
+	if (map->slave.xfer_size) {
+		dma_unmap_resource(chan->device->dev, map->addr,
+				   map->slave.xfer_size, map->dir, 0);
+		map->slave.xfer_size = 0;
+	}
+
 	pm_runtime_put(chan->device->dev);
 }
 
diff --git a/drivers/hid/hid-corsair.c b/drivers/hid/hid-corsair.c
index 717704e9ae07..c0303f61c26a 100644
--- a/drivers/hid/hid-corsair.c
+++ b/drivers/hid/hid-corsair.c
@@ -148,26 +148,36 @@ static enum led_brightness k90_backlight_get(struct led_classdev *led_cdev)
 	struct usb_interface *usbif = to_usb_interface(dev->parent);
 	struct usb_device *usbdev = interface_to_usbdev(usbif);
 	int brightness;
-	char data[8];
+	char *data;
+
+	data = kmalloc(8, GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
 
 	ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0),
 			      K90_REQUEST_STATUS,
 			      USB_DIR_IN | USB_TYPE_VENDOR |
 			      USB_RECIP_DEVICE, 0, 0, data, 8,
 			      USB_CTRL_SET_TIMEOUT);
-	if (ret < 0) {
+	if (ret < 5) {
 		dev_warn(dev, "Failed to get K90 initial state (error %d).\n",
 			 ret);
-		return -EIO;
+		ret = -EIO;
+		goto out;
 	}
 	brightness = data[4];
 	if (brightness < 0 || brightness > 3) {
 		dev_warn(dev,
 			 "Read invalid backlight brightness: %02hhx.\n",
 			 data[4]);
-		return -EIO;
+		ret = -EIO;
+		goto out;
 	}
-	return brightness;
+	ret = brightness;
+out:
+	kfree(data);
+
+	return ret;
 }
 
 static enum led_brightness k90_record_led_get(struct led_classdev *led_cdev)
@@ -253,17 +263,22 @@ static ssize_t k90_show_macro_mode(struct device *dev,
 	struct usb_interface *usbif = to_usb_interface(dev->parent);
 	struct usb_device *usbdev = interface_to_usbdev(usbif);
 	const char *macro_mode;
-	char data[8];
+	char *data;
+
+	data = kmalloc(2, GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
 
 	ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0),
 			      K90_REQUEST_GET_MODE,
 			      USB_DIR_IN | USB_TYPE_VENDOR |
 			      USB_RECIP_DEVICE, 0, 0, data, 2,
 			      USB_CTRL_SET_TIMEOUT);
-	if (ret < 0) {
+	if (ret < 1) {
 		dev_warn(dev, "Failed to get K90 initial mode (error %d).\n",
 			 ret);
-		return -EIO;
+		ret = -EIO;
+		goto out;
 	}
 
 	switch (data[0]) {
@@ -277,10 +292,15 @@ static ssize_t k90_show_macro_mode(struct device *dev,
 	default:
 		dev_warn(dev, "K90 in unknown mode: %02hhx.\n",
 			 data[0]);
-		return -EIO;
+		ret = -EIO;
+		goto out;
 	}
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", macro_mode);
+	ret = snprintf(buf, PAGE_SIZE, "%s\n", macro_mode);
+out:
+	kfree(data);
+
+	return ret;
 }
 
 static ssize_t k90_store_macro_mode(struct device *dev,
@@ -320,26 +340,36 @@ static ssize_t k90_show_current_profile(struct device *dev,
 	struct usb_interface *usbif = to_usb_interface(dev->parent);
 	struct usb_device *usbdev = interface_to_usbdev(usbif);
 	int current_profile;
-	char data[8];
+	char *data;
+
+	data = kmalloc(8, GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
 
 	ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0),
 			      K90_REQUEST_STATUS,
 			      USB_DIR_IN | USB_TYPE_VENDOR |
 			      USB_RECIP_DEVICE, 0, 0, data, 8,
 			      USB_CTRL_SET_TIMEOUT);
-	if (ret < 0) {
+	if (ret < 8) {
 		dev_warn(dev, "Failed to get K90 initial state (error %d).\n",
 			 ret);
-		return -EIO;
+		ret = -EIO;
+		goto out;
 	}
 	current_profile = data[7];
 	if (current_profile < 1 || current_profile > 3) {
 		dev_warn(dev, "Read invalid current profile: %02hhx.\n",
 			 data[7]);
-		return -EIO;
+		ret = -EIO;
+		goto out;
 	}
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", current_profile);
+	ret = snprintf(buf, PAGE_SIZE, "%d\n", current_profile);
+out:
+	kfree(data);
+
+	return ret;
 }
 
 static ssize_t k90_store_current_profile(struct device *dev,
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
index 1a2984c28b95..ae04826e82fc 100644
--- a/drivers/infiniband/core/cache.c
+++ b/drivers/infiniband/core/cache.c
@@ -770,12 +770,8 @@ static int _gid_table_setup_one(struct ib_device *ib_dev)
 	int err = 0;
 
 	table = kcalloc(ib_dev->phys_port_cnt, sizeof(*table), GFP_KERNEL);
-
-	if (!table) {
-		pr_warn("failed to allocate ib gid cache for %s\n",
-			ib_dev->name);
+	if (!table)
 		return -ENOMEM;
-	}
 
 	for (port = 0; port < ib_dev->phys_port_cnt; port++) {
 		u8 rdma_port = port + rdma_start_port(ib_dev);
@@ -1170,14 +1166,13 @@ int ib_cache_setup_one(struct ib_device *device)
 					  GFP_KERNEL);
 	if (!device->cache.pkey_cache ||
 	    !device->cache.lmc_cache) {
-		pr_warn("Couldn't allocate cache for %s\n", device->name);
-		return -ENOMEM;
+		err = -ENOMEM;
+		goto free;
 	}
 
 	err = gid_table_setup_one(device);
 	if (err)
-		/* Allocated memory will be cleaned in the release function */
-		return err;
+		goto free;
 
 	for (p = 0; p <= rdma_end_port(device) - rdma_start_port(device); ++p)
 		ib_cache_update(device, p + rdma_start_port(device));
@@ -1192,6 +1187,9 @@ int ib_cache_setup_one(struct ib_device *device)
 
 err:
 	gid_table_cleanup_one(device);
+free:
+	kfree(device->cache.pkey_cache);
+	kfree(device->cache.lmc_cache);
 	return err;
 }
 
diff --git a/drivers/infiniband/hw/mlx4/ah.c b/drivers/infiniband/hw/mlx4/ah.c
index b9bf0759f10a..8dfc76f8cbb4 100644
--- a/drivers/infiniband/hw/mlx4/ah.c
+++ b/drivers/infiniband/hw/mlx4/ah.c
@@ -114,7 +114,9 @@ static struct ib_ah *create_iboe_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr
 		       !(1 << ah->av.eth.stat_rate & dev->caps.stat_rate_support))
 			--ah->av.eth.stat_rate;
 	}
-
+	ah->av.eth.sl_tclass_flowlabel |=
+			cpu_to_be32((ah_attr->grh.traffic_class << 20) |
+				    ah_attr->grh.flow_label);
 	/*
 	 * HW requires multicast LID so we just choose one.
 	 */
@@ -122,7 +124,7 @@ static struct ib_ah *create_iboe_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr
 		ah->av.ib.dlid = cpu_to_be16(0xc000);
 
 	memcpy(ah->av.eth.dgid, ah_attr->grh.dgid.raw, 16);
-	ah->av.eth.sl_tclass_flowlabel = cpu_to_be32(ah_attr->sl << 29);
+	ah->av.eth.sl_tclass_flowlabel |= cpu_to_be32(ah_attr->sl << 29);
 
 	return &ah->ibah;
 }
diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
index 1672907ff219..18d309e40f1b 100644
--- a/drivers/infiniband/hw/mlx4/mad.c
+++ b/drivers/infiniband/hw/mlx4/mad.c
@@ -702,10 +702,18 @@ static int mlx4_ib_demux_mad(struct ib_device *ibdev, u8 port,
 
 	/* If a grh is present, we demux according to it */
 	if (wc->wc_flags & IB_WC_GRH) {
-		slave = mlx4_ib_find_real_gid(ibdev, port, grh->dgid.global.interface_id);
-		if (slave < 0) {
-			mlx4_ib_warn(ibdev, "failed matching grh\n");
-			return -ENOENT;
+		if (grh->dgid.global.interface_id ==
+			cpu_to_be64(IB_SA_WELL_KNOWN_GUID) &&
+		    grh->dgid.global.subnet_prefix == cpu_to_be64(
+			atomic64_read(&dev->sriov.demux[port - 1].subnet_prefix))) {
+			slave = 0;
+		} else {
+			slave = mlx4_ib_find_real_gid(ibdev, port,
+						      grh->dgid.global.interface_id);
+			if (slave < 0) {
+				mlx4_ib_warn(ibdev, "failed matching grh\n");
+				return -ENOENT;
+			}
 		}
 	}
 	/* Class-specific handling */
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index b597e8227591..46ad99595fd2 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -697,9 +697,11 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port,
 	if (err)
 		goto out;
 
-	props->active_width	=  (((u8 *)mailbox->buf)[5] == 0x40) ?
-						IB_WIDTH_4X : IB_WIDTH_1X;
-	props->active_speed	= IB_SPEED_QDR;
+	props->active_width	=  (((u8 *)mailbox->buf)[5] == 0x40) ||
+				   (((u8 *)mailbox->buf)[5] == 0x20 /*56Gb*/) ?
+					   IB_WIDTH_4X : IB_WIDTH_1X;
+	props->active_speed	=  (((u8 *)mailbox->buf)[5] == 0x20 /*56Gb*/) ?
+					   IB_SPEED_FDR : IB_SPEED_QDR;
 	props->port_cap_flags	= IB_PORT_CM_SUP | IB_PORT_IP_BASED_GIDS;
 	props->gid_tbl_len	= mdev->dev->caps.gid_table_len[port];
 	props->max_msg_sz	= mdev->dev->caps.max_msg_sz;
@@ -2820,14 +2822,19 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
 			goto err_steer_qp_release;
 		}
 
-		bitmap_zero(ibdev->ib_uc_qpns_bitmap, ibdev->steer_qpn_count);
-
-		err = mlx4_FLOW_STEERING_IB_UC_QP_RANGE(
-				dev, ibdev->steer_qpn_base,
-				ibdev->steer_qpn_base +
-				ibdev->steer_qpn_count - 1);
-		if (err)
-			goto err_steer_free_bitmap;
+		if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_DMFS_IPOIB) {
+			bitmap_zero(ibdev->ib_uc_qpns_bitmap,
+				    ibdev->steer_qpn_count);
+			err = mlx4_FLOW_STEERING_IB_UC_QP_RANGE(
+					dev, ibdev->steer_qpn_base,
+					ibdev->steer_qpn_base +
+					ibdev->steer_qpn_count - 1);
+			if (err)
+				goto err_steer_free_bitmap;
+		} else {
+			bitmap_fill(ibdev->ib_uc_qpns_bitmap,
+				    ibdev->steer_qpn_count);
+		}
 	}
 
 	for (j = 1; j <= ibdev->dev->caps.num_ports; j++)
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 570bc866b1d6..c22454383976 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1280,7 +1280,8 @@ static int _mlx4_ib_destroy_qp(struct ib_qp *qp)
 	if (is_qp0(dev, mqp))
 		mlx4_CLOSE_PORT(dev->dev, mqp->port);
 
-	if (dev->qp1_proxy[mqp->port - 1] == mqp) {
+	if (mqp->mlx4_ib_qp_type == MLX4_IB_QPT_PROXY_GSI &&
+	    dev->qp1_proxy[mqp->port - 1] == mqp) {
 		mutex_lock(&dev->qp1_proxy_lock[mqp->port - 1]);
 		dev->qp1_proxy[mqp->port - 1] = NULL;
 		mutex_unlock(&dev->qp1_proxy_lock[mqp->port - 1]);
@@ -1764,14 +1765,14 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
 		u8 port_num = mlx4_is_bonded(to_mdev(ibqp->device)->dev) ? 1 :
 			attr_mask & IB_QP_PORT ? attr->port_num : qp->port;
 		union ib_gid gid;
-		struct ib_gid_attr gid_attr;
+		struct ib_gid_attr gid_attr = {.gid_type = IB_GID_TYPE_IB};
 		u16 vlan = 0xffff;
 		u8 smac[ETH_ALEN];
 		int status = 0;
 		int is_eth = rdma_cap_eth_ah(&dev->ib_dev, port_num) &&
 			attr->ah_attr.ah_flags & IB_AH_GRH;
 
-		if (is_eth) {
+		if (is_eth && attr->ah_attr.ah_flags & IB_AH_GRH) {
 			int index = attr->ah_attr.grh.sgid_index;
 
 			status = ib_get_cached_gid(ibqp->device, port_num,
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 32b09f059c84..4cab29ea394c 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -496,6 +496,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 	struct mlx5_ib_dev *dev = to_mdev(ibdev);
 	struct mlx5_core_dev *mdev = dev->mdev;
 	int err = -ENOMEM;
+	int max_sq_desc;
 	int max_rq_sg;
 	int max_sq_sg;
 	u64 min_page_size = 1ull << MLX5_CAP_GEN(mdev, log_pg_sz);
@@ -618,9 +619,10 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 	props->max_qp_wr	   = 1 << MLX5_CAP_GEN(mdev, log_max_qp_sz);
 	max_rq_sg =  MLX5_CAP_GEN(mdev, max_wqe_sz_rq) /
 		     sizeof(struct mlx5_wqe_data_seg);
-	max_sq_sg = (MLX5_CAP_GEN(mdev, max_wqe_sz_sq) -
-		     sizeof(struct mlx5_wqe_ctrl_seg)) /
-		     sizeof(struct mlx5_wqe_data_seg);
+	max_sq_desc = min_t(int, MLX5_CAP_GEN(mdev, max_wqe_sz_sq), 512);
+	max_sq_sg = (max_sq_desc - sizeof(struct mlx5_wqe_ctrl_seg) -
+		     sizeof(struct mlx5_wqe_raddr_seg)) /
+		sizeof(struct mlx5_wqe_data_seg);
 	props->max_sge = min(max_rq_sg, max_sq_sg);
 	props->max_sge_rd	   = MLX5_MAX_SGE_RD;
 	props->max_cq		   = 1 << MLX5_CAP_GEN(mdev, log_max_cq);
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index 4e9012463c37..be2d02b6a6aa 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -628,7 +628,8 @@ int mlx5_mr_cache_init(struct mlx5_ib_dev *dev)
 		ent->order = i + 2;
 		ent->dev = dev;
 
-		if (dev->mdev->profile->mask & MLX5_PROF_MASK_MR_CACHE)
+		if ((dev->mdev->profile->mask & MLX5_PROF_MASK_MR_CACHE) &&
+		    (mlx5_core_is_pf(dev->mdev)))
 			limit = dev->mdev->profile->mr_cache[i].limit;
 		else
 			limit = 0;
@@ -646,6 +647,33 @@ int mlx5_mr_cache_init(struct mlx5_ib_dev *dev)
 	return 0;
 }
 
+static void wait_for_async_commands(struct mlx5_ib_dev *dev)
+{
+	struct mlx5_mr_cache *cache = &dev->cache;
+	struct mlx5_cache_ent *ent;
+	int total = 0;
+	int i;
+	int j;
+
+	for (i = 0; i < MAX_MR_CACHE_ENTRIES; i++) {
+		ent = &cache->ent[i];
+		for (j = 0 ; j < 1000; j++) {
+			if (!ent->pending)
+				break;
+			msleep(50);
+		}
+	}
+	for (i = 0; i < MAX_MR_CACHE_ENTRIES; i++) {
+		ent = &cache->ent[i];
+		total += ent->pending;
+	}
+
+	if (total)
+		mlx5_ib_warn(dev, "aborted while there are %d pending mr requests\n", total);
+	else
+		mlx5_ib_warn(dev, "done with all pending requests\n");
+}
+
 int mlx5_mr_cache_cleanup(struct mlx5_ib_dev *dev)
 {
 	int i;
@@ -659,6 +687,7 @@ int mlx5_mr_cache_cleanup(struct mlx5_ib_dev *dev)
 		clean_keys(dev, i);
 
 	destroy_workqueue(dev->cache.wq);
+	wait_for_async_commands(dev);
 	del_timer_sync(&dev->delay_timer);
 
 	return 0;
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index d1e921816bfe..aee3942ec68d 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -351,6 +351,29 @@ static int calc_send_wqe(struct ib_qp_init_attr *attr)
 		return ALIGN(max_t(int, inl_size, size), MLX5_SEND_WQE_BB);
 }
 
+static int get_send_sge(struct ib_qp_init_attr *attr, int wqe_size)
+{
+	int max_sge;
+
+	if (attr->qp_type == IB_QPT_RC)
+		max_sge = (min_t(int, wqe_size, 512) -
+			   sizeof(struct mlx5_wqe_ctrl_seg) -
+			   sizeof(struct mlx5_wqe_raddr_seg)) /
+			sizeof(struct mlx5_wqe_data_seg);
+	else if (attr->qp_type == IB_QPT_XRC_INI)
+		max_sge = (min_t(int, wqe_size, 512) -
+			   sizeof(struct mlx5_wqe_ctrl_seg) -
+			   sizeof(struct mlx5_wqe_xrc_seg) -
+			   sizeof(struct mlx5_wqe_raddr_seg)) /
+			sizeof(struct mlx5_wqe_data_seg);
+	else
+		max_sge = (wqe_size - sq_overhead(attr)) /
+			sizeof(struct mlx5_wqe_data_seg);
+
+	return min_t(int, max_sge, wqe_size - sq_overhead(attr) /
+		     sizeof(struct mlx5_wqe_data_seg));
+}
+
 static int calc_sq_size(struct mlx5_ib_dev *dev, struct ib_qp_init_attr *attr,
 			struct mlx5_ib_qp *qp)
 {
@@ -387,7 +410,11 @@ static int calc_sq_size(struct mlx5_ib_dev *dev, struct ib_qp_init_attr *attr,
 		return -ENOMEM;
 	}
 	qp->sq.wqe_shift = ilog2(MLX5_SEND_WQE_BB);
-	qp->sq.max_gs = attr->cap.max_send_sge;
+	qp->sq.max_gs = get_send_sge(attr, wqe_size);
+	if (qp->sq.max_gs < attr->cap.max_send_sge)
+		return -ENOMEM;
+
+	attr->cap.max_send_sge = qp->sq.max_gs;
 	qp->sq.max_post = wq_size / wqe_size;
 	attr->cap.max_send_wr = qp->sq.max_post;
 
diff --git a/drivers/infiniband/hw/mlx5/srq.c b/drivers/infiniband/hw/mlx5/srq.c
index 3857dbd9c956..729b0696626e 100644
--- a/drivers/infiniband/hw/mlx5/srq.c
+++ b/drivers/infiniband/hw/mlx5/srq.c
@@ -282,6 +282,7 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd,
 	mlx5_ib_dbg(dev, "desc_size 0x%x, req wr 0x%x, srq size 0x%x, max_gs 0x%x, max_avail_gather 0x%x\n",
 		    desc_size, init_attr->attr.max_wr, srq->msrq.max, srq->msrq.max_gs,
 		    srq->msrq.max_avail_gather);
+	in.type = init_attr->srq_type;
 
 	if (pd->uobject)
 		err = create_srq_user(pd, srq, &in, udata, buf_size);
@@ -294,7 +295,6 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd,
 		goto err_srq;
 	}
 
-	in.type = init_attr->srq_type;
 	in.log_size = ilog2(srq->msrq.max);
 	in.wqe_shift = srq->msrq.wqe_shift - 4;
 	if (srq->wq_sig)
diff --git a/drivers/infiniband/sw/rxe/rxe_param.h b/drivers/infiniband/sw/rxe/rxe_param.h
index f459c43a77c8..13ed2cc6eaa2 100644
--- a/drivers/infiniband/sw/rxe/rxe_param.h
+++ b/drivers/infiniband/sw/rxe/rxe_param.h
@@ -82,7 +82,7 @@ enum rxe_device_param {
 	RXE_MAX_SGE			= 32,
 	RXE_MAX_SGE_RD			= 32,
 	RXE_MAX_CQ			= 16384,
-	RXE_MAX_LOG_CQE			= 13,
+	RXE_MAX_LOG_CQE			= 15,
 	RXE_MAX_MR			= 2 * 1024,
 	RXE_MAX_PD			= 0x7ffc,
 	RXE_MAX_QP_RD_ATOM		= 128,
diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
index 22bd9630dcd9..9f46be52335e 100644
--- a/drivers/infiniband/sw/rxe/rxe_req.c
+++ b/drivers/infiniband/sw/rxe/rxe_req.c
@@ -548,23 +548,23 @@ static void update_wqe_psn(struct rxe_qp *qp,
 static void save_state(struct rxe_send_wqe *wqe,
 		       struct rxe_qp *qp,
 		       struct rxe_send_wqe *rollback_wqe,
-		       struct rxe_qp *rollback_qp)
+		       u32 *rollback_psn)
 {
 	rollback_wqe->state     = wqe->state;
 	rollback_wqe->first_psn = wqe->first_psn;
 	rollback_wqe->last_psn  = wqe->last_psn;
-	rollback_qp->req.psn    = qp->req.psn;
+	*rollback_psn		= qp->req.psn;
 }
 
 static void rollback_state(struct rxe_send_wqe *wqe,
 			   struct rxe_qp *qp,
 			   struct rxe_send_wqe *rollback_wqe,
-			   struct rxe_qp *rollback_qp)
+			   u32 rollback_psn)
 {
 	wqe->state     = rollback_wqe->state;
 	wqe->first_psn = rollback_wqe->first_psn;
 	wqe->last_psn  = rollback_wqe->last_psn;
-	qp->req.psn    = rollback_qp->req.psn;
+	qp->req.psn    = rollback_psn;
 }
 
 static void update_state(struct rxe_qp *qp, struct rxe_send_wqe *wqe,
@@ -593,8 +593,8 @@ int rxe_requester(void *arg)
 	int mtu;
 	int opcode;
 	int ret;
-	struct rxe_qp rollback_qp;
 	struct rxe_send_wqe rollback_wqe;
+	u32 rollback_psn;
 
 next_wqe:
 	if (unlikely(!qp->valid || qp->req.state == QP_STATE_ERROR))
@@ -719,7 +719,7 @@ int rxe_requester(void *arg)
 	 * rxe_xmit_packet().
 	 * Otherwise, completer might initiate an unjustified retry flow.
 	 */
-	save_state(wqe, qp, &rollback_wqe, &rollback_qp);
+	save_state(wqe, qp, &rollback_wqe, &rollback_psn);
 	update_wqe_state(qp, wqe, &pkt);
 	update_wqe_psn(qp, wqe, &pkt, payload);
 	ret = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp, &pkt, skb);
@@ -727,7 +727,7 @@ int rxe_requester(void *arg)
 		qp->need_req_skb = 1;
 		kfree_skb(skb);
 
-		rollback_state(wqe, qp, &rollback_wqe, &rollback_qp);
+		rollback_state(wqe, qp, &rollback_wqe, rollback_psn);
 
 		if (ret == -EAGAIN) {
 			rxe_run_task(&qp->req.task, 1);
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 339a1eecdfe3..81a8080c18b3 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -1054,8 +1054,6 @@ static struct ib_qp *ipoib_cm_create_tx_qp(struct net_device *dev, struct ipoib_
 
 	tx_qp = ib_create_qp(priv->pd, &attr);
 	if (PTR_ERR(tx_qp) == -EINVAL) {
-		ipoib_warn(priv, "can't use GFP_NOIO for QPs on device %s, using GFP_KERNEL\n",
-			   priv->ca->name);
 		attr.create_flags &= ~IB_QP_CREATE_USE_GFP_NOIO;
 		tx_qp = ib_create_qp(priv->pd, &attr);
 	}
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 6d7de9bfed9a..b93fe83a0b63 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -1346,6 +1346,18 @@ static void alps_process_packet_ss4_v2(struct psmouse *psmouse)
 
 	priv->multi_packet = 0;
 
+	/* Report trackstick */
+	if (alps_get_pkt_id_ss4_v2(packet) == SS4_PACKET_ID_STICK) {
+		if (priv->flags & ALPS_DUALPOINT) {
+			input_report_key(dev2, BTN_LEFT, f->ts_left);
+			input_report_key(dev2, BTN_RIGHT, f->ts_right);
+			input_report_key(dev2, BTN_MIDDLE, f->ts_middle);
+			input_sync(dev2);
+		}
+		return;
+	}
+
+	/* Report touchpad */
 	alps_report_mt_data(psmouse, (f->fingers <= 4) ? f->fingers : 4);
 
 	input_mt_report_finger_count(dev, f->fingers);
@@ -1356,13 +1368,6 @@ static void alps_process_packet_ss4_v2(struct psmouse *psmouse)
 
 	input_report_abs(dev, ABS_PRESSURE, f->pressure);
 	input_sync(dev);
-
-	if (priv->flags & ALPS_DUALPOINT) {
-		input_report_key(dev2, BTN_LEFT, f->ts_left);
-		input_report_key(dev2, BTN_RIGHT, f->ts_right);
-		input_report_key(dev2, BTN_MIDDLE, f->ts_middle);
-		input_sync(dev2);
-	}
 }
 
 static bool alps_is_valid_package_ss4_v2(struct psmouse *psmouse)
diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index ce4a96fccc43..5ff803efdc03 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -93,7 +93,7 @@ config VIDEO_OMAP3_DEBUG
 
 config VIDEO_PXA27x
 	tristate "PXA27x Quick Capture Interface driver"
-	depends on VIDEO_DEV && HAS_DMA
+	depends on VIDEO_DEV && VIDEO_V4L2 && HAS_DMA
 	depends on PXA27x || COMPILE_TEST
 	select VIDEOBUF2_DMA_SG
 	select SG_SPLIT
diff --git a/drivers/media/platform/blackfin/ppi.c b/drivers/media/platform/blackfin/ppi.c
index cff63e511e6d..b8f3d9fa66e9 100644
--- a/drivers/media/platform/blackfin/ppi.c
+++ b/drivers/media/platform/blackfin/ppi.c
@@ -214,6 +214,8 @@ static int ppi_set_params(struct ppi_if *ppi, struct ppi_params *params)
 	if (params->dlen > 24 || params->dlen <= 0)
 		return -EINVAL;
 	pctrl = devm_pinctrl_get(ppi->dev);
+	if (IS_ERR(pctrl))
+		return PTR_ERR(pctrl);
 	pstate = pinctrl_lookup_state(pctrl,
 				      pin_state[(params->dlen + 7) / 8 - 1]);
 	if (pinctrl_select_state(pctrl, pstate))
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index 3436eda58855..27e7cf65c2a7 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -926,10 +926,11 @@ static int s5p_mfc_release(struct file *file)
 	mfc_debug_enter();
 	if (dev)
 		mutex_lock(&dev->mfc_mutex);
-	s5p_mfc_clock_on();
 	vb2_queue_release(&ctx->vq_src);
 	vb2_queue_release(&ctx->vq_dst);
 	if (dev) {
+		s5p_mfc_clock_on();
+
 		/* Mark context as idle */
 		clear_work_bit_irqsave(ctx);
 		/*
@@ -951,9 +952,9 @@ static int s5p_mfc_release(struct file *file)
 			if (s5p_mfc_power_off() < 0)
 				mfc_err("Power off failed\n");
 		}
+		mfc_debug(2, "Shutting down clock\n");
+		s5p_mfc_clock_off();
 	}
-	mfc_debug(2, "Shutting down clock\n");
-	s5p_mfc_clock_off();
 	if (dev)
 		dev->ctx[ctx->num] = NULL;
 	s5p_mfc_dec_ctrls_delete(ctx);
diff --git a/drivers/media/platform/sti/hva/hva-hw.c b/drivers/media/platform/sti/hva/hva-hw.c
index d341d4994528..cf2a8d884536 100644
--- a/drivers/media/platform/sti/hva/hva-hw.c
+++ b/drivers/media/platform/sti/hva/hva-hw.c
@@ -305,16 +305,16 @@ int hva_hw_probe(struct platform_device *pdev, struct hva_dev *hva)
 	/* get memory for registers */
 	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	hva->regs = devm_ioremap_resource(dev, regs);
-	if (IS_ERR_OR_NULL(hva->regs)) {
+	if (IS_ERR(hva->regs)) {
 		dev_err(dev, "%s     failed to get regs\n", HVA_PREFIX);
 		return PTR_ERR(hva->regs);
 	}
 
 	/* get memory for esram */
 	esram = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	if (IS_ERR_OR_NULL(esram)) {
+	if (!esram) {
 		dev_err(dev, "%s     failed to get esram\n", HVA_PREFIX);
-		return PTR_ERR(esram);
+		return -ENODEV;
 	}
 	hva->esram_addr = esram->start;
 	hva->esram_size = resource_size(esram);
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
index 0f301903aa6f..63165d324fff 100644
--- a/drivers/media/rc/ite-cir.c
+++ b/drivers/media/rc/ite-cir.c
@@ -263,6 +263,8 @@ static void ite_set_carrier_params(struct ite_dev *dev)
 
 			if (allowance > ITE_RXDCR_MAX)
 				allowance = ITE_RXDCR_MAX;
+
+			use_demodulator = true;
 		}
 	}
 
diff --git a/drivers/media/spi/gs1662.c b/drivers/media/spi/gs1662.c
index d76f36233f43..5143a90219c0 100644
--- a/drivers/media/spi/gs1662.c
+++ b/drivers/media/spi/gs1662.c
@@ -453,10 +453,9 @@ static int gs_probe(struct spi_device *spi)
 static int gs_remove(struct spi_device *spi)
 {
 	struct v4l2_subdev *sd = spi_get_drvdata(spi);
-	struct gs *gs = to_gs(sd);
 
 	v4l2_device_unregister_subdev(sd);
-	kfree(gs);
+
 	return 0;
 }
 
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 44ecebd1ea8c..c8b8ac66ff7e 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -309,6 +309,9 @@ static void mxs_mmc_ac(struct mxs_mmc_host *host)
 	cmd0 = BF_SSP(cmd->opcode, CMD0_CMD);
 	cmd1 = cmd->arg;
 
+	if (cmd->opcode == MMC_STOP_TRANSMISSION)
+		cmd0 |= BM_SSP_CMD0_APPEND_8CYC;
+
 	if (host->sdio_irq_en) {
 		ctrl0 |= BM_SSP_CTRL0_SDIO_IRQ_CHECK;
 		cmd0 |= BM_SSP_CMD0_CONT_CLKING_EN | BM_SSP_CMD0_SLOW_CLKING_EN;
@@ -417,8 +420,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
 		       ssp->base + HW_SSP_BLOCK_SIZE);
 	}
 
-	if ((cmd->opcode == MMC_STOP_TRANSMISSION) ||
-	    (cmd->opcode == SD_IO_RW_EXTENDED))
+	if (cmd->opcode == SD_IO_RW_EXTENDED)
 		cmd0 |= BM_SSP_CMD0_APPEND_8CYC;
 
 	cmd1 = cmd->arg;
diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 81d4dc034793..fddd0be196f4 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -394,7 +394,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
 	/* Power on the SDHCI controller and its children */
 	acpi_device_fix_up_power(device);
 	list_for_each_entry(child, &device->children, node)
-		acpi_device_fix_up_power(child);
+		if (child->status.present && child->status.enabled)
+			acpi_device_fix_up_power(child);
 
 	if (acpi_bus_get_status(device) || !device->status.present)
 		return -ENODEV;
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 7b7a887b4709..b254090b8a1b 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -537,7 +537,7 @@ config MTD_NAND_FSMC
 	  Flexible Static Memory Controller (FSMC)
 
 config MTD_NAND_XWAY
-	tristate "Support for NAND on Lantiq XWAY SoC"
+	bool "Support for NAND on Lantiq XWAY SoC"
 	depends on LANTIQ && SOC_TYPE_XWAY
 	help
 	  Enables support for NAND Flash chips on Lantiq XWAY SoCs. NAND is attached
diff --git a/drivers/mtd/nand/lpc32xx_mlc.c b/drivers/mtd/nand/lpc32xx_mlc.c
index 852388171f20..bc6e49af063a 100644
--- a/drivers/mtd/nand/lpc32xx_mlc.c
+++ b/drivers/mtd/nand/lpc32xx_mlc.c
@@ -776,7 +776,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
 	init_completion(&host->comp_controller);
 
 	host->irq = platform_get_irq(pdev, 0);
-	if ((host->irq < 0) || (host->irq >= NR_IRQS)) {
+	if (host->irq < 0) {
 		dev_err(&pdev->dev, "failed to get platform irq\n");
 		res = -EINVAL;
 		goto err_exit3;
diff --git a/drivers/mtd/nand/xway_nand.c b/drivers/mtd/nand/xway_nand.c
index 1f2948c0c458..895101a5e686 100644
--- a/drivers/mtd/nand/xway_nand.c
+++ b/drivers/mtd/nand/xway_nand.c
@@ -232,7 +232,6 @@ static const struct of_device_id xway_nand_match[] = {
 	{ .compatible = "lantiq,nand-xway" },
 	{},
 };
-MODULE_DEVICE_TABLE(of, xway_nand_match);
 
 static struct platform_driver xway_nand_driver = {
 	.probe	= xway_nand_probe,
@@ -243,6 +242,4 @@ static struct platform_driver xway_nand_driver = {
 	},
 };
 
-module_platform_driver(xway_nand_driver);
-
-MODULE_LICENSE("GPL");
+builtin_platform_driver(xway_nand_driver);
diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c
index d403ba7b8f43..d489fbd07c12 100644
--- a/drivers/mtd/spi-nor/cadence-quadspi.c
+++ b/drivers/mtd/spi-nor/cadence-quadspi.c
@@ -1077,12 +1077,14 @@ static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np)
 
 	/* Get flash device data */
 	for_each_available_child_of_node(dev->of_node, np) {
-		if (of_property_read_u32(np, "reg", &cs)) {
+		ret = of_property_read_u32(np, "reg", &cs);
+		if (ret) {
 			dev_err(dev, "Couldn't determine chip select.\n");
 			goto err;
 		}
 
-		if (cs > CQSPI_MAX_CHIPSELECT) {
+		if (cs >= CQSPI_MAX_CHIPSELECT) {
+			ret = -EINVAL;
 			dev_err(dev, "Chip select %d out of range.\n", cs);
 			goto err;
 		}
diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
index 1056ed142411..f186e0460cde 100644
--- a/drivers/net/ieee802154/atusb.c
+++ b/drivers/net/ieee802154/atusb.c
@@ -112,13 +112,26 @@ static int atusb_read_reg(struct atusb *atusb, uint8_t reg)
 {
 	struct usb_device *usb_dev = atusb->usb_dev;
 	int ret;
+	uint8_t *buffer;
 	uint8_t value;
 
+	buffer = kmalloc(1, GFP_KERNEL);
+	if (!buffer)
+		return -ENOMEM;
+
 	dev_dbg(&usb_dev->dev, "atusb: reg = 0x%x\n", reg);
 	ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
 				ATUSB_REG_READ, ATUSB_REQ_FROM_DEV,
-				0, reg, &value, 1, 1000);
-	return ret >= 0 ? value : ret;
+				0, reg, buffer, 1, 1000);
+
+	if (ret >= 0) {
+		value = buffer[0];
+		kfree(buffer);
+		return value;
+	} else {
+		kfree(buffer);
+		return ret;
+	}
 }
 
 static int atusb_write_subreg(struct atusb *atusb, uint8_t reg, uint8_t mask,
@@ -587,9 +600,13 @@ static struct ieee802154_ops atusb_ops = {
 static int atusb_get_and_show_revision(struct atusb *atusb)
 {
 	struct usb_device *usb_dev = atusb->usb_dev;
-	unsigned char buffer[3];
+	unsigned char *buffer;
 	int ret;
 
+	buffer = kmalloc(3, GFP_KERNEL);
+	if (!buffer)
+		return -ENOMEM;
+
 	/* Get a couple of the ATMega Firmware values */
 	ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
 				ATUSB_ID, ATUSB_REQ_FROM_DEV, 0, 0,
@@ -605,15 +622,20 @@ static int atusb_get_and_show_revision(struct atusb *atusb)
 		dev_info(&usb_dev->dev, "Please update to version 0.2 or newer");
 	}
 
+	kfree(buffer);
 	return ret;
 }
 
 static int atusb_get_and_show_build(struct atusb *atusb)
 {
 	struct usb_device *usb_dev = atusb->usb_dev;
-	char build[ATUSB_BUILD_SIZE + 1];
+	char *build;
 	int ret;
 
+	build = kmalloc(ATUSB_BUILD_SIZE + 1, GFP_KERNEL);
+	if (!build)
+		return -ENOMEM;
+
 	ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
 				ATUSB_BUILD, ATUSB_REQ_FROM_DEV, 0, 0,
 				build, ATUSB_BUILD_SIZE, 1000);
@@ -622,6 +644,7 @@ static int atusb_get_and_show_build(struct atusb *atusb)
 		dev_info(&usb_dev->dev, "Firmware: build %s\n", build);
 	}
 
+	kfree(build);
 	return ret;
 }
 
diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index abe5c6bc756c..1480734c2d6e 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -957,6 +957,7 @@ static ssize_t __size_store(struct device *dev, unsigned long long val)
 {
 	resource_size_t allocated = 0, available = 0;
 	struct nd_region *nd_region = to_nd_region(dev->parent);
+	struct nd_namespace_common *ndns = to_ndns(dev);
 	struct nd_mapping *nd_mapping;
 	struct nvdimm_drvdata *ndd;
 	struct nd_label_id label_id;
@@ -964,7 +965,7 @@ static ssize_t __size_store(struct device *dev, unsigned long long val)
 	u8 *uuid = NULL;
 	int rc, i;
 
-	if (dev->driver || to_ndns(dev)->claim)
+	if (dev->driver || ndns->claim)
 		return -EBUSY;
 
 	if (is_namespace_pmem(dev)) {
@@ -1034,20 +1035,16 @@ static ssize_t __size_store(struct device *dev, unsigned long long val)
 
 		nd_namespace_pmem_set_resource(nd_region, nspm,
 				val * nd_region->ndr_mappings);
-	} else if (is_namespace_blk(dev)) {
-		struct nd_namespace_blk *nsblk = to_nd_namespace_blk(dev);
-
-		/*
-		 * Try to delete the namespace if we deleted all of its
-		 * allocation, this is not the seed device for the
-		 * region, and it is not actively claimed by a btt
-		 * instance.
-		 */
-		if (val == 0 && nd_region->ns_seed != dev
-				&& !nsblk->common.claim)
-			nd_device_unregister(dev, ND_ASYNC);
 	}
 
+	/*
+	 * Try to delete the namespace if we deleted all of its
+	 * allocation, this is not the seed device for the region, and
+	 * it is not actively claimed by a btt instance.
+	 */
+	if (val == 0 && nd_region->ns_seed != dev && !ndns->claim)
+		nd_device_unregister(dev, ND_ASYNC);
+
 	return rc;
 }
 
diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index bed19994c1e9..af8f6e92e885 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -807,11 +807,6 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
 {
 	u32 val;
 
-	/* get iATU unroll support */
-	pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);
-	dev_dbg(pp->dev, "iATU unroll: %s\n",
-		pp->iatu_unroll_enabled ? "enabled" : "disabled");
-
 	/* set the number of lanes */
 	val = dw_pcie_readl_rc(pp, PCIE_PORT_LINK_CONTROL);
 	val &= ~PORT_LINK_MODE_MASK;
@@ -882,6 +877,11 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
 	 * we should not program the ATU here.
 	 */
 	if (!pp->ops->rd_other_conf) {
+		/* get iATU unroll support */
+		pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);
+		dev_dbg(pp->dev, "iATU unroll: %s\n",
+			pp->iatu_unroll_enabled ? "enabled" : "disabled");
+
 		dw_pcie_prog_outbound_atu(pp, PCIE_ATU_REGION_INDEX0,
 					  PCIE_ATU_TYPE_MEM, pp->mem_base,
 					  pp->mem_bus_addr, pp->mem_size);
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 104c46d53121..300770cdc084 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1050,6 +1050,7 @@ void set_pcie_port_type(struct pci_dev *pdev)
 	pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
 	if (!pos)
 		return;
+
 	pdev->pcie_cap = pos;
 	pci_read_config_word(pdev, pos + PCI_EXP_FLAGS, &reg16);
 	pdev->pcie_flags_reg = reg16;
@@ -1057,13 +1058,14 @@ void set_pcie_port_type(struct pci_dev *pdev)
 	pdev->pcie_mpss = reg16 & PCI_EXP_DEVCAP_PAYLOAD;
 
 	/*
-	 * A Root Port is always the upstream end of a Link.  No PCIe
-	 * component has two Links.  Two Links are connected by a Switch
-	 * that has a Port on each Link and internal logic to connect the
-	 * two Ports.
+	 * A Root Port or a PCI-to-PCIe bridge is always the upstream end
+	 * of a Link.  No PCIe component has two Links.  Two Links are
+	 * connected by a Switch that has a Port on each Link and internal
+	 * logic to connect the two Ports.
 	 */
 	type = pci_pcie_type(pdev);
-	if (type == PCI_EXP_TYPE_ROOT_PORT)
+	if (type == PCI_EXP_TYPE_ROOT_PORT ||
+	    type == PCI_EXP_TYPE_PCIE_BRIDGE)
 		pdev->has_secondary_link = 1;
 	else if (type == PCI_EXP_TYPE_UPSTREAM ||
 		 type == PCI_EXP_TYPE_DOWNSTREAM) {
diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index b6ea9ffa7381..e0a629eaceab 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -411,8 +411,8 @@ int rpmsg_register_device(struct rpmsg_device *rpdev)
 	struct device *dev = &rpdev->dev;
 	int ret;
 
-	dev_set_name(&rpdev->dev, "%s:%s",
-		     dev_name(dev->parent), rpdev->id.name);
+	dev_set_name(&rpdev->dev, "%s.%s.%d.%d", dev_name(dev->parent),
+		     rpdev->id.name, rpdev->src, rpdev->dst);
 
 	rpdev->dev.bus = &rpmsg_bus;
 	rpdev->dev.release = rpmsg_release_device;
diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
index 608140f16d98..e3b911c895b4 100644
--- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
+++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
@@ -45,6 +45,7 @@
 
 #define	INITIAL_SRP_LIMIT	800
 #define	DEFAULT_MAX_SECTORS	256
+#define MAX_TXU			1024 * 1024
 
 static uint max_vdma_size = MAX_H_COPY_RDMA;
 
@@ -1239,7 +1240,7 @@ static long ibmvscsis_adapter_info(struct scsi_info *vscsi,
 	}
 
 	info = dma_alloc_coherent(&vscsi->dma_dev->dev, sizeof(*info), &token,
-				  GFP_KERNEL);
+				  GFP_ATOMIC);
 	if (!info) {
 		dev_err(&vscsi->dev, "bad dma_alloc_coherent %p\n",
 			iue->target);
@@ -1291,7 +1292,7 @@ static long ibmvscsis_adapter_info(struct scsi_info *vscsi,
 	info->mad_version = cpu_to_be32(MAD_VERSION_1);
 	info->os_type = cpu_to_be32(LINUX);
 	memset(&info->port_max_txu[0], 0, sizeof(info->port_max_txu));
-	info->port_max_txu[0] = cpu_to_be32(128 * PAGE_SIZE);
+	info->port_max_txu[0] = cpu_to_be32(MAX_TXU);
 
 	dma_wmb();
 	rc = h_copy_rdma(sizeof(*info), vscsi->dds.window[LOCAL].liobn,
@@ -1357,7 +1358,7 @@ static int ibmvscsis_cap_mad(struct scsi_info *vscsi, struct iu_entry *iue)
 	}
 
 	cap = dma_alloc_coherent(&vscsi->dma_dev->dev, olen, &token,
-				 GFP_KERNEL);
+				 GFP_ATOMIC);
 	if (!cap) {
 		dev_err(&vscsi->dev, "bad dma_alloc_coherent %p\n",
 			iue->target);
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 3e71bc1b4a80..7008061c4b5b 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -393,6 +393,7 @@ struct MPT3SAS_TARGET {
  * @eedp_enable: eedp support enable bit
  * @eedp_type: 0(type_1), 1(type_2), 2(type_3)
  * @eedp_block_length: block size
+ * @ata_command_pending: SATL passthrough outstanding for device
  */
 struct MPT3SAS_DEVICE {
 	struct MPT3SAS_TARGET *sas_target;
@@ -402,6 +403,17 @@ struct MPT3SAS_DEVICE {
 	u8	block;
 	u8	tlr_snoop_check;
 	u8	ignore_delay_remove;
+	/*
+	 * Bug workaround for SATL handling: the mpt2/3sas firmware
+	 * doesn't return BUSY or TASK_SET_FULL for subsequent
+	 * commands while a SATL pass through is in operation as the
+	 * spec requires, it simply does nothing with them until the
+	 * pass through completes, causing them possibly to timeout if
+	 * the passthrough is a long executing command (like format or
+	 * secure erase).  This variable allows us to do the right
+	 * thing while a SATL command is pending.
+	 */
+	unsigned long ata_command_pending;
 };
 
 #define MPT3_CMD_NOT_USED	0x8000	/* free */
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 1c4744e78173..f84a6087cebd 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -3885,9 +3885,18 @@ _scsih_temp_threshold_events(struct MPT3SAS_ADAPTER *ioc,
 	}
 }
 
-static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd)
+static int _scsih_set_satl_pending(struct scsi_cmnd *scmd, bool pending)
 {
-	return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16);
+	struct MPT3SAS_DEVICE *priv = scmd->device->hostdata;
+
+	if (scmd->cmnd[0] != ATA_12 && scmd->cmnd[0] != ATA_16)
+		return 0;
+
+	if (pending)
+		return test_and_set_bit(0, &priv->ata_command_pending);
+
+	clear_bit(0, &priv->ata_command_pending);
+	return 0;
 }
 
 /**
@@ -3911,9 +3920,7 @@ _scsih_flush_running_cmds(struct MPT3SAS_ADAPTER *ioc)
 		if (!scmd)
 			continue;
 		count++;
-		if (ata_12_16_cmd(scmd))
-			scsi_internal_device_unblock(scmd->device,
-							SDEV_RUNNING);
+		_scsih_set_satl_pending(scmd, false);
 		mpt3sas_base_free_smid(ioc, smid);
 		scsi_dma_unmap(scmd);
 		if (ioc->pci_error_recovery)
@@ -4044,13 +4051,6 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
 	if (ioc->logging_level & MPT_DEBUG_SCSI)
 		scsi_print_command(scmd);
 
-	/*
-	 * Lock the device for any subsequent command until command is
-	 * done.
-	 */
-	if (ata_12_16_cmd(scmd))
-		scsi_internal_device_block(scmd->device);
-
 	sas_device_priv_data = scmd->device->hostdata;
 	if (!sas_device_priv_data || !sas_device_priv_data->sas_target) {
 		scmd->result = DID_NO_CONNECT << 16;
@@ -4064,6 +4064,19 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
 		return 0;
 	}
 
+	/*
+	 * Bug work around for firmware SATL handling.  The loop
+	 * is based on atomic operations and ensures consistency
+	 * since we're lockless at this point
+	 */
+	do {
+		if (test_bit(0, &sas_device_priv_data->ata_command_pending)) {
+			scmd->result = SAM_STAT_BUSY;
+			scmd->scsi_done(scmd);
+			return 0;
+		}
+	} while (_scsih_set_satl_pending(scmd, true));
+
 	sas_target_priv_data = sas_device_priv_data->sas_target;
 
 	/* invalid device handle */
@@ -4626,8 +4639,7 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply)
 	if (scmd == NULL)
 		return 1;
 
-	if (ata_12_16_cmd(scmd))
-		scsi_internal_device_unblock(scmd->device, SDEV_RUNNING);
+	_scsih_set_satl_pending(scmd, false);
 
 	mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
 
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 56d6142852a5..078d797cb492 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -3489,7 +3489,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
 				sizeof(struct ct6_dsd), 0,
 				SLAB_HWCACHE_ALIGN, NULL);
 			if (!ctx_cachep)
-				goto fail_free_gid_list;
+				goto fail_free_srb_mempool;
 		}
 		ha->ctx_mempool = mempool_create_slab_pool(SRB_MIN_REQ,
 			ctx_cachep);
@@ -3642,7 +3642,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
 	ha->loop_id_map = kzalloc(BITS_TO_LONGS(LOOPID_MAP_SIZE) * sizeof(long),
 	    GFP_KERNEL);
 	if (!ha->loop_id_map)
-		goto fail_async_pd;
+		goto fail_loop_id_map;
 	else {
 		qla2x00_set_reserved_loop_ids(ha);
 		ql_dbg_pci(ql_dbg_init, ha->pdev, 0x0123,
@@ -3651,6 +3651,8 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
 
 	return 0;
 
+fail_loop_id_map:
+	dma_pool_free(ha->s_dma_pool, ha->async_pd, ha->async_pd_dma);
 fail_async_pd:
 	dma_pool_free(ha->s_dma_pool, ha->ex_init_cb, ha->ex_init_cb_dma);
 fail_ex_init_cb:
@@ -3678,6 +3680,10 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
 	dma_pool_free(ha->s_dma_pool, ha->ms_iocb, ha->ms_iocb_dma);
 	ha->ms_iocb = NULL;
 	ha->ms_iocb_dma = 0;
+
+	if (ha->sns_cmd)
+		dma_free_coherent(&ha->pdev->dev, sizeof(struct sns_cmd_pkt),
+		    ha->sns_cmd, ha->sns_cmd_dma);
 fail_dma_pool:
 	if (IS_QLA82XX(ha) || ql2xenabledif) {
 		dma_pool_destroy(ha->fcp_cmnd_dma_pool);
@@ -3695,10 +3701,12 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
 	kfree(ha->nvram);
 	ha->nvram = NULL;
 fail_free_ctx_mempool:
-	mempool_destroy(ha->ctx_mempool);
+	if (ha->ctx_mempool)
+		mempool_destroy(ha->ctx_mempool);
 	ha->ctx_mempool = NULL;
 fail_free_srb_mempool:
-	mempool_destroy(ha->srb_mempool);
+	if (ha->srb_mempool)
+		mempool_destroy(ha->srb_mempool);
 	ha->srb_mempool = NULL;
 fail_free_gid_list:
 	dma_free_coherent(&ha->pdev->dev, qla2x00_gid_list_size(ha),
diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c
index 8c9a35c91705..50adabbb5808 100644
--- a/drivers/scsi/ses.c
+++ b/drivers/scsi/ses.c
@@ -587,7 +587,7 @@ static void ses_match_to_enclosure(struct enclosure_device *edev,
 
 	ses_enclosure_data_process(edev, to_scsi_device(edev->edev.parent), 0);
 
-	if (scsi_is_sas_rphy(&sdev->sdev_gendev))
+	if (scsi_is_sas_rphy(sdev->sdev_target->dev.parent))
 		efd.addr = sas_get_address(sdev);
 
 	if (efd.addr) {
diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c
index 8823cc81ae45..5bb376009d98 100644
--- a/drivers/soc/ti/wkup_m3_ipc.c
+++ b/drivers/soc/ti/wkup_m3_ipc.c
@@ -459,6 +459,7 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
 
 	if (IS_ERR(task)) {
 		dev_err(dev, "can't create rproc_boot thread\n");
+		ret = PTR_ERR(task);
 		goto err_put_rproc;
 	}
 
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index dd7b5b47291d..d6239fa718be 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1690,6 +1690,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
 		pxa2xx_spi_write(drv_data, SSCR1, tmp);
 		tmp = SSCR0_SCR(2) | SSCR0_Motorola | SSCR0_DataSize(8);
 		pxa2xx_spi_write(drv_data, SSCR0, tmp);
+		break;
 	default:
 		tmp = SSCR1_RxTresh(RX_THRESH_DFLT) |
 		      SSCR1_TxTresh(TX_THRESH_DFLT);
diff --git a/drivers/staging/media/s5p-cec/s5p_cec.c b/drivers/staging/media/s5p-cec/s5p_cec.c
index 1780a08b73c9..58d756231136 100644
--- a/drivers/staging/media/s5p-cec/s5p_cec.c
+++ b/drivers/staging/media/s5p-cec/s5p_cec.c
@@ -231,7 +231,7 @@ static int s5p_cec_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int s5p_cec_runtime_suspend(struct device *dev)
+static int __maybe_unused s5p_cec_runtime_suspend(struct device *dev)
 {
 	struct s5p_cec_dev *cec = dev_get_drvdata(dev);
 
@@ -239,7 +239,7 @@ static int s5p_cec_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int s5p_cec_runtime_resume(struct device *dev)
+static int __maybe_unused s5p_cec_runtime_resume(struct device *dev)
 {
 	struct s5p_cec_dev *cec = dev_get_drvdata(dev);
 	int ret;
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 87e6035c9e81..8e7a3d646531 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -392,7 +392,7 @@ dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page,
 	if (dma_capable(dev, dev_addr, size) &&
 	    !range_straddles_page_boundary(phys, size) &&
 		!xen_arch_need_swiotlb(dev, phys, dev_addr) &&
-		!swiotlb_force) {
+		(swiotlb_force != SWIOTLB_FORCE)) {
 		/* we are not interested in the dma_addr returned by
 		 * xen_dma_map_page, only in the potential cache flushes executed
 		 * by the function. */
@@ -549,7 +549,7 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl,
 		phys_addr_t paddr = sg_phys(sg);
 		dma_addr_t dev_addr = xen_phys_to_bus(paddr);
 
-		if (swiotlb_force ||
+		if (swiotlb_force == SWIOTLB_FORCE ||
 		    xen_arch_need_swiotlb(hwdev, paddr, dev_addr) ||
 		    !dma_capable(hwdev, dev_addr, sg->length) ||
 		    range_straddles_page_boundary(paddr, sg->length)) {
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 16e6ded0b7f2..f3f21105b860 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2507,9 +2507,20 @@ int ceph_get_caps(struct ceph_inode_info *ci, int need, int want,
 			if (err < 0)
 				ret = err;
 		} else {
-			ret = wait_event_interruptible(ci->i_cap_wq,
-					try_get_cap_refs(ci, need, want, endoff,
-							 true, &_got, &err));
+			DEFINE_WAIT_FUNC(wait, woken_wake_function);
+			add_wait_queue(&ci->i_cap_wq, &wait);
+
+			while (!try_get_cap_refs(ci, need, want, endoff,
+						 true, &_got, &err)) {
+				if (signal_pending(current)) {
+					ret = -ERESTARTSYS;
+					break;
+				}
+				wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
+			}
+
+			remove_wait_queue(&ci->i_cap_wq, &wait);
+
 			if (err == -EAGAIN)
 				continue;
 			if (err < 0)
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index a594c7879cc2..1afa11191000 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -1255,7 +1255,8 @@ static int ceph_d_revalidate(struct dentry *dentry, unsigned int flags)
 		struct ceph_mds_client *mdsc =
 			ceph_sb_to_client(dir->i_sb)->mdsc;
 		struct ceph_mds_request *req;
-		int op, mask, err;
+		int op, err;
+		u32 mask;
 
 		if (flags & LOOKUP_RCU)
 			return -ECHILD;
@@ -1270,7 +1271,7 @@ static int ceph_d_revalidate(struct dentry *dentry, unsigned int flags)
 			mask = CEPH_STAT_CAP_INODE | CEPH_CAP_AUTH_SHARED;
 			if (ceph_security_xattr_wanted(dir))
 				mask |= CEPH_CAP_XATTR_SHARED;
-			req->r_args.getattr.mask = mask;
+			req->r_args.getattr.mask = cpu_to_le32(mask);
 
 			err = ceph_mdsc_do_request(mdsc, NULL, req);
 			switch (err) {
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index ef4d04647325..12f2252f6c98 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -305,7 +305,8 @@ static int frag_tree_split_cmp(const void *l, const void *r)
 {
 	struct ceph_frag_tree_split *ls = (struct ceph_frag_tree_split*)l;
 	struct ceph_frag_tree_split *rs = (struct ceph_frag_tree_split*)r;
-	return ceph_frag_compare(ls->frag, rs->frag);
+	return ceph_frag_compare(le32_to_cpu(ls->frag),
+				 le32_to_cpu(rs->frag));
 }
 
 static bool is_frag_child(u32 f, struct ceph_inode_frag *frag)
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 815acd1a56d4..6a26c7bd1286 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -288,12 +288,13 @@ static int parse_reply_info_extra(void **p, void *end,
 				  struct ceph_mds_reply_info_parsed *info,
 				  u64 features)
 {
-	if (info->head->op == CEPH_MDS_OP_GETFILELOCK)
+	u32 op = le32_to_cpu(info->head->op);
+
+	if (op == CEPH_MDS_OP_GETFILELOCK)
 		return parse_reply_info_filelock(p, end, info, features);
-	else if (info->head->op == CEPH_MDS_OP_READDIR ||
-		 info->head->op == CEPH_MDS_OP_LSSNAP)
+	else if (op == CEPH_MDS_OP_READDIR || op == CEPH_MDS_OP_LSSNAP)
 		return parse_reply_info_dir(p, end, info, features);
-	else if (info->head->op == CEPH_MDS_OP_CREATE)
+	else if (op == CEPH_MDS_OP_CREATE)
 		return parse_reply_info_create(p, end, info, features);
 	else
 		return -EIO;
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 70ea57c7b6bb..4e06a27ed7f8 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -2025,7 +2025,6 @@ static void end_requests(struct fuse_conn *fc, struct list_head *head)
 		struct fuse_req *req;
 		req = list_entry(head->next, struct fuse_req, list);
 		req->out.h.error = -ECONNABORTED;
-		clear_bit(FR_PENDING, &req->flags);
 		clear_bit(FR_SENT, &req->flags);
 		list_del_init(&req->list);
 		request_end(fc, req);
@@ -2103,6 +2102,8 @@ void fuse_abort_conn(struct fuse_conn *fc)
 		spin_lock(&fiq->waitq.lock);
 		fiq->connected = 0;
 		list_splice_init(&fiq->pending, &to_end2);
+		list_for_each_entry(req, &to_end2, list)
+			clear_bit(FR_PENDING, &req->flags);
 		while (forget_pending(fiq))
 			kfree(dequeue_forget(fiq, 1, NULL));
 		wake_up_all_locked(&fiq->waitq);
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 096f79997f75..642c57b8de7b 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -68,7 +68,7 @@ static u64 time_to_jiffies(u64 sec, u32 nsec)
 	if (sec || nsec) {
 		struct timespec64 ts = {
 			sec,
-			max_t(u32, nsec, NSEC_PER_SEC - 1)
+			min_t(u32, nsec, NSEC_PER_SEC - 1)
 		};
 
 		return get_jiffies_64() + timespec64_to_jiffies(&ts);
diff --git a/fs/posix_acl.c b/fs/posix_acl.c
index 595522022aca..c9d48dc78495 100644
--- a/fs/posix_acl.c
+++ b/fs/posix_acl.c
@@ -922,11 +922,10 @@ int simple_set_acl(struct inode *inode, struct posix_acl *acl, int type)
 	int error;
 
 	if (type == ACL_TYPE_ACCESS) {
-		error = posix_acl_equiv_mode(acl, &inode->i_mode);
-		if (error < 0)
-			return 0;
-		if (error == 0)
-			acl = NULL;
+		error = posix_acl_update_mode(inode,
+				&inode->i_mode, &acl);
+		if (error)
+			return error;
 	}
 
 	inode->i_ctime = current_time(inode);
diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c
index fa9a20cc60d6..fe5e8d4970ae 100644
--- a/fs/ubifs/tnc.c
+++ b/fs/ubifs/tnc.c
@@ -34,6 +34,11 @@
 #include <linux/slab.h>
 #include "ubifs.h"
 
+static int try_read_node(const struct ubifs_info *c, void *buf, int type,
+			 int len, int lnum, int offs);
+static int fallible_read_node(struct ubifs_info *c, const union ubifs_key *key,
+			      struct ubifs_zbranch *zbr, void *node);
+
 /*
  * Returned codes of 'matches_name()' and 'fallible_matches_name()' functions.
  * @NAME_LESS: name corresponding to the first argument is less than second
@@ -402,7 +407,19 @@ static int tnc_read_node_nm(struct ubifs_info *c, struct ubifs_zbranch *zbr,
 		return 0;
 	}
 
-	err = ubifs_tnc_read_node(c, zbr, node);
+	if (c->replaying) {
+		err = fallible_read_node(c, &zbr->key, zbr, node);
+		/*
+		 * When the node was not found, return -ENOENT, 0 otherwise.
+		 * Negative return codes stay as-is.
+		 */
+		if (err == 0)
+			err = -ENOENT;
+		else if (err == 1)
+			err = 0;
+	} else {
+		err = ubifs_tnc_read_node(c, zbr, node);
+	}
 	if (err)
 		return err;
 
@@ -2766,7 +2783,11 @@ struct ubifs_dent_node *ubifs_tnc_next_ent(struct ubifs_info *c,
 	if (nm->name) {
 		if (err) {
 			/* Handle collisions */
-			err = resolve_collision(c, key, &znode, &n, nm);
+			if (c->replaying)
+				err = fallible_resolve_collision(c, key, &znode, &n,
+							 nm, 0);
+			else
+				err = resolve_collision(c, key, &znode, &n, nm);
 			dbg_tnc("rc returned %d, znode %p, n %d",
 				err, znode, n);
 			if (unlikely(err < 0))
diff --git a/include/dt-bindings/clock/r8a7794-clock.h b/include/dt-bindings/clock/r8a7794-clock.h
index 9d02f5317c7c..88e64846cf37 100644
--- a/include/dt-bindings/clock/r8a7794-clock.h
+++ b/include/dt-bindings/clock/r8a7794-clock.h
@@ -20,8 +20,7 @@
 #define R8A7794_CLK_QSPI		5
 #define R8A7794_CLK_SDH			6
 #define R8A7794_CLK_SD0			7
-#define R8A7794_CLK_Z			8
-#define R8A7794_CLK_RCAN		9
+#define R8A7794_CLK_RCAN		8
 
 /* MSTP0 */
 #define R8A7794_CLK_MSIOF0		0
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 321f9ed552a9..01f71e1d2e94 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -444,6 +444,10 @@ bool __rcu_is_watching(void);
 #error "Unknown RCU implementation specified to kernel configuration"
 #endif
 
+#define RCU_SCHEDULER_INACTIVE	0
+#define RCU_SCHEDULER_INIT	1
+#define RCU_SCHEDULER_RUNNING	2
+
 /*
  * init_rcu_head_on_stack()/destroy_rcu_head_on_stack() are needed for dynamic
  * initialization and destruction of rcu_head on the stack. rcu_head structures
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index e5d193440374..7440290f64ac 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -66,6 +66,7 @@ struct svc_xprt {
 #define XPT_LISTENER	10		/* listening endpoint */
 #define XPT_CACHE_AUTH	11		/* cache auth info */
 #define XPT_LOCAL	12		/* connection from loopback interface */
+#define XPT_KILL_TEMP   13		/* call xpo_kill_temp_xprt before closing */
 
 	struct svc_serv		*xpt_server;	/* service for transport */
 	atomic_t    	    	xpt_reserved;	/* space on outq that is rsvd */
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 5f81f8a187f2..d2613536fd03 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -9,7 +9,13 @@ struct device;
 struct page;
 struct scatterlist;
 
-extern int swiotlb_force;
+enum swiotlb_force {
+	SWIOTLB_NORMAL,		/* Default - depending on HW DMA mask etc. */
+	SWIOTLB_FORCE,		/* swiotlb=force */
+	SWIOTLB_NO_FORCE,	/* swiotlb=noforce */
+};
+
+extern enum swiotlb_force swiotlb_force;
 
 /*
  * Maximum allowable number of contiguous slabs to map,
diff --git a/include/trace/events/swiotlb.h b/include/trace/events/swiotlb.h
index 7ea4c5e7c448..288c0c54a2b4 100644
--- a/include/trace/events/swiotlb.h
+++ b/include/trace/events/swiotlb.h
@@ -11,16 +11,16 @@ TRACE_EVENT(swiotlb_bounced,
 	TP_PROTO(struct device *dev,
 		 dma_addr_t dev_addr,
 		 size_t size,
-		 int swiotlb_force),
+		 enum swiotlb_force swiotlb_force),
 
 	TP_ARGS(dev, dev_addr, size, swiotlb_force),
 
 	TP_STRUCT__entry(
-		__string(	dev_name,	dev_name(dev)	)
-		__field(	u64,	dma_mask		)
-		__field(	dma_addr_t,	dev_addr	)
-		__field(	size_t,	size			)
-		__field(	int,	swiotlb_force		)
+		__string(	dev_name,	dev_name(dev)		)
+		__field(	u64,	dma_mask			)
+		__field(	dma_addr_t,	dev_addr		)
+		__field(	size_t,	size				)
+		__field(	enum swiotlb_force,	swiotlb_force	)
 	),
 
 	TP_fast_assign(
@@ -37,7 +37,10 @@ TRACE_EVENT(swiotlb_bounced,
 		__entry->dma_mask,
 		(unsigned long long)__entry->dev_addr,
 		__entry->size,
-		__entry->swiotlb_force ? "swiotlb_force" : "" )
+		__print_symbolic(__entry->swiotlb_force,
+			{ SWIOTLB_NORMAL,	"NORMAL" },
+			{ SWIOTLB_FORCE,	"FORCE" },
+			{ SWIOTLB_NO_FORCE,	"NO_FORCE" }))
 );
 
 #endif /*  _TRACE_SWIOTLB_H */
diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h
index 80adef7d4c3d..0d6ff3e471be 100644
--- a/kernel/rcu/rcu.h
+++ b/kernel/rcu/rcu.h
@@ -136,6 +136,7 @@ int rcu_jiffies_till_stall_check(void);
 #define TPS(x)  tracepoint_string(x)
 
 void rcu_early_boot_tests(void);
+void rcu_test_sync_prims(void);
 
 /*
  * This function really isn't for public consumption, but RCU is special in
diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c
index 1898559e6b60..b23a4d076f3d 100644
--- a/kernel/rcu/tiny.c
+++ b/kernel/rcu/tiny.c
@@ -185,9 +185,6 @@ static __latent_entropy void rcu_process_callbacks(struct softirq_action *unused
  * benefits of doing might_sleep() to reduce latency.)
  *
  * Cool, huh?  (Due to Josh Triplett.)
- *
- * But we want to make this a static inline later.  The cond_resched()
- * currently makes this problematic.
  */
 void synchronize_sched(void)
 {
@@ -195,7 +192,6 @@ void synchronize_sched(void)
 			 lock_is_held(&rcu_lock_map) ||
 			 lock_is_held(&rcu_sched_lock_map),
 			 "Illegal synchronize_sched() in RCU read-side critical section");
-	cond_resched();
 }
 EXPORT_SYMBOL_GPL(synchronize_sched);
 
diff --git a/kernel/rcu/tiny_plugin.h b/kernel/rcu/tiny_plugin.h
index 196f0302e2f4..c64b827ecbca 100644
--- a/kernel/rcu/tiny_plugin.h
+++ b/kernel/rcu/tiny_plugin.h
@@ -60,12 +60,17 @@ EXPORT_SYMBOL_GPL(rcu_scheduler_active);
 
 /*
  * During boot, we forgive RCU lockdep issues.  After this function is
- * invoked, we start taking RCU lockdep issues seriously.
+ * invoked, we start taking RCU lockdep issues seriously.  Note that unlike
+ * Tree RCU, Tiny RCU transitions directly from RCU_SCHEDULER_INACTIVE
+ * to RCU_SCHEDULER_RUNNING, skipping the RCU_SCHEDULER_INIT stage.
+ * The reason for this is that Tiny RCU does not need kthreads, so does
+ * not have to care about the fact that the scheduler is half-initialized
+ * at a certain phase of the boot process.
  */
 void __init rcu_scheduler_starting(void)
 {
 	WARN_ON(nr_context_switches() > 0);
-	rcu_scheduler_active = 1;
+	rcu_scheduler_active = RCU_SCHEDULER_RUNNING;
 }
 
 #endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 69a5611a7e7c..10f62c6f48e7 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -127,13 +127,16 @@ int rcu_num_nodes __read_mostly = NUM_RCU_NODES; /* Total # rcu_nodes in use. */
 int sysctl_panic_on_rcu_stall __read_mostly;
 
 /*
- * The rcu_scheduler_active variable transitions from zero to one just
- * before the first task is spawned.  So when this variable is zero, RCU
- * can assume that there is but one task, allowing RCU to (for example)
+ * The rcu_scheduler_active variable is initialized to the value
+ * RCU_SCHEDULER_INACTIVE and transitions RCU_SCHEDULER_INIT just before the
+ * first task is spawned.  So when this variable is RCU_SCHEDULER_INACTIVE,
+ * RCU can assume that there is but one task, allowing RCU to (for example)
  * optimize synchronize_rcu() to a simple barrier().  When this variable
- * is one, RCU must actually do all the hard work required to detect real
- * grace periods.  This variable is also used to suppress boot-time false
- * positives from lockdep-RCU error checking.
+ * is RCU_SCHEDULER_INIT, RCU must actually do all the hard work required
+ * to detect real grace periods.  This variable is also used to suppress
+ * boot-time false positives from lockdep-RCU error checking.  Finally, it
+ * transitions from RCU_SCHEDULER_INIT to RCU_SCHEDULER_RUNNING after RCU
+ * is fully initialized, including all of its kthreads having been spawned.
  */
 int rcu_scheduler_active __read_mostly;
 EXPORT_SYMBOL_GPL(rcu_scheduler_active);
@@ -3985,18 +3988,22 @@ static int __init rcu_spawn_gp_kthread(void)
 early_initcall(rcu_spawn_gp_kthread);
 
 /*
- * This function is invoked towards the end of the scheduler's initialization
- * process.  Before this is called, the idle task might contain
- * RCU read-side critical sections (during which time, this idle
- * task is booting the system).  After this function is called, the
- * idle tasks are prohibited from containing RCU read-side critical
- * sections.  This function also enables RCU lockdep checking.
+ * This function is invoked towards the end of the scheduler's
+ * initialization process.  Before this is called, the idle task might
+ * contain synchronous grace-period primitives (during which time, this idle
+ * task is booting the system, and such primitives are no-ops).  After this
+ * function is called, any synchronous grace-period primitives are run as
+ * expedited, with the requesting task driving the grace period forward.
+ * A later core_initcall() rcu_exp_runtime_mode() will switch to full
+ * runtime RCU functionality.
  */
 void rcu_scheduler_starting(void)
 {
 	WARN_ON(num_online_cpus() != 1);
 	WARN_ON(nr_context_switches() > 0);
-	rcu_scheduler_active = 1;
+	rcu_test_sync_prims();
+	rcu_scheduler_active = RCU_SCHEDULER_INIT;
+	rcu_test_sync_prims();
 }
 
 /*
diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h
index 24343eb87b58..78eba4120d46 100644
--- a/kernel/rcu/tree_exp.h
+++ b/kernel/rcu/tree_exp.h
@@ -522,18 +522,28 @@ struct rcu_exp_work {
 };
 
 /*
+ * Common code to drive an expedited grace period forward, used by
+ * workqueues and mid-boot-time tasks.
+ */
+static void rcu_exp_sel_wait_wake(struct rcu_state *rsp,
+				  smp_call_func_t func, unsigned long s)
+{
+	/* Initialize the rcu_node tree in preparation for the wait. */
+	sync_rcu_exp_select_cpus(rsp, func);
+
+	/* Wait and clean up, including waking everyone. */
+	rcu_exp_wait_wake(rsp, s);
+}
+
+/*
  * Work-queue handler to drive an expedited grace period forward.
  */
 static void wait_rcu_exp_gp(struct work_struct *wp)
 {
 	struct rcu_exp_work *rewp;
 
-	/* Initialize the rcu_node tree in preparation for the wait. */
 	rewp = container_of(wp, struct rcu_exp_work, rew_work);
-	sync_rcu_exp_select_cpus(rewp->rew_rsp, rewp->rew_func);
-
-	/* Wait and clean up, including waking everyone. */
-	rcu_exp_wait_wake(rewp->rew_rsp, rewp->rew_s);
+	rcu_exp_sel_wait_wake(rewp->rew_rsp, rewp->rew_func, rewp->rew_s);
 }
 
 /*
@@ -559,12 +569,18 @@ static void _synchronize_rcu_expedited(struct rcu_state *rsp,
 	if (exp_funnel_lock(rsp, s))
 		return;  /* Someone else did our work for us. */
 
-	/* Marshall arguments and schedule the expedited grace period. */
-	rew.rew_func = func;
-	rew.rew_rsp = rsp;
-	rew.rew_s = s;
-	INIT_WORK_ONSTACK(&rew.rew_work, wait_rcu_exp_gp);
-	schedule_work(&rew.rew_work);
+	/* Ensure that load happens before action based on it. */
+	if (unlikely(rcu_scheduler_active == RCU_SCHEDULER_INIT)) {
+		/* Direct call during scheduler init and early_initcalls(). */
+		rcu_exp_sel_wait_wake(rsp, func, s);
+	} else {
+		/* Marshall arguments & schedule the expedited grace period. */
+		rew.rew_func = func;
+		rew.rew_rsp = rsp;
+		rew.rew_s = s;
+		INIT_WORK_ONSTACK(&rew.rew_work, wait_rcu_exp_gp);
+		schedule_work(&rew.rew_work);
+	}
 
 	/* Wait for expedited grace period to complete. */
 	rdp = per_cpu_ptr(rsp->rda, raw_smp_processor_id());
@@ -666,6 +682,8 @@ void synchronize_rcu_expedited(void)
 {
 	struct rcu_state *rsp = rcu_state_p;
 
+	if (rcu_scheduler_active == RCU_SCHEDULER_INACTIVE)
+		return;
 	_synchronize_rcu_expedited(rsp, sync_rcu_exp_handler);
 }
 EXPORT_SYMBOL_GPL(synchronize_rcu_expedited);
@@ -683,3 +701,15 @@ void synchronize_rcu_expedited(void)
 EXPORT_SYMBOL_GPL(synchronize_rcu_expedited);
 
 #endif /* #else #ifdef CONFIG_PREEMPT_RCU */
+
+/*
+ * Switch to run-time mode once Tree RCU has fully initialized.
+ */
+static int __init rcu_exp_runtime_mode(void)
+{
+	rcu_test_sync_prims();
+	rcu_scheduler_active = RCU_SCHEDULER_RUNNING;
+	rcu_test_sync_prims();
+	return 0;
+}
+core_initcall(rcu_exp_runtime_mode);
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 85c5a883c6e3..56583e764ebf 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -670,7 +670,7 @@ void synchronize_rcu(void)
 			 lock_is_held(&rcu_lock_map) ||
 			 lock_is_held(&rcu_sched_lock_map),
 			 "Illegal synchronize_rcu() in RCU read-side critical section");
-	if (!rcu_scheduler_active)
+	if (rcu_scheduler_active == RCU_SCHEDULER_INACTIVE)
 		return;
 	if (rcu_gp_is_expedited())
 		synchronize_rcu_expedited();
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
index f19271dce0a9..4f6db7e6a117 100644
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
@@ -121,11 +121,14 @@ EXPORT_SYMBOL(rcu_read_lock_sched_held);
  * Should expedited grace-period primitives always fall back to their
  * non-expedited counterparts?  Intended for use within RCU.  Note
  * that if the user specifies both rcu_expedited and rcu_normal, then
- * rcu_normal wins.
+ * rcu_normal wins.  (Except during the time period during boot from
+ * when the first task is spawned until the rcu_exp_runtime_mode()
+ * core_initcall() is invoked, at which point everything is expedited.)
  */
 bool rcu_gp_is_normal(void)
 {
-	return READ_ONCE(rcu_normal);
+	return READ_ONCE(rcu_normal) &&
+	       rcu_scheduler_active != RCU_SCHEDULER_INIT;
 }
 EXPORT_SYMBOL_GPL(rcu_gp_is_normal);
 
@@ -135,13 +138,14 @@ static atomic_t rcu_expedited_nesting =
 /*
  * Should normal grace-period primitives be expedited?  Intended for
  * use within RCU.  Note that this function takes the rcu_expedited
- * sysfs/boot variable into account as well as the rcu_expedite_gp()
- * nesting.  So looping on rcu_unexpedite_gp() until rcu_gp_is_expedited()
- * returns false is a -really- bad idea.
+ * sysfs/boot variable and rcu_scheduler_active into account as well
+ * as the rcu_expedite_gp() nesting.  So looping on rcu_unexpedite_gp()
+ * until rcu_gp_is_expedited() returns false is a -really- bad idea.
  */
 bool rcu_gp_is_expedited(void)
 {
-	return rcu_expedited || atomic_read(&rcu_expedited_nesting);
+	return rcu_expedited || atomic_read(&rcu_expedited_nesting) ||
+	       rcu_scheduler_active == RCU_SCHEDULER_INIT;
 }
 EXPORT_SYMBOL_GPL(rcu_gp_is_expedited);
 
@@ -257,7 +261,7 @@ EXPORT_SYMBOL_GPL(rcu_callback_map);
 
 int notrace debug_lockdep_rcu_enabled(void)
 {
-	return rcu_scheduler_active && debug_locks &&
+	return rcu_scheduler_active != RCU_SCHEDULER_INACTIVE && debug_locks &&
 	       current->lockdep_recursion == 0;
 }
 EXPORT_SYMBOL_GPL(debug_lockdep_rcu_enabled);
@@ -591,7 +595,7 @@ EXPORT_SYMBOL_GPL(call_rcu_tasks);
 void synchronize_rcu_tasks(void)
 {
 	/* Complain if the scheduler has not started.  */
-	RCU_LOCKDEP_WARN(!rcu_scheduler_active,
+	RCU_LOCKDEP_WARN(rcu_scheduler_active == RCU_SCHEDULER_INACTIVE,
 			 "synchronize_rcu_tasks called too soon");
 
 	/* Wait for the grace period. */
@@ -813,6 +817,23 @@ static void rcu_spawn_tasks_kthread(void)
 
 #endif /* #ifdef CONFIG_TASKS_RCU */
 
+/*
+ * Test each non-SRCU synchronous grace-period wait API.  This is
+ * useful just after a change in mode for these primitives, and
+ * during early boot.
+ */
+void rcu_test_sync_prims(void)
+{
+	if (!IS_ENABLED(CONFIG_PROVE_RCU))
+		return;
+	synchronize_rcu();
+	synchronize_rcu_bh();
+	synchronize_sched();
+	synchronize_rcu_expedited();
+	synchronize_rcu_bh_expedited();
+	synchronize_sched_expedited();
+}
+
 #ifdef CONFIG_PROVE_RCU
 
 /*
@@ -865,6 +886,7 @@ void rcu_early_boot_tests(void)
 		early_boot_test_call_rcu_bh();
 	if (rcu_self_test_sched)
 		early_boot_test_call_rcu_sched();
+	rcu_test_sync_prims();
 }
 
 static int rcu_verify_early_boot_tests(void)
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 22e13a0e19d7..ad1d2962d129 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -53,7 +53,7 @@
  */
 #define IO_TLB_MIN_SLABS ((1<<20) >> IO_TLB_SHIFT)
 
-int swiotlb_force;
+enum swiotlb_force swiotlb_force;
 
 /*
  * Used to do a quick range check in swiotlb_tbl_unmap_single and
@@ -106,8 +106,12 @@ setup_io_tlb_npages(char *str)
 	}
 	if (*str == ',')
 		++str;
-	if (!strcmp(str, "force"))
-		swiotlb_force = 1;
+	if (!strcmp(str, "force")) {
+		swiotlb_force = SWIOTLB_FORCE;
+	} else if (!strcmp(str, "noforce")) {
+		swiotlb_force = SWIOTLB_NO_FORCE;
+		io_tlb_nslabs = 1;
+	}
 
 	return 0;
 }
@@ -541,8 +545,15 @@ static phys_addr_t
 map_single(struct device *hwdev, phys_addr_t phys, size_t size,
 	   enum dma_data_direction dir)
 {
-	dma_addr_t start_dma_addr = phys_to_dma(hwdev, io_tlb_start);
+	dma_addr_t start_dma_addr;
+
+	if (swiotlb_force == SWIOTLB_NO_FORCE) {
+		dev_warn_ratelimited(hwdev, "Cannot do DMA to address %pa\n",
+				     &phys);
+		return SWIOTLB_MAP_ERROR;
+	}
 
+	start_dma_addr = phys_to_dma(hwdev, io_tlb_start);
 	return swiotlb_tbl_map_single(hwdev, start_dma_addr, phys, size, dir);
 }
 
@@ -707,6 +718,9 @@ static void
 swiotlb_full(struct device *dev, size_t size, enum dma_data_direction dir,
 	     int do_panic)
 {
+	if (swiotlb_force == SWIOTLB_NO_FORCE)
+		return;
+
 	/*
 	 * Ran out of IOMMU space for this operation. This is very bad.
 	 * Unfortunately the drivers cannot handle this operation properly.
@@ -749,7 +763,7 @@ dma_addr_t swiotlb_map_page(struct device *dev, struct page *page,
 	 * we can safely return the device addr and not worry about bounce
 	 * buffering it.
 	 */
-	if (dma_capable(dev, dev_addr, size) && !swiotlb_force)
+	if (dma_capable(dev, dev_addr, size) && swiotlb_force != SWIOTLB_FORCE)
 		return dev_addr;
 
 	trace_swiotlb_bounced(dev, dev_addr, size, swiotlb_force);
@@ -888,7 +902,7 @@ swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems,
 		phys_addr_t paddr = sg_phys(sg);
 		dma_addr_t dev_addr = phys_to_dma(hwdev, paddr);
 
-		if (swiotlb_force ||
+		if (swiotlb_force == SWIOTLB_FORCE ||
 		    !dma_capable(hwdev, dev_addr, sg->length)) {
 			phys_addr_t map = map_single(hwdev, sg_phys(sg),
 						     sg->length, dir);
diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c
index a0905f04bd13..b216131915e7 100644
--- a/net/ceph/auth_x.c
+++ b/net/ceph/auth_x.c
@@ -39,56 +39,58 @@ static int ceph_x_should_authenticate(struct ceph_auth_client *ac)
 	return need != 0;
 }
 
+static int ceph_x_encrypt_offset(void)
+{
+	return sizeof(u32) + sizeof(struct ceph_x_encrypt_header);
+}
+
 static int ceph_x_encrypt_buflen(int ilen)
 {
-	return sizeof(struct ceph_x_encrypt_header) + ilen + 16 +
-		sizeof(u32);
+	return ceph_x_encrypt_offset() + ilen + 16;
 }
 
-static int ceph_x_encrypt(struct ceph_crypto_key *secret,
-			  void *ibuf, int ilen, void *obuf, size_t olen)
+static int ceph_x_encrypt(struct ceph_crypto_key *secret, void *buf,
+			  int buf_len, int plaintext_len)
 {
-	struct ceph_x_encrypt_header head = {
-		.struct_v = 1,
-		.magic = cpu_to_le64(CEPHX_ENC_MAGIC)
-	};
-	size_t len = olen - sizeof(u32);
+	struct ceph_x_encrypt_header *hdr = buf + sizeof(u32);
+	int ciphertext_len;
 	int ret;
 
-	ret = ceph_encrypt2(secret, obuf + sizeof(u32), &len,
-			    &head, sizeof(head), ibuf, ilen);
+	hdr->struct_v = 1;
+	hdr->magic = cpu_to_le64(CEPHX_ENC_MAGIC);
+
+	ret = ceph_crypt(secret, true, buf + sizeof(u32), buf_len - sizeof(u32),
+			 plaintext_len + sizeof(struct ceph_x_encrypt_header),
+			 &ciphertext_len);
 	if (ret)
 		return ret;
-	ceph_encode_32(&obuf, len);
-	return len + sizeof(u32);
+
+	ceph_encode_32(&buf, ciphertext_len);
+	return sizeof(u32) + ciphertext_len;
 }
 
-static int ceph_x_decrypt(struct ceph_crypto_key *secret,
-			  void **p, void *end, void **obuf, size_t olen)
+static int ceph_x_decrypt(struct ceph_crypto_key *secret, void **p, void *end)
 {
-	struct ceph_x_encrypt_header head;
-	size_t head_len = sizeof(head);
-	int len, ret;
-
-	len = ceph_decode_32(p);
-	if (*p + len > end)
-		return -EINVAL;
+	struct ceph_x_encrypt_header *hdr = *p + sizeof(u32);
+	int ciphertext_len, plaintext_len;
+	int ret;
 
-	dout("ceph_x_decrypt len %d\n", len);
-	if (*obuf == NULL) {
-		*obuf = kmalloc(len, GFP_NOFS);
-		if (!*obuf)
-			return -ENOMEM;
-		olen = len;
-	}
+	ceph_decode_32_safe(p, end, ciphertext_len, e_inval);
+	ceph_decode_need(p, end, ciphertext_len, e_inval);
 
-	ret = ceph_decrypt2(secret, &head, &head_len, *obuf, &olen, *p, len);
+	ret = ceph_crypt(secret, false, *p, end - *p, ciphertext_len,
+			 &plaintext_len);
 	if (ret)
 		return ret;
-	if (head.struct_v != 1 || le64_to_cpu(head.magic) != CEPHX_ENC_MAGIC)
+
+	if (hdr->struct_v != 1 || le64_to_cpu(hdr->magic) != CEPHX_ENC_MAGIC)
 		return -EPERM;
-	*p += len;
-	return olen;
+
+	*p += ciphertext_len;
+	return plaintext_len - sizeof(struct ceph_x_encrypt_header);
+
+e_inval:
+	return -EINVAL;
 }
 
 /*
@@ -143,13 +145,10 @@ static int process_one_ticket(struct ceph_auth_client *ac,
 	int type;
 	u8 tkt_struct_v, blob_struct_v;
 	struct ceph_x_ticket_handler *th;
-	void *dbuf = NULL;
 	void *dp, *dend;
 	int dlen;
 	char is_enc;
 	struct timespec validity;
-	struct ceph_crypto_key old_key;
-	void *ticket_buf = NULL;
 	void *tp, *tpend;
 	void **ptp;
 	struct ceph_crypto_key new_session_key;
@@ -174,20 +173,17 @@ static int process_one_ticket(struct ceph_auth_client *ac,
 	}
 
 	/* blob for me */
-	dlen = ceph_x_decrypt(secret, p, end, &dbuf, 0);
-	if (dlen <= 0) {
-		ret = dlen;
+	dp = *p + ceph_x_encrypt_offset();
+	ret = ceph_x_decrypt(secret, p, end);
+	if (ret < 0)
 		goto out;
-	}
-	dout(" decrypted %d bytes\n", dlen);
-	dp = dbuf;
-	dend = dp + dlen;
+	dout(" decrypted %d bytes\n", ret);
+	dend = dp + ret;
 
 	tkt_struct_v = ceph_decode_8(&dp);
 	if (tkt_struct_v != 1)
 		goto bad;
 
-	memcpy(&old_key, &th->session_key, sizeof(old_key));
 	ret = ceph_crypto_key_decode(&new_session_key, &dp, dend);
 	if (ret)
 		goto out;
@@ -203,15 +199,13 @@ static int process_one_ticket(struct ceph_auth_client *ac,
 	ceph_decode_8_safe(p, end, is_enc, bad);
 	if (is_enc) {
 		/* encrypted */
-		dout(" encrypted ticket\n");
-		dlen = ceph_x_decrypt(&old_key, p, end, &ticket_buf, 0);
-		if (dlen < 0) {
-			ret = dlen;
+		tp = *p + ceph_x_encrypt_offset();
+		ret = ceph_x_decrypt(&th->session_key, p, end);
+		if (ret < 0)
 			goto out;
-		}
-		tp = ticket_buf;
+		dout(" encrypted ticket, decrypted %d bytes\n", ret);
 		ptp = &tp;
-		tpend = *ptp + dlen;
+		tpend = tp + ret;
 	} else {
 		/* unencrypted */
 		ptp = p;
@@ -242,8 +236,6 @@ static int process_one_ticket(struct ceph_auth_client *ac,
 	xi->have_keys |= th->service;
 
 out:
-	kfree(ticket_buf);
-	kfree(dbuf);
 	return ret;
 
 bad:
@@ -294,7 +286,7 @@ static int ceph_x_build_authorizer(struct ceph_auth_client *ac,
 {
 	int maxlen;
 	struct ceph_x_authorize_a *msg_a;
-	struct ceph_x_authorize_b msg_b;
+	struct ceph_x_authorize_b *msg_b;
 	void *p, *end;
 	int ret;
 	int ticket_blob_len =
@@ -308,8 +300,8 @@ static int ceph_x_build_authorizer(struct ceph_auth_client *ac,
 	if (ret)
 		goto out_au;
 
-	maxlen = sizeof(*msg_a) + sizeof(msg_b) +
-		ceph_x_encrypt_buflen(ticket_blob_len);
+	maxlen = sizeof(*msg_a) + ticket_blob_len +
+		ceph_x_encrypt_buflen(sizeof(*msg_b));
 	dout("  need len %d\n", maxlen);
 	if (au->buf && au->buf->alloc_len < maxlen) {
 		ceph_buffer_put(au->buf);
@@ -343,18 +335,19 @@ static int ceph_x_build_authorizer(struct ceph_auth_client *ac,
 	p += ticket_blob_len;
 	end = au->buf->vec.iov_base + au->buf->vec.iov_len;
 
+	msg_b = p + ceph_x_encrypt_offset();
+	msg_b->struct_v = 1;
 	get_random_bytes(&au->nonce, sizeof(au->nonce));
-	msg_b.struct_v = 1;
-	msg_b.nonce = cpu_to_le64(au->nonce);
-	ret = ceph_x_encrypt(&au->session_key, &msg_b, sizeof(msg_b),
-			     p, end - p);
+	msg_b->nonce = cpu_to_le64(au->nonce);
+	ret = ceph_x_encrypt(&au->session_key, p, end - p, sizeof(*msg_b));
 	if (ret < 0)
 		goto out_au;
+
 	p += ret;
+	WARN_ON(p > end);
 	au->buf->vec.iov_len = p - au->buf->vec.iov_base;
 	dout(" built authorizer nonce %llx len %d\n", au->nonce,
 	     (int)au->buf->vec.iov_len);
-	BUG_ON(au->buf->vec.iov_len > maxlen);
 	return 0;
 
 out_au:
@@ -452,8 +445,9 @@ static int ceph_x_build_request(struct ceph_auth_client *ac,
 	if (need & CEPH_ENTITY_TYPE_AUTH) {
 		struct ceph_x_authenticate *auth = (void *)(head + 1);
 		void *p = auth + 1;
-		struct ceph_x_challenge_blob tmp;
-		char tmp_enc[40];
+		void *enc_buf = xi->auth_authorizer.enc_buf;
+		struct ceph_x_challenge_blob *blob = enc_buf +
+							ceph_x_encrypt_offset();
 		u64 *u;
 
 		if (p > end)
@@ -464,16 +458,16 @@ static int ceph_x_build_request(struct ceph_auth_client *ac,
 
 		/* encrypt and hash */
 		get_random_bytes(&auth->client_challenge, sizeof(u64));
-		tmp.client_challenge = auth->client_challenge;
-		tmp.server_challenge = cpu_to_le64(xi->server_challenge);
-		ret = ceph_x_encrypt(&xi->secret, &tmp, sizeof(tmp),
-				     tmp_enc, sizeof(tmp_enc));
+		blob->client_challenge = auth->client_challenge;
+		blob->server_challenge = cpu_to_le64(xi->server_challenge);
+		ret = ceph_x_encrypt(&xi->secret, enc_buf, CEPHX_AU_ENC_BUF_LEN,
+				     sizeof(*blob));
 		if (ret < 0)
 			return ret;
 
 		auth->struct_v = 1;
 		auth->key = 0;
-		for (u = (u64 *)tmp_enc; u + 1 <= (u64 *)(tmp_enc + ret); u++)
+		for (u = (u64 *)enc_buf; u + 1 <= (u64 *)(enc_buf + ret); u++)
 			auth->key ^= *(__le64 *)u;
 		dout(" server_challenge %llx client_challenge %llx key %llx\n",
 		     xi->server_challenge, le64_to_cpu(auth->client_challenge),
@@ -600,8 +594,8 @@ static int ceph_x_create_authorizer(
 	auth->authorizer = (struct ceph_authorizer *) au;
 	auth->authorizer_buf = au->buf->vec.iov_base;
 	auth->authorizer_buf_len = au->buf->vec.iov_len;
-	auth->authorizer_reply_buf = au->reply_buf;
-	auth->authorizer_reply_buf_len = sizeof (au->reply_buf);
+	auth->authorizer_reply_buf = au->enc_buf;
+	auth->authorizer_reply_buf_len = CEPHX_AU_ENC_BUF_LEN;
 	auth->sign_message = ac->ops->sign_message;
 	auth->check_message_signature = ac->ops->check_message_signature;
 
@@ -632,24 +626,22 @@ static int ceph_x_verify_authorizer_reply(struct ceph_auth_client *ac,
 					  struct ceph_authorizer *a, size_t len)
 {
 	struct ceph_x_authorizer *au = (void *)a;
-	int ret = 0;
-	struct ceph_x_authorize_reply reply;
-	void *preply = &reply;
-	void *p = au->reply_buf;
-	void *end = p + sizeof(au->reply_buf);
+	void *p = au->enc_buf;
+	struct ceph_x_authorize_reply *reply = p + ceph_x_encrypt_offset();
+	int ret;
 
-	ret = ceph_x_decrypt(&au->session_key, &p, end, &preply, sizeof(reply));
+	ret = ceph_x_decrypt(&au->session_key, &p, p + CEPHX_AU_ENC_BUF_LEN);
 	if (ret < 0)
 		return ret;
-	if (ret != sizeof(reply))
+	if (ret != sizeof(*reply))
 		return -EPERM;
 
-	if (au->nonce + 1 != le64_to_cpu(reply.nonce_plus_one))
+	if (au->nonce + 1 != le64_to_cpu(reply->nonce_plus_one))
 		ret = -EPERM;
 	else
 		ret = 0;
 	dout("verify_authorizer_reply nonce %llx got %llx ret %d\n",
-	     au->nonce, le64_to_cpu(reply.nonce_plus_one), ret);
+	     au->nonce, le64_to_cpu(reply->nonce_plus_one), ret);
 	return ret;
 }
 
@@ -704,35 +696,48 @@ static void ceph_x_invalidate_authorizer(struct ceph_auth_client *ac,
 	invalidate_ticket(ac, CEPH_ENTITY_TYPE_AUTH);
 }
 
-static int calcu_signature(struct ceph_x_authorizer *au,
-			   struct ceph_msg *msg, __le64 *sig)
+static int calc_signature(struct ceph_x_authorizer *au, struct ceph_msg *msg,
+			  __le64 *psig)
 {
+	void *enc_buf = au->enc_buf;
+	struct {
+		__le32 len;
+		__le32 header_crc;
+		__le32 front_crc;
+		__le32 middle_crc;
+		__le32 data_crc;
+	} __packed *sigblock = enc_buf + ceph_x_encrypt_offset();
 	int ret;
-	char tmp_enc[40];
-	__le32 tmp[5] = {
-		cpu_to_le32(16), msg->hdr.crc, msg->footer.front_crc,
-		msg->footer.middle_crc, msg->footer.data_crc,
-	};
-	ret = ceph_x_encrypt(&au->session_key, &tmp, sizeof(tmp),
-			     tmp_enc, sizeof(tmp_enc));
+
+	sigblock->len = cpu_to_le32(4*sizeof(u32));
+	sigblock->header_crc = msg->hdr.crc;
+	sigblock->front_crc = msg->footer.front_crc;
+	sigblock->middle_crc = msg->footer.middle_crc;
+	sigblock->data_crc =  msg->footer.data_crc;
+	ret = ceph_x_encrypt(&au->session_key, enc_buf, CEPHX_AU_ENC_BUF_LEN,
+			     sizeof(*sigblock));
 	if (ret < 0)
 		return ret;
-	*sig = *(__le64*)(tmp_enc + 4);
+
+	*psig = *(__le64 *)(enc_buf + sizeof(u32));
 	return 0;
 }
 
 static int ceph_x_sign_message(struct ceph_auth_handshake *auth,
 			       struct ceph_msg *msg)
 {
+	__le64 sig;
 	int ret;
 
 	if (ceph_test_opt(from_msgr(msg->con->msgr), NOMSGSIGN))
 		return 0;
 
-	ret = calcu_signature((struct ceph_x_authorizer *)auth->authorizer,
-			      msg, &msg->footer.sig);
-	if (ret < 0)
+	ret = calc_signature((struct ceph_x_authorizer *)auth->authorizer,
+			     msg, &sig);
+	if (ret)
 		return ret;
+
+	msg->footer.sig = sig;
 	msg->footer.flags |= CEPH_MSG_FOOTER_SIGNED;
 	return 0;
 }
@@ -746,9 +751,9 @@ static int ceph_x_check_message_signature(struct ceph_auth_handshake *auth,
 	if (ceph_test_opt(from_msgr(msg->con->msgr), NOMSGSIGN))
 		return 0;
 
-	ret = calcu_signature((struct ceph_x_authorizer *)auth->authorizer,
-			      msg, &sig_check);
-	if (ret < 0)
+	ret = calc_signature((struct ceph_x_authorizer *)auth->authorizer,
+			     msg, &sig_check);
+	if (ret)
 		return ret;
 	if (sig_check == msg->footer.sig)
 		return 0;
diff --git a/net/ceph/auth_x.h b/net/ceph/auth_x.h
index 21a5af904bae..48e9ad41bd2a 100644
--- a/net/ceph/auth_x.h
+++ b/net/ceph/auth_x.h
@@ -24,6 +24,7 @@ struct ceph_x_ticket_handler {
 	unsigned long renew_after, expires;
 };
 
+#define CEPHX_AU_ENC_BUF_LEN	128  /* big enough for encrypted blob */
 
 struct ceph_x_authorizer {
 	struct ceph_authorizer base;
@@ -32,7 +33,7 @@ struct ceph_x_authorizer {
 	unsigned int service;
 	u64 nonce;
 	u64 secret_id;
-	char reply_buf[128];  /* big enough for encrypted blob */
+	char enc_buf[CEPHX_AU_ENC_BUF_LEN] __aligned(8);
 };
 
 struct ceph_x_info {
diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c
index db2847ac5f12..292e33bd916e 100644
--- a/net/ceph/crypto.c
+++ b/net/ceph/crypto.c
@@ -13,14 +13,60 @@
 #include <linux/ceph/decode.h>
 #include "crypto.h"
 
+/*
+ * Set ->key and ->tfm.  The rest of the key should be filled in before
+ * this function is called.
+ */
+static int set_secret(struct ceph_crypto_key *key, void *buf)
+{
+	unsigned int noio_flag;
+	int ret;
+
+	key->key = NULL;
+	key->tfm = NULL;
+
+	switch (key->type) {
+	case CEPH_CRYPTO_NONE:
+		return 0; /* nothing to do */
+	case CEPH_CRYPTO_AES:
+		break;
+	default:
+		return -ENOTSUPP;
+	}
+
+	WARN_ON(!key->len);
+	key->key = kmemdup(buf, key->len, GFP_NOIO);
+	if (!key->key) {
+		ret = -ENOMEM;
+		goto fail;
+	}
+
+	/* crypto_alloc_skcipher() allocates with GFP_KERNEL */
+	noio_flag = memalloc_noio_save();
+	key->tfm = crypto_alloc_skcipher("cbc(aes)", 0, CRYPTO_ALG_ASYNC);
+	memalloc_noio_restore(noio_flag);
+	if (IS_ERR(key->tfm)) {
+		ret = PTR_ERR(key->tfm);
+		key->tfm = NULL;
+		goto fail;
+	}
+
+	ret = crypto_skcipher_setkey(key->tfm, key->key, key->len);
+	if (ret)
+		goto fail;
+
+	return 0;
+
+fail:
+	ceph_crypto_key_destroy(key);
+	return ret;
+}
+
 int ceph_crypto_key_clone(struct ceph_crypto_key *dst,
 			  const struct ceph_crypto_key *src)
 {
 	memcpy(dst, src, sizeof(struct ceph_crypto_key));
-	dst->key = kmemdup(src->key, src->len, GFP_NOFS);
-	if (!dst->key)
-		return -ENOMEM;
-	return 0;
+	return set_secret(dst, src->key);
 }
 
 int ceph_crypto_key_encode(struct ceph_crypto_key *key, void **p, void *end)
@@ -37,16 +83,16 @@ int ceph_crypto_key_encode(struct ceph_crypto_key *key, void **p, void *end)
 
 int ceph_crypto_key_decode(struct ceph_crypto_key *key, void **p, void *end)
 {
+	int ret;
+
 	ceph_decode_need(p, end, 2*sizeof(u16) + sizeof(key->created), bad);
 	key->type = ceph_decode_16(p);
 	ceph_decode_copy(p, &key->created, sizeof(key->created));
 	key->len = ceph_decode_16(p);
 	ceph_decode_need(p, end, key->len, bad);
-	key->key = kmalloc(key->len, GFP_NOFS);
-	if (!key->key)
-		return -ENOMEM;
-	ceph_decode_copy(p, key->key, key->len);
-	return 0;
+	ret = set_secret(key, *p);
+	*p += key->len;
+	return ret;
 
 bad:
 	dout("failed to decode crypto key\n");
@@ -80,9 +126,14 @@ int ceph_crypto_key_unarmor(struct ceph_crypto_key *key, const char *inkey)
 	return 0;
 }
 
-static struct crypto_skcipher *ceph_crypto_alloc_cipher(void)
+void ceph_crypto_key_destroy(struct ceph_crypto_key *key)
 {
-	return crypto_alloc_skcipher("cbc(aes)", 0, CRYPTO_ALG_ASYNC);
+	if (key) {
+		kfree(key->key);
+		key->key = NULL;
+		crypto_free_skcipher(key->tfm);
+		key->tfm = NULL;
+	}
 }
 
 static const u8 *aes_iv = (u8 *)CEPH_AES_IV;
@@ -157,372 +208,82 @@ static void teardown_sgtable(struct sg_table *sgt)
 		sg_free_table(sgt);
 }
 
-static int ceph_aes_encrypt(const void *key, int key_len,
-			    void *dst, size_t *dst_len,
-			    const void *src, size_t src_len)
-{
-	struct scatterlist sg_in[2], prealloc_sg;
-	struct sg_table sg_out;
-	struct crypto_skcipher *tfm = ceph_crypto_alloc_cipher();
-	SKCIPHER_REQUEST_ON_STACK(req, tfm);
-	int ret;
-	char iv[AES_BLOCK_SIZE];
-	size_t zero_padding = (0x10 - (src_len & 0x0f));
-	char pad[16];
-
-	if (IS_ERR(tfm))
-		return PTR_ERR(tfm);
-
-	memset(pad, zero_padding, zero_padding);
-
-	*dst_len = src_len + zero_padding;
-
-	sg_init_table(sg_in, 2);
-	sg_set_buf(&sg_in[0], src, src_len);
-	sg_set_buf(&sg_in[1], pad, zero_padding);
-	ret = setup_sgtable(&sg_out, &prealloc_sg, dst, *dst_len);
-	if (ret)
-		goto out_tfm;
-
-	crypto_skcipher_setkey((void *)tfm, key, key_len);
-	memcpy(iv, aes_iv, AES_BLOCK_SIZE);
-
-	skcipher_request_set_tfm(req, tfm);
-	skcipher_request_set_callback(req, 0, NULL, NULL);
-	skcipher_request_set_crypt(req, sg_in, sg_out.sgl,
-				   src_len + zero_padding, iv);
-
-	/*
-	print_hex_dump(KERN_ERR, "enc key: ", DUMP_PREFIX_NONE, 16, 1,
-		       key, key_len, 1);
-	print_hex_dump(KERN_ERR, "enc src: ", DUMP_PREFIX_NONE, 16, 1,
-			src, src_len, 1);
-	print_hex_dump(KERN_ERR, "enc pad: ", DUMP_PREFIX_NONE, 16, 1,
-			pad, zero_padding, 1);
-	*/
-	ret = crypto_skcipher_encrypt(req);
-	skcipher_request_zero(req);
-	if (ret < 0) {
-		pr_err("ceph_aes_crypt failed %d\n", ret);
-		goto out_sg;
-	}
-	/*
-	print_hex_dump(KERN_ERR, "enc out: ", DUMP_PREFIX_NONE, 16, 1,
-		       dst, *dst_len, 1);
-	*/
-
-out_sg:
-	teardown_sgtable(&sg_out);
-out_tfm:
-	crypto_free_skcipher(tfm);
-	return ret;
-}
-
-static int ceph_aes_encrypt2(const void *key, int key_len, void *dst,
-			     size_t *dst_len,
-			     const void *src1, size_t src1_len,
-			     const void *src2, size_t src2_len)
-{
-	struct scatterlist sg_in[3], prealloc_sg;
-	struct sg_table sg_out;
-	struct crypto_skcipher *tfm = ceph_crypto_alloc_cipher();
-	SKCIPHER_REQUEST_ON_STACK(req, tfm);
-	int ret;
-	char iv[AES_BLOCK_SIZE];
-	size_t zero_padding = (0x10 - ((src1_len + src2_len) & 0x0f));
-	char pad[16];
-
-	if (IS_ERR(tfm))
-		return PTR_ERR(tfm);
-
-	memset(pad, zero_padding, zero_padding);
-
-	*dst_len = src1_len + src2_len + zero_padding;
-
-	sg_init_table(sg_in, 3);
-	sg_set_buf(&sg_in[0], src1, src1_len);
-	sg_set_buf(&sg_in[1], src2, src2_len);
-	sg_set_buf(&sg_in[2], pad, zero_padding);
-	ret = setup_sgtable(&sg_out, &prealloc_sg, dst, *dst_len);
-	if (ret)
-		goto out_tfm;
-
-	crypto_skcipher_setkey((void *)tfm, key, key_len);
-	memcpy(iv, aes_iv, AES_BLOCK_SIZE);
-
-	skcipher_request_set_tfm(req, tfm);
-	skcipher_request_set_callback(req, 0, NULL, NULL);
-	skcipher_request_set_crypt(req, sg_in, sg_out.sgl,
-				   src1_len + src2_len + zero_padding, iv);
-
-	/*
-	print_hex_dump(KERN_ERR, "enc  key: ", DUMP_PREFIX_NONE, 16, 1,
-		       key, key_len, 1);
-	print_hex_dump(KERN_ERR, "enc src1: ", DUMP_PREFIX_NONE, 16, 1,
-			src1, src1_len, 1);
-	print_hex_dump(KERN_ERR, "enc src2: ", DUMP_PREFIX_NONE, 16, 1,
-			src2, src2_len, 1);
-	print_hex_dump(KERN_ERR, "enc  pad: ", DUMP_PREFIX_NONE, 16, 1,
-			pad, zero_padding, 1);
-	*/
-	ret = crypto_skcipher_encrypt(req);
-	skcipher_request_zero(req);
-	if (ret < 0) {
-		pr_err("ceph_aes_crypt2 failed %d\n", ret);
-		goto out_sg;
-	}
-	/*
-	print_hex_dump(KERN_ERR, "enc  out: ", DUMP_PREFIX_NONE, 16, 1,
-		       dst, *dst_len, 1);
-	*/
-
-out_sg:
-	teardown_sgtable(&sg_out);
-out_tfm:
-	crypto_free_skcipher(tfm);
-	return ret;
-}
-
-static int ceph_aes_decrypt(const void *key, int key_len,
-			    void *dst, size_t *dst_len,
-			    const void *src, size_t src_len)
+static int ceph_aes_crypt(const struct ceph_crypto_key *key, bool encrypt,
+			  void *buf, int buf_len, int in_len, int *pout_len)
 {
-	struct sg_table sg_in;
-	struct scatterlist sg_out[2], prealloc_sg;
-	struct crypto_skcipher *tfm = ceph_crypto_alloc_cipher();
-	SKCIPHER_REQUEST_ON_STACK(req, tfm);
-	char pad[16];
-	char iv[AES_BLOCK_SIZE];
+	SKCIPHER_REQUEST_ON_STACK(req, key->tfm);
+	struct sg_table sgt;
+	struct scatterlist prealloc_sg;
+	char iv[AES_BLOCK_SIZE] __aligned(8);
+	int pad_byte = AES_BLOCK_SIZE - (in_len & (AES_BLOCK_SIZE - 1));
+	int crypt_len = encrypt ? in_len + pad_byte : in_len;
 	int ret;
-	int last_byte;
-
-	if (IS_ERR(tfm))
-		return PTR_ERR(tfm);
 
-	sg_init_table(sg_out, 2);
-	sg_set_buf(&sg_out[0], dst, *dst_len);
-	sg_set_buf(&sg_out[1], pad, sizeof(pad));
-	ret = setup_sgtable(&sg_in, &prealloc_sg, src, src_len);
+	WARN_ON(crypt_len > buf_len);
+	if (encrypt)
+		memset(buf + in_len, pad_byte, pad_byte);
+	ret = setup_sgtable(&sgt, &prealloc_sg, buf, crypt_len);
 	if (ret)
-		goto out_tfm;
+		return ret;
 
-	crypto_skcipher_setkey((void *)tfm, key, key_len);
 	memcpy(iv, aes_iv, AES_BLOCK_SIZE);
-
-	skcipher_request_set_tfm(req, tfm);
+	skcipher_request_set_tfm(req, key->tfm);
 	skcipher_request_set_callback(req, 0, NULL, NULL);
-	skcipher_request_set_crypt(req, sg_in.sgl, sg_out,
-				   src_len, iv);
+	skcipher_request_set_crypt(req, sgt.sgl, sgt.sgl, crypt_len, iv);
 
 	/*
-	print_hex_dump(KERN_ERR, "dec key: ", DUMP_PREFIX_NONE, 16, 1,
-		       key, key_len, 1);
-	print_hex_dump(KERN_ERR, "dec  in: ", DUMP_PREFIX_NONE, 16, 1,
-		       src, src_len, 1);
+	print_hex_dump(KERN_ERR, "key: ", DUMP_PREFIX_NONE, 16, 1,
+		       key->key, key->len, 1);
+	print_hex_dump(KERN_ERR, " in: ", DUMP_PREFIX_NONE, 16, 1,
+		       buf, crypt_len, 1);
 	*/
-	ret = crypto_skcipher_decrypt(req);
-	skcipher_request_zero(req);
-	if (ret < 0) {
-		pr_err("ceph_aes_decrypt failed %d\n", ret);
-		goto out_sg;
-	}
-
-	if (src_len <= *dst_len)
-		last_byte = ((char *)dst)[src_len - 1];
+	if (encrypt)
+		ret = crypto_skcipher_encrypt(req);
 	else
-		last_byte = pad[src_len - *dst_len - 1];
-	if (last_byte <= 16 && src_len >= last_byte) {
-		*dst_len = src_len - last_byte;
-	} else {
-		pr_err("ceph_aes_decrypt got bad padding %d on src len %d\n",
-		       last_byte, (int)src_len);
-		return -EPERM;  /* bad padding */
-	}
-	/*
-	print_hex_dump(KERN_ERR, "dec out: ", DUMP_PREFIX_NONE, 16, 1,
-		       dst, *dst_len, 1);
-	*/
-
-out_sg:
-	teardown_sgtable(&sg_in);
-out_tfm:
-	crypto_free_skcipher(tfm);
-	return ret;
-}
-
-static int ceph_aes_decrypt2(const void *key, int key_len,
-			     void *dst1, size_t *dst1_len,
-			     void *dst2, size_t *dst2_len,
-			     const void *src, size_t src_len)
-{
-	struct sg_table sg_in;
-	struct scatterlist sg_out[3], prealloc_sg;
-	struct crypto_skcipher *tfm = ceph_crypto_alloc_cipher();
-	SKCIPHER_REQUEST_ON_STACK(req, tfm);
-	char pad[16];
-	char iv[AES_BLOCK_SIZE];
-	int ret;
-	int last_byte;
-
-	if (IS_ERR(tfm))
-		return PTR_ERR(tfm);
-
-	sg_init_table(sg_out, 3);
-	sg_set_buf(&sg_out[0], dst1, *dst1_len);
-	sg_set_buf(&sg_out[1], dst2, *dst2_len);
-	sg_set_buf(&sg_out[2], pad, sizeof(pad));
-	ret = setup_sgtable(&sg_in, &prealloc_sg, src, src_len);
-	if (ret)
-		goto out_tfm;
-
-	crypto_skcipher_setkey((void *)tfm, key, key_len);
-	memcpy(iv, aes_iv, AES_BLOCK_SIZE);
-
-	skcipher_request_set_tfm(req, tfm);
-	skcipher_request_set_callback(req, 0, NULL, NULL);
-	skcipher_request_set_crypt(req, sg_in.sgl, sg_out,
-				   src_len, iv);
-
-	/*
-	print_hex_dump(KERN_ERR, "dec  key: ", DUMP_PREFIX_NONE, 16, 1,
-		       key, key_len, 1);
-	print_hex_dump(KERN_ERR, "dec   in: ", DUMP_PREFIX_NONE, 16, 1,
-		       src, src_len, 1);
-	*/
-	ret = crypto_skcipher_decrypt(req);
+		ret = crypto_skcipher_decrypt(req);
 	skcipher_request_zero(req);
-	if (ret < 0) {
-		pr_err("ceph_aes_decrypt failed %d\n", ret);
-		goto out_sg;
-	}
-
-	if (src_len <= *dst1_len)
-		last_byte = ((char *)dst1)[src_len - 1];
-	else if (src_len <= *dst1_len + *dst2_len)
-		last_byte = ((char *)dst2)[src_len - *dst1_len - 1];
-	else
-		last_byte = pad[src_len - *dst1_len - *dst2_len - 1];
-	if (last_byte <= 16 && src_len >= last_byte) {
-		src_len -= last_byte;
-	} else {
-		pr_err("ceph_aes_decrypt got bad padding %d on src len %d\n",
-		       last_byte, (int)src_len);
-		return -EPERM;  /* bad padding */
-	}
-
-	if (src_len < *dst1_len) {
-		*dst1_len = src_len;
-		*dst2_len = 0;
-	} else {
-		*dst2_len = src_len - *dst1_len;
+	if (ret) {
+		pr_err("%s %scrypt failed: %d\n", __func__,
+		       encrypt ? "en" : "de", ret);
+		goto out_sgt;
 	}
 	/*
-	print_hex_dump(KERN_ERR, "dec  out1: ", DUMP_PREFIX_NONE, 16, 1,
-		       dst1, *dst1_len, 1);
-	print_hex_dump(KERN_ERR, "dec  out2: ", DUMP_PREFIX_NONE, 16, 1,
-		       dst2, *dst2_len, 1);
+	print_hex_dump(KERN_ERR, "out: ", DUMP_PREFIX_NONE, 16, 1,
+		       buf, crypt_len, 1);
 	*/
 
-out_sg:
-	teardown_sgtable(&sg_in);
-out_tfm:
-	crypto_free_skcipher(tfm);
-	return ret;
-}
-
-
-int ceph_decrypt(struct ceph_crypto_key *secret, void *dst, size_t *dst_len,
-		 const void *src, size_t src_len)
-{
-	switch (secret->type) {
-	case CEPH_CRYPTO_NONE:
-		if (*dst_len < src_len)
-			return -ERANGE;
-		memcpy(dst, src, src_len);
-		*dst_len = src_len;
-		return 0;
-
-	case CEPH_CRYPTO_AES:
-		return ceph_aes_decrypt(secret->key, secret->len, dst,
-					dst_len, src, src_len);
-
-	default:
-		return -EINVAL;
-	}
-}
-
-int ceph_decrypt2(struct ceph_crypto_key *secret,
-			void *dst1, size_t *dst1_len,
-			void *dst2, size_t *dst2_len,
-			const void *src, size_t src_len)
-{
-	size_t t;
-
-	switch (secret->type) {
-	case CEPH_CRYPTO_NONE:
-		if (*dst1_len + *dst2_len < src_len)
-			return -ERANGE;
-		t = min(*dst1_len, src_len);
-		memcpy(dst1, src, t);
-		*dst1_len = t;
-		src += t;
-		src_len -= t;
-		if (src_len) {
-			t = min(*dst2_len, src_len);
-			memcpy(dst2, src, t);
-			*dst2_len = t;
+	if (encrypt) {
+		*pout_len = crypt_len;
+	} else {
+		pad_byte = *(char *)(buf + in_len - 1);
+		if (pad_byte > 0 && pad_byte <= AES_BLOCK_SIZE &&
+		    in_len >= pad_byte) {
+			*pout_len = in_len - pad_byte;
+		} else {
+			pr_err("%s got bad padding %d on in_len %d\n",
+			       __func__, pad_byte, in_len);
+			ret = -EPERM;
+			goto out_sgt;
 		}
-		return 0;
-
-	case CEPH_CRYPTO_AES:
-		return ceph_aes_decrypt2(secret->key, secret->len,
-					 dst1, dst1_len, dst2, dst2_len,
-					 src, src_len);
-
-	default:
-		return -EINVAL;
 	}
-}
-
-int ceph_encrypt(struct ceph_crypto_key *secret, void *dst, size_t *dst_len,
-		 const void *src, size_t src_len)
-{
-	switch (secret->type) {
-	case CEPH_CRYPTO_NONE:
-		if (*dst_len < src_len)
-			return -ERANGE;
-		memcpy(dst, src, src_len);
-		*dst_len = src_len;
-		return 0;
 
-	case CEPH_CRYPTO_AES:
-		return ceph_aes_encrypt(secret->key, secret->len, dst,
-					dst_len, src, src_len);
-
-	default:
-		return -EINVAL;
-	}
+out_sgt:
+	teardown_sgtable(&sgt);
+	return ret;
 }
 
-int ceph_encrypt2(struct ceph_crypto_key *secret, void *dst, size_t *dst_len,
-		  const void *src1, size_t src1_len,
-		  const void *src2, size_t src2_len)
+int ceph_crypt(const struct ceph_crypto_key *key, bool encrypt,
+	       void *buf, int buf_len, int in_len, int *pout_len)
 {
-	switch (secret->type) {
+	switch (key->type) {
 	case CEPH_CRYPTO_NONE:
-		if (*dst_len < src1_len + src2_len)
-			return -ERANGE;
-		memcpy(dst, src1, src1_len);
-		memcpy(dst + src1_len, src2, src2_len);
-		*dst_len = src1_len + src2_len;
+		*pout_len = in_len;
 		return 0;
-
 	case CEPH_CRYPTO_AES:
-		return ceph_aes_encrypt2(secret->key, secret->len, dst, dst_len,
-					 src1, src1_len, src2, src2_len);
-
+		return ceph_aes_crypt(key, encrypt, buf, buf_len, in_len,
+				      pout_len);
 	default:
-		return -EINVAL;
+		return -ENOTSUPP;
 	}
 }
 
diff --git a/net/ceph/crypto.h b/net/ceph/crypto.h
index 2e9cab09f37b..58d83aa7740f 100644
--- a/net/ceph/crypto.h
+++ b/net/ceph/crypto.h
@@ -12,37 +12,19 @@ struct ceph_crypto_key {
 	struct ceph_timespec created;
 	int len;
 	void *key;
+	struct crypto_skcipher *tfm;
 };
 
-static inline void ceph_crypto_key_destroy(struct ceph_crypto_key *key)
-{
-	if (key) {
-		kfree(key->key);
-		key->key = NULL;
-	}
-}
-
 int ceph_crypto_key_clone(struct ceph_crypto_key *dst,
 			  const struct ceph_crypto_key *src);
 int ceph_crypto_key_encode(struct ceph_crypto_key *key, void **p, void *end);
 int ceph_crypto_key_decode(struct ceph_crypto_key *key, void **p, void *end);
 int ceph_crypto_key_unarmor(struct ceph_crypto_key *key, const char *in);
+void ceph_crypto_key_destroy(struct ceph_crypto_key *key);
 
 /* crypto.c */
-int ceph_decrypt(struct ceph_crypto_key *secret,
-		 void *dst, size_t *dst_len,
-		 const void *src, size_t src_len);
-int ceph_encrypt(struct ceph_crypto_key *secret,
-		 void *dst, size_t *dst_len,
-		 const void *src, size_t src_len);
-int ceph_decrypt2(struct ceph_crypto_key *secret,
-		  void *dst1, size_t *dst1_len,
-		  void *dst2, size_t *dst2_len,
-		  const void *src, size_t src_len);
-int ceph_encrypt2(struct ceph_crypto_key *secret,
-		  void *dst, size_t *dst_len,
-		  const void *src1, size_t src1_len,
-		  const void *src2, size_t src2_len);
+int ceph_crypt(const struct ceph_crypto_key *key, bool encrypt,
+	       void *buf, int buf_len, int in_len, int *pout_len);
 int ceph_crypto_init(void);
 void ceph_crypto_shutdown(void);
 
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index a47bbc973f2d..2384b4aae064 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -3939,21 +3939,31 @@ static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx,
 	u64_stats_update_end(&stats->syncp);
 
 	if (fast_rx->internal_forward) {
-		struct sta_info *dsta = sta_info_get(rx->sdata, skb->data);
+		struct sk_buff *xmit_skb = NULL;
+		bool multicast = is_multicast_ether_addr(skb->data);
 
-		if (dsta) {
+		if (multicast) {
+			xmit_skb = skb_copy(skb, GFP_ATOMIC);
+		} else if (sta_info_get(rx->sdata, skb->data)) {
+			xmit_skb = skb;
+			skb = NULL;
+		}
+
+		if (xmit_skb) {
 			/*
 			 * Send to wireless media and increase priority by 256
 			 * to keep the received priority instead of
 			 * reclassifying the frame (see cfg80211_classify8021d).
 			 */
-			skb->priority += 256;
-			skb->protocol = htons(ETH_P_802_3);
-			skb_reset_network_header(skb);
-			skb_reset_mac_header(skb);
-			dev_queue_xmit(skb);
-			return true;
+			xmit_skb->priority += 256;
+			xmit_skb->protocol = htons(ETH_P_802_3);
+			skb_reset_network_header(xmit_skb);
+			skb_reset_mac_header(xmit_skb);
+			dev_queue_xmit(xmit_skb);
 		}
+
+		if (!skb)
+			return true;
 	}
 
 	/* deliver to local stack */
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index 45662d7f0943..6fdffde28733 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -1489,7 +1489,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)
 	case RPC_GSS_PROC_DESTROY:
 		if (gss_write_verf(rqstp, rsci->mechctx, gc->gc_seq))
 			goto auth_err;
-		rsci->h.expiry_time = get_seconds();
+		rsci->h.expiry_time = seconds_since_boot();
 		set_bit(CACHE_NEGATIVE, &rsci->h.flags);
 		if (resv->iov_len + 4 > PAGE_SIZE)
 			goto drop;
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 3bc1d61694cb..9c9db55a0c1e 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -799,6 +799,8 @@ static int svc_handle_xprt(struct svc_rqst *rqstp, struct svc_xprt *xprt)
 
 	if (test_bit(XPT_CLOSE, &xprt->xpt_flags)) {
 		dprintk("svc_recv: found XPT_CLOSE\n");
+		if (test_and_clear_bit(XPT_KILL_TEMP, &xprt->xpt_flags))
+			xprt->xpt_ops->xpo_kill_temp_xprt(xprt);
 		svc_delete_xprt(xprt);
 		/* Leave XPT_BUSY set on the dead xprt: */
 		goto out;
@@ -1020,9 +1022,11 @@ void svc_age_temp_xprts_now(struct svc_serv *serv, struct sockaddr *server_addr)
 		le = to_be_closed.next;
 		list_del_init(le);
 		xprt = list_entry(le, struct svc_xprt, xpt_list);
-		dprintk("svc_age_temp_xprts_now: closing %p\n", xprt);
-		xprt->xpt_ops->xpo_kill_temp_xprt(xprt);
-		svc_close_xprt(xprt);
+		set_bit(XPT_CLOSE, &xprt->xpt_flags);
+		set_bit(XPT_KILL_TEMP, &xprt->xpt_flags);
+		dprintk("svc_age_temp_xprts_now: queuing xprt %p for closing\n",
+				xprt);
+		svc_xprt_enqueue(xprt);
 	}
 }
 EXPORT_SYMBOL_GPL(svc_age_temp_xprts_now);
diff --git a/net/sunrpc/xprtrdma/frwr_ops.c b/net/sunrpc/xprtrdma/frwr_ops.c
index 26b26beef2d4..adbf52c6df83 100644
--- a/net/sunrpc/xprtrdma/frwr_ops.c
+++ b/net/sunrpc/xprtrdma/frwr_ops.c
@@ -421,7 +421,7 @@ frwr_op_map(struct rpcrdma_xprt *r_xprt, struct rpcrdma_mr_seg *seg,
 			 IB_ACCESS_REMOTE_WRITE | IB_ACCESS_LOCAL_WRITE :
 			 IB_ACCESS_REMOTE_READ;
 
-	DECR_CQCOUNT(&r_xprt->rx_ep);
+	rpcrdma_set_signaled(&r_xprt->rx_ep, &reg_wr->wr);
 	rc = ib_post_send(ia->ri_id->qp, &reg_wr->wr, &bad_wr);
 	if (rc)
 		goto out_senderr;
@@ -486,7 +486,7 @@ frwr_op_unmap_sync(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
 	struct rpcrdma_ia *ia = &r_xprt->rx_ia;
 	struct rpcrdma_mw *mw, *tmp;
 	struct rpcrdma_frmr *f;
-	int rc;
+	int count, rc;
 
 	dprintk("RPC:       %s: req %p\n", __func__, req);
 
@@ -496,6 +496,7 @@ frwr_op_unmap_sync(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
 	 * a single ib_post_send() call.
 	 */
 	f = NULL;
+	count = 0;
 	invalidate_wrs = pos = prev = NULL;
 	list_for_each_entry(mw, &req->rl_registered, mw_list) {
 		if ((rep->rr_wc_flags & IB_WC_WITH_INVALIDATE) &&
@@ -505,6 +506,7 @@ frwr_op_unmap_sync(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
 		}
 
 		pos = __frwr_prepare_linv_wr(mw);
+		count++;
 
 		if (!invalidate_wrs)
 			invalidate_wrs = pos;
@@ -523,7 +525,12 @@ frwr_op_unmap_sync(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
 	f->fr_invwr.send_flags = IB_SEND_SIGNALED;
 	f->fr_cqe.done = frwr_wc_localinv_wake;
 	reinit_completion(&f->fr_linv_done);
-	INIT_CQCOUNT(&r_xprt->rx_ep);
+
+	/* Initialize CQ count, since there is always a signaled
+	 * WR being posted here.  The new cqcount depends on how
+	 * many SQEs are about to be consumed.
+	 */
+	rpcrdma_init_cqcount(&r_xprt->rx_ep, count);
 
 	/* Transport disconnect drains the receive CQ before it
 	 * replaces the QP. The RPC reply handler won't call us
diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
index ad1df979b3f0..a47c9bdef5fa 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
@@ -348,8 +348,6 @@ int rdma_read_chunk_frmr(struct svcxprt_rdma *xprt,
 	atomic_inc(&rdma_stat_read);
 	return ret;
  err:
-	ib_dma_unmap_sg(xprt->sc_cm_id->device,
-			frmr->sg, frmr->sg_nents, frmr->direction);
 	svc_rdma_put_context(ctxt, 0);
 	svc_rdma_put_frmr(xprt, frmr);
 	return ret;
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index ec74289af7ec..8da7f6a4dfc3 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -223,8 +223,8 @@ rpcrdma_update_connect_private(struct rpcrdma_xprt *r_xprt,
 		cdata->inline_rsize = rsize;
 	if (wsize < cdata->inline_wsize)
 		cdata->inline_wsize = wsize;
-	pr_info("rpcrdma: max send %u, max recv %u\n",
-		cdata->inline_wsize, cdata->inline_rsize);
+	dprintk("RPC:       %s: max send %u, max recv %u\n",
+		__func__, cdata->inline_wsize, cdata->inline_rsize);
 	rpcrdma_set_max_header_sizes(r_xprt);
 }
 
@@ -532,7 +532,7 @@ rpcrdma_ep_create(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia,
 	ep->rep_cqinit = ep->rep_attr.cap.max_send_wr/2 - 1;
 	if (ep->rep_cqinit <= 2)
 		ep->rep_cqinit = 0;	/* always signal? */
-	INIT_CQCOUNT(ep);
+	rpcrdma_init_cqcount(ep, 0);
 	init_waitqueue_head(&ep->rep_connect_wait);
 	INIT_DELAYED_WORK(&ep->rep_connect_worker, rpcrdma_connect_worker);
 
@@ -1311,13 +1311,7 @@ rpcrdma_ep_post(struct rpcrdma_ia *ia,
 	dprintk("RPC:       %s: posting %d s/g entries\n",
 		__func__, send_wr->num_sge);
 
-	if (DECR_CQCOUNT(ep) > 0)
-		send_wr->send_flags = 0;
-	else { /* Provider must take a send completion every now and then */
-		INIT_CQCOUNT(ep);
-		send_wr->send_flags = IB_SEND_SIGNALED;
-	}
-
+	rpcrdma_set_signaled(ep, send_wr);
 	rc = ib_post_send(ia->ri_id->qp, send_wr, &send_wr_fail);
 	if (rc)
 		goto out_postsend_err;
diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h
index 6e1bba358203..f6ae1b22da47 100644
--- a/net/sunrpc/xprtrdma/xprt_rdma.h
+++ b/net/sunrpc/xprtrdma/xprt_rdma.h
@@ -95,8 +95,24 @@ struct rpcrdma_ep {
 	struct delayed_work	rep_connect_worker;
 };
 
-#define INIT_CQCOUNT(ep) atomic_set(&(ep)->rep_cqcount, (ep)->rep_cqinit)
-#define DECR_CQCOUNT(ep) atomic_sub_return(1, &(ep)->rep_cqcount)
+static inline void
+rpcrdma_init_cqcount(struct rpcrdma_ep *ep, int count)
+{
+	atomic_set(&ep->rep_cqcount, ep->rep_cqinit - count);
+}
+
+/* To update send queue accounting, provider must take a
+ * send completion every now and then.
+ */
+static inline void
+rpcrdma_set_signaled(struct rpcrdma_ep *ep, struct ib_send_wr *send_wr)
+{
+	send_wr->send_flags = 0;
+	if (unlikely(atomic_sub_return(1, &ep->rep_cqcount) <= 0)) {
+		rpcrdma_init_cqcount(ep, 0);
+		send_wr->send_flags = IB_SEND_SIGNALED;
+	}
+}
 
 /* Pre-allocate extra Work Requests for handling backward receives
  * and sends. This is a fixed value because the Work Queues are
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 72edf83d76b7..cffdd9cf3ebf 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -366,7 +366,7 @@ ifndef NO_SDT
 endif
 
 ifdef PERF_HAVE_JITDUMP
-  ifndef NO_DWARF
+  ifndef NO_LIBELF
     $(call detected,CONFIG_JITDUMP)
     CFLAGS += -DHAVE_JITDUMP
   endif
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
index d1ce29be560e..cd7bc4d104e2 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -70,8 +70,8 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)
 	OPT_UINTEGER(0, "ldlat", &perf_mem_events__loads_ldlat, "mem-loads latency"),
 	OPT_INCR('v', "verbose", &verbose,
 		 "be more verbose (show counter open errors, etc)"),
-	OPT_BOOLEAN('U', "--all-user", &all_user, "collect only user level data"),
-	OPT_BOOLEAN('K', "--all-kernel", &all_kernel, "collect only kernel level data"),
+	OPT_BOOLEAN('U', "all-user", &all_user, "collect only user level data"),
+	OPT_BOOLEAN('K', "all-kernel", &all_kernel, "collect only kernel level data"),
 	OPT_END()
 	};
 
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index c298bd3e1d90..21f8a81797a0 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1452,7 +1452,7 @@ static int trace__printf_interrupted_entry(struct trace *trace, struct perf_samp
 
 	duration = sample->time - ttrace->entry_time;
 
-	printed  = trace__fprintf_entry_head(trace, trace->current, duration, sample->time, trace->output);
+	printed  = trace__fprintf_entry_head(trace, trace->current, duration, ttrace->entry_time, trace->output);
 	printed += fprintf(trace->output, "%-70s) ...\n", ttrace->entry_str);
 	ttrace->entry_pending = false;
 
@@ -1499,7 +1499,7 @@ static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel,
 
 	if (sc->is_exit) {
 		if (!(trace->duration_filter || trace->summary_only || trace->min_stack)) {
-			trace__fprintf_entry_head(trace, thread, 1, sample->time, trace->output);
+			trace__fprintf_entry_head(trace, thread, 1, ttrace->entry_time, trace->output);
 			fprintf(trace->output, "%-70s)\n", ttrace->entry_str);
 		}
 	} else {
@@ -1592,7 +1592,7 @@ static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel,
 	if (trace->summary_only)
 		goto out;
 
-	trace__fprintf_entry_head(trace, thread, duration, sample->time, trace->output);
+	trace__fprintf_entry_head(trace, thread, duration, ttrace->entry_time, trace->output);
 
 	if (ttrace->entry_pending) {
 		fprintf(trace->output, "%-70s", ttrace->entry_str);
diff --git a/tools/perf/trace/beauty/mmap.c b/tools/perf/trace/beauty/mmap.c
index fd710ab33684..af1cfde6b97b 100644
--- a/tools/perf/trace/beauty/mmap.c
+++ b/tools/perf/trace/beauty/mmap.c
@@ -42,7 +42,9 @@ static size_t syscall_arg__scnprintf_mmap_flags(char *bf, size_t size,
 
 	P_MMAP_FLAG(SHARED);
 	P_MMAP_FLAG(PRIVATE);
+#ifdef MAP_32BIT
 	P_MMAP_FLAG(32BIT);
+#endif
 	P_MMAP_FLAG(ANONYMOUS);
 	P_MMAP_FLAG(DENYWRITE);
 	P_MMAP_FLAG(EXECUTABLE);
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index eb60e613d795..1dc67efad634 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -120,7 +120,7 @@ libperf-y += demangle-rust.o
 ifdef CONFIG_JITDUMP
 libperf-$(CONFIG_LIBELF) += jitdump.o
 libperf-$(CONFIG_LIBELF) += genelf.o
-libperf-$(CONFIG_LIBELF) += genelf_debug.o
+libperf-$(CONFIG_DWARF) += genelf_debug.o
 endif
 
 CFLAGS_config.o   += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
index 07fd30bc2f81..ae58b493af45 100644
--- a/tools/perf/util/callchain.c
+++ b/tools/perf/util/callchain.c
@@ -193,7 +193,6 @@ int perf_callchain_config(const char *var, const char *value)
 
 	if (!strcmp(var, "record-mode"))
 		return parse_callchain_record_opt(value, &callchain_param);
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
 	if (!strcmp(var, "dump-size")) {
 		unsigned long size = 0;
 		int ret;
@@ -203,7 +202,6 @@ int perf_callchain_config(const char *var, const char *value)
 
 		return ret;
 	}
-#endif
 	if (!strcmp(var, "print-type"))
 		return parse_callchain_mode(value);
 	if (!strcmp(var, "order"))
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
index 13e75549c440..47cfd1080975 100644
--- a/tools/perf/util/callchain.h
+++ b/tools/perf/util/callchain.h
@@ -11,11 +11,7 @@
 
 #define CALLCHAIN_HELP "setup and enables call-graph (stack chain/backtrace):\n\n"
 
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
 # define RECORD_MODE_HELP  HELP_PAD "record_mode:\tcall graph recording mode (fp|dwarf|lbr)\n"
-#else
-# define RECORD_MODE_HELP  HELP_PAD "record_mode:\tcall graph recording mode (fp|lbr)\n"
-#endif
 
 #define RECORD_SIZE_HELP						\
 	HELP_PAD "record_size:\tif record_mode is 'dwarf', max size of stack recording (<bytes>)\n" \
diff --git a/tools/perf/util/genelf.c b/tools/perf/util/genelf.c
index c1ef805c6a8f..14a73acc549c 100644
--- a/tools/perf/util/genelf.c
+++ b/tools/perf/util/genelf.c
@@ -19,7 +19,9 @@
 #include <limits.h>
 #include <fcntl.h>
 #include <err.h>
+#ifdef HAVE_DWARF_SUPPORT
 #include <dwarf.h>
+#endif
 
 #include "perf.h"
 #include "genelf.h"
@@ -157,7 +159,7 @@ gen_build_id(struct buildid_note *note, unsigned long load_addr, const void *cod
 int
 jit_write_elf(int fd, uint64_t load_addr, const char *sym,
 	      const void *code, int csize,
-	      void *debug, int nr_debug_entries)
+	      void *debug __maybe_unused, int nr_debug_entries __maybe_unused)
 {
 	Elf *e;
 	Elf_Data *d;
@@ -386,11 +388,14 @@ jit_write_elf(int fd, uint64_t load_addr, const char *sym,
 	shdr->sh_size = sizeof(bnote);
 	shdr->sh_entsize = 0;
 
+#ifdef HAVE_DWARF_SUPPORT
 	if (debug && nr_debug_entries) {
 		retval = jit_add_debug_info(e, load_addr, debug, nr_debug_entries);
 		if (retval)
 			goto error;
-	} else {
+	} else
+#endif
+	{
 		if (elf_update(e, ELF_C_WRITE) < 0) {
 			warnx("elf_update 4 failed");
 			goto error;
diff --git a/tools/perf/util/genelf.h b/tools/perf/util/genelf.h
index 2fbeb59c4bdd..5c933ac71451 100644
--- a/tools/perf/util/genelf.h
+++ b/tools/perf/util/genelf.h
@@ -4,8 +4,10 @@
 /* genelf.c */
 int jit_write_elf(int fd, uint64_t code_addr, const char *sym,
 		  const void *code, int csize, void *debug, int nr_debug_entries);
+#ifdef HAVE_DWARF_SUPPORT
 /* genelf_debug.c */
 int jit_add_debug_info(Elf *e, uint64_t code_addr, void *debug, int nr_debug_entries);
+#endif
 
 #if   defined(__arm__)
 #define GEN_ELF_ARCH	EM_ARM
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index aecff69a510d..f7b35e178582 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1459,7 +1459,8 @@ int dso__load(struct dso *dso, struct map *map)
 	 * Read the build id if possible. This is required for
 	 * DSO_BINARY_TYPE__BUILDID_DEBUGINFO to work
 	 */
-	if (is_regular_file(dso->long_name) &&
+	if (!dso->has_build_id &&
+	    is_regular_file(dso->long_name) &&
 	    filename__read_build_id(dso->long_name, build_id, BUILD_ID_SIZE) > 0)
 		dso__set_build_id(dso, build_id);
 
diff --git a/tools/perf/util/trace-event-scripting.c b/tools/perf/util/trace-event-scripting.c
index 9df61059a85d..a2fd6e79d5a5 100644
--- a/tools/perf/util/trace-event-scripting.c
+++ b/tools/perf/util/trace-event-scripting.c
@@ -95,7 +95,8 @@ static void register_python_scripting(struct scripting_ops *scripting_ops)
 	if (err)
 		die("error registering py script extension");
 
-	scripting_context = malloc(sizeof(struct scripting_context));
+	if (scripting_context == NULL)
+		scripting_context = malloc(sizeof(*scripting_context));
 }
 
 #ifdef NO_LIBPYTHON
@@ -159,7 +160,8 @@ static void register_perl_scripting(struct scripting_ops *scripting_ops)
 	if (err)
 		die("error registering pl script extension");
 
-	scripting_context = malloc(sizeof(struct scripting_context));
+	if (scripting_context == NULL)
+		scripting_context = malloc(sizeof(*scripting_context));
 }
 
 #ifdef NO_LIBPERL
diff --git a/tools/testing/selftests/powerpc/pmu/ebb/pmc56_overflow_test.c b/tools/testing/selftests/powerpc/pmu/ebb/pmc56_overflow_test.c
index c22860ab9733..30e1ac62e8cb 100644
--- a/tools/testing/selftests/powerpc/pmu/ebb/pmc56_overflow_test.c
+++ b/tools/testing/selftests/powerpc/pmu/ebb/pmc56_overflow_test.c
@@ -66,7 +66,7 @@ int pmc56_overflow(void)
 
 	FAIL_IF(ebb_event_enable(&event));
 
-	mtspr(SPRN_PMC1, pmc_sample_period(sample_period));
+	mtspr(SPRN_PMC2, pmc_sample_period(sample_period));
 	mtspr(SPRN_PMC5, 0);
 	mtspr(SPRN_PMC6, 0);
 
diff --git a/tools/virtio/ringtest/run-on-all.sh b/tools/virtio/ringtest/run-on-all.sh
index 2e69ca812b4c..29b0d3920bfc 100755
--- a/tools/virtio/ringtest/run-on-all.sh
+++ b/tools/virtio/ringtest/run-on-all.sh
@@ -1,12 +1,13 @@
 #!/bin/sh
 
+CPUS_ONLINE=$(lscpu --online -p=cpu|grep -v -e '#')
 #use last CPU for host. Why not the first?
 #many devices tend to use cpu0 by default so
 #it tends to be busier
-HOST_AFFINITY=$(lscpu -p=cpu | tail -1)
+HOST_AFFINITY=$(echo "${CPUS_ONLINE}"|tail -n 1)
 
 #run command on all cpus
-for cpu in $(seq 0 $HOST_AFFINITY)
+for cpu in $CPUS_ONLINE
 do
 	#Don't run guest and host on same CPU
 	#It actually works ok if using signalling
diff --git a/virt/kvm/arm/vgic/vgic-init.c b/virt/kvm/arm/vgic/vgic-init.c
index 8cebfbc19e90..539d3f5cb619 100644
--- a/virt/kvm/arm/vgic/vgic-init.c
+++ b/virt/kvm/arm/vgic/vgic-init.c
@@ -268,15 +268,11 @@ static void kvm_vgic_dist_destroy(struct kvm *kvm)
 {
 	struct vgic_dist *dist = &kvm->arch.vgic;
 
-	mutex_lock(&kvm->lock);
-
 	dist->ready = false;
 	dist->initialized = false;
 
 	kfree(dist->spis);
 	dist->nr_spis = 0;
-
-	mutex_unlock(&kvm->lock);
 }
 
 void kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu)
@@ -286,7 +282,8 @@ void kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu)
 	INIT_LIST_HEAD(&vgic_cpu->ap_list_head);
 }
 
-void kvm_vgic_destroy(struct kvm *kvm)
+/* To be called with kvm->lock held */
+static void __kvm_vgic_destroy(struct kvm *kvm)
 {
 	struct kvm_vcpu *vcpu;
 	int i;
@@ -297,6 +294,13 @@ void kvm_vgic_destroy(struct kvm *kvm)
 		kvm_vgic_vcpu_destroy(vcpu);
 }
 
+void kvm_vgic_destroy(struct kvm *kvm)
+{
+	mutex_lock(&kvm->lock);
+	__kvm_vgic_destroy(kvm);
+	mutex_unlock(&kvm->lock);
+}
+
 /**
  * vgic_lazy_init: Lazy init is only allowed if the GIC exposed to the guest
  * is a GICv2. A GICv3 must be explicitly initialized by the guest using the
@@ -348,6 +352,10 @@ int kvm_vgic_map_resources(struct kvm *kvm)
 		ret = vgic_v2_map_resources(kvm);
 	else
 		ret = vgic_v3_map_resources(kvm);
+
+	if (ret)
+		__kvm_vgic_destroy(kvm);
+
 out:
 	mutex_unlock(&kvm->lock);
 	return ret;
diff --git a/virt/kvm/arm/vgic/vgic-v2.c b/virt/kvm/arm/vgic/vgic-v2.c
index 9bab86757fa4..834137e7b83f 100644
--- a/virt/kvm/arm/vgic/vgic-v2.c
+++ b/virt/kvm/arm/vgic/vgic-v2.c
@@ -293,8 +293,6 @@ int vgic_v2_map_resources(struct kvm *kvm)
 	dist->ready = true;
 
 out:
-	if (ret)
-		kvm_vgic_destroy(kvm);
 	return ret;
 }
 
diff --git a/virt/kvm/arm/vgic/vgic-v3.c b/virt/kvm/arm/vgic/vgic-v3.c
index 5c9f9745e6ca..e6b03fd8c374 100644
--- a/virt/kvm/arm/vgic/vgic-v3.c
+++ b/virt/kvm/arm/vgic/vgic-v3.c
@@ -302,8 +302,6 @@ int vgic_v3_map_resources(struct kvm *kvm)
 	dist->ready = true;
 
 out:
-	if (ret)
-		kvm_vgic_destroy(kvm);
 	return ret;
 }
 

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-01-26  7:48 Linux 4.9.6 Greg KH
  2017-01-26  7:48 ` Greg KH
@ 2017-02-06 17:30 ` Gabriel C
  2017-02-06 17:41   ` Greg KH
  2017-02-06 23:06   ` Linus Torvalds
  1 sibling, 2 replies; 52+ messages in thread
From: Gabriel C @ 2017-02-06 17:30 UTC (permalink / raw)
  To: Greg KH, linux-kernel, Andrew Morton, torvalds, stable
  Cc: lwn, Jiri Slaby, Thomas Gleixner, Ruslan Ruslichenko


On 26.01.2017 08:48, Greg KH wrote:

Hi Greg,

> I'm announcing the release of the 4.9.6 kernel.


Somewhat late , however I didn't tested 4.9.6 but jumped from 4.9.5 to 4.9.7
and found out by box won't boot anymore.

It hangs early and freeze with a lot RCU warnings.
Since I cannot setup a netconsole right now I cannot post the errors , really sorry.

( but I could make a picture if needed )


I bisected it down to :

 > Ruslan Ruslichenko (1):
 >       x86/ioapic: Restore IO-APIC irq_chip retrigger callback

Reverting this one fixes the problem for me..

Also this problem exists in Linus tree , I tested on:
4.10.0-rc6-00167-ga0a28644c1cf

The box is a PRIMERGY TX200 S5 , 2 socket , 2 x E5520 CPU(s) installed.

Config:
https://raw.githubusercontent.com/frugalware/frugalware-current/master/source/base/kernel/config.x86_64

Regards,

Gabriel C.

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-06 17:30 ` Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box ) Gabriel C
@ 2017-02-06 17:41   ` Greg KH
  2017-02-06 19:05       ` Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco)
  2017-02-06 23:06   ` Linus Torvalds
  1 sibling, 1 reply; 52+ messages in thread
From: Greg KH @ 2017-02-06 17:41 UTC (permalink / raw)
  To: Gabriel C
  Cc: linux-kernel, Andrew Morton, torvalds, stable, lwn, Jiri Slaby,
	Thomas Gleixner, Ruslan Ruslichenko

On Mon, Feb 06, 2017 at 06:30:15PM +0100, Gabriel C wrote:
> 
> On 26.01.2017 08:48, Greg KH wrote:
> 
> Hi Greg,
> 
> > I'm announcing the release of the 4.9.6 kernel.
> 
> 
> Somewhat late , however I didn't tested 4.9.6 but jumped from 4.9.5 to 4.9.7
> and found out by box won't boot anymore.
> 
> It hangs early and freeze with a lot RCU warnings.
> Since I cannot setup a netconsole right now I cannot post the errors , really sorry.
> 
> ( but I could make a picture if needed )
> 
> 
> I bisected it down to :
> 
> > Ruslan Ruslichenko (1):
> >       x86/ioapic: Restore IO-APIC irq_chip retrigger callback
> 
> Reverting this one fixes the problem for me..
> 
> Also this problem exists in Linus tree , I tested on:
> 4.10.0-rc6-00167-ga0a28644c1cf

Ok, at least we are consistent :)

> The box is a PRIMERGY TX200 S5 , 2 socket , 2 x E5520 CPU(s) installed.
> 
> Config:
> https://raw.githubusercontent.com/frugalware/frugalware-current/master/source/base/kernel/config.x86_64

Ruslan, any thoughts about what to do here?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-06 17:41   ` Greg KH
@ 2017-02-06 19:05       ` Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco)
  0 siblings, 0 replies; 52+ messages in thread
From: Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco) @ 2017-02-06 19:05 UTC (permalink / raw)
  To: Greg KH, Gabriel C
  Cc: linux-kernel, Andrew Morton, torvalds, stable, lwn, Jiri Slaby,
	Thomas Gleixner

On 02/06/2017 07:41 PM, Greg KH wrote:
> On Mon, Feb 06, 2017 at 06:30:15PM +0100, Gabriel C wrote:
>> On 26.01.2017 08:48, Greg KH wrote:
>>
>> Hi Greg,
>>
>>> I'm announcing the release of the 4.9.6 kernel.
>>
>> Somewhat late , however I didn't tested 4.9.6 but jumped from 4.9.5 to 4.9.7
>> and found out by box won't boot anymore.
>>
>> It hangs early and freeze with a lot RCU warnings.
>> Since I cannot setup a netconsole right now I cannot post the errors , really sorry.
>>
>> ( but I could make a picture if needed )
>>
>>
>> I bisected it down to :
>>
>>> Ruslan Ruslichenko (1):
>>>        x86/ioapic: Restore IO-APIC irq_chip retrigger callback
>> Reverting this one fixes the problem for me..
>>
>> Also this problem exists in Linus tree , I tested on:
>> 4.10.0-rc6-00167-ga0a28644c1cf
> Ok, at least we are consistent :)
>
>> The box is a PRIMERGY TX200 S5 , 2 socket , 2 x E5520 CPU(s) installed.
>>
>> Config:
>> https://raw.githubusercontent.com/frugalware/frugalware-current/master/source/base/kernel/config.x86_64
> Ruslan, any thoughts about what to do here?
This looks strange. What this patch does is just revert previous 
behavior, broken by d32932d02e18.
So we can try to test with last v4.1 stable, where retrigger callback 
were still present.

Also on v4.10 maybe check with software emulation of this feature and 
reverted patch, e.g.:

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index e487493..49c3c71 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -170,6 +170,7 @@ config X86
         select USER_STACKTRACE_SUPPORT
         select VIRT_TO_BUS
         select X86_FEATURE_NAMES                if PROC_FS
+       select HARDIRQS_SW_RESEND

  config INSTRUCTION_DECODER
         def_bool y

I think for further debugging logs will be needed.
>
> thanks,
>
> greg k-h

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
@ 2017-02-06 19:05       ` Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco)
  0 siblings, 0 replies; 52+ messages in thread
From: Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco) @ 2017-02-06 19:05 UTC (permalink / raw)
  To: Greg KH, Gabriel C
  Cc: linux-kernel, Andrew Morton, torvalds, stable, lwn, Jiri Slaby,
	Thomas Gleixner

On 02/06/2017 07:41 PM, Greg KH wrote:
> On Mon, Feb 06, 2017 at 06:30:15PM +0100, Gabriel C wrote:
>> On 26.01.2017 08:48, Greg KH wrote:
>>
>> Hi Greg,
>>
>>> I'm announcing the release of the 4.9.6 kernel.
>>
>> Somewhat late , however I didn't tested 4.9.6 but jumped from 4.9.5 to 4.9.7
>> and found out by box won't boot anymore.
>>
>> It hangs early and freeze with a lot RCU warnings.
>> Since I cannot setup a netconsole right now I cannot post the errors , really sorry.
>>
>> ( but I could make a picture if needed )
>>
>>
>> I bisected it down to :
>>
>>> Ruslan Ruslichenko (1):
>>>        x86/ioapic: Restore IO-APIC irq_chip retrigger callback
>> Reverting this one fixes the problem for me..
>>
>> Also this problem exists in Linus tree , I tested on:
>> 4.10.0-rc6-00167-ga0a28644c1cf
> Ok, at least we are consistent :)
>
>> The box is a PRIMERGY TX200 S5 , 2 socket , 2 x E5520 CPU(s) installed.
>>
>> Config:
>> https://raw.githubusercontent.com/frugalware/frugalware-current/master/source/base/kernel/config.x86_64
> Ruslan, any thoughts about what to do here?
This looks strange. What this patch does is just revert previous 
behavior, broken by d32932d02e18.
So we can try to test with last v4.1 stable, where retrigger callback 
were still present.

Also on v4.10 maybe check with software emulation of this feature and 
reverted patch, e.g.:

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index e487493..49c3c71 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -170,6 +170,7 @@ config X86
         select USER_STACKTRACE_SUPPORT
         select VIRT_TO_BUS
         select X86_FEATURE_NAMES                if PROC_FS
+       select HARDIRQS_SW_RESEND

  config INSTRUCTION_DECODER
         def_bool y

I think for further debugging logs will be needed.
>
> thanks,
>
> greg k-h

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-06 19:05       ` Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco)
@ 2017-02-06 20:38         ` Gabriel C
  -1 siblings, 0 replies; 52+ messages in thread
From: Gabriel C @ 2017-02-06 20:38 UTC (permalink / raw)
  To: Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco), Greg KH
  Cc: linux-kernel, Andrew Morton, torvalds, stable, lwn, Jiri Slaby,
	Thomas Gleixner



On 06.02.2017 20:05, Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco) wrote:
> On 02/06/2017 07:41 PM, Greg KH wrote:
>> On Mon, Feb 06, 2017 at 06:30:15PM +0100, Gabriel C wrote:
>>> On 26.01.2017 08:48, Greg KH wrote:
>>>
>>> Hi Greg,
>>>
>>>> I'm announcing the release of the 4.9.6 kernel.
>>>
>>> Somewhat late , however I didn't tested 4.9.6 but jumped from 4.9.5 to 4.9.7
>>> and found out by box won't boot anymore.
>>>
>>> It hangs early and freeze with a lot RCU warnings.
>>> Since I cannot setup a netconsole right now I cannot post the errors , really sorry.
>>>
>>> ( but I could make a picture if needed )
>>>
>>>
>>> I bisected it down to :
>>>
>>>> Ruslan Ruslichenko (1):
>>>>        x86/ioapic: Restore IO-APIC irq_chip retrigger callback
>>> Reverting this one fixes the problem for me..
>>>
>>> Also this problem exists in Linus tree , I tested on:
>>> 4.10.0-rc6-00167-ga0a28644c1cf
>> Ok, at least we are consistent :)
>>
>>> The box is a PRIMERGY TX200 S5 , 2 socket , 2 x E5520 CPU(s) installed.
>>>
>>> Config:
>>> https://raw.githubusercontent.com/frugalware/frugalware-current/master/source/base/kernel/config.x86_64
>> Ruslan, any thoughts about what to do here?
> This looks strange. What this patch does is just revert previous
> behavior, broken by d32932d02e18.
> So we can try to test with last v4.1 stable, where retrigger callback
> were still present.

I can test that but first on weekend if you wish.

> Also on v4.10 maybe check with software emulation of this feature and
> reverted patch, e.g.:
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index e487493..49c3c71 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -170,6 +170,7 @@ config X86
>          select USER_STACKTRACE_SUPPORT
>          select VIRT_TO_BUS
>          select X86_FEATURE_NAMES                if PROC_FS
> +       select HARDIRQS_SW_RESEND
>
>   config INSTRUCTION_DECODER
>          def_bool y
>

With patch reverted + this one I get a early kernel panic.. on 4.10.0-rc7

With just the patch reverted all is fine , the box boots and all seems fine.

> I think for further debugging logs will be needed.

Yes sure , I just need to find a way to set something up like netconsole here.
Right now I have no way doig that. I'll try to do that on weekend too also.

Regards,

Gabriel C

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
@ 2017-02-06 20:38         ` Gabriel C
  0 siblings, 0 replies; 52+ messages in thread
From: Gabriel C @ 2017-02-06 20:38 UTC (permalink / raw)
  To: Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco), Greg KH
  Cc: linux-kernel, Andrew Morton, torvalds, stable, lwn, Jiri Slaby,
	Thomas Gleixner



On 06.02.2017 20:05, Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco) wrote:
> On 02/06/2017 07:41 PM, Greg KH wrote:
>> On Mon, Feb 06, 2017 at 06:30:15PM +0100, Gabriel C wrote:
>>> On 26.01.2017 08:48, Greg KH wrote:
>>>
>>> Hi Greg,
>>>
>>>> I'm announcing the release of the 4.9.6 kernel.
>>>
>>> Somewhat late , however I didn't tested 4.9.6 but jumped from 4.9.5 to 4.9.7
>>> and found out by box won't boot anymore.
>>>
>>> It hangs early and freeze with a lot RCU warnings.
>>> Since I cannot setup a netconsole right now I cannot post the errors , really sorry.
>>>
>>> ( but I could make a picture if needed )
>>>
>>>
>>> I bisected it down to :
>>>
>>>> Ruslan Ruslichenko (1):
>>>>        x86/ioapic: Restore IO-APIC irq_chip retrigger callback
>>> Reverting this one fixes the problem for me..
>>>
>>> Also this problem exists in Linus tree , I tested on:
>>> 4.10.0-rc6-00167-ga0a28644c1cf
>> Ok, at least we are consistent :)
>>
>>> The box is a PRIMERGY TX200 S5 , 2 socket , 2 x E5520 CPU(s) installed.
>>>
>>> Config:
>>> https://raw.githubusercontent.com/frugalware/frugalware-current/master/source/base/kernel/config.x86_64
>> Ruslan, any thoughts about what to do here?
> This looks strange. What this patch does is just revert previous
> behavior, broken by d32932d02e18.
> So we can try to test with last v4.1 stable, where retrigger callback
> were still present.

I can test that but first on weekend if you wish.

> Also on v4.10 maybe check with software emulation of this feature and
> reverted patch, e.g.:
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index e487493..49c3c71 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -170,6 +170,7 @@ config X86
>          select USER_STACKTRACE_SUPPORT
>          select VIRT_TO_BUS
>          select X86_FEATURE_NAMES                if PROC_FS
> +       select HARDIRQS_SW_RESEND
>
>   config INSTRUCTION_DECODER
>          def_bool y
>

With patch reverted + this one I get a early kernel panic.. on 4.10.0-rc7

With just the patch reverted all is fine , the box boots and all seems fine.

> I think for further debugging logs will be needed.

Yes sure , I just need to find a way to set something up like netconsole here.
Right now I have no way doig that. I'll try to do that on weekend too also.

Regards,

Gabriel C

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-06 17:30 ` Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box ) Gabriel C
  2017-02-06 17:41   ` Greg KH
@ 2017-02-06 23:06   ` Linus Torvalds
  2017-02-07 20:46     ` Thomas Gleixner
  2017-02-07 21:24     ` Thomas Gleixner
  1 sibling, 2 replies; 52+ messages in thread
From: Linus Torvalds @ 2017-02-06 23:06 UTC (permalink / raw)
  To: Gabriel C
  Cc: Greg KH, Linux Kernel Mailing List, Andrew Morton, stable, lwn,
	Jiri Slaby, Thomas Gleixner, Ruslan Ruslichenko

On Mon, Feb 6, 2017 at 9:30 AM, Gabriel C <nix.or.die@gmail.com> wrote:
>
> Somewhat late , however I didn't tested 4.9.6 but jumped from 4.9.5 to 4.9.7
> and found out by box won't boot anymore.
>
> It hangs early and freeze with a lot RCU warnings.
> Since I cannot setup a netconsole right now I cannot post the errors ,
> really sorry.
>
> ( but I could make a picture if needed )
>
> I bisected it down to :
>
>> Ruslan Ruslichenko (1):
>>       x86/ioapic: Restore IO-APIC irq_chip retrigger callback

Ok, it's

    020eb3daaba2 ("x86/ioapic: Restore IO-APIC irq_chip retrigger callback")

in mainline.

> Reverting this one fixes the problem for me..

Since that came in rather late, I suspect we'll have to revert for
now.  The thing it fixes has been around for almost two years, so it
can't be as serious a problem as the fix itself ended up being.

Thomas?

That said, it also strikes me that the implicated
irq_chip_retrigger_hierarchy() function looks really very suspicious
indeed.

Most of the other users don't seem to traverse the parent all the way
until they find something. They just do the operation in the parent,
and if the parent needs it, it might then do it in _its_ parent and so
on.

And the compiler is able to turn the parent call into a tail call so
it doesn't cause a stack use explosion even if the parenthood chains
end up being pretty deep.

So I'm wondering if that for-loop triggers a stack overflow on your
setup somehow, just because that irq_retrigger() call is now truly
recursive, and hasn't been turned into tail-calls.

But for now, I'd be inclined to just revert it unless somebody has a
"Duh!" moment and can tell me what's wrong with that commit with an
obvious fix.

Comments?

                  Linus

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-06 23:06   ` Linus Torvalds
@ 2017-02-07 20:46     ` Thomas Gleixner
  2017-02-07 21:25       ` Thomas Gleixner
  2017-02-07 21:24     ` Thomas Gleixner
  1 sibling, 1 reply; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-07 20:46 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Gabriel C, Greg KH, Linux Kernel Mailing List, Andrew Morton,
	stable, lwn, Jiri Slaby, Ruslan Ruslichenko

On Mon, 6 Feb 2017, Linus Torvalds wrote:
> But for now, I'd be inclined to just revert it unless somebody has a
> "Duh!" moment and can tell me what's wrong with that commit with an
> obvious fix.

I have no "Duh!" moment even after staring at the code for quite a while.

Gabriel, can you please send me the bootlog from a working kernel?

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-06 23:06   ` Linus Torvalds
  2017-02-07 20:46     ` Thomas Gleixner
@ 2017-02-07 21:24     ` Thomas Gleixner
  1 sibling, 0 replies; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-07 21:24 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Gabriel C, Greg KH, Linux Kernel Mailing List, Andrew Morton,
	stable, lwn, Jiri Slaby, Ruslan Ruslichenko

On Mon, 6 Feb 2017, Linus Torvalds wrote:
> That said, it also strikes me that the implicated
> irq_chip_retrigger_hierarchy() function looks really very suspicious
> indeed.
> 
> Most of the other users don't seem to traverse the parent all the way
> until they find something. They just do the operation in the parent,
> and if the parent needs it, it might then do it in _its_ parent and so
> on.

The whole point of the hierarchy is that we have decoupled the stacked
chips so the ioapic does not know whether it is connected to the irq
remapping unit or to the vector domain directly.

> So I'm wondering if that for-loop triggers a stack overflow on your
> setup somehow, just because that irq_retrigger() call is now truly
> recursive, and hasn't been turned into tail-calls.

It would only be recursive if some level down the hierarchy would use the
same callback.

The ioapic is always on top of its hierarchy and its either connected to
the vector domain directly, which is the last level in the hierarchy and
implements the real retrigger callback or to the irq remapping unit which
does not have a retrigger callback. So it's not a recursion problem AFAICT,
but lets try and just use the apic callback directly as we did before the
whole hierarchy rework. That's wrong for other reasons, but that does not
matter in that particular case. Patch below.

We have the same situation with the MSI interrupt domains which all use
irq_chip_retrigger_hierarchy() function as their retrigger callback, which
does not seem to have the same effect on Gabriels machine.

I have the feeling that this commit unearthes some other subtle wreckage in
the interrupt machinery which gets not triggered otherwise.

Thanks,

	tglx

8<-------------------
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 52f352b063fd..3b6e5f3f099d 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1867,6 +1867,8 @@ static int ioapic_set_affinity(struct irq_data *irq_data,
 	return ret;
 }
 
+extern int apic_retrigger_irq(struct irq_data *irq_data);
+
 static struct irq_chip ioapic_chip __read_mostly = {
 	.name			= "IO-APIC",
 	.irq_startup		= startup_ioapic_irq,
@@ -1875,7 +1877,7 @@ static struct irq_chip ioapic_chip __read_mostly = {
 	.irq_ack		= irq_chip_ack_parent,
 	.irq_eoi		= ioapic_ack_level,
 	.irq_set_affinity	= ioapic_set_affinity,
-	.irq_retrigger		= irq_chip_retrigger_hierarchy,
+	.irq_retrigger		= apic_retrigger_irq,
 	.flags			= IRQCHIP_SKIP_SET_WAKE,
 };
 
@@ -1887,7 +1889,7 @@ static struct irq_chip ioapic_ir_chip __read_mostly = {
 	.irq_ack		= irq_chip_ack_parent,
 	.irq_eoi		= ioapic_ir_ack_level,
 	.irq_set_affinity	= ioapic_set_affinity,
-	.irq_retrigger		= irq_chip_retrigger_hierarchy,
+	.irq_retrigger		= apic_retrigger_irq,
 	.flags			= IRQCHIP_SKIP_SET_WAKE,
 };
 
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index 5d30c5e42bb1..ce9b93e19266 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -496,7 +496,7 @@ void setup_vector_irq(int cpu)
 	__setup_vector_irq(cpu);
 }
 
-static int apic_retrigger_irq(struct irq_data *irq_data)
+int apic_retrigger_irq(struct irq_data *irq_data)
 {
 	struct apic_chip_data *data = apic_chip_data(irq_data);
 	unsigned long flags;

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-07 20:46     ` Thomas Gleixner
@ 2017-02-07 21:25       ` Thomas Gleixner
  2017-02-10 23:17         ` Gabriel C
  0 siblings, 1 reply; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-07 21:25 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Gabriel C, Greg KH, Linux Kernel Mailing List, Andrew Morton,
	stable, lwn, Jiri Slaby, Ruslan Ruslichenko

On Tue, 7 Feb 2017, Thomas Gleixner wrote:
> Gabriel, can you please send me the bootlog from a working kernel?

Plus content of /proc/interrupts.

Btw, how far in the boot process is the machine when this happens?

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-07 21:25       ` Thomas Gleixner
@ 2017-02-10 23:17         ` Gabriel C
  2017-02-11  1:42           ` Gabriel C
  2017-02-11  8:26           ` Thomas Gleixner
  0 siblings, 2 replies; 52+ messages in thread
From: Gabriel C @ 2017-02-10 23:17 UTC (permalink / raw)
  To: Thomas Gleixner, Linus Torvalds
  Cc: Greg KH, Linux Kernel Mailing List, Andrew Morton, stable, lwn,
	Jiri Slaby, Ruslan Ruslichenko



On 07.02.2017 22:25, Thomas Gleixner wrote:
> On Tue, 7 Feb 2017, Thomas Gleixner wrote:
Hi Thomas ,

Sorry I was travelling..

>> Gabriel, can you please send me the bootlog from a working kernel?
>

http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/dmesg

( If you wish I can send you one from .10-rc with that patch reverted )

> Plus content of /proc/interrupts.
>

http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/interrupts


> Btw, how far in the boot process is the machine when this happens?

Right after :

Uncompressing Linux.....
Booting the kernel..

So early..

One thing is strange .. on all one socket boxes I have the kernel seems to be fine with that
patch while breaks on both dual socket boxes ( well both have near same HW )

Also I'm going to test your patch from your other email

Regards,

Gabrile C

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-10 23:17         ` Gabriel C
@ 2017-02-11  1:42           ` Gabriel C
  2017-02-11  8:26           ` Thomas Gleixner
  1 sibling, 0 replies; 52+ messages in thread
From: Gabriel C @ 2017-02-11  1:42 UTC (permalink / raw)
  To: Thomas Gleixner, Linus Torvalds
  Cc: Greg KH, Linux Kernel Mailing List, Andrew Morton, stable, lwn,
	Jiri Slaby, Ruslan Ruslichenko



On 11.02.2017 00:17, Gabriel C wrote:

>
>> Btw, how far in the boot process is the machine when this happens?
>
> Right after :
>
> Uncompressing Linux.....
> Booting the kernel..
>
> So early..
>

After lots more boots .. I found out sometimes it gets to :

..

[    4.656826] Key type dns_resolver registered

..

next line(s) in all my logs would be :

..

[    4.657507] microcode: sig=0x106a5, pf=0x1, revision=0x19
[    4.658678] microcode: Microcode Update Driver: v2.01 <tigran@aivazian.fsnet.co.uk>, Peter Oruba

..

so maybe some sort race in microcode code ? but this would be strange ?

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-10 23:17         ` Gabriel C
  2017-02-11  1:42           ` Gabriel C
@ 2017-02-11  8:26           ` Thomas Gleixner
  2017-02-11 13:09             ` Gabriel C
  1 sibling, 1 reply; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-11  8:26 UTC (permalink / raw)
  To: Gabriel C
  Cc: Linus Torvalds, Greg KH, Linux Kernel Mailing List,
	Andrew Morton, stable, lwn, Jiri Slaby, Ruslan Ruslichenko

On Sat, 11 Feb 2017, Gabriel C wrote:
> On 07.02.2017 22:25, Thomas Gleixner wrote:
> Hi Thomas ,
> 
> Sorry I was travelling..

Nothing to be sorry about.

> > Btw, how far in the boot process is the machine when this happens?
> 
> Right after :
> 
> Uncompressing Linux.....
> Booting the kernel..
> 
> So early..

You might try with 'earlyprintk' on the command line. That should tell more.

> One thing is strange .. on all one socket boxes I have the kernel seems
> to be fine with that patch while breaks on both dual socket boxes ( well
> both have near same HW )

That's really weird.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-11  8:26           ` Thomas Gleixner
@ 2017-02-11 13:09             ` Gabriel C
  2017-02-11 14:21               ` Borislav Petkov
  0 siblings, 1 reply; 52+ messages in thread
From: Gabriel C @ 2017-02-11 13:09 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Linus Torvalds, Greg KH, Linux Kernel Mailing List,
	Andrew Morton, stable, lwn, Jiri Slaby, Ruslan Ruslichenko



On 11.02.2017 09:26, Thomas Gleixner wrote:
>
> You might try with 'earlyprintk' on the command line. That should tell more.

With that I have some more output.. and after lots more boots I found out there are really
at least 2 bugs triggered by this in 4.10.

When just boothing with earlyprintk=vga debug ignore_loglevel the kernel hangs right after :

Key type dns_resolver registered
..

The cursor blinks and one have to wait a while this bug to trigger if at all.
Sometimes it just hangs there and that is.

Adding ' dis_ucode_ldr ' to commandline makes the kernel hangs right after :

clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x20ac7f6ecc6, max_idle_ns: 440795315461 ns
...

and I have the bug triggered really quick..

Also I cannot get netconsole to work , I'm sure is some problem here local and I don't have
any serial cable around right now. The only way I saw now to give you at least some ifo is to
make an video of that crash. You can find it there :

http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/crash.mp4

Also this is after waiting a while :

http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/20170211_130319.jpg

I know videos and picures are not the best solution but reight now I don't have any
other way to capture some logs :|

The kernel is Linus git tree + .d966564fcdc19e13eb6ba1fbe6b8101070339c3d reverted and the config is :

http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/config

I hope the video helps at least somewhat to have a clue what could be wrong.


Regards,

Gabriel C

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-11 13:09             ` Gabriel C
@ 2017-02-11 14:21               ` Borislav Petkov
  2017-02-11 20:58                 ` Gabriel C
  0 siblings, 1 reply; 52+ messages in thread
From: Borislav Petkov @ 2017-02-11 14:21 UTC (permalink / raw)
  To: Gabriel C
  Cc: Thomas Gleixner, Linus Torvalds, Greg KH,
	Linux Kernel Mailing List, Andrew Morton, stable, lwn,
	Jiri Slaby, Ruslan Ruslichenko

On Sat, Feb 11, 2017 at 02:09:14PM +0100, Gabriel C wrote:
> Adding ' dis_ucode_ldr ' to commandline makes the kernel hangs right after :

Wait a minute, are you saying that without dis_ucode_ldr you can't even
boot so far?

> clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x20ac7f6ecc6, max_idle_ns: 440795315461 ns
> ...
> 
> and I have the bug triggered really quick..
> 
> Also I cannot get netconsole to work , I'm sure is some problem here local and I don't have
> any serial cable around right now. The only way I saw now to give you at least some ifo is to
> make an video of that crash. You can find it there :
> 
> http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/crash.mp4

Watchdog fires on all cores showing they're all idle. For some reason,
not all cores get to dump the watchdog splat, though. Some seem really
stuck.

And you have TAINT_FIRMWARE_WORKAROUND due to
intel_prepare_irq_remapping() noticing intr remapping is broken on that
box.

Would be better if you could disable that frugalware splash screen and
switch to grub console mode so that we can see the very beginning of the
boot.

Btw, your BIOS is from 2013. Is there new one, per chance, on your
vendor's site? Might wanna consider updating it...

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-11 14:21               ` Borislav Petkov
@ 2017-02-11 20:58                 ` Gabriel C
  2017-02-11 21:32                   ` Borislav Petkov
  0 siblings, 1 reply; 52+ messages in thread
From: Gabriel C @ 2017-02-11 20:58 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Thomas Gleixner, Linus Torvalds, Greg KH,
	Linux Kernel Mailing List, Andrew Morton, stable, lwn,
	Jiri Slaby, Ruslan Ruslichenko



On 11.02.2017 15:21, Borislav Petkov wrote:
> On Sat, Feb 11, 2017 at 02:09:14PM +0100, Gabriel C wrote:
>> Adding ' dis_ucode_ldr ' to commandline makes the kernel hangs right after :
>
> Wait a minute, are you saying that without dis_ucode_ldr you can't even
> boot so far?

Yes , it will hang before tsc message ..
Also sometimes I have same trace sometimes it just hangs forever.


>
>> clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x20ac7f6ecc6, max_idle_ns: 440795315461 ns
>> ...
>>
>> and I have the bug triggered really quick..
>>
>> Also I cannot get netconsole to work , I'm sure is some problem here local and I don't have
>> any serial cable around right now. The only way I saw now to give you at least some ifo is to
>> make an video of that crash. You can find it there :
>>
>> http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/crash.mp4
>
> Watchdog fires on all cores showing they're all idle. For some reason,
> not all cores get to dump the watchdog splat, though. Some seem really
> stuck.
>
> And you have TAINT_FIRMWARE_WORKAROUND due to
> intel_prepare_irq_remapping() noticing intr remapping is broken on that
> box.

Well yes and I'm not so sure is really broken.. I reverted the patch blacklisted my box right after it was addeded
the time and I don't have any issues .. however since I don't have a use of that feature I don't really care is marked broken or not..

>
> Would be better if you could disable that frugalware splash screen and
> switch to grub console mode so that we can see the very beginning of the
> boot.

I do that tomorrow ...

>
> Btw, your BIOS is from 2013. Is there new one, per chance, on your
> vendor's site? Might wanna consider updating it...
>


This BIOS was / is newest one :(

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-11 20:58                 ` Gabriel C
@ 2017-02-11 21:32                   ` Borislav Petkov
  2017-02-12 20:21                     ` Gabriel C
  0 siblings, 1 reply; 52+ messages in thread
From: Borislav Petkov @ 2017-02-11 21:32 UTC (permalink / raw)
  To: Gabriel C
  Cc: Thomas Gleixner, Linus Torvalds, Greg KH,
	Linux Kernel Mailing List, Andrew Morton, stable, lwn,
	Jiri Slaby, Ruslan Ruslichenko

On Sat, Feb 11, 2017 at 09:58:26PM +0100, Gabriel C wrote:
> Yes , it will hang before tsc message ..
> Also sometimes I have same trace sometimes it just hangs forever.

It doesn't sound like dis_ucode_ldr changes anything. Or maybe it does,
maybe the microcode applies some fix for some erratum or whatnot.

Right, so please disable that splash screen and do a boot video again
without the dis_ucode_ldr option.

Thanks.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-11 21:32                   ` Borislav Petkov
@ 2017-02-12 20:21                     ` Gabriel C
  2017-02-12 21:12                       ` Borislav Petkov
  0 siblings, 1 reply; 52+ messages in thread
From: Gabriel C @ 2017-02-12 20:21 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Thomas Gleixner, Linus Torvalds, Greg KH,
	Linux Kernel Mailing List, Andrew Morton, stable, lwn,
	Jiri Slaby, Ruslan Ruslichenko



On 11.02.2017 22:32, Borislav Petkov wrote:
> On Sat, Feb 11, 2017 at 09:58:26PM +0100, Gabriel C wrote:
>> Yes , it will hang before tsc message ..
>> Also sometimes I have same trace sometimes it just hangs forever.
>
> It doesn't sound like dis_ucode_ldr changes anything. Or maybe it does,
> maybe the microcode applies some fix for some erratum or whatnot.

Well the bug is still there but at least something in microcode code seems to
trigger too..

Also when it hangs it looks like this :

http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/crash2.jpg

Will stay like this forever.. no trace or something.

>
> Right, so please disable that splash screen and do a boot video again
> without the dis_ucode_ldr option.
>

The problem was vga=.. option ,  not the splash :)

There is what I get :

http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/crash2.mp4

With dis_ucode_ldr there is some more output , with it will stay like this , nothing more.

Alo I disabled all 'VT-d' in BIOS .. it doesn't make any difference.

Regards,

Gabriel C

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-12 20:21                     ` Gabriel C
@ 2017-02-12 21:12                       ` Borislav Petkov
  2017-02-12 22:21                         ` Gabriel C
  0 siblings, 1 reply; 52+ messages in thread
From: Borislav Petkov @ 2017-02-12 21:12 UTC (permalink / raw)
  To: Gabriel C
  Cc: Thomas Gleixner, Linus Torvalds, Greg KH,
	Linux Kernel Mailing List, Andrew Morton, stable, lwn,
	Jiri Slaby, Ruslan Ruslichenko

On Sun, Feb 12, 2017 at 09:21:53PM +0100, Gabriel C wrote:
> There is what I get :
> 
> http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/crash2.mp4

Ok, I'm watching it frame-by-frame. I can see the microcode getting
updated to revision 0x19 as in your working dmesg.

The machine hangs here at the

clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x20ac7f6ecc6, max_idle_ns: 440795315461 ns

line too. The exact same numbers even as in the previous run! Strange.

> With dis_ucode_ldr there is some more output , with it will stay like this , nothing more.

Ok, can you do redo the first video but with "initcall_debug" on the
kernel command line?

And then do video of another run with "initcall_debug dis_ucode_ldr" on
the kernel command line?

I'd like to see which of the initcalls doesn't return.

Thanks!

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-12 21:12                       ` Borislav Petkov
@ 2017-02-12 22:21                         ` Gabriel C
  2017-02-13  0:38                           ` Borislav Petkov
  0 siblings, 1 reply; 52+ messages in thread
From: Gabriel C @ 2017-02-12 22:21 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Thomas Gleixner, Linus Torvalds, Greg KH,
	Linux Kernel Mailing List, Andrew Morton, stable, lwn,
	Jiri Slaby, Ruslan Ruslichenko



On 12.02.2017 22:12, Borislav Petkov wrote:
> On Sun, Feb 12, 2017 at 09:21:53PM +0100, Gabriel C wrote:
>> There is what I get :
>>
>> http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/crash2.mp4
>
> Ok, I'm watching it frame-by-frame. I can see the microcode getting
> updated to revision 0x19 as in your working dmesg.
>
> The machine hangs here at the
>
> clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x20ac7f6ecc6, max_idle_ns: 440795315461 ns
>
> line too. The exact same numbers even as in the previous run! Strange.
>
>> With dis_ucode_ldr there is some more output , with it will stay like this , nothing more.
>
> Ok, can you do redo the first video but with "initcall_debug" on the
> kernel command line?
>
> And then do video of another run with "initcall_debug dis_ucode_ldr" on
> the kernel command line?
>
> I'd like to see which of the initcalls doesn't return.

There are both videos .. however the output seems kind same this time..

http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/crash_initcall_debug.mp4
http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/crash_intcall_debug_ucode_off.mp4

I try to find out more tomorrow but right now I don't even have a clue
where to add some printk's to get some more output :(

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-12 22:21                         ` Gabriel C
@ 2017-02-13  0:38                           ` Borislav Petkov
  2017-02-13  1:26                             ` Gabriel C
  0 siblings, 1 reply; 52+ messages in thread
From: Borislav Petkov @ 2017-02-13  0:38 UTC (permalink / raw)
  To: Gabriel C
  Cc: Thomas Gleixner, Linus Torvalds, Greg KH,
	Linux Kernel Mailing List, Andrew Morton, stable, lwn,
	Jiri Slaby, Ruslan Ruslichenko

On Sun, Feb 12, 2017 at 11:21:13PM +0100, Gabriel C wrote:
> http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/crash_initcall_debug.mp4
> http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/crash_intcall_debug_ucode_off.mp4

Thanks and interesting. In both cases, mcheck_init_device() doesn't
return or we don't see the "initcall returned" message.

Ok, let's try a silly sprinkling of printks in that function and try to
pinpoint how far we manage to come.

Apply, build, boot and shoot video again :-)

Thanks.

---
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 8e9725c607ea..70268867cb33 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -2565,37 +2565,57 @@ static __init int mcheck_init_device(void)
 	enum cpuhp_state hp_online;
 	int err;
 
+	pr_err("%s: entry\n", __func__);
+
 	if (!mce_available(&boot_cpu_data)) {
 		err = -EIO;
 		goto err_out;
 	}
 
+	pr_err("%s: mce_available\n", __func__);
+
 	if (!zalloc_cpumask_var(&mce_device_initialized, GFP_KERNEL)) {
 		err = -ENOMEM;
 		goto err_out;
 	}
 
+	pr_err("%s: zalloc_cpumask_var\n", __func__);
+
 	mce_init_banks();
 
+	pr_err("%s: mce_init_banks\n", __func__);
+
 	err = subsys_system_register(&mce_subsys, NULL);
 	if (err)
 		goto err_out_mem;
 
+	pr_err("%s: subsys_system_register\n", __func__);
+
 	err = cpuhp_setup_state(CPUHP_X86_MCE_DEAD, "x86/mce:dead", NULL,
 				mce_cpu_dead);
 	if (err)
 		goto err_out_mem;
 
+	pr_err("%s: x86/mce:dead\n", __func__);
+
 	err = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "x86/mce:online",
 				mce_cpu_online, mce_cpu_pre_down);
 	if (err < 0)
 		goto err_out_online;
+
+	pr_err("%s: x86/mce:online\n", __func__);
+
 	hp_online = err;
 
 	register_syscore_ops(&mce_syscore_ops);
 
+	pr_err("%s: register_syscore_ops\n", __func__);
+
 	/* register character device /dev/mcelog */
 	err = misc_register(&mce_chrdev_device);
+
+	pr_err("%s: misc_register, err: 0x%x\n", __func__, err);
+
 	if (err)
 		goto err_register;
 

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13  0:38                           ` Borislav Petkov
@ 2017-02-13  1:26                             ` Gabriel C
  2017-02-13  2:31                               ` Mike Galbraith
  2017-02-13 10:28                               ` Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box ) Borislav Petkov
  0 siblings, 2 replies; 52+ messages in thread
From: Gabriel C @ 2017-02-13  1:26 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Thomas Gleixner, Linus Torvalds, Greg KH,
	Linux Kernel Mailing List, Andrew Morton, stable, lwn,
	Jiri Slaby, Ruslan Ruslichenko



On 13.02.2017 01:38, Borislav Petkov wrote:
> On Sun, Feb 12, 2017 at 11:21:13PM +0100, Gabriel C wrote:
>> http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/crash_initcall_debug.mp4
>> http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/crash_intcall_debug_ucode_off.mp4
>
> Thanks and interesting. In both cases, mcheck_init_device() doesn't
> return or we don't see the "initcall returned" message.
>
> Ok, let's try a silly sprinkling of printks in that function and try to
> pinpoint how far we manage to come.
>
> Apply, build, boot and shoot video again :-)
>

I didn't tested your patch yet but did a boot with mce=off and nomce which seems to not
really works since is still want to mc_device_add() even when off.

See :


http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/crash_mce_off.jpg

I'll build an .10-rc8 with your patch tomorrow .. is somewhat late now here :)


Another thing is .. there seems to be a real bug in tsc code .

I've build an -rc8 with a lot more debug options on an now I see the following :

...

[    4.321029] =================================
[    4.321909] [ INFO: inconsistent lock state ]
[    4.322789] 4.10.0-rc8-debug #1 Tainted: G          I
[    4.323879] ---------------------------------
[    4.324759] inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
[    4.325973] cpuhp/0/14 [HC0[0]:SC0[0]:HE1:SE1] takes:
[    4.326993]  (tick_broadcast_lock){?.....}, at: [<ffffffff810f40e7>] tick_broadcast_control+0x57/0x190
[    4.328879] {IN-HARDIRQ-W} state was registered at:
[    4.329866]   __lock_acquire+0x24f/0x19e0
[    4.330675]   lock_acquire+0xa5/0xd0
[    4.331399]   _raw_spin_lock_irqsave+0x54/0x90
[    4.332297]   tick_broadcast_switch_to_oneshot+0x11/0x50
[    4.333371]   tick_switch_to_oneshot+0x8c/0xd0
[    4.334269]   tick_init_highres+0x10/0x20
[    4.335079]   hrtimer_run_queues+0x5a/0xe0
[    4.335907]   run_local_timers+0x20/0x50
[    4.336699]   update_process_times+0x22/0x50
[    4.337562]   tick_periodic+0xa5/0xb0
[    4.338302]   tick_handle_periodic+0x1f/0x60
[    4.378065]   smp_trace_apic_timer_interrupt+0x74/0x90
[    4.418107]   smp_apic_timer_interrupt+0x9/0x10
[    4.458095]   apic_timer_interrupt+0x93/0xa0
[    4.498048]   mwait_idle+0x5a/0x90
[    4.537618]   arch_cpu_idle+0xa/0x10
[    4.577098]   default_idle_call+0x2c/0x30
[    4.616211]   do_idle+0x10c/0x1e0
[    4.654606]   cpu_startup_entry+0x5d/0x60
[    4.692388]   rest_init+0x12c/0x140
[    4.729557]   start_kernel+0x45f/0x46c
[    4.766325]   x86_64_start_reservations+0x2a/0x2c
[    4.803075]   x86_64_start_kernel+0xeb/0xf8
[    4.839178]   verify_cpu+0x0/0xfc
[    4.874629] irq event stamp: 71
[    4.909417] hardirqs last  enabled at (71): [<ffffffff8176a887>] _raw_spin_unlock_irq+0x27/0x50
[    4.945642] hardirqs last disabled at (70): [<ffffffff81762eaa>] __schedule+0x13a/0x7c0
[    4.981797] softirqs last  enabled at (0): [<ffffffff81060ef0>] copy_process+0x7c0/0x1ea0
[    5.018580] softirqs last disabled at (0): [<          (null)>]           (null)
[    5.055677]
                other info that might help us debug this:
[    5.072455] tsc: Refined TSC clocksource calibration: 2266.746 MHz
[    5.072467] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x20ac7f6ecc6, max_idle_ns: 440795315461 ns
[    5.202828]  Possible unsafe locking scenario:


^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This seems to be the place where the other patch breaks hell here..


[    5.276704]        CPU0
[    5.312400]        ----
[    5.347605]   lock(tick_broadcast_lock);
[    5.383163]   <Interrupt>
[    5.418457]     lock(tick_broadcast_lock);
[    5.454015]
                 *** DEADLOCK ***

[    5.557982] no locks held by cpuhp/0/14.
[    5.592295]
                stack backtrace:
[    5.657946] CPU: 0 PID: 14 Comm: cpuhp/0 Tainted: G          I     4.10.0-rc8-debug #1
[    5.690740] Hardware name: FUJITSU                          PRIMERGY TX200 S5             /D2709, BIOS 6.00 Rev. 1.14.2709              02/04/2013
[    5.758323] Call Trace:
[    5.791434]  dump_stack+0x86/0xc1
[    5.824421]  print_usage_bug+0x283/0x2a0
[    5.857357]  mark_lock+0x39e/0x650
[    5.890256]  ? check_usage_forwards+0xf0/0xf0
[    5.923436]  __lock_acquire+0x2ba/0x19e0
[    5.956617]  ? pick_next_task_fair+0x350/0x700
[    5.989903]  ? finish_task_switch+0x184/0x220
[    6.023171]  ? debug_smp_processor_id+0x17/0x20
[    6.056667]  lock_acquire+0xa5/0xd0
[    6.089882]  ? tick_broadcast_control+0x57/0x190
[    6.123395]  ? smpboot_thread_fn+0x28/0x250
[    6.156838]  _raw_spin_lock+0x3c/0x80
[    6.190175]  ? tick_broadcast_control+0x57/0x190
[    6.223914]  tick_broadcast_control+0x57/0x190
[    6.257846]  ? finish_task_switch+0x184/0x220
[    6.291900]  ? smpboot_thread_fn+0x28/0x250
[    6.325991]  intel_idle_cpu_online+0x1d/0x100
[    6.360220]  cpuhp_invoke_callback+0x62/0x120
[    6.394397]  ? smpboot_thread_fn+0x28/0x250
[    6.428451]  cpuhp_thread_fun+0x87/0x110
[    6.462611]  smpboot_thread_fn+0x227/0x250
[    6.496805]  kthread+0x125/0x130
[    6.530947]  ? sort_range+0x20/0x20
[    6.564126]  ? kthread_stop+0x70/0x70
[    6.597078]  ret_from_fork+0x31/0x40
[    6.630787] clocksource: Switched to clocksource tsc

...


Maybe Thomas has some ideas ?


Regards,

Gabriel C

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13  1:26                             ` Gabriel C
@ 2017-02-13  2:31                               ` Mike Galbraith
       [not found]                                 ` <CA+55aFzC33RgUDbb-tn9+ANJtD_R2+FzjJihnT_kGk-h+nTD1Q@mail.gmail.com>
                                                   ` (2 more replies)
  2017-02-13 10:28                               ` Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box ) Borislav Petkov
  1 sibling, 3 replies; 52+ messages in thread
From: Mike Galbraith @ 2017-02-13  2:31 UTC (permalink / raw)
  To: Gabriel C, Borislav Petkov
  Cc: Thomas Gleixner, Linus Torvalds, Greg KH,
	Linux Kernel Mailing List, Andrew Morton, stable, lwn,
	Jiri Slaby, Ruslan Ruslichenko

On Mon, 2017-02-13 at 02:26 +0100, Gabriel C wrote:

> [    5.276704]        CPU0
> [    5.312400]        ----
> [    5.347605]   lock(tick_broadcast_lock);
> [    5.383163]   
> [    5.418457]     lock(tick_broadcast_lock);
> [    5.454015]
>                  *** DEADLOCK ***
> 
> [    5.557982] no locks held by cpuhp/0/14.

Oh, that looks familiar...

tick/broadcast: Make tick_broadcast_control() use raw_spinlock_irqsave()

Otherwise we end up with the lockdep splat below:

[   12.703619] =================================
[   12.703619] [ INFO: inconsistent lock state ]
[   12.703621] 4.10.0-rt1-rt #18 Not tainted
[   12.703622] ---------------------------------
[   12.703623] inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
[   12.703624] cpuhp/0/23 [HC0[0]:SC0[0]:HE1:SE1] takes:
[   12.703625]  (tick_broadcast_lock){?.....}, at: [<ffffffff81123f9a>] tick_broadcast_control+0x5a/0x1a0
[   12.703632] {IN-HARDIRQ-W} state was registered at:
[   12.703637] [<ffffffff810e3511>] __lock_acquire+0xa21/0x1550
[   12.703639] [<ffffffff810e444d>] lock_acquire+0xbd/0x250
[   12.703642] [<ffffffff81703723>] _raw_spin_lock_irqsave+0x53/0x70
[   12.703644] [<ffffffff811240f6>] tick_broadcast_switch_to_oneshot+0x16/0x50
[   12.703646] [<ffffffff811244d9>] tick_switch_to_oneshot+0x59/0xd0
[   12.703647] [<ffffffff811245e5>] tick_init_highres+0x15/0x20
[   12.703652] [<ffffffff811134cf>] hrtimer_run_queues+0x9f/0xe0
[   12.703654] [<ffffffff81111155>] run_local_timers+0x25/0x60
[   12.703656] [<ffffffff811111bc>] update_process_times+0x2c/0x60
[   12.703659] [<ffffffff8112256f>] tick_periodic+0x2f/0x100
[   12.703661] [<ffffffff81122664>] tick_handle_periodic+0x24/0x70
[   12.703664] [<ffffffff810485d3>] local_apic_timer_interrupt+0x33/0x60
[   12.703669] [<ffffffff81706f18>] smp_apic_timer_interrupt+0x38/0x50
[   12.703671] [<ffffffff81705f2d>] apic_timer_interrupt+0x9d/0xb0
[   12.703672] [<ffffffff81702b54>] mwait_idle+0x94/0x290
[   12.703676] [<ffffffff8102862f>] arch_cpu_idle+0xf/0x20
[   12.703677] [<ffffffff817030c1>] default_idle_call+0x31/0x60
[   12.703681] [<ffffffff810d7575>] do_idle+0x175/0x290
[   12.703683] [<ffffffff810d79b8>] cpu_startup_entry+0x48/0x50
[   12.703687] [<ffffffff81046833>] start_secondary+0x133/0x160
[   12.703689] [<ffffffff810001c4>] verify_cpu+0x0/0xfc
[   12.703690] irq event stamp: 71
[   12.703691] hardirqs last  enabled at (71): [<ffffffff8170376c>] _raw_spin_unlock_irq+0x2c/0x80
[   12.703696] hardirqs last disabled at (70): [<ffffffff816ff0dc>] __schedule+0x9c/0x7e0
[   12.703699] softirqs last  enabled at (0): [<ffffffff8107ba11>] copy_process.part.34+0x5f1/0x22d0
[   12.703700] softirqs last disabled at (0): [<          (null)>]           (null)
[   12.703701] 
[   12.703701] other info that might help us debug this:
[   12.703701]  Possible unsafe locking scenario:
[   12.703701] 
[   12.703701]        CPU0
[   12.703702]        ----
[   12.703702]   lock(tick_broadcast_lock);
[   12.703703]   <Interrupt>
[   12.703704]     lock(tick_broadcast_lock);
[   12.703705] 
[   12.703705]  *** DEADLOCK ***
[   12.703705] 
[   12.703705] no locks held by cpuhp/0/23.
[   12.703705] 
[   12.703705] stack backtrace:
[   12.703707] CPU: 0 PID: 23 Comm: cpuhp/0 Not tainted 4.10.0-rt1-rt #18
[   12.703708] Hardware name: Hewlett-Packard ProLiant DL980 G7, BIOS P66 07/07/2010
[   12.703709] Call Trace:
[   12.703715]  dump_stack+0x85/0xc8
[   12.703717]  print_usage_bug+0x1ea/0x1fb
[   12.703719]  ? print_shortest_lock_dependencies+0x1c0/0x1c0
[   12.703721]  mark_lock+0x20d/0x290
[   12.703723]  __lock_acquire+0x8e6/0x1550
[   12.703724]  ? __lock_acquire+0x2ce/0x1550
[   12.703726]  ? load_balance+0x1b4/0xaf0
[   12.703728]  lock_acquire+0xbd/0x250
[   12.703729]  ? tick_broadcast_control+0x5a/0x1a0
[   12.703735]  ? efifb_probe+0x170/0x170
[   12.703736]  _raw_spin_lock+0x3b/0x50
[   12.703737]  ? tick_broadcast_control+0x5a/0x1a0
[   12.703738]  tick_broadcast_control+0x5a/0x1a0
[   12.703740]  ? efifb_probe+0x170/0x170
[   12.703742]  intel_idle_cpu_online+0x22/0x100
[   12.703744]  cpuhp_invoke_callback+0x245/0x9d0
[   12.703747]  ? finish_task_switch+0x78/0x290
[   12.703750]  ? check_preemption_disabled+0x9f/0x130
[   12.703752]  cpuhp_thread_fun+0x52/0x110
[   12.703754]  smpboot_thread_fn+0x276/0x320
[   12.703757]  kthread+0x10c/0x140
[   12.703759]  ? smpboot_update_cpumask_percpu_thread+0x130/0x130
[   12.703760]  ? kthread_park+0x90/0x90
[   12.703762]  ret_from_fork+0x2a/0x40
[   12.709790] intel_idle: lapic_timer_reliable_states 0x2

Signed-off-by: Mike Galbraith <efault@gmx.de>
---
 kernel/time/tick-broadcast.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -357,6 +357,7 @@ void tick_broadcast_control(enum tick_br
 	struct clock_event_device *bc, *dev;
 	struct tick_device *td;
 	int cpu, bc_stopped;
+	unsigned long flags;
 
 	td = this_cpu_ptr(&tick_cpu_device);
 	dev = td->evtdev;
@@ -370,7 +371,7 @@ void tick_broadcast_control(enum tick_br
 	if (!tick_device_is_functional(dev))
 		return;
 
-	raw_spin_lock(&tick_broadcast_lock);
+	raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
 	cpu = smp_processor_id();
 	bc = tick_broadcast_device.evtdev;
 	bc_stopped = cpumask_empty(tick_broadcast_mask);
@@ -420,7 +421,7 @@ void tick_broadcast_control(enum tick_br
 				tick_broadcast_setup_oneshot(bc);
 		}
 	}
-	raw_spin_unlock(&tick_broadcast_lock);
+	raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);
 }
 EXPORT_SYMBOL_GPL(tick_broadcast_control);
 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
       [not found]                                 ` <CA+55aFzC33RgUDbb-tn9+ANJtD_R2+FzjJihnT_kGk-h+nTD1Q@mail.gmail.com>
@ 2017-02-13  5:48                                   ` Gabriel C
  2017-02-13 14:05                                     ` Thomas Gleixner
  2017-02-13 18:35                                     ` Linus Torvalds
  0 siblings, 2 replies; 52+ messages in thread
From: Gabriel C @ 2017-02-13  5:48 UTC (permalink / raw)
  To: Linus Torvalds, Mike Galbraith
  Cc: Thomas Gleixner, Greg Kroah-Hartman, Borislav Petkov, stable,
	Andrew Morton, Ruslan Ruslichenko, Jiri Slaby



On 13.02.2017 05:36, Linus Torvalds wrote:
> On Feb 12, 2017 18:32, "Mike Galbraith" <efault@gmx.de> wrote:
>
>
> tick/broadcast: Make tick_broadcast_control() use raw_spinlock_irqsave()
>
>
> Gabriel, does this patch fix your problem even without the revert (note
> that the revert is already in rc8, so if you apply Mike's patch on top of
> current kernel sources you should revert the revert to test)

Yes I know .. I have 2 kernels one with and one without the revert.

Mike's patch fixes the warning I see in rc8 with the revert but won't fix the problem with reverted revert...

Also now I get a new warning :

...

[   81.518032] ======================================================
[   81.520151] [ INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected ]
[   81.522276] 4.10.0-rc8-debug-dirty #1 Tainted: G          I
[   81.524445] ------------------------------------------------------
[   81.526560] (systemd)/1725 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
[   81.528672]  (((&rwb->window_timer))){+.-...}, at: [<ffffffff810e38e0>] del_timer_sync+0x0/0xd0
[   81.530973]
                and this task is already holding:
[   81.535399]  (&(&q->__queue_lock)->rlock){-.-...}, at: [<ffffffff81378fc0>] cfq_set_request+0x80/0x2c0
[   81.537637] which would create a new lock dependency:
[   81.539870]  (&(&q->__queue_lock)->rlock){-.-...} -> (((&rwb->window_timer))){+.-...}
[   81.542145]
                but this new dependency connects a HARDIRQ-irq-safe lock:
[   81.546717]  (&(&q->__queue_lock)->rlock){-.-...}
[   81.546720]
                ... which became HARDIRQ-irq-safe at:
[   81.553643]   __lock_acquire+0x24f/0x19e0
[   81.555970]   lock_acquire+0xa5/0xd0
[   81.558302]   _raw_spin_lock_irqsave+0x54/0x90
[   81.560667]   ata_qc_schedule_eh+0x56/0x80 [libata]
[   81.563035]   ata_qc_complete+0x99/0x1c0 [libata]
[   81.565410]   ata_do_link_abort+0x93/0xd0 [libata]
[   81.567786]   ata_port_abort+0xb/0x10 [libata]
[   81.570150]   ahci_handle_port_interrupt+0x41e/0x570 [libahci]
[   81.572533]   ahci_handle_port_intr+0x74/0xb0 [libahci]
[   81.574918]   ahci_single_level_irq_intr+0x3b/0x60 [libahci]
[   81.577311]   __handle_irq_event_percpu+0x35/0x100
[   81.579696]   handle_irq_event_percpu+0x1e/0x50
[   81.582065]   handle_irq_event+0x34/0x60
[   81.584427]   handle_edge_irq+0x112/0x140
[   81.586776]   handle_irq+0x18/0x20
[   81.589109]   do_IRQ+0x87/0x110
[   81.591403]   ret_from_intr+0x0/0x20
[   81.593666]   cpuidle_enter_state+0x102/0x230
[   81.595939]   cpuidle_enter+0x12/0x20
[   81.598202]   call_cpuidle+0x38/0x40
[   81.600443]   do_idle+0x16e/0x1e0
[   81.602670]   cpu_startup_entry+0x5d/0x60
[   81.604890]   rest_init+0x12c/0x140
[   81.607080]   start_kernel+0x45f/0x46c
[   81.609252]   x86_64_start_reservations+0x2a/0x2c
[   81.611399]   x86_64_start_kernel+0xeb/0xf8
[   81.613505]   verify_cpu+0x0/0xfc
[   81.615574]
                to a HARDIRQ-irq-unsafe lock:
[   81.619611]  (((&rwb->window_timer))){+.-...}
[   81.619614]
                ... which became HARDIRQ-irq-unsafe at:
[   81.625562] ...
[   81.625565]   __lock_acquire+0x2ba/0x19e0
[   81.629504]   lock_acquire+0xa5/0xd0
[   81.631467]   call_timer_fn+0x74/0x110
[   81.633397]   expire_timers+0xaa/0xd0
[   81.635287]   run_timer_softirq+0x72/0x140
[   81.637145]   __do_softirq+0x143/0x290
[   81.638974]   irq_exit+0x6a/0xd0
[   81.640818]   smp_trace_apic_timer_interrupt+0x79/0x90
[   81.642698]   smp_apic_timer_interrupt+0x9/0x10
[   81.644572]   apic_timer_interrupt+0x93/0xa0
[   81.646445]   cpuidle_enter_state+0x102/0x230
[   81.648332]   cpuidle_enter+0x12/0x20
[   81.650211]   call_cpuidle+0x38/0x40
[   81.652096]   do_idle+0x16e/0x1e0
[   81.653984]   cpu_startup_entry+0x5d/0x60
[   81.655855]   start_secondary+0x150/0x180
[   81.657696]   verify_cpu+0x0/0xfc
[   81.659497]
                other info that might help us debug this:

[   81.664802]  Possible interrupt unsafe locking scenario:

[   81.668296]        CPU0                    CPU1
[   81.670010]        ----                    ----
[   81.671685]   lock(((&rwb->window_timer)));
[   81.673358]                                local_irq_disable();
[   81.675018]                                lock(&(&q->__queue_lock)->rlock);
[   81.676659]                                lock(((&rwb->window_timer)));
[   81.678275]   <Interrupt>
[   81.679845]     lock(&(&q->__queue_lock)->rlock);
[   81.681419]
                 *** DEADLOCK ***

[   81.685989] 1 lock held by (systemd)/1725:
[   81.687518]  #0:  (&(&q->__queue_lock)->rlock){-.-...}, at: [<ffffffff81378fc0>] cfq_set_request+0x80/0x2c0
[   81.689125]
                the dependencies between HARDIRQ-irq-safe lock and the holding lock:
[   81.692327] -> (&(&q->__queue_lock)->rlock){-.-...} ops: 70140 {
[   81.693971]    IN-HARDIRQ-W at:
[   81.695606]                     __lock_acquire+0x24f/0x19e0
[   81.697262]                     lock_acquire+0xa5/0xd0
[   81.698906]                     _raw_spin_lock_irqsave+0x54/0x90
[   81.700568]                     ata_qc_schedule_eh+0x56/0x80 [libata]
[   81.702229]                     ata_qc_complete+0x99/0x1c0 [libata]
[   81.703884]                     ata_do_link_abort+0x93/0xd0 [libata]
[   81.705540]                     ata_port_abort+0xb/0x10 [libata]
[   81.707199]                     ahci_handle_port_interrupt+0x41e/0x570 [libahci]
[   81.708881]                     ahci_handle_port_intr+0x74/0xb0 [libahci]
[   81.710563]                     ahci_single_level_irq_intr+0x3b/0x60 [libahci]
[   81.712256]                     __handle_irq_event_percpu+0x35/0x100
[   81.713952]                     handle_irq_event_percpu+0x1e/0x50
[   81.715651]                     handle_irq_event+0x34/0x60
[   81.717350]                     handle_edge_irq+0x112/0x140
[   81.719050]                     handle_irq+0x18/0x20
[   81.720744]                     do_IRQ+0x87/0x110
[   81.722432]                     ret_from_intr+0x0/0x20
[   81.724123]                     cpuidle_enter_state+0x102/0x230
[   81.725823]                     cpuidle_enter+0x12/0x20
[   81.727509]                     call_cpuidle+0x38/0x40
[   81.729196]                     do_idle+0x16e/0x1e0
[   81.730879]                     cpu_startup_entry+0x5d/0x60
[   81.732565]                     rest_init+0x12c/0x140
[   81.734246]                     start_kernel+0x45f/0x46c
[   81.735927]                     x86_64_start_reservations+0x2a/0x2c
[   81.737617]                     x86_64_start_kernel+0xeb/0xf8
[   81.739297]                     verify_cpu+0x0/0xfc
[   81.740964]    IN-SOFTIRQ-W at:
[   81.742628]                     __lock_acquire+0x268/0x19e0
[   81.744311]                     lock_acquire+0xa5/0xd0
[   81.745994]                     _raw_spin_lock_irqsave+0x54/0x90
[   81.747699]                     scsi_end_request+0x144/0x1a0 [scsi_mod]
[   81.749417]                     scsi_io_completion+0x268/0x610 [scsi_mod]
[   81.751133]                     scsi_finish_command+0x103/0x110 [scsi_mod]
[   81.752856]                     scsi_softirq_done+0x11f/0x130 [scsi_mod]
[   81.754575]                     blk_done_softirq+0x9b/0xb0
[   81.756288]                     __do_softirq+0x143/0x290
[   81.757992]                     irq_exit+0x6a/0xd0
[   81.759688]                     smp_trace_apic_timer_interrupt+0x79/0x90
[   81.761407]                     smp_apic_timer_interrupt+0x9/0x10
[   81.763131]                     apic_timer_interrupt+0x93/0xa0
[   81.764862]                     _raw_spin_unlock_irqrestore+0x47/0x70
[   81.766606]                     release_pages+0x51/0x390
[   81.768347]                     free_pages_and_swap_cache+0x2a/0xb0
[   81.770100]                     tlb_flush_mmu_free+0x34/0x50
[   81.771851]                     tlb_finish_mmu+0x17/0x50
[   81.773592]                     unmap_region+0xe8/0x100
[   81.775322]                     do_munmap+0x264/0x3e0
[   81.777040]                     SyS_munmap+0x49/0x70
[   81.778752]                     entry_SYSCALL_64_fastpath+0x1f/0xc2
[   81.780483]    INITIAL USE at:
[   81.782221]                    __lock_acquire+0x1c9/0x19e0
[   81.783978]                    lock_acquire+0xa5/0xd0
[   81.785721]                    _raw_spin_lock_irq+0x48/0x80
[   81.787470]                    blkcg_init_queue+0xad/0x1b0
[   81.789217]                    blk_alloc_queue_node+0x27d/0x2d0
[   81.790959]                    blk_mq_init_queue+0x1b/0x60
[   81.792695]                    loop_add+0xf4/0x280
[   81.794427]                    loop_init+0x101/0x142
[   81.796166]                    do_one_initcall+0x6f/0x190
[   81.797914]                    kernel_init_freeable+0x321/0x3b7
[   81.799659]                    kernel_init+0x9/0xf0
[   81.801360]                    ret_from_fork+0x31/0x40
[   81.803029]  }
[   81.804660]  ... key      at: [<ffffffff82f1e728>] __key.42689+0x0/0x8
[   81.806315]  ... acquired at:
[   81.807937]    check_irq_usage+0x4d/0xa0
[   81.809555]    __lock_acquire+0x1110/0x19e0
[   81.811176]    lock_acquire+0xa5/0xd0
[   81.812783]    del_timer_sync+0x49/0xd0
[   81.814385]    wbt_disable_default+0x1e/0x60
[   81.815991]    check_blkcg_changed+0x22d/0x380
[   81.817594]    cfq_set_request+0xe5/0x2c0
[   81.819194]    elv_set_request+0x1a/0x20
[   81.820775]    get_request+0x88d/0x900
[   81.822355]    blk_queue_bio+0x1e9/0x320
[   81.823925]    generic_make_request+0xbe/0x170
[   81.825492]    submit_bio+0x121/0x150
[   81.827050]    btrfs_map_bio+0x282/0x2a0
[   81.828613]    btree_submit_bio_hook+0x71/0xe0
[   81.830181]    submit_one_bio+0x65/0x90
[   81.831750]    read_extent_buffer_pages+0x1fa/0x2f0
[   81.833336]    btree_read_extent_buffer_pages+0x59/0xf0
[   81.834932]    read_tree_block+0x2d/0x50
[   81.836528]    read_block_for_search.isra.10+0x296/0x2e0
[   81.838140]    btrfs_search_slot+0x6cc/0x920
[   81.839754]    btrfs_lookup_csum+0x3e/0x120
[   81.841370]    __btrfs_lookup_bio_sums+0x258/0x4d0
[   81.842993]    btrfs_lookup_bio_sums+0x11/0x20
[   81.844621]    btrfs_submit_compressed_read+0x3d0/0x4c0
[   81.846259]    btrfs_submit_bio_hook+0xbb/0x170
[   81.847889]    submit_one_bio+0x65/0x90
[   81.849516]    extent_readpages+0x1dd/0x1f0
[   81.851145]    btrfs_readpages+0x1a/0x20
[   81.852769]    __do_page_cache_readahead+0x249/0x320
[   81.854396]    ondemand_readahead+0x47e/0x4b0
[   81.856025]    page_cache_sync_readahead+0x3c/0x40
[   81.857656]    generic_file_read_iter+0x20e/0x770
[   81.859279]    __vfs_read+0xe5/0x120
[   81.860897]    vfs_read+0xc7/0x170
[   81.862503]    SyS_read+0x44/0xa0
[   81.864102]    entry_SYSCALL_64_fastpath+0x1f/0xc2

[   81.867299]
                the dependencies between the lock to be acquired
[   81.867300]  and HARDIRQ-irq-unsafe lock:
[   81.872089] -> (((&rwb->window_timer))){+.-...} ops: 463 {
[   81.873716]    HARDIRQ-ON-W at:
[   81.875336]                     __lock_acquire+0x2ba/0x19e0
[   81.876969]                     lock_acquire+0xa5/0xd0
[   81.878598]                     call_timer_fn+0x74/0x110
[   81.880225]                     expire_timers+0xaa/0xd0
[   81.881853]                     run_timer_softirq+0x72/0x140
[   81.883486]                     __do_softirq+0x143/0x290
[   81.885127]                     irq_exit+0x6a/0xd0
[   81.886765]                     smp_trace_apic_timer_interrupt+0x79/0x90
[   81.888419]                     smp_apic_timer_interrupt+0x9/0x10
[   81.890066]                     apic_timer_interrupt+0x93/0xa0
[   81.891706]                     cpuidle_enter_state+0x102/0x230
[   81.893349]                     cpuidle_enter+0x12/0x20
[   81.894982]                     call_cpuidle+0x38/0x40
[   81.896610]                     do_idle+0x16e/0x1e0
[   81.898235]                     cpu_startup_entry+0x5d/0x60
[   81.899866]                     start_secondary+0x150/0x180
[   81.901497]                     verify_cpu+0x0/0xfc
[   81.903126]    IN-SOFTIRQ-W at:
[   81.904753]                     __lock_acquire+0x268/0x19e0
[   81.906402]                     lock_acquire+0xa5/0xd0
[   81.908052]                     call_timer_fn+0x74/0x110
[   81.909702]                     expire_timers+0xaa/0xd0
[   81.911347]                     run_timer_softirq+0x72/0x140
[   81.912980]                     __do_softirq+0x143/0x290
[   81.914605]                     irq_exit+0x6a/0xd0
[   81.916227]                     smp_trace_apic_timer_interrupt+0x79/0x90
[   81.917867]                     smp_apic_timer_interrupt+0x9/0x10
[   81.919510]                     apic_timer_interrupt+0x93/0xa0
[   81.921161]                     cpuidle_enter_state+0x102/0x230
[   81.922807]                     cpuidle_enter+0x12/0x20
[   81.924444]                     call_cpuidle+0x38/0x40
[   81.926082]                     do_idle+0x16e/0x1e0
[   81.927718]                     cpu_startup_entry+0x5d/0x60
[   81.929358]                     start_secondary+0x150/0x180
[   81.930996]                     verify_cpu+0x0/0xfc
[   81.932628]    INITIAL USE at:
[   81.934256]                    __lock_acquire+0x1c9/0x19e0
[   81.935907]                    lock_acquire+0xa5/0xd0
[   81.937550]                    call_timer_fn+0x74/0x110
[   81.939192]                    expire_timers+0xaa/0xd0
[   81.940826]                    run_timer_softirq+0x72/0x140
[   81.942456]                    __do_softirq+0x143/0x290
[   81.944075]                    irq_exit+0x6a/0xd0
[   81.945685]                    smp_trace_apic_timer_interrupt+0x79/0x90
[   81.947304]                    smp_apic_timer_interrupt+0x9/0x10
[   81.948926]                    apic_timer_interrupt+0x93/0xa0
[   81.950547]                    cpuidle_enter_state+0x102/0x230
[   81.952162]                    cpuidle_enter+0x12/0x20
[   81.953766]                    call_cpuidle+0x38/0x40
[   81.955369]                    do_idle+0x16e/0x1e0
[   81.956971]                    cpu_startup_entry+0x5d/0x60
[   81.958580]                    start_secondary+0x150/0x180
[   81.960191]                    verify_cpu+0x0/0xfc
[   81.961787]  }
[   81.963360]  ... key      at: [<ffffffff82f1f7e0>] __key.37597+0x0/0x8
[   81.964971]  ... acquired at:
[   81.966566]    check_irq_usage+0x4d/0xa0
[   81.968162]    __lock_acquire+0x1110/0x19e0
[   81.969767]    lock_acquire+0xa5/0xd0
[   81.971374]    del_timer_sync+0x49/0xd0
[   81.972973]    wbt_disable_default+0x1e/0x60
[   81.974574]    check_blkcg_changed+0x22d/0x380
[   81.976192]    cfq_set_request+0xe5/0x2c0
[   81.977800]    elv_set_request+0x1a/0x20
[   81.979384]    get_request+0x88d/0x900
[   81.980954]    blk_queue_bio+0x1e9/0x320
[   81.982506]    generic_make_request+0xbe/0x170
[   81.984057]    submit_bio+0x121/0x150
[   81.985606]    btrfs_map_bio+0x282/0x2a0
[   81.987157]    btree_submit_bio_hook+0x71/0xe0
[   81.988713]    submit_one_bio+0x65/0x90
[   81.990269]    read_extent_buffer_pages+0x1fa/0x2f0
[   81.991829]    btree_read_extent_buffer_pages+0x59/0xf0
[   81.993394]    read_tree_block+0x2d/0x50
[   81.994950]    read_block_for_search.isra.10+0x296/0x2e0
[   81.996513]    btrfs_search_slot+0x6cc/0x920
[   81.998073]    btrfs_lookup_csum+0x3e/0x120
[   81.999624]    __btrfs_lookup_bio_sums+0x258/0x4d0
[   82.001190]    btrfs_lookup_bio_sums+0x11/0x20
[   82.002767]    btrfs_submit_compressed_read+0x3d0/0x4c0
[   82.004352]    btrfs_submit_bio_hook+0xbb/0x170
[   82.005933]    submit_one_bio+0x65/0x90
[   82.007513]    extent_readpages+0x1dd/0x1f0
[   82.009092]    btrfs_readpages+0x1a/0x20
[   82.010667]    __do_page_cache_readahead+0x249/0x320
[   82.012241]    ondemand_readahead+0x47e/0x4b0
[   82.013816]    page_cache_sync_readahead+0x3c/0x40
[   82.015398]    generic_file_read_iter+0x20e/0x770
[   82.016989]    __vfs_read+0xe5/0x120
[   82.018577]    vfs_read+0xc7/0x170
[   82.020155]    SyS_read+0x44/0xa0
[   82.021731]    entry_SYSCALL_64_fastpath+0x1f/0xc2

[   82.024866]
                stack backtrace:
[   82.027929] CPU: 13 PID: 1725 Comm: (systemd) Tainted: G          I     4.10.0-rc8-debug-dirty #1
[   82.029530] Hardware name: FUJITSU                          PRIMERGY TX200 S5             /D2709, BIOS 6.00 Rev. 1.14.2709              02/04/2013
[   82.031213] Call Trace:
[   82.032870]  dump_stack+0x86/0xc1
[   82.034527]  check_usage+0x5fc/0x630
[   82.036191]  check_irq_usage+0x4d/0xa0
[   82.037852]  __lock_acquire+0x1110/0x19e0
[   82.039510]  ? __lock_acquire+0x18f0/0x19e0
[   82.041160]  ? __lock_acquire+0x18f0/0x19e0
[   82.042792]  lock_acquire+0xa5/0xd0
[   82.044425]  ? collect_expired_timers+0xb0/0xb0
[   82.046069]  del_timer_sync+0x49/0xd0
[   82.047711]  ? collect_expired_timers+0xb0/0xb0
[   82.049366]  wbt_disable_default+0x1e/0x60
[   82.051024]  check_blkcg_changed+0x22d/0x380
[   82.052678]  ? cfq_pd_offline+0x110/0x110
[   82.054327]  ? debug_smp_processor_id+0x17/0x20
[   82.055977]  ? get_lock_stats+0x19/0x50
[   82.057623]  ? cfq_set_request+0x80/0x2c0
[   82.059276]  cfq_set_request+0xe5/0x2c0
[   82.060926]  ? _raw_spin_unlock_irq+0x27/0x50
[   82.062656]  ? __this_cpu_preempt_check+0x13/0x20
[   82.064314]  ? trace_hardirqs_on_caller+0x1db/0x210
[   82.065976]  ? trace_hardirqs_on+0xd/0x10
[   82.067630]  ? _raw_spin_unlock_irq+0x38/0x50
[   82.069291]  elv_set_request+0x1a/0x20
[   82.070937]  get_request+0x88d/0x900
[   82.072568]  ? get_request+0x47/0x900
[   82.074202]  ? prepare_to_wait_event+0x180/0x180
[   82.075842]  blk_queue_bio+0x1e9/0x320
[   82.077476]  generic_make_request+0xbe/0x170
[   82.079117]  submit_bio+0x121/0x150
[   82.080754]  ? __percpu_counter_add+0x8b/0xb0
[   82.082390]  btrfs_map_bio+0x282/0x2a0
[   82.084027]  ? free_root_pointers+0x60/0x60
[   82.085673]  btree_submit_bio_hook+0x71/0xe0
[   82.087320]  submit_one_bio+0x65/0x90
[   82.088969]  read_extent_buffer_pages+0x1fa/0x2f0
[   82.090628]  ? free_root_pointers+0x60/0x60
[   82.092284]  btree_read_extent_buffer_pages+0x59/0xf0
[   82.093952]  read_tree_block+0x2d/0x50
[   82.095612]  read_block_for_search.isra.10+0x296/0x2e0
[   82.097282]  btrfs_search_slot+0x6cc/0x920
[   82.098946]  ? __this_cpu_preempt_check+0x13/0x20
[   82.100617]  btrfs_lookup_csum+0x3e/0x120
[   82.102280]  __btrfs_lookup_bio_sums+0x258/0x4d0
[   82.103951]  ? kmem_cache_alloc+0x11a/0x130
[   82.105613]  btrfs_lookup_bio_sums+0x11/0x20
[   82.107280]  btrfs_submit_compressed_read+0x3d0/0x4c0
[   82.108953]  btrfs_submit_bio_hook+0xbb/0x170
[   82.110610]  submit_one_bio+0x65/0x90
[   82.112260]  extent_readpages+0x1dd/0x1f0
[   82.113910]  ? btrfs_direct_IO+0x320/0x320
[   82.115559]  ? alloc_pages_current+0x14a/0x1e0
[   82.117219]  ? __page_cache_alloc+0xcc/0x150
[   82.118873]  btrfs_readpages+0x1a/0x20
[   82.120524]  __do_page_cache_readahead+0x249/0x320
[   82.122181]  ? __do_page_cache_readahead+0xb4/0x320
[   82.123836]  ondemand_readahead+0x47e/0x4b0
[   82.125491]  page_cache_sync_readahead+0x3c/0x40
[   82.127148]  generic_file_read_iter+0x20e/0x770
[   82.128817]  ? __do_page_fault+0x325/0x410
[   82.130490]  __vfs_read+0xe5/0x120
[   82.132152]  vfs_read+0xc7/0x170
[   82.133809]  SyS_read+0x44/0xa0
[   82.135479]  entry_SYSCALL_64_fastpath+0x1f/0xc2
[   82.137166] RIP: 0033:0x7f4eace2ff27
[   82.138825] RSP: 002b:00007ffdd7f77318 EFLAGS: 00000202 ORIG_RAX: 0000000000000000
[   82.140477] RAX: ffffffffffffffda RBX: ffffffff813b0823 RCX: 00007f4eace2ff27
[   82.142106] RDX: 0000000000000340 RSI: 00007ffdd7f77408 RDI: 0000000000000008
[   82.143751] RBP: ffffc9000ccb7f88 R08: 0000000090000002 R09: 00007ffdd7f773ef
[   82.145408] R10: 00007f4eace310d0 R11: 0000000000000202 R12: 00007ffdd7f773ef
[   82.147072] R13: 0000000000000340 R14: 0000000000000008 R15: 00007ffdd7f77400
[   82.148745]  ? __this_cpu_preempt_check+0x13/0x20
  ...

For the kernel with the revert reverted I'll do some videos later on today.. I need the box to do some work first :)

So far .. the kernel with the reverted revert + Mike's patch ( but even without Mike's patch ) will trigger an bug in mce code ,
with mce=off it will trigger an bug in microcode code , with dis_ucode_ldr we trigger an bug(s) in smp_call_*() and hrtimer_*() functions..

Also this 2 liner patch seems to break hell .. at least on my box.

Regards,

Gabriel C


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13  2:31                               ` Mike Galbraith
       [not found]                                 ` <CA+55aFzC33RgUDbb-tn9+ANJtD_R2+FzjJihnT_kGk-h+nTD1Q@mail.gmail.com>
@ 2017-02-13  8:47                                 ` Thomas Gleixner
  2017-02-13  8:52                                 ` [tip:timers/urgent] tick/broadcast: Prevent deadlock on tick_broadcast_lock tip-bot for Mike Galbraith
  2 siblings, 0 replies; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-13  8:47 UTC (permalink / raw)
  To: Mike Galbraith
  Cc: Gabriel C, Borislav Petkov, Linus Torvalds, Greg KH,
	Linux Kernel Mailing List, Andrew Morton, stable, lwn,
	Jiri Slaby, Ruslan Ruslichenko

On Mon, 13 Feb 2017, Mike Galbraith wrote:
>  kernel/time/tick-broadcast.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> --- a/kernel/time/tick-broadcast.c
> +++ b/kernel/time/tick-broadcast.c
> @@ -357,6 +357,7 @@ void tick_broadcast_control(enum tick_br
>  	struct clock_event_device *bc, *dev;
>  	struct tick_device *td;
>  	int cpu, bc_stopped;
> +	unsigned long flags;
>  
>  	td = this_cpu_ptr(&tick_cpu_device);
>  	dev = td->evtdev;
> @@ -370,7 +371,7 @@ void tick_broadcast_control(enum tick_br
>  	if (!tick_device_is_functional(dev))
>  		return;
>  
> -	raw_spin_lock(&tick_broadcast_lock);
> +	raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
>  	cpu = smp_processor_id();
>  	bc = tick_broadcast_device.evtdev;
>  	bc_stopped = cpumask_empty(tick_broadcast_mask);
> @@ -420,7 +421,7 @@ void tick_broadcast_control(enum tick_br
>  				tick_broadcast_setup_oneshot(bc);
>  		}
>  	}
> -	raw_spin_unlock(&tick_broadcast_lock);
> +	raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);

That cures the lockdep splat, but the comment above
tick_broadcast_control() says:

* Called with interrupts disabled, so clockevents_lock is not
* required here because the local clock event device cannot go away
* under us.

So if we want to relax the calling convention, then we need to take the
lock early.  Otherwise it's unsafe to fiddle with the local clock event
device.

The calling convention was broken with the following commit:

    29d7bbada98e intel_idle: Remove superfluous SMP fuction call

So we could fix it at the call site, but making the core more robust is the
better solution.

I'll fix it up.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 52+ messages in thread

* [tip:timers/urgent] tick/broadcast: Prevent deadlock on tick_broadcast_lock
  2017-02-13  2:31                               ` Mike Galbraith
       [not found]                                 ` <CA+55aFzC33RgUDbb-tn9+ANJtD_R2+FzjJihnT_kGk-h+nTD1Q@mail.gmail.com>
  2017-02-13  8:47                                 ` Thomas Gleixner
@ 2017-02-13  8:52                                 ` tip-bot for Mike Galbraith
  2 siblings, 0 replies; 52+ messages in thread
From: tip-bot for Mike Galbraith @ 2017-02-13  8:52 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, bp, efault, rruslich, gregkh, hpa, bigeasy, stable,
	anna-maria, linux-kernel, akpm, torvalds, jslaby, nix.or.die,
	mingo

Commit-ID:  202461e2f3c15dbfb05825d29ace0d20cdf55fa4
Gitweb:     http://git.kernel.org/tip/202461e2f3c15dbfb05825d29ace0d20cdf55fa4
Author:     Mike Galbraith <efault@gmx.de>
AuthorDate: Mon, 13 Feb 2017 03:31:55 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 13 Feb 2017 09:49:31 +0100

tick/broadcast: Prevent deadlock on tick_broadcast_lock

tick_broadcast_lock is taken from interrupt context, but the following call
chain takes the lock without disabling interrupts:

[   12.703736]  _raw_spin_lock+0x3b/0x50
[   12.703738]  tick_broadcast_control+0x5a/0x1a0
[   12.703742]  intel_idle_cpu_online+0x22/0x100
[   12.703744]  cpuhp_invoke_callback+0x245/0x9d0
[   12.703752]  cpuhp_thread_fun+0x52/0x110
[   12.703754]  smpboot_thread_fn+0x276/0x320

So the following deadlock can happen:

   lock(tick_broadcast_lock);
   <Interrupt>
      lock(tick_broadcast_lock);

intel_idle_cpu_online() is the only place which violates the calling
convention of tick_broadcast_control(). This was caused by the removal of
the smp function call in course of the cpu hotplug rework.

Instead of slapping local_irq_disable/enable() at the call site, we can
relax the calling convention and handle it in the core code, which makes
the whole machinery more robust.

Fixes: 29d7bbada98e ("intel_idle: Remove superfluous SMP fuction call")
Reported-by: Gabriel C <nix.or.die@gmail.com>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Cc: Ruslan Ruslichenko <rruslich@cisco.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: lwn@lwn.net
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Anna-Maria Gleixner <anna-maria@linutronix.de>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: stable <stable@vger.kernel.org>
Link: http://lkml.kernel.org/r/1486953115.5912.4.camel@gmx.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 kernel/time/tick-broadcast.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 3109204..17ac99b 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -347,17 +347,16 @@ static void tick_handle_periodic_broadcast(struct clock_event_device *dev)
  *
  * Called when the system enters a state where affected tick devices
  * might stop. Note: TICK_BROADCAST_FORCE cannot be undone.
- *
- * Called with interrupts disabled, so clockevents_lock is not
- * required here because the local clock event device cannot go away
- * under us.
  */
 void tick_broadcast_control(enum tick_broadcast_mode mode)
 {
 	struct clock_event_device *bc, *dev;
 	struct tick_device *td;
 	int cpu, bc_stopped;
+	unsigned long flags;
 
+	/* Protects also the local clockevent device. */
+	raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
 	td = this_cpu_ptr(&tick_cpu_device);
 	dev = td->evtdev;
 
@@ -365,12 +364,11 @@ void tick_broadcast_control(enum tick_broadcast_mode mode)
 	 * Is the device not affected by the powerstate ?
 	 */
 	if (!dev || !(dev->features & CLOCK_EVT_FEAT_C3STOP))
-		return;
+		goto out;
 
 	if (!tick_device_is_functional(dev))
-		return;
+		goto out;
 
-	raw_spin_lock(&tick_broadcast_lock);
 	cpu = smp_processor_id();
 	bc = tick_broadcast_device.evtdev;
 	bc_stopped = cpumask_empty(tick_broadcast_mask);
@@ -420,7 +418,8 @@ void tick_broadcast_control(enum tick_broadcast_mode mode)
 				tick_broadcast_setup_oneshot(bc);
 		}
 	}
-	raw_spin_unlock(&tick_broadcast_lock);
+out:
+	raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);
 }
 EXPORT_SYMBOL_GPL(tick_broadcast_control);
 

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13  1:26                             ` Gabriel C
  2017-02-13  2:31                               ` Mike Galbraith
@ 2017-02-13 10:28                               ` Borislav Petkov
  1 sibling, 0 replies; 52+ messages in thread
From: Borislav Petkov @ 2017-02-13 10:28 UTC (permalink / raw)
  To: Gabriel C
  Cc: Thomas Gleixner, Linus Torvalds, Greg KH,
	Linux Kernel Mailing List, Andrew Morton, stable, lwn,
	Jiri Slaby, Ruslan Ruslichenko

On Mon, Feb 13, 2017 at 02:26:20AM +0100, Gabriel C wrote:
> I didn't tested your patch yet but did a boot with mce=off and nomce
> which seems to not really works since is still want to mc_device_add()
> even when off.

mc_device_add() is microcode loader's ->add_dev() subsys pointer and
that's not from mce. From mce you should be seeing only (with the debug
patch applied):

[    1.717508] mce: mcheck_init_device: entry
[    1.718769] mce: Unable to init device /dev/mcelog (rc: -5)

> See :
> 
> http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/crash_mce_off.jpg

That looks like core 13 got the NMI from the watchdog at

        if (wait)
                csd_lock_wait(csd);

IINM and from what I could correlate to the asm it generates here,
RIP points to that READ_ONCE there in smp_cond_load_acquire() in
smp_call_function_single() which is called by collect_cpu_info() of the
microcode loader to get the microcode-relevant info from the CPU.

So this is simply a bystander CPU which got interrupted.

> I'll build an .10-rc8 with your patch tomorrow .. is somewhat late now here :)

Ok.

> Another thing is .. there seems to be a real bug in tsc code .
> 
> I've build an -rc8 with a lot more debug options on an now I see the following :

Right before I went to bed I thought of telling you to enable lockdep :-)

Good. :-)

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13  5:48                                   ` Gabriel C
@ 2017-02-13 14:05                                     ` Thomas Gleixner
  2017-02-13 14:16                                       ` Thomas Gleixner
  2017-02-13 18:35                                     ` Linus Torvalds
  1 sibling, 1 reply; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-13 14:05 UTC (permalink / raw)
  To: Gabriel C
  Cc: Linus Torvalds, Mike Galbraith, Greg Kroah-Hartman,
	Borislav Petkov, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby

On Mon, 13 Feb 2017, Gabriel C wrote:
> On 13.02.2017 05:36, Linus Torvalds wrote:
> > Gabriel, does this patch fix your problem even without the revert (note
> > that the revert is already in rc8, so if you apply Mike's patch on top of
> > current kernel sources you should revert the revert to test)
> 
> Yes I know .. I have 2 kernels one with and one without the revert.
> 
> Mike's patch fixes the warning I see in rc8 with the revert but won't fix the
> problem with reverted revert...

Can you please send your .config ?

> Also now I get a new warning :
> 

Yes, that's definitely broken. I'll send that splat to the block folks.

> So far .. the kernel with the reverted revert + Mike's patch ( but even
> without Mike's patch ) will trigger an bug in mce code ,
> with mce=off it will trigger an bug in microcode code , with dis_ucode_ldr we
> trigger an bug(s) in smp_call_*() and hrtimer_*() functions..
> 
> Also this 2 liner patch seems to break hell .. at least on my box.

I'm still stumped.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13 14:05                                     ` Thomas Gleixner
@ 2017-02-13 14:16                                       ` Thomas Gleixner
  2017-02-13 20:24                                         ` Gabriel C
  0 siblings, 1 reply; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-13 14:16 UTC (permalink / raw)
  To: Gabriel C
  Cc: Linus Torvalds, Mike Galbraith, Greg Kroah-Hartman,
	Borislav Petkov, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby

On Mon, 13 Feb 2017, Thomas Gleixner wrote:

> On Mon, 13 Feb 2017, Gabriel C wrote:
> > On 13.02.2017 05:36, Linus Torvalds wrote:
> > > Gabriel, does this patch fix your problem even without the revert (note
> > > that the revert is already in rc8, so if you apply Mike's patch on top of
> > > current kernel sources you should revert the revert to test)
> > 
> > Yes I know .. I have 2 kernels one with and one without the revert.
> > 
> > Mike's patch fixes the warning I see in rc8 with the revert but won't fix the
> > problem with reverted revert...
> 
> Can you please send your .config ?
> 
> > Also now I get a new warning :
> > 
> 
> Yes, that's definitely broken. I'll send that splat to the block folks.

Can you disable CONFIG_BLK_WBT for now so we get to the real stuff?

> > So far .. the kernel with the reverted revert + Mike's patch ( but even
> > without Mike's patch ) will trigger an bug in mce code ,
> > with mce=off it will trigger an bug in microcode code , with dis_ucode_ldr we
> > trigger an bug(s) in smp_call_*() and hrtimer_*() functions..
> > 
> > Also this 2 liner patch seems to break hell .. at least on my box.
> 
> I'm still stumped.
> 
> Thanks,
> 
> 	tglx
> 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13  5:48                                   ` Gabriel C
  2017-02-13 14:05                                     ` Thomas Gleixner
@ 2017-02-13 18:35                                     ` Linus Torvalds
  2017-02-13 19:33                                       ` Thomas Gleixner
  1 sibling, 1 reply; 52+ messages in thread
From: Linus Torvalds @ 2017-02-13 18:35 UTC (permalink / raw)
  To: Gabriel C
  Cc: Mike Galbraith, Thomas Gleixner, Greg Kroah-Hartman,
	Borislav Petkov, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby

[-- Attachment #1: Type: text/plain, Size: 1593 bytes --]

On Sun, Feb 12, 2017 at 9:48 PM, Gabriel C <nix.or.die@gmail.com> wrote:
>
> So far .. the kernel with the reverted revert + Mike's patch ( but even
> without Mike's patch ) will trigger an bug in mce code ,
> with mce=off it will trigger an bug in microcode code , with dis_ucode_ldr
> we trigger an bug(s) in smp_call_*() and hrtimer_*() functions..
>
> Also this 2 liner patch seems to break hell .. at least on my box.

I suspect you might be seeing symptoms that are "downstream" from the
real issue. So depending on what you enable/disable you get problems
in different parts.

That said, the block lockdep splat Jens sent a patch for. But it looks
very unlikely to be the root cause.

The fact that the two-liner patch matters so much and so consistently
(despite timing differences elsewhere) makes me think it realy is
specifically about irq retriggering, not the random symptoms we see.

Can you try this patch on top of a working setup that doesn't have a
lot of other noise in it (ie presumably just plain rc8, for example)?
All it does is do a WARN_ON() when the irq_retrigger() code is
actually triggered. It shouldn't be so common as to spam all your
logs, but I might be wrong, so I put a stub in where you could replace
the

    if (1)

with something like

    if (printk_ratelimit())

which should limit it to something like a max of 10 warnings every five seconds.

I'm wondering if we somehow end up trying to retrigger an NMI or other
internal APIC thing (maybe that's where the machine check comes in?)
that definitely shouldn't be retriggered.

                  Linus

[-- Attachment #2: patch.diff --]
[-- Type: text/plain, Size: 1132 bytes --]

 arch/x86/kernel/irq.c | 4 ++++
 kernel/irq/resend.c   | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 7c6e9ffe4424..d115f0da2d25 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -532,6 +532,10 @@ void fixup_irqs(void)
 		if (irr  & (1 << (vector % 32))) {
 			desc = __this_cpu_read(vector_irq[vector]);
 
+			if (1) { // rate limit?
+				printk("IRQ retrigger for %s\n", desc->name);
+				WARN_ON_ONCE(1);
+			}
 			raw_spin_lock(&desc->lock);
 			data = irq_desc_get_irq_data(desc);
 			chip = irq_data_get_irq_chip(data);
diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c
index b86886beee4f..4f2df79ac887 100644
--- a/kernel/irq/resend.c
+++ b/kernel/irq/resend.c
@@ -71,6 +71,11 @@ void check_irq_resend(struct irq_desc *desc)
 		desc->istate &= ~IRQS_PENDING;
 		desc->istate |= IRQS_REPLAY;
 
+		if (1) { // rate limit?
+			printk("IRQ retrigger for %s\n", desc->name);
+			WARN_ON_ONCE(1);
+		}
+
 		if (!desc->irq_data.chip->irq_retrigger ||
 		    !desc->irq_data.chip->irq_retrigger(&desc->irq_data)) {
 #ifdef CONFIG_HARDIRQS_SW_RESEND

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13 18:35                                     ` Linus Torvalds
@ 2017-02-13 19:33                                       ` Thomas Gleixner
  2017-02-13 20:12                                         ` Linus Torvalds
  0 siblings, 1 reply; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-13 19:33 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Gabriel C, Mike Galbraith, Greg Kroah-Hartman, Borislav Petkov,
	stable, Andrew Morton, Ruslan Ruslichenko, Jiri Slaby

On Mon, 13 Feb 2017, Linus Torvalds wrote:
> The fact that the two-liner patch matters so much and so consistently
> (despite timing differences elsewhere) makes me think it realy is
> specifically about irq retriggering, not the random symptoms we see.

I agree, 
 
> I'm wondering if we somehow end up trying to retrigger an NMI or other
> internal APIC thing (maybe that's where the machine check comes in?)
> that definitely shouldn't be retriggered.

We never retrigger any of the special vectors, just the device interrupts
can get that treatment and there only the few edge interrupts connected to
the IO-APIC are relevant.

Boris has access to a machine with a similar CPU. It shows the symptom of
boot hang, but only after Boris used Gabriels config file. The normal SuSe
config just boots fine. Again, nothing stands out there which immediately
rings a bell. :(

Thanks,

	Thomas

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13 19:33                                       ` Thomas Gleixner
@ 2017-02-13 20:12                                         ` Linus Torvalds
  2017-02-13 20:18                                           ` Thomas Gleixner
                                                             ` (2 more replies)
  0 siblings, 3 replies; 52+ messages in thread
From: Linus Torvalds @ 2017-02-13 20:12 UTC (permalink / raw)
  To: Thomas Gleixner, Steven Rostedt
  Cc: Gabriel C, Mike Galbraith, Greg Kroah-Hartman, Borislav Petkov,
	stable, Andrew Morton, Ruslan Ruslichenko, Jiri Slaby

On Mon, Feb 13, 2017 at 11:33 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>
> We never retrigger any of the special vectors, just the device interrupts
> can get that treatment and there only the few edge interrupts connected to
> the IO-APIC are relevant.

Don't we walk up to the local apic when we walk the parent chain? I
didn't check how the parent chain thing is connected..

Anyway, I'm wondering if the WARN_ON might give some ideas (and I just
noticed that I made the WARN_ON() be WARN_ON_ONCE() in the patch I
sent out, because I'm so used to trying to avoid constant streams of
warnings, but in this case we migth want them - particularly if
Gabriel then tries it with a broken kernel and we get a "it halts
after _this_ one" situation.

> Boris has access to a machine with a similar CPU. It shows the symptom of
> boot hang, but only after Boris used Gabriels config file. The normal SuSe
> config just boots fine. Again, nothing stands out there which immediately
> rings a bell. :(

Oh, I must have missed that email.

Boris - have you tried to narrow down the exact config isse with the
ktest config bisection script? I haven't used it myself, but I'm
adding StevenR to see if he has suggestions.

               Linus

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13 20:12                                         ` Linus Torvalds
@ 2017-02-13 20:18                                           ` Thomas Gleixner
  2017-02-13 20:22                                           ` Steven Rostedt
  2017-02-13 20:43                                           ` Borislav Petkov
  2 siblings, 0 replies; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-13 20:18 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Steven Rostedt, Gabriel C, Mike Galbraith, Greg Kroah-Hartman,
	Borislav Petkov, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby

On Mon, 13 Feb 2017, Linus Torvalds wrote:
> On Mon, Feb 13, 2017 at 11:33 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >
> > We never retrigger any of the special vectors, just the device interrupts
> > can get that treatment and there only the few edge interrupts connected to
> > the IO-APIC are relevant.
> 
> Don't we walk up to the local apic when we walk the parent chain? I
> didn't check how the parent chain thing is connected..
> 
> Anyway, I'm wondering if the WARN_ON might give some ideas (and I just
> noticed that I made the WARN_ON() be WARN_ON_ONCE() in the patch I
> sent out, because I'm so used to trying to avoid constant streams of
> warnings, but in this case we migth want them - particularly if
> Gabriel then tries it with a broken kernel and we get a "it halts
> after _this_ one" situation.
> 
> > Boris has access to a machine with a similar CPU. It shows the symptom of
> > boot hang, but only after Boris used Gabriels config file. The normal SuSe
> > config just boots fine. Again, nothing stands out there which immediately
> > rings a bell. :(
> 
> Oh, I must have missed that email.
> 
> Boris - have you tried to narrow down the exact config isse with the
> ktest config bisection script? I haven't used it myself, but I'm
> adding StevenR to see if he has suggestions.

I found a machine myself which does not come up with that config, but the
remote console is not working, so I'll poke at it first thing tomorrow
morning when I'm in the office.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13 20:12                                         ` Linus Torvalds
  2017-02-13 20:18                                           ` Thomas Gleixner
@ 2017-02-13 20:22                                           ` Steven Rostedt
  2017-02-13 20:43                                           ` Borislav Petkov
  2 siblings, 0 replies; 52+ messages in thread
From: Steven Rostedt @ 2017-02-13 20:22 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Thomas Gleixner, Gabriel C, Mike Galbraith, Greg Kroah-Hartman,
	Borislav Petkov, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby

On Mon, 13 Feb 2017 12:12:53 -0800
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Mon, Feb 13, 2017 at 11:33 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >
> > We never retrigger any of the special vectors, just the device interrupts
> > can get that treatment and there only the few edge interrupts connected to
> > the IO-APIC are relevant.  
> 
> Don't we walk up to the local apic when we walk the parent chain? I
> didn't check how the parent chain thing is connected..
> 
> Anyway, I'm wondering if the WARN_ON might give some ideas (and I just
> noticed that I made the WARN_ON() be WARN_ON_ONCE() in the patch I
> sent out, because I'm so used to trying to avoid constant streams of
> warnings, but in this case we migth want them - particularly if
> Gabriel then tries it with a broken kernel and we get a "it halts
> after _this_ one" situation.
> 
> > Boris has access to a machine with a similar CPU. It shows the symptom of
> > boot hang, but only after Boris used Gabriels config file. The normal SuSe
> > config just boots fine. Again, nothing stands out there which immediately
> > rings a bell. :(  
> 
> Oh, I must have missed that email.
> 
> Boris - have you tried to narrow down the exact config isse with the
> ktest config bisection script? I haven't used it myself, but I'm
> adding StevenR to see if he has suggestions.
>

Funny you mention this. I'm about to finish a config-bisect stand alone
script (doesn't need all the stuff that ktest.pl has), and I was
looking for a test case.

-- Steve

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13 14:16                                       ` Thomas Gleixner
@ 2017-02-13 20:24                                         ` Gabriel C
  0 siblings, 0 replies; 52+ messages in thread
From: Gabriel C @ 2017-02-13 20:24 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Linus Torvalds, Mike Galbraith, Greg Kroah-Hartman,
	Borislav Petkov, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby



On 13.02.2017 15:16, Thomas Gleixner wrote:
> On Mon, 13 Feb 2017, Thomas Gleixner wrote:
>
>> On Mon, 13 Feb 2017, Gabriel C wrote:
>>> On 13.02.2017 05:36, Linus Torvalds wrote:
>>>> Gabriel, does this patch fix your problem even without the revert (note
>>>> that the revert is already in rc8, so if you apply Mike's patch on top of
>>>> current kernel sources you should revert the revert to test)
>>>
>>> Yes I know .. I have 2 kernels one with and one without the revert.
>>>
>>> Mike's patch fixes the warning I see in rc8 with the revert but won't fix the
>>> problem with reverted revert...
>>
>> Can you please send your .config ?

http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/config-4.10-rc8

>>> Also now I get a new warning :
>>>
>>
>> Yes, that's definitely broken. I'll send that splat to the block folks.
>
> Can you disable CONFIG_BLK_WBT for now so we get to the real stuff?

Sure. I'll rebuild both kernels in a bit. just got home.



^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13 20:12                                         ` Linus Torvalds
  2017-02-13 20:18                                           ` Thomas Gleixner
  2017-02-13 20:22                                           ` Steven Rostedt
@ 2017-02-13 20:43                                           ` Borislav Petkov
  2017-02-13 20:59                                             ` Thomas Gleixner
  2017-02-13 21:33                                             ` Linus Torvalds
  2 siblings, 2 replies; 52+ messages in thread
From: Borislav Petkov @ 2017-02-13 20:43 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Thomas Gleixner, Steven Rostedt, Gabriel C, Mike Galbraith,
	Greg Kroah-Hartman, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby

On Mon, Feb 13, 2017 at 12:12:53PM -0800, Linus Torvalds wrote:
> Boris - have you tried to narrow down the exact config isse with the
> ktest config bisection script?

I'd love to but that box is one piece of shite. I only have remote
console access and the remote console sucks big time. It booted fine
with our SLES config but then I tried Gabriel's config and it froze.
Btw, remote recovery is a serious PITA - had to reinstall it. It was
*actually* faster. :-\

Then, I reverted

020eb3daaba2 ("x86/ioapic: Restore IO-APIC irq_chip retrigger callback")

ontop of -rc7 as Thomas requested and it started spewing the crap below
(yeah, that serial output is f*cked).

And it went nuts after this, flooding dmesg with that splat (I've sent
tglx a 14M dmesg) and then I killed it.

So all in all, bisecting on this box would be like trying to sew with
astronaut's gloves. So I really really hope tglx or Gabriel are more
successful there.

FWIW, it really looks like something's tickling this in Gabriel's
.config.

HTH.

[    8.608102] Btrfs loaded, crc32c=crc32c-generic                              
[    8.618171] console [netcon0] enabled                                        
[    8.625703] netconsole: network logging started                              
[    8.635613] rtc_cmos 00:04: setting system clock to 2017-02-13 20:15:50 UTC (
1487016950)                                                                     
[    8.652522] genirq: Flags mismatch irq 4. 00000000 (serial) vs. 00000080 (gol
dfish_pdev_bus)                                                                 
[    8.669770] CPU: 2 PID: 1 Comm: swapper/0 Tainted: G          I     4.10.0-rc^M[    8.618171] console [netcon0] enabled                                        
[    8.625703] netconsole: network logging started                              
[    8.635613] rtc_cmos 00:04: setting system clock to 2017-02-13 20:15:50 UTC (
1487016950)                                                                     
[    8.652522] genirq: Flags mismatch irq 4. 00000000 (serial) vs. 00000080 (gol
dfish_pdev_bus)                                                                 
[    8.669770] CPU: 2 PID: 1 Comm: swapper/0 Tainted: G          I     4.10.0-rc
7-dirty #3                                                                      
[    8.686066] Hardware name: HP ProLiant ML370 G6, BIOS P63 05/05/2011         
[    8.698915] Call Trace:                                                      
[    8.703972]  dump_stack+0x63/0x85                                            
[    8.710757]  __setup_irq+0x486/0x5e0                                         
[    8.718060]  request_threaded_irq+0x121/0x190                                
[    8.726939]  univ8250_setup_irq+0x202/0x250                                  
[    8.735458]  serial8250_do_startup+0x411/0x5e0                               
[    8.744500]  serial8250_startup+0x16/0x20                                    
[    8.752672]  uart_startup+0x8d/0x140                                         
[    8.759973]  uart_port_activate+0x4d/0x60                                    
[    8.768190]  tty_port_open+0x7d/0xc0                                         
[    8.775494]  ? tty_add_file+0x7d/0x90                                        
[    8.782969]  uart_open+0x38/0x50                                             
[    8.789622]  tty_open+0x384/0x580                                            
[    8.796407]  chrdev_open+0x147/0x1e0                                         
[    8.803711]  ? cdev_put+0x20/0x20                                            
[    8.810537]  do_dentry_open.isra.15+0x17b/0x2c0                              ^M[    8.759973]  uart_port_activate+0x4d/0x60                                    
[    8.768190]  tty_port_open+0x7d/0xc0                                         
[    8.775494]  ? tty_add_file+0x7d/0x90                                        
[    8.782969]  uart_open+0x38/0x50                                             
[    8.789622]  tty_open+0x384/0x580                                            
[    8.796407]  chrdev_open+0x147/0x1e0                                         
[    8.803711]  ? cdev_put+0x20/0x20                                            
[    8.810537]  do_dentry_open.isra.15+0x17b/0x2c0                              
[    8.819811]  ? __inode_permission+0xa3/0xc0                                  
[    8.828329]  vfs_open+0x4f/0x60                                              
[    8.834809]  path_openat+0xe6a/0x1190                                        
[    8.842290]  ? ida_get_new_above+0x211/0x230                                 
[    8.850981]  ? proc_alloc_inum+0x4f/0xb0                                     
[    8.858976]  do_filp_open+0x7d/0xd0                                          
[    8.866109]  ? __check_object_size+0xbe/0x1e8                                
[    8.874973]  ? __alloc_fd+0x13e/0x150                                        
[    8.882446]  do_sys_open+0x130/0x1c0                                         
[    8.889749]  SyS_open+0x19/0x20                                              
[    8.896199]  kernel_init_freeable+0x1b8/0x224                                
[    8.905120]  ? do_early_param+0x8a/0x8a                                      
[    8.912947]  ? rest_init+0x90/0x90                                           
[    8.919906]  kernel_init+0x9/0x100                                           
[    8.926907]  ret_from_fork+0x2c/0x40                                         
[    8.937513] Freeing unused kernel memory: 1600K                              
[    8.946755] Write protecting the kernel read-only data: 12288k               ^M[    8.866109]  ? __check_object_size+0xbe/0x1e8                                
[    8.874973]  ? __alloc_fd+0x13e/0x150                                        
[    8.882446]  do_sys_open+0x130/0x1c0                                         
[    8.889749]  SyS_open+0x19/0x20                                              
[    8.896199]  kernel_init_freeable+0x1b8/0x224                                
[    8.905120]  ? do_early_param+0x8a/0x8a                                      
[    8.912947]  ? rest_init+0x90/0x90                                           
[    8.919906]  kernel_init+0x9/0x100                                           
[    8.926907]  ret_from_fork+0x2c/0x40                                         
[    8.937513] Freeing unused kernel memory: 1600K                              
[    8.946755] Write protecting the kernel read-only data: 12288k               
[    8.962756] Freeing unused kernel memory: 1364K                              
[    8.977387] Freeing unused kernel memory: 1740K                              
[    8.988912] systemd[1]: Failed to insert module 'autofs4': Function not imple
mented                                                                          
[    9.004624] systemd[1]: Failed to insert module 'ipv6': Function not implemen
ted                                                                             
[    9.019744] systemd[1]: Failed to insert module 'unix': Function not implemen
ted                                                                             
[    9.034844] tsc: Refined TSC clocksource calibration: 2532.613 MHz           
[    9.035665] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x2481921a
2d0, max_idle_ns: 440795281605 ns                                               
[    9.069575] genirq: Flags mismatch irq 4. 00000000 (serial) vs. 00000080 (gol
dfish_pdev_bus)                                                                 
[    9.086738] CPU: 2 PID: 1 Comm: systemd Tainted: G          I     4.10.0-rc7-^M[    9.019744] systemd[1]: Failed to insert module 'unix': Function not implemen
ted

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13 20:43                                           ` Borislav Petkov
@ 2017-02-13 20:59                                             ` Thomas Gleixner
  2017-02-13 21:42                                               ` Gabriel C
  2017-02-13 21:33                                             ` Linus Torvalds
  1 sibling, 1 reply; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-13 20:59 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Linus Torvalds, Steven Rostedt, Gabriel C, Mike Galbraith,
	Greg Kroah-Hartman, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby

On Mon, 13 Feb 2017, Borislav Petkov wrote:
> [    8.652522] genirq: Flags mismatch irq 4. 00000000 (serial) vs. 00000080 (gol
> dfish_pdev_bus)                                                                 

> [    8.652522] genirq: Flags mismatch irq 4. 00000000 (serial) vs. 00000080 (gol
> dfish_pdev_bus)                                                                 

Uurgh.

Gabriel, can you please disable CONFIG_GOLDFISH and everything related to that?

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13 20:43                                           ` Borislav Petkov
  2017-02-13 20:59                                             ` Thomas Gleixner
@ 2017-02-13 21:33                                             ` Linus Torvalds
  2017-02-13 21:35                                               ` Thomas Gleixner
  1 sibling, 1 reply; 52+ messages in thread
From: Linus Torvalds @ 2017-02-13 21:33 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Thomas Gleixner, Steven Rostedt, Gabriel C, Mike Galbraith,
	Greg Kroah-Hartman, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby

On Mon, Feb 13, 2017 at 12:43 PM, Borislav Petkov <bp@alien8.de> wrote:
>
> FWIW, it really looks like something's tickling this in Gabriel's
> .config.
>
> [    8.652522] genirq: Flags mismatch irq 4. 00000000 (serial) vs. 00000080 (goldfish_pdev_bus)

How the hell is that "goldfish_pdev_bus" thing there at all?

And I'm not talking about the driver being enabled, I'm talking about
the bus probe finding such a device in the first place?

That thing is supposed to only trigger on virtual hardware in QEMU.
But it must have actually probed successfully in order to have an
interrupt. How is that thing supposed to match anything>?

             Linus

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13 21:33                                             ` Linus Torvalds
@ 2017-02-13 21:35                                               ` Thomas Gleixner
  2017-02-13 21:42                                                 ` Thomas Gleixner
  2017-02-13 21:44                                                 ` Linus Torvalds
  0 siblings, 2 replies; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-13 21:35 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Borislav Petkov, Steven Rostedt, Gabriel C, Mike Galbraith,
	Greg Kroah-Hartman, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby


On Mon, 13 Feb 2017, Linus Torvalds wrote:

> On Mon, Feb 13, 2017 at 12:43 PM, Borislav Petkov <bp@alien8.de> wrote:
> >
> > FWIW, it really looks like something's tickling this in Gabriel's
> > .config.
> >
> > [    8.652522] genirq: Flags mismatch irq 4. 00000000 (serial) vs. 00000080 (goldfish_pdev_bus)
> 
> How the hell is that "goldfish_pdev_bus" thing there at all?
> 
> And I'm not talking about the driver being enabled, I'm talking about
> the bus probe finding such a device in the first place?
> 
> That thing is supposed to only trigger on virtual hardware in QEMU.
> But it must have actually probed successfully in order to have an
> interrupt. How is that thing supposed to match anything>?

That's easy.

arch/x86/platform/goldfish/goldfish.c

static int __init goldfish_init(void)
{
        platform_device_register_simple("goldfish_pdev_bus", -1,
                                                goldfish_pdev_bus_resources, 2);
        return 0;
}
device_initcall(goldfish_init);

So it unconditionallyt registers that platform device, which has IRQ 4 as
irq resource and the driver happily matches on the platform devices.

Wonderful crap, isn't it? It should be made 'depend on BROKEN'.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13 20:59                                             ` Thomas Gleixner
@ 2017-02-13 21:42                                               ` Gabriel C
  2017-02-14  0:04                                                 ` Gabriel C
  0 siblings, 1 reply; 52+ messages in thread
From: Gabriel C @ 2017-02-13 21:42 UTC (permalink / raw)
  To: Thomas Gleixner, Borislav Petkov
  Cc: Linus Torvalds, Steven Rostedt, Mike Galbraith,
	Greg Kroah-Hartman, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby



On 13.02.2017 21:59, Thomas Gleixner wrote:
> On Mon, 13 Feb 2017, Borislav Petkov wrote:
>> [    8.652522] genirq: Flags mismatch irq 4. 00000000 (serial) vs. 00000080 (gol
>> dfish_pdev_bus)
>
>> [    8.652522] genirq: Flags mismatch irq 4. 00000000 (serial) vs. 00000080 (gol
>> dfish_pdev_bus)
>
> Uurgh.
>
> Gabriel, can you please disable CONFIG_GOLDFISH and everything related to that?

Sure. I was about to start building the kernels.

I'll build an rc8 -CONFIG_GOLDFISH , -CONFIG_BLK_WBT + the debug patch from Linus.

An one with with reverted revert.. with same config then..


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13 21:35                                               ` Thomas Gleixner
@ 2017-02-13 21:42                                                 ` Thomas Gleixner
  2017-02-13 21:44                                                 ` Linus Torvalds
  1 sibling, 0 replies; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-13 21:42 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Borislav Petkov, Steven Rostedt, Gabriel C, Mike Galbraith,
	Greg Kroah-Hartman, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby

On Mon, 13 Feb 2017, Thomas Gleixner wrote:
> On Mon, 13 Feb 2017, Linus Torvalds wrote:
> 
> > On Mon, Feb 13, 2017 at 12:43 PM, Borislav Petkov <bp@alien8.de> wrote:
> > >
> > > FWIW, it really looks like something's tickling this in Gabriel's
> > > .config.
> > >
> > > [    8.652522] genirq: Flags mismatch irq 4. 00000000 (serial) vs. 00000080 (goldfish_pdev_bus)
> > 
> > How the hell is that "goldfish_pdev_bus" thing there at all?
> > 
> > And I'm not talking about the driver being enabled, I'm talking about
> > the bus probe finding such a device in the first place?
> > 
> > That thing is supposed to only trigger on virtual hardware in QEMU.
> > But it must have actually probed successfully in order to have an
> > interrupt. How is that thing supposed to match anything>?
> 
> That's easy.
> 
> arch/x86/platform/goldfish/goldfish.c
> 
> static int __init goldfish_init(void)
> {
>         platform_device_register_simple("goldfish_pdev_bus", -1,
>                                                 goldfish_pdev_bus_resources, 2);
>         return 0;
> }
> device_initcall(goldfish_init);
> 
> So it unconditionallyt registers that platform device, which has IRQ 4 as
> irq resource and the driver happily matches on the platform devices.
> 
> Wonderful crap, isn't it? It should be made 'depend on BROKEN'.

And of course that stupid driver init runs before the serial device init
happens. Which leaves the serial w/o interrupt. Crap.

Thanks,

	Thomas


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13 21:35                                               ` Thomas Gleixner
  2017-02-13 21:42                                                 ` Thomas Gleixner
@ 2017-02-13 21:44                                                 ` Linus Torvalds
  2017-02-14  8:15                                                   ` Thomas Gleixner
  1 sibling, 1 reply; 52+ messages in thread
From: Linus Torvalds @ 2017-02-13 21:44 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Borislav Petkov, Steven Rostedt, Gabriel C, Mike Galbraith,
	Greg Kroah-Hartman, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby

On Mon, Feb 13, 2017 at 1:35 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
>
>
> arch/x86/platform/goldfish/goldfish.c
>
> static int __init goldfish_init(void)
> {
>         platform_device_register_simple("goldfish_pdev_bus", -1,
>                                                 goldfish_pdev_bus_resources, 2);
>         return 0;
> }
> device_initcall(goldfish_init);
>
> So it unconditionallyt registers that platform device, which has IRQ 4 as
> irq resource and the driver happily matches on the platform devices.
>
> Wonderful crap, isn't it? It should be made 'depend on BROKEN'.

Ugh. Yeah, that's crazy. Random hardcoded interfaces that get enabled
by people by mistake.

And yeah, it's not just the irq. It just randomly sets up memory addresses too.

That thing needs to be disabled some way. Maybe not marked "broken",
but there needs to be something that actually enables it at runtime
(like a kernel command line option or something like that).

That said - that code was presumably enabled before too, so why would
this break something? And if this is the cause, we need to figure out
what it is that it then triggers..

            Linus

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13 21:42                                               ` Gabriel C
@ 2017-02-14  0:04                                                 ` Gabriel C
  0 siblings, 0 replies; 52+ messages in thread
From: Gabriel C @ 2017-02-14  0:04 UTC (permalink / raw)
  To: Thomas Gleixner, Borislav Petkov
  Cc: Linus Torvalds, Steven Rostedt, Mike Galbraith,
	Greg Kroah-Hartman, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby



On 13.02.2017 22:42, Gabriel C wrote:
>
>
> On 13.02.2017 21:59, Thomas Gleixner wrote:
>> On Mon, 13 Feb 2017, Borislav Petkov wrote:
>>> [    8.652522] genirq: Flags mismatch irq 4. 00000000 (serial) vs. 00000080 (gol
>>> dfish_pdev_bus)
>>
>>> [    8.652522] genirq: Flags mismatch irq 4. 00000000 (serial) vs. 00000080 (gol
>>> dfish_pdev_bus)
>>
>> Uurgh.
>>
>> Gabriel, can you please disable CONFIG_GOLDFISH and everything related to that?
>
> Sure. I was about to start building the kernels.
>
> I'll build an rc8 -CONFIG_GOLDFISH , -CONFIG_BLK_WBT + the debug patch from Linus.
>
> An one with with reverted revert.. with same config then..
>

Ok some news .. without CONFIG_GOLDFISH && CONFIG_BLK_WBT + Linus debug patch + Mike's patch ,
+ 'x86/ioapic: Restore IO-APIC irq_chip retrigger callback' back in I have an working kernel.

Linus debug patch triggers once but that seems to be the netconsole.. ( e1000e stuff )

..

[   10.049367] IRQ retrigger for edge
[   10.049368] ------------[ cut here ]------------
[   10.049373] WARNING: CPU: 11 PID: 1 at kernel/irq/resend.c:76 check_irq_resend+0x5f/0x80
[   10.049374] Modules linked in:
[   10.049377] CPU: 11 PID: 1 Comm: swapper/0 Tainted: G          I     4.10.0-rc8-debug-00001-ga1015e374d94-dirty #4
[   10.049378] Hardware name: FUJITSU                          PRIMERGY TX200 S5             /D2709, BIOS 6.00 Rev. 1.14.2709              02/04/2013
[   10.049379] Call Trace:
[   10.049382]  dump_stack+0x86/0xc1
[   10.049385]  __warn+0xbb/0xe0
[   10.049387]  warn_slowpath_null+0x18/0x20
[   10.049388]  check_irq_resend+0x5f/0x80
[   10.049390]  __enable_irq+0x4d/0x60
[   10.049391]  enable_irq+0x66/0x80
[   10.049394]  e1000_netpoll+0x76/0x110
[   10.049397]  netpoll_poll_dev+0xa0/0x170
[   10.049398]  netpoll_send_skb_on_dev+0x1ab/0x2b0
[   10.049400]  netpoll_send_udp+0x417/0x450
[   10.049403]  write_msg+0xdb/0xf0
[   10.049404]  console_unlock+0x2e5/0x430
[   10.049406]  register_console+0x287/0x370
[   10.049408]  init_netconsole+0x1e0/0x27f
[   10.049409]  ? option_setup+0x1f/0x1f
[   10.049413]  do_one_initcall+0x6f/0x190
[   10.049416]  ? do_early_param+0x8f/0x8f
[   10.049417]  kernel_init_freeable+0x321/0x3b7
[   10.049420]  ? rest_init+0x140/0x140
[   10.049421]  kernel_init+0x9/0xf0
[   10.049423]  ret_from_fork+0x31/0x40
[   10.049425] ---[ end trace 471c8e9095d0e278 ]---

...

Now I need to find out which CONFIG_* option broke it ..

I'll start to re-enable *GOLDFISH things first since this seems to be somewhat broken.

Is the first thing I will do tomorrow.

Regards,

Gabriel C

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-13 21:44                                                 ` Linus Torvalds
@ 2017-02-14  8:15                                                   ` Thomas Gleixner
  2017-02-14 14:49                                                     ` Thomas Gleixner
  0 siblings, 1 reply; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-14  8:15 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Borislav Petkov, Steven Rostedt, Gabriel C, Mike Galbraith,
	Greg Kroah-Hartman, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby

On Mon, 13 Feb 2017, Linus Torvalds wrote:
> On Mon, Feb 13, 2017 at 1:35 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >
> > arch/x86/platform/goldfish/goldfish.c
> >
> > static int __init goldfish_init(void)
> > {
> >         platform_device_register_simple("goldfish_pdev_bus", -1,
> >                                                 goldfish_pdev_bus_resources, 2);
> >         return 0;
> > }
> > device_initcall(goldfish_init);
> >
> > So it unconditionallyt registers that platform device, which has IRQ 4 as
> > irq resource and the driver happily matches on the platform devices.
> >
> > Wonderful crap, isn't it? It should be made 'depend on BROKEN'.
> 
> Ugh. Yeah, that's crazy. Random hardcoded interfaces that get enabled
> by people by mistake.
> 
> And yeah, it's not just the irq. It just randomly sets up memory addresses too.
> 
> That thing needs to be disabled some way. Maybe not marked "broken",
> but there needs to be something that actually enables it at runtime
> (like a kernel command line option or something like that).
> 
> That said - that code was presumably enabled before too, so why would
> this break something? And if this is the cause, we need to figure out
> what it is that it then triggers..

I'm on it ...

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-14  8:15                                                   ` Thomas Gleixner
@ 2017-02-14 14:49                                                     ` Thomas Gleixner
  2017-02-14 14:55                                                       ` Greg Kroah-Hartman
  2017-02-14 16:45                                                       ` Thomas Gleixner
  0 siblings, 2 replies; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-14 14:49 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Borislav Petkov, Steven Rostedt, Gabriel C, Mike Galbraith,
	Greg Kroah-Hartman, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby, Ingo Molnar

On Tue, 14 Feb 2017, Thomas Gleixner wrote:
> On Mon, 13 Feb 2017, Linus Torvalds wrote:
> > On Mon, Feb 13, 2017 at 1:35 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > >
> > > arch/x86/platform/goldfish/goldfish.c
> > >
> > > static int __init goldfish_init(void)
> > > {
> > >         platform_device_register_simple("goldfish_pdev_bus", -1,
> > >                                                 goldfish_pdev_bus_resources, 2);
> > >         return 0;
> > > }
> > > device_initcall(goldfish_init);
> > >
> > > So it unconditionallyt registers that platform device, which has IRQ 4 as
> > > irq resource and the driver happily matches on the platform devices.
> > >
> > > Wonderful crap, isn't it? It should be made 'depend on BROKEN'.
> > 
> > Ugh. Yeah, that's crazy. Random hardcoded interfaces that get enabled
> > by people by mistake.
> > 
> > And yeah, it's not just the irq. It just randomly sets up memory addresses too.
> > 
> > That thing needs to be disabled some way. Maybe not marked "broken",
> > but there needs to be something that actually enables it at runtime
> > (like a kernel command line option or something like that).

I prefer to mark it broken, because that's what it is, but we can add a
command line option as well. See below.

> > That said - that code was presumably enabled before too, so why would
> > this break something? And if this is the cause, we need to figure out
> > what it is that it then triggers..
> 
> I'm on it ...

When that goldfish bus driver gets an interrupt then it really goes down
the drain:

static irqreturn_t goldfish_pdev_bus_interrupt(int irq, void *dev_id)
{
	irqreturn_t ret = IRQ_NONE;
	while (1) {
		u32 op = readl(pdev_bus_base + PDEV_BUS_OP);

So here it reads from that hardcoded physical address which was handed in
via that platform device.

		switch (op) {
		case PDEV_BUS_OP_DONE:
			return IRQ_NONE;

If 'op' is 0 it returns IRQ_NONE;
	
		case PDEV_BUS_OP_REMOVE_DEV:
			goldfish_pdev_remove();
			break;

		case PDEV_BUS_OP_ADD_DEV:
			goldfish_new_pdev();
			break;

These two handle device add/remove which pokes more in that address
range. Cute stuff with kmalloc(GFP_ATOMIC) and other nice things inside of
a hard interrupt handler.

		}
		ret = IRQ_HANDLED;

Sets ret to HANDLED, which is pointless because the only exit from this
while(1) loop is via the PDEV_BUS_OP_DONE case, which returns IRQ_NONE !

	}
	return ret;
}

On my machine this loop never breaks because op = 0xffffffff . Which
obviously causes the rcu stalls and whatever.

I haven't seen such an engineering trainwreck in a long time.

So now, the real interesting question remains:

   Why is that ioapic - retrigger patch causing that nonsense to run?

>From Linus debug patch we can't see which interrupt line is retriggered and
it's a WARN_ONCE()....

Gabriel, can you please apply the debug patch below instead of the one
Linus sent, so we can get some more information about this. Can you upload
/proc/interrupts as well? The last one I've seen does not have e1000 in it.

Leave GOLDFISH and WBT disabled for now.

Thanks,

	tglx

8<-------------

--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -1098,9 +1098,10 @@ EXPORT_SYMBOL_GPL(irq_chip_set_type_pare
 int irq_chip_retrigger_hierarchy(struct irq_data *data)
 {
 	for (data = data->parent_data; data; data = data->parent_data)
-		if (data->chip && data->chip->irq_retrigger)
+		if (data->chip && data->chip->irq_retrigger) {
+			pr_info("Retrigger %s %u\n", data->chip->name, data->irq);
 			return data->chip->irq_retrigger(data);
-
+		}
 	return 0;
 }
 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-14 14:49                                                     ` Thomas Gleixner
@ 2017-02-14 14:55                                                       ` Greg Kroah-Hartman
  2017-02-14 15:11                                                         ` Thomas Gleixner
  2017-02-14 16:45                                                       ` Thomas Gleixner
  1 sibling, 1 reply; 52+ messages in thread
From: Greg Kroah-Hartman @ 2017-02-14 14:55 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Linus Torvalds, Borislav Petkov, Steven Rostedt, Gabriel C,
	Mike Galbraith, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby, Ingo Molnar

On Tue, Feb 14, 2017 at 03:49:57PM +0100, Thomas Gleixner wrote:
> On Tue, 14 Feb 2017, Thomas Gleixner wrote:
> > On Mon, 13 Feb 2017, Linus Torvalds wrote:
> > > On Mon, Feb 13, 2017 at 1:35 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > > >
> > > > arch/x86/platform/goldfish/goldfish.c
> > > >
> > > > static int __init goldfish_init(void)
> > > > {
> > > >         platform_device_register_simple("goldfish_pdev_bus", -1,
> > > >                                                 goldfish_pdev_bus_resources, 2);
> > > >         return 0;
> > > > }
> > > > device_initcall(goldfish_init);
> > > >
> > > > So it unconditionallyt registers that platform device, which has IRQ 4 as
> > > > irq resource and the driver happily matches on the platform devices.
> > > >
> > > > Wonderful crap, isn't it? It should be made 'depend on BROKEN'.
> > > 
> > > Ugh. Yeah, that's crazy. Random hardcoded interfaces that get enabled
> > > by people by mistake.
> > > 
> > > And yeah, it's not just the irq. It just randomly sets up memory addresses too.
> > > 
> > > That thing needs to be disabled some way. Maybe not marked "broken",
> > > but there needs to be something that actually enables it at runtime
> > > (like a kernel command line option or something like that).
> 
> I prefer to mark it broken, because that's what it is, but we can add a
> command line option as well. See below.

I have no problem marking all of the Goldfish stuff broken as it seems
to be a "dead" platform at the moment, no one is providing any updates
or cares about it, and the only users I know of it are using a _very_
old kernel version (the Android emulator).

Want me to send a patch for that as I think the Goldfish stuff
originally came through my tree...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-14 14:55                                                       ` Greg Kroah-Hartman
@ 2017-02-14 15:11                                                         ` Thomas Gleixner
  0 siblings, 0 replies; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-14 15:11 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Linus Torvalds, Borislav Petkov, Steven Rostedt, Gabriel C,
	Mike Galbraith, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby, Ingo Molnar

On Tue, 14 Feb 2017, Greg Kroah-Hartman wrote:
> On Tue, Feb 14, 2017 at 03:49:57PM +0100, Thomas Gleixner wrote:
> > On Tue, 14 Feb 2017, Thomas Gleixner wrote:
> > > On Mon, 13 Feb 2017, Linus Torvalds wrote:
> > > > On Mon, Feb 13, 2017 at 1:35 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > > > >
> > > > > arch/x86/platform/goldfish/goldfish.c
> > > > >
> > > > > static int __init goldfish_init(void)
> > > > > {
> > > > >         platform_device_register_simple("goldfish_pdev_bus", -1,
> > > > >                                                 goldfish_pdev_bus_resources, 2);
> > > > >         return 0;
> > > > > }
> > > > > device_initcall(goldfish_init);
> > > > >
> > > > > So it unconditionallyt registers that platform device, which has IRQ 4 as
> > > > > irq resource and the driver happily matches on the platform devices.
> > > > >
> > > > > Wonderful crap, isn't it? It should be made 'depend on BROKEN'.
> > > > 
> > > > Ugh. Yeah, that's crazy. Random hardcoded interfaces that get enabled
> > > > by people by mistake.
> > > > 
> > > > And yeah, it's not just the irq. It just randomly sets up memory addresses too.
> > > > 
> > > > That thing needs to be disabled some way. Maybe not marked "broken",
> > > > but there needs to be something that actually enables it at runtime
> > > > (like a kernel command line option or something like that).
> > 
> > I prefer to mark it broken, because that's what it is, but we can add a
> > command line option as well. See below.
> 
> I have no problem marking all of the Goldfish stuff broken as it seems
> to be a "dead" platform at the moment, no one is providing any updates
> or cares about it, and the only users I know of it are using a _very_
> old kernel version (the Android emulator).
> 
> Want me to send a patch for that as I think the Goldfish stuff
> originally came through my tree...

Alternatively we can add a command line option 'goldfish' to the
x86/platform code which prevents the creation of platform device if not
set. Either way is fine.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-14 14:49                                                     ` Thomas Gleixner
  2017-02-14 14:55                                                       ` Greg Kroah-Hartman
@ 2017-02-14 16:45                                                       ` Thomas Gleixner
  2017-02-15  2:17                                                         ` Gabriel C
  1 sibling, 1 reply; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-14 16:45 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Borislav Petkov, Steven Rostedt, Gabriel C, Mike Galbraith,
	Greg Kroah-Hartman, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby, Ingo Molnar

On Tue, 14 Feb 2017, Thomas Gleixner wrote:
> Gabriel, can you please apply the debug patch below instead of the one
> Linus sent, so we can get some more information about this. Can you upload
> /proc/interrupts as well? The last one I've seen does not have e1000 in it.
> 
> Leave GOLDFISH and WBT disabled for now.

Here is a better one. Please turn on GOLDFISH and leave WBT disabled unless
you have Jens patch applied.

That should give us the connection between the retrigger and the goldfish
irq firing.

output from lspci -vvv would be helpful as well.

Thanks,

	tglx
---
--- a/drivers/platform/goldfish/pdev_bus.c
+++ b/drivers/platform/goldfish/pdev_bus.c
@@ -154,10 +154,17 @@ static int goldfish_new_pdev(void)
 	return 0;
 }
 
+extern int stop_crap;
+
 static irqreturn_t goldfish_pdev_bus_interrupt(int irq, void *dev_id)
 {
 	irqreturn_t ret = IRQ_NONE;
-	while (1) {
+
+	if(!stop_crap) {
+		pr_info("Goldfish IRQ\n");
+		stop_crap = 1;
+	}
+	while (0) {
 		u32 op = readl(pdev_bus_base + PDEV_BUS_OP);
 		switch (op) {
 		case PDEV_BUS_OP_DONE:
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -1088,6 +1088,8 @@ int irq_chip_set_type_parent(struct irq_
 }
 EXPORT_SYMBOL_GPL(irq_chip_set_type_parent);
 
+int stop_crap;
+
 /**
  * irq_chip_retrigger_hierarchy - Retrigger an interrupt in hardware
  * @data:	Pointer to interrupt specific data
@@ -1098,9 +1100,11 @@ EXPORT_SYMBOL_GPL(irq_chip_set_type_pare
 int irq_chip_retrigger_hierarchy(struct irq_data *data)
 {
 	for (data = data->parent_data; data; data = data->parent_data)
-		if (data->chip && data->chip->irq_retrigger)
+		if (data->chip && data->chip->irq_retrigger) {
+			if (!stop_crap)
+				pr_info("Retrigger %s %u\n", data->chip->name, data->irq);
 			return data->chip->irq_retrigger(data);
-
+		}
 	return 0;
 }
 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-14 16:45                                                       ` Thomas Gleixner
@ 2017-02-15  2:17                                                         ` Gabriel C
  2017-02-15  8:46                                                           ` Thomas Gleixner
  0 siblings, 1 reply; 52+ messages in thread
From: Gabriel C @ 2017-02-15  2:17 UTC (permalink / raw)
  To: Thomas Gleixner, Linus Torvalds
  Cc: Borislav Petkov, Steven Rostedt, Mike Galbraith,
	Greg Kroah-Hartman, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby, Ingo Molnar



On 14.02.2017 17:45, Thomas Gleixner wrote:
> On Tue, 14 Feb 2017, Thomas Gleixner wrote:
>> Gabriel, can you please apply the debug patch below instead of the one
>> Linus sent, so we can get some more information about this. Can you upload
>> /proc/interrupts as well? The last one I've seen does not have e1000 in it.

Yes the card was not used the time I've send first round of hw infos..

>>
>> Leave GOLDFISH and WBT disabled for now.
>
> Here is a better one. Please turn on GOLDFISH and leave WBT disabled unless
> you have Jens patch applied.
>
> That should give us the connection between the retrigger and the goldfish
> irq firing.
>
> output from lspci -vvv would be helpful as well.

lspci , interrupts , dmidecode output can be found there :

http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/hw/

dmesg with initcall_debug :

http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/dmesg-4.10.0-rc8-debug-00001-ga1015e374d94-dirty

The only place I see your debug patch triggers is :

..

[    7.029816] calling  goldfish_pdev_bus_driver_init+0x0/0x14 @ 1
[    7.031707] Retrigger (null) 4
[    7.033556] Goldfish IRQ
..

So data->chip->name being NULL here.

Regards,

Gabriel C

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )
  2017-02-15  2:17                                                         ` Gabriel C
@ 2017-02-15  8:46                                                           ` Thomas Gleixner
  0 siblings, 0 replies; 52+ messages in thread
From: Thomas Gleixner @ 2017-02-15  8:46 UTC (permalink / raw)
  To: Gabriel C
  Cc: Linus Torvalds, Borislav Petkov, Steven Rostedt, Mike Galbraith,
	Greg Kroah-Hartman, stable, Andrew Morton, Ruslan Ruslichenko,
	Jiri Slaby, Ingo Molnar

On Wed, 15 Feb 2017, Gabriel C wrote:
> On 14.02.2017 17:45, Thomas Gleixner wrote:
> The only place I see your debug patch triggers is :
> 
> ..
> 
> [    7.029816] calling  goldfish_pdev_bus_driver_init+0x0/0x14 @ 1
> [    7.031707] Retrigger (null) 4
> [    7.033556] Goldfish IRQ

Ok. So the interrupt is pending for unknown reasons when it gets requested
by that goldfish driver and the enable logic retriggers it.  The retrigger
invokes that interrupt handler which then goes into infinite loop mode.

Having interrupts marked pending after boot happens occasionally and with
proper written drivers and interrupt handlers that's a non issue. Every
interrupt routine must be able to handle spurious interrupts.

So that's not a some mysterious low level interrupt handling problem, it's
just a completely bogus driver.

> So data->chip->name being NULL here.

Ok. That's the lapic_controller chip missing a chip name. I'll fix that
along with a command line option which makes that goldfish nonsense not
register that platform device unconditionally.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2017-02-15  8:46 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-26  7:48 Linux 4.9.6 Greg KH
2017-01-26  7:48 ` Greg KH
2017-02-06 17:30 ` Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box ) Gabriel C
2017-02-06 17:41   ` Greg KH
2017-02-06 19:05     ` Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco)
2017-02-06 19:05       ` Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco)
2017-02-06 20:38       ` Gabriel C
2017-02-06 20:38         ` Gabriel C
2017-02-06 23:06   ` Linus Torvalds
2017-02-07 20:46     ` Thomas Gleixner
2017-02-07 21:25       ` Thomas Gleixner
2017-02-10 23:17         ` Gabriel C
2017-02-11  1:42           ` Gabriel C
2017-02-11  8:26           ` Thomas Gleixner
2017-02-11 13:09             ` Gabriel C
2017-02-11 14:21               ` Borislav Petkov
2017-02-11 20:58                 ` Gabriel C
2017-02-11 21:32                   ` Borislav Petkov
2017-02-12 20:21                     ` Gabriel C
2017-02-12 21:12                       ` Borislav Petkov
2017-02-12 22:21                         ` Gabriel C
2017-02-13  0:38                           ` Borislav Petkov
2017-02-13  1:26                             ` Gabriel C
2017-02-13  2:31                               ` Mike Galbraith
     [not found]                                 ` <CA+55aFzC33RgUDbb-tn9+ANJtD_R2+FzjJihnT_kGk-h+nTD1Q@mail.gmail.com>
2017-02-13  5:48                                   ` Gabriel C
2017-02-13 14:05                                     ` Thomas Gleixner
2017-02-13 14:16                                       ` Thomas Gleixner
2017-02-13 20:24                                         ` Gabriel C
2017-02-13 18:35                                     ` Linus Torvalds
2017-02-13 19:33                                       ` Thomas Gleixner
2017-02-13 20:12                                         ` Linus Torvalds
2017-02-13 20:18                                           ` Thomas Gleixner
2017-02-13 20:22                                           ` Steven Rostedt
2017-02-13 20:43                                           ` Borislav Petkov
2017-02-13 20:59                                             ` Thomas Gleixner
2017-02-13 21:42                                               ` Gabriel C
2017-02-14  0:04                                                 ` Gabriel C
2017-02-13 21:33                                             ` Linus Torvalds
2017-02-13 21:35                                               ` Thomas Gleixner
2017-02-13 21:42                                                 ` Thomas Gleixner
2017-02-13 21:44                                                 ` Linus Torvalds
2017-02-14  8:15                                                   ` Thomas Gleixner
2017-02-14 14:49                                                     ` Thomas Gleixner
2017-02-14 14:55                                                       ` Greg Kroah-Hartman
2017-02-14 15:11                                                         ` Thomas Gleixner
2017-02-14 16:45                                                       ` Thomas Gleixner
2017-02-15  2:17                                                         ` Gabriel C
2017-02-15  8:46                                                           ` Thomas Gleixner
2017-02-13  8:47                                 ` Thomas Gleixner
2017-02-13  8:52                                 ` [tip:timers/urgent] tick/broadcast: Prevent deadlock on tick_broadcast_lock tip-bot for Mike Galbraith
2017-02-13 10:28                               ` Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box ) Borislav Petkov
2017-02-07 21:24     ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.