History

Merge 4.3-rc4 into char-misc-next

This is needed due to the duplicated iommu stuff to help with the merge and to prevent future issues.

Greg Kroah-Hartman committed 11 years ago

Commit c39b7ee2 parents 1e1851f 049e6dd285 files · +2457 −1583Browse files

Unified · Split

285 files
  1. Documentation/Changes +1 −1
  2. Documentation/devicetree/bindings/input/cypress,cyapa.txt +1 −1
  3. Documentation/devicetree/bindings/interrupt-controller/qca,ath79-misc-intc.txt +18 −2
  4. Documentation/input/multi-touch-protocol.txt +1 −1
  5. Documentation/power/pci.txt +38 −13
  6. Documentation/ptp/testptp.c +1 −0
  7. MAINTAINERS +2 −2
  8. Makefile +1 −1
  9. arch/arc/include/asm/Kbuild +1 −0
  10. arch/arm64/include/asm/pgtable.h +2 −2
  11. arch/arm64/kernel/efi.c +2 −1
  12. arch/arm64/kernel/entry-ftrace.S +20 −2
  13. arch/avr32/include/asm/Kbuild +1 −0
  14. arch/blackfin/include/asm/Kbuild +1 −0
  15. arch/c6x/include/asm/Kbuild +1 −0
  16. arch/cris/include/asm/Kbuild +1 −0
  17. arch/frv/include/asm/Kbuild +1 −0
  18. arch/hexagon/include/asm/Kbuild +1 −0
  19. arch/ia64/include/asm/Kbuild +1 −0
  20. arch/m32r/include/asm/Kbuild +1 −0
  21. arch/m68k/configs/amiga_defconfig +8 −1
  22. arch/m68k/configs/apollo_defconfig +8 −1
  23. arch/m68k/configs/atari_defconfig +8 −1
  24. arch/m68k/configs/bvme6000_defconfig +8 −1
  25. arch/m68k/configs/hp300_defconfig +8 −1
  26. arch/m68k/configs/mac_defconfig +8 −1
  27. arch/m68k/configs/multi_defconfig +8 −1
  28. arch/m68k/configs/mvme147_defconfig +8 −1
  29. arch/m68k/configs/mvme16x_defconfig +8 −1
  30. arch/m68k/configs/q40_defconfig +8 −1
  31. arch/m68k/configs/sun3_defconfig +8 −1
  32. arch/m68k/configs/sun3x_defconfig +8 −1
  33. arch/m68k/include/asm/linkage.h +30 −0
  34. arch/m68k/include/asm/unistd.h +1 −1
  35. arch/m68k/include/uapi/asm/unistd.h +19 −0
  36. arch/m68k/kernel/syscalltable.S +19 −1
  37. arch/metag/include/asm/Kbuild +1 −0
  38. arch/microblaze/include/asm/Kbuild +1 −0
  39. arch/mips/ath79/irq.c +20 −2
  40. arch/mips/cavium-octeon/setup.c +1 −1
  41. arch/mips/include/asm/Kbuild +1 −0
  42. arch/mips/include/asm/cpu-features.h +3 −0
  43. arch/mips/include/asm/cpu.h +1 −0
  44. arch/mips/include/asm/maar.h +9 −0
  45. arch/mips/include/asm/mips-cm.h +39 −0
  46. arch/mips/include/asm/mipsregs.h +2 −0
  47. arch/mips/include/uapi/asm/unistd.h +12 −6
  48. arch/mips/jz4740/board-qi_lb60.c +1 −0
  49. arch/mips/jz4740/gpio.c +1 −0
  50. arch/mips/kernel/cps-vec.S +7 −5
  51. arch/mips/kernel/cpu-probe.c +13 −8
  52. arch/mips/kernel/octeon_switch.S +1 −25
  53. arch/mips/kernel/r2300_switch.S +1 −27
  54. arch/mips/kernel/scall32-o32.S +18 −23
  55. arch/mips/kernel/scall64-64.S +18 −22
  56. arch/mips/kernel/scall64-n32.S +7 −14
  57. arch/mips/kernel/scall64-o32.S +7 −14
  58. arch/mips/kernel/setup.c +9 −1
  59. arch/mips/kernel/smp.c +2 −0
  60. arch/mips/loongson64/common/env.c +3 −0
  61. arch/mips/mm/dma-default.c +1 −1
  62. arch/mips/mm/init.c +114 −63
  63. arch/mips/net/bpf_jit_asm.S +54 −9
  64. arch/mn10300/include/asm/Kbuild +1 −0
  65. arch/nios2/include/asm/Kbuild +1 −0
  66. arch/powerpc/include/asm/Kbuild +1 −0
  67. arch/s390/include/asm/Kbuild +1 −0
  68. arch/score/include/asm/Kbuild +1 −0
  69. arch/tile/gxio/mpipe.c +4 −29
  70. arch/tile/include/asm/Kbuild +1 −0
  71. arch/tile/kernel/usb.c +1 −0
  72. arch/um/include/asm/Kbuild +1 −0
  73. arch/unicore32/include/asm/Kbuild +1 −0
  74. arch/x86/include/asm/cpufeature.h +1 −1
  75. arch/x86/include/asm/efi.h +2 −0
  76. arch/x86/include/asm/msr-index.h +2 −0
  77. arch/x86/include/asm/pvclock-abi.h +1 −0
  78. arch/x86/include/uapi/asm/bitsperlong.h +1 −1
  79. arch/x86/kernel/cpu/mshyperv.c +7 −5
  80. arch/x86/kernel/cpu/perf_event.h +1 −0
  81. arch/x86/kernel/cpu/perf_event_intel.c +15 −2
  82. arch/x86/kernel/cpu/perf_event_msr.c +2 −2
  83. arch/x86/kernel/cpu/scattered.c +1 −1
  84. arch/x86/kernel/crash.c +3 −4
  85. arch/x86/kernel/process.c +55 −0
  86. arch/x86/kernel/process_32.c +0 −28
  87. arch/x86/kernel/process_64.c +0 −24
  88. arch/x86/kvm/svm.c +13 −112
  89. arch/x86/kvm/vmx.c +8 −3
  90. arch/x86/kvm/x86.c +0 −4
  91. arch/x86/mm/init_64.c +1 −1
  92. arch/x86/platform/efi/efi.c +66 −1
  93. arch/xtensa/include/asm/Kbuild +1 −0
  94. block/blk-mq-cpumap.c +5 −4
  95. block/blk-mq-sysfs.c +22 −12
  96. block/blk-mq-tag.c +20 −7
  97. block/blk-mq-tag.h +2 −0
  98. block/blk-mq.c +77 −41
  99. block/blk-mq.h +2 −1
  100. crypto/asymmetric_keys/x509_public_key.c +0 −4
  101. drivers/acpi/ec.c +2 −0
  102. drivers/acpi/pci_irq.c +1 −0
  103. drivers/acpi/pci_link.c +14 −2
  104. drivers/base/power/opp.c +12 −5
  105. drivers/block/loop.c +5 −6
  106. drivers/block/null_blk.c +1 −1
  107. drivers/block/nvme-core.c +24 −28
  108. drivers/block/virtio_blk.c +1 −1
  109. drivers/block/xen-blkback/xenbus.c +20 −18
  110. drivers/block/xen-blkfront.c +10 −9
  111. drivers/clocksource/rockchip_timer.c +1 −1
  112. drivers/clocksource/timer-keystone.c +1 −1
  113. drivers/dma/at_xdmac.c +12 −3
  114. drivers/dma/dmaengine.c +9 −1
  115. drivers/dma/dw/core.c +2 −2
  116. drivers/dma/idma64.c +8 −8
  117. drivers/dma/pxa_dma.c +25 −6
  118. drivers/dma/sun4i-dma.c +3 −3
  119. drivers/dma/xgene-dma.c +17 −29
  120. drivers/dma/zx296702_dma.c +1 −1
  121. drivers/firmware/efi/libstub/arm-stub.c +73 −15
  122. drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +0 −39
  123. drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2 −1
  124. drivers/gpu/drm/amd/amdgpu/atombios_encoders.c +1 −2
  125. drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +6 −2
  126. drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +6 −2
  127. drivers/gpu/drm/amd/include/cgs_linux.h +0 −17
  128. drivers/gpu/drm/drm_dp_mst_topology.c +52 −33
  129. drivers/gpu/drm/drm_fb_helper.c +5 −1
  130. drivers/gpu/drm/drm_probe_helper.c +16 −3
  131. drivers/gpu/drm/exynos/exynos7_drm_decon.c +0 −12
  132. drivers/gpu/drm/exynos/exynos_dp_core.c +0 −23
  133. drivers/gpu/drm/exynos/exynos_drm_core.c +0 −6
  134. drivers/gpu/drm/exynos/exynos_drm_crtc.c +0 −15
  135. drivers/gpu/drm/exynos/exynos_drm_drv.c +2 −0
  136. drivers/gpu/drm/exynos/exynos_drm_drv.h +0 −4
  137. drivers/gpu/drm/exynos/exynos_drm_fimc.c +18 −18
  138. drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 −13
  139. drivers/gpu/drm/exynos/exynos_drm_g2d.c +0 −3
  140. drivers/gpu/drm/exynos/exynos_drm_gem.c +41 −53
  141. drivers/gpu/drm/exynos/exynos_drm_gem.h +2 −4
  142. drivers/gpu/drm/exynos/exynos_drm_rotator.c +1 −1
  143. drivers/gpu/drm/i915/intel_dp_mst.c +8 −1
  144. drivers/gpu/drm/i915/intel_hotplug.c +1 −1
  145. drivers/gpu/drm/i915/intel_lrc.c +32 −7
  146. drivers/gpu/drm/i915/intel_lrc.h +2 −0
  147. drivers/gpu/drm/i915/intel_runtime_pm.c +2 −1
  148. drivers/gpu/drm/qxl/qxl_display.c +1 −1
  149. drivers/gpu/drm/radeon/atombios_encoders.c +4 −4
  150. drivers/gpu/drm/radeon/radeon_dp_mst.c +9 −2
  151. drivers/gpu/drm/radeon/radeon_fb.c +1 −31
  152. drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c +8 −0
  153. drivers/hwmon/abx500.c +1 −0
  154. drivers/hwmon/gpio-fan.c +1 −0
  155. drivers/hwmon/pwm-fan.c +1 −0
  156. drivers/idle/intel_idle.c +10 −2
  157. drivers/infiniband/hw/mlx5/main.c +1 −66
  158. drivers/infiniband/hw/mlx5/mlx5_ib.h +0 −2
  159. drivers/infiniband/hw/mlx5/qp.c +1 −3
  160. drivers/infiniband/ulp/ipoib/ipoib.h +3 −1
  161. drivers/infiniband/ulp/ipoib/ipoib_main.c +18 −0
  162. drivers/infiniband/ulp/ipoib/ipoib_multicast.c +14 −12
  163. drivers/infiniband/ulp/iser/iscsi_iser.c +5 −0
  164. drivers/infiniband/ulp/iser/iscsi_iser.h +1 −0
  165. drivers/infiniband/ulp/iser/iser_memory.c +12 −6
  166. drivers/infiniband/ulp/iser/iser_verbs.c +13 −8
  167. drivers/input/joystick/Kconfig +1 −0
  168. drivers/input/joystick/walkera0701.c +2 −2
  169. drivers/input/keyboard/omap4-keypad.c +1 −1
  170. drivers/input/misc/pm8941-pwrkey.c +1 −1
  171. drivers/input/misc/uinput.c +1 −1
  172. drivers/input/mouse/elan_i2c.h +1 −1
  173. drivers/input/mouse/elan_i2c_core.c +19 −7
  174. drivers/input/mouse/elan_i2c_i2c.c +2 −2
  175. drivers/input/mouse/elan_i2c_smbus.c +2 −2
  176. drivers/input/mouse/synaptics.c +4 −8
  177. drivers/input/serio/libps2.c +14 −8
  178. drivers/input/serio/parkbd.c +1 −0
  179. drivers/input/touchscreen/imx6ul_tsc.c +22 −12
  180. drivers/input/touchscreen/mms114.c +2 −2
  181. drivers/iommu/intel-iommu.c +2 −0
  182. drivers/iommu/iova.c +6 −17
  183. drivers/irqchip/irq-gic-v3-its-pci-msi.c +1 −1
  184. drivers/irqchip/irq-gic-v3-its.c +3 −0
  185. drivers/irqchip/irq-mips-gic.c +10 −2
  186. drivers/md/bitmap.c +2 −1
  187. drivers/md/md.c +5 −0
  188. drivers/md/multipath.c +1 −2
  189. drivers/md/raid0.c +6 −6
  190. drivers/md/raid1.c +4 −7
  191. drivers/md/raid10.c +3 −6
  192. drivers/md/raid5.c +7 −4
  193. drivers/mmc/core/core.c +4 −2
  194. drivers/mmc/core/host.c +2 −2
  195. drivers/mmc/host/pxamci.c +22 −44
  196. drivers/mmc/host/sunxi-mmc.c +39 −14
  197. drivers/mtd/ubi/io.c +5 −0
  198. drivers/mtd/ubi/vtbl.c +1 −0
  199. drivers/mtd/ubi/wl.c +1 −0
  200. drivers/net/dsa/mv88e6xxx.c +2 −0
  201. drivers/net/ethernet/brocade/bna/bfa_ioc.c +7 −6
  202. drivers/net/ethernet/hisilicon/hip04_eth.c +1 −1
  203. drivers/net/ethernet/ibm/emac/core.h +3 −3
  204. drivers/net/ethernet/intel/i40e/i40e_adminq.c +9 −0
  205. drivers/net/ethernet/intel/i40e/i40e_main.c +2 −1
  206. drivers/net/ethernet/intel/i40evf/i40e_adminq.c +9 −0
  207. drivers/net/ethernet/mellanox/mlx4/mcg.c +4 −3
  208. drivers/net/ethernet/mellanox/mlx5/core/fw.c +0 −22
  209. drivers/net/ethernet/realtek/r8169.c +1 −1
  210. drivers/pci/pci-driver.c +4 −3
  211. drivers/scsi/scsi_lib.c +1 −1
  212. drivers/thermal/power_allocator.c +10 −0
  213. drivers/watchdog/Kconfig +2 −1
  214. drivers/watchdog/bcm2835_wdt.c +8 −2
  215. drivers/watchdog/gef_wdt.c +1 −0
  216. drivers/watchdog/mena21_wdt.c +1 −0
  217. drivers/watchdog/moxart_wdt.c +1 −0
  218. fs/dax.c +12 −1
  219. fs/ubifs/xattr.c +0 −3
  220. include/asm-generic/word-at-a-time.h +72 −8
  221. include/drm/drm_crtc_helper.h +1 −0
  222. include/drm/drm_dp_helper.h +4 −0
  223. include/drm/drm_dp_mst_helper.h +1 −0
  224. include/linux/acpi.h +1 −0
  225. include/linux/blk-mq.h +1 −4
  226. include/linux/blkdev.h +2 −0
  227. include/linux/memcontrol.h +0 −1
  228. include/linux/mlx5/device.h +0 −11
  229. include/linux/mlx5/driver.h +0 −1
  230. include/linux/mm.h +21 −0
  231. include/linux/rcupdate.h +5 −6
  232. include/linux/skbuff.h +1 −1
  233. include/linux/string.h +3 −0
  234. include/net/af_unix.h +5 −1
  235. include/uapi/linux/userfaultfd.h +0 −2
  236. ipc/msg.c +7 −7
  237. ipc/shm.c +7 −6
  238. ipc/util.c +4 −4
  239. kernel/events/core.c +81 −33
  240. kernel/irq/proc.c +17 −2
  241. kernel/locking/lockdep.c +5 −5
  242. kernel/rcu/tree.c +5 −0
  243. kernel/sched/core.c +11 −3
  244. kernel/time/clocksource.c +1 −1
  245. lib/string.c +88 −0
  246. mm/dmapool.c +1 −1
  247. mm/hugetlb.c +8 −0
  248. mm/memcontrol.c +18 −13
  249. mm/migrate.c +11 −1
  250. mm/slab.c +10 −3
  251. net/core/net-sysfs.c +1 −2
  252. net/core/skbuff.c +5 −4
  253. net/dsa/slave.c +8 −3
  254. net/ipv4/fib_frontend.c +1 −0
  255. net/ipv4/route.c +1 −0
  256. net/ipv6/route.c +2 −1
  257. net/l2tp/l2tp_core.c +9 −2
  258. net/sctp/associola.c +11 −9
  259. net/sctp/sm_sideeffect.c +24 −20
  260. net/sunrpc/xprtrdma/fmr_ops.c +0 −19
  261. net/sunrpc/xprtrdma/frwr_ops.c +0 −5
  262. net/sunrpc/xprtrdma/physical_ops.c +1 −9
  263. net/sunrpc/xprtrdma/verbs.c +1 −1
  264. net/sunrpc/xprtrdma/xprt_rdma.h +0 −1
  265. net/unix/af_unix.c +14 −1
  266. samples/kprobes/jprobe_example.c +7 −7
  267. samples/kprobes/kprobe_example.c +3 −3
  268. samples/kprobes/kretprobe_example.c +2 −2
  269. scripts/extract-cert.c +0 −4
  270. scripts/sign-file.c +77 −17
  271. security/keys/gc.c +4 −4
  272. tools/build/Makefile.feature +6 −2
  273. tools/build/feature/Makefile +9 −1
  274. tools/build/feature/test-all.c +10 −0
  275. tools/build/feature/test-get_cpuid.c +7 −0
  276. tools/build/feature/test-numa_num_possible_cpus.c +6 −0
  277. tools/lib/traceevent/event-parse.c +20 −3
  278. tools/perf/Documentation/intel-pt.txt +0 −15
  279. tools/perf/config/Makefile +15 −5
  280. tools/perf/util/probe-event.c +7 −6
  281. tools/perf/util/session.c +4 −1
  282. tools/perf/util/stat.c +14 −2
  283. tools/perf/util/symbol-elf.c +14 −23
  284. tools/perf/util/util.c +1 −1
  285. tools/power/x86/turbostat/turbostat.c +34 −5
Documentation/Changes+1−1
@@ -43,7 +43,7 @@ o udev 081 # udevd --version · 42 unmodified lines
4343 o grub 0.93 # grub --version || grub-install --version
4444 o mcelog 0.6 # mcelog --version
4545 o iptables 1.4.2 # iptables -V
46−o openssl & libcrypto 1.0.1k # openssl version
46+o openssl & libcrypto 1.0.0 # openssl version
4747
4848
4949 Kernel compilation
Documentation/devicetree/bindings/input/cypress,cyapa.txt+1−1
@@ -25,7 +25,7 @@ Example: · 24 unmodified lines
2525 /* Cypress Gen3 touchpad */
2626 touchpad@67 {
2727 compatible = "cypress,cyapa";
28− reg = <0x24>;
28+ reg = <0x67>;
2929 interrupt-parent = <&gpio>;
3030 interrupts = <2 IRQ_TYPE_EDGE_FALLING>; /* GPIO 2 */
3131 wakeup-source;
Documentation/devicetree/bindings/interrupt-controller/qca,ath79-misc-intc.txt+18−2
@@ -4,8 +4,8 @@ The MISC interrupt controller is a secondary controller for lower priority · 3 unmodified lines
44 interrupt.
55
66 Required Properties:
7−- compatible: has to be "qca,<soctype>-cpu-intc", "qca,ar7100-misc-intc"
8− as fallback
7+- compatible: has to be "qca,<soctype>-cpu-intc", "qca,ar7100-misc-intc" or
8+ "qca,<soctype>-cpu-intc", "qca,ar7240-misc-intc"
99 - reg: Base address and size of the controllers memory area
1010 - interrupt-parent: phandle of the parent interrupt controller.
1111 - interrupts: Interrupt specifier for the controllers interrupt.
@@ -13,6 +13,9 @@ Required Properties: · 1 unmodified line
1313 - #interrupt-cells : Specifies the number of cells needed to encode interrupt
1414 source, should be 1
1515
16+Compatible fallback depends on the SoC. Use ar7100 for ar71xx and ar913x,
17+use ar7240 for all other SoCs.
18+
1619 Please refer to interrupts.txt in this directory for details of the common
1720 Interrupt Controllers bindings used by client devices.
1821
@@ -28,3 +31,16 @@ Example: · 9 unmodified lines
2831 interrupt-controller;
2932 #interrupt-cells = <1>;
3033 };
34+
35+Another example:
36+
37+ interrupt-controller@18060010 {
38+ compatible = "qca,ar9331-misc-intc", qca,ar7240-misc-intc";
39+ reg = <0x18060010 0x4>;
40+
41+ interrupt-parent = <&cpuintc>;
42+ interrupts = <6>;
43+
44+ interrupt-controller;
45+ #interrupt-cells = <1>;
46+ };
Documentation/input/multi-touch-protocol.txt+1−1
@@ -361,7 +361,7 @@ For win8 devices with both T and C coordinates, the position mapping is · 360 unmodified lines
361361 ABS_MT_POSITION_X := T_X
362362 ABS_MT_POSITION_Y := T_Y
363363 ABS_MT_TOOL_X := C_X
364− ABS_MT_TOOL_X := C_Y
364+ ABS_MT_TOOL_Y := C_Y
365365
366366 Unfortunately, there is not enough information to specify both the touching
367367 ellipse and the tool ellipse, so one has to resort to approximations. One
Documentation/power/pci.txt+38−13
@@ -979,20 +979,45 @@ every time right after the runtime_resume() callback has returned · 978 unmodified lines
979979 (alternatively, the runtime_suspend() callback will have to check if the
980980 device should really be suspended and return -EAGAIN if that is not the case).
981981
982−The runtime PM of PCI devices is disabled by default. It is also blocked by
983−pci_pm_init() that runs the pm_runtime_forbid() helper function. If a PCI
984−driver implements the runtime PM callbacks and intends to use the runtime PM
985−framework provided by the PM core and the PCI subsystem, it should enable this
986−feature by executing the pm_runtime_enable() helper function. However, the
987−driver should not call the pm_runtime_allow() helper function unblocking
988−the runtime PM of the device. Instead, it should allow user space or some
989−platform-specific code to do that (user space can do it via sysfs), although
990−once it has called pm_runtime_enable(), it must be prepared to handle the
982+The runtime PM of PCI devices is enabled by default by the PCI core. PCI
983+device drivers do not need to enable it and should not attempt to do so.
984+However, it is blocked by pci_pm_init() that runs the pm_runtime_forbid()
985+helper function. In addition to that, the runtime PM usage counter of
986+each PCI device is incremented by local_pci_probe() before executing the
987+probe callback provided by the device's driver.
988+
989+If a PCI driver implements the runtime PM callbacks and intends to use the
990+runtime PM framework provided by the PM core and the PCI subsystem, it needs
991+to decrement the device's runtime PM usage counter in its probe callback
992+function. If it doesn't do that, the counter will always be different from
993+zero for the device and it will never be runtime-suspended. The simplest
994+way to do that is by calling pm_runtime_put_noidle(), but if the driver
995+wants to schedule an autosuspend right away, for example, it may call
996+pm_runtime_put_autosuspend() instead for this purpose. Generally, it
997+just needs to call a function that decrements the devices usage counter
998+from its probe routine to make runtime PM work for the device.
999+
1000+It is important to remember that the driver's runtime_suspend() callback
1001+may be executed right after the usage counter has been decremented, because
1002+user space may already have cuased the pm_runtime_allow() helper function
1003+unblocking the runtime PM of the device to run via sysfs, so the driver must
1004+be prepared to cope with that.
1005+
1006+The driver itself should not call pm_runtime_allow(), though. Instead, it
1007+should let user space or some platform-specific code do that (user space can
1008+do it via sysfs as stated above), but it must be prepared to handle the
9911009 runtime PM of the device correctly as soon as pm_runtime_allow() is called
992−(which may happen at any time). [It also is possible that user space causes
993−pm_runtime_allow() to be called via sysfs before the driver is loaded, so in
994−fact the driver has to be prepared to handle the runtime PM of the device as
995−soon as it calls pm_runtime_enable().]
1010+(which may happen at any time, even before the driver is loaded).
1011+
1012+When the driver's remove callback runs, it has to balance the decrementation
1013+of the device's runtime PM usage counter at the probe time. For this reason,
1014+if it has decremented the counter in its probe callback, it must run
1015+pm_runtime_get_noresume() in its remove callback. [Since the core carries
1016+out a runtime resume of the device and bumps up the device's usage counter
1017+before running the driver's remove callback, the runtime PM of the device
1018+is effectively disabled for the duration of the remove execution and all
1019+runtime PM helper functions incrementing the device's usage counter are
1020+then effectively equivalent to pm_runtime_get_noresume().]
9961021
9971022 The runtime PM framework works by processing requests to suspend or resume
9981023 devices, or to check if they are idle (in which cases it is reasonable to
Documentation/ptp/testptp.c+1−0
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1919 */
2020 #define _GNU_SOURCE
21+#define __SANE_USERSPACE_TYPES__ /* For PPC64, to get LL64 types */
2122 #include <errno.h>
2223 #include <fcntl.h>
2324 #include <inttypes.h>
MAINTAINERS+2−2
@@ -5963,7 +5963,7 @@ F: virt/kvm/ · 5962 unmodified lines
59635963 KERNEL VIRTUAL MACHINE (KVM) FOR AMD-V
59645964 M: Joerg Roedel <joro@8bytes.org>
59655965 L: kvm@vger.kernel.org
5966−W: http://kvm.qumranet.com
5966+W: http://www.linux-kvm.org/
59675967 S: Maintained
59685968 F: arch/x86/include/asm/svm.h
59695969 F: arch/x86/kvm/svm.c
@@ -5971,7 +5971,7 @@ F: arch/x86/kvm/svm.c · 1 unmodified line
59715971 KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC
59725972 M: Alexander Graf <agraf@suse.com>
59735973 L: kvm-ppc@vger.kernel.org
5974−W: http://kvm.qumranet.com
5974+W: http://www.linux-kvm.org/
59755975 T: git git://github.com/agraf/linux-2.6.git
59765976 S: Supported
59775977 F: arch/powerpc/include/asm/kvm*
Makefile+1−1
@@ -1,7 +1,7 @@
11 VERSION = 4
22 PATCHLEVEL = 3
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc3
4+EXTRAVERSION = -rc4
55 NAME = Hurr durr I'ma sheep
66
77 # *DOCUMENTATION*
arch/arc/include/asm/Kbuild+1−0
@@ -48,4 +48,5 @@ generic-y += types.h · 47 unmodified lines
4848 generic-y += ucontext.h
4949 generic-y += user.h
5050 generic-y += vga.h
51+generic-y += word-at-a-time.h
5152 generic-y += xor.h
arch/arm64/include/asm/pgtable.h+2−2
@@ -79,7 +79,7 @@ extern void __pgd_error(const char *file, int line, unsigned long val); · 78 unmodified lines
7979 #define PAGE_S2 __pgprot(PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_NORMAL) | PTE_S2_RDONLY)
8080 #define PAGE_S2_DEVICE __pgprot(PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_DEVICE_nGnRE) | PTE_S2_RDONLY | PTE_UXN)
8181
82−#define PAGE_NONE __pgprot(((_PAGE_DEFAULT) & ~PTE_TYPE_MASK) | PTE_PROT_NONE | PTE_PXN | PTE_UXN)
82+#define PAGE_NONE __pgprot(((_PAGE_DEFAULT) & ~PTE_VALID) | PTE_PROT_NONE | PTE_PXN | PTE_UXN)
8383 #define PAGE_SHARED __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_WRITE)
8484 #define PAGE_SHARED_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_WRITE)
8585 #define PAGE_COPY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN)
@@ -496,7 +496,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long addr) · 410 unmodified lines
496496 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
497497 {
498498 const pteval_t mask = PTE_USER | PTE_PXN | PTE_UXN | PTE_RDONLY |
499− PTE_PROT_NONE | PTE_WRITE | PTE_TYPE_MASK;
499+ PTE_PROT_NONE | PTE_VALID | PTE_WRITE;
500500 /* preserve the hardware dirty information */
501501 if (pte_hw_dirty(pte))
502502 pte = pte_mkdirty(pte);
arch/arm64/kernel/efi.c+2−1
@@ -258,7 +258,8 @@ static bool __init efi_virtmap_init(void) · 257 unmodified lines
258258 */
259259 if (!is_normal_ram(md))
260260 prot = __pgprot(PROT_DEVICE_nGnRE);
261− else if (md->type == EFI_RUNTIME_SERVICES_CODE)
261+ else if (md->type == EFI_RUNTIME_SERVICES_CODE ||
262+ !PAGE_ALIGNED(md->phys_addr))
262263 prot = PAGE_KERNEL_EXEC;
263264 else
264265 prot = PAGE_KERNEL;
arch/arm64/kernel/entry-ftrace.S+20−2
@@ -178,6 +178,24 @@ ENTRY(ftrace_stub) · 177 unmodified lines
178178 ENDPROC(ftrace_stub)
179179
180180 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
181+ /* save return value regs*/
182+ .macro save_return_regs
183+ sub sp, sp, #64
184+ stp x0, x1, [sp]
185+ stp x2, x3, [sp, #16]
186+ stp x4, x5, [sp, #32]
187+ stp x6, x7, [sp, #48]
188+ .endm
189+
190+ /* restore return value regs*/
191+ .macro restore_return_regs
192+ ldp x0, x1, [sp]
193+ ldp x2, x3, [sp, #16]
194+ ldp x4, x5, [sp, #32]
195+ ldp x6, x7, [sp, #48]
196+ add sp, sp, #64
197+ .endm
198+
181199 /*
182200 * void ftrace_graph_caller(void)
183201 *
@@ -204,11 +222,11 @@ ENDPROC(ftrace_graph_caller) · 20 unmodified lines
204222 * only when CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST is enabled.
205223 */
206224 ENTRY(return_to_handler)
207− str x0, [sp, #-16]!
225+ save_return_regs
208226 mov x0, x29 // parent's fp
209227 bl ftrace_return_to_handler// addr = ftrace_return_to_hander(fp);
210228 mov x30, x0 // restore the original return address
211− ldr x0, [sp], #16
229+ restore_return_regs
212230 ret
213231 END(return_to_handler)
214232 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
arch/avr32/include/asm/Kbuild+1−0
@@ -20,4 +20,5 @@ generic-y += sections.h · 19 unmodified lines
2020 generic-y += topology.h
2121 generic-y += trace_clock.h
2222 generic-y += vga.h
23+generic-y += word-at-a-time.h
2324 generic-y += xor.h
arch/blackfin/include/asm/Kbuild+1−0
@@ -46,4 +46,5 @@ generic-y += types.h · 45 unmodified lines
4646 generic-y += ucontext.h
4747 generic-y += unaligned.h
4848 generic-y += user.h
49+generic-y += word-at-a-time.h
4950 generic-y += xor.h
arch/c6x/include/asm/Kbuild+1−0
@@ -59,4 +59,5 @@ generic-y += types.h · 58 unmodified lines
5959 generic-y += ucontext.h
6060 generic-y += user.h
6161 generic-y += vga.h
62+generic-y += word-at-a-time.h
6263 generic-y += xor.h
arch/cris/include/asm/Kbuild+1−0
@@ -43,4 +43,5 @@ generic-y += topology.h · 42 unmodified lines
4343 generic-y += trace_clock.h
4444 generic-y += types.h
4545 generic-y += vga.h
46+generic-y += word-at-a-time.h
4647 generic-y += xor.h
arch/frv/include/asm/Kbuild+1−0
@@ -7,3 +7,4 @@ generic-y += mcs_spinlock.h · 6 unmodified lines
77 generic-y += mm-arch-hooks.h
88 generic-y += preempt.h
99 generic-y += trace_clock.h
10+generic-y += word-at-a-time.h
arch/hexagon/include/asm/Kbuild+1−0
@@ -58,4 +58,5 @@ generic-y += types.h · 57 unmodified lines
5858 generic-y += ucontext.h
5959 generic-y += unaligned.h
6060 generic-y += vga.h
61+generic-y += word-at-a-time.h
6162 generic-y += xor.h
arch/ia64/include/asm/Kbuild+1−0
@@ -8,3 +8,4 @@ generic-y += mm-arch-hooks.h · 7 unmodified lines
88 generic-y += preempt.h
99 generic-y += trace_clock.h
1010 generic-y += vtime.h
11+generic-y += word-at-a-time.h
arch/m32r/include/asm/Kbuild+1−0
@@ -9,3 +9,4 @@ generic-y += module.h · 8 unmodified lines
99 generic-y += preempt.h
1010 generic-y += sections.h
1111 generic-y += trace_clock.h
12+generic-y += word-at-a-time.h
arch/m68k/configs/amiga_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -57,7 +58,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 41 unmodified lines
5758 CONFIG_NET_IPGRE=m
5859 CONFIG_NET_IPVTI=m
5960 CONFIG_NET_FOU_IP_TUNNELS=y
60−CONFIG_GENEVE_CORE=m
6161 CONFIG_INET_AH=m
6262 CONFIG_INET_ESP=m
6363 CONFIG_INET_IPCOMP=m
@@ -67,10 +67,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6767 # CONFIG_INET_LRO is not set
6868 CONFIG_INET_DIAG=m
6969 CONFIG_INET_UDP_DIAG=m
70+CONFIG_IPV6=m
7071 CONFIG_IPV6_ROUTER_PREF=y
7172 CONFIG_INET6_AH=m
7273 CONFIG_INET6_ESP=m
7374 CONFIG_INET6_IPCOMP=m
75+CONFIG_IPV6_ILA=m
7476 CONFIG_IPV6_VTI=m
7577 CONFIG_IPV6_GRE=m
7678 CONFIG_NETFILTER=y
@@ -179,6 +181,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
179181 CONFIG_IP_SET_LIST_SET=m
180182 CONFIG_NF_CONNTRACK_IPV4=m
181183 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
184+CONFIG_NFT_DUP_IPV4=m
182185 CONFIG_NF_TABLES_ARP=m
183186 CONFIG_NF_LOG_ARP=m
184187 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -206,6 +209,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
206209 CONFIG_IP_NF_ARP_MANGLE=m
207210 CONFIG_NF_CONNTRACK_IPV6=m
208211 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
212+CONFIG_NFT_DUP_IPV6=m
209213 CONFIG_NFT_CHAIN_NAT_IPV6=m
210214 CONFIG_NFT_MASQ_IPV6=m
211215 CONFIG_NFT_REDIR_IPV6=m
@@ -271,6 +275,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
271275 CONFIG_MPLS=y
272276 CONFIG_NET_MPLS_GSO=m
273277 CONFIG_MPLS_ROUTING=m
278+CONFIG_MPLS_IPTUNNEL=m
274279 # CONFIG_WIRELESS is not set
275280 # CONFIG_UEVENT_HELPER is not set
276281 CONFIG_DEVTMPFS=y
@@ -370,6 +375,7 @@ CONFIG_ZORRO8390=y · 93 unmodified lines
370375 # CONFIG_NET_VENDOR_SEEQ is not set
371376 # CONFIG_NET_VENDOR_SMSC is not set
372377 # CONFIG_NET_VENDOR_STMICRO is not set
378+# CONFIG_NET_VENDOR_SYNOPSYS is not set
373379 # CONFIG_NET_VENDOR_VIA is not set
374380 # CONFIG_NET_VENDOR_WIZNET is not set
375381 CONFIG_PPP=m
@@ -537,6 +543,7 @@ CONFIG_TEST_USER_COPY=m · 161 unmodified lines
537543 CONFIG_TEST_BPF=m
538544 CONFIG_TEST_FIRMWARE=m
539545 CONFIG_TEST_UDELAY=m
546+CONFIG_TEST_STATIC_KEYS=m
540547 CONFIG_EARLY_PRINTK=y
541548 CONFIG_ENCRYPTED_KEYS=m
542549 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/apollo_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -55,7 +56,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 39 unmodified lines
5556 CONFIG_NET_IPGRE=m
5657 CONFIG_NET_IPVTI=m
5758 CONFIG_NET_FOU_IP_TUNNELS=y
58−CONFIG_GENEVE_CORE=m
5959 CONFIG_INET_AH=m
6060 CONFIG_INET_ESP=m
6161 CONFIG_INET_IPCOMP=m
@@ -65,10 +65,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6565 # CONFIG_INET_LRO is not set
6666 CONFIG_INET_DIAG=m
6767 CONFIG_INET_UDP_DIAG=m
68+CONFIG_IPV6=m
6869 CONFIG_IPV6_ROUTER_PREF=y
6970 CONFIG_INET6_AH=m
7071 CONFIG_INET6_ESP=m
7172 CONFIG_INET6_IPCOMP=m
73+CONFIG_IPV6_ILA=m
7274 CONFIG_IPV6_VTI=m
7375 CONFIG_IPV6_GRE=m
7476 CONFIG_NETFILTER=y
@@ -177,6 +179,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
177179 CONFIG_IP_SET_LIST_SET=m
178180 CONFIG_NF_CONNTRACK_IPV4=m
179181 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
182+CONFIG_NFT_DUP_IPV4=m
180183 CONFIG_NF_TABLES_ARP=m
181184 CONFIG_NF_LOG_ARP=m
182185 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -204,6 +207,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
204207 CONFIG_IP_NF_ARP_MANGLE=m
205208 CONFIG_NF_CONNTRACK_IPV6=m
206209 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
210+CONFIG_NFT_DUP_IPV6=m
207211 CONFIG_NFT_CHAIN_NAT_IPV6=m
208212 CONFIG_NFT_MASQ_IPV6=m
209213 CONFIG_NFT_REDIR_IPV6=m
@@ -269,6 +273,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
269273 CONFIG_MPLS=y
270274 CONFIG_NET_MPLS_GSO=m
271275 CONFIG_MPLS_ROUTING=m
276+CONFIG_MPLS_IPTUNNEL=m
272277 # CONFIG_WIRELESS is not set
273278 # CONFIG_UEVENT_HELPER is not set
274279 CONFIG_DEVTMPFS=y
@@ -344,6 +349,7 @@ CONFIG_VETH=m · 69 unmodified lines
344349 # CONFIG_NET_VENDOR_SAMSUNG is not set
345350 # CONFIG_NET_VENDOR_SEEQ is not set
346351 # CONFIG_NET_VENDOR_STMICRO is not set
352+# CONFIG_NET_VENDOR_SYNOPSYS is not set
347353 # CONFIG_NET_VENDOR_VIA is not set
348354 # CONFIG_NET_VENDOR_WIZNET is not set
349355 CONFIG_PPP=m
@@ -495,6 +501,7 @@ CONFIG_TEST_USER_COPY=m · 145 unmodified lines
495501 CONFIG_TEST_BPF=m
496502 CONFIG_TEST_FIRMWARE=m
497503 CONFIG_TEST_UDELAY=m
504+CONFIG_TEST_STATIC_KEYS=m
498505 CONFIG_EARLY_PRINTK=y
499506 CONFIG_ENCRYPTED_KEYS=m
500507 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/atari_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -55,7 +56,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 39 unmodified lines
5556 CONFIG_NET_IPGRE=m
5657 CONFIG_NET_IPVTI=m
5758 CONFIG_NET_FOU_IP_TUNNELS=y
58−CONFIG_GENEVE_CORE=m
5959 CONFIG_INET_AH=m
6060 CONFIG_INET_ESP=m
6161 CONFIG_INET_IPCOMP=m
@@ -65,10 +65,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6565 # CONFIG_INET_LRO is not set
6666 CONFIG_INET_DIAG=m
6767 CONFIG_INET_UDP_DIAG=m
68+CONFIG_IPV6=m
6869 CONFIG_IPV6_ROUTER_PREF=y
6970 CONFIG_INET6_AH=m
7071 CONFIG_INET6_ESP=m
7172 CONFIG_INET6_IPCOMP=m
73+CONFIG_IPV6_ILA=m
7274 CONFIG_IPV6_VTI=m
7375 CONFIG_IPV6_GRE=m
7476 CONFIG_NETFILTER=y
@@ -177,6 +179,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
177179 CONFIG_IP_SET_LIST_SET=m
178180 CONFIG_NF_CONNTRACK_IPV4=m
179181 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
182+CONFIG_NFT_DUP_IPV4=m
180183 CONFIG_NF_TABLES_ARP=m
181184 CONFIG_NF_LOG_ARP=m
182185 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -204,6 +207,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
204207 CONFIG_IP_NF_ARP_MANGLE=m
205208 CONFIG_NF_CONNTRACK_IPV6=m
206209 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
210+CONFIG_NFT_DUP_IPV6=m
207211 CONFIG_NFT_CHAIN_NAT_IPV6=m
208212 CONFIG_NFT_MASQ_IPV6=m
209213 CONFIG_NFT_REDIR_IPV6=m
@@ -269,6 +273,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
269273 CONFIG_MPLS=y
270274 CONFIG_NET_MPLS_GSO=m
271275 CONFIG_MPLS_ROUTING=m
276+CONFIG_MPLS_IPTUNNEL=m
272277 # CONFIG_WIRELESS is not set
273278 # CONFIG_UEVENT_HELPER is not set
274279 CONFIG_DEVTMPFS=y
@@ -355,6 +360,7 @@ CONFIG_NE2000=y · 80 unmodified lines
355360 # CONFIG_NET_VENDOR_SEEQ is not set
356361 CONFIG_SMC91X=y
357362 # CONFIG_NET_VENDOR_STMICRO is not set
363+# CONFIG_NET_VENDOR_SYNOPSYS is not set
358364 # CONFIG_NET_VENDOR_VIA is not set
359365 # CONFIG_NET_VENDOR_WIZNET is not set
360366 CONFIG_PPP=m
@@ -517,6 +523,7 @@ CONFIG_TEST_USER_COPY=m · 156 unmodified lines
517523 CONFIG_TEST_BPF=m
518524 CONFIG_TEST_FIRMWARE=m
519525 CONFIG_TEST_UDELAY=m
526+CONFIG_TEST_STATIC_KEYS=m
520527 CONFIG_EARLY_PRINTK=y
521528 CONFIG_ENCRYPTED_KEYS=m
522529 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/bvme6000_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -53,7 +54,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 37 unmodified lines
5354 CONFIG_NET_IPGRE=m
5455 CONFIG_NET_IPVTI=m
5556 CONFIG_NET_FOU_IP_TUNNELS=y
56−CONFIG_GENEVE_CORE=m
5757 CONFIG_INET_AH=m
5858 CONFIG_INET_ESP=m
5959 CONFIG_INET_IPCOMP=m
@@ -63,10 +63,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6363 # CONFIG_INET_LRO is not set
6464 CONFIG_INET_DIAG=m
6565 CONFIG_INET_UDP_DIAG=m
66+CONFIG_IPV6=m
6667 CONFIG_IPV6_ROUTER_PREF=y
6768 CONFIG_INET6_AH=m
6869 CONFIG_INET6_ESP=m
6970 CONFIG_INET6_IPCOMP=m
71+CONFIG_IPV6_ILA=m
7072 CONFIG_IPV6_VTI=m
7173 CONFIG_IPV6_GRE=m
7274 CONFIG_NETFILTER=y
@@ -175,6 +177,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
175177 CONFIG_IP_SET_LIST_SET=m
176178 CONFIG_NF_CONNTRACK_IPV4=m
177179 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
180+CONFIG_NFT_DUP_IPV4=m
178181 CONFIG_NF_TABLES_ARP=m
179182 CONFIG_NF_LOG_ARP=m
180183 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -202,6 +205,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
202205 CONFIG_IP_NF_ARP_MANGLE=m
203206 CONFIG_NF_CONNTRACK_IPV6=m
204207 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
208+CONFIG_NFT_DUP_IPV6=m
205209 CONFIG_NFT_CHAIN_NAT_IPV6=m
206210 CONFIG_NFT_MASQ_IPV6=m
207211 CONFIG_NFT_REDIR_IPV6=m
@@ -267,6 +271,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
267271 CONFIG_MPLS=y
268272 CONFIG_NET_MPLS_GSO=m
269273 CONFIG_MPLS_ROUTING=m
274+CONFIG_MPLS_IPTUNNEL=m
270275 # CONFIG_WIRELESS is not set
271276 # CONFIG_UEVENT_HELPER is not set
272277 CONFIG_DEVTMPFS=y
@@ -343,6 +348,7 @@ CONFIG_BVME6000_NET=y · 70 unmodified lines
343348 # CONFIG_NET_VENDOR_SAMSUNG is not set
344349 # CONFIG_NET_VENDOR_SEEQ is not set
345350 # CONFIG_NET_VENDOR_STMICRO is not set
351+# CONFIG_NET_VENDOR_SYNOPSYS is not set
346352 # CONFIG_NET_VENDOR_VIA is not set
347353 # CONFIG_NET_VENDOR_WIZNET is not set
348354 CONFIG_PPP=m
@@ -488,6 +494,7 @@ CONFIG_TEST_USER_COPY=m · 139 unmodified lines
488494 CONFIG_TEST_BPF=m
489495 CONFIG_TEST_FIRMWARE=m
490496 CONFIG_TEST_UDELAY=m
497+CONFIG_TEST_STATIC_KEYS=m
491498 CONFIG_EARLY_PRINTK=y
492499 CONFIG_ENCRYPTED_KEYS=m
493500 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/hp300_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -55,7 +56,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 39 unmodified lines
5556 CONFIG_NET_IPGRE=m
5657 CONFIG_NET_IPVTI=m
5758 CONFIG_NET_FOU_IP_TUNNELS=y
58−CONFIG_GENEVE_CORE=m
5959 CONFIG_INET_AH=m
6060 CONFIG_INET_ESP=m
6161 CONFIG_INET_IPCOMP=m
@@ -65,10 +65,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6565 # CONFIG_INET_LRO is not set
6666 CONFIG_INET_DIAG=m
6767 CONFIG_INET_UDP_DIAG=m
68+CONFIG_IPV6=m
6869 CONFIG_IPV6_ROUTER_PREF=y
6970 CONFIG_INET6_AH=m
7071 CONFIG_INET6_ESP=m
7172 CONFIG_INET6_IPCOMP=m
73+CONFIG_IPV6_ILA=m
7274 CONFIG_IPV6_VTI=m
7375 CONFIG_IPV6_GRE=m
7476 CONFIG_NETFILTER=y
@@ -177,6 +179,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
177179 CONFIG_IP_SET_LIST_SET=m
178180 CONFIG_NF_CONNTRACK_IPV4=m
179181 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
182+CONFIG_NFT_DUP_IPV4=m
180183 CONFIG_NF_TABLES_ARP=m
181184 CONFIG_NF_LOG_ARP=m
182185 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -204,6 +207,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
204207 CONFIG_IP_NF_ARP_MANGLE=m
205208 CONFIG_NF_CONNTRACK_IPV6=m
206209 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
210+CONFIG_NFT_DUP_IPV6=m
207211 CONFIG_NFT_CHAIN_NAT_IPV6=m
208212 CONFIG_NFT_MASQ_IPV6=m
209213 CONFIG_NFT_REDIR_IPV6=m
@@ -269,6 +273,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
269273 CONFIG_MPLS=y
270274 CONFIG_NET_MPLS_GSO=m
271275 CONFIG_MPLS_ROUTING=m
276+CONFIG_MPLS_IPTUNNEL=m
272277 # CONFIG_WIRELESS is not set
273278 # CONFIG_UEVENT_HELPER is not set
274279 CONFIG_DEVTMPFS=y
@@ -345,6 +350,7 @@ CONFIG_HPLANCE=y · 70 unmodified lines
345350 # CONFIG_NET_VENDOR_SAMSUNG is not set
346351 # CONFIG_NET_VENDOR_SEEQ is not set
347352 # CONFIG_NET_VENDOR_STMICRO is not set
353+# CONFIG_NET_VENDOR_SYNOPSYS is not set
348354 # CONFIG_NET_VENDOR_VIA is not set
349355 # CONFIG_NET_VENDOR_WIZNET is not set
350356 CONFIG_PPP=m
@@ -497,6 +503,7 @@ CONFIG_TEST_USER_COPY=m · 146 unmodified lines
497503 CONFIG_TEST_BPF=m
498504 CONFIG_TEST_FIRMWARE=m
499505 CONFIG_TEST_UDELAY=m
506+CONFIG_TEST_STATIC_KEYS=m
500507 CONFIG_EARLY_PRINTK=y
501508 CONFIG_ENCRYPTED_KEYS=m
502509 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/mac_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -54,7 +55,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 38 unmodified lines
5455 CONFIG_NET_IPGRE=m
5556 CONFIG_NET_IPVTI=m
5657 CONFIG_NET_FOU_IP_TUNNELS=y
57−CONFIG_GENEVE_CORE=m
5858 CONFIG_INET_AH=m
5959 CONFIG_INET_ESP=m
6060 CONFIG_INET_IPCOMP=m
@@ -64,10 +64,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6464 # CONFIG_INET_LRO is not set
6565 CONFIG_INET_DIAG=m
6666 CONFIG_INET_UDP_DIAG=m
67+CONFIG_IPV6=m
6768 CONFIG_IPV6_ROUTER_PREF=y
6869 CONFIG_INET6_AH=m
6970 CONFIG_INET6_ESP=m
7071 CONFIG_INET6_IPCOMP=m
72+CONFIG_IPV6_ILA=m
7173 CONFIG_IPV6_VTI=m
7274 CONFIG_IPV6_GRE=m
7375 CONFIG_NETFILTER=y
@@ -176,6 +178,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
176178 CONFIG_IP_SET_LIST_SET=m
177179 CONFIG_NF_CONNTRACK_IPV4=m
178180 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
181+CONFIG_NFT_DUP_IPV4=m
179182 CONFIG_NF_TABLES_ARP=m
180183 CONFIG_NF_LOG_ARP=m
181184 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -203,6 +206,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
203206 CONFIG_IP_NF_ARP_MANGLE=m
204207 CONFIG_NF_CONNTRACK_IPV6=m
205208 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
209+CONFIG_NFT_DUP_IPV6=m
206210 CONFIG_NFT_CHAIN_NAT_IPV6=m
207211 CONFIG_NFT_MASQ_IPV6=m
208212 CONFIG_NFT_REDIR_IPV6=m
@@ -271,6 +275,7 @@ CONFIG_NETLINK_DIAG=m · 62 unmodified lines
271275 CONFIG_MPLS=y
272276 CONFIG_NET_MPLS_GSO=m
273277 CONFIG_MPLS_ROUTING=m
278+CONFIG_MPLS_IPTUNNEL=m
274279 # CONFIG_WIRELESS is not set
275280 # CONFIG_UEVENT_HELPER is not set
276281 CONFIG_DEVTMPFS=y
@@ -364,6 +369,7 @@ CONFIG_MAC8390=y · 87 unmodified lines
364369 # CONFIG_NET_VENDOR_SEEQ is not set
365370 # CONFIG_NET_VENDOR_SMSC is not set
366371 # CONFIG_NET_VENDOR_STMICRO is not set
372+# CONFIG_NET_VENDOR_SYNOPSYS is not set
367373 # CONFIG_NET_VENDOR_VIA is not set
368374 # CONFIG_NET_VENDOR_WIZNET is not set
369375 CONFIG_PPP=m
@@ -519,6 +525,7 @@ CONFIG_TEST_USER_COPY=m · 149 unmodified lines
519525 CONFIG_TEST_BPF=m
520526 CONFIG_TEST_FIRMWARE=m
521527 CONFIG_TEST_UDELAY=m
528+CONFIG_TEST_STATIC_KEYS=m
522529 CONFIG_EARLY_PRINTK=y
523530 CONFIG_ENCRYPTED_KEYS=m
524531 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/multi_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -64,7 +65,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 48 unmodified lines
6465 CONFIG_NET_IPGRE=m
6566 CONFIG_NET_IPVTI=m
6667 CONFIG_NET_FOU_IP_TUNNELS=y
67−CONFIG_GENEVE_CORE=m
6868 CONFIG_INET_AH=m
6969 CONFIG_INET_ESP=m
7070 CONFIG_INET_IPCOMP=m
@@ -74,10 +74,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
7474 # CONFIG_INET_LRO is not set
7575 CONFIG_INET_DIAG=m
7676 CONFIG_INET_UDP_DIAG=m
77+CONFIG_IPV6=m
7778 CONFIG_IPV6_ROUTER_PREF=y
7879 CONFIG_INET6_AH=m
7980 CONFIG_INET6_ESP=m
8081 CONFIG_INET6_IPCOMP=m
82+CONFIG_IPV6_ILA=m
8183 CONFIG_IPV6_VTI=m
8284 CONFIG_IPV6_GRE=m
8385 CONFIG_NETFILTER=y
@@ -186,6 +188,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
186188 CONFIG_IP_SET_LIST_SET=m
187189 CONFIG_NF_CONNTRACK_IPV4=m
188190 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
191+CONFIG_NFT_DUP_IPV4=m
189192 CONFIG_NF_TABLES_ARP=m
190193 CONFIG_NF_LOG_ARP=m
191194 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -213,6 +216,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
213216 CONFIG_IP_NF_ARP_MANGLE=m
214217 CONFIG_NF_CONNTRACK_IPV6=m
215218 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
219+CONFIG_NFT_DUP_IPV6=m
216220 CONFIG_NFT_CHAIN_NAT_IPV6=m
217221 CONFIG_NFT_MASQ_IPV6=m
218222 CONFIG_NFT_REDIR_IPV6=m
@@ -281,6 +285,7 @@ CONFIG_NETLINK_DIAG=m · 62 unmodified lines
281285 CONFIG_MPLS=y
282286 CONFIG_NET_MPLS_GSO=m
283287 CONFIG_MPLS_ROUTING=m
288+CONFIG_MPLS_IPTUNNEL=m
284289 # CONFIG_WIRELESS is not set
285290 # CONFIG_UEVENT_HELPER is not set
286291 CONFIG_DEVTMPFS=y
@@ -410,6 +415,7 @@ CONFIG_ZORRO8390=y · 123 unmodified lines
410415 # CONFIG_NET_VENDOR_SEEQ is not set
411416 CONFIG_SMC91X=y
412417 # CONFIG_NET_VENDOR_STMICRO is not set
418+# CONFIG_NET_VENDOR_SYNOPSYS is not set
413419 # CONFIG_NET_VENDOR_VIA is not set
414420 # CONFIG_NET_VENDOR_WIZNET is not set
415421 CONFIG_PLIP=m
@@ -599,6 +605,7 @@ CONFIG_TEST_USER_COPY=m · 183 unmodified lines
599605 CONFIG_TEST_BPF=m
600606 CONFIG_TEST_FIRMWARE=m
601607 CONFIG_TEST_UDELAY=m
608+CONFIG_TEST_STATIC_KEYS=m
602609 CONFIG_EARLY_PRINTK=y
603610 CONFIG_ENCRYPTED_KEYS=m
604611 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/mvme147_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -52,7 +53,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 36 unmodified lines
5253 CONFIG_NET_IPGRE=m
5354 CONFIG_NET_IPVTI=m
5455 CONFIG_NET_FOU_IP_TUNNELS=y
55−CONFIG_GENEVE_CORE=m
5656 CONFIG_INET_AH=m
5757 CONFIG_INET_ESP=m
5858 CONFIG_INET_IPCOMP=m
@@ -62,10 +62,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6262 # CONFIG_INET_LRO is not set
6363 CONFIG_INET_DIAG=m
6464 CONFIG_INET_UDP_DIAG=m
65+CONFIG_IPV6=m
6566 CONFIG_IPV6_ROUTER_PREF=y
6667 CONFIG_INET6_AH=m
6768 CONFIG_INET6_ESP=m
6869 CONFIG_INET6_IPCOMP=m
70+CONFIG_IPV6_ILA=m
6971 CONFIG_IPV6_VTI=m
7072 CONFIG_IPV6_GRE=m
7173 CONFIG_NETFILTER=y
@@ -174,6 +176,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
174176 CONFIG_IP_SET_LIST_SET=m
175177 CONFIG_NF_CONNTRACK_IPV4=m
176178 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
179+CONFIG_NFT_DUP_IPV4=m
177180 CONFIG_NF_TABLES_ARP=m
178181 CONFIG_NF_LOG_ARP=m
179182 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -201,6 +204,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
201204 CONFIG_IP_NF_ARP_MANGLE=m
202205 CONFIG_NF_CONNTRACK_IPV6=m
203206 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
207+CONFIG_NFT_DUP_IPV6=m
204208 CONFIG_NFT_CHAIN_NAT_IPV6=m
205209 CONFIG_NFT_MASQ_IPV6=m
206210 CONFIG_NFT_REDIR_IPV6=m
@@ -266,6 +270,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
266270 CONFIG_MPLS=y
267271 CONFIG_NET_MPLS_GSO=m
268272 CONFIG_MPLS_ROUTING=m
273+CONFIG_MPLS_IPTUNNEL=m
269274 # CONFIG_WIRELESS is not set
270275 # CONFIG_UEVENT_HELPER is not set
271276 CONFIG_DEVTMPFS=y
@@ -343,6 +348,7 @@ CONFIG_MVME147_NET=y · 71 unmodified lines
343348 # CONFIG_NET_VENDOR_SAMSUNG is not set
344349 # CONFIG_NET_VENDOR_SEEQ is not set
345350 # CONFIG_NET_VENDOR_STMICRO is not set
351+# CONFIG_NET_VENDOR_SYNOPSYS is not set
346352 # CONFIG_NET_VENDOR_VIA is not set
347353 # CONFIG_NET_VENDOR_WIZNET is not set
348354 CONFIG_PPP=m
@@ -488,6 +494,7 @@ CONFIG_TEST_USER_COPY=m · 139 unmodified lines
488494 CONFIG_TEST_BPF=m
489495 CONFIG_TEST_FIRMWARE=m
490496 CONFIG_TEST_UDELAY=m
497+CONFIG_TEST_STATIC_KEYS=m
491498 CONFIG_EARLY_PRINTK=y
492499 CONFIG_ENCRYPTED_KEYS=m
493500 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/mvme16x_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -53,7 +54,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 37 unmodified lines
5354 CONFIG_NET_IPGRE=m
5455 CONFIG_NET_IPVTI=m
5556 CONFIG_NET_FOU_IP_TUNNELS=y
56−CONFIG_GENEVE_CORE=m
5757 CONFIG_INET_AH=m
5858 CONFIG_INET_ESP=m
5959 CONFIG_INET_IPCOMP=m
@@ -63,10 +63,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6363 # CONFIG_INET_LRO is not set
6464 CONFIG_INET_DIAG=m
6565 CONFIG_INET_UDP_DIAG=m
66+CONFIG_IPV6=m
6667 CONFIG_IPV6_ROUTER_PREF=y
6768 CONFIG_INET6_AH=m
6869 CONFIG_INET6_ESP=m
6970 CONFIG_INET6_IPCOMP=m
71+CONFIG_IPV6_ILA=m
7072 CONFIG_IPV6_VTI=m
7173 CONFIG_IPV6_GRE=m
7274 CONFIG_NETFILTER=y
@@ -175,6 +177,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
175177 CONFIG_IP_SET_LIST_SET=m
176178 CONFIG_NF_CONNTRACK_IPV4=m
177179 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
180+CONFIG_NFT_DUP_IPV4=m
178181 CONFIG_NF_TABLES_ARP=m
179182 CONFIG_NF_LOG_ARP=m
180183 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -202,6 +205,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
202205 CONFIG_IP_NF_ARP_MANGLE=m
203206 CONFIG_NF_CONNTRACK_IPV6=m
204207 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
208+CONFIG_NFT_DUP_IPV6=m
205209 CONFIG_NFT_CHAIN_NAT_IPV6=m
206210 CONFIG_NFT_MASQ_IPV6=m
207211 CONFIG_NFT_REDIR_IPV6=m
@@ -267,6 +271,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
267271 CONFIG_MPLS=y
268272 CONFIG_NET_MPLS_GSO=m
269273 CONFIG_MPLS_ROUTING=m
274+CONFIG_MPLS_IPTUNNEL=m
270275 # CONFIG_WIRELESS is not set
271276 # CONFIG_UEVENT_HELPER is not set
272277 CONFIG_DEVTMPFS=y
@@ -343,6 +348,7 @@ CONFIG_MVME16x_NET=y · 70 unmodified lines
343348 # CONFIG_NET_VENDOR_SAMSUNG is not set
344349 # CONFIG_NET_VENDOR_SEEQ is not set
345350 # CONFIG_NET_VENDOR_STMICRO is not set
351+# CONFIG_NET_VENDOR_SYNOPSYS is not set
346352 # CONFIG_NET_VENDOR_VIA is not set
347353 # CONFIG_NET_VENDOR_WIZNET is not set
348354 CONFIG_PPP=m
@@ -488,6 +494,7 @@ CONFIG_TEST_USER_COPY=m · 139 unmodified lines
488494 CONFIG_TEST_BPF=m
489495 CONFIG_TEST_FIRMWARE=m
490496 CONFIG_TEST_UDELAY=m
497+CONFIG_TEST_STATIC_KEYS=m
491498 CONFIG_EARLY_PRINTK=y
492499 CONFIG_ENCRYPTED_KEYS=m
493500 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/q40_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -53,7 +54,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 37 unmodified lines
5354 CONFIG_NET_IPGRE=m
5455 CONFIG_NET_IPVTI=m
5556 CONFIG_NET_FOU_IP_TUNNELS=y
56−CONFIG_GENEVE_CORE=m
5757 CONFIG_INET_AH=m
5858 CONFIG_INET_ESP=m
5959 CONFIG_INET_IPCOMP=m
@@ -63,10 +63,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6363 # CONFIG_INET_LRO is not set
6464 CONFIG_INET_DIAG=m
6565 CONFIG_INET_UDP_DIAG=m
66+CONFIG_IPV6=m
6667 CONFIG_IPV6_ROUTER_PREF=y
6768 CONFIG_INET6_AH=m
6869 CONFIG_INET6_ESP=m
6970 CONFIG_INET6_IPCOMP=m
71+CONFIG_IPV6_ILA=m
7072 CONFIG_IPV6_VTI=m
7173 CONFIG_IPV6_GRE=m
7274 CONFIG_NETFILTER=y
@@ -175,6 +177,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
175177 CONFIG_IP_SET_LIST_SET=m
176178 CONFIG_NF_CONNTRACK_IPV4=m
177179 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
180+CONFIG_NFT_DUP_IPV4=m
178181 CONFIG_NF_TABLES_ARP=m
179182 CONFIG_NF_LOG_ARP=m
180183 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -202,6 +205,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
202205 CONFIG_IP_NF_ARP_MANGLE=m
203206 CONFIG_NF_CONNTRACK_IPV6=m
204207 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
208+CONFIG_NFT_DUP_IPV6=m
205209 CONFIG_NFT_CHAIN_NAT_IPV6=m
206210 CONFIG_NFT_MASQ_IPV6=m
207211 CONFIG_NFT_REDIR_IPV6=m
@@ -267,6 +271,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
267271 CONFIG_MPLS=y
268272 CONFIG_NET_MPLS_GSO=m
269273 CONFIG_MPLS_ROUTING=m
274+CONFIG_MPLS_IPTUNNEL=m
270275 # CONFIG_WIRELESS is not set
271276 # CONFIG_UEVENT_HELPER is not set
272277 CONFIG_DEVTMPFS=y
@@ -354,6 +359,7 @@ CONFIG_NE2000=y · 81 unmodified lines
354359 # CONFIG_NET_VENDOR_SEEQ is not set
355360 # CONFIG_NET_VENDOR_SMSC is not set
356361 # CONFIG_NET_VENDOR_STMICRO is not set
362+# CONFIG_NET_VENDOR_SYNOPSYS is not set
357363 # CONFIG_NET_VENDOR_VIA is not set
358364 # CONFIG_NET_VENDOR_WIZNET is not set
359365 CONFIG_PLIP=m
@@ -510,6 +516,7 @@ CONFIG_TEST_USER_COPY=m · 150 unmodified lines
510516 CONFIG_TEST_BPF=m
511517 CONFIG_TEST_FIRMWARE=m
512518 CONFIG_TEST_UDELAY=m
519+CONFIG_TEST_STATIC_KEYS=m
513520 CONFIG_EARLY_PRINTK=y
514521 CONFIG_ENCRYPTED_KEYS=m
515522 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/sun3_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -50,7 +51,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 34 unmodified lines
5051 CONFIG_NET_IPGRE=m
5152 CONFIG_NET_IPVTI=m
5253 CONFIG_NET_FOU_IP_TUNNELS=y
53−CONFIG_GENEVE_CORE=m
5454 CONFIG_INET_AH=m
5555 CONFIG_INET_ESP=m
5656 CONFIG_INET_IPCOMP=m
@@ -60,10 +60,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6060 # CONFIG_INET_LRO is not set
6161 CONFIG_INET_DIAG=m
6262 CONFIG_INET_UDP_DIAG=m
63+CONFIG_IPV6=m
6364 CONFIG_IPV6_ROUTER_PREF=y
6465 CONFIG_INET6_AH=m
6566 CONFIG_INET6_ESP=m
6667 CONFIG_INET6_IPCOMP=m
68+CONFIG_IPV6_ILA=m
6769 CONFIG_IPV6_VTI=m
6870 CONFIG_IPV6_GRE=m
6971 CONFIG_NETFILTER=y
@@ -172,6 +174,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
172174 CONFIG_IP_SET_LIST_SET=m
173175 CONFIG_NF_CONNTRACK_IPV4=m
174176 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
177+CONFIG_NFT_DUP_IPV4=m
175178 CONFIG_NF_TABLES_ARP=m
176179 CONFIG_NF_LOG_ARP=m
177180 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -199,6 +202,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
199202 CONFIG_IP_NF_ARP_MANGLE=m
200203 CONFIG_NF_CONNTRACK_IPV6=m
201204 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
205+CONFIG_NFT_DUP_IPV6=m
202206 CONFIG_NFT_CHAIN_NAT_IPV6=m
203207 CONFIG_NFT_MASQ_IPV6=m
204208 CONFIG_NFT_REDIR_IPV6=m
@@ -264,6 +268,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
264268 CONFIG_MPLS=y
265269 CONFIG_NET_MPLS_GSO=m
266270 CONFIG_MPLS_ROUTING=m
271+CONFIG_MPLS_IPTUNNEL=m
267272 # CONFIG_WIRELESS is not set
268273 # CONFIG_UEVENT_HELPER is not set
269274 CONFIG_DEVTMPFS=y
@@ -341,6 +346,7 @@ CONFIG_SUN3_82586=y · 71 unmodified lines
341346 # CONFIG_NET_VENDOR_SEEQ is not set
342347 # CONFIG_NET_VENDOR_STMICRO is not set
343348 # CONFIG_NET_VENDOR_SUN is not set
349+# CONFIG_NET_VENDOR_SYNOPSYS is not set
344350 # CONFIG_NET_VENDOR_VIA is not set
345351 # CONFIG_NET_VENDOR_WIZNET is not set
346352 CONFIG_PPP=m
@@ -489,6 +495,7 @@ CONFIG_TEST_USER_COPY=m · 142 unmodified lines
489495 CONFIG_TEST_BPF=m
490496 CONFIG_TEST_FIRMWARE=m
491497 CONFIG_TEST_UDELAY=m
498+CONFIG_TEST_STATIC_KEYS=m
492499 CONFIG_ENCRYPTED_KEYS=m
493500 CONFIG_CRYPTO_RSA=m
494501 CONFIG_CRYPTO_MANAGER=y
arch/m68k/configs/sun3x_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -50,7 +51,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 34 unmodified lines
5051 CONFIG_NET_IPGRE=m
5152 CONFIG_NET_IPVTI=m
5253 CONFIG_NET_FOU_IP_TUNNELS=y
53−CONFIG_GENEVE_CORE=m
5454 CONFIG_INET_AH=m
5555 CONFIG_INET_ESP=m
5656 CONFIG_INET_IPCOMP=m
@@ -60,10 +60,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6060 # CONFIG_INET_LRO is not set
6161 CONFIG_INET_DIAG=m
6262 CONFIG_INET_UDP_DIAG=m
63+CONFIG_IPV6=m
6364 CONFIG_IPV6_ROUTER_PREF=y
6465 CONFIG_INET6_AH=m
6566 CONFIG_INET6_ESP=m
6667 CONFIG_INET6_IPCOMP=m
68+CONFIG_IPV6_ILA=m
6769 CONFIG_IPV6_VTI=m
6870 CONFIG_IPV6_GRE=m
6971 CONFIG_NETFILTER=y
@@ -172,6 +174,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
172174 CONFIG_IP_SET_LIST_SET=m
173175 CONFIG_NF_CONNTRACK_IPV4=m
174176 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
177+CONFIG_NFT_DUP_IPV4=m
175178 CONFIG_NF_TABLES_ARP=m
176179 CONFIG_NF_LOG_ARP=m
177180 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -199,6 +202,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
199202 CONFIG_IP_NF_ARP_MANGLE=m
200203 CONFIG_NF_CONNTRACK_IPV6=m
201204 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
205+CONFIG_NFT_DUP_IPV6=m
202206 CONFIG_NFT_CHAIN_NAT_IPV6=m
203207 CONFIG_NFT_MASQ_IPV6=m
204208 CONFIG_NFT_REDIR_IPV6=m
@@ -264,6 +268,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
264268 CONFIG_MPLS=y
265269 CONFIG_NET_MPLS_GSO=m
266270 CONFIG_MPLS_ROUTING=m
271+CONFIG_MPLS_IPTUNNEL=m
267272 # CONFIG_WIRELESS is not set
268273 # CONFIG_UEVENT_HELPER is not set
269274 CONFIG_DEVTMPFS=y
@@ -341,6 +346,7 @@ CONFIG_SUN3LANCE=y · 71 unmodified lines
341346 # CONFIG_NET_VENDOR_SAMSUNG is not set
342347 # CONFIG_NET_VENDOR_SEEQ is not set
343348 # CONFIG_NET_VENDOR_STMICRO is not set
349+# CONFIG_NET_VENDOR_SYNOPSYS is not set
344350 # CONFIG_NET_VENDOR_VIA is not set
345351 # CONFIG_NET_VENDOR_WIZNET is not set
346352 CONFIG_PPP=m
@@ -489,6 +495,7 @@ CONFIG_TEST_USER_COPY=m · 142 unmodified lines
489495 CONFIG_TEST_BPF=m
490496 CONFIG_TEST_FIRMWARE=m
491497 CONFIG_TEST_UDELAY=m
498+CONFIG_TEST_STATIC_KEYS=m
492499 CONFIG_EARLY_PRINTK=y
493500 CONFIG_ENCRYPTED_KEYS=m
494501 CONFIG_CRYPTO_RSA=m
arch/m68k/include/asm/linkage.h+30−0
@@ -4,4 +4,34 @@ · 3 unmodified lines
44 #define __ALIGN .align 4
55 #define __ALIGN_STR ".align 4"
66
7+/*
8+ * Make sure the compiler doesn't do anything stupid with the
9+ * arguments on the stack - they are owned by the *caller*, not
10+ * the callee. This just fools gcc into not spilling into them,
11+ * and keeps it from doing tailcall recursion and/or using the
12+ * stack slots for temporaries, since they are live and "used"
13+ * all the way to the end of the function.
14+ */
15+#define asmlinkage_protect(n, ret, args...) \
16+ __asmlinkage_protect##n(ret, ##args)
17+#define __asmlinkage_protect_n(ret, args...) \
18+ __asm__ __volatile__ ("" : "=r" (ret) : "0" (ret), ##args)
19+#define __asmlinkage_protect0(ret) \
20+ __asmlinkage_protect_n(ret)
21+#define __asmlinkage_protect1(ret, arg1) \
22+ __asmlinkage_protect_n(ret, "m" (arg1))
23+#define __asmlinkage_protect2(ret, arg1, arg2) \
24+ __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2))
25+#define __asmlinkage_protect3(ret, arg1, arg2, arg3) \
26+ __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3))
27+#define __asmlinkage_protect4(ret, arg1, arg2, arg3, arg4) \
28+ __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \
29+ "m" (arg4))
30+#define __asmlinkage_protect5(ret, arg1, arg2, arg3, arg4, arg5) \
31+ __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \
32+ "m" (arg4), "m" (arg5))
33+#define __asmlinkage_protect6(ret, arg1, arg2, arg3, arg4, arg5, arg6) \
34+ __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \
35+ "m" (arg4), "m" (arg5), "m" (arg6))
36+
737 #endif
arch/m68k/include/asm/unistd.h+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 #include <uapi/asm/unistd.h>
55
66
7−#define NR_syscalls 356
7+#define NR_syscalls 375
88
99 #define __ARCH_WANT_OLD_READDIR
1010 #define __ARCH_WANT_OLD_STAT
arch/m68k/include/uapi/asm/unistd.h+19−0
@@ -361,5 +361,24 @@ · 360 unmodified lines
361361 #define __NR_memfd_create 353
362362 #define __NR_bpf 354
363363 #define __NR_execveat 355
364+#define __NR_socket 356
365+#define __NR_socketpair 357
366+#define __NR_bind 358
367+#define __NR_connect 359
368+#define __NR_listen 360
369+#define __NR_accept4 361
370+#define __NR_getsockopt 362
371+#define __NR_setsockopt 363
372+#define __NR_getsockname 364
373+#define __NR_getpeername 365
374+#define __NR_sendto 366
375+#define __NR_sendmsg 367
376+#define __NR_recvfrom 368
377+#define __NR_recvmsg 369
378+#define __NR_shutdown 370
379+#define __NR_recvmmsg 371
380+#define __NR_sendmmsg 372
381+#define __NR_userfaultfd 373
382+#define __NR_membarrier 374
364383
365384 #endif /* _UAPI_ASM_M68K_UNISTD_H_ */
arch/m68k/kernel/syscalltable.S+19−1
@@ -376,4 +376,22 @@ ENTRY(sys_call_table) · 375 unmodified lines
376376 .long sys_memfd_create
377377 .long sys_bpf
378378 .long sys_execveat /* 355 */
379−
379+ .long sys_socket
380+ .long sys_socketpair
381+ .long sys_bind
382+ .long sys_connect
383+ .long sys_listen /* 360 */
384+ .long sys_accept4
385+ .long sys_getsockopt
386+ .long sys_setsockopt
387+ .long sys_getsockname
388+ .long sys_getpeername /* 365 */
389+ .long sys_sendto
390+ .long sys_sendmsg
391+ .long sys_recvfrom
392+ .long sys_recvmsg
393+ .long sys_shutdown /* 370 */
394+ .long sys_recvmmsg
395+ .long sys_sendmmsg
396+ .long sys_userfaultfd
397+ .long sys_membarrier
arch/metag/include/asm/Kbuild+1−0
@@ -54,4 +54,5 @@ generic-y += ucontext.h · 53 unmodified lines
5454 generic-y += unaligned.h
5555 generic-y += user.h
5656 generic-y += vga.h
57+generic-y += word-at-a-time.h
5758 generic-y += xor.h
arch/microblaze/include/asm/Kbuild+1−0
@@ -10,3 +10,4 @@ generic-y += mm-arch-hooks.h · 9 unmodified lines
1010 generic-y += preempt.h
1111 generic-y += syscalls.h
1212 generic-y += trace_clock.h
13+generic-y += word-at-a-time.h
arch/mips/ath79/irq.c+20−2
@@ -293,8 +293,26 @@ static int __init ath79_misc_intc_of_init( · 292 unmodified lines
293293
294294 return 0;
295295 }
296−IRQCHIP_DECLARE(ath79_misc_intc, "qca,ar7100-misc-intc",
297− ath79_misc_intc_of_init);
296+
297+static int __init ar7100_misc_intc_of_init(
298+ struct device_node *node, struct device_node *parent)
299+{
300+ ath79_misc_irq_chip.irq_mask_ack = ar71xx_misc_irq_mask;
301+ return ath79_misc_intc_of_init(node, parent);
302+}
303+
304+IRQCHIP_DECLARE(ar7100_misc_intc, "qca,ar7100-misc-intc",
305+ ar7100_misc_intc_of_init);
306+
307+static int __init ar7240_misc_intc_of_init(
308+ struct device_node *node, struct device_node *parent)
309+{
310+ ath79_misc_irq_chip.irq_ack = ar724x_misc_irq_ack;
311+ return ath79_misc_intc_of_init(node, parent);
312+}
313+
314+IRQCHIP_DECLARE(ar7240_misc_intc, "qca,ar7240-misc-intc",
315+ ar7240_misc_intc_of_init);
298316
299317 static int __init ar79_cpu_intc_of_init(
300318 struct device_node *node, struct device_node *parent)
arch/mips/cavium-octeon/setup.c+1−1
@@ -933,7 +933,7 @@ void __init plat_mem_setup(void) · 932 unmodified lines
933933 while ((boot_mem_map.nr_map < BOOT_MEM_MAP_MAX)
934934 && (total < MAX_MEMORY)) {
935935 memory = cvmx_bootmem_phy_alloc(mem_alloc_size,
936− __pa_symbol(&__init_end), -1,
936+ __pa_symbol(&_end), -1,
937937 0x100000,
938938 CVMX_BOOTMEM_FLAG_NO_LOCKING);
939939 if (memory >= 0) {
arch/mips/include/asm/Kbuild+1−0
@@ -17,4 +17,5 @@ generic-y += segment.h · 16 unmodified lines
1717 generic-y += serial.h
1818 generic-y += trace_clock.h
1919 generic-y += user.h
20+generic-y += word-at-a-time.h
2021 generic-y += xor.h
arch/mips/include/asm/cpu-features.h+3−0
@@ -20,6 +20,9 @@ · 19 unmodified lines
2020 #ifndef cpu_has_tlb
2121 #define cpu_has_tlb (cpu_data[0].options & MIPS_CPU_TLB)
2222 #endif
23+#ifndef cpu_has_ftlb
24+#define cpu_has_ftlb (cpu_data[0].options & MIPS_CPU_FTLB)
25+#endif
2326 #ifndef cpu_has_tlbinv
2427 #define cpu_has_tlbinv (cpu_data[0].options & MIPS_CPU_TLBINV)
2528 #endif
arch/mips/include/asm/cpu.h+1−0
@@ -385,6 +385,7 @@ enum cpu_type_enum { · 384 unmodified lines
385385 #define MIPS_CPU_CDMM 0x4000000000ull /* CPU has Common Device Memory Map */
386386 #define MIPS_CPU_BP_GHIST 0x8000000000ull /* R12K+ Branch Prediction Global History */
387387 #define MIPS_CPU_SP 0x10000000000ull /* Small (1KB) page support */
388+#define MIPS_CPU_FTLB 0x20000000000ull /* CPU has Fixed-page-size TLB */
388389
389390 /*
390391 * CPU ASE encodings
arch/mips/include/asm/maar.h+9−0
@@ -65,6 +65,15 @@ static inline void write_maar_pair(unsigned idx, phys_addr_t lower, · 64 unmodified lines
6565 back_to_back_c0_hazard();
6666 }
6767
68+/**
69+ * maar_init() - initialise MAARs
70+ *
71+ * Performs initialisation of MAARs for the current CPU, making use of the
72+ * platforms implementation of platform_maar_init where necessary and
73+ * duplicating the setup it provides on secondary CPUs.
74+ */
75+extern void maar_init(void);
76+
6877 /**
6978 * struct maar_config - MAAR configuration data
7079 * @lower: The lowest address that the MAAR pair will affect. Must be
arch/mips/include/asm/mips-cm.h+39−0
@@ -194,6 +194,7 @@ BUILD_CM_RW(reg3_mask, MIPS_CM_GCB_OFS + 0xc8) · 193 unmodified lines
194194 BUILD_CM_R_(gic_status, MIPS_CM_GCB_OFS + 0xd0)
195195 BUILD_CM_R_(cpc_status, MIPS_CM_GCB_OFS + 0xf0)
196196 BUILD_CM_RW(l2_config, MIPS_CM_GCB_OFS + 0x130)
197+BUILD_CM_RW(sys_config2, MIPS_CM_GCB_OFS + 0x150)
197198
198199 /* Core Local & Core Other register accessor functions */
199200 BUILD_CM_Cx_RW(reset_release, 0x00)
@@ -316,6 +317,10 @@ BUILD_CM_Cx_R_(tcid_8_priority, 0x80) · 116 unmodified lines
316317 #define CM_GCR_L2_CONFIG_ASSOC_SHF 0
317318 #define CM_GCR_L2_CONFIG_ASSOC_MSK (_ULCAST_(0xff) << 0)
318319
320+/* GCR_SYS_CONFIG2 register fields */
321+#define CM_GCR_SYS_CONFIG2_MAXVPW_SHF 0
322+#define CM_GCR_SYS_CONFIG2_MAXVPW_MSK (_ULCAST_(0xf) << 0)
323+
319324 /* GCR_Cx_COHERENCE register fields */
320325 #define CM_GCR_Cx_COHERENCE_COHDOMAINEN_SHF 0
321326 #define CM_GCR_Cx_COHERENCE_COHDOMAINEN_MSK (_ULCAST_(0xff) << 0)
@@ -405,4 +410,38 @@ static inline int mips_cm_revision(void) · 83 unmodified lines
405410 return read_gcr_rev();
406411 }
407412
413+/**
414+ * mips_cm_max_vp_width() - return the width in bits of VP indices
415+ *
416+ * Return: the width, in bits, of VP indices in fields that combine core & VP
417+ * indices.
418+ */
419+static inline unsigned int mips_cm_max_vp_width(void)
420+{
421+ extern int smp_num_siblings;
422+
423+ if (mips_cm_revision() >= CM_REV_CM3)
424+ return read_gcr_sys_config2() & CM_GCR_SYS_CONFIG2_MAXVPW_MSK;
425+
426+ return smp_num_siblings;
427+}
428+
429+/**
430+ * mips_cm_vp_id() - calculate the hardware VP ID for a CPU
431+ * @cpu: the CPU whose VP ID to calculate
432+ *
433+ * Hardware such as the GIC uses identifiers for VPs which may not match the
434+ * CPU numbers used by Linux. This function calculates the hardware VP
435+ * identifier corresponding to a given CPU.
436+ *
437+ * Return: the VP ID for the CPU.
438+ */
439+static inline unsigned int mips_cm_vp_id(unsigned int cpu)
440+{
441+ unsigned int core = cpu_data[cpu].core;
442+ unsigned int vp = cpu_vpe_id(&cpu_data[cpu]);
443+
444+ return (core * mips_cm_max_vp_width()) + vp;
445+}
446+
408447 #endif /* __MIPS_ASM_MIPS_CM_H__ */
arch/mips/include/asm/mipsregs.h+2−0
@@ -487,6 +487,8 @@ · 486 unmodified lines
487487
488488 /* Bits specific to the MIPS32/64 PRA. */
489489 #define MIPS_CONF_MT (_ULCAST_(7) << 7)
490+#define MIPS_CONF_MT_TLB (_ULCAST_(1) << 7)
491+#define MIPS_CONF_MT_FTLB (_ULCAST_(4) << 7)
490492 #define MIPS_CONF_AR (_ULCAST_(7) << 10)
491493 #define MIPS_CONF_AT (_ULCAST_(3) << 13)
492494 #define MIPS_CONF_M (_ULCAST_(1) << 31)
arch/mips/include/uapi/asm/unistd.h+12−6
@@ -377,16 +377,18 @@ · 376 unmodified lines
377377 #define __NR_memfd_create (__NR_Linux + 354)
378378 #define __NR_bpf (__NR_Linux + 355)
379379 #define __NR_execveat (__NR_Linux + 356)
380+#define __NR_userfaultfd (__NR_Linux + 357)
381+#define __NR_membarrier (__NR_Linux + 358)
380382
381383 /*
382384 * Offset of the last Linux o32 flavoured syscall
383385 */
384−#define __NR_Linux_syscalls 356
386+#define __NR_Linux_syscalls 358
385387
386388 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
387389
388390 #define __NR_O32_Linux 4000
389−#define __NR_O32_Linux_syscalls 356
391+#define __NR_O32_Linux_syscalls 358
390392
391393 #if _MIPS_SIM == _MIPS_SIM_ABI64
392394
@@ -711,16 +713,18 @@ · 318 unmodified lines
711713 #define __NR_memfd_create (__NR_Linux + 314)
712714 #define __NR_bpf (__NR_Linux + 315)
713715 #define __NR_execveat (__NR_Linux + 316)
716+#define __NR_userfaultfd (__NR_Linux + 317)
717+#define __NR_membarrier (__NR_Linux + 318)
714718
715719 /*
716720 * Offset of the last Linux 64-bit flavoured syscall
717721 */
718−#define __NR_Linux_syscalls 316
722+#define __NR_Linux_syscalls 318
719723
720724 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
721725
722726 #define __NR_64_Linux 5000
723−#define __NR_64_Linux_syscalls 316
727+#define __NR_64_Linux_syscalls 318
724728
725729 #if _MIPS_SIM == _MIPS_SIM_NABI32
726730
@@ -1049,15 +1053,17 @@ · 322 unmodified lines
10491053 #define __NR_memfd_create (__NR_Linux + 318)
10501054 #define __NR_bpf (__NR_Linux + 319)
10511055 #define __NR_execveat (__NR_Linux + 320)
1056+#define __NR_userfaultfd (__NR_Linux + 321)
1057+#define __NR_membarrier (__NR_Linux + 322)
10521058
10531059 /*
10541060 * Offset of the last N32 flavoured syscall
10551061 */
1056−#define __NR_Linux_syscalls 320
1062+#define __NR_Linux_syscalls 322
10571063
10581064 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
10591065
10601066 #define __NR_N32_Linux 6000
1061−#define __NR_N32_Linux_syscalls 320
1067+#define __NR_N32_Linux_syscalls 322
10621068
10631069 #endif /* _UAPI_ASM_UNISTD_H */
arch/mips/jz4740/board-qi_lb60.c+1−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include <linux/power/jz4740-battery.h>
2727 #include <linux/power/gpio-charger.h>
2828
29+#include <asm/mach-jz4740/gpio.h>
2930 #include <asm/mach-jz4740/jz4740_fb.h>
3031 #include <asm/mach-jz4740/jz4740_mmc.h>
3132 #include <asm/mach-jz4740/jz4740_nand.h>
arch/mips/jz4740/gpio.c+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <linux/seq_file.h>
2929
3030 #include <asm/mach-jz4740/base.h>
31+#include <asm/mach-jz4740/gpio.h>
3132
3233 #define JZ4740_GPIO_BASE_A (32*0)
3334 #define JZ4740_GPIO_BASE_B (32*1)
arch/mips/kernel/cps-vec.S+7−5
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 mfc0 \dest, CP0_CONFIG, 3
4040 andi \dest, \dest, MIPS_CONF3_MT
4141 beqz \dest, \nomt
42+ nop
4243 .endm
4344
4445 .section .text.cps-vec
@@ -223,10 +224,9 @@ LEAF(excep_ejtag) · 178 unmodified lines
223224 END(excep_ejtag)
224225
225226 LEAF(mips_cps_core_init)
226−#ifdef CONFIG_MIPS_MT
227+#ifdef CONFIG_MIPS_MT_SMP
227228 /* Check that the core implements the MT ASE */
228229 has_mt t0, 3f
229− nop
230230
231231 .set push
232232 .set mips64r2
@@ -310,8 +310,9 @@ LEAF(mips_cps_boot_vpes) · 77 unmodified lines
310310 PTR_ADDU t0, t0, t1
311311
312312 /* Calculate this VPEs ID. If the core doesn't support MT use 0 */
313+ li t9, 0
314+#ifdef CONFIG_MIPS_MT_SMP
313315 has_mt ta2, 1f
314− li t9, 0
315316
316317 /* Find the number of VPEs present in the core */
317318 mfc0 t1, CP0_MVPCONF0
@@ -330,6 +331,7 @@ LEAF(mips_cps_boot_vpes) · 12 unmodified lines
330331 /* Retrieve the VPE ID from EBase.CPUNum */
331332 mfc0 t9, $15, 1
332333 and t9, t9, t1
334+#endif
333335
334336 1: /* Calculate a pointer to this VPEs struct vpe_boot_config */
335337 li t1, VPEBOOTCFG_SIZE
@@ -337,7 +339,7 @@ LEAF(mips_cps_boot_vpes) · 1 unmodified line
337339 PTR_L ta3, COREBOOTCFG_VPECONFIG(t0)
338340 PTR_ADDU v0, v0, ta3
339341
340−#ifdef CONFIG_MIPS_MT
342+#ifdef CONFIG_MIPS_MT_SMP
341343
342344 /* If the core doesn't support MT then return */
343345 bnez ta2, 1f
@@ -451,7 +453,7 @@ LEAF(mips_cps_boot_vpes) · 107 unmodified lines
451453
452454 2: .set pop
453455
454−#endif /* CONFIG_MIPS_MT */
456+#endif /* CONFIG_MIPS_MT_SMP */
455457
456458 /* Return */
457459 jr ra
arch/mips/kernel/cpu-probe.c+13−8
@@ -410,16 +410,18 @@ static int set_ftlb_enable(struct cpuinfo_mips *c, int enable) · 409 unmodified lines
410410 static inline unsigned int decode_config0(struct cpuinfo_mips *c)
411411 {
412412 unsigned int config0;
413− int isa;
413+ int isa, mt;
414414
415415 config0 = read_c0_config();
416416
417417 /*
418418 * Look for Standard TLB or Dual VTLB and FTLB
419419 */
420− if ((((config0 & MIPS_CONF_MT) >> 7) == 1) ||
421− (((config0 & MIPS_CONF_MT) >> 7) == 4))
420+ mt = config0 & MIPS_CONF_MT;
421+ if (mt == MIPS_CONF_MT_TLB)
422422 c->options |= MIPS_CPU_TLB;
423+ else if (mt == MIPS_CONF_MT_FTLB)
424+ c->options |= MIPS_CPU_TLB | MIPS_CPU_FTLB;
423425
424426 isa = (config0 & MIPS_CONF_AT) >> 13;
425427 switch (isa) {
@@ -559,15 +561,18 @@ static inline unsigned int decode_config4(struct cpuinfo_mips *c) · 133 unmodified lines
559561 if (cpu_has_tlb) {
560562 if (((config4 & MIPS_CONF4_IE) >> 29) == 2)
561563 c->options |= MIPS_CPU_TLBINV;
564+
562565 /*
563− * This is a bit ugly. R6 has dropped that field from
564− * config4 and the only valid configuration is VTLB+FTLB so
565− * set a good value for mmuextdef for that case.
566+ * R6 has dropped the MMUExtDef field from config4.
567+ * On R6 the fields always describe the FTLB, and only if it is
568+ * present according to Config.MT.
566569 */
567− if (cpu_has_mips_r6)
570+ if (!cpu_has_mips_r6)
571+ mmuextdef = config4 & MIPS_CONF4_MMUEXTDEF;
572+ else if (cpu_has_ftlb)
568573 mmuextdef = MIPS_CONF4_MMUEXTDEF_VTLBSIZEEXT;
569574 else
570− mmuextdef = config4 & MIPS_CONF4_MMUEXTDEF;
575+ mmuextdef = 0;
571576
572577 switch (mmuextdef) {
573578 case MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT:
arch/mips/kernel/octeon_switch.S+1−25
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 .set pop
1919 /*
2020 * task_struct *resume(task_struct *prev, task_struct *next,
21− * struct thread_info *next_ti, int usedfpu)
21+ * struct thread_info *next_ti)
2222 */
2323 .align 7
2424 LEAF(resume)
@@ -28,30 +28,6 @@ · 3 unmodified lines
2828 cpu_save_nonscratch a0
2929 LONG_S ra, THREAD_REG31(a0)
3030
31− /*
32− * check if we need to save FPU registers
33− */
34− .set push
35− .set noreorder
36− beqz a3, 1f
37− PTR_L t3, TASK_THREAD_INFO(a0)
38− .set pop
39−
40− /*
41− * clear saved user stack CU1 bit
42− */
43− LONG_L t0, ST_OFF(t3)
44− li t1, ~ST0_CU1
45− and t0, t0, t1
46− LONG_S t0, ST_OFF(t3)
47−
48− .set push
49− .set arch=mips64r2
50− fpu_save_double a0 t0 t1 # c0_status passed in t0
51− # clobbers t1
52− .set pop
53−1:
54−
5531 #if CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0
5632 /* Check if we need to store CVMSEG state */
5733 dmfc0 t0, $11,7 /* CvmMemCtl */
arch/mips/kernel/r2300_switch.S+1−27
@@ -30,19 +30,9 @@ · 29 unmodified lines
3030 */
3131 #define ST_OFF (_THREAD_SIZE - 32 - PT_SIZE + PT_STATUS)
3232
33−/*
34− * FPU context is saved iff the process has used it's FPU in the current
35− * time slice as indicated by TIF_USEDFPU. In any case, the CU1 bit for user
36− * space STATUS register should be 0, so that a process *always* starts its
37− * userland with FPU disabled after each context switch.
38− *
39− * FPU will be enabled as soon as the process accesses FPU again, through
40− * do_cpu() trap.
41− */
42−
4333 /*
4434 * task_struct *resume(task_struct *prev, task_struct *next,
45− * struct thread_info *next_ti, int usedfpu)
35+ * struct thread_info *next_ti)
4636 */
4737 LEAF(resume)
4838 mfc0 t1, CP0_STATUS
@@ -50,22 +40,6 @@ LEAF(resume) · 1 unmodified line
5040 cpu_save_nonscratch a0
5141 sw ra, THREAD_REG31(a0)
5242
53− beqz a3, 1f
54−
55− PTR_L t3, TASK_THREAD_INFO(a0)
56−
57− /*
58− * clear saved user stack CU1 bit
59− */
60− lw t0, ST_OFF(t3)
61− li t1, ~ST0_CU1
62− and t0, t0, t1
63− sw t0, ST_OFF(t3)
64−
65− fpu_save_single a0, t0 # clobbers t0
66−
67−1:
68−
6943 #if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP)
7044 PTR_LA t8, __stack_chk_guard
7145 LONG_L t9, TASK_STACK_CANARY(a1)
arch/mips/kernel/scall32-o32.S+18−23
@@ -36,16 +36,8 @@ NESTED(handle_sys, PT_SIZE, sp) · 35 unmodified lines
3636 lw t1, PT_EPC(sp) # skip syscall on return
3737
3838 subu v0, v0, __NR_O32_Linux # check syscall number
39− sltiu t0, v0, __NR_O32_Linux_syscalls + 1
4039 addiu t1, 4 # skip to next instruction
4140 sw t1, PT_EPC(sp)
42− beqz t0, illegal_syscall
43−
44− sll t0, v0, 2
45− la t1, sys_call_table
46− addu t1, t0
47− lw t2, (t1) # syscall routine
48− beqz t2, illegal_syscall
4941
5042 sw a3, PT_R26(sp) # save a3 for syscall restarting
5143
@@ -96,6 +88,16 @@ loads_done: · 44 unmodified lines
9688 li t1, _TIF_WORK_SYSCALL_ENTRY
9789 and t0, t1
9890 bnez t0, syscall_trace_entry # -> yes
91+syscall_common:
92+ sltiu t0, v0, __NR_O32_Linux_syscalls + 1
93+ beqz t0, illegal_syscall
94+
95+ sll t0, v0, 2
96+ la t1, sys_call_table
97+ addu t1, t0
98+ lw t2, (t1) # syscall routine
99+
100+ beqz t2, illegal_syscall
99101
100102 jalr t2 # Do The Real Thing (TM)
101103
@@ -116,7 +118,7 @@ o32_syscall_exit: · 14 unmodified lines
116118
117119 syscall_trace_entry:
118120 SAVE_STATIC
119− move s0, t2
121+ move s0, v0
120122 move a0, sp
121123
122124 /*
@@ -129,27 +131,18 @@ syscall_trace_entry: · 6 unmodified lines
129131
130132 1: jal syscall_trace_enter
131133
132− bltz v0, 2f # seccomp failed? Skip syscall
134+ bltz v0, 1f # seccomp failed? Skip syscall
135+
136+ move v0, s0 # restore syscall
133137
134− move t0, s0
135138 RESTORE_STATIC
136139 lw a0, PT_R4(sp) # Restore argument registers
137140 lw a1, PT_R5(sp)
138141 lw a2, PT_R6(sp)
139142 lw a3, PT_R7(sp)
140− jalr t0
141−
142− li t0, -EMAXERRNO - 1 # error?
143− sltu t0, t0, v0
144− sw t0, PT_R7(sp) # set error flag
145− beqz t0, 1f
146−
147− lw t1, PT_R2(sp) # syscall number
148− negu v0 # error
149− sw t1, PT_R0(sp) # save it for syscall restarting
150−1: sw v0, PT_R2(sp) # result
143+ j syscall_common
151144
152−2: j syscall_exit
145+1: j syscall_exit
153146
154147 /* ------------------------------------------------------------------------ */
155148
@@ -599,3 +592,5 @@ EXPORT(sys_call_table) · 443 unmodified lines
599592 PTR sys_memfd_create
600593 PTR sys_bpf /* 4355 */
601594 PTR sys_execveat
595+ PTR sys_userfaultfd
596+ PTR sys_membarrier
arch/mips/kernel/scall64-64.S+18−22
@@ -39,18 +39,11 @@ NESTED(handle_sys64, PT_SIZE, sp) · 38 unmodified lines
3939 .set at
4040 #endif
4141
42− dsubu t0, v0, __NR_64_Linux # check syscall number
43− sltiu t0, t0, __NR_64_Linux_syscalls + 1
4442 #if !defined(CONFIG_MIPS32_O32) && !defined(CONFIG_MIPS32_N32)
4543 ld t1, PT_EPC(sp) # skip syscall on return
4644 daddiu t1, 4 # skip to next instruction
4745 sd t1, PT_EPC(sp)
4846 #endif
49− beqz t0, illegal_syscall
50−
51− dsll t0, v0, 3 # offset into table
52− ld t2, (sys_call_table - (__NR_64_Linux * 8))(t0)
53− # syscall routine
5447
5548 sd a3, PT_R26(sp) # save a3 for syscall restarting
5649
@@ -59,6 +52,17 @@ NESTED(handle_sys64, PT_SIZE, sp) · 2 unmodified lines
5952 and t0, t1, t0
6053 bnez t0, syscall_trace_entry
6154
55+syscall_common:
56+ dsubu t2, v0, __NR_64_Linux
57+ sltiu t0, t2, __NR_64_Linux_syscalls + 1
58+ beqz t0, illegal_syscall
59+
60+ dsll t0, t2, 3 # offset into table
61+ dla t2, sys_call_table
62+ daddu t0, t2, t0
63+ ld t2, (t0) # syscall routine
64+ beqz t2, illegal_syscall
65+
6266 jalr t2 # Do The Real Thing (TM)
6367
6468 li t0, -EMAXERRNO - 1 # error?
@@ -78,14 +82,14 @@ n64_syscall_exit: · 13 unmodified lines
7882
7983 syscall_trace_entry:
8084 SAVE_STATIC
81− move s0, t2
85+ move s0, v0
8286 move a0, sp
8387 move a1, v0
8488 jal syscall_trace_enter
8589
86− bltz v0, 2f # seccomp failed? Skip syscall
90+ bltz v0, 1f # seccomp failed? Skip syscall
8791
88− move t0, s0
92+ move v0, s0
8993 RESTORE_STATIC
9094 ld a0, PT_R4(sp) # Restore argument registers
9195 ld a1, PT_R5(sp)
@@ -93,19 +97,9 @@ syscall_trace_entry: · 1 unmodified line
9397 ld a3, PT_R7(sp)
9498 ld a4, PT_R8(sp)
9599 ld a5, PT_R9(sp)
96− jalr t0
97−
98− li t0, -EMAXERRNO - 1 # error?
99− sltu t0, t0, v0
100− sd t0, PT_R7(sp) # set error flag
101− beqz t0, 1f
102−
103− ld t1, PT_R2(sp) # syscall number
104− dnegu v0 # error
105− sd t1, PT_R0(sp) # save it for syscall restarting
106−1: sd v0, PT_R2(sp) # result
100+ j syscall_common
107101
108−2: j syscall_exit
102+1: j syscall_exit
109103
110104 illegal_syscall:
111105 /* This also isn't a 64-bit syscall, throw an error. */
@@ -436,4 +430,6 @@ EXPORT(sys_call_table) · 324 unmodified lines
436430 PTR sys_memfd_create
437431 PTR sys_bpf /* 5315 */
438432 PTR sys_execveat
433+ PTR sys_userfaultfd
434+ PTR sys_membarrier
439435 .size sys_call_table,.-sys_call_table
arch/mips/kernel/scall64-n32.S+7−14
@@ -52,6 +52,7 @@ NESTED(handle_sysn32, PT_SIZE, sp) · 51 unmodified lines
5252 and t0, t1, t0
5353 bnez t0, n32_syscall_trace_entry
5454
55+syscall_common:
5556 jalr t2 # Do The Real Thing (TM)
5657
5758 li t0, -EMAXERRNO - 1 # error?
@@ -75,9 +76,9 @@ n32_syscall_trace_entry: · 17 unmodified lines
7576 move a1, v0
7677 jal syscall_trace_enter
7778
78− bltz v0, 2f # seccomp failed? Skip syscall
79+ bltz v0, 1f # seccomp failed? Skip syscall
7980
80− move t0, s0
81+ move t2, s0
8182 RESTORE_STATIC
8283 ld a0, PT_R4(sp) # Restore argument registers
8384 ld a1, PT_R5(sp)
@@ -85,19 +86,9 @@ n32_syscall_trace_entry: · 1 unmodified line
8586 ld a3, PT_R7(sp)
8687 ld a4, PT_R8(sp)
8788 ld a5, PT_R9(sp)
88− jalr t0
89+ j syscall_common
8990
90− li t0, -EMAXERRNO - 1 # error?
91− sltu t0, t0, v0
92− sd t0, PT_R7(sp) # set error flag
93− beqz t0, 1f
94−
95− ld t1, PT_R2(sp) # syscall number
96− dnegu v0 # error
97− sd t1, PT_R0(sp) # save it for syscall restarting
98−1: sd v0, PT_R2(sp) # result
99−
100−2: j syscall_exit
91+1: j syscall_exit
10192
10293 not_n32_scall:
10394 /* This is not an n32 compatibility syscall, pass it on to
@@ -429,4 +420,6 @@ EXPORT(sysn32_call_table) · 325 unmodified lines
429420 PTR sys_memfd_create
430421 PTR sys_bpf
431422 PTR compat_sys_execveat /* 6320 */
423+ PTR sys_userfaultfd
424+ PTR sys_membarrier
432425 .size sysn32_call_table,.-sysn32_call_table
arch/mips/kernel/scall64-o32.S+7−14
@@ -87,6 +87,7 @@ loads_done: · 86 unmodified lines
8787 and t0, t1, t0
8888 bnez t0, trace_a_syscall
8989
90+syscall_common:
9091 jalr t2 # Do The Real Thing (TM)
9192
9293 li t0, -EMAXERRNO - 1 # error?
@@ -130,9 +131,9 @@ trace_a_syscall: · 37 unmodified lines
130131
131132 1: jal syscall_trace_enter
132133
133− bltz v0, 2f # seccomp failed? Skip syscall
134+ bltz v0, 1f # seccomp failed? Skip syscall
134135
135− move t0, s0
136+ move t2, s0
136137 RESTORE_STATIC
137138 ld a0, PT_R4(sp) # Restore argument registers
138139 ld a1, PT_R5(sp)
@@ -142,19 +143,9 @@ trace_a_syscall: · 3 unmodified lines
142143 ld a5, PT_R9(sp)
143144 ld a6, PT_R10(sp)
144145 ld a7, PT_R11(sp) # For indirect syscalls
145− jalr t0
146+ j syscall_common
146147
147− li t0, -EMAXERRNO - 1 # error?
148− sltu t0, t0, v0
149− sd t0, PT_R7(sp) # set error flag
150− beqz t0, 1f
151−
152− ld t1, PT_R2(sp) # syscall number
153− dnegu v0 # error
154− sd t1, PT_R0(sp) # save it for syscall restarting
155−1: sd v0, PT_R2(sp) # result
156−
157−2: j syscall_exit
148+1: j syscall_exit
158149
159150 /* ------------------------------------------------------------------------ */
160151
@@ -584,4 +575,6 @@ EXPORT(sys32_call_table) · 423 unmodified lines
584575 PTR sys_memfd_create
585576 PTR sys_bpf /* 4355 */
586577 PTR compat_sys_execveat
578+ PTR sys_userfaultfd
579+ PTR sys_membarrier
587580 .size sys32_call_table,.-sys32_call_table
arch/mips/kernel/setup.c+9−1
@@ -338,7 +338,7 @@ static void __init bootmem_init(void) · 337 unmodified lines
338338 if (end <= reserved_end)
339339 continue;
340340 #ifdef CONFIG_BLK_DEV_INITRD
341− /* mapstart should be after initrd_end */
341+ /* Skip zones before initrd and initrd itself */
342342 if (initrd_end && end <= (unsigned long)PFN_UP(__pa(initrd_end)))
343343 continue;
344344 #endif
@@ -371,6 +371,14 @@ static void __init bootmem_init(void) · 26 unmodified lines
371371 max_low_pfn = PFN_DOWN(HIGHMEM_START);
372372 }
373373
374+#ifdef CONFIG_BLK_DEV_INITRD
375+ /*
376+ * mapstart should be after initrd_end
377+ */
378+ if (initrd_end)
379+ mapstart = max(mapstart, (unsigned long)PFN_UP(__pa(initrd_end)));
380+#endif
381+
374382 /*
375383 * Initialize the boot-time allocator with low memory only.
376384 */
arch/mips/kernel/smp.c+2−0
@@ -42,6 +42,7 @@ · 41 unmodified lines
4242 #include <asm/mmu_context.h>
4343 #include <asm/time.h>
4444 #include <asm/setup.h>
45+#include <asm/maar.h>
4546
4647 cpumask_t cpu_callin_map; /* Bitmask of started secondaries */
4748
@@ -157,6 +158,7 @@ asmlinkage void start_secondary(void) · 109 unmodified lines
157158 mips_clockevent_init();
158159 mp_ops->init_secondary();
159160 cpu_report();
161+ maar_init();
160162
161163 /*
162164 * XXX parity protection should be folded in here when it's converted
arch/mips/loongson64/common/env.c+3−0
@@ -64,6 +64,9 @@ void __init prom_init_env(void) · 63 unmodified lines
6464 }
6565 if (memsize == 0)
6666 memsize = 256;
67+
68+ loongson_sysconf.nr_uarts = 1;
69+
6770 pr_info("memsize=%u, highmemsize=%u\n", memsize, highmemsize);
6871 #else
6972 struct boot_params *boot_p;
arch/mips/mm/dma-default.c+1−1
@@ -100,7 +100,7 @@ static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp) · 99 unmodified lines
100100 else
101101 #endif
102102 #if defined(CONFIG_ZONE_DMA) && !defined(CONFIG_ZONE_DMA32)
103− if (dev->coherent_dma_mask < DMA_BIT_MASK(64))
103+ if (dev->coherent_dma_mask < DMA_BIT_MASK(sizeof(phys_addr_t) * 8))
104104 dma_flag = __GFP_DMA;
105105 else
106106 #endif
arch/mips/mm/init.c+114−63
@@ -44,6 +44,7 @@ · 43 unmodified lines
4444 #include <asm/pgalloc.h>
4545 #include <asm/tlb.h>
4646 #include <asm/fixmap.h>
47+#include <asm/maar.h>
4748
4849 /*
4950 * We have up to 8 empty zeroed pages so we can map one of the right colour
@@ -252,6 +253,119 @@ void __init fixrange_init(unsigned long start, unsigned long end, · 202 unmodified lines
252253 #endif
253254 }
254255
256+unsigned __weak platform_maar_init(unsigned num_pairs)
257+{
258+ struct maar_config cfg[BOOT_MEM_MAP_MAX];
259+ unsigned i, num_configured, num_cfg = 0;
260+ phys_addr_t skip;
261+
262+ for (i = 0; i < boot_mem_map.nr_map; i++) {
263+ switch (boot_mem_map.map[i].type) {
264+ case BOOT_MEM_RAM:
265+ case BOOT_MEM_INIT_RAM:
266+ break;
267+ default:
268+ continue;
269+ }
270+
271+ skip = 0x10000 - (boot_mem_map.map[i].addr & 0xffff);
272+
273+ cfg[num_cfg].lower = boot_mem_map.map[i].addr;
274+ cfg[num_cfg].lower += skip;
275+
276+ cfg[num_cfg].upper = cfg[num_cfg].lower;
277+ cfg[num_cfg].upper += boot_mem_map.map[i].size - 1;
278+ cfg[num_cfg].upper -= skip;
279+
280+ cfg[num_cfg].attrs = MIPS_MAAR_S;
281+ num_cfg++;
282+ }
283+
284+ num_configured = maar_config(cfg, num_cfg, num_pairs);
285+ if (num_configured < num_cfg)
286+ pr_warn("Not enough MAAR pairs (%u) for all bootmem regions (%u)\n",
287+ num_pairs, num_cfg);
288+
289+ return num_configured;
290+}
291+
292+void maar_init(void)
293+{
294+ unsigned num_maars, used, i;
295+ phys_addr_t lower, upper, attr;
296+ static struct {
297+ struct maar_config cfgs[3];
298+ unsigned used;
299+ } recorded = { { { 0 } }, 0 };
300+
301+ if (!cpu_has_maar)
302+ return;
303+
304+ /* Detect the number of MAARs */
305+ write_c0_maari(~0);
306+ back_to_back_c0_hazard();
307+ num_maars = read_c0_maari() + 1;
308+
309+ /* MAARs should be in pairs */
310+ WARN_ON(num_maars % 2);
311+
312+ /* Set MAARs using values we recorded already */
313+ if (recorded.used) {
314+ used = maar_config(recorded.cfgs, recorded.used, num_maars / 2);
315+ BUG_ON(used != recorded.used);
316+ } else {
317+ /* Configure the required MAARs */
318+ used = platform_maar_init(num_maars / 2);
319+ }
320+
321+ /* Disable any further MAARs */
322+ for (i = (used * 2); i < num_maars; i++) {
323+ write_c0_maari(i);
324+ back_to_back_c0_hazard();
325+ write_c0_maar(0);
326+ back_to_back_c0_hazard();
327+ }
328+
329+ if (recorded.used)
330+ return;
331+
332+ pr_info("MAAR configuration:\n");
333+ for (i = 0; i < num_maars; i += 2) {
334+ write_c0_maari(i);
335+ back_to_back_c0_hazard();
336+ upper = read_c0_maar();
337+
338+ write_c0_maari(i + 1);
339+ back_to_back_c0_hazard();
340+ lower = read_c0_maar();
341+
342+ attr = lower & upper;
343+ lower = (lower & MIPS_MAAR_ADDR) << 4;
344+ upper = ((upper & MIPS_MAAR_ADDR) << 4) | 0xffff;
345+
346+ pr_info(" [%d]: ", i / 2);
347+ if (!(attr & MIPS_MAAR_V)) {
348+ pr_cont("disabled\n");
349+ continue;
350+ }
351+
352+ pr_cont("%pa-%pa", &lower, &upper);
353+
354+ if (attr & MIPS_MAAR_S)
355+ pr_cont(" speculate");
356+
357+ pr_cont("\n");
358+
359+ /* Record the setup for use on secondary CPUs */
360+ if (used <= ARRAY_SIZE(recorded.cfgs)) {
361+ recorded.cfgs[recorded.used].lower = lower;
362+ recorded.cfgs[recorded.used].upper = upper;
363+ recorded.cfgs[recorded.used].attrs = attr;
364+ recorded.used++;
365+ }
366+ }
367+}
368+
255369 #ifndef CONFIG_NEED_MULTIPLE_NODES
256370 int page_is_ram(unsigned long pagenr)
257371 {
@@ -334,69 +448,6 @@ static inline void mem_init_free_highmem(void) · 76 unmodified lines
334448 #endif
335449 }
336450
337−unsigned __weak platform_maar_init(unsigned num_pairs)
338−{
339− struct maar_config cfg[BOOT_MEM_MAP_MAX];
340− unsigned i, num_configured, num_cfg = 0;
341− phys_addr_t skip;
342−
343− for (i = 0; i < boot_mem_map.nr_map; i++) {
344− switch (boot_mem_map.map[i].type) {
345− case BOOT_MEM_RAM:
346− case BOOT_MEM_INIT_RAM:
347− break;
348− default:
349− continue;
350− }
351−
352− skip = 0x10000 - (boot_mem_map.map[i].addr & 0xffff);
353−
354− cfg[num_cfg].lower = boot_mem_map.map[i].addr;
355− cfg[num_cfg].lower += skip;
356−
357− cfg[num_cfg].upper = cfg[num_cfg].lower;
358− cfg[num_cfg].upper += boot_mem_map.map[i].size - 1;
359− cfg[num_cfg].upper -= skip;
360−
361− cfg[num_cfg].attrs = MIPS_MAAR_S;
362− num_cfg++;
363− }
364−
365− num_configured = maar_config(cfg, num_cfg, num_pairs);
366− if (num_configured < num_cfg)
367− pr_warn("Not enough MAAR pairs (%u) for all bootmem regions (%u)\n",
368− num_pairs, num_cfg);
369−
370− return num_configured;
371−}
372−
373−static void maar_init(void)
374−{
375− unsigned num_maars, used, i;
376−
377− if (!cpu_has_maar)
378− return;
379−
380− /* Detect the number of MAARs */
381− write_c0_maari(~0);
382− back_to_back_c0_hazard();
383− num_maars = read_c0_maari() + 1;
384−
385− /* MAARs should be in pairs */
386− WARN_ON(num_maars % 2);
387−
388− /* Configure the required MAARs */
389− used = platform_maar_init(num_maars / 2);
390−
391− /* Disable any further MAARs */
392− for (i = (used * 2); i < num_maars; i++) {
393− write_c0_maari(i);
394− back_to_back_c0_hazard();
395− write_c0_maar(0);
396− back_to_back_c0_hazard();
397− }
398−}
399−
400451 void __init mem_init(void)
401452 {
402453 #ifdef CONFIG_HIGHMEM
arch/mips/net/bpf_jit_asm.S+54−9
@@ -57,15 +57,28 @@ · 56 unmodified lines
5757
5858 LEAF(sk_load_word)
5959 is_offset_negative(word)
60− .globl sk_load_word_positive
61−sk_load_word_positive:
60+FEXPORT(sk_load_word_positive)
6261 is_offset_in_header(4, word)
6362 /* Offset within header boundaries */
6463 PTR_ADDU t1, $r_skb_data, offset
64+ .set reorder
6565 lw $r_A, 0(t1)
66+ .set noreorder
6667 #ifdef CONFIG_CPU_LITTLE_ENDIAN
68+# if defined(__mips_isa_rev) && (__mips_isa_rev >= 2)
6769 wsbh t0, $r_A
6870 rotr $r_A, t0, 16
71+# else
72+ sll t0, $r_A, 24
73+ srl t1, $r_A, 24
74+ srl t2, $r_A, 8
75+ or t0, t0, t1
76+ andi t2, t2, 0xff00
77+ andi t1, $r_A, 0xff00
78+ or t0, t0, t2
79+ sll t1, t1, 8
80+ or $r_A, t0, t1
81+# endif
6982 #endif
7083 jr $r_ra
7184 move $r_ret, zero
@@ -73,15 +86,24 @@ sk_load_word_positive: · 1 unmodified line
7386
7487 LEAF(sk_load_half)
7588 is_offset_negative(half)
76− .globl sk_load_half_positive
77−sk_load_half_positive:
89+FEXPORT(sk_load_half_positive)
7890 is_offset_in_header(2, half)
7991 /* Offset within header boundaries */
8092 PTR_ADDU t1, $r_skb_data, offset
93+ .set reorder
8194 lh $r_A, 0(t1)
95+ .set noreorder
8296 #ifdef CONFIG_CPU_LITTLE_ENDIAN
97+# if defined(__mips_isa_rev) && (__mips_isa_rev >= 2)
8398 wsbh t0, $r_A
8499 seh $r_A, t0
100+# else
101+ sll t0, $r_A, 24
102+ andi t1, $r_A, 0xff00
103+ sra t0, t0, 16
104+ srl t1, t1, 8
105+ or $r_A, t0, t1
106+# endif
85107 #endif
86108 jr $r_ra
87109 move $r_ret, zero
@@ -89,8 +111,7 @@ sk_load_half_positive: · 1 unmodified line
89111
90112 LEAF(sk_load_byte)
91113 is_offset_negative(byte)
92− .globl sk_load_byte_positive
93−sk_load_byte_positive:
114+FEXPORT(sk_load_byte_positive)
94115 is_offset_in_header(1, byte)
95116 /* Offset within header boundaries */
96117 PTR_ADDU t1, $r_skb_data, offset
@@ -148,23 +169,47 @@ sk_load_byte_positive: · 51 unmodified lines
148169 NESTED(bpf_slow_path_word, (6 * SZREG), $r_sp)
149170 bpf_slow_path_common(4)
150171 #ifdef CONFIG_CPU_LITTLE_ENDIAN
172+# if defined(__mips_isa_rev) && (__mips_isa_rev >= 2)
151173 wsbh t0, $r_s0
152174 jr $r_ra
153175 rotr $r_A, t0, 16
154−#endif
176+# else
177+ sll t0, $r_s0, 24
178+ srl t1, $r_s0, 24
179+ srl t2, $r_s0, 8
180+ or t0, t0, t1
181+ andi t2, t2, 0xff00
182+ andi t1, $r_s0, 0xff00
183+ or t0, t0, t2
184+ sll t1, t1, 8
185+ jr $r_ra
186+ or $r_A, t0, t1
187+# endif
188+#else
155189 jr $r_ra
156− move $r_A, $r_s0
190+ move $r_A, $r_s0
191+#endif
157192
158193 END(bpf_slow_path_word)
159194
160195 NESTED(bpf_slow_path_half, (6 * SZREG), $r_sp)
161196 bpf_slow_path_common(2)
162197 #ifdef CONFIG_CPU_LITTLE_ENDIAN
198+# if defined(__mips_isa_rev) && (__mips_isa_rev >= 2)
163199 jr $r_ra
164200 wsbh $r_A, $r_s0
165−#endif
201+# else
202+ sll t0, $r_s0, 8
203+ andi t1, $r_s0, 0xff00
204+ andi t0, t0, 0xff00
205+ srl t1, t1, 8
206+ jr $r_ra
207+ or $r_A, t0, t1
208+# endif
209+#else
166210 jr $r_ra
167211 move $r_A, $r_s0
212+#endif
168213
169214 END(bpf_slow_path_half)
170215
arch/mn10300/include/asm/Kbuild+1−0
@@ -9,3 +9,4 @@ generic-y += mm-arch-hooks.h · 8 unmodified lines
99 generic-y += preempt.h
1010 generic-y += sections.h
1111 generic-y += trace_clock.h
12+generic-y += word-at-a-time.h
arch/nios2/include/asm/Kbuild+1−0
@@ -61,4 +61,5 @@ generic-y += types.h · 60 unmodified lines
6161 generic-y += unaligned.h
6262 generic-y += user.h
6363 generic-y += vga.h
64+generic-y += word-at-a-time.h
6465 generic-y += xor.h
arch/powerpc/include/asm/Kbuild+1−0
@@ -7,3 +7,4 @@ generic-y += mcs_spinlock.h · 6 unmodified lines
77 generic-y += preempt.h
88 generic-y += rwsem.h
99 generic-y += vtime.h
10+generic-y += word-at-a-time.h
arch/s390/include/asm/Kbuild+1−0
@@ -6,3 +6,4 @@ generic-y += mcs_spinlock.h · 5 unmodified lines
66 generic-y += mm-arch-hooks.h
77 generic-y += preempt.h
88 generic-y += trace_clock.h
9+generic-y += word-at-a-time.h
arch/score/include/asm/Kbuild+1−0
@@ -13,3 +13,4 @@ generic-y += sections.h · 12 unmodified lines
1313 generic-y += trace_clock.h
1414 generic-y += xor.h
1515 generic-y += serial.h
16+generic-y += word-at-a-time.h
arch/tile/gxio/mpipe.c+4−29
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/errno.h>
2020 #include <linux/io.h>
2121 #include <linux/module.h>
22+#include <linux/string.h>
2223
2324 #include <gxio/iorpc_globals.h>
2425 #include <gxio/iorpc_mpipe.h>
@@ -29,32 +30,6 @@ · 4 unmodified lines
2930 /* HACK: Avoid pointless "shadow" warnings. */
3031 #define link link_shadow
3132
32−/**
33− * strscpy - Copy a C-string into a sized buffer, but only if it fits
34− * @dest: Where to copy the string to
35− * @src: Where to copy the string from
36− * @size: size of destination buffer
37− *
38− * Use this routine to avoid copying too-long strings.
39− * The routine returns the total number of bytes copied
40− * (including the trailing NUL) or zero if the buffer wasn't
41− * big enough. To ensure that programmers pay attention
42− * to the return code, the destination has a single NUL
43− * written at the front (if size is non-zero) when the
44− * buffer is not big enough.
45− */
46−static size_t strscpy(char *dest, const char *src, size_t size)
47−{
48− size_t len = strnlen(src, size) + 1;
49− if (len > size) {
50− if (size)
51− dest[0] = '\0';
52− return 0;
53− }
54− memcpy(dest, src, len);
55− return len;
56−}
57−
5833 int gxio_mpipe_init(gxio_mpipe_context_t *context, unsigned int mpipe_index)
5934 {
6035 char file[32];
@@ -540,7 +515,7 @@ int gxio_mpipe_link_instance(const char *link_name) · 479 unmodified lines
540515 if (!context)
541516 return GXIO_ERR_NO_DEVICE;
542517
543− if (strscpy(name.name, link_name, sizeof(name.name)) == 0)
518+ if (strscpy(name.name, link_name, sizeof(name.name)) < 0)
544519 return GXIO_ERR_NO_DEVICE;
545520
546521 return gxio_mpipe_info_instance_aux(context, name);
@@ -559,7 +534,7 @@ int gxio_mpipe_link_enumerate_mac(int idx, char *link_name, uint8_t *link_mac) · 12 unmodified lines
559534
560535 rv = gxio_mpipe_info_enumerate_aux(context, idx, &name, &mac);
561536 if (rv >= 0) {
562− if (strscpy(link_name, name.name, sizeof(name.name)) == 0)
537+ if (strscpy(link_name, name.name, sizeof(name.name)) < 0)
563538 return GXIO_ERR_INVAL_MEMORY_SIZE;
564539 memcpy(link_mac, mac.mac, sizeof(mac.mac));
565540 }
@@ -576,7 +551,7 @@ int gxio_mpipe_link_open(gxio_mpipe_link_t *link, · 10 unmodified lines
576551 _gxio_mpipe_link_name_t name;
577552 int rv;
578553
579− if (strscpy(name.name, link_name, sizeof(name.name)) == 0)
554+ if (strscpy(name.name, link_name, sizeof(name.name)) < 0)
580555 return GXIO_ERR_NO_DEVICE;
581556
582557 rv = gxio_mpipe_link_open_aux(context, name, flags);
arch/tile/include/asm/Kbuild+1−0
@@ -40,4 +40,5 @@ generic-y += termbits.h · 39 unmodified lines
4040 generic-y += termios.h
4141 generic-y += trace_clock.h
4242 generic-y += types.h
43+generic-y += word-at-a-time.h
4344 generic-y += xor.h
arch/tile/kernel/usb.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <linux/platform_device.h>
2323 #include <linux/usb/tilegx.h>
2424 #include <linux/init.h>
25+#include <linux/module.h>
2526 #include <linux/types.h>
2627
2728 static u64 ehci_dmamask = DMA_BIT_MASK(32);
arch/um/include/asm/Kbuild+1−0
@@ -25,4 +25,5 @@ generic-y += preempt.h · 24 unmodified lines
2525 generic-y += switch_to.h
2626 generic-y += topology.h
2727 generic-y += trace_clock.h
28+generic-y += word-at-a-time.h
2829 generic-y += xor.h
arch/unicore32/include/asm/Kbuild+1−0
@@ -62,4 +62,5 @@ generic-y += ucontext.h · 61 unmodified lines
6262 generic-y += unaligned.h
6363 generic-y += user.h
6464 generic-y += vga.h
65+generic-y += word-at-a-time.h
6566 generic-y += xor.h
arch/x86/include/asm/cpufeature.h+1−1
@@ -193,7 +193,7 @@ · 192 unmodified lines
193193 #define X86_FEATURE_HW_PSTATE ( 7*32+ 8) /* AMD HW-PState */
194194 #define X86_FEATURE_PROC_FEEDBACK ( 7*32+ 9) /* AMD ProcFeedbackInterface */
195195 #define X86_FEATURE_HWP ( 7*32+ 10) /* "hwp" Intel HWP */
196−#define X86_FEATURE_HWP_NOITFY ( 7*32+ 11) /* Intel HWP_NOTIFY */
196+#define X86_FEATURE_HWP_NOTIFY ( 7*32+ 11) /* Intel HWP_NOTIFY */
197197 #define X86_FEATURE_HWP_ACT_WINDOW ( 7*32+ 12) /* Intel HWP_ACT_WINDOW */
198198 #define X86_FEATURE_HWP_EPP ( 7*32+13) /* Intel HWP_EPP */
199199 #define X86_FEATURE_HWP_PKG_REQ ( 7*32+14) /* Intel HWP_PKG_REQ */
arch/x86/include/asm/efi.h+2−0
@@ -86,6 +86,7 @@ extern u64 asmlinkage efi_call(void *fp, ...); · 85 unmodified lines
8686 extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,
8787 u32 type, u64 attribute);
8888
89+#ifdef CONFIG_KASAN
8990 /*
9091 * CONFIG_KASAN may redefine memset to __memset. __memset function is present
9192 * only in kernel binary. Since the EFI stub linked into a separate binary it
@@ -95,6 +96,7 @@ extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size, · 3 unmodified lines
9596 #undef memcpy
9697 #undef memset
9798 #undef memmove
99+#endif
98100
99101 #endif /* CONFIG_X86_32 */
100102
arch/x86/include/asm/msr-index.h+2−0
@@ -141,6 +141,8 @@ · 140 unmodified lines
141141 #define DEBUGCTLMSR_BTS_OFF_USR (1UL << 10)
142142 #define DEBUGCTLMSR_FREEZE_LBRS_ON_PMI (1UL << 11)
143143
144+#define MSR_PEBS_FRONTEND 0x000003f7
145+
144146 #define MSR_IA32_POWER_CTL 0x000001fc
145147
146148 #define MSR_IA32_MC0_CTL 0x00000400
arch/x86/include/asm/pvclock-abi.h+1−0
@@ -41,6 +41,7 @@ struct pvclock_wall_clock { · 40 unmodified lines
4141
4242 #define PVCLOCK_TSC_STABLE_BIT (1 << 0)
4343 #define PVCLOCK_GUEST_STOPPED (1 << 1)
44+/* PVCLOCK_COUNTS_FROM_ZERO broke ABI and can't be used anymore. */
4445 #define PVCLOCK_COUNTS_FROM_ZERO (1 << 2)
4546 #endif /* __ASSEMBLY__ */
4647 #endif /* _ASM_X86_PVCLOCK_ABI_H */
arch/x86/include/uapi/asm/bitsperlong.h+1−1
@@ -1,7 +1,7 @@
11 #ifndef __ASM_X86_BITSPERLONG_H
22 #define __ASM_X86_BITSPERLONG_H
33
4−#ifdef __x86_64__
4+#if defined(__x86_64__) && !defined(__ILP32__)
55 # define __BITS_PER_LONG 64
66 #else
77 # define __BITS_PER_LONG 32
arch/x86/kernel/cpu/mshyperv.c+7−5
@@ -34,11 +34,10 @@ · 33 unmodified lines
3434 struct ms_hyperv_info ms_hyperv;
3535 EXPORT_SYMBOL_GPL(ms_hyperv);
3636
37−static void (*hv_kexec_handler)(void);
38−static void (*hv_crash_handler)(struct pt_regs *regs);
39−
4037 #if IS_ENABLED(CONFIG_HYPERV)
4138 static void (*vmbus_handler)(void);
39+static void (*hv_kexec_handler)(void);
40+static void (*hv_crash_handler)(struct pt_regs *regs);
4241
4342 void hyperv_vector_handler(struct pt_regs *regs)
4443 {
@@ -96,8 +95,8 @@ void hv_remove_crash_handler(void) · 51 unmodified lines
9695 hv_crash_handler = NULL;
9796 }
9897 EXPORT_SYMBOL_GPL(hv_remove_crash_handler);
99−#endif
10098
99+#ifdef CONFIG_KEXEC_CORE
101100 static void hv_machine_shutdown(void)
102101 {
103102 if (kexec_in_progress && hv_kexec_handler)
@@ -111,7 +110,8 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs) · 7 unmodified lines
111110 hv_crash_handler(regs);
112111 native_machine_crash_shutdown(regs);
113112 }
114−
113+#endif /* CONFIG_KEXEC_CORE */
114+#endif /* CONFIG_HYPERV */
115115
116116 static uint32_t __init ms_hyperv_platform(void)
117117 {
@@ -186,8 +186,10 @@ static void __init ms_hyperv_init_platform(void) · 68 unmodified lines
186186 no_timer_check = 1;
187187 #endif
188188
189+#if IS_ENABLED(CONFIG_HYPERV) && defined(CONFIG_KEXEC_CORE)
189190 machine_ops.shutdown = hv_machine_shutdown;
190191 machine_ops.crash_shutdown = hv_machine_crash_shutdown;
192+#endif
191193 mark_tsc_unstable("running on Hyper-V");
192194 }
193195
arch/x86/kernel/cpu/perf_event.h+1−0
@@ -47,6 +47,7 @@ enum extra_reg_type { · 46 unmodified lines
4747 EXTRA_REG_RSP_1 = 1, /* offcore_response_1 */
4848 EXTRA_REG_LBR = 2, /* lbr_select */
4949 EXTRA_REG_LDLAT = 3, /* ld_lat_threshold */
50+ EXTRA_REG_FE = 4, /* fe_* */
5051
5152 EXTRA_REG_MAX /* number of entries needed */
5253 };
arch/x86/kernel/cpu/perf_event_intel.c+15−2
@@ -205,6 +205,11 @@ static struct extra_reg intel_skl_extra_regs[] __read_mostly = { · 204 unmodified lines
205205 INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0x3fffff8fffull, RSP_0),
206206 INTEL_UEVENT_EXTRA_REG(0x01bb, MSR_OFFCORE_RSP_1, 0x3fffff8fffull, RSP_1),
207207 INTEL_UEVENT_PEBS_LDLAT_EXTRA_REG(0x01cd),
208+ /*
209+ * Note the low 8 bits eventsel code is not a continuous field, containing
210+ * some #GPing bits. These are masked out.
211+ */
212+ INTEL_UEVENT_EXTRA_REG(0x01c6, MSR_PEBS_FRONTEND, 0x7fff17, FE),
208213 EVENT_EXTRA_END
209214 };
210215
@@ -250,7 +255,7 @@ struct event_constraint intel_bdw_event_constraints[] = { · 39 unmodified lines
250255 FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
251256 FIXED_EVENT_CONSTRAINT(0x0300, 2), /* CPU_CLK_UNHALTED.REF */
252257 INTEL_UEVENT_CONSTRAINT(0x148, 0x4), /* L1D_PEND_MISS.PENDING */
253− INTEL_EVENT_CONSTRAINT(0xa3, 0x4), /* CYCLE_ACTIVITY.* */
258+ INTEL_UEVENT_CONSTRAINT(0x8a3, 0x4), /* CYCLE_ACTIVITY.CYCLES_L1D_MISS */
254259 EVENT_CONSTRAINT_END
255260 };
256261
@@ -2891,6 +2896,8 @@ PMU_FORMAT_ATTR(offcore_rsp, "config1:0-63"); · 2634 unmodified lines
28912896
28922897 PMU_FORMAT_ATTR(ldlat, "config1:0-15");
28932898
2899+PMU_FORMAT_ATTR(frontend, "config1:0-23");
2900+
28942901 static struct attribute *intel_arch3_formats_attr[] = {
28952902 &format_attr_event.attr,
28962903 &format_attr_umask.attr,
@@ -2907,6 +2914,11 @@ static struct attribute *intel_arch3_formats_attr[] = { · 10 unmodified lines
29072914 NULL,
29082915 };
29092916
2917+static struct attribute *skl_format_attr[] = {
2918+ &format_attr_frontend.attr,
2919+ NULL,
2920+};
2921+
29102922 static __initconst const struct x86_pmu core_pmu = {
29112923 .name = "core",
29122924 .handle_irq = x86_pmu_handle_irq,
@@ -3516,7 +3528,8 @@ __init int intel_pmu_init(void) · 603 unmodified lines
35163528
35173529 x86_pmu.hw_config = hsw_hw_config;
35183530 x86_pmu.get_event_constraints = hsw_get_event_constraints;
3519− x86_pmu.cpu_events = hsw_events_attrs;
3531+ x86_pmu.format_attrs = merge_attr(intel_arch3_formats_attr,
3532+ skl_format_attr);
35203533 WARN_ON(!x86_pmu.format_attrs);
35213534 x86_pmu.cpu_events = hsw_events_attrs;
35223535 pr_cont("Skylake events, ");
arch/x86/kernel/cpu/perf_event_msr.c+2−2
@@ -10,12 +10,12 @@ enum perf_msr_id { · 9 unmodified lines
1010 PERF_MSR_EVENT_MAX,
1111 };
1212
13−bool test_aperfmperf(int idx)
13+static bool test_aperfmperf(int idx)
1414 {
1515 return boot_cpu_has(X86_FEATURE_APERFMPERF);
1616 }
1717
18−bool test_intel(int idx)
18+static bool test_intel(int idx)
1919 {
2020 if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL ||
2121 boot_cpu_data.x86 != 6)
arch/x86/kernel/cpu/scattered.c+1−1
@@ -37,7 +37,7 @@ void init_scattered_cpuid_features(struct cpuinfo_x86 *c) · 36 unmodified lines
3737 { X86_FEATURE_PLN, CR_EAX, 4, 0x00000006, 0 },
3838 { X86_FEATURE_PTS, CR_EAX, 6, 0x00000006, 0 },
3939 { X86_FEATURE_HWP, CR_EAX, 7, 0x00000006, 0 },
40− { X86_FEATURE_HWP_NOITFY, CR_EAX, 8, 0x00000006, 0 },
40+ { X86_FEATURE_HWP_NOTIFY, CR_EAX, 8, 0x00000006, 0 },
4141 { X86_FEATURE_HWP_ACT_WINDOW, CR_EAX, 9, 0x00000006, 0 },
4242 { X86_FEATURE_HWP_EPP, CR_EAX,10, 0x00000006, 0 },
4343 { X86_FEATURE_HWP_PKG_REQ, CR_EAX,11, 0x00000006, 0 },
arch/x86/kernel/crash.c+3−4
@@ -185,10 +185,9 @@ void native_machine_crash_shutdown(struct pt_regs *regs) · 184 unmodified lines
185185 }
186186
187187 #ifdef CONFIG_KEXEC_FILE
188−static int get_nr_ram_ranges_callback(unsigned long start_pfn,
189− unsigned long nr_pfn, void *arg)
188+static int get_nr_ram_ranges_callback(u64 start, u64 end, void *arg)
190189 {
191− int *nr_ranges = arg;
190+ unsigned int *nr_ranges = arg;
192191
193192 (*nr_ranges)++;
194193 return 0;
@@ -214,7 +213,7 @@ static void fill_up_crash_elf_data(struct crash_elf_data *ced, · 19 unmodified lines
214213
215214 ced->image = image;
216215
217− walk_system_ram_range(0, -1, &nr_ranges,
216+ walk_system_ram_res(0, -1, &nr_ranges,
218217 get_nr_ram_ranges_callback);
219218
220219 ced->max_nr_ranges = nr_ranges;
arch/x86/kernel/process.c+55−0
@@ -506,3 +506,58 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) · 505 unmodified lines
506506 return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
507507 }
508508
509+/*
510+ * Called from fs/proc with a reference on @p to find the function
511+ * which called into schedule(). This needs to be done carefully
512+ * because the task might wake up and we might look at a stack
513+ * changing under us.
514+ */
515+unsigned long get_wchan(struct task_struct *p)
516+{
517+ unsigned long start, bottom, top, sp, fp, ip;
518+ int count = 0;
519+
520+ if (!p || p == current || p->state == TASK_RUNNING)
521+ return 0;
522+
523+ start = (unsigned long)task_stack_page(p);
524+ if (!start)
525+ return 0;
526+
527+ /*
528+ * Layout of the stack page:
529+ *
530+ * ----------- topmax = start + THREAD_SIZE - sizeof(unsigned long)
531+ * PADDING
532+ * ----------- top = topmax - TOP_OF_KERNEL_STACK_PADDING
533+ * stack
534+ * ----------- bottom = start + sizeof(thread_info)
535+ * thread_info
536+ * ----------- start
537+ *
538+ * The tasks stack pointer points at the location where the
539+ * framepointer is stored. The data on the stack is:
540+ * ... IP FP ... IP FP
541+ *
542+ * We need to read FP and IP, so we need to adjust the upper
543+ * bound by another unsigned long.
544+ */
545+ top = start + THREAD_SIZE - TOP_OF_KERNEL_STACK_PADDING;
546+ top -= 2 * sizeof(unsigned long);
547+ bottom = start + sizeof(struct thread_info);
548+
549+ sp = READ_ONCE(p->thread.sp);
550+ if (sp < bottom || sp > top)
551+ return 0;
552+
553+ fp = READ_ONCE(*(unsigned long *)sp);
554+ do {
555+ if (fp < bottom || fp > top)
556+ return 0;
557+ ip = READ_ONCE(*(unsigned long *)(fp + sizeof(unsigned long)));
558+ if (!in_sched_functions(ip))
559+ return ip;
560+ fp = READ_ONCE(*(unsigned long *)fp);
561+ } while (count++ < 16 && p->state != TASK_RUNNING);
562+ return 0;
563+}
arch/x86/kernel/process_32.c+0−28
@@ -324,31 +324,3 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) · 323 unmodified lines
324324
325325 return prev_p;
326326 }
327−
328−#define top_esp (THREAD_SIZE - sizeof(unsigned long))
329−#define top_ebp (THREAD_SIZE - 2*sizeof(unsigned long))
330−
331−unsigned long get_wchan(struct task_struct *p)
332−{
333− unsigned long bp, sp, ip;
334− unsigned long stack_page;
335− int count = 0;
336− if (!p || p == current || p->state == TASK_RUNNING)
337− return 0;
338− stack_page = (unsigned long)task_stack_page(p);
339− sp = p->thread.sp;
340− if (!stack_page || sp < stack_page || sp > top_esp+stack_page)
341− return 0;
342− /* include/asm-i386/system.h:switch_to() pushes bp last. */
343− bp = *(unsigned long *) sp;
344− do {
345− if (bp < stack_page || bp > top_ebp+stack_page)
346− return 0;
347− ip = *(unsigned long *) (bp+4);
348− if (!in_sched_functions(ip))
349− return ip;
350− bp = *(unsigned long *) bp;
351− } while (count++ < 16);
352− return 0;
353−}
354−
arch/x86/kernel/process_64.c+0−24
@@ -499,30 +499,6 @@ void set_personality_ia32(bool x32) · 498 unmodified lines
499499 }
500500 EXPORT_SYMBOL_GPL(set_personality_ia32);
501501
502−unsigned long get_wchan(struct task_struct *p)
503−{
504− unsigned long stack;
505− u64 fp, ip;
506− int count = 0;
507−
508− if (!p || p == current || p->state == TASK_RUNNING)
509− return 0;
510− stack = (unsigned long)task_stack_page(p);
511− if (p->thread.sp < stack || p->thread.sp >= stack+THREAD_SIZE)
512− return 0;
513− fp = *(u64 *)(p->thread.sp);
514− do {
515− if (fp < (unsigned long)stack ||
516− fp >= (unsigned long)stack+THREAD_SIZE)
517− return 0;
518− ip = *(u64 *)(fp+8);
519− if (!in_sched_functions(ip))
520− return ip;
521− fp = *(u64 *)fp;
522− } while (count++ < 16);
523− return 0;
524−}
525−
526502 long do_arch_prctl(struct task_struct *task, int code, unsigned long addr)
527503 {
528504 int ret = 0;
arch/x86/kvm/svm.c+13−112
@@ -514,7 +514,7 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu) · 513 unmodified lines
514514 struct vcpu_svm *svm = to_svm(vcpu);
515515
516516 if (svm->vmcb->control.next_rip != 0) {
517− WARN_ON(!static_cpu_has(X86_FEATURE_NRIPS));
517+ WARN_ON_ONCE(!static_cpu_has(X86_FEATURE_NRIPS));
518518 svm->next_rip = svm->vmcb->control.next_rip;
519519 }
520520
@@ -866,64 +866,6 @@ static void svm_disable_lbrv(struct vcpu_svm *svm) · 345 unmodified lines
866866 set_msr_interception(msrpm, MSR_IA32_LASTINTTOIP, 0, 0);
867867 }
868868
869−#define MTRR_TYPE_UC_MINUS 7
870−#define MTRR2PROTVAL_INVALID 0xff
871−
872−static u8 mtrr2protval[8];
873−
874−static u8 fallback_mtrr_type(int mtrr)
875−{
876− /*
877− * WT and WP aren't always available in the host PAT. Treat
878− * them as UC and UC- respectively. Everything else should be
879− * there.
880− */
881− switch (mtrr)
882− {
883− case MTRR_TYPE_WRTHROUGH:
884− return MTRR_TYPE_UNCACHABLE;
885− case MTRR_TYPE_WRPROT:
886− return MTRR_TYPE_UC_MINUS;
887− default:
888− BUG();
889− }
890−}
891−
892−static void build_mtrr2protval(void)
893−{
894− int i;
895− u64 pat;
896−
897− for (i = 0; i < 8; i++)
898− mtrr2protval[i] = MTRR2PROTVAL_INVALID;
899−
900− /* Ignore the invalid MTRR types. */
901− mtrr2protval[2] = 0;
902− mtrr2protval[3] = 0;
903−
904− /*
905− * Use host PAT value to figure out the mapping from guest MTRR
906− * values to nested page table PAT/PCD/PWT values. We do not
907− * want to change the host PAT value every time we enter the
908− * guest.
909− */
910− rdmsrl(MSR_IA32_CR_PAT, pat);
911− for (i = 0; i < 8; i++) {
912− u8 mtrr = pat >> (8 * i);
913−
914− if (mtrr2protval[mtrr] == MTRR2PROTVAL_INVALID)
915− mtrr2protval[mtrr] = __cm_idx2pte(i);
916− }
917−
918− for (i = 0; i < 8; i++) {
919− if (mtrr2protval[i] == MTRR2PROTVAL_INVALID) {
920− u8 fallback = fallback_mtrr_type(i);
921− mtrr2protval[i] = mtrr2protval[fallback];
922− BUG_ON(mtrr2protval[i] == MTRR2PROTVAL_INVALID);
923− }
924− }
925−}
926−
927869 static __init int svm_hardware_setup(void)
928870 {
929871 int cpu;
@@ -990,7 +932,6 @@ static __init int svm_hardware_setup(void) · 60 unmodified lines
990932 } else
991933 kvm_disable_tdp();
992934
993− build_mtrr2protval();
994935 return 0;
995936
996937 err:
@@ -1145,43 +1086,6 @@ static u64 svm_compute_tsc_offset(struct kvm_vcpu *vcpu, u64 target_tsc) · 148 unmodified lines
11451086 return target_tsc - tsc;
11461087 }
11471088
1148−static void svm_set_guest_pat(struct vcpu_svm *svm, u64 *g_pat)
1149−{
1150− struct kvm_vcpu *vcpu = &svm->vcpu;
1151−
1152− /* Unlike Intel, AMD takes the guest's CR0.CD into account.
1153− *
1154− * AMD does not have IPAT. To emulate it for the case of guests
1155− * with no assigned devices, just set everything to WB. If guests
1156− * have assigned devices, however, we cannot force WB for RAM
1157− * pages only, so use the guest PAT directly.
1158− */
1159− if (!kvm_arch_has_assigned_device(vcpu->kvm))
1160− *g_pat = 0x0606060606060606;
1161− else
1162− *g_pat = vcpu->arch.pat;
1163−}
1164−
1165−static u64 svm_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio)
1166−{
1167− u8 mtrr;
1168−
1169− /*
1170− * 1. MMIO: trust guest MTRR, so same as item 3.
1171− * 2. No passthrough: always map as WB, and force guest PAT to WB as well
1172− * 3. Passthrough: can't guarantee the result, try to trust guest.
1173− */
1174− if (!is_mmio && !kvm_arch_has_assigned_device(vcpu->kvm))
1175− return 0;
1176−
1177− if (!kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_CD_NW_CLEARED) &&
1178− kvm_read_cr0(vcpu) & X86_CR0_CD)
1179− return _PAGE_NOCACHE;
1180−
1181− mtrr = kvm_mtrr_get_guest_memory_type(vcpu, gfn);
1182− return mtrr2protval[mtrr];
1183−}
1184−
11851089 static void init_vmcb(struct vcpu_svm *svm, bool init_event)
11861090 {
11871091 struct vmcb_control_area *control = &svm->vmcb->control;
@@ -1278,7 +1182,6 @@ static void init_vmcb(struct vcpu_svm *svm, bool init_event) · 90 unmodified lines
12781182 clr_cr_intercept(svm, INTERCEPT_CR3_READ);
12791183 clr_cr_intercept(svm, INTERCEPT_CR3_WRITE);
12801184 save->g_pat = svm->vcpu.arch.pat;
1281− svm_set_guest_pat(svm, &save->g_pat);
12821185 save->cr3 = 0;
12831186 save->cr4 = 0;
12841187 }
@@ -1673,10 +1576,13 @@ static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) · 388 unmodified lines
16731576
16741577 if (!vcpu->fpu_active)
16751578 cr0 |= X86_CR0_TS;
1676−
1677− /* These are emulated via page tables. */
1678− cr0 &= ~(X86_CR0_CD | X86_CR0_NW);
1679−
1579+ /*
1580+ * re-enable caching here because the QEMU bios
1581+ * does not do it - this results in some delay at
1582+ * reboot
1583+ */
1584+ if (kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_CD_NW_CLEARED))
1585+ cr0 &= ~(X86_CR0_CD | X86_CR0_NW);
16801586 svm->vmcb->save.cr0 = cr0;
16811587 mark_dirty(svm->vmcb, VMCB_CR);
16821588 update_cr0_intercept(svm);
@@ -3351,16 +3257,6 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr) · 1668 unmodified lines
33513257 case MSR_VM_IGNNE:
33523258 vcpu_unimpl(vcpu, "unimplemented wrmsr: 0x%x data 0x%llx\n", ecx, data);
33533259 break;
3354− case MSR_IA32_CR_PAT:
3355− if (npt_enabled) {
3356− if (!kvm_mtrr_valid(vcpu, MSR_IA32_CR_PAT, data))
3357− return 1;
3358− vcpu->arch.pat = data;
3359− svm_set_guest_pat(svm, &svm->vmcb->save.g_pat);
3360− mark_dirty(svm->vmcb, VMCB_NPT);
3361− break;
3362− }
3363− /* fall through */
33643260 default:
33653261 return kvm_set_msr_common(vcpu, msr);
33663262 }
@@ -4195,6 +4091,11 @@ static bool svm_has_high_real_mode_segbase(void) · 828 unmodified lines
41954091 return true;
41964092 }
41974093
4094+static u64 svm_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio)
4095+{
4096+ return 0;
4097+}
4098+
41984099 static void svm_cpuid_update(struct kvm_vcpu *vcpu)
41994100 {
42004101 }
arch/x86/kvm/vmx.c+8−3
@@ -8617,17 +8617,22 @@ static u64 vmx_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio) · 8616 unmodified lines
86178617 u64 ipat = 0;
86188618
86198619 /* For VT-d and EPT combination
8620− * 1. MMIO: guest may want to apply WC, trust it.
8620+ * 1. MMIO: always map as UC
86218621 * 2. EPT with VT-d:
86228622 * a. VT-d without snooping control feature: can't guarantee the
8623− * result, try to trust guest. So the same as item 1.
8623+ * result, try to trust guest.
86248624 * b. VT-d with snooping control feature: snooping control feature of
86258625 * VT-d engine can guarantee the cache correctness. Just set it
86268626 * to WB to keep consistent with host. So the same as item 3.
86278627 * 3. EPT without VT-d: always map as WB and set IPAT=1 to keep
86288628 * consistent with host MTRR
86298629 */
8630− if (!is_mmio && !kvm_arch_has_noncoherent_dma(vcpu->kvm)) {
8630+ if (is_mmio) {
8631+ cache = MTRR_TYPE_UNCACHABLE;
8632+ goto exit;
8633+ }
8634+
8635+ if (!kvm_arch_has_noncoherent_dma(vcpu->kvm)) {
86318636 ipat = VMX_EPT_IPAT_BIT;
86328637 cache = MTRR_TYPE_WRBACK;
86338638 goto exit;
arch/x86/kvm/x86.c+0−4
@@ -1708,8 +1708,6 @@ static int kvm_guest_time_update(struct kvm_vcpu *v) · 1707 unmodified lines
17081708 vcpu->pvclock_set_guest_stopped_request = false;
17091709 }
17101710
1711− pvclock_flags |= PVCLOCK_COUNTS_FROM_ZERO;
1712−
17131711 /* If the host uses TSC clocksource, then it is stable */
17141712 if (use_master_clock)
17151713 pvclock_flags |= PVCLOCK_TSC_STABLE_BIT;
@@ -2007,8 +2005,6 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 291 unmodified lines
20072005 &vcpu->requests);
20082006
20092007 ka->boot_vcpu_runs_old_kvmclock = tmp;
2010−
2011− ka->kvmclock_offset = -get_kernel_ns();
20122008 }
20132009
20142010 vcpu->arch.time = data;
arch/x86/mm/init_64.c+1−1
@@ -1132,7 +1132,7 @@ void mark_rodata_ro(void) · 1131 unmodified lines
11321132 * has been zapped already via cleanup_highmem().
11331133 */
11341134 all_end = roundup((unsigned long)_brk_end, PMD_SIZE);
1135− set_memory_nx(rodata_start, (all_end - rodata_start) >> PAGE_SHIFT);
1135+ set_memory_nx(text_end, (all_end - text_end) >> PAGE_SHIFT);
11361136
11371137 rodata_test();
11381138
arch/x86/platform/efi/efi.c+66−1
@@ -704,6 +704,70 @@ out: · 703 unmodified lines
704704 return ret;
705705 }
706706
707+/*
708+ * Iterate the EFI memory map in reverse order because the regions
709+ * will be mapped top-down. The end result is the same as if we had
710+ * mapped things forward, but doesn't require us to change the
711+ * existing implementation of efi_map_region().
712+ */
713+static inline void *efi_map_next_entry_reverse(void *entry)
714+{
715+ /* Initial call */
716+ if (!entry)
717+ return memmap.map_end - memmap.desc_size;
718+
719+ entry -= memmap.desc_size;
720+ if (entry < memmap.map)
721+ return NULL;
722+
723+ return entry;
724+}
725+
726+/*
727+ * efi_map_next_entry - Return the next EFI memory map descriptor
728+ * @entry: Previous EFI memory map descriptor
729+ *
730+ * This is a helper function to iterate over the EFI memory map, which
731+ * we do in different orders depending on the current configuration.
732+ *
733+ * To begin traversing the memory map @entry must be %NULL.
734+ *
735+ * Returns %NULL when we reach the end of the memory map.
736+ */
737+static void *efi_map_next_entry(void *entry)
738+{
739+ if (!efi_enabled(EFI_OLD_MEMMAP) && efi_enabled(EFI_64BIT)) {
740+ /*
741+ * Starting in UEFI v2.5 the EFI_PROPERTIES_TABLE
742+ * config table feature requires us to map all entries
743+ * in the same order as they appear in the EFI memory
744+ * map. That is to say, entry N must have a lower
745+ * virtual address than entry N+1. This is because the
746+ * firmware toolchain leaves relative references in
747+ * the code/data sections, which are split and become
748+ * separate EFI memory regions. Mapping things
749+ * out-of-order leads to the firmware accessing
750+ * unmapped addresses.
751+ *
752+ * Since we need to map things this way whether or not
753+ * the kernel actually makes use of
754+ * EFI_PROPERTIES_TABLE, let's just switch to this
755+ * scheme by default for 64-bit.
756+ */
757+ return efi_map_next_entry_reverse(entry);
758+ }
759+
760+ /* Initial call */
761+ if (!entry)
762+ return memmap.map;
763+
764+ entry += memmap.desc_size;
765+ if (entry >= memmap.map_end)
766+ return NULL;
767+
768+ return entry;
769+}
770+
707771 /*
708772 * Map the efi memory ranges of the runtime services and update new_mmap with
709773 * virtual addresses.
@@ -714,7 +778,8 @@ static void * __init efi_map_regions(int *count, int *pg_shift) · 4 unmodified lines
714778 unsigned long left = 0;
715779 efi_memory_desc_t *md;
716780
717− for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
781+ p = NULL;
782+ while ((p = efi_map_next_entry(p))) {
718783 md = p;
719784 if (!(md->attribute & EFI_MEMORY_RUNTIME)) {
720785 #ifdef CONFIG_X86_64
arch/xtensa/include/asm/Kbuild+1−0
@@ -28,4 +28,5 @@ generic-y += statfs.h · 27 unmodified lines
2828 generic-y += termios.h
2929 generic-y += topology.h
3030 generic-y += trace_clock.h
31+generic-y += word-at-a-time.h
3132 generic-y += xor.h
block/blk-mq-cpumap.c+5−4
@@ -31,7 +31,8 @@ static int get_first_sibling(unsigned int cpu) · 30 unmodified lines
3131 return cpu;
3232 }
3333
34−int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues)
34+int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues,
35+ const struct cpumask *online_mask)
3536 {
3637 unsigned int i, nr_cpus, nr_uniq_cpus, queue, first_sibling;
3738 cpumask_var_t cpus;
@@ -41,7 +42,7 @@ int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues) · 3 unmodified lines
4142
4243 cpumask_clear(cpus);
4344 nr_cpus = nr_uniq_cpus = 0;
44− for_each_online_cpu(i) {
45+ for_each_cpu(i, online_mask) {
4546 nr_cpus++;
4647 first_sibling = get_first_sibling(i);
4748 if (!cpumask_test_cpu(first_sibling, cpus))
@@ -51,7 +52,7 @@ int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues) · 3 unmodified lines
5152
5253 queue = 0;
5354 for_each_possible_cpu(i) {
54− if (!cpu_online(i)) {
55+ if (!cpumask_test_cpu(i, online_mask)) {
5556 map[i] = 0;
5657 continue;
5758 }
@@ -95,7 +96,7 @@ unsigned int *blk_mq_make_queue_map(struct blk_mq_tag_set *set) · 37 unmodified lines
9596 if (!map)
9697 return NULL;
9798
98− if (!blk_mq_update_queue_map(map, set->nr_hw_queues))
99+ if (!blk_mq_update_queue_map(map, set->nr_hw_queues, cpu_online_mask))
99100 return map;
100101
101102 kfree(map);
block/blk-mq-sysfs.c+22−12
@@ -229,8 +229,6 @@ static ssize_t blk_mq_hw_sysfs_cpus_show(struct blk_mq_hw_ctx *hctx, char *page) · 228 unmodified lines
229229 unsigned int i, first = 1;
230230 ssize_t ret = 0;
231231
232− blk_mq_disable_hotplug();
233−
234232 for_each_cpu(i, hctx->cpumask) {
235233 if (first)
236234 ret += sprintf(ret + page, "%u", i);
@@ -240,8 +238,6 @@ static ssize_t blk_mq_hw_sysfs_cpus_show(struct blk_mq_hw_ctx *hctx, char *page) · 3 unmodified lines
240238 first = 0;
241239 }
242240
243− blk_mq_enable_hotplug();
244−
245241 ret += sprintf(ret + page, "\n");
246242 return ret;
247243 }
@@ -343,7 +339,7 @@ static void blk_mq_unregister_hctx(struct blk_mq_hw_ctx *hctx) · 95 unmodified lines
343339 struct blk_mq_ctx *ctx;
344340 int i;
345341
346− if (!hctx->nr_ctx || !(hctx->flags & BLK_MQ_F_SYSFS_UP))
342+ if (!hctx->nr_ctx)
347343 return;
348344
349345 hctx_for_each_ctx(hctx, ctx, i)
@@ -358,7 +354,7 @@ static int blk_mq_register_hctx(struct blk_mq_hw_ctx *hctx) · 8 unmodified lines
358354 struct blk_mq_ctx *ctx;
359355 int i, ret;
360356
361− if (!hctx->nr_ctx || !(hctx->flags & BLK_MQ_F_SYSFS_UP))
357+ if (!hctx->nr_ctx)
362358 return 0;
363359
364360 ret = kobject_add(&hctx->kobj, &q->mq_kobj, "%u", hctx->queue_num);
@@ -381,6 +377,8 @@ void blk_mq_unregister_disk(struct gendisk *disk) · 16 unmodified lines
381377 struct blk_mq_ctx *ctx;
382378 int i, j;
383379
380+ blk_mq_disable_hotplug();
381+
384382 queue_for_each_hw_ctx(q, hctx, i) {
385383 blk_mq_unregister_hctx(hctx);
386384
@@ -395,6 +393,9 @@ void blk_mq_unregister_disk(struct gendisk *disk) · 8 unmodified lines
395393 kobject_put(&q->mq_kobj);
396394
397395 kobject_put(&disk_to_dev(disk)->kobj);
396+
397+ q->mq_sysfs_init_done = false;
398+ blk_mq_enable_hotplug();
398399 }
399400
400401 static void blk_mq_sysfs_init(struct request_queue *q)
@@ -425,27 +426,30 @@ int blk_mq_register_disk(struct gendisk *disk) · 24 unmodified lines
425426 struct blk_mq_hw_ctx *hctx;
426427 int ret, i;
427428
429+ blk_mq_disable_hotplug();
430+
428431 blk_mq_sysfs_init(q);
429432
430433 ret = kobject_add(&q->mq_kobj, kobject_get(&dev->kobj), "%s", "mq");
431434 if (ret < 0)
432− return ret;
435+ goto out;
433436
434437 kobject_uevent(&q->mq_kobj, KOBJ_ADD);
435438
436439 queue_for_each_hw_ctx(q, hctx, i) {
437− hctx->flags |= BLK_MQ_F_SYSFS_UP;
438440 ret = blk_mq_register_hctx(hctx);
439441 if (ret)
440442 break;
441443 }
442444
443− if (ret) {
445+ if (ret)
444446 blk_mq_unregister_disk(disk);
445− return ret;
446− }
447+ else
448+ q->mq_sysfs_init_done = true;
449+out:
450+ blk_mq_enable_hotplug();
447451
448− return 0;
452+ return ret;
449453 }
450454 EXPORT_SYMBOL_GPL(blk_mq_register_disk);
451455
@@ -454,6 +458,9 @@ void blk_mq_sysfs_unregister(struct request_queue *q) · 2 unmodified lines
454458 struct blk_mq_hw_ctx *hctx;
455459 int i;
456460
461+ if (!q->mq_sysfs_init_done)
462+ return;
463+
457464 queue_for_each_hw_ctx(q, hctx, i)
458465 blk_mq_unregister_hctx(hctx);
459466 }
@@ -463,6 +470,9 @@ int blk_mq_sysfs_register(struct request_queue *q) · 3 unmodified lines
463470 struct blk_mq_hw_ctx *hctx;
464471 int i, ret = 0;
465472
473+ if (!q->mq_sysfs_init_done)
474+ return ret;
475+
466476 queue_for_each_hw_ctx(q, hctx, i) {
467477 ret = blk_mq_register_hctx(hctx);
468478 if (ret)
block/blk-mq-tag.c+20−7
@@ -471,17 +471,30 @@ void blk_mq_all_tag_busy_iter(struct blk_mq_tags *tags, busy_tag_iter_fn *fn, · 470 unmodified lines
471471 }
472472 EXPORT_SYMBOL(blk_mq_all_tag_busy_iter);
473473
474−void blk_mq_tag_busy_iter(struct blk_mq_hw_ctx *hctx, busy_iter_fn *fn,
474+void blk_mq_queue_tag_busy_iter(struct request_queue *q, busy_iter_fn *fn,
475475 void *priv)
476476 {
477− struct blk_mq_tags *tags = hctx->tags;
477+ struct blk_mq_hw_ctx *hctx;
478+ int i;
479+
480+
481+ queue_for_each_hw_ctx(q, hctx, i) {
482+ struct blk_mq_tags *tags = hctx->tags;
483+
484+ /*
485+ * If not software queues are currently mapped to this
486+ * hardware queue, there's nothing to check
487+ */
488+ if (!blk_mq_hw_queue_mapped(hctx))
489+ continue;
490+
491+ if (tags->nr_reserved_tags)
492+ bt_for_each(hctx, &tags->breserved_tags, 0, fn, priv, true);
493+ bt_for_each(hctx, &tags->bitmap_tags, tags->nr_reserved_tags, fn, priv,
494+ false);
495+ }
478496
479− if (tags->nr_reserved_tags)
480− bt_for_each(hctx, &tags->breserved_tags, 0, fn, priv, true);
481− bt_for_each(hctx, &tags->bitmap_tags, tags->nr_reserved_tags, fn, priv,
482− false);
483497 }
484−EXPORT_SYMBOL(blk_mq_tag_busy_iter);
485498
486499 static unsigned int bt_unused_tags(struct blk_mq_bitmap_tags *bt)
487500 {
block/blk-mq-tag.h+2−0
@@ -58,6 +58,8 @@ extern ssize_t blk_mq_tag_sysfs_show(struct blk_mq_tags *tags, char *page); · 57 unmodified lines
5858 extern void blk_mq_tag_init_last_tag(struct blk_mq_tags *tags, unsigned int *last_tag);
5959 extern int blk_mq_tag_update_depth(struct blk_mq_tags *tags, unsigned int depth);
6060 extern void blk_mq_tag_wakeup_all(struct blk_mq_tags *tags, bool);
61+void blk_mq_queue_tag_busy_iter(struct request_queue *q, busy_iter_fn *fn,
62+ void *priv);
6163
6264 enum {
6365 BLK_MQ_TAG_CACHE_MIN = 1,
block/blk-mq.c+77−41
@@ -393,14 +393,16 @@ void __blk_mq_complete_request(struct request *rq) · 392 unmodified lines
393393 * Ends all I/O on a request. It does not handle partial completions.
394394 * The actual completion happens out-of-order, through a IPI handler.
395395 **/
396−void blk_mq_complete_request(struct request *rq)
396+void blk_mq_complete_request(struct request *rq, int error)
397397 {
398398 struct request_queue *q = rq->q;
399399
400400 if (unlikely(blk_should_fake_timeout(q)))
401401 return;
402− if (!blk_mark_rq_complete(rq))
402+ if (!blk_mark_rq_complete(rq)) {
403+ rq->errors = error;
403404 __blk_mq_complete_request(rq);
405+ }
404406 }
405407 EXPORT_SYMBOL(blk_mq_complete_request);
406408
@@ -616,10 +618,8 @@ static void blk_mq_check_expired(struct blk_mq_hw_ctx *hctx, · 209 unmodified lines
616618 * If a request wasn't started before the queue was
617619 * marked dying, kill it here or it'll go unnoticed.
618620 */
619− if (unlikely(blk_queue_dying(rq->q))) {
620− rq->errors = -EIO;
621− blk_mq_complete_request(rq);
622− }
621+ if (unlikely(blk_queue_dying(rq->q)))
622+ blk_mq_complete_request(rq, -EIO);
623623 return;
624624 }
625625 if (rq->cmd_flags & REQ_NO_TIMEOUT)
@@ -641,24 +641,16 @@ static void blk_mq_rq_timer(unsigned long priv) · 15 unmodified lines
641641 .next = 0,
642642 .next_set = 0,
643643 };
644− struct blk_mq_hw_ctx *hctx;
645644 int i;
646645
647− queue_for_each_hw_ctx(q, hctx, i) {
648− /*
649− * If not software queues are currently mapped to this
650− * hardware queue, there's nothing to check
651− */
652− if (!blk_mq_hw_queue_mapped(hctx))
653− continue;
654−
655− blk_mq_tag_busy_iter(hctx, blk_mq_check_expired, &data);
656− }
646+ blk_mq_queue_tag_busy_iter(q, blk_mq_check_expired, &data);
657647
658648 if (data.next_set) {
659649 data.next = blk_rq_timeout(round_jiffies_up(data.next));
660650 mod_timer(&q->timeout, data.next);
661651 } else {
652+ struct blk_mq_hw_ctx *hctx;
653+
662654 queue_for_each_hw_ctx(q, hctx, i) {
663655 /* the hctx may be unmapped, so check it here */
664656 if (blk_mq_hw_queue_mapped(hctx))
@@ -1789,13 +1781,19 @@ static void blk_mq_init_cpu_queues(struct request_queue *q, · 1124 unmodified lines
17891781 }
17901782 }
17911783
1792−static void blk_mq_map_swqueue(struct request_queue *q)
1784+static void blk_mq_map_swqueue(struct request_queue *q,
1785+ const struct cpumask *online_mask)
17931786 {
17941787 unsigned int i;
17951788 struct blk_mq_hw_ctx *hctx;
17961789 struct blk_mq_ctx *ctx;
17971790 struct blk_mq_tag_set *set = q->tag_set;
17981791
1792+ /*
1793+ * Avoid others reading imcomplete hctx->cpumask through sysfs
1794+ */
1795+ mutex_lock(&q->sysfs_lock);
1796+
17991797 queue_for_each_hw_ctx(q, hctx, i) {
18001798 cpumask_clear(hctx->cpumask);
18011799 hctx->nr_ctx = 0;
@@ -1806,16 +1804,17 @@ static void blk_mq_map_swqueue(struct request_queue *q) · 4 unmodified lines
18061804 */
18071805 queue_for_each_ctx(q, ctx, i) {
18081806 /* If the cpu isn't online, the cpu is mapped to first hctx */
1809− if (!cpu_online(i))
1807+ if (!cpumask_test_cpu(i, online_mask))
18101808 continue;
18111809
18121810 hctx = q->mq_ops->map_queue(q, i);
18131811 cpumask_set_cpu(i, hctx->cpumask);
1814− cpumask_set_cpu(i, hctx->tags->cpumask);
18151812 ctx->index_hw = hctx->nr_ctx;
18161813 hctx->ctxs[hctx->nr_ctx++] = ctx;
18171814 }
18181815
1816+ mutex_unlock(&q->sysfs_lock);
1817+
18191818 queue_for_each_hw_ctx(q, hctx, i) {
18201819 struct blk_mq_ctxmap *map = &hctx->ctx_map;
18211820
@@ -1851,6 +1850,14 @@ static void blk_mq_map_swqueue(struct request_queue *q) · 29 unmodified lines
18511850 hctx->next_cpu = cpumask_first(hctx->cpumask);
18521851 hctx->next_cpu_batch = BLK_MQ_CPU_WORK_BATCH;
18531852 }
1853+
1854+ queue_for_each_ctx(q, ctx, i) {
1855+ if (!cpumask_test_cpu(i, online_mask))
1856+ continue;
1857+
1858+ hctx = q->mq_ops->map_queue(q, i);
1859+ cpumask_set_cpu(i, hctx->tags->cpumask);
1860+ }
18541861 }
18551862
18561863 static void blk_mq_update_tag_set_depth(struct blk_mq_tag_set *set)
@@ -1918,6 +1925,9 @@ void blk_mq_release(struct request_queue *q) · 61 unmodified lines
19181925 kfree(hctx);
19191926 }
19201927
1928+ kfree(q->mq_map);
1929+ q->mq_map = NULL;
1930+
19211931 kfree(q->queue_hw_ctx);
19221932
19231933 /* ctx kobj stays in queue_ctx */
@@ -2027,13 +2037,15 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set, · 103 unmodified lines
20272037 if (blk_mq_init_hw_queues(q, set))
20282038 goto err_hctxs;
20292039
2040+ get_online_cpus();
20302041 mutex_lock(&all_q_mutex);
2031− list_add_tail(&q->all_q_node, &all_q_list);
2032− mutex_unlock(&all_q_mutex);
20332042
2043+ list_add_tail(&q->all_q_node, &all_q_list);
20342044 blk_mq_add_queue_tag_set(set, q);
2045+ blk_mq_map_swqueue(q, cpu_online_mask);
20352046
2036− blk_mq_map_swqueue(q);
2047+ mutex_unlock(&all_q_mutex);
2048+ put_online_cpus();
20372049
20382050 return q;
20392051
@@ -2057,30 +2069,27 @@ void blk_mq_free_queue(struct request_queue *q) · 17 unmodified lines
20572069 {
20582070 struct blk_mq_tag_set *set = q->tag_set;
20592071
2072+ mutex_lock(&all_q_mutex);
2073+ list_del_init(&q->all_q_node);
2074+ mutex_unlock(&all_q_mutex);
2075+
20602076 blk_mq_del_queue_tag_set(q);
20612077
20622078 blk_mq_exit_hw_queues(q, set, set->nr_hw_queues);
20632079 blk_mq_free_hw_queues(q, set);
20642080
20652081 percpu_ref_exit(&q->mq_usage_counter);
2066−
2067− kfree(q->mq_map);
2068−
2069− q->mq_map = NULL;
2070−
2071− mutex_lock(&all_q_mutex);
2072− list_del_init(&q->all_q_node);
2073− mutex_unlock(&all_q_mutex);
20742082 }
20752083
20762084 /* Basically redo blk_mq_init_queue with queue frozen */
2077−static void blk_mq_queue_reinit(struct request_queue *q)
2085+static void blk_mq_queue_reinit(struct request_queue *q,
2086+ const struct cpumask *online_mask)
20782087 {
20792088 WARN_ON_ONCE(!atomic_read(&q->mq_freeze_depth));
20802089
20812090 blk_mq_sysfs_unregister(q);
20822091
2083− blk_mq_update_queue_map(q->mq_map, q->nr_hw_queues);
2092+ blk_mq_update_queue_map(q->mq_map, q->nr_hw_queues, online_mask);
20842093
20852094 /*
20862095 * redo blk_mq_init_cpu_queues and blk_mq_init_hw_queues. FIXME: maybe
@@ -2088,7 +2097,7 @@ static void blk_mq_queue_reinit(struct request_queue *q) · 1 unmodified line
20882097 * involves free and re-allocate memory, worthy doing?)
20892098 */
20902099
2091− blk_mq_map_swqueue(q);
2100+ blk_mq_map_swqueue(q, online_mask);
20922101
20932102 blk_mq_sysfs_register(q);
20942103 }
@@ -2097,16 +2106,43 @@ static int blk_mq_queue_reinit_notify(struct notifier_block *nb, · 2 unmodified lines
20972106 unsigned long action, void *hcpu)
20982107 {
20992108 struct request_queue *q;
2109+ int cpu = (unsigned long)hcpu;
2110+ /*
2111+ * New online cpumask which is going to be set in this hotplug event.
2112+ * Declare this cpumasks as global as cpu-hotplug operation is invoked
2113+ * one-by-one and dynamically allocating this could result in a failure.
2114+ */
2115+ static struct cpumask online_new;
21002116
21012117 /*
2102− * Before new mappings are established, hotadded cpu might already
2103− * start handling requests. This doesn't break anything as we map
2104− * offline CPUs to first hardware queue. We will re-init the queue
2105− * below to get optimal settings.
2118+ * Before hotadded cpu starts handling requests, new mappings must
2119+ * be established. Otherwise, these requests in hw queue might
2120+ * never be dispatched.
2121+ *
2122+ * For example, there is a single hw queue (hctx) and two CPU queues
2123+ * (ctx0 for CPU0, and ctx1 for CPU1).
2124+ *
2125+ * Now CPU1 is just onlined and a request is inserted into
2126+ * ctx1->rq_list and set bit0 in pending bitmap as ctx1->index_hw is
2127+ * still zero.
2128+ *
2129+ * And then while running hw queue, flush_busy_ctxs() finds bit0 is
2130+ * set in pending bitmap and tries to retrieve requests in
2131+ * hctx->ctxs[0]->rq_list. But htx->ctxs[0] is a pointer to ctx0,
2132+ * so the request in ctx1->rq_list is ignored.
21062133 */
2107− if (action != CPU_DEAD && action != CPU_DEAD_FROZEN &&
2108− action != CPU_ONLINE && action != CPU_ONLINE_FROZEN)
2134+ switch (action & ~CPU_TASKS_FROZEN) {
2135+ case CPU_DEAD:
2136+ case CPU_UP_CANCELED:
2137+ cpumask_copy(&online_new, cpu_online_mask);
2138+ break;
2139+ case CPU_UP_PREPARE:
2140+ cpumask_copy(&online_new, cpu_online_mask);
2141+ cpumask_set_cpu(cpu, &online_new);
2142+ break;
2143+ default:
21092144 return NOTIFY_OK;
2145+ }
21102146
21112147 mutex_lock(&all_q_mutex);
21122148
@@ -2130,7 +2166,7 @@ static int blk_mq_queue_reinit_notify(struct notifier_block *nb, · 17 unmodified lines
21302166 }
21312167
21322168 list_for_each_entry(q, &all_q_list, all_q_node)
2133− blk_mq_queue_reinit(q);
2169+ blk_mq_queue_reinit(q, &online_new);
21342170
21352171 list_for_each_entry(q, &all_q_list, all_q_node)
21362172 blk_mq_unfreeze_queue(q);
block/blk-mq.h+2−1
@@ -51,7 +51,8 @@ void blk_mq_disable_hotplug(void); · 50 unmodified lines
5151 * CPU -> queue mappings
5252 */
5353 extern unsigned int *blk_mq_make_queue_map(struct blk_mq_tag_set *set);
54−extern int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues);
54+extern int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues,
55+ const struct cpumask *online_mask);
5556 extern int blk_mq_hw_queue_to_node(unsigned int *map, unsigned int);
5657
5758 /*
crypto/asymmetric_keys/x509_public_key.c+0−4
@@ -332,10 +332,6 @@ static int x509_key_preparse(struct key_preparsed_payload *prep) · 331 unmodified lines
332332 srlen = cert->raw_serial_size;
333333 q = cert->raw_serial;
334334 }
335− if (srlen > 1 && *q == 0) {
336− srlen--;
337− q++;
338− }
339335
340336 ret = -ENOMEM;
341337 desc = kmalloc(sulen + 2 + srlen * 2 + 1, GFP_KERNEL);
drivers/acpi/ec.c+2−0
@@ -1044,8 +1044,10 @@ static int acpi_ec_query(struct acpi_ec *ec, u8 *data) · 1043 unmodified lines
10441044 goto err_exit;
10451045
10461046 mutex_lock(&ec->mutex);
1047+ result = -ENODATA;
10471048 list_for_each_entry(handler, &ec->list, node) {
10481049 if (value == handler->query_bit) {
1050+ result = 0;
10491051 q->handler = acpi_ec_get_query_handler(handler);
10501052 ec_dbg_evt("Query(0x%02x) scheduled",
10511053 q->handler->query_bit);
drivers/acpi/pci_irq.c+1−0
@@ -372,6 +372,7 @@ static int acpi_isa_register_gsi(struct pci_dev *dev) · 371 unmodified lines
372372
373373 /* Interrupt Line values above 0xF are forbidden */
374374 if (dev->irq > 0 && (dev->irq <= 0xF) &&
375+ acpi_isa_irq_available(dev->irq) &&
375376 (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
376377 dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
377378 pin_name(dev->pin), dev->irq);
drivers/acpi/pci_link.c+14−2
@@ -498,8 +498,7 @@ int __init acpi_irq_penalty_init(void) · 497 unmodified lines
498498 PIRQ_PENALTY_PCI_POSSIBLE;
499499 }
500500 }
501− /* Add a penalty for the SCI */
502− acpi_irq_penalty[acpi_gbl_FADT.sci_interrupt] += PIRQ_PENALTY_PCI_USING;
501+
503502 return 0;
504503 }
505504
@@ -553,6 +552,13 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link) · 47 unmodified lines
553552 irq = link->irq.possible[i];
554553 }
555554 }
555+ if (acpi_irq_penalty[irq] >= PIRQ_PENALTY_ISA_ALWAYS) {
556+ printk(KERN_ERR PREFIX "No IRQ available for %s [%s]. "
557+ "Try pci=noacpi or acpi=off\n",
558+ acpi_device_name(link->device),
559+ acpi_device_bid(link->device));
560+ return -ENODEV;
561+ }
556562
557563 /* Attempt to enable the link device at this IRQ. */
558564 if (acpi_pci_link_set(link, irq)) {
@@ -821,6 +827,12 @@ void acpi_penalize_isa_irq(int irq, int active) · 262 unmodified lines
821827 }
822828 }
823829
830+bool acpi_isa_irq_available(int irq)
831+{
832+ return irq >= 0 && (irq >= ARRAY_SIZE(acpi_irq_penalty) ||
833+ acpi_irq_penalty[irq] < PIRQ_PENALTY_ISA_ALWAYS);
834+}
835+
824836 /*
825837 * Penalize IRQ used by ACPI SCI. If ACPI SCI pin attributes conflict with
826838 * PCI IRQ attributes, mark ACPI SCI as ISA_ALWAYS so it won't be use for
drivers/base/power/opp.c+12−5
@@ -892,10 +892,17 @@ static int opp_get_microvolt(struct dev_pm_opp *opp, struct device *dev) · 891 unmodified lines
892892 u32 microvolt[3] = {0};
893893 int count, ret;
894894
895− count = of_property_count_u32_elems(opp->np, "opp-microvolt");
896− if (!count)
895+ /* Missing property isn't a problem, but an invalid entry is */
896+ if (!of_find_property(opp->np, "opp-microvolt", NULL))
897897 return 0;
898898
899+ count = of_property_count_u32_elems(opp->np, "opp-microvolt");
900+ if (count < 0) {
901+ dev_err(dev, "%s: Invalid opp-microvolt property (%d)\n",
902+ __func__, count);
903+ return count;
904+ }
905+
899906 /* There can be one or three elements here */
900907 if (count != 1 && count != 3) {
901908 dev_err(dev, "%s: Invalid number of elements in opp-microvolt property (%d)\n",
@@ -1063,7 +1070,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_add); · 161 unmodified lines
10631070 * share a common logic which is isolated here.
10641071 *
10651072 * Return: -EINVAL for bad pointers, -ENOMEM if no memory available for the
1066− * copy operation, returns 0 if no modifcation was done OR modification was
1073+ * copy operation, returns 0 if no modification was done OR modification was
10671074 * successful.
10681075 *
10691076 * Locking: The internal device_opp and opp structures are RCU protected.
@@ -1151,7 +1158,7 @@ unlock: · 81 unmodified lines
11511158 * mutex locking or synchronize_rcu() blocking calls cannot be used.
11521159 *
11531160 * Return: -EINVAL for bad pointers, -ENOMEM if no memory available for the
1154− * copy operation, returns 0 if no modifcation was done OR modification was
1161+ * copy operation, returns 0 if no modification was done OR modification was
11551162 * successful.
11561163 */
11571164 int dev_pm_opp_enable(struct device *dev, unsigned long freq)
@@ -1177,7 +1184,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_enable); · 19 unmodified lines
11771184 * mutex locking or synchronize_rcu() blocking calls cannot be used.
11781185 *
11791186 * Return: -EINVAL for bad pointers, -ENOMEM if no memory available for the
1180− * copy operation, returns 0 if no modifcation was done OR modification was
1187+ * copy operation, returns 0 if no modification was done OR modification was
11811188 * successful.
11821189 */
11831190 int dev_pm_opp_disable(struct device *dev, unsigned long freq)
drivers/block/loop.c+5−6
@@ -1486,17 +1486,16 @@ static void loop_handle_cmd(struct loop_cmd *cmd) · 1485 unmodified lines
14861486 {
14871487 const bool write = cmd->rq->cmd_flags & REQ_WRITE;
14881488 struct loop_device *lo = cmd->rq->q->queuedata;
1489− int ret = -EIO;
1489+ int ret = 0;
14901490
1491− if (write && (lo->lo_flags & LO_FLAGS_READ_ONLY))
1491+ if (write && (lo->lo_flags & LO_FLAGS_READ_ONLY)) {
1492+ ret = -EIO;
14921493 goto failed;
1494+ }
14931495
14941496 ret = do_req_filebacked(lo, cmd->rq);
1495−
14961497 failed:
1497− if (ret)
1498− cmd->rq->errors = -EIO;
1499− blk_mq_complete_request(cmd->rq);
1498+ blk_mq_complete_request(cmd->rq, ret ? -EIO : 0);
15001499 }
15011500
15021501 static void loop_queue_write_work(struct work_struct *work)
drivers/block/null_blk.c+1−1
@@ -289,7 +289,7 @@ static inline void null_handle_cmd(struct nullb_cmd *cmd) · 288 unmodified lines
289289 case NULL_IRQ_SOFTIRQ:
290290 switch (queue_mode) {
291291 case NULL_Q_MQ:
292− blk_mq_complete_request(cmd->rq);
292+ blk_mq_complete_request(cmd->rq, cmd->rq->errors);
293293 break;
294294 case NULL_Q_RQ:
295295 blk_complete_request(cmd->rq);
drivers/block/nvme-core.c+24−28
@@ -618,16 +618,15 @@ static void req_completion(struct nvme_queue *nvmeq, void *ctx, · 617 unmodified lines
618618 spin_unlock_irqrestore(req->q->queue_lock, flags);
619619 return;
620620 }
621+
621622 if (req->cmd_type == REQ_TYPE_DRV_PRIV) {
622623 if (cmd_rq->ctx == CMD_CTX_CANCELLED)
623− req->errors = -EINTR;
624− else
625− req->errors = status;
624+ status = -EINTR;
626625 } else {
627− req->errors = nvme_error_status(status);
626+ status = nvme_error_status(status);
628627 }
629− } else
630− req->errors = 0;
628+ }
629+
631630 if (req->cmd_type == REQ_TYPE_DRV_PRIV) {
632631 u32 result = le32_to_cpup(&cqe->result);
633632 req->special = (void *)(uintptr_t)result;
@@ -650,7 +649,7 @@ static void req_completion(struct nvme_queue *nvmeq, void *ctx, · 16 unmodified lines
650649 }
651650 nvme_free_iod(nvmeq->dev, iod);
652651
653− blk_mq_complete_request(req);
652+ blk_mq_complete_request(req, status);
654653 }
655654
656655 /* length is in bytes. gfp flags indicates whether we may sleep. */
@@ -863,8 +862,7 @@ static int nvme_queue_rq(struct blk_mq_hw_ctx *hctx, · 206 unmodified lines
863862 if (ns && ns->ms && !blk_integrity_rq(req)) {
864863 if (!(ns->pi_type && ns->ms == 8) &&
865864 req->cmd_type != REQ_TYPE_DRV_PRIV) {
866− req->errors = -EFAULT;
867− blk_mq_complete_request(req);
865+ blk_mq_complete_request(req, -EFAULT);
868866 return BLK_MQ_RQ_QUEUE_OK;
869867 }
870868 }
@@ -2439,6 +2437,22 @@ static void nvme_scan_namespaces(struct nvme_dev *dev, unsigned nn) · 1568 unmodified lines
24392437 list_sort(NULL, &dev->namespaces, ns_cmp);
24402438 }
24412439
2440+static void nvme_set_irq_hints(struct nvme_dev *dev)
2441+{
2442+ struct nvme_queue *nvmeq;
2443+ int i;
2444+
2445+ for (i = 0; i < dev->online_queues; i++) {
2446+ nvmeq = dev->queues[i];
2447+
2448+ if (!nvmeq->tags || !(*nvmeq->tags))
2449+ continue;
2450+
2451+ irq_set_affinity_hint(dev->entry[nvmeq->cq_vector].vector,
2452+ blk_mq_tags_cpumask(*nvmeq->tags));
2453+ }
2454+}
2455+
24422456 static void nvme_dev_scan(struct work_struct *work)
24432457 {
24442458 struct nvme_dev *dev = container_of(work, struct nvme_dev, scan_work);
@@ -2450,6 +2464,7 @@ static void nvme_dev_scan(struct work_struct *work) · 5 unmodified lines
24502464 return;
24512465 nvme_scan_namespaces(dev, le32_to_cpup(&ctrl->nn));
24522466 kfree(ctrl);
2467+ nvme_set_irq_hints(dev);
24532468 }
24542469
24552470 /*
@@ -2953,22 +2968,6 @@ static const struct file_operations nvme_dev_fops = { · 497 unmodified lines
29532968 .compat_ioctl = nvme_dev_ioctl,
29542969 };
29552970
2956−static void nvme_set_irq_hints(struct nvme_dev *dev)
2957−{
2958− struct nvme_queue *nvmeq;
2959− int i;
2960−
2961− for (i = 0; i < dev->online_queues; i++) {
2962− nvmeq = dev->queues[i];
2963−
2964− if (!nvmeq->tags || !(*nvmeq->tags))
2965− continue;
2966−
2967− irq_set_affinity_hint(dev->entry[nvmeq->cq_vector].vector,
2968− blk_mq_tags_cpumask(*nvmeq->tags));
2969− }
2970−}
2971−
29722971 static int nvme_dev_start(struct nvme_dev *dev)
29732972 {
29742973 int result;
@@ -3010,8 +3009,6 @@ static int nvme_dev_start(struct nvme_dev *dev) · 35 unmodified lines
30103009 if (result)
30113010 goto free_tags;
30123011
3013− nvme_set_irq_hints(dev);
3014−
30153012 dev->event_limit = 1;
30163013 return result;
30173014
@@ -3062,7 +3059,6 @@ static int nvme_dev_resume(struct nvme_dev *dev) · 44 unmodified lines
30623059 } else {
30633060 nvme_unfreeze_queues(dev);
30643061 nvme_dev_add(dev);
3065− nvme_set_irq_hints(dev);
30663062 }
30673063 return 0;
30683064 }
drivers/block/virtio_blk.c+1−1
@@ -144,7 +144,7 @@ static void virtblk_done(struct virtqueue *vq) · 143 unmodified lines
144144 do {
145145 virtqueue_disable_cb(vq);
146146 while ((vbr = virtqueue_get_buf(vblk->vqs[qid].vq, &len)) != NULL) {
147− blk_mq_complete_request(vbr->req);
147+ blk_mq_complete_request(vbr->req, vbr->req->errors);
148148 req_done = true;
149149 }
150150 if (unlikely(virtqueue_is_broken(vq)))
drivers/block/xen-blkback/xenbus.c+20−18
@@ -212,6 +212,9 @@ static int xen_blkif_map(struct xen_blkif *blkif, grant_ref_t *gref, · 211 unmodified lines
212212
213213 static int xen_blkif_disconnect(struct xen_blkif *blkif)
214214 {
215+ struct pending_req *req, *n;
216+ int i = 0, j;
217+
215218 if (blkif->xenblkd) {
216219 kthread_stop(blkif->xenblkd);
217220 wake_up(&blkif->shutdown_wq);
@@ -238,13 +241,28 @@ static int xen_blkif_disconnect(struct xen_blkif *blkif) · 20 unmodified lines
238241 /* Remove all persistent grants and the cache of ballooned pages. */
239242 xen_blkbk_free_caches(blkif);
240243
244+ /* Check that there is no request in use */
245+ list_for_each_entry_safe(req, n, &blkif->pending_free, free_list) {
246+ list_del(&req->free_list);
247+
248+ for (j = 0; j < MAX_INDIRECT_SEGMENTS; j++)
249+ kfree(req->segments[j]);
250+
251+ for (j = 0; j < MAX_INDIRECT_PAGES; j++)
252+ kfree(req->indirect_pages[j]);
253+
254+ kfree(req);
255+ i++;
256+ }
257+
258+ WARN_ON(i != (XEN_BLKIF_REQS_PER_PAGE * blkif->nr_ring_pages));
259+ blkif->nr_ring_pages = 0;
260+
241261 return 0;
242262 }
243263
244264 static void xen_blkif_free(struct xen_blkif *blkif)
245265 {
246− struct pending_req *req, *n;
247− int i = 0, j;
248266
249267 xen_blkif_disconnect(blkif);
250268 xen_vbd_free(&blkif->vbd);
@@ -257,22 +275,6 @@ static void xen_blkif_free(struct xen_blkif *blkif) · 6 unmodified lines
257275 BUG_ON(!list_empty(&blkif->free_pages));
258276 BUG_ON(!RB_EMPTY_ROOT(&blkif->persistent_gnts));
259277
260− /* Check that there is no request in use */
261− list_for_each_entry_safe(req, n, &blkif->pending_free, free_list) {
262− list_del(&req->free_list);
263−
264− for (j = 0; j < MAX_INDIRECT_SEGMENTS; j++)
265− kfree(req->segments[j]);
266−
267− for (j = 0; j < MAX_INDIRECT_PAGES; j++)
268− kfree(req->indirect_pages[j]);
269−
270− kfree(req);
271− i++;
272− }
273−
274− WARN_ON(i != (XEN_BLKIF_REQS_PER_PAGE * blkif->nr_ring_pages));
275−
276278 kmem_cache_free(xen_blkif_cachep, blkif);
277279 }
278280
drivers/block/xen-blkfront.c+10−9
@@ -1142,6 +1142,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) · 1141 unmodified lines
11421142 RING_IDX i, rp;
11431143 unsigned long flags;
11441144 struct blkfront_info *info = (struct blkfront_info *)dev_id;
1145+ int error;
11451146
11461147 spin_lock_irqsave(&info->io_lock, flags);
11471148
@@ -1182,37 +1183,37 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) · 34 unmodified lines
11821183 continue;
11831184 }
11841185
1185− req->errors = (bret->status == BLKIF_RSP_OKAY) ? 0 : -EIO;
1186+ error = (bret->status == BLKIF_RSP_OKAY) ? 0 : -EIO;
11861187 switch (bret->operation) {
11871188 case BLKIF_OP_DISCARD:
11881189 if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) {
11891190 struct request_queue *rq = info->rq;
11901191 printk(KERN_WARNING "blkfront: %s: %s op failed\n",
11911192 info->gd->disk_name, op_name(bret->operation));
1192− req->errors = -EOPNOTSUPP;
1193+ error = -EOPNOTSUPP;
11931194 info->feature_discard = 0;
11941195 info->feature_secdiscard = 0;
11951196 queue_flag_clear(QUEUE_FLAG_DISCARD, rq);
11961197 queue_flag_clear(QUEUE_FLAG_SECDISCARD, rq);
11971198 }
1198− blk_mq_complete_request(req);
1199+ blk_mq_complete_request(req, error);
11991200 break;
12001201 case BLKIF_OP_FLUSH_DISKCACHE:
12011202 case BLKIF_OP_WRITE_BARRIER:
12021203 if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) {
12031204 printk(KERN_WARNING "blkfront: %s: %s op failed\n",
12041205 info->gd->disk_name, op_name(bret->operation));
1205− req->errors = -EOPNOTSUPP;
1206+ error = -EOPNOTSUPP;
12061207 }
12071208 if (unlikely(bret->status == BLKIF_RSP_ERROR &&
12081209 info->shadow[id].req.u.rw.nr_segments == 0)) {
12091210 printk(KERN_WARNING "blkfront: %s: empty %s op failed\n",
12101211 info->gd->disk_name, op_name(bret->operation));
1211− req->errors = -EOPNOTSUPP;
1212+ error = -EOPNOTSUPP;
12121213 }
1213− if (unlikely(req->errors)) {
1214− if (req->errors == -EOPNOTSUPP)
1215− req->errors = 0;
1214+ if (unlikely(error)) {
1215+ if (error == -EOPNOTSUPP)
1216+ error = 0;
12161217 info->feature_flush = 0;
12171218 xlvbd_flush(info);
12181219 }
@@ -1223,7 +1224,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) · 4 unmodified lines
12231224 dev_dbg(&info->xbdev->dev, "Bad return from blkdev data "
12241225 "request: %x\n", bret->status);
12251226
1226− blk_mq_complete_request(req);
1227+ blk_mq_complete_request(req, error);
12271228 break;
12281229 default:
12291230 BUG();
drivers/clocksource/rockchip_timer.c+1−1
@@ -148,7 +148,7 @@ static void __init rk_timer_init(struct device_node *np) · 147 unmodified lines
148148 bc_timer.freq = clk_get_rate(timer_clk);
149149
150150 irq = irq_of_parse_and_map(np, 0);
151− if (irq == NO_IRQ) {
151+ if (!irq) {
152152 pr_err("Failed to map interrupts for '%s'\n", TIMER_NAME);
153153 return;
154154 }
drivers/clocksource/timer-keystone.c+1−1
@@ -152,7 +152,7 @@ static void __init keystone_timer_init(struct device_node *np) · 151 unmodified lines
152152 int irq, error;
153153
154154 irq = irq_of_parse_and_map(np, 0);
155− if (irq == NO_IRQ) {
155+ if (!irq) {
156156 pr_err("%s: failed to map interrupts\n", __func__);
157157 return;
158158 }
drivers/dma/at_xdmac.c+12−3
@@ -455,6 +455,15 @@ static struct at_xdmac_desc *at_xdmac_alloc_desc(struct dma_chan *chan, · 454 unmodified lines
455455 return desc;
456456 }
457457
458+void at_xdmac_init_used_desc(struct at_xdmac_desc *desc)
459+{
460+ memset(&desc->lld, 0, sizeof(desc->lld));
461+ INIT_LIST_HEAD(&desc->descs_list);
462+ desc->direction = DMA_TRANS_NONE;
463+ desc->xfer_size = 0;
464+ desc->active_xfer = false;
465+}
466+
458467 /* Call must be protected by lock. */
459468 static struct at_xdmac_desc *at_xdmac_get_desc(struct at_xdmac_chan *atchan)
460469 {
@@ -466,7 +475,7 @@ static struct at_xdmac_desc *at_xdmac_get_desc(struct at_xdmac_chan *atchan) · 5 unmodified lines
466475 desc = list_first_entry(&atchan->free_descs_list,
467476 struct at_xdmac_desc, desc_node);
468477 list_del(&desc->desc_node);
469− desc->active_xfer = false;
478+ at_xdmac_init_used_desc(desc);
470479 }
471480
472481 return desc;
@@ -875,14 +884,14 @@ at_xdmac_interleaved_queue_desc(struct dma_chan *chan, · 402 unmodified lines
875884
876885 if (xt->src_inc) {
877886 if (xt->src_sgl)
878− chan_cc |= AT_XDMAC_CC_SAM_UBS_DS_AM;
887+ chan_cc |= AT_XDMAC_CC_SAM_UBS_AM;
879888 else
880889 chan_cc |= AT_XDMAC_CC_SAM_INCREMENTED_AM;
881890 }
882891
883892 if (xt->dst_inc) {
884893 if (xt->dst_sgl)
885− chan_cc |= AT_XDMAC_CC_DAM_UBS_DS_AM;
894+ chan_cc |= AT_XDMAC_CC_DAM_UBS_AM;
886895 else
887896 chan_cc |= AT_XDMAC_CC_DAM_INCREMENTED_AM;
888897 }
drivers/dma/dmaengine.c+9−1
@@ -554,10 +554,18 @@ struct dma_chan *dma_get_slave_channel(struct dma_chan *chan) · 553 unmodified lines
554554 mutex_lock(&dma_list_mutex);
555555
556556 if (chan->client_count == 0) {
557+ struct dma_device *device = chan->device;
558+
559+ dma_cap_set(DMA_PRIVATE, device->cap_mask);
560+ device->privatecnt++;
557561 err = dma_chan_get(chan);
558− if (err)
562+ if (err) {
559563 pr_debug("%s: failed to get %s: (%d)\n",
560564 __func__, dma_chan_name(chan), err);
565+ chan = NULL;
566+ if (--device->privatecnt == 0)
567+ dma_cap_clear(DMA_PRIVATE, device->cap_mask);
568+ }
561569 } else
562570 chan = NULL;
563571
drivers/dma/dw/core.c+2−2
@@ -1591,7 +1591,6 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata) · 1590 unmodified lines
15911591 INIT_LIST_HEAD(&dw->dma.channels);
15921592 for (i = 0; i < nr_channels; i++) {
15931593 struct dw_dma_chan *dwc = &dw->chan[i];
1594− int r = nr_channels - i - 1;
15951594
15961595 dwc->chan.device = &dw->dma;
15971596 dma_cookie_init(&dwc->chan);
@@ -1603,7 +1602,7 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata) · 5 unmodified lines
16031602
16041603 /* 7 is highest priority & 0 is lowest. */
16051604 if (pdata->chan_priority == CHAN_PRIORITY_ASCENDING)
1606− dwc->priority = r;
1605+ dwc->priority = nr_channels - i - 1;
16071606 else
16081607 dwc->priority = i;
16091608
@@ -1622,6 +1621,7 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata) · 12 unmodified lines
16221621 /* Hardware configuration */
16231622 if (autocfg) {
16241623 unsigned int dwc_params;
1624+ unsigned int r = DW_DMA_MAX_NR_CHANNELS - i - 1;
16251625 void __iomem *addr = chip->regs + r * sizeof(u32);
16261626
16271627 dwc_params = dma_read_byaddr(addr, DWC_PARAMS);
drivers/dma/idma64.c+8−8
@@ -355,23 +355,23 @@ static size_t idma64_active_desc_size(struct idma64_chan *idma64c) · 354 unmodified lines
355355 struct idma64_desc *desc = idma64c->desc;
356356 struct idma64_hw_desc *hw;
357357 size_t bytes = desc->length;
358− u64 llp;
359− u32 ctlhi;
358+ u64 llp = channel_readq(idma64c, LLP);
359+ u32 ctlhi = channel_readl(idma64c, CTL_HI);
360360 unsigned int i = 0;
361361
362− llp = channel_readq(idma64c, LLP);
363362 do {
364363 hw = &desc->hw[i];
365− } while ((hw->llp != llp) && (++i < desc->ndesc));
364+ if (hw->llp == llp)
365+ break;
366+ bytes -= hw->len;
367+ } while (++i < desc->ndesc);
366368
367369 if (!i)
368370 return bytes;
369371
370− do {
371− bytes -= desc->hw[--i].len;
372− } while (i);
372+ /* The current chunk is not fully transfered yet */
373+ bytes += desc->hw[--i].len;
373374
374− ctlhi = channel_readl(idma64c, CTL_HI);
375375 return bytes - IDMA64C_CTLH_BLOCK_TS(ctlhi);
376376 }
377377
drivers/dma/pxa_dma.c+25−6
@@ -473,8 +473,10 @@ static void pxad_free_phy(struct pxad_chan *chan) · 472 unmodified lines
473473 return;
474474
475475 /* clear the channel mapping in DRCMR */
476− reg = pxad_drcmr(chan->drcmr);
477− writel_relaxed(0, chan->phy->base + reg);
476+ if (chan->drcmr <= DRCMR_CHLNUM) {
477+ reg = pxad_drcmr(chan->drcmr);
478+ writel_relaxed(0, chan->phy->base + reg);
479+ }
478480
479481 spin_lock_irqsave(&pdev->phy_lock, flags);
480482 for (i = 0; i < 32; i++)
@@ -516,8 +518,10 @@ static void phy_enable(struct pxad_phy *phy, bool misaligned) · 35 unmodified lines
516518 "%s(); phy=%p(%d) misaligned=%d\n", __func__,
517519 phy, phy->idx, misaligned);
518520
519− reg = pxad_drcmr(phy->vchan->drcmr);
520− writel_relaxed(DRCMR_MAPVLD | phy->idx, phy->base + reg);
521+ if (phy->vchan->drcmr <= DRCMR_CHLNUM) {
522+ reg = pxad_drcmr(phy->vchan->drcmr);
523+ writel_relaxed(DRCMR_MAPVLD | phy->idx, phy->base + reg);
524+ }
521525
522526 dalgn = phy_readl_relaxed(phy, DALGN);
523527 if (misaligned)
@@ -887,6 +891,7 @@ pxad_tx_prep(struct virt_dma_chan *vc, struct virt_dma_desc *vd, · 363 unmodified lines
887891 struct dma_async_tx_descriptor *tx;
888892 struct pxad_chan *chan = container_of(vc, struct pxad_chan, vc);
889893
894+ INIT_LIST_HEAD(&vd->node);
890895 tx = vchan_tx_prep(vc, vd, tx_flags);
891896 tx->tx_submit = pxad_tx_submit;
892897 dev_dbg(&chan->vc.chan.dev->device,
@@ -910,14 +915,18 @@ static void pxad_get_config(struct pxad_chan *chan, · 17 unmodified lines
910915 width = chan->cfg.src_addr_width;
911916 dev_addr = chan->cfg.src_addr;
912917 *dev_src = dev_addr;
913− *dcmd |= PXA_DCMD_INCTRGADDR | PXA_DCMD_FLOWSRC;
918+ *dcmd |= PXA_DCMD_INCTRGADDR;
919+ if (chan->drcmr <= DRCMR_CHLNUM)
920+ *dcmd |= PXA_DCMD_FLOWSRC;
914921 }
915922 if (dir == DMA_MEM_TO_DEV) {
916923 maxburst = chan->cfg.dst_maxburst;
917924 width = chan->cfg.dst_addr_width;
918925 dev_addr = chan->cfg.dst_addr;
919926 *dev_dst = dev_addr;
920− *dcmd |= PXA_DCMD_INCSRCADDR | PXA_DCMD_FLOWTRG;
927+ *dcmd |= PXA_DCMD_INCSRCADDR;
928+ if (chan->drcmr <= DRCMR_CHLNUM)
929+ *dcmd |= PXA_DCMD_FLOWTRG;
921930 }
922931 if (dir == DMA_MEM_TO_MEM)
923932 *dcmd |= PXA_DCMD_BURST32 | PXA_DCMD_INCTRGADDR |
@@ -1177,6 +1186,16 @@ static unsigned int pxad_residue(struct pxad_chan *chan, · 253 unmodified lines
11771186 else
11781187 curr = phy_readl_relaxed(chan->phy, DTADR);
11791188
1189+ /*
1190+ * curr has to be actually read before checking descriptor
1191+ * completion, so that a curr inside a status updater
1192+ * descriptor implies the following test returns true, and
1193+ * preventing reordering of curr load and the test.
1194+ */
1195+ rmb();
1196+ if (is_desc_completed(vd))
1197+ goto out;
1198+
11801199 for (i = 0; i < sw_desc->nb_desc - 1; i++) {
11811200 hw_desc = sw_desc->hw_desc[i];
11821201 if (sw_desc->hw_desc[0]->dcmd & PXA_DCMD_INCSRCADDR)
drivers/dma/sun4i-dma.c+3−3
@@ -599,13 +599,13 @@ get_next_cyclic_promise(struct sun4i_dma_contract *contract) · 598 unmodified lines
599599 static void sun4i_dma_free_contract(struct virt_dma_desc *vd)
600600 {
601601 struct sun4i_dma_contract *contract = to_sun4i_dma_contract(vd);
602− struct sun4i_dma_promise *promise;
602+ struct sun4i_dma_promise *promise, *tmp;
603603
604604 /* Free all the demands and completed demands */
605− list_for_each_entry(promise, &contract->demands, list)
605+ list_for_each_entry_safe(promise, tmp, &contract->demands, list)
606606 kfree(promise);
607607
608− list_for_each_entry(promise, &contract->completed_demands, list)
608+ list_for_each_entry_safe(promise, tmp, &contract->completed_demands, list)
609609 kfree(promise);
610610
611611 kfree(contract);
drivers/dma/xgene-dma.c+17−29
@@ -59,7 +59,6 @@ · 58 unmodified lines
5959 #define XGENE_DMA_RING_MEM_RAM_SHUTDOWN 0xD070
6060 #define XGENE_DMA_RING_BLK_MEM_RDY 0xD074
6161 #define XGENE_DMA_RING_BLK_MEM_RDY_VAL 0xFFFFFFFF
62−#define XGENE_DMA_RING_DESC_CNT(v) (((v) & 0x0001FFFE) >> 1)
6362 #define XGENE_DMA_RING_ID_GET(owner, num) (((owner) << 6) | (num))
6463 #define XGENE_DMA_RING_DST_ID(v) ((1 << 10) | (v))
6564 #define XGENE_DMA_RING_CMD_OFFSET 0x2C
@@ -379,14 +378,6 @@ static u8 xgene_dma_encode_xor_flyby(u32 src_cnt) · 313 unmodified lines
379378 return flyby_type[src_cnt];
380379 }
381380
382−static u32 xgene_dma_ring_desc_cnt(struct xgene_dma_ring *ring)
383−{
384− u32 __iomem *cmd_base = ring->cmd_base;
385− u32 ring_state = ioread32(&cmd_base[1]);
386−
387− return XGENE_DMA_RING_DESC_CNT(ring_state);
388−}
389−
390381 static void xgene_dma_set_src_buffer(__le64 *ext8, size_t *len,
391382 dma_addr_t *paddr)
392383 {
@@ -659,15 +650,12 @@ static void xgene_dma_clean_running_descriptor(struct xgene_dma_chan *chan, · 266 unmodified lines
659650 dma_pool_free(chan->desc_pool, desc, desc->tx.phys);
660651 }
661652
662−static int xgene_chan_xfer_request(struct xgene_dma_ring *ring,
663− struct xgene_dma_desc_sw *desc_sw)
653+static void xgene_chan_xfer_request(struct xgene_dma_chan *chan,
654+ struct xgene_dma_desc_sw *desc_sw)
664655 {
656+ struct xgene_dma_ring *ring = &chan->tx_ring;
665657 struct xgene_dma_desc_hw *desc_hw;
666658
667− /* Check if can push more descriptor to hw for execution */
668− if (xgene_dma_ring_desc_cnt(ring) > (ring->slots - 2))
669− return -EBUSY;
670−
671659 /* Get hw descriptor from DMA tx ring */
672660 desc_hw = &ring->desc_hw[ring->head];
673661
@@ -694,11 +682,13 @@ static int xgene_chan_xfer_request(struct xgene_dma_ring *ring, · 20 unmodified lines
694682 memcpy(desc_hw, &desc_sw->desc2, sizeof(*desc_hw));
695683 }
696684
685+ /* Increment the pending transaction count */
686+ chan->pending += ((desc_sw->flags &
687+ XGENE_DMA_FLAG_64B_DESC) ? 2 : 1);
688+
697689 /* Notify the hw that we have descriptor ready for execution */
698690 iowrite32((desc_sw->flags & XGENE_DMA_FLAG_64B_DESC) ?
699691 2 : 1, ring->cmd);
700−
701− return 0;
702692 }
703693
704694 /**
@@ -710,7 +700,6 @@ static int xgene_chan_xfer_request(struct xgene_dma_ring *ring, · 5 unmodified lines
710700 static void xgene_chan_xfer_ld_pending(struct xgene_dma_chan *chan)
711701 {
712702 struct xgene_dma_desc_sw *desc_sw, *_desc_sw;
713− int ret;
714703
715704 /*
716705 * If the list of pending descriptors is empty, then we
@@ -735,18 +724,13 @@ static void xgene_chan_xfer_ld_pending(struct xgene_dma_chan *chan) · 18 unmodified lines
735724 if (chan->pending >= chan->max_outstanding)
736725 return;
737726
738− ret = xgene_chan_xfer_request(&chan->tx_ring, desc_sw);
739− if (ret)
740− return;
727+ xgene_chan_xfer_request(chan, desc_sw);
741728
742729 /*
743730 * Delete this element from ld pending queue and append it to
744731 * ld running queue
745732 */
746733 list_move_tail(&desc_sw->node, &chan->ld_running);
747−
748− /* Increment the pending transaction count */
749− chan->pending++;
750734 }
751735 }
752736
@@ -821,7 +805,8 @@ static void xgene_dma_cleanup_descriptors(struct xgene_dma_chan *chan) · 68 unmodified lines
821805 * Decrement the pending transaction count
822806 * as we have processed one
823807 */
824− chan->pending--;
808+ chan->pending -= ((desc_sw->flags &
809+ XGENE_DMA_FLAG_64B_DESC) ? 2 : 1);
825810
826811 /*
827812 * Delete this node from ld running queue and append it to
@@ -1421,15 +1406,18 @@ static int xgene_dma_create_ring_one(struct xgene_dma_chan *chan, · 593 unmodified lines
14211406 struct xgene_dma_ring *ring,
14221407 enum xgene_dma_ring_cfgsize cfgsize)
14231408 {
1409+ int ret;
1410+
14241411 /* Setup DMA ring descriptor variables */
14251412 ring->pdma = chan->pdma;
14261413 ring->cfgsize = cfgsize;
14271414 ring->num = chan->pdma->ring_num++;
14281415 ring->id = XGENE_DMA_RING_ID_GET(ring->owner, ring->buf_num);
14291416
1430− ring->size = xgene_dma_get_ring_size(chan, cfgsize);
1431− if (ring->size <= 0)
1432− return ring->size;
1417+ ret = xgene_dma_get_ring_size(chan, cfgsize);
1418+ if (ret <= 0)
1419+ return ret;
1420+ ring->size = ret;
14331421
14341422 /* Allocate memory for DMA ring descriptor */
14351423 ring->desc_vaddr = dma_zalloc_coherent(chan->dev, ring->size,
@@ -1482,7 +1470,7 @@ static int xgene_dma_create_chan_rings(struct xgene_dma_chan *chan) · 46 unmodified lines
14821470 tx_ring->id, tx_ring->num, tx_ring->desc_vaddr);
14831471
14841472 /* Set the max outstanding request possible to this channel */
1485− chan->max_outstanding = rx_ring->slots;
1473+ chan->max_outstanding = tx_ring->slots;
14861474
14871475 return ret;
14881476 }
drivers/dma/zx296702_dma.c+1−1
@@ -739,7 +739,7 @@ static struct dma_chan *zx_of_dma_simple_xlate(struct of_phandle_args *dma_spec, · 738 unmodified lines
739739 struct dma_chan *chan;
740740 struct zx_dma_chan *c;
741741
742− if (request > d->dma_requests)
742+ if (request >= d->dma_requests)
743743 return NULL;
744744
745745 chan = dma_get_any_slave_channel(&d->slave);
drivers/firmware/efi/libstub/arm-stub.c+73−15
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 */
1414
1515 #include <linux/efi.h>
16+#include <linux/sort.h>
1617 #include <asm/efi.h>
1718
1819 #include "efistub.h"
@@ -305,6 +306,44 @@ fail: · 286 unmodified lines
305306 */
306307 #define EFI_RT_VIRTUAL_BASE 0x40000000
307308
309+static int cmp_mem_desc(const void *l, const void *r)
310+{
311+ const efi_memory_desc_t *left = l, *right = r;
312+
313+ return (left->phys_addr > right->phys_addr) ? 1 : -1;
314+}
315+
316+/*
317+ * Returns whether region @left ends exactly where region @right starts,
318+ * or false if either argument is NULL.
319+ */
320+static bool regions_are_adjacent(efi_memory_desc_t *left,
321+ efi_memory_desc_t *right)
322+{
323+ u64 left_end;
324+
325+ if (left == NULL || right == NULL)
326+ return false;
327+
328+ left_end = left->phys_addr + left->num_pages * EFI_PAGE_SIZE;
329+
330+ return left_end == right->phys_addr;
331+}
332+
333+/*
334+ * Returns whether region @left and region @right have compatible memory type
335+ * mapping attributes, and are both EFI_MEMORY_RUNTIME regions.
336+ */
337+static bool regions_have_compatible_memory_type_attrs(efi_memory_desc_t *left,
338+ efi_memory_desc_t *right)
339+{
340+ static const u64 mem_type_mask = EFI_MEMORY_WB | EFI_MEMORY_WT |
341+ EFI_MEMORY_WC | EFI_MEMORY_UC |
342+ EFI_MEMORY_RUNTIME;
343+
344+ return ((left->attribute ^ right->attribute) & mem_type_mask) == 0;
345+}
346+
308347 /*
309348 * efi_get_virtmap() - create a virtual mapping for the EFI memory map
310349 *
@@ -317,33 +356,52 @@ void efi_get_virtmap(efi_memory_desc_t *memory_map, unsigned long map_size, · 6 unmodified lines
317356 int *count)
318357 {
319358 u64 efi_virt_base = EFI_RT_VIRTUAL_BASE;
320− efi_memory_desc_t *out = runtime_map;
359+ efi_memory_desc_t *in, *prev = NULL, *out = runtime_map;
321360 int l;
322361
323− for (l = 0; l < map_size; l += desc_size) {
324− efi_memory_desc_t *in = (void *)memory_map + l;
362+ /*
363+ * To work around potential issues with the Properties Table feature
364+ * introduced in UEFI 2.5, which may split PE/COFF executable images
365+ * in memory into several RuntimeServicesCode and RuntimeServicesData
366+ * regions, we need to preserve the relative offsets between adjacent
367+ * EFI_MEMORY_RUNTIME regions with the same memory type attributes.
368+ * The easiest way to find adjacent regions is to sort the memory map
369+ * before traversing it.
370+ */
371+ sort(memory_map, map_size / desc_size, desc_size, cmp_mem_desc, NULL);
372+
373+ for (l = 0; l < map_size; l += desc_size, prev = in) {
325374 u64 paddr, size;
326375
376+ in = (void *)memory_map + l;
327377 if (!(in->attribute & EFI_MEMORY_RUNTIME))
328378 continue;
329379
380+ paddr = in->phys_addr;
381+ size = in->num_pages * EFI_PAGE_SIZE;
382+
330383 /*
331384 * Make the mapping compatible with 64k pages: this allows
332385 * a 4k page size kernel to kexec a 64k page size kernel and
333386 * vice versa.
334387 */
335− paddr = round_down(in->phys_addr, SZ_64K);
336− size = round_up(in->num_pages * EFI_PAGE_SIZE +
337− in->phys_addr - paddr, SZ_64K);
338−
339− /*
340− * Avoid wasting memory on PTEs by choosing a virtual base that
341− * is compatible with section mappings if this region has the
342− * appropriate size and physical alignment. (Sections are 2 MB
343− * on 4k granule kernels)
344− */
345− if (IS_ALIGNED(in->phys_addr, SZ_2M) && size >= SZ_2M)
346− efi_virt_base = round_up(efi_virt_base, SZ_2M);
388+ if (!regions_are_adjacent(prev, in) ||
389+ !regions_have_compatible_memory_type_attrs(prev, in)) {
390+
391+ paddr = round_down(in->phys_addr, SZ_64K);
392+ size += in->phys_addr - paddr;
393+
394+ /*
395+ * Avoid wasting memory on PTEs by choosing a virtual
396+ * base that is compatible with section mappings if this
397+ * region has the appropriate size and physical
398+ * alignment. (Sections are 2 MB on 4k granule kernels)
399+ */
400+ if (IS_ALIGNED(in->phys_addr, SZ_2M) && size >= SZ_2M)
401+ efi_virt_base = round_up(efi_virt_base, SZ_2M);
402+ else
403+ efi_virt_base = round_up(efi_virt_base, SZ_64K);
404+ }
347405
348406 in->virt_addr = efi_virt_base + in->phys_addr - paddr;
349407 efi_virt_base += size;
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c+0−39
@@ -208,44 +208,6 @@ static int amdgpu_cgs_alloc_gpu_mem(void *cgs_device, · 207 unmodified lines
208208 return ret;
209209 }
210210
211−static int amdgpu_cgs_import_gpu_mem(void *cgs_device, int dmabuf_fd,
212− cgs_handle_t *handle)
213−{
214− CGS_FUNC_ADEV;
215− int r;
216− uint32_t dma_handle;
217− struct drm_gem_object *obj;
218− struct amdgpu_bo *bo;
219− struct drm_device *dev = adev->ddev;
220− struct drm_file *file_priv = NULL, *priv;
221−
222− mutex_lock(&dev->struct_mutex);
223− list_for_each_entry(priv, &dev->filelist, lhead) {
224− rcu_read_lock();
225− if (priv->pid == get_pid(task_pid(current)))
226− file_priv = priv;
227− rcu_read_unlock();
228− if (file_priv)
229− break;
230− }
231− mutex_unlock(&dev->struct_mutex);
232− r = dev->driver->prime_fd_to_handle(dev,
233− file_priv, dmabuf_fd,
234− &dma_handle);
235− spin_lock(&file_priv->table_lock);
236−
237− /* Check if we currently have a reference on the object */
238− obj = idr_find(&file_priv->object_idr, dma_handle);
239− if (obj == NULL) {
240− spin_unlock(&file_priv->table_lock);
241− return -EINVAL;
242− }
243− spin_unlock(&file_priv->table_lock);
244− bo = gem_to_amdgpu_bo(obj);
245− *handle = (cgs_handle_t)bo;
246− return 0;
247−}
248−
249211 static int amdgpu_cgs_free_gpu_mem(void *cgs_device, cgs_handle_t handle)
250212 {
251213 struct amdgpu_bo *obj = (struct amdgpu_bo *)handle;
@@ -810,7 +772,6 @@ static const struct cgs_ops amdgpu_cgs_ops = { · 558 unmodified lines
810772 };
811773
812774 static const struct cgs_os_ops amdgpu_cgs_os_ops = {
813− amdgpu_cgs_import_gpu_mem,
814775 amdgpu_cgs_add_irq_source,
815776 amdgpu_cgs_irq_get,
816777 amdgpu_cgs_irq_put
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c+2−1
@@ -156,7 +156,8 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) · 155 unmodified lines
156156 uint64_t *chunk_array_user;
157157 uint64_t *chunk_array;
158158 struct amdgpu_fpriv *fpriv = p->filp->driver_priv;
159− unsigned size, i;
159+ unsigned size;
160+ int i;
160161 int ret;
161162
162163 if (cs->in.num_chunks == 0)
drivers/gpu/drm/amd/amdgpu/atombios_encoders.c+1−2
@@ -1279,8 +1279,7 @@ amdgpu_atombios_encoder_setup_dig(struct drm_encoder *encoder, int action) · 1278 unmodified lines
12791279 amdgpu_atombios_encoder_setup_dig_encoder(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON, 0);
12801280 }
12811281 if (amdgpu_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT))
1282− amdgpu_atombios_encoder_setup_dig_transmitter(encoder,
1283− ATOM_TRANSMITTER_ACTION_LCD_BLON, 0, 0);
1282+ amdgpu_atombios_encoder_set_backlight_level(amdgpu_encoder, dig->backlight_level);
12841283 if (ext_encoder)
12851284 amdgpu_atombios_encoder_setup_external_encoder(encoder, ext_encoder, ATOM_ENABLE);
12861285 } else {
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c+6−2
@@ -1262,6 +1262,12 @@ static int gmc_v7_0_process_interrupt(struct amdgpu_device *adev, · 1261 unmodified lines
12621262 addr = RREG32(mmVM_CONTEXT1_PROTECTION_FAULT_ADDR);
12631263 status = RREG32(mmVM_CONTEXT1_PROTECTION_FAULT_STATUS);
12641264 mc_client = RREG32(mmVM_CONTEXT1_PROTECTION_FAULT_MCCLIENT);
1265+ /* reset addr and status */
1266+ WREG32_P(mmVM_CONTEXT1_CNTL2, 1, ~1);
1267+
1268+ if (!addr && !status)
1269+ return 0;
1270+
12651271 dev_err(adev->dev, "GPU fault detected: %d 0x%08x\n",
12661272 entry->src_id, entry->src_data);
12671273 dev_err(adev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n",
@@ -1269,8 +1275,6 @@ static int gmc_v7_0_process_interrupt(struct amdgpu_device *adev, · 1 unmodified line
12691275 dev_err(adev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n",
12701276 status);
12711277 gmc_v7_0_vm_decode_fault(adev, status, addr, mc_client);
1272− /* reset addr and status */
1273− WREG32_P(mmVM_CONTEXT1_CNTL2, 1, ~1);
12741278
12751279 return 0;
12761280 }
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c+6−2
@@ -1262,6 +1262,12 @@ static int gmc_v8_0_process_interrupt(struct amdgpu_device *adev, · 1261 unmodified lines
12621262 addr = RREG32(mmVM_CONTEXT1_PROTECTION_FAULT_ADDR);
12631263 status = RREG32(mmVM_CONTEXT1_PROTECTION_FAULT_STATUS);
12641264 mc_client = RREG32(mmVM_CONTEXT1_PROTECTION_FAULT_MCCLIENT);
1265+ /* reset addr and status */
1266+ WREG32_P(mmVM_CONTEXT1_CNTL2, 1, ~1);
1267+
1268+ if (!addr && !status)
1269+ return 0;
1270+
12651271 dev_err(adev->dev, "GPU fault detected: %d 0x%08x\n",
12661272 entry->src_id, entry->src_data);
12671273 dev_err(adev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n",
@@ -1269,8 +1275,6 @@ static int gmc_v8_0_process_interrupt(struct amdgpu_device *adev, · 1 unmodified line
12691275 dev_err(adev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n",
12701276 status);
12711277 gmc_v8_0_vm_decode_fault(adev, status, addr, mc_client);
1272− /* reset addr and status */
1273− WREG32_P(mmVM_CONTEXT1_CNTL2, 1, ~1);
12741278
12751279 return 0;
12761280 }
drivers/gpu/drm/amd/include/cgs_linux.h+0−17
@@ -26,19 +26,6 @@ · 25 unmodified lines
2626
2727 #include "cgs_common.h"
2828
29−/**
30− * cgs_import_gpu_mem() - Import dmabuf handle
31− * @cgs_device: opaque device handle
32− * @dmabuf_fd: DMABuf file descriptor
33− * @handle: memory handle (output)
34− *
35− * Must be called in the process context that dmabuf_fd belongs to.
36− *
37− * Return: 0 on success, -errno otherwise
38− */
39−typedef int (*cgs_import_gpu_mem_t)(void *cgs_device, int dmabuf_fd,
40− cgs_handle_t *handle);
41−
4229 /**
4330 * cgs_irq_source_set_func() - Callback for enabling/disabling interrupt sources
4431 * @private_data: private data provided to cgs_add_irq_source
@@ -114,16 +101,12 @@ typedef int (*cgs_irq_get_t)(void *cgs_device, unsigned src_id, unsigned type); · 69 unmodified lines
114101 typedef int (*cgs_irq_put_t)(void *cgs_device, unsigned src_id, unsigned type);
115102
116103 struct cgs_os_ops {
117− cgs_import_gpu_mem_t import_gpu_mem;
118−
119104 /* IRQ handling */
120105 cgs_add_irq_source_t add_irq_source;
121106 cgs_irq_get_t irq_get;
122107 cgs_irq_put_t irq_put;
123108 };
124109
125−#define cgs_import_gpu_mem(dev,dmabuf_fd,handle) \
126− CGS_OS_CALL(import_gpu_mem,dev,dmabuf_fd,handle)
127110 #define cgs_add_irq_source(dev,src_id,num_types,set,handler,private_data) \
128111 CGS_OS_CALL(add_irq_source,dev,src_id,num_types,set,handler, \
129112 private_data)
drivers/gpu/drm/drm_dp_mst_topology.c+52−33
@@ -53,8 +53,8 @@ static int drm_dp_send_dpcd_write(struct drm_dp_mst_topology_mgr *mgr, · 52 unmodified lines
5353 struct drm_dp_mst_port *port,
5454 int offset, int size, u8 *bytes);
5555
56−static int drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr,
57− struct drm_dp_mst_branch *mstb);
56+static void drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr,
57+ struct drm_dp_mst_branch *mstb);
5858 static int drm_dp_send_enum_path_resources(struct drm_dp_mst_topology_mgr *mgr,
5959 struct drm_dp_mst_branch *mstb,
6060 struct drm_dp_mst_port *port);
@@ -804,8 +804,6 @@ static void drm_dp_destroy_mst_branch_device(struct kref *kref) · 743 unmodified lines
804804 struct drm_dp_mst_port *port, *tmp;
805805 bool wake_tx = false;
806806
807− cancel_work_sync(&mstb->mgr->work);
808−
809807 /*
810808 * destroy all ports - don't need lock
811809 * as there are no more references to the mst branch
@@ -863,29 +861,33 @@ static void drm_dp_destroy_port(struct kref *kref) · 51 unmodified lines
863861 {
864862 struct drm_dp_mst_port *port = container_of(kref, struct drm_dp_mst_port, kref);
865863 struct drm_dp_mst_topology_mgr *mgr = port->mgr;
864+
866865 if (!port->input) {
867866 port->vcpi.num_slots = 0;
868867
869868 kfree(port->cached_edid);
870869
871− /* we can't destroy the connector here, as
872− we might be holding the mode_config.mutex
873− from an EDID retrieval */
870+ /*
871+ * The only time we don't have a connector
872+ * on an output port is if the connector init
873+ * fails.
874+ */
874875 if (port->connector) {
876+ /* we can't destroy the connector here, as
877+ * we might be holding the mode_config.mutex
878+ * from an EDID retrieval */
879+
875880 mutex_lock(&mgr->destroy_connector_lock);
876881 list_add(&port->next, &mgr->destroy_connector_list);
877882 mutex_unlock(&mgr->destroy_connector_lock);
878883 schedule_work(&mgr->destroy_connector_work);
879884 return;
880885 }
886+ /* no need to clean up vcpi
887+ * as if we have no connector we never setup a vcpi */
881888 drm_dp_port_teardown_pdt(port, port->pdt);
882−
883− if (!port->input && port->vcpi.vcpi > 0)
884− drm_dp_mst_put_payload_id(mgr, port->vcpi.vcpi);
885889 }
886890 kfree(port);
887−
888− (*mgr->cbs->hotplug)(mgr);
889891 }
890892
891893 static void drm_dp_put_port(struct drm_dp_mst_port *port)
@@ -1027,8 +1029,8 @@ static void drm_dp_check_port_guid(struct drm_dp_mst_branch *mstb, · 135 unmodified lines
10271029 }
10281030 }
10291031
1030−static void build_mst_prop_path(struct drm_dp_mst_port *port,
1031− struct drm_dp_mst_branch *mstb,
1032+static void build_mst_prop_path(const struct drm_dp_mst_branch *mstb,
1033+ int pnum,
10321034 char *proppath,
10331035 size_t proppath_size)
10341036 {
@@ -1041,7 +1043,7 @@ static void build_mst_prop_path(struct drm_dp_mst_port *port, · 6 unmodified lines
10411043 snprintf(temp, sizeof(temp), "-%d", port_num);
10421044 strlcat(proppath, temp, proppath_size);
10431045 }
1044− snprintf(temp, sizeof(temp), "-%d", port->port_num);
1046+ snprintf(temp, sizeof(temp), "-%d", pnum);
10451047 strlcat(proppath, temp, proppath_size);
10461048 }
10471049
@@ -1105,22 +1107,32 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, · 57 unmodified lines
11051107 drm_dp_port_teardown_pdt(port, old_pdt);
11061108
11071109 ret = drm_dp_port_setup_pdt(port);
1108− if (ret == true) {
1110+ if (ret == true)
11091111 drm_dp_send_link_address(mstb->mgr, port->mstb);
1110− port->mstb->link_address_sent = true;
1111− }
11121112 }
11131113
11141114 if (created && !port->input) {
11151115 char proppath[255];
1116− build_mst_prop_path(port, mstb, proppath, sizeof(proppath));
1117− port->connector = (*mstb->mgr->cbs->add_connector)(mstb->mgr, port, proppath);
11181116
1119− if (port->port_num >= 8) {
1117+ build_mst_prop_path(mstb, port->port_num, proppath, sizeof(proppath));
1118+ port->connector = (*mstb->mgr->cbs->add_connector)(mstb->mgr, port, proppath);
1119+ if (!port->connector) {
1120+ /* remove it from the port list */
1121+ mutex_lock(&mstb->mgr->lock);
1122+ list_del(&port->next);
1123+ mutex_unlock(&mstb->mgr->lock);
1124+ /* drop port list reference */
1125+ drm_dp_put_port(port);
1126+ goto out;
1127+ }
1128+ if (port->port_num >= DP_MST_LOGICAL_PORT_0) {
11201129 port->cached_edid = drm_get_edid(port->connector, &port->aux.ddc);
1130+ drm_mode_connector_set_tile_property(port->connector);
11211131 }
1132+ (*mstb->mgr->cbs->register_connector)(port->connector);
11221133 }
11231134
1135+out:
11241136 /* put reference to this port */
11251137 drm_dp_put_port(port);
11261138 }
@@ -1202,10 +1214,9 @@ static void drm_dp_check_and_send_link_address(struct drm_dp_mst_topology_mgr *m · 75 unmodified lines
12021214 {
12031215 struct drm_dp_mst_port *port;
12041216 struct drm_dp_mst_branch *mstb_child;
1205− if (!mstb->link_address_sent) {
1217+ if (!mstb->link_address_sent)
12061218 drm_dp_send_link_address(mgr, mstb);
1207− mstb->link_address_sent = true;
1208− }
1219+
12091220 list_for_each_entry(port, &mstb->ports, next) {
12101221 if (port->input)
12111222 continue;
@@ -1458,8 +1469,8 @@ static void drm_dp_queue_down_tx(struct drm_dp_mst_topology_mgr *mgr, · 246 unmodified lines
14581469 mutex_unlock(&mgr->qlock);
14591470 }
14601471
1461−static int drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr,
1462− struct drm_dp_mst_branch *mstb)
1472+static void drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr,
1473+ struct drm_dp_mst_branch *mstb)
14631474 {
14641475 int len;
14651476 struct drm_dp_sideband_msg_tx *txmsg;
@@ -1467,11 +1478,12 @@ static int drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr, · 1 unmodified line
14671478
14681479 txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL);
14691480 if (!txmsg)
1470− return -ENOMEM;
1481+ return;
14711482
14721483 txmsg->dst = mstb;
14731484 len = build_link_address(txmsg);
14741485
1486+ mstb->link_address_sent = true;
14751487 drm_dp_queue_down_tx(mgr, txmsg);
14761488
14771489 ret = drm_dp_mst_wait_tx_reply(mstb, txmsg);
@@ -1499,11 +1511,12 @@ static int drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr, · 21 unmodified lines
14991511 }
15001512 (*mgr->cbs->hotplug)(mgr);
15011513 }
1502− } else
1514+ } else {
1515+ mstb->link_address_sent = false;
15031516 DRM_DEBUG_KMS("link address failed %d\n", ret);
1517+ }
15041518
15051519 kfree(txmsg);
1506− return 0;
15071520 }
15081521
15091522 static int drm_dp_send_enum_path_resources(struct drm_dp_mst_topology_mgr *mgr,
@@ -1978,6 +1991,8 @@ void drm_dp_mst_topology_mgr_suspend(struct drm_dp_mst_topology_mgr *mgr) · 468 unmodified lines
19781991 drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL,
19791992 DP_MST_EN | DP_UPSTREAM_IS_SRC);
19801993 mutex_unlock(&mgr->lock);
1994+ flush_work(&mgr->work);
1995+ flush_work(&mgr->destroy_connector_work);
19811996 }
19821997 EXPORT_SYMBOL(drm_dp_mst_topology_mgr_suspend);
19831998
@@ -2263,10 +2278,10 @@ struct edid *drm_dp_mst_get_edid(struct drm_connector *connector, struct drm_dp_ · 279 unmodified lines
22632278
22642279 if (port->cached_edid)
22652280 edid = drm_edid_duplicate(port->cached_edid);
2266− else
2281+ else {
22672282 edid = drm_get_edid(connector, &port->aux.ddc);
2268−
2269− drm_mode_connector_set_tile_property(connector);
2283+ drm_mode_connector_set_tile_property(connector);
2284+ }
22702285 drm_dp_put_port(port);
22712286 return edid;
22722287 }
@@ -2671,7 +2686,7 @@ static void drm_dp_destroy_connector_work(struct work_struct *work) · 398 unmodified lines
26712686 {
26722687 struct drm_dp_mst_topology_mgr *mgr = container_of(work, struct drm_dp_mst_topology_mgr, destroy_connector_work);
26732688 struct drm_dp_mst_port *port;
2674−
2689+ bool send_hotplug = false;
26752690 /*
26762691 * Not a regular list traverse as we have to drop the destroy
26772692 * connector lock before destroying the connector, to avoid AB->BA
@@ -2694,7 +2709,10 @@ static void drm_dp_destroy_connector_work(struct work_struct *work) · 16 unmodified lines
26942709 if (!port->input && port->vcpi.vcpi > 0)
26952710 drm_dp_mst_put_payload_id(mgr, port->vcpi.vcpi);
26962711 kfree(port);
2712+ send_hotplug = true;
26972713 }
2714+ if (send_hotplug)
2715+ (*mgr->cbs->hotplug)(mgr);
26982716 }
26992717
27002718 /**
@@ -2747,6 +2765,7 @@ EXPORT_SYMBOL(drm_dp_mst_topology_mgr_init); · 46 unmodified lines
27472765 */
27482766 void drm_dp_mst_topology_mgr_destroy(struct drm_dp_mst_topology_mgr *mgr)
27492767 {
2768+ flush_work(&mgr->work);
27502769 flush_work(&mgr->destroy_connector_work);
27512770 mutex_lock(&mgr->payload_lock);
27522771 kfree(mgr->payloads);
drivers/gpu/drm/drm_fb_helper.c+5−1
@@ -345,7 +345,11 @@ static bool restore_fbdev_mode(struct drm_fb_helper *fb_helper) · 344 unmodified lines
345345 struct drm_crtc *crtc = mode_set->crtc;
346346 int ret;
347347
348− if (crtc->funcs->cursor_set) {
348+ if (crtc->funcs->cursor_set2) {
349+ ret = crtc->funcs->cursor_set2(crtc, NULL, 0, 0, 0, 0, 0);
350+ if (ret)
351+ error = true;
352+ } else if (crtc->funcs->cursor_set) {
349353 ret = crtc->funcs->cursor_set(crtc, NULL, 0, 0, 0);
350354 if (ret)
351355 error = true;
drivers/gpu/drm/drm_probe_helper.c+16−3
@@ -94,7 +94,18 @@ static int drm_helper_probe_add_cmdline_mode(struct drm_connector *connector) · 93 unmodified lines
9494 }
9595
9696 #define DRM_OUTPUT_POLL_PERIOD (10*HZ)
97−static void __drm_kms_helper_poll_enable(struct drm_device *dev)
97+/**
98+ * drm_kms_helper_poll_enable_locked - re-enable output polling.
99+ * @dev: drm_device
100+ *
101+ * This function re-enables the output polling work without
102+ * locking the mode_config mutex.
103+ *
104+ * This is like drm_kms_helper_poll_enable() however it is to be
105+ * called from a context where the mode_config mutex is locked
106+ * already.
107+ */
108+void drm_kms_helper_poll_enable_locked(struct drm_device *dev)
98109 {
99110 bool poll = false;
100111 struct drm_connector *connector;
@@ -113,6 +124,8 @@ static void __drm_kms_helper_poll_enable(struct drm_device *dev) · 12 unmodified lines
113124 if (poll)
114125 schedule_delayed_work(&dev->mode_config.output_poll_work, DRM_OUTPUT_POLL_PERIOD);
115126 }
127+EXPORT_SYMBOL(drm_kms_helper_poll_enable_locked);
128+
116129
117130 static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connector *connector,
118131 uint32_t maxX, uint32_t maxY, bool merge_type_bits)
@@ -174,7 +187,7 @@ static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connect · 55 unmodified lines
174187
175188 /* Re-enable polling in case the global poll config changed. */
176189 if (drm_kms_helper_poll != dev->mode_config.poll_running)
177− __drm_kms_helper_poll_enable(dev);
190+ drm_kms_helper_poll_enable_locked(dev);
178191
179192 dev->mode_config.poll_running = drm_kms_helper_poll;
180193
@@ -428,7 +441,7 @@ EXPORT_SYMBOL(drm_kms_helper_poll_disable); · 247 unmodified lines
428441 void drm_kms_helper_poll_enable(struct drm_device *dev)
429442 {
430443 mutex_lock(&dev->mode_config.mutex);
431− __drm_kms_helper_poll_enable(dev);
444+ drm_kms_helper_poll_enable_locked(dev);
432445 mutex_unlock(&dev->mode_config.mutex);
433446 }
434447 EXPORT_SYMBOL(drm_kms_helper_poll_enable);
drivers/gpu/drm/exynos/exynos7_drm_decon.c+0−12
@@ -37,7 +37,6 @@ · 36 unmodified lines
3737 * DECON stands for Display and Enhancement controller.
3838 */
3939
40−#define DECON_DEFAULT_FRAMERATE 60
4140 #define MIN_FB_WIDTH_FOR_16WORD_BURST 128
4241
4342 #define WINDOWS_NR 2
@@ -165,16 +164,6 @@ static u32 decon_calc_clkdiv(struct decon_context *ctx, · 121 unmodified lines
165164 return (clkdiv < 0x100) ? clkdiv : 0xff;
166165 }
167166
168−static bool decon_mode_fixup(struct exynos_drm_crtc *crtc,
169− const struct drm_display_mode *mode,
170− struct drm_display_mode *adjusted_mode)
171−{
172− if (adjusted_mode->vrefresh == 0)
173− adjusted_mode->vrefresh = DECON_DEFAULT_FRAMERATE;
174−
175− return true;
176−}
177−
178167 static void decon_commit(struct exynos_drm_crtc *crtc)
179168 {
180169 struct decon_context *ctx = crtc->ctx;
@@ -637,7 +626,6 @@ static void decon_disable(struct exynos_drm_crtc *crtc) · 456 unmodified lines
637626 static const struct exynos_drm_crtc_ops decon_crtc_ops = {
638627 .enable = decon_enable,
639628 .disable = decon_disable,
640− .mode_fixup = decon_mode_fixup,
641629 .commit = decon_commit,
642630 .enable_vblank = decon_enable_vblank,
643631 .disable_vblank = decon_disable_vblank,
drivers/gpu/drm/exynos/exynos_dp_core.c+0−23
@@ -1383,28 +1383,6 @@ static int exynos_dp_remove(struct platform_device *pdev) · 1382 unmodified lines
13831383 return 0;
13841384 }
13851385
1386−#ifdef CONFIG_PM_SLEEP
1387−static int exynos_dp_suspend(struct device *dev)
1388−{
1389− struct exynos_dp_device *dp = dev_get_drvdata(dev);
1390−
1391− exynos_dp_disable(&dp->encoder);
1392− return 0;
1393−}
1394−
1395−static int exynos_dp_resume(struct device *dev)
1396−{
1397− struct exynos_dp_device *dp = dev_get_drvdata(dev);
1398−
1399− exynos_dp_enable(&dp->encoder);
1400− return 0;
1401−}
1402−#endif
1403−
1404−static const struct dev_pm_ops exynos_dp_pm_ops = {
1405− SET_SYSTEM_SLEEP_PM_OPS(exynos_dp_suspend, exynos_dp_resume)
1406−};
1407−
14081386 static const struct of_device_id exynos_dp_match[] = {
14091387 { .compatible = "samsung,exynos5-dp" },
14101388 {},
@@ -1417,7 +1395,6 @@ struct platform_driver dp_driver = { · 6 unmodified lines
14171395 .driver = {
14181396 .name = "exynos-dp",
14191397 .owner = THIS_MODULE,
1420− .pm = &exynos_dp_pm_ops,
14211398 .of_match_table = exynos_dp_match,
14221399 },
14231400 };
drivers/gpu/drm/exynos/exynos_drm_core.c+0−6
@@ -28,7 +28,6 @@ int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv) · 27 unmodified lines
2828
2929 return 0;
3030 }
31−EXPORT_SYMBOL_GPL(exynos_drm_subdrv_register);
3231
3332 int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *subdrv)
3433 {
@@ -39,7 +38,6 @@ int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *subdrv) · 4 unmodified lines
3938
4039 return 0;
4140 }
42−EXPORT_SYMBOL_GPL(exynos_drm_subdrv_unregister);
4341
4442 int exynos_drm_device_subdrv_probe(struct drm_device *dev)
4543 {
@@ -69,7 +67,6 @@ int exynos_drm_device_subdrv_probe(struct drm_device *dev) · 23 unmodified lines
6967
7068 return 0;
7169 }
72−EXPORT_SYMBOL_GPL(exynos_drm_device_subdrv_probe);
7370
7471 int exynos_drm_device_subdrv_remove(struct drm_device *dev)
7572 {
@@ -87,7 +84,6 @@ int exynos_drm_device_subdrv_remove(struct drm_device *dev) · 11 unmodified lines
8784
8885 return 0;
8986 }
90−EXPORT_SYMBOL_GPL(exynos_drm_device_subdrv_remove);
9187
9288 int exynos_drm_subdrv_open(struct drm_device *dev, struct drm_file *file)
9389 {
@@ -111,7 +107,6 @@ err: · 17 unmodified lines
111107 }
112108 return ret;
113109 }
114−EXPORT_SYMBOL_GPL(exynos_drm_subdrv_open);
115110
116111 void exynos_drm_subdrv_close(struct drm_device *dev, struct drm_file *file)
117112 {
@@ -122,4 +117,3 @@ void exynos_drm_subdrv_close(struct drm_device *dev, struct drm_file *file) · 4 unmodified lines
122117 subdrv->close(dev, subdrv->dev, file);
123118 }
124119 }
125−EXPORT_SYMBOL_GPL(exynos_drm_subdrv_close);
drivers/gpu/drm/exynos/exynos_drm_crtc.c+0−15
@@ -41,20 +41,6 @@ static void exynos_drm_crtc_disable(struct drm_crtc *crtc) · 40 unmodified lines
4141 exynos_crtc->ops->disable(exynos_crtc);
4242 }
4343
44−static bool
45−exynos_drm_crtc_mode_fixup(struct drm_crtc *crtc,
46− const struct drm_display_mode *mode,
47− struct drm_display_mode *adjusted_mode)
48−{
49− struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
50−
51− if (exynos_crtc->ops->mode_fixup)
52− return exynos_crtc->ops->mode_fixup(exynos_crtc, mode,
53− adjusted_mode);
54−
55− return true;
56−}
57−
5844 static void
5945 exynos_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
6046 {
@@ -99,7 +85,6 @@ static void exynos_crtc_atomic_flush(struct drm_crtc *crtc, · 38 unmodified lines
9985 static struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = {
10086 .enable = exynos_drm_crtc_enable,
10187 .disable = exynos_drm_crtc_disable,
102− .mode_fixup = exynos_drm_crtc_mode_fixup,
10388 .mode_set_nofb = exynos_drm_crtc_mode_set_nofb,
10489 .atomic_begin = exynos_crtc_atomic_begin,
10590 .atomic_flush = exynos_crtc_atomic_flush,
drivers/gpu/drm/exynos/exynos_drm_drv.c+2−0
@@ -304,6 +304,7 @@ int exynos_atomic_commit(struct drm_device *dev, struct drm_atomic_state *state, · 303 unmodified lines
304304 return 0;
305305 }
306306
307+#ifdef CONFIG_PM_SLEEP
307308 static int exynos_drm_suspend(struct drm_device *dev, pm_message_t state)
308309 {
309310 struct drm_connector *connector;
@@ -340,6 +341,7 @@ static int exynos_drm_resume(struct drm_device *dev) · 30 unmodified lines
340341
341342 return 0;
342343 }
344+#endif
343345
344346 static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
345347 {
drivers/gpu/drm/exynos/exynos_drm_drv.h+0−4
@@ -82,7 +82,6 @@ struct exynos_drm_plane { · 81 unmodified lines
8282 *
8383 * @enable: enable the device
8484 * @disable: disable the device
85− * @mode_fixup: fix mode data before applying it
8685 * @commit: set current hw specific display mode to hw.
8786 * @enable_vblank: specific driver callback for enabling vblank interrupt.
8887 * @disable_vblank: specific driver callback for disabling vblank interrupt.
@@ -103,9 +102,6 @@ struct exynos_drm_crtc; · 14 unmodified lines
103102 struct exynos_drm_crtc_ops {
104103 void (*enable)(struct exynos_drm_crtc *crtc);
105104 void (*disable)(struct exynos_drm_crtc *crtc);
106− bool (*mode_fixup)(struct exynos_drm_crtc *crtc,
107− const struct drm_display_mode *mode,
108− struct drm_display_mode *adjusted_mode);
109105 void (*commit)(struct exynos_drm_crtc *crtc);
110106 int (*enable_vblank)(struct exynos_drm_crtc *crtc);
111107 void (*disable_vblank)(struct exynos_drm_crtc *crtc);
drivers/gpu/drm/exynos/exynos_drm_fimc.c+18−18
@@ -1206,23 +1206,6 @@ static struct exynos_drm_ipp_ops fimc_dst_ops = { · 1205 unmodified lines
12061206 .set_addr = fimc_dst_set_addr,
12071207 };
12081208
1209−static int fimc_clk_ctrl(struct fimc_context *ctx, bool enable)
1210−{
1211− DRM_DEBUG_KMS("enable[%d]\n", enable);
1212−
1213− if (enable) {
1214− clk_prepare_enable(ctx->clocks[FIMC_CLK_GATE]);
1215− clk_prepare_enable(ctx->clocks[FIMC_CLK_WB_A]);
1216− ctx->suspended = false;
1217− } else {
1218− clk_disable_unprepare(ctx->clocks[FIMC_CLK_GATE]);
1219− clk_disable_unprepare(ctx->clocks[FIMC_CLK_WB_A]);
1220− ctx->suspended = true;
1221− }
1222−
1223− return 0;
1224−}
1225−
12261209 static irqreturn_t fimc_irq_handler(int irq, void *dev_id)
12271210 {
12281211 struct fimc_context *ctx = dev_id;
@@ -1780,6 +1763,24 @@ static int fimc_remove(struct platform_device *pdev) · 551 unmodified lines
17801763 return 0;
17811764 }
17821765
1766+#ifdef CONFIG_PM
1767+static int fimc_clk_ctrl(struct fimc_context *ctx, bool enable)
1768+{
1769+ DRM_DEBUG_KMS("enable[%d]\n", enable);
1770+
1771+ if (enable) {
1772+ clk_prepare_enable(ctx->clocks[FIMC_CLK_GATE]);
1773+ clk_prepare_enable(ctx->clocks[FIMC_CLK_WB_A]);
1774+ ctx->suspended = false;
1775+ } else {
1776+ clk_disable_unprepare(ctx->clocks[FIMC_CLK_GATE]);
1777+ clk_disable_unprepare(ctx->clocks[FIMC_CLK_WB_A]);
1778+ ctx->suspended = true;
1779+ }
1780+
1781+ return 0;
1782+}
1783+
17831784 #ifdef CONFIG_PM_SLEEP
17841785 static int fimc_suspend(struct device *dev)
17851786 {
@@ -1806,7 +1807,6 @@ static int fimc_resume(struct device *dev) · 20 unmodified lines
18061807 }
18071808 #endif
18081809
1809−#ifdef CONFIG_PM
18101810 static int fimc_runtime_suspend(struct device *dev)
18111811 {
18121812 struct fimc_context *ctx = get_fimc_context(dev);
drivers/gpu/drm/exynos/exynos_drm_fimd.c+1−13
@@ -41,7 +41,6 @@ · 40 unmodified lines
4141 * CPU Interface.
4242 */
4343
44−#define FIMD_DEFAULT_FRAMERATE 60
4544 #define MIN_FB_WIDTH_FOR_16WORD_BURST 128
4645
4746 /* position control register for hardware window 0, 2 ~ 4.*/
@@ -377,16 +376,6 @@ static u32 fimd_calc_clkdiv(struct fimd_context *ctx, · 329 unmodified lines
377376 return (clkdiv < 0x100) ? clkdiv : 0xff;
378377 }
379378
380−static bool fimd_mode_fixup(struct exynos_drm_crtc *crtc,
381− const struct drm_display_mode *mode,
382− struct drm_display_mode *adjusted_mode)
383−{
384− if (adjusted_mode->vrefresh == 0)
385− adjusted_mode->vrefresh = FIMD_DEFAULT_FRAMERATE;
386−
387− return true;
388−}
389−
390379 static void fimd_commit(struct exynos_drm_crtc *crtc)
391380 {
392381 struct fimd_context *ctx = crtc->ctx;
@@ -882,13 +871,12 @@ static void fimd_dp_clock_enable(struct exynos_drm_crtc *crtc, bool enable) · 489 unmodified lines
882871 return;
883872
884873 val = enable ? DP_MIE_CLK_DP_ENABLE : DP_MIE_CLK_DISABLE;
885− writel(DP_MIE_CLK_DP_ENABLE, ctx->regs + DP_MIE_CLKCON);
874+ writel(val, ctx->regs + DP_MIE_CLKCON);
886875 }
887876
888877 static const struct exynos_drm_crtc_ops fimd_crtc_ops = {
889878 .enable = fimd_enable,
890879 .disable = fimd_disable,
891− .mode_fixup = fimd_mode_fixup,
892880 .commit = fimd_commit,
893881 .enable_vblank = fimd_enable_vblank,
894882 .disable_vblank = fimd_disable_vblank,
drivers/gpu/drm/exynos/exynos_drm_g2d.c+0−3
@@ -1059,7 +1059,6 @@ int exynos_g2d_get_ver_ioctl(struct drm_device *drm_dev, void *data, · 1058 unmodified lines
10591059
10601060 return 0;
10611061 }
1062−EXPORT_SYMBOL_GPL(exynos_g2d_get_ver_ioctl);
10631062
10641063 int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data,
10651064 struct drm_file *file)
@@ -1230,7 +1229,6 @@ err: · 164 unmodified lines
12301229 g2d_put_cmdlist(g2d, node);
12311230 return ret;
12321231 }
1233−EXPORT_SYMBOL_GPL(exynos_g2d_set_cmdlist_ioctl);
12341232
12351233 int exynos_g2d_exec_ioctl(struct drm_device *drm_dev, void *data,
12361234 struct drm_file *file)
@@ -1293,7 +1291,6 @@ int exynos_g2d_exec_ioctl(struct drm_device *drm_dev, void *data, · 56 unmodified lines
12931291 out:
12941292 return 0;
12951293 }
1296−EXPORT_SYMBOL_GPL(exynos_g2d_exec_ioctl);
12971294
12981295 static int g2d_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
12991296 {
drivers/gpu/drm/exynos/exynos_drm_gem.c+41−53
@@ -56,39 +56,35 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem_obj *obj) · 55 unmodified lines
5656 nr_pages = obj->size >> PAGE_SHIFT;
5757
5858 if (!is_drm_iommu_supported(dev)) {
59− dma_addr_t start_addr;
60− unsigned int i = 0;
61−
6259 obj->pages = drm_calloc_large(nr_pages, sizeof(struct page *));
6360 if (!obj->pages) {
6461 DRM_ERROR("failed to allocate pages.\n");
6562 return -ENOMEM;
6663 }
64+ }
6765
68− obj->cookie = dma_alloc_attrs(dev->dev,
69− obj->size,
70− &obj->dma_addr, GFP_KERNEL,
71− &obj->dma_attrs);
72− if (!obj->cookie) {
73− DRM_ERROR("failed to allocate buffer.\n");
66+ obj->cookie = dma_alloc_attrs(dev->dev, obj->size, &obj->dma_addr,
67+ GFP_KERNEL, &obj->dma_attrs);
68+ if (!obj->cookie) {
69+ DRM_ERROR("failed to allocate buffer.\n");
70+ if (obj->pages)
7471 drm_free_large(obj->pages);
75− return -ENOMEM;
76− }
72+ return -ENOMEM;
73+ }
74+
75+ if (obj->pages) {
76+ dma_addr_t start_addr;
77+ unsigned int i = 0;
7778
7879 start_addr = obj->dma_addr;
7980 while (i < nr_pages) {
80− obj->pages[i] = phys_to_page(start_addr);
81+ obj->pages[i] = pfn_to_page(dma_to_pfn(dev->dev,
82+ start_addr));
8183 start_addr += PAGE_SIZE;
8284 i++;
8385 }
8486 } else {
85− obj->pages = dma_alloc_attrs(dev->dev, obj->size,
86− &obj->dma_addr, GFP_KERNEL,
87− &obj->dma_attrs);
88− if (!obj->pages) {
89− DRM_ERROR("failed to allocate buffer.\n");
90− return -ENOMEM;
91− }
87+ obj->pages = obj->cookie;
9288 }
9389
9490 DRM_DEBUG_KMS("dma_addr(0x%lx), size(0x%lx)\n",
@@ -110,15 +106,11 @@ static void exynos_drm_free_buf(struct exynos_drm_gem_obj *obj) · 15 unmodified lines
110106 DRM_DEBUG_KMS("dma_addr(0x%lx), size(0x%lx)\n",
111107 (unsigned long)obj->dma_addr, obj->size);
112108
113− if (!is_drm_iommu_supported(dev)) {
114− dma_free_attrs(dev->dev, obj->size, obj->cookie,
115− (dma_addr_t)obj->dma_addr, &obj->dma_attrs);
116− drm_free_large(obj->pages);
117− } else
118− dma_free_attrs(dev->dev, obj->size, obj->pages,
119− (dma_addr_t)obj->dma_addr, &obj->dma_attrs);
109+ dma_free_attrs(dev->dev, obj->size, obj->cookie,
110+ (dma_addr_t)obj->dma_addr, &obj->dma_attrs);
120111
121− obj->dma_addr = (dma_addr_t)NULL;
112+ if (!is_drm_iommu_supported(dev))
113+ drm_free_large(obj->pages);
122114 }
123115
124116 static int exynos_drm_gem_handle_create(struct drm_gem_object *obj,
@@ -156,18 +148,14 @@ void exynos_drm_gem_destroy(struct exynos_drm_gem_obj *exynos_gem_obj) · 31 unmodified lines
156148 * once dmabuf's refcount becomes 0.
157149 */
158150 if (obj->import_attach)
159− goto out;
160−
161− exynos_drm_free_buf(exynos_gem_obj);
162−
163−out:
164− drm_gem_free_mmap_offset(obj);
151+ drm_prime_gem_destroy(obj, exynos_gem_obj->sgt);
152+ else
153+ exynos_drm_free_buf(exynos_gem_obj);
165154
166155 /* release file pointer to gem object. */
167156 drm_gem_object_release(obj);
168157
169158 kfree(exynos_gem_obj);
170− exynos_gem_obj = NULL;
171159 }
172160
173161 unsigned long exynos_drm_gem_get_size(struct drm_device *dev,
@@ -190,8 +178,7 @@ unsigned long exynos_drm_gem_get_size(struct drm_device *dev, · 16 unmodified lines
190178 return exynos_gem_obj->size;
191179 }
192180
193−
194−struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev,
181+static struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev,
195182 unsigned long size)
196183 {
197184 struct exynos_drm_gem_obj *exynos_gem_obj;
@@ -212,6 +199,13 @@ struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev, · 14 unmodified lines
212199 return ERR_PTR(ret);
213200 }
214201
202+ ret = drm_gem_create_mmap_offset(obj);
203+ if (ret < 0) {
204+ drm_gem_object_release(obj);
205+ kfree(exynos_gem_obj);
206+ return ERR_PTR(ret);
207+ }
208+
215209 DRM_DEBUG_KMS("created file object = 0x%x\n", (unsigned int)obj->filp);
216210
217211 return exynos_gem_obj;
@@ -313,7 +307,7 @@ void exynos_drm_gem_put_dma_addr(struct drm_device *dev, · 95 unmodified lines
313307 drm_gem_object_unreference_unlocked(obj);
314308 }
315309
316−int exynos_drm_gem_mmap_buffer(struct exynos_drm_gem_obj *exynos_gem_obj,
310+static int exynos_drm_gem_mmap_buffer(struct exynos_drm_gem_obj *exynos_gem_obj,
317311 struct vm_area_struct *vma)
318312 {
319313 struct drm_device *drm_dev = exynos_gem_obj->base.dev;
@@ -342,7 +336,8 @@ int exynos_drm_gem_mmap_buffer(struct exynos_drm_gem_obj *exynos_gem_obj, · 22 unmodified lines
342336
343337 int exynos_drm_gem_get_ioctl(struct drm_device *dev, void *data,
344338 struct drm_file *file_priv)
345−{ struct exynos_drm_gem_obj *exynos_gem_obj;
339+{
340+ struct exynos_drm_gem_obj *exynos_gem_obj;
346341 struct drm_exynos_gem_info *args = data;
347342 struct drm_gem_object *obj;
348343
@@ -402,6 +397,7 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv, · 53 unmodified lines
402397 struct drm_mode_create_dumb *args)
403398 {
404399 struct exynos_drm_gem_obj *exynos_gem_obj;
400+ unsigned int flags;
405401 int ret;
406402
407403 /*
@@ -413,16 +409,12 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv, · 5 unmodified lines
413409 args->pitch = args->width * ((args->bpp + 7) / 8);
414410 args->size = args->pitch * args->height;
415411
416− if (is_drm_iommu_supported(dev)) {
417− exynos_gem_obj = exynos_drm_gem_create(dev,
418− EXYNOS_BO_NONCONTIG | EXYNOS_BO_WC,
419− args->size);
420− } else {
421− exynos_gem_obj = exynos_drm_gem_create(dev,
422− EXYNOS_BO_CONTIG | EXYNOS_BO_WC,
423− args->size);
424− }
412+ if (is_drm_iommu_supported(dev))
413+ flags = EXYNOS_BO_NONCONTIG | EXYNOS_BO_WC;
414+ else
415+ flags = EXYNOS_BO_CONTIG | EXYNOS_BO_WC;
425416
417+ exynos_gem_obj = exynos_drm_gem_create(dev, flags, args->size);
426418 if (IS_ERR(exynos_gem_obj)) {
427419 dev_warn(dev->dev, "FB allocation failed.\n");
428420 return PTR_ERR(exynos_gem_obj);
@@ -460,14 +452,9 @@ int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv, · 31 unmodified lines
460452 goto unlock;
461453 }
462454
463− ret = drm_gem_create_mmap_offset(obj);
464− if (ret)
465− goto out;
466−
467455 *offset = drm_vma_node_offset_addr(&obj->vma_node);
468456 DRM_DEBUG_KMS("offset = 0x%lx\n", (unsigned long)*offset);
469457
470−out:
471458 drm_gem_object_unreference(obj);
472459 unlock:
473460 mutex_unlock(&dev->struct_mutex);
@@ -543,7 +530,6 @@ int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) · 69 unmodified lines
543530
544531 err_close_vm:
545532 drm_gem_vm_close(vma);
546− drm_gem_free_mmap_offset(obj);
547533
548534 return ret;
549535 }
@@ -588,6 +574,8 @@ exynos_drm_gem_prime_import_sg_table(struct drm_device *dev, · 38 unmodified lines
588574 if (ret < 0)
589575 goto err_free_large;
590576
577+ exynos_gem_obj->sgt = sgt;
578+
591579 if (sgt->nents == 1) {
592580 /* always physically continuous memory if sgt->nents is 1. */
593581 exynos_gem_obj->flags |= EXYNOS_BO_CONTIG;
drivers/gpu/drm/exynos/exynos_drm_gem.h+2−4
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 * - this address could be physical address without IOMMU and
4040 * device address with IOMMU.
4141 * @pages: Array of backing pages.
42+ * @sgt: Imported sg_table.
4243 *
4344 * P.S. this object would be transferred to user as kms_bo.handle so
4445 * user can access the buffer through kms_bo.handle.
@@ -52,6 +53,7 @@ struct exynos_drm_gem_obj { · 7 unmodified lines
5253 dma_addr_t dma_addr;
5354 struct dma_attrs dma_attrs;
5455 struct page **pages;
56+ struct sg_table *sgt;
5557 };
5658
5759 struct page **exynos_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask);
@@ -59,10 +61,6 @@ struct page **exynos_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask); · 1 unmodified line
5961 /* destroy a buffer with gem object */
6062 void exynos_drm_gem_destroy(struct exynos_drm_gem_obj *exynos_gem_obj);
6163
62−/* create a private gem object and initialize it. */
63−struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev,
64− unsigned long size);
65−
6664 /* create a new buffer with gem object */
6765 struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev,
6866 unsigned int flags,
drivers/gpu/drm/exynos/exynos_drm_rotator.c+1−1
@@ -786,6 +786,7 @@ static int rotator_remove(struct platform_device *pdev) · 785 unmodified lines
786786 return 0;
787787 }
788788
789+#ifdef CONFIG_PM
789790 static int rotator_clk_crtl(struct rot_context *rot, bool enable)
790791 {
791792 if (enable) {
@@ -822,7 +823,6 @@ static int rotator_resume(struct device *dev) · 30 unmodified lines
822823 }
823824 #endif
824825
825−#ifdef CONFIG_PM
826826 static int rotator_runtime_suspend(struct device *dev)
827827 {
828828 struct rot_context *rot = dev_get_drvdata(dev);
drivers/gpu/drm/i915/intel_dp_mst.c+8−1
@@ -462,11 +462,17 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo · 461 unmodified lines
462462 drm_object_attach_property(&connector->base, dev->mode_config.tile_property, 0);
463463
464464 drm_mode_connector_set_path_property(connector, pathprop);
465+ return connector;
466+}
467+
468+static void intel_dp_register_mst_connector(struct drm_connector *connector)
469+{
470+ struct intel_connector *intel_connector = to_intel_connector(connector);
471+ struct drm_device *dev = connector->dev;
465472 drm_modeset_lock_all(dev);
466473 intel_connector_add_to_fbdev(intel_connector);
467474 drm_modeset_unlock_all(dev);
468475 drm_connector_register(&intel_connector->base);
469− return connector;
470476 }
471477
472478 static void intel_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr,
@@ -512,6 +518,7 @@ static void intel_dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr) · 39 unmodified lines
512518
513519 static struct drm_dp_mst_topology_cbs mst_cbs = {
514520 .add_connector = intel_dp_add_mst_connector,
521+ .register_connector = intel_dp_register_mst_connector,
515522 .destroy_connector = intel_dp_destroy_mst_connector,
516523 .hotplug = intel_dp_mst_hotplug,
517524 };
drivers/gpu/drm/i915/intel_hotplug.c+1−1
@@ -180,7 +180,7 @@ static void intel_hpd_irq_storm_disable(struct drm_i915_private *dev_priv) · 179 unmodified lines
180180
181181 /* Enable polling and queue hotplug re-enabling. */
182182 if (hpd_disabled) {
183− drm_kms_helper_poll_enable(dev);
183+ drm_kms_helper_poll_enable_locked(dev);
184184 mod_delayed_work(system_wq, &dev_priv->hotplug.reenable_work,
185185 msecs_to_jiffies(HPD_STORM_REENABLE_DELAY));
186186 }
drivers/gpu/drm/i915/intel_lrc.c+32−7
@@ -484,18 +484,18 @@ void intel_lrc_irq_handler(struct intel_engine_cs *ring) · 483 unmodified lines
484484 status_pointer = I915_READ(RING_CONTEXT_STATUS_PTR(ring));
485485
486486 read_pointer = ring->next_context_status_buffer;
487− write_pointer = status_pointer & 0x07;
487+ write_pointer = status_pointer & GEN8_CSB_PTR_MASK;
488488 if (read_pointer > write_pointer)
489− write_pointer += 6;
489+ write_pointer += GEN8_CSB_ENTRIES;
490490
491491 spin_lock(&ring->execlist_lock);
492492
493493 while (read_pointer < write_pointer) {
494494 read_pointer++;
495495 status = I915_READ(RING_CONTEXT_STATUS_BUF(ring) +
496− (read_pointer % 6) * 8);
496+ (read_pointer % GEN8_CSB_ENTRIES) * 8);
497497 status_id = I915_READ(RING_CONTEXT_STATUS_BUF(ring) +
498− (read_pointer % 6) * 8 + 4);
498+ (read_pointer % GEN8_CSB_ENTRIES) * 8 + 4);
499499
500500 if (status & GEN8_CTX_STATUS_IDLE_ACTIVE)
501501 continue;
@@ -521,10 +521,12 @@ void intel_lrc_irq_handler(struct intel_engine_cs *ring) · 19 unmodified lines
521521 spin_unlock(&ring->execlist_lock);
522522
523523 WARN(submit_contexts > 2, "More than two context complete events?\n");
524− ring->next_context_status_buffer = write_pointer % 6;
524+ ring->next_context_status_buffer = write_pointer % GEN8_CSB_ENTRIES;
525525
526526 I915_WRITE(RING_CONTEXT_STATUS_PTR(ring),
527− _MASKED_FIELD(0x07 << 8, ((u32)ring->next_context_status_buffer & 0x07) << 8));
527+ _MASKED_FIELD(GEN8_CSB_PTR_MASK << 8,
528+ ((u32)ring->next_context_status_buffer &
529+ GEN8_CSB_PTR_MASK) << 8));
528530 }
529531
530532 static int execlists_context_queue(struct drm_i915_gem_request *request)
@@ -1422,6 +1424,7 @@ static int gen8_init_common_ring(struct intel_engine_cs *ring) · 891 unmodified lines
14221424 {
14231425 struct drm_device *dev = ring->dev;
14241426 struct drm_i915_private *dev_priv = dev->dev_private;
1427+ u8 next_context_status_buffer_hw;
14251428
14261429 I915_WRITE_IMR(ring, ~(ring->irq_enable_mask | ring->irq_keep_mask));
14271430 I915_WRITE(RING_HWSTAM(ring->mmio_base), 0xffffffff);
@@ -1436,7 +1439,29 @@ static int gen8_init_common_ring(struct intel_engine_cs *ring) · 8 unmodified lines
14361439 _MASKED_BIT_DISABLE(GFX_REPLAY_MODE) |
14371440 _MASKED_BIT_ENABLE(GFX_RUN_LIST_ENABLE));
14381441 POSTING_READ(RING_MODE_GEN7(ring));
1439− ring->next_context_status_buffer = 0;
1442+
1443+ /*
1444+ * Instead of resetting the Context Status Buffer (CSB) read pointer to
1445+ * zero, we need to read the write pointer from hardware and use its
1446+ * value because "this register is power context save restored".
1447+ * Effectively, these states have been observed:
1448+ *
1449+ * | Suspend-to-idle (freeze) | Suspend-to-RAM (mem) |
1450+ * BDW | CSB regs not reset | CSB regs reset |
1451+ * CHT | CSB regs not reset | CSB regs not reset |
1452+ */
1453+ next_context_status_buffer_hw = (I915_READ(RING_CONTEXT_STATUS_PTR(ring))
1454+ & GEN8_CSB_PTR_MASK);
1455+
1456+ /*
1457+ * When the CSB registers are reset (also after power-up / gpu reset),
1458+ * CSB write pointer is set to all 1's, which is not valid, use '5' in
1459+ * this special case, so the first element read is CSB[0].
1460+ */
1461+ if (next_context_status_buffer_hw == GEN8_CSB_PTR_MASK)
1462+ next_context_status_buffer_hw = (GEN8_CSB_ENTRIES - 1);
1463+
1464+ ring->next_context_status_buffer = next_context_status_buffer_hw;
14401465 DRM_DEBUG_DRIVER("Execlists enabled for %s\n", ring->name);
14411466
14421467 memset(&ring->hangcheck, 0, sizeof(ring->hangcheck));
drivers/gpu/drm/i915/intel_lrc.h+2−0
@@ -25,6 +25,8 @@ · 24 unmodified lines
2525 #define _INTEL_LRC_H_
2626
2727 #define GEN8_LR_CONTEXT_ALIGN 4096
28+#define GEN8_CSB_ENTRIES 6
29+#define GEN8_CSB_PTR_MASK 0x07
2830
2931 /* Execlists regs */
3032 #define RING_ELSP(ring) ((ring)->mmio_base+0x230)
drivers/gpu/drm/i915/intel_runtime_pm.c+2−1
@@ -246,7 +246,8 @@ static void skl_power_well_post_enable(struct drm_i915_private *dev_priv, · 245 unmodified lines
246246 }
247247
248248 if (power_well->data == SKL_DISP_PW_1) {
249− intel_prepare_ddi(dev);
249+ if (!dev_priv->power_domains.initializing)
250+ intel_prepare_ddi(dev);
250251 gen8_irq_power_well_post_enable(dev_priv, 1 << PIPE_A);
251252 }
252253 }
drivers/gpu/drm/qxl/qxl_display.c+1−1
@@ -618,7 +618,7 @@ static int qxl_crtc_mode_set(struct drm_crtc *crtc, · 617 unmodified lines
618618 adjusted_mode->hdisplay,
619619 adjusted_mode->vdisplay);
620620
621− if (qcrtc->index == 0)
621+ if (bo->is_primary == false)
622622 recreate_primary = true;
623623
624624 if (bo->surf.stride * bo->surf.height > qdev->vram_size) {
drivers/gpu/drm/radeon/atombios_encoders.c+4−4
@@ -1624,8 +1624,9 @@ radeon_atom_encoder_dpms_avivo(struct drm_encoder *encoder, int mode) · 1623 unmodified lines
16241624 } else
16251625 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
16261626 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
1627− args.ucAction = ATOM_LCD_BLON;
1628− atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
1627+ struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
1628+
1629+ atombios_set_backlight_level(radeon_encoder, dig->backlight_level);
16291630 }
16301631 break;
16311632 case DRM_MODE_DPMS_STANDBY:
@@ -1706,8 +1707,7 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode) · 74 unmodified lines
17061707 atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON, 0);
17071708 }
17081709 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT))
1709− atombios_dig_transmitter_setup(encoder,
1710− ATOM_TRANSMITTER_ACTION_LCD_BLON, 0, 0);
1710+ atombios_set_backlight_level(radeon_encoder, dig->backlight_level);
17111711 if (ext_encoder)
17121712 atombios_external_encoder_setup(encoder, ext_encoder, ATOM_ENABLE);
17131713 break;
drivers/gpu/drm/radeon/radeon_dp_mst.c+9−2
@@ -265,7 +265,6 @@ static struct drm_connector *radeon_dp_add_mst_connector(struct drm_dp_mst_topol · 264 unmodified lines
265265 {
266266 struct radeon_connector *master = container_of(mgr, struct radeon_connector, mst_mgr);
267267 struct drm_device *dev = master->base.dev;
268− struct radeon_device *rdev = dev->dev_private;
269268 struct radeon_connector *radeon_connector;
270269 struct drm_connector *connector;
271270
@@ -286,12 +285,19 @@ static struct drm_connector *radeon_dp_add_mst_connector(struct drm_dp_mst_topol · 14 unmodified lines
286285 drm_object_attach_property(&connector->base, dev->mode_config.path_property, 0);
287286 drm_mode_connector_set_path_property(connector, pathprop);
288287
288+ return connector;
289+}
290+
291+static void radeon_dp_register_mst_connector(struct drm_connector *connector)
292+{
293+ struct drm_device *dev = connector->dev;
294+ struct radeon_device *rdev = dev->dev_private;
295+
289296 drm_modeset_lock_all(dev);
290297 radeon_fb_add_connector(rdev, connector);
291298 drm_modeset_unlock_all(dev);
292299
293300 drm_connector_register(connector);
294− return connector;
295301 }
296302
297303 static void radeon_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr,
@@ -324,6 +330,7 @@ static void radeon_dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr) · 26 unmodified lines
324330
325331 struct drm_dp_mst_topology_cbs mst_cbs = {
326332 .add_connector = radeon_dp_add_mst_connector,
333+ .register_connector = radeon_dp_register_mst_connector,
327334 .destroy_connector = radeon_dp_destroy_mst_connector,
328335 .hotplug = radeon_dp_mst_hotplug,
329336 };
drivers/gpu/drm/radeon/radeon_fb.c+1−31
@@ -48,40 +48,10 @@ struct radeon_fbdev { · 47 unmodified lines
4848 struct radeon_device *rdev;
4949 };
5050
51−/**
52− * radeon_fb_helper_set_par - Hide cursor on CRTCs used by fbdev.
53− *
54− * @info: fbdev info
55− *
56− * This function hides the cursor on all CRTCs used by fbdev.
57− */
58−static int radeon_fb_helper_set_par(struct fb_info *info)
59−{
60− int ret;
61−
62− ret = drm_fb_helper_set_par(info);
63−
64− /* XXX: with universal plane support fbdev will automatically disable
65− * all non-primary planes (including the cursor)
66− */
67− if (ret == 0) {
68− struct drm_fb_helper *fb_helper = info->par;
69− int i;
70−
71− for (i = 0; i < fb_helper->crtc_count; i++) {
72− struct drm_crtc *crtc = fb_helper->crtc_info[i].mode_set.crtc;
73−
74− radeon_crtc_cursor_set2(crtc, NULL, 0, 0, 0, 0, 0);
75− }
76− }
77−
78− return ret;
79−}
80−
8151 static struct fb_ops radeonfb_ops = {
8252 .owner = THIS_MODULE,
8353 .fb_check_var = drm_fb_helper_check_var,
84− .fb_set_par = radeon_fb_helper_set_par,
54+ .fb_set_par = drm_fb_helper_set_par,
8555 .fb_fillrect = drm_fb_helper_cfb_fillrect,
8656 .fb_copyarea = drm_fb_helper_cfb_copyarea,
8757 .fb_imageblit = drm_fb_helper_cfb_imageblit,
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c+8−0
@@ -681,6 +681,14 @@ static bool vmw_cmdbuf_try_alloc(struct vmw_cmdbuf_man *man, · 680 unmodified lines
681681 0, 0,
682682 DRM_MM_SEARCH_DEFAULT,
683683 DRM_MM_CREATE_DEFAULT);
684+ if (ret) {
685+ (void) vmw_cmdbuf_man_process(man);
686+ ret = drm_mm_insert_node_generic(&man->mm, info->node,
687+ info->page_size, 0, 0,
688+ DRM_MM_SEARCH_DEFAULT,
689+ DRM_MM_CREATE_DEFAULT);
690+ }
691+
684692 spin_unlock_bh(&man->lock);
685693 info->done = !ret;
686694
drivers/hwmon/abx500.c+1−0
@@ -470,6 +470,7 @@ static const struct of_device_id abx500_temp_match[] = { · 469 unmodified lines
470470 { .compatible = "stericsson,abx500-temp" },
471471 {},
472472 };
473+MODULE_DEVICE_TABLE(of, abx500_temp_match);
473474 #endif
474475
475476 static struct platform_driver abx500_temp_driver = {
drivers/hwmon/gpio-fan.c+1−0
@@ -539,6 +539,7 @@ static const struct of_device_id of_gpio_fan_match[] = { · 538 unmodified lines
539539 { .compatible = "gpio-fan", },
540540 {},
541541 };
542+MODULE_DEVICE_TABLE(of, of_gpio_fan_match);
542543 #endif /* CONFIG_OF_GPIO */
543544
544545 static int gpio_fan_probe(struct platform_device *pdev)
drivers/hwmon/pwm-fan.c+1−0
@@ -323,6 +323,7 @@ static const struct of_device_id of_pwm_fan_match[] = { · 322 unmodified lines
323323 { .compatible = "pwm-fan", },
324324 {},
325325 };
326+MODULE_DEVICE_TABLE(of, of_pwm_fan_match);
326327
327328 static struct platform_driver pwm_fan_driver = {
328329 .probe = pwm_fan_probe,
drivers/idle/intel_idle.c+10−2
@@ -620,7 +620,7 @@ static struct cpuidle_state skl_cstates[] = { · 619 unmodified lines
620620 .name = "C6-SKL",
621621 .desc = "MWAIT 0x20",
622622 .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
623− .exit_latency = 75,
623+ .exit_latency = 85,
624624 .target_residency = 200,
625625 .enter = &intel_idle,
626626 .enter_freeze = intel_idle_freeze, },
@@ -636,10 +636,18 @@ static struct cpuidle_state skl_cstates[] = { · 9 unmodified lines
636636 .name = "C8-SKL",
637637 .desc = "MWAIT 0x40",
638638 .flags = MWAIT2flg(0x40) | CPUIDLE_FLAG_TLB_FLUSHED,
639− .exit_latency = 174,
639+ .exit_latency = 200,
640640 .target_residency = 800,
641641 .enter = &intel_idle,
642642 .enter_freeze = intel_idle_freeze, },
643+ {
644+ .name = "C9-SKL",
645+ .desc = "MWAIT 0x50",
646+ .flags = MWAIT2flg(0x50) | CPUIDLE_FLAG_TLB_FLUSHED,
647+ .exit_latency = 480,
648+ .target_residency = 5000,
649+ .enter = &intel_idle,
650+ .enter_freeze = intel_idle_freeze, },
643651 {
644652 .name = "C10-SKL",
645653 .desc = "MWAIT 0x60",
drivers/infiniband/hw/mlx5/main.c+1−66
@@ -245,7 +245,6 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, · 244 unmodified lines
245245 props->device_cap_flags |= IB_DEVICE_BAD_QKEY_CNTR;
246246 if (MLX5_CAP_GEN(mdev, apm))
247247 props->device_cap_flags |= IB_DEVICE_AUTO_PATH_MIG;
248− props->device_cap_flags |= IB_DEVICE_LOCAL_DMA_LKEY;
249248 if (MLX5_CAP_GEN(mdev, xrc))
250249 props->device_cap_flags |= IB_DEVICE_XRC;
251250 props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS;
@@ -795,53 +794,6 @@ static int mlx5_ib_mmap(struct ib_ucontext *ibcontext, struct vm_area_struct *vm · 543 unmodified lines
795794 return 0;
796795 }
797796
798−static int alloc_pa_mkey(struct mlx5_ib_dev *dev, u32 *key, u32 pdn)
799−{
800− struct mlx5_create_mkey_mbox_in *in;
801− struct mlx5_mkey_seg *seg;
802− struct mlx5_core_mr mr;
803− int err;
804−
805− in = kzalloc(sizeof(*in), GFP_KERNEL);
806− if (!in)
807− return -ENOMEM;
808−
809− seg = &in->seg;
810− seg->flags = MLX5_PERM_LOCAL_READ | MLX5_ACCESS_MODE_PA;
811− seg->flags_pd = cpu_to_be32(pdn | MLX5_MKEY_LEN64);
812− seg->qpn_mkey7_0 = cpu_to_be32(0xffffff << 8);
813− seg->start_addr = 0;
814−
815− err = mlx5_core_create_mkey(dev->mdev, &mr, in, sizeof(*in),
816− NULL, NULL, NULL);
817− if (err) {
818− mlx5_ib_warn(dev, "failed to create mkey, %d\n", err);
819− goto err_in;
820− }
821−
822− kfree(in);
823− *key = mr.key;
824−
825− return 0;
826−
827−err_in:
828− kfree(in);
829−
830− return err;
831−}
832−
833−static void free_pa_mkey(struct mlx5_ib_dev *dev, u32 key)
834−{
835− struct mlx5_core_mr mr;
836− int err;
837−
838− memset(&mr, 0, sizeof(mr));
839− mr.key = key;
840− err = mlx5_core_destroy_mkey(dev->mdev, &mr);
841− if (err)
842− mlx5_ib_warn(dev, "failed to destroy mkey 0x%x\n", key);
843−}
844−
845797 static struct ib_pd *mlx5_ib_alloc_pd(struct ib_device *ibdev,
846798 struct ib_ucontext *context,
847799 struct ib_udata *udata)
@@ -867,13 +819,6 @@ static struct ib_pd *mlx5_ib_alloc_pd(struct ib_device *ibdev, · 19 unmodified lines
867819 kfree(pd);
868820 return ERR_PTR(-EFAULT);
869821 }
870− } else {
871− err = alloc_pa_mkey(to_mdev(ibdev), &pd->pa_lkey, pd->pdn);
872− if (err) {
873− mlx5_core_dealloc_pd(to_mdev(ibdev)->mdev, pd->pdn);
874− kfree(pd);
875− return ERR_PTR(err);
876− }
877822 }
878823
879824 return &pd->ibpd;
@@ -884,9 +829,6 @@ static int mlx5_ib_dealloc_pd(struct ib_pd *pd) · 4 unmodified lines
884829 struct mlx5_ib_dev *mdev = to_mdev(pd->device);
885830 struct mlx5_ib_pd *mpd = to_mpd(pd);
886831
887− if (!pd->uobject)
888− free_pa_mkey(mdev, mpd->pa_lkey);
889−
890832 mlx5_core_dealloc_pd(mdev->mdev, mpd->pdn);
891833 kfree(mpd);
892834
@@ -1245,18 +1187,10 @@ static int create_dev_resources(struct mlx5_ib_resources *devr) · 352 unmodified lines
12451187 struct ib_srq_init_attr attr;
12461188 struct mlx5_ib_dev *dev;
12471189 struct ib_cq_init_attr cq_attr = {.cqe = 1};
1248− u32 rsvd_lkey;
12491190 int ret = 0;
12501191
12511192 dev = container_of(devr, struct mlx5_ib_dev, devr);
12521193
1253− ret = mlx5_core_query_special_context(dev->mdev, &rsvd_lkey);
1254− if (ret) {
1255− pr_err("Failed to query special context %d\n", ret);
1256− return ret;
1257− }
1258− dev->ib_dev.local_dma_lkey = rsvd_lkey;
1259−
12601194 devr->p0 = mlx5_ib_alloc_pd(&dev->ib_dev, NULL, NULL);
12611195 if (IS_ERR(devr->p0)) {
12621196 ret = PTR_ERR(devr->p0);
@@ -1418,6 +1352,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) · 155 unmodified lines
14181352 strlcpy(dev->ib_dev.name, "mlx5_%d", IB_DEVICE_NAME_MAX);
14191353 dev->ib_dev.owner = THIS_MODULE;
14201354 dev->ib_dev.node_type = RDMA_NODE_IB_CA;
1355+ dev->ib_dev.local_dma_lkey = 0 /* not supported for now */;
14211356 dev->num_ports = MLX5_CAP_GEN(mdev, num_ports);
14221357 dev->ib_dev.phys_port_cnt = dev->num_ports;
14231358 dev->ib_dev.num_comp_vectors =
drivers/infiniband/hw/mlx5/mlx5_ib.h+0−2
@@ -103,7 +103,6 @@ static inline struct mlx5_ib_ucontext *to_mucontext(struct ib_ucontext *ibuconte · 102 unmodified lines
103103 struct mlx5_ib_pd {
104104 struct ib_pd ibpd;
105105 u32 pdn;
106− u32 pa_lkey;
107106 };
108107
109108 /* Use macros here so that don't have to duplicate
@@ -213,7 +212,6 @@ struct mlx5_ib_qp { · 103 unmodified lines
213212 int uuarn;
214213
215214 int create_type;
216− u32 pa_lkey;
217215
218216 /* Store signature errors */
219217 bool signature_en;
drivers/infiniband/hw/mlx5/qp.c+1−3
@@ -925,8 +925,6 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, · 924 unmodified lines
925925 err = create_kernel_qp(dev, init_attr, qp, &in, &inlen);
926926 if (err)
927927 mlx5_ib_dbg(dev, "err %d\n", err);
928− else
929− qp->pa_lkey = to_mpd(pd)->pa_lkey;
930928 }
931929
932930 if (err)
@@ -2045,7 +2043,7 @@ static void set_frwr_pages(struct mlx5_wqe_data_seg *dseg, · 1112 unmodified lines
20452043 mfrpl->mapped_page_list[i] = cpu_to_be64(page_list[i] | perm);
20462044 dseg->addr = cpu_to_be64(mfrpl->map);
20472045 dseg->byte_count = cpu_to_be32(ALIGN(sizeof(u64) * wr->wr.fast_reg.page_list_len, 64));
2048− dseg->lkey = cpu_to_be32(pd->pa_lkey);
2046+ dseg->lkey = cpu_to_be32(pd->ibpd.local_dma_lkey);
20492047 }
20502048
20512049 static __be32 send_ieth(struct ib_send_wr *wr)
drivers/infiniband/ulp/ipoib/ipoib.h+3−1
@@ -80,7 +80,7 @@ enum { · 79 unmodified lines
8080 IPOIB_NUM_WC = 4,
8181
8282 IPOIB_MAX_PATH_REC_QUEUE = 3,
83− IPOIB_MAX_MCAST_QUEUE = 3,
83+ IPOIB_MAX_MCAST_QUEUE = 64,
8484
8585 IPOIB_FLAG_OPER_UP = 0,
8686 IPOIB_FLAG_INITIALIZED = 1,
@@ -548,6 +548,8 @@ void ipoib_path_iter_read(struct ipoib_path_iter *iter, · 461 unmodified lines
548548
549549 int ipoib_mcast_attach(struct net_device *dev, u16 mlid,
550550 union ib_gid *mgid, int set_qkey);
551+int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast);
552+struct ipoib_mcast *__ipoib_mcast_find(struct net_device *dev, void *mgid);
551553
552554 int ipoib_init_qp(struct net_device *dev);
553555 int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca);
drivers/infiniband/ulp/ipoib/ipoib_main.c+18−0
@@ -1149,6 +1149,9 @@ static void __ipoib_reap_neigh(struct ipoib_dev_priv *priv) · 1148 unmodified lines
11491149 unsigned long dt;
11501150 unsigned long flags;
11511151 int i;
1152+ LIST_HEAD(remove_list);
1153+ struct ipoib_mcast *mcast, *tmcast;
1154+ struct net_device *dev = priv->dev;
11521155
11531156 if (test_bit(IPOIB_STOP_NEIGH_GC, &priv->flags))
11541157 return;
@@ -1176,6 +1179,19 @@ static void __ipoib_reap_neigh(struct ipoib_dev_priv *priv) · 21 unmodified lines
11761179 lockdep_is_held(&priv->lock))) != NULL) {
11771180 /* was the neigh idle for two GC periods */
11781181 if (time_after(neigh_obsolete, neigh->alive)) {
1182+ u8 *mgid = neigh->daddr + 4;
1183+
1184+ /* Is this multicast ? */
1185+ if (*mgid == 0xff) {
1186+ mcast = __ipoib_mcast_find(dev, mgid);
1187+
1188+ if (mcast && test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags)) {
1189+ list_del(&mcast->list);
1190+ rb_erase(&mcast->rb_node, &priv->multicast_tree);
1191+ list_add_tail(&mcast->list, &remove_list);
1192+ }
1193+ }
1194+
11791195 rcu_assign_pointer(*np,
11801196 rcu_dereference_protected(neigh->hnext,
11811197 lockdep_is_held(&priv->lock)));
@@ -1191,6 +1207,8 @@ static void __ipoib_reap_neigh(struct ipoib_dev_priv *priv) · 9 unmodified lines
11911207
11921208 out_unlock:
11931209 spin_unlock_irqrestore(&priv->lock, flags);
1210+ list_for_each_entry_safe(mcast, tmcast, &remove_list, list)
1211+ ipoib_mcast_leave(dev, mcast);
11941212 }
11951213
11961214 static void ipoib_reap_neigh(struct work_struct *work)
drivers/infiniband/ulp/ipoib/ipoib_multicast.c+14−12
@@ -153,7 +153,7 @@ static struct ipoib_mcast *ipoib_mcast_alloc(struct net_device *dev, · 152 unmodified lines
153153 return mcast;
154154 }
155155
156−static struct ipoib_mcast *__ipoib_mcast_find(struct net_device *dev, void *mgid)
156+struct ipoib_mcast *__ipoib_mcast_find(struct net_device *dev, void *mgid)
157157 {
158158 struct ipoib_dev_priv *priv = netdev_priv(dev);
159159 struct rb_node *n = priv->multicast_tree.rb_node;
@@ -508,17 +508,19 @@ static void ipoib_mcast_join(struct net_device *dev, struct ipoib_mcast *mcast) · 348 unmodified lines
508508 rec.hop_limit = priv->broadcast->mcmember.hop_limit;
509509
510510 /*
511− * Historically Linux IPoIB has never properly supported SEND
512− * ONLY join. It emulated it by not providing all the required
513− * attributes, which is enough to prevent group creation and
514− * detect if there are full members or not. A major problem
515− * with supporting SEND ONLY is detecting when the group is
516− * auto-destroyed as IPoIB will cache the MLID..
511+ * Send-only IB Multicast joins do not work at the core
512+ * IB layer yet, so we can't use them here. However,
513+ * we are emulating an Ethernet multicast send, which
514+ * does not require a multicast subscription and will
515+ * still send properly. The most appropriate thing to
516+ * do is to create the group if it doesn't exist as that
517+ * most closely emulates the behavior, from a user space
518+ * application perspecitive, of Ethernet multicast
519+ * operation. For now, we do a full join, maybe later
520+ * when the core IB layers support send only joins we
521+ * will use them.
517522 */
518−#if 1
519− if (test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags))
520− comp_mask &= ~IB_SA_MCMEMBER_REC_TRAFFIC_CLASS;
521−#else
523+#if 0
522524 if (test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags))
523525 rec.join_state = 4;
524526 #endif
@@ -675,7 +677,7 @@ int ipoib_mcast_stop_thread(struct net_device *dev) · 150 unmodified lines
675677 return 0;
676678 }
677679
678−static int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast)
680+int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast)
679681 {
680682 struct ipoib_dev_priv *priv = netdev_priv(dev);
681683 int ret = 0;
drivers/infiniband/ulp/iser/iscsi_iser.c+5−0
@@ -97,6 +97,11 @@ unsigned int iser_max_sectors = ISER_DEF_MAX_SECTORS; · 96 unmodified lines
9797 module_param_named(max_sectors, iser_max_sectors, uint, S_IRUGO | S_IWUSR);
9898 MODULE_PARM_DESC(max_sectors, "Max number of sectors in a single scsi command (default:1024");
9999
100+bool iser_always_reg = true;
101+module_param_named(always_register, iser_always_reg, bool, S_IRUGO);
102+MODULE_PARM_DESC(always_register,
103+ "Always register memory, even for continuous memory regions (default:true)");
104+
100105 bool iser_pi_enable = false;
101106 module_param_named(pi_enable, iser_pi_enable, bool, S_IRUGO);
102107 MODULE_PARM_DESC(pi_enable, "Enable T10-PI offload support (default:disabled)");
drivers/infiniband/ulp/iser/iscsi_iser.h+1−0
@@ -611,6 +611,7 @@ extern int iser_debug_level; · 610 unmodified lines
611611 extern bool iser_pi_enable;
612612 extern int iser_pi_guard;
613613 extern unsigned int iser_max_sectors;
614+extern bool iser_always_reg;
614615
615616 int iser_assign_reg_ops(struct iser_device *device);
616617
drivers/infiniband/ulp/iser/iser_memory.c+12−6
@@ -803,11 +803,12 @@ static int · 802 unmodified lines
803803 iser_reg_prot_sg(struct iscsi_iser_task *task,
804804 struct iser_data_buf *mem,
805805 struct iser_fr_desc *desc,
806+ bool use_dma_key,
806807 struct iser_mem_reg *reg)
807808 {
808809 struct iser_device *device = task->iser_conn->ib_conn.device;
809810
810− if (mem->dma_nents == 1)
811+ if (use_dma_key)
811812 return iser_reg_dma(device, mem, reg);
812813
813814 return device->reg_ops->reg_mem(task, mem, &desc->pi_ctx->rsc, reg);
@@ -817,11 +818,12 @@ static int · 3 unmodified lines
817818 iser_reg_data_sg(struct iscsi_iser_task *task,
818819 struct iser_data_buf *mem,
819820 struct iser_fr_desc *desc,
821+ bool use_dma_key,
820822 struct iser_mem_reg *reg)
821823 {
822824 struct iser_device *device = task->iser_conn->ib_conn.device;
823825
824− if (mem->dma_nents == 1)
826+ if (use_dma_key)
825827 return iser_reg_dma(device, mem, reg);
826828
827829 return device->reg_ops->reg_mem(task, mem, &desc->rsc, reg);
@@ -836,14 +838,17 @@ int iser_reg_rdma_mem(struct iscsi_iser_task *task, · 8 unmodified lines
836838 struct iser_mem_reg *reg = &task->rdma_reg[dir];
837839 struct iser_mem_reg *data_reg;
838840 struct iser_fr_desc *desc = NULL;
841+ bool use_dma_key;
839842 int err;
840843
841844 err = iser_handle_unaligned_buf(task, mem, dir);
842845 if (unlikely(err))
843846 return err;
844847
845− if (mem->dma_nents != 1 ||
846− scsi_get_prot_op(task->sc) != SCSI_PROT_NORMAL) {
848+ use_dma_key = (mem->dma_nents == 1 && !iser_always_reg &&
849+ scsi_get_prot_op(task->sc) == SCSI_PROT_NORMAL);
850+
851+ if (!use_dma_key) {
847852 desc = device->reg_ops->reg_desc_get(ib_conn);
848853 reg->mem_h = desc;
849854 }
@@ -853,7 +858,7 @@ int iser_reg_rdma_mem(struct iscsi_iser_task *task, · 3 unmodified lines
853858 else
854859 data_reg = &task->desc.data_reg;
855860
856− err = iser_reg_data_sg(task, mem, desc, data_reg);
861+ err = iser_reg_data_sg(task, mem, desc, use_dma_key, data_reg);
857862 if (unlikely(err))
858863 goto err_reg;
859864
@@ -866,7 +871,8 @@ int iser_reg_rdma_mem(struct iscsi_iser_task *task, · 6 unmodified lines
866871 if (unlikely(err))
867872 goto err_reg;
868873
869− err = iser_reg_prot_sg(task, mem, desc, prot_reg);
874+ err = iser_reg_prot_sg(task, mem, desc,
875+ use_dma_key, prot_reg);
870876 if (unlikely(err))
871877 goto err_reg;
872878 }
drivers/infiniband/ulp/iser/iser_verbs.c+13−8
@@ -133,11 +133,15 @@ static int iser_create_device_ib_res(struct iser_device *device) · 132 unmodified lines
133133 (unsigned long)comp);
134134 }
135135
136− device->mr = ib_get_dma_mr(device->pd, IB_ACCESS_LOCAL_WRITE |
137− IB_ACCESS_REMOTE_WRITE |
138− IB_ACCESS_REMOTE_READ);
139− if (IS_ERR(device->mr))
140− goto dma_mr_err;
136+ if (!iser_always_reg) {
137+ int access = IB_ACCESS_LOCAL_WRITE |
138+ IB_ACCESS_REMOTE_WRITE |
139+ IB_ACCESS_REMOTE_READ;
140+
141+ device->mr = ib_get_dma_mr(device->pd, access);
142+ if (IS_ERR(device->mr))
143+ goto dma_mr_err;
144+ }
141145
142146 INIT_IB_EVENT_HANDLER(&device->event_handler, device->ib_device,
143147 iser_event_handler);
@@ -147,7 +151,8 @@ static int iser_create_device_ib_res(struct iser_device *device) · 3 unmodified lines
147151 return 0;
148152
149153 handler_err:
150− ib_dereg_mr(device->mr);
154+ if (device->mr)
155+ ib_dereg_mr(device->mr);
151156 dma_mr_err:
152157 for (i = 0; i < device->comps_used; i++)
153158 tasklet_kill(&device->comps[i].tasklet);
@@ -173,7 +178,6 @@ comps_err: · 19 unmodified lines
173178 static void iser_free_device_ib_res(struct iser_device *device)
174179 {
175180 int i;
176− BUG_ON(device->mr == NULL);
177181
178182 for (i = 0; i < device->comps_used; i++) {
179183 struct iser_comp *comp = &device->comps[i];
@@ -184,7 +188,8 @@ static void iser_free_device_ib_res(struct iser_device *device) · 4 unmodified lines
184188 }
185189
186190 (void)ib_unregister_event_handler(&device->event_handler);
187− (void)ib_dereg_mr(device->mr);
191+ if (device->mr)
192+ (void)ib_dereg_mr(device->mr);
188193 ib_dealloc_pd(device->pd);
189194
190195 kfree(device->comps);
drivers/input/joystick/Kconfig+1−0
@@ -196,6 +196,7 @@ config JOYSTICK_TWIDJOY · 195 unmodified lines
196196 config JOYSTICK_ZHENHUA
197197 tristate "5-byte Zhenhua RC transmitter"
198198 select SERIO
199+ select BITREVERSE
199200 help
200201 Say Y here if you have a Zhen Hua PPM-4CH transmitter which is
201202 supplied with a ready to fly micro electric indoor helicopters
drivers/input/joystick/walkera0701.c+2−2
@@ -150,7 +150,7 @@ static void walkera0701_irq_handler(void *handler_data) · 149 unmodified lines
150150 if (w->counter == 24) { /* full frame */
151151 walkera0701_parse_frame(w);
152152 w->counter = NO_SYNC;
153− if (abs(pulse_time - SYNC_PULSE) < RESERVE) /* new frame sync */
153+ if (abs64(pulse_time - SYNC_PULSE) < RESERVE) /* new frame sync */
154154 w->counter = 0;
155155 } else {
156156 if ((pulse_time > (ANALOG_MIN_PULSE - RESERVE)
@@ -161,7 +161,7 @@ static void walkera0701_irq_handler(void *handler_data) · 4 unmodified lines
161161 } else
162162 w->counter = NO_SYNC;
163163 }
164− } else if (abs(pulse_time - SYNC_PULSE - BIN0_PULSE) <
164+ } else if (abs64(pulse_time - SYNC_PULSE - BIN0_PULSE) <
165165 RESERVE + BIN1_PULSE - BIN0_PULSE) /* frame sync .. */
166166 w->counter = 0;
167167
drivers/input/keyboard/omap4-keypad.c+1−1
@@ -266,7 +266,7 @@ static int omap4_keypad_probe(struct platform_device *pdev) · 265 unmodified lines
266266
267267 error = omap4_keypad_parse_dt(&pdev->dev, keypad_data);
268268 if (error)
269− return error;
269+ goto err_free_keypad;
270270
271271 res = request_mem_region(res->start, resource_size(res), pdev->name);
272272 if (!res) {
drivers/input/misc/pm8941-pwrkey.c+1−1
@@ -93,7 +93,7 @@ static int pm8941_reboot_notify(struct notifier_block *nb, · 92 unmodified lines
9393 default:
9494 reset_type = PON_PS_HOLD_TYPE_HARD_RESET;
9595 break;
96− };
96+ }
9797
9898 error = regmap_update_bits(pwrkey->regmap,
9999 pwrkey->baseaddr + PON_PS_HOLD_RST_CTL,
drivers/input/misc/uinput.c+1−1
@@ -414,7 +414,7 @@ static int uinput_setup_device(struct uinput_device *udev, · 413 unmodified lines
414414 dev->id.product = user_dev->id.product;
415415 dev->id.version = user_dev->id.version;
416416
417− for_each_set_bit(i, dev->absbit, ABS_CNT) {
417+ for (i = 0; i < ABS_CNT; i++) {
418418 input_abs_set_max(dev, i, user_dev->absmax[i]);
419419 input_abs_set_min(dev, i, user_dev->absmin[i]);
420420 input_abs_set_fuzz(dev, i, user_dev->absfuzz[i]);
drivers/input/mouse/elan_i2c.h+1−1
@@ -60,7 +60,7 @@ struct elan_transport_ops { · 59 unmodified lines
6060 int (*get_sm_version)(struct i2c_client *client,
6161 u8* ic_type, u8 *version);
6262 int (*get_checksum)(struct i2c_client *client, bool iap, u16 *csum);
63− int (*get_product_id)(struct i2c_client *client, u8 *id);
63+ int (*get_product_id)(struct i2c_client *client, u16 *id);
6464
6565 int (*get_max)(struct i2c_client *client,
6666 unsigned int *max_x, unsigned int *max_y);
drivers/input/mouse/elan_i2c_core.c+19−7
@@ -40,7 +40,7 @@ · 39 unmodified lines
4040 #include "elan_i2c.h"
4141
4242 #define DRIVER_NAME "elan_i2c"
43−#define ELAN_DRIVER_VERSION "1.6.0"
43+#define ELAN_DRIVER_VERSION "1.6.1"
4444 #define ETP_MAX_PRESSURE 255
4545 #define ETP_FWIDTH_REDUCE 90
4646 #define ETP_FINGER_WIDTH 15
@@ -76,7 +76,7 @@ struct elan_tp_data { · 29 unmodified lines
7676 unsigned int x_res;
7777 unsigned int y_res;
7878
79− u8 product_id;
79+ u16 product_id;
8080 u8 fw_version;
8181 u8 sm_version;
8282 u8 iap_version;
@@ -98,15 +98,25 @@ static int elan_get_fwinfo(u8 iap_version, u16 *validpage_count, · 15 unmodified lines
9898 u16 *signature_address)
9999 {
100100 switch (iap_version) {
101+ case 0x00:
102+ case 0x06:
101103 case 0x08:
102104 *validpage_count = 512;
103105 break;
106+ case 0x03:
107+ case 0x07:
104108 case 0x09:
109+ case 0x0A:
110+ case 0x0B:
111+ case 0x0C:
105112 *validpage_count = 768;
106113 break;
107114 case 0x0D:
108115 *validpage_count = 896;
109116 break;
117+ case 0x0E:
118+ *validpage_count = 640;
119+ break;
110120 default:
111121 /* unknown ic type clear value */
112122 *validpage_count = 0;
@@ -266,11 +276,10 @@ static int elan_query_device_info(struct elan_tp_data *data) · 153 unmodified lines
266276
267277 error = elan_get_fwinfo(data->iap_version, &data->fw_validpage_count,
268278 &data->fw_signature_address);
269− if (error) {
270− dev_err(&data->client->dev,
271− "unknown iap version %d\n", data->iap_version);
272− return error;
273− }
279+ if (error)
280+ dev_warn(&data->client->dev,
281+ "unexpected iap version %#04x (ic type: %#04x), firmware update will not work\n",
282+ data->iap_version, data->ic_type);
274283
275284 return 0;
276285 }
@@ -486,6 +495,9 @@ static ssize_t elan_sysfs_update_fw(struct device *dev, · 209 unmodified lines
486495 const u8 *fw_signature;
487496 static const u8 signature[] = {0xAA, 0x55, 0xCC, 0x33, 0xFF, 0xFF};
488497
498+ if (data->fw_validpage_count == 0)
499+ return -EINVAL;
500+
489501 /* Look for a firmware with the product id appended. */
490502 fw_name = kasprintf(GFP_KERNEL, ETP_FW_NAME, data->product_id);
491503 if (!fw_name) {
drivers/input/mouse/elan_i2c_i2c.c+2−2
@@ -276,7 +276,7 @@ static int elan_i2c_get_sm_version(struct i2c_client *client, · 275 unmodified lines
276276 return 0;
277277 }
278278
279−static int elan_i2c_get_product_id(struct i2c_client *client, u8 *id)
279+static int elan_i2c_get_product_id(struct i2c_client *client, u16 *id)
280280 {
281281 int error;
282282 u8 val[3];
@@ -287,7 +287,7 @@ static int elan_i2c_get_product_id(struct i2c_client *client, u8 *id) · 4 unmodified lines
287287 return error;
288288 }
289289
290− *id = val[0];
290+ *id = le16_to_cpup((__le16 *)val);
291291 return 0;
292292 }
293293
drivers/input/mouse/elan_i2c_smbus.c+2−2
@@ -183,7 +183,7 @@ static int elan_smbus_get_sm_version(struct i2c_client *client, · 182 unmodified lines
183183 return 0;
184184 }
185185
186−static int elan_smbus_get_product_id(struct i2c_client *client, u8 *id)
186+static int elan_smbus_get_product_id(struct i2c_client *client, u16 *id)
187187 {
188188 int error;
189189 u8 val[3];
@@ -195,7 +195,7 @@ static int elan_smbus_get_product_id(struct i2c_client *client, u8 *id) · 5 unmodified lines
195195 return error;
196196 }
197197
198− *id = val[1];
198+ *id = be16_to_cpup((__be16 *)val);
199199 return 0;
200200 }
201201
drivers/input/mouse/synaptics.c+4−8
@@ -519,18 +519,14 @@ static int synaptics_set_mode(struct psmouse *psmouse) · 518 unmodified lines
519519 struct synaptics_data *priv = psmouse->private;
520520
521521 priv->mode = 0;
522−
523− if (priv->absolute_mode) {
522+ if (priv->absolute_mode)
524523 priv->mode |= SYN_BIT_ABSOLUTE_MODE;
525− if (SYN_CAP_EXTENDED(priv->capabilities))
526− priv->mode |= SYN_BIT_W_MODE;
527− }
528−
529− if (!SYN_MODE_WMODE(priv->mode) && priv->disable_gesture)
524+ if (priv->disable_gesture)
530525 priv->mode |= SYN_BIT_DISABLE_GESTURE;
531−
532526 if (psmouse->rate >= 80)
533527 priv->mode |= SYN_BIT_HIGH_RATE;
528+ if (SYN_CAP_EXTENDED(priv->capabilities))
529+ priv->mode |= SYN_BIT_W_MODE;
534530
535531 if (synaptics_mode_cmd(psmouse, priv->mode))
536532 return -1;
drivers/input/serio/libps2.c+14−8
@@ -212,12 +212,17 @@ int __ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command) · 211 unmodified lines
212212 * time before the ACK arrives.
213213 */
214214 if (ps2_sendbyte(ps2dev, command & 0xff,
215− command == PS2_CMD_RESET_BAT ? 1000 : 200))
216− goto out;
215+ command == PS2_CMD_RESET_BAT ? 1000 : 200)) {
216+ serio_pause_rx(ps2dev->serio);
217+ goto out_reset_flags;
218+ }
217219
218− for (i = 0; i < send; i++)
219− if (ps2_sendbyte(ps2dev, param[i], 200))
220− goto out;
220+ for (i = 0; i < send; i++) {
221+ if (ps2_sendbyte(ps2dev, param[i], 200)) {
222+ serio_pause_rx(ps2dev->serio);
223+ goto out_reset_flags;
224+ }
225+ }
221226
222227 /*
223228 * The reset command takes a long time to execute.
@@ -234,17 +239,18 @@ int __ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command) · 10 unmodified lines
234239 !(ps2dev->flags & PS2_FLAG_CMD), timeout);
235240 }
236241
242+ serio_pause_rx(ps2dev->serio);
243+
237244 if (param)
238245 for (i = 0; i < receive; i++)
239246 param[i] = ps2dev->cmdbuf[(receive - 1) - i];
240247
241248 if (ps2dev->cmdcnt && (command != PS2_CMD_RESET_BAT || ps2dev->cmdcnt != 1))
242− goto out;
249+ goto out_reset_flags;
243250
244251 rc = 0;
245252
246− out:
247− serio_pause_rx(ps2dev->serio);
253+ out_reset_flags:
248254 ps2dev->flags = 0;
249255 serio_continue_rx(ps2dev->serio);
250256
drivers/input/serio/parkbd.c+1−0
@@ -194,6 +194,7 @@ static int __init parkbd_init(void) · 193 unmodified lines
194194 parkbd_port = parkbd_allocate_serio();
195195 if (!parkbd_port) {
196196 parport_release(parkbd_dev);
197+ parport_unregister_device(parkbd_dev);
197198 return -ENOMEM;
198199 }
199200
drivers/input/touchscreen/imx6ul_tsc.c+22−12
@@ -94,7 +94,7 @@ struct imx6ul_tsc { · 93 unmodified lines
9494 * TSC module need ADC to get the measure value. So
9595 * before config TSC, we should initialize ADC module.
9696 */
97−static void imx6ul_adc_init(struct imx6ul_tsc *tsc)
97+static int imx6ul_adc_init(struct imx6ul_tsc *tsc)
9898 {
9999 int adc_hc = 0;
100100 int adc_gc;
@@ -122,17 +122,23 @@ static void imx6ul_adc_init(struct imx6ul_tsc *tsc) · 21 unmodified lines
122122
123123 timeout = wait_for_completion_timeout
124124 (&tsc->completion, ADC_TIMEOUT);
125− if (timeout == 0)
125+ if (timeout == 0) {
126126 dev_err(tsc->dev, "Timeout for adc calibration\n");
127+ return -ETIMEDOUT;
128+ }
127129
128130 adc_gs = readl(tsc->adc_regs + REG_ADC_GS);
129− if (adc_gs & ADC_CALF)
131+ if (adc_gs & ADC_CALF) {
130132 dev_err(tsc->dev, "ADC calibration failed\n");
133+ return -EINVAL;
134+ }
131135
132136 /* TSC need the ADC work in hardware trigger */
133137 adc_cfg = readl(tsc->adc_regs + REG_ADC_CFG);
134138 adc_cfg |= ADC_HARDWARE_TRIGGER;
135139 writel(adc_cfg, tsc->adc_regs + REG_ADC_CFG);
140+
141+ return 0;
136142 }
137143
138144 /*
@@ -188,11 +194,17 @@ static void imx6ul_tsc_set(struct imx6ul_tsc *tsc) · 49 unmodified lines
188194 writel(start, tsc->tsc_regs + REG_TSC_FLOW_CONTROL);
189195 }
190196
191−static void imx6ul_tsc_init(struct imx6ul_tsc *tsc)
197+static int imx6ul_tsc_init(struct imx6ul_tsc *tsc)
192198 {
193− imx6ul_adc_init(tsc);
199+ int err;
200+
201+ err = imx6ul_adc_init(tsc);
202+ if (err)
203+ return err;
194204 imx6ul_tsc_channel_config(tsc);
195205 imx6ul_tsc_set(tsc);
206+
207+ return 0;
196208 }
197209
198210 static void imx6ul_tsc_disable(struct imx6ul_tsc *tsc)
@@ -311,9 +323,7 @@ static int imx6ul_tsc_open(struct input_dev *input_dev) · 112 unmodified lines
311323 return err;
312324 }
313325
314− imx6ul_tsc_init(tsc);
315−
316− return 0;
326+ return imx6ul_tsc_init(tsc);
317327 }
318328
319329 static void imx6ul_tsc_close(struct input_dev *input_dev)
@@ -337,7 +347,7 @@ static int imx6ul_tsc_probe(struct platform_device *pdev) · 17 unmodified lines
337347 int tsc_irq;
338348 int adc_irq;
339349
340− tsc = devm_kzalloc(&pdev->dev, sizeof(struct imx6ul_tsc), GFP_KERNEL);
350+ tsc = devm_kzalloc(&pdev->dev, sizeof(*tsc), GFP_KERNEL);
341351 if (!tsc)
342352 return -ENOMEM;
343353
@@ -345,7 +355,7 @@ static int imx6ul_tsc_probe(struct platform_device *pdev) · 1 unmodified line
345355 if (!input_dev)
346356 return -ENOMEM;
347357
348− input_dev->name = "iMX6UL TouchScreen Controller";
358+ input_dev->name = "iMX6UL Touchscreen Controller";
349359 input_dev->id.bustype = BUS_HOST;
350360
351361 input_dev->open = imx6ul_tsc_open;
@@ -406,7 +416,7 @@ static int imx6ul_tsc_probe(struct platform_device *pdev) · 54 unmodified lines
406416 }
407417
408418 adc_irq = platform_get_irq(pdev, 1);
409− if (adc_irq <= 0) {
419+ if (adc_irq < 0) {
410420 dev_err(&pdev->dev, "no adc irq resource?\n");
411421 return adc_irq;
412422 }
@@ -491,7 +501,7 @@ static int __maybe_unused imx6ul_tsc_resume(struct device *dev) · 78 unmodified lines
491501 goto out;
492502 }
493503
494− imx6ul_tsc_init(tsc);
504+ retval = imx6ul_tsc_init(tsc);
495505 }
496506
497507 out:
drivers/input/touchscreen/mms114.c+2−2
@@ -394,12 +394,12 @@ static struct mms114_platform_data *mms114_parse_dt(struct device *dev) · 393 unmodified lines
394394 if (of_property_read_u32(np, "x-size", &pdata->x_size)) {
395395 dev_err(dev, "failed to get x-size property\n");
396396 return NULL;
397− };
397+ }
398398
399399 if (of_property_read_u32(np, "y-size", &pdata->y_size)) {
400400 dev_err(dev, "failed to get y-size property\n");
401401 return NULL;
402− };
402+ }
403403
404404 of_property_read_u32(np, "contact-threshold",
405405 &pdata->contact_threshold);
drivers/iommu/intel-iommu.c+2−0
@@ -3215,6 +3215,8 @@ static struct iova *intel_alloc_iova(struct device *dev, · 3214 unmodified lines
32153215
32163216 /* Restrict dma_mask to the width that the iommu can handle */
32173217 dma_mask = min_t(uint64_t, DOMAIN_MAX_ADDR(domain->gaw), dma_mask);
3218+ /* Ensure we reserve the whole size-aligned region */
3219+ nrpages = __roundup_pow_of_two(nrpages);
32183220
32193221 if (!dmar_forcedac && dma_mask > DMA_BIT_MASK(32)) {
32203222 /*
drivers/iommu/iova.c+6−17
@@ -88,19 +88,14 @@ __cached_rbnode_delete_update(struct iova_domain *iovad, struct iova *free) · 87 unmodified lines
8888 }
8989 }
9090
91−/* Computes the padding size required, to make the
92− * the start address naturally aligned on its size
91+/*
92+ * Computes the padding size required, to make the start address
93+ * naturally aligned on the power-of-two order of its size
9394 */
94−static int
95−iova_get_pad_size(int size, unsigned int limit_pfn)
95+static unsigned int
96+iova_get_pad_size(unsigned int size, unsigned int limit_pfn)
9697 {
97− unsigned int pad_size = 0;
98− unsigned int order = ilog2(size);
99−
100− if (order)
101− pad_size = (limit_pfn + 1) % (1 << order);
102−
103− return pad_size;
98+ return (limit_pfn + 1 - size) & (__roundup_pow_of_two(size) - 1);
10499 }
105100
106101 static int __alloc_and_insert_iova_range(struct iova_domain *iovad,
@@ -284,12 +279,6 @@ alloc_iova(struct iova_domain *iovad, unsigned long size, · 177 unmodified lines
284279 if (!new_iova)
285280 return NULL;
286281
287− /* If size aligned is set then round the size to
288− * to next power of two.
289− */
290− if (size_aligned)
291− size = __roundup_pow_of_two(size);
292−
293282 ret = __alloc_and_insert_iova_range(iovad, size, limit_pfn,
294283 new_iova, size_aligned);
295284
drivers/irqchip/irq-gic-v3-its-pci-msi.c+1−1
@@ -62,7 +62,7 @@ static int its_get_pci_alias(struct pci_dev *pdev, u16 alias, void *data) · 61 unmodified lines
6262
6363 dev_alias->dev_id = alias;
6464 if (pdev != dev_alias->pdev)
65− dev_alias->count += its_pci_msi_vec_count(dev_alias->pdev);
65+ dev_alias->count += its_pci_msi_vec_count(pdev);
6666
6767 return 0;
6868 }
drivers/irqchip/irq-gic-v3-its.c+3−0
@@ -719,6 +719,9 @@ static unsigned long *its_lpi_alloc_chunks(int nr_irqs, int *base, int *nr_ids) · 718 unmodified lines
719719 out:
720720 spin_unlock(&lpi_lock);
721721
722+ if (!bitmap)
723+ *base = *nr_ids = 0;
724+
722725 return bitmap;
723726 }
724727
drivers/irqchip/irq-mips-gic.c+10−2
@@ -320,6 +320,14 @@ static void gic_handle_shared_int(bool chained) · 319 unmodified lines
320320 intrmask[i] = gic_read(intrmask_reg);
321321 pending_reg += gic_reg_step;
322322 intrmask_reg += gic_reg_step;
323+
324+ if (!config_enabled(CONFIG_64BIT) || mips_cm_is64)
325+ continue;
326+
327+ pending[i] |= (u64)gic_read(pending_reg) << 32;
328+ intrmask[i] |= (u64)gic_read(intrmask_reg) << 32;
329+ pending_reg += gic_reg_step;
330+ intrmask_reg += gic_reg_step;
323331 }
324332
325333 bitmap_and(pending, pending, intrmask, gic_shared_intrs);
@@ -426,7 +434,7 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *cpumask, · 100 unmodified lines
426434 spin_lock_irqsave(&gic_lock, flags);
427435
428436 /* Re-route this IRQ */
429− gic_map_to_vpe(irq, cpumask_first(&tmp));
437+ gic_map_to_vpe(irq, mips_cm_vp_id(cpumask_first(&tmp)));
430438
431439 /* Update the pcpu_masks */
432440 for (i = 0; i < NR_CPUS; i++)
@@ -599,7 +607,7 @@ static __init void gic_ipi_init_one(unsigned int intr, int cpu, · 166 unmodified lines
599607 GIC_SHARED_TO_HWIRQ(intr));
600608 int i;
601609
602− gic_map_to_vpe(intr, cpu);
610+ gic_map_to_vpe(intr, mips_cm_vp_id(cpu));
603611 for (i = 0; i < NR_CPUS; i++)
604612 clear_bit(intr, pcpu_masks[i].pcpu_mask);
605613 set_bit(intr, pcpu_masks[cpu].pcpu_mask);
drivers/md/bitmap.c+2−1
@@ -1997,7 +1997,8 @@ int bitmap_resize(struct bitmap *bitmap, sector_t blocks, · 1996 unmodified lines
19971997 if (bitmap->mddev->bitmap_info.offset || bitmap->mddev->bitmap_info.file)
19981998 ret = bitmap_storage_alloc(&store, chunks,
19991999 !bitmap->mddev->bitmap_info.external,
2000− bitmap->cluster_slot);
2000+ mddev_is_clustered(bitmap->mddev)
2001+ ? bitmap->cluster_slot : 0);
20012002 if (ret)
20022003 goto err;
20032004
drivers/md/md.c+5−0
@@ -5409,9 +5409,13 @@ static int md_set_readonly(struct mddev *mddev, struct block_device *bdev) · 5408 unmodified lines
54095409 * which will now never happen */
54105410 wake_up_process(mddev->sync_thread->tsk);
54115411
5412+ if (mddev->external && test_bit(MD_CHANGE_PENDING, &mddev->flags))
5413+ return -EBUSY;
54125414 mddev_unlock(mddev);
54135415 wait_event(resync_wait, !test_bit(MD_RECOVERY_RUNNING,
54145416 &mddev->recovery));
5417+ wait_event(mddev->sb_wait,
5418+ !test_bit(MD_CHANGE_PENDING, &mddev->flags));
54155419 mddev_lock_nointr(mddev);
54165420
54175421 mutex_lock(&mddev->open_mutex);
@@ -8160,6 +8164,7 @@ void md_check_recovery(struct mddev *mddev) · 2742 unmodified lines
81608164 md_reap_sync_thread(mddev);
81618165 clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery);
81628166 clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
8167+ clear_bit(MD_CHANGE_PENDING, &mddev->flags);
81638168 goto unlock;
81648169 }
81658170
drivers/md/multipath.c+1−2
@@ -470,8 +470,7 @@ static int multipath_run (struct mddev *mddev) · 469 unmodified lines
470470 return 0;
471471
472472 out_free_conf:
473− if (conf->pool)
474− mempool_destroy(conf->pool);
473+ mempool_destroy(conf->pool);
475474 kfree(conf->multipaths);
476475 kfree(conf);
477476 mddev->private = NULL;
drivers/md/raid0.c+6−6
@@ -376,12 +376,6 @@ static int raid0_run(struct mddev *mddev) · 375 unmodified lines
376376 struct md_rdev *rdev;
377377 bool discard_supported = false;
378378
379− rdev_for_each(rdev, mddev) {
380− disk_stack_limits(mddev->gendisk, rdev->bdev,
381− rdev->data_offset << 9);
382− if (blk_queue_discard(bdev_get_queue(rdev->bdev)))
383− discard_supported = true;
384− }
385379 blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
386380 blk_queue_max_write_same_sectors(mddev->queue, mddev->chunk_sectors);
387381 blk_queue_max_discard_sectors(mddev->queue, mddev->chunk_sectors);
@@ -390,6 +384,12 @@ static int raid0_run(struct mddev *mddev) · 2 unmodified lines
390384 blk_queue_io_opt(mddev->queue,
391385 (mddev->chunk_sectors << 9) * mddev->raid_disks);
392386
387+ rdev_for_each(rdev, mddev) {
388+ disk_stack_limits(mddev->gendisk, rdev->bdev,
389+ rdev->data_offset << 9);
390+ if (blk_queue_discard(bdev_get_queue(rdev->bdev)))
391+ discard_supported = true;
392+ }
393393 if (!discard_supported)
394394 queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
395395 else
drivers/md/raid1.c+4−7
@@ -881,8 +881,7 @@ static sector_t wait_barrier(struct r1conf *conf, struct bio *bio) · 880 unmodified lines
881881 }
882882
883883 if (bio && bio_data_dir(bio) == WRITE) {
884− if (bio->bi_iter.bi_sector >=
885− conf->mddev->curr_resync_completed) {
884+ if (bio->bi_iter.bi_sector >= conf->next_resync) {
886885 if (conf->start_next_window == MaxSector)
887886 conf->start_next_window =
888887 conf->next_resync +
@@ -1516,7 +1515,7 @@ static void close_sync(struct r1conf *conf) · 627 unmodified lines
15161515 conf->r1buf_pool = NULL;
15171516
15181517 spin_lock_irq(&conf->resync_lock);
1519− conf->next_resync = 0;
1518+ conf->next_resync = MaxSector - 2 * NEXT_NORMALIO_DISTANCE;
15201519 conf->start_next_window = MaxSector;
15211520 conf->current_window_requests +=
15221521 conf->next_window_requests;
@@ -2843,8 +2842,7 @@ static struct r1conf *setup_conf(struct mddev *mddev) · 1320 unmodified lines
28432842
28442843 abort:
28452844 if (conf) {
2846− if (conf->r1bio_pool)
2847− mempool_destroy(conf->r1bio_pool);
2845+ mempool_destroy(conf->r1bio_pool);
28482846 kfree(conf->mirrors);
28492847 safe_put_page(conf->tmppage);
28502848 kfree(conf->poolinfo);
@@ -2946,8 +2944,7 @@ static void raid1_free(struct mddev *mddev, void *priv) · 95 unmodified lines
29462944 {
29472945 struct r1conf *conf = priv;
29482946
2949− if (conf->r1bio_pool)
2950− mempool_destroy(conf->r1bio_pool);
2947+ mempool_destroy(conf->r1bio_pool);
29512948 kfree(conf->mirrors);
29522949 safe_put_page(conf->tmppage);
29532950 kfree(conf->poolinfo);
drivers/md/raid10.c+3−6
@@ -3486,8 +3486,7 @@ static struct r10conf *setup_conf(struct mddev *mddev) · 3485 unmodified lines
34863486 printk(KERN_ERR "md/raid10:%s: couldn't allocate memory.\n",
34873487 mdname(mddev));
34883488 if (conf) {
3489− if (conf->r10bio_pool)
3490− mempool_destroy(conf->r10bio_pool);
3489+ mempool_destroy(conf->r10bio_pool);
34913490 kfree(conf->mirrors);
34923491 safe_put_page(conf->tmppage);
34933492 kfree(conf);
@@ -3682,8 +3681,7 @@ static int run(struct mddev *mddev) · 188 unmodified lines
36823681
36833682 out_free_conf:
36843683 md_unregister_thread(&mddev->thread);
3685− if (conf->r10bio_pool)
3686− mempool_destroy(conf->r10bio_pool);
3684+ mempool_destroy(conf->r10bio_pool);
36873685 safe_put_page(conf->tmppage);
36883686 kfree(conf->mirrors);
36893687 kfree(conf);
@@ -3696,8 +3694,7 @@ static void raid10_free(struct mddev *mddev, void *priv) · 6 unmodified lines
36963694 {
36973695 struct r10conf *conf = priv;
36983696
3699− if (conf->r10bio_pool)
3700− mempool_destroy(conf->r10bio_pool);
3697+ mempool_destroy(conf->r10bio_pool);
37013698 safe_put_page(conf->tmppage);
37023699 kfree(conf->mirrors);
37033700 kfree(conf->mirrors_old);
drivers/md/raid5.c+7−4
@@ -2271,8 +2271,7 @@ static void shrink_stripes(struct r5conf *conf) · 2270 unmodified lines
22712271 drop_one_stripe(conf))
22722272 ;
22732273
2274− if (conf->slab_cache)
2275− kmem_cache_destroy(conf->slab_cache);
2274+ kmem_cache_destroy(conf->slab_cache);
22762275 conf->slab_cache = NULL;
22772276 }
22782277
@@ -3150,6 +3149,8 @@ handle_failed_stripe(struct r5conf *conf, struct stripe_head *sh, · 871 unmodified lines
31503149 spin_unlock_irq(&sh->stripe_lock);
31513150 if (test_and_clear_bit(R5_Overlap, &sh->dev[i].flags))
31523151 wake_up(&conf->wait_for_overlap);
3152+ if (bi)
3153+ s->to_read--;
31533154 while (bi && bi->bi_iter.bi_sector <
31543155 sh->dev[i].sector + STRIPE_SECTORS) {
31553156 struct bio *nextbi =
@@ -3169,6 +3170,8 @@ handle_failed_stripe(struct r5conf *conf, struct stripe_head *sh, · 13 unmodified lines
31693170 */
31703171 clear_bit(R5_LOCKED, &sh->dev[i].flags);
31713172 }
3173+ s->to_write = 0;
3174+ s->written = 0;
31723175
31733176 if (test_and_clear_bit(STRIPE_FULL_WRITE, &sh->state))
31743177 if (atomic_dec_and_test(&conf->pending_full_writes))
@@ -3300,7 +3303,7 @@ static int need_this_block(struct stripe_head *sh, struct stripe_head_state *s, · 125 unmodified lines
33003303 */
33013304 return 0;
33023305
3303− for (i = 0; i < s->failed; i++) {
3306+ for (i = 0; i < s->failed && i < 2; i++) {
33043307 if (fdev[i]->towrite &&
33053308 !test_bit(R5_UPTODATE, &fdev[i]->flags) &&
33063309 !test_bit(R5_OVERWRITE, &fdev[i]->flags))
@@ -3324,7 +3327,7 @@ static int need_this_block(struct stripe_head *sh, struct stripe_head_state *s, · 17 unmodified lines
33243327 sh->sector < sh->raid_conf->mddev->recovery_cp)
33253328 /* reconstruct-write isn't being forced */
33263329 return 0;
3327− for (i = 0; i < s->failed; i++) {
3330+ for (i = 0; i < s->failed && i < 2; i++) {
33283331 if (s->failed_num[i] != sh->pd_idx &&
33293332 s->failed_num[i] != sh->qd_idx &&
33303333 !test_bit(R5_UPTODATE, &fdev[i]->flags) &&
drivers/mmc/core/core.c+4−2
@@ -134,9 +134,11 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq) · 133 unmodified lines
134134 int err = cmd->error;
135135
136136 /* Flag re-tuning needed on CRC errors */
137− if (err == -EILSEQ || (mrq->sbc && mrq->sbc->error == -EILSEQ) ||
137+ if ((cmd->opcode != MMC_SEND_TUNING_BLOCK &&
138+ cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200) &&
139+ (err == -EILSEQ || (mrq->sbc && mrq->sbc->error == -EILSEQ) ||
138140 (mrq->data && mrq->data->error == -EILSEQ) ||
139− (mrq->stop && mrq->stop->error == -EILSEQ))
141+ (mrq->stop && mrq->stop->error == -EILSEQ)))
140142 mmc_retune_needed(host);
141143
142144 if (err && cmd->retries && mmc_host_is_spi(host)) {
drivers/mmc/core/host.c+2−2
@@ -457,7 +457,7 @@ int mmc_of_parse(struct mmc_host *host) · 456 unmodified lines
457457 0, &cd_gpio_invert);
458458 if (!ret)
459459 dev_info(host->parent, "Got CD GPIO\n");
460− else if (ret != -ENOENT)
460+ else if (ret != -ENOENT && ret != -ENOSYS)
461461 return ret;
462462
463463 /*
@@ -481,7 +481,7 @@ int mmc_of_parse(struct mmc_host *host) · 17 unmodified lines
481481 ret = mmc_gpiod_request_ro(host, "wp", 0, false, 0, &ro_gpio_invert);
482482 if (!ret)
483483 dev_info(host->parent, "Got WP GPIO\n");
484− else if (ret != -ENOENT)
484+ else if (ret != -ENOENT && ret != -ENOSYS)
485485 return ret;
486486
487487 if (of_property_read_bool(np, "disable-wp"))
drivers/mmc/host/pxamci.c+22−44
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <linux/clk.h>
2929 #include <linux/err.h>
3030 #include <linux/mmc/host.h>
31+#include <linux/mmc/slot-gpio.h>
3132 #include <linux/io.h>
3233 #include <linux/regulator/consumer.h>
3334 #include <linux/gpio.h>
@@ -454,12 +455,8 @@ static int pxamci_get_ro(struct mmc_host *mmc) · 420 unmodified lines
454455 {
455456 struct pxamci_host *host = mmc_priv(mmc);
456457
457− if (host->pdata && gpio_is_valid(host->pdata->gpio_card_ro)) {
458− if (host->pdata->gpio_card_ro_invert)
459− return !gpio_get_value(host->pdata->gpio_card_ro);
460− else
461− return gpio_get_value(host->pdata->gpio_card_ro);
462− }
458+ if (host->pdata && gpio_is_valid(host->pdata->gpio_card_ro))
459+ return mmc_gpio_get_ro(mmc);
463460 if (host->pdata && host->pdata->get_ro)
464461 return !!host->pdata->get_ro(mmc_dev(mmc));
465462 /*
@@ -551,6 +548,7 @@ static void pxamci_enable_sdio_irq(struct mmc_host *host, int enable) · 85 unmodified lines
551548
552549 static const struct mmc_host_ops pxamci_ops = {
553550 .request = pxamci_request,
551+ .get_cd = mmc_gpio_get_cd,
554552 .get_ro = pxamci_get_ro,
555553 .set_ios = pxamci_set_ios,
556554 .enable_sdio_irq = pxamci_enable_sdio_irq,
@@ -790,37 +788,31 @@ static int pxamci_probe(struct platform_device *pdev) · 233 unmodified lines
790788 gpio_power = host->pdata->gpio_power;
791789 }
792790 if (gpio_is_valid(gpio_power)) {
793− ret = gpio_request(gpio_power, "mmc card power");
791+ ret = devm_gpio_request(&pdev->dev, gpio_power,
792+ "mmc card power");
794793 if (ret) {
795− dev_err(&pdev->dev, "Failed requesting gpio_power %d\n", gpio_power);
794+ dev_err(&pdev->dev, "Failed requesting gpio_power %d\n",
795+ gpio_power);
796796 goto out;
797797 }
798798 gpio_direction_output(gpio_power,
799799 host->pdata->gpio_power_invert);
800800 }
801− if (gpio_is_valid(gpio_ro)) {
802− ret = gpio_request(gpio_ro, "mmc card read only");
803− if (ret) {
804− dev_err(&pdev->dev, "Failed requesting gpio_ro %d\n", gpio_ro);
805− goto err_gpio_ro;
806− }
807− gpio_direction_input(gpio_ro);
801+ if (gpio_is_valid(gpio_ro))
802+ ret = mmc_gpio_request_ro(mmc, gpio_ro);
803+ if (ret) {
804+ dev_err(&pdev->dev, "Failed requesting gpio_ro %d\n", gpio_ro);
805+ goto out;
806+ } else {
807+ mmc->caps |= host->pdata->gpio_card_ro_invert ?
808+ MMC_CAP2_RO_ACTIVE_HIGH : 0;
808809 }
809− if (gpio_is_valid(gpio_cd)) {
810− ret = gpio_request(gpio_cd, "mmc card detect");
811− if (ret) {
812− dev_err(&pdev->dev, "Failed requesting gpio_cd %d\n", gpio_cd);
813− goto err_gpio_cd;
814− }
815− gpio_direction_input(gpio_cd);
816810
817− ret = request_irq(gpio_to_irq(gpio_cd), pxamci_detect_irq,
818− IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
819− "mmc card detect", mmc);
820− if (ret) {
821− dev_err(&pdev->dev, "failed to request card detect IRQ\n");
822− goto err_request_irq;
823− }
811+ if (gpio_is_valid(gpio_cd))
812+ ret = mmc_gpio_request_cd(mmc, gpio_cd, 0);
813+ if (ret) {
814+ dev_err(&pdev->dev, "Failed requesting gpio_cd %d\n", gpio_cd);
815+ goto out;
824816 }
825817
826818 if (host->pdata && host->pdata->init)
@@ -835,13 +827,7 @@ static int pxamci_probe(struct platform_device *pdev) · 8 unmodified lines
835827
836828 return 0;
837829
838−err_request_irq:
839− gpio_free(gpio_cd);
840−err_gpio_cd:
841− gpio_free(gpio_ro);
842−err_gpio_ro:
843− gpio_free(gpio_power);
844− out:
830+out:
845831 if (host) {
846832 if (host->dma_chan_rx)
847833 dma_release_channel(host->dma_chan_rx);
@@ -873,14 +859,6 @@ static int pxamci_remove(struct platform_device *pdev) · 25 unmodified lines
873859 gpio_ro = host->pdata->gpio_card_ro;
874860 gpio_power = host->pdata->gpio_power;
875861 }
876− if (gpio_is_valid(gpio_cd)) {
877− free_irq(gpio_to_irq(gpio_cd), mmc);
878− gpio_free(gpio_cd);
879− }
880− if (gpio_is_valid(gpio_ro))
881− gpio_free(gpio_ro);
882− if (gpio_is_valid(gpio_power))
883− gpio_free(gpio_power);
884862 if (host->vcc)
885863 regulator_put(host->vcc);
886864
drivers/mmc/host/sunxi-mmc.c+39−14
@@ -210,6 +210,16 @@ · 209 unmodified lines
210210 #define SDXC_IDMAC_DES0_CES BIT(30) /* card error summary */
211211 #define SDXC_IDMAC_DES0_OWN BIT(31) /* 1-idma owns it, 0-host owns it */
212212
213+#define SDXC_CLK_400K 0
214+#define SDXC_CLK_25M 1
215+#define SDXC_CLK_50M 2
216+#define SDXC_CLK_50M_DDR 3
217+
218+struct sunxi_mmc_clk_delay {
219+ u32 output;
220+ u32 sample;
221+};
222+
213223 struct sunxi_idma_des {
214224 u32 config;
215225 u32 buf_size;
@@ -229,6 +239,7 @@ struct sunxi_mmc_host { · 13 unmodified lines
229239 struct clk *clk_mmc;
230240 struct clk *clk_sample;
231241 struct clk *clk_output;
242+ const struct sunxi_mmc_clk_delay *clk_delays;
232243
233244 /* irq */
234245 spinlock_t lock;
@@ -654,25 +665,19 @@ static int sunxi_mmc_clk_set_rate(struct sunxi_mmc_host *host, · 419 unmodified lines
654665
655666 /* determine delays */
656667 if (rate <= 400000) {
657− oclk_dly = 180;
658− sclk_dly = 42;
668+ oclk_dly = host->clk_delays[SDXC_CLK_400K].output;
669+ sclk_dly = host->clk_delays[SDXC_CLK_400K].sample;
659670 } else if (rate <= 25000000) {
660− oclk_dly = 180;
661− sclk_dly = 75;
671+ oclk_dly = host->clk_delays[SDXC_CLK_25M].output;
672+ sclk_dly = host->clk_delays[SDXC_CLK_25M].sample;
662673 } else if (rate <= 50000000) {
663674 if (ios->timing == MMC_TIMING_UHS_DDR50) {
664− oclk_dly = 60;
665− sclk_dly = 120;
675+ oclk_dly = host->clk_delays[SDXC_CLK_50M_DDR].output;
676+ sclk_dly = host->clk_delays[SDXC_CLK_50M_DDR].sample;
666677 } else {
667− oclk_dly = 90;
668− sclk_dly = 150;
678+ oclk_dly = host->clk_delays[SDXC_CLK_50M].output;
679+ sclk_dly = host->clk_delays[SDXC_CLK_50M].sample;
669680 }
670− } else if (rate <= 100000000) {
671− oclk_dly = 6;
672− sclk_dly = 24;
673− } else if (rate <= 200000000) {
674− oclk_dly = 3;
675− sclk_dly = 12;
676681 } else {
677682 return -EINVAL;
678683 }
@@ -871,6 +876,7 @@ static void sunxi_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) · 192 unmodified lines
871876 static const struct of_device_id sunxi_mmc_of_match[] = {
872877 { .compatible = "allwinner,sun4i-a10-mmc", },
873878 { .compatible = "allwinner,sun5i-a13-mmc", },
879+ { .compatible = "allwinner,sun9i-a80-mmc", },
874880 { /* sentinel */ }
875881 };
876882 MODULE_DEVICE_TABLE(of, sunxi_mmc_of_match);
@@ -884,6 +890,20 @@ static struct mmc_host_ops sunxi_mmc_ops = { · 7 unmodified lines
884890 .hw_reset = sunxi_mmc_hw_reset,
885891 };
886892
893+static const struct sunxi_mmc_clk_delay sunxi_mmc_clk_delays[] = {
894+ [SDXC_CLK_400K] = { .output = 180, .sample = 180 },
895+ [SDXC_CLK_25M] = { .output = 180, .sample = 75 },
896+ [SDXC_CLK_50M] = { .output = 90, .sample = 120 },
897+ [SDXC_CLK_50M_DDR] = { .output = 60, .sample = 120 },
898+};
899+
900+static const struct sunxi_mmc_clk_delay sun9i_mmc_clk_delays[] = {
901+ [SDXC_CLK_400K] = { .output = 180, .sample = 180 },
902+ [SDXC_CLK_25M] = { .output = 180, .sample = 75 },
903+ [SDXC_CLK_50M] = { .output = 150, .sample = 120 },
904+ [SDXC_CLK_50M_DDR] = { .output = 90, .sample = 120 },
905+};
906+
887907 static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,
888908 struct platform_device *pdev)
889909 {
@@ -895,6 +915,11 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host, · 5 unmodified lines
895915 else
896916 host->idma_des_size_bits = 16;
897917
918+ if (of_device_is_compatible(np, "allwinner,sun9i-a80-mmc"))
919+ host->clk_delays = sun9i_mmc_clk_delays;
920+ else
921+ host->clk_delays = sunxi_mmc_clk_delays;
922+
898923 ret = mmc_regulator_get_supply(host->mmc);
899924 if (ret) {
900925 if (ret != -EPROBE_DEFER)
drivers/mtd/ubi/io.c+5−0
@@ -926,6 +926,11 @@ static int validate_vid_hdr(const struct ubi_device *ubi, · 925 unmodified lines
926926 goto bad;
927927 }
928928
929+ if (data_size > ubi->leb_size) {
930+ ubi_err(ubi, "bad data_size");
931+ goto bad;
932+ }
933+
929934 if (vol_type == UBI_VID_STATIC) {
930935 /*
931936 * Although from high-level point of view static volumes may
drivers/mtd/ubi/vtbl.c+1−0
@@ -649,6 +649,7 @@ static int init_volumes(struct ubi_device *ubi, · 648 unmodified lines
649649 if (ubi->corr_peb_count)
650650 ubi_err(ubi, "%d PEBs are corrupted and not used",
651651 ubi->corr_peb_count);
652+ return -ENOSPC;
652653 }
653654 ubi->rsvd_pebs += reserved_pebs;
654655 ubi->avail_pebs -= reserved_pebs;
drivers/mtd/ubi/wl.c+1−0
@@ -1601,6 +1601,7 @@ int ubi_wl_init(struct ubi_device *ubi, struct ubi_attach_info *ai) · 1600 unmodified lines
16011601 if (ubi->corr_peb_count)
16021602 ubi_err(ubi, "%d PEBs are corrupted and not used",
16031603 ubi->corr_peb_count);
1604+ err = -ENOSPC;
16041605 goto out_free;
16051606 }
16061607 ubi->avail_pebs -= reserved_pebs;
drivers/net/dsa/mv88e6xxx.c+2−0
@@ -2051,6 +2051,8 @@ static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port) · 2050 unmodified lines
20512051 reg |= PORT_CONTROL_FRAME_ETHER_TYPE_DSA;
20522052 else
20532053 reg |= PORT_CONTROL_FRAME_MODE_DSA;
2054+ reg |= PORT_CONTROL_FORWARD_UNKNOWN |
2055+ PORT_CONTROL_FORWARD_UNKNOWN_MC;
20542056 }
20552057
20562058 if (mv88e6xxx_6352_family(ds) || mv88e6xxx_6351_family(ds) ||
drivers/net/ethernet/brocade/bna/bfa_ioc.c+7−6
@@ -1543,7 +1543,7 @@ bfa_flash_cmd_act_check(void __iomem *pci_bar) · 1542 unmodified lines
15431543 }
15441544
15451545 /* Flush FLI data fifo. */
1546−static u32
1546+static int
15471547 bfa_flash_fifo_flush(void __iomem *pci_bar)
15481548 {
15491549 u32 i;
@@ -1573,11 +1573,11 @@ bfa_flash_fifo_flush(void __iomem *pci_bar) · 23 unmodified lines
15731573 }
15741574
15751575 /* Read flash status. */
1576−static u32
1576+static int
15771577 bfa_flash_status_read(void __iomem *pci_bar)
15781578 {
15791579 union bfa_flash_dev_status_reg dev_status;
1580− u32 status;
1580+ int status;
15811581 u32 ret_status;
15821582 int i;
15831583
@@ -1611,11 +1611,11 @@ bfa_flash_status_read(void __iomem *pci_bar) · 27 unmodified lines
16111611 }
16121612
16131613 /* Start flash read operation. */
1614−static u32
1614+static int
16151615 bfa_flash_read_start(void __iomem *pci_bar, u32 offset, u32 len,
16161616 char *buf)
16171617 {
1618− u32 status;
1618+ int status;
16191619
16201620 /* len must be mutiple of 4 and not exceeding fifo size */
16211621 if (len == 0 || len > BFA_FLASH_FIFO_SIZE || (len & 0x03) != 0)
@@ -1703,7 +1703,8 @@ static enum bfa_status · 81 unmodified lines
17031703 bfa_flash_raw_read(void __iomem *pci_bar, u32 offset, char *buf,
17041704 u32 len)
17051705 {
1706− u32 n, status;
1706+ u32 n;
1707+ int status;
17071708 u32 off, l, s, residue, fifo_sz;
17081709
17091710 residue = len;
drivers/net/ethernet/hisilicon/hip04_eth.c+1−1
@@ -816,7 +816,7 @@ static int hip04_mac_probe(struct platform_device *pdev) · 815 unmodified lines
816816 struct net_device *ndev;
817817 struct hip04_priv *priv;
818818 struct resource *res;
819− unsigned int irq;
819+ int irq;
820820 int ret;
821821
822822 ndev = alloc_etherdev(sizeof(struct hip04_priv));
drivers/net/ethernet/ibm/emac/core.h+3−3
@@ -460,8 +460,8 @@ struct emac_ethtool_regs_subhdr { · 459 unmodified lines
460460 u32 index;
461461 };
462462
463−#define EMAC_ETHTOOL_REGS_VER 0
464−#define EMAC4_ETHTOOL_REGS_VER 1
465−#define EMAC4SYNC_ETHTOOL_REGS_VER 2
463+#define EMAC_ETHTOOL_REGS_VER 3
464+#define EMAC4_ETHTOOL_REGS_VER 4
465+#define EMAC4SYNC_ETHTOOL_REGS_VER 5
466466
467467 #endif /* __IBM_NEWEMAC_CORE_H */
drivers/net/ethernet/intel/i40e/i40e_adminq.c+9−0
@@ -946,6 +946,13 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw, · 945 unmodified lines
946946 /* take the lock before we start messing with the ring */
947947 mutex_lock(&hw->aq.arq_mutex);
948948
949+ if (hw->aq.arq.count == 0) {
950+ i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
951+ "AQRX: Admin queue not initialized.\n");
952+ ret_code = I40E_ERR_QUEUE_EMPTY;
953+ goto clean_arq_element_err;
954+ }
955+
949956 /* set next_to_use to head */
950957 ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK);
951958 if (ntu == ntc) {
@@ -1007,6 +1014,8 @@ clean_arq_element_out: · 55 unmodified lines
10071014 /* Set pending if needed, unlock and return */
10081015 if (pending != NULL)
10091016 *pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc);
1017+
1018+clean_arq_element_err:
10101019 mutex_unlock(&hw->aq.arq_mutex);
10111020
10121021 if (i40e_is_nvm_update_op(&e->desc)) {
drivers/net/ethernet/intel/i40e/i40e_main.c+2−1
@@ -2672,7 +2672,8 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring) · 2671 unmodified lines
26722672 rx_ctx.lrxqthresh = 2;
26732673 rx_ctx.crcstrip = 1;
26742674 rx_ctx.l2tsel = 1;
2675− rx_ctx.showiv = 1;
2675+ /* this controls whether VLAN is stripped from inner headers */
2676+ rx_ctx.showiv = 0;
26762677 #ifdef I40E_FCOE
26772678 rx_ctx.fc_ena = (vsi->type == I40E_VSI_FCOE);
26782679 #endif
drivers/net/ethernet/intel/i40evf/i40e_adminq.c+9−0
@@ -887,6 +887,13 @@ i40e_status i40evf_clean_arq_element(struct i40e_hw *hw, · 886 unmodified lines
887887 /* take the lock before we start messing with the ring */
888888 mutex_lock(&hw->aq.arq_mutex);
889889
890+ if (hw->aq.arq.count == 0) {
891+ i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
892+ "AQRX: Admin queue not initialized.\n");
893+ ret_code = I40E_ERR_QUEUE_EMPTY;
894+ goto clean_arq_element_err;
895+ }
896+
890897 /* set next_to_use to head */
891898 ntu = (rd32(hw, hw->aq.arq.head) & I40E_VF_ARQH1_ARQH_MASK);
892899 if (ntu == ntc) {
@@ -948,6 +955,8 @@ clean_arq_element_out: · 55 unmodified lines
948955 /* Set pending if needed, unlock and return */
949956 if (pending != NULL)
950957 *pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc);
958+
959+clean_arq_element_err:
951960 mutex_unlock(&hw->aq.arq_mutex);
952961
953962 return ret_code;
drivers/net/ethernet/mellanox/mlx4/mcg.c+4−3
@@ -1184,10 +1184,11 @@ out: · 1183 unmodified lines
11841184 if (prot == MLX4_PROT_ETH) {
11851185 /* manage the steering entry for promisc mode */
11861186 if (new_entry)
1187− new_steering_entry(dev, port, steer, index, qp->qpn);
1187+ err = new_steering_entry(dev, port, steer,
1188+ index, qp->qpn);
11881189 else
1189− existing_steering_entry(dev, port, steer,
1190− index, qp->qpn);
1190+ err = existing_steering_entry(dev, port, steer,
1191+ index, qp->qpn);
11911192 }
11921193 if (err && link && index != -1) {
11931194 if (index < dev->caps.num_mgms)
drivers/net/ethernet/mellanox/mlx5/core/fw.c+0−22
@@ -200,25 +200,3 @@ int mlx5_cmd_teardown_hca(struct mlx5_core_dev *dev) · 199 unmodified lines
200200
201201 return err;
202202 }
203−
204−int mlx5_core_query_special_context(struct mlx5_core_dev *dev, u32 *rsvd_lkey)
205−{
206− struct mlx5_cmd_query_special_contexts_mbox_in in;
207− struct mlx5_cmd_query_special_contexts_mbox_out out;
208− int err;
209−
210− memset(&in, 0, sizeof(in));
211− memset(&out, 0, sizeof(out));
212− in.hdr.opcode = cpu_to_be16(MLX5_CMD_OP_QUERY_SPECIAL_CONTEXTS);
213− err = mlx5_cmd_exec(dev, &in, sizeof(in), &out, sizeof(out));
214− if (err)
215− return err;
216−
217− if (out.hdr.status)
218− err = mlx5_cmd_status_to_err(&out.hdr);
219−
220− *rsvd_lkey = be32_to_cpu(out.resd_lkey);
221−
222− return err;
223−}
224−EXPORT_SYMBOL(mlx5_core_query_special_context);
drivers/net/ethernet/realtek/r8169.c+1−1
@@ -6081,7 +6081,7 @@ static void rtl_hw_start_8168h_1(struct rtl8169_private *tp) · 6080 unmodified lines
60816081 {
60826082 void __iomem *ioaddr = tp->mmio_addr;
60836083 struct pci_dev *pdev = tp->pci_dev;
6084− u16 rg_saw_cnt;
6084+ int rg_saw_cnt;
60856085 u32 data;
60866086 static const struct ephy_info e_info_8168h_1[] = {
60876087 { 0x1e, 0x0800, 0x0001 },
drivers/pci/pci-driver.c+4−3
@@ -299,9 +299,10 @@ static long local_pci_probe(void *_ddi) · 298 unmodified lines
299299 * Unbound PCI devices are always put in D0, regardless of
300300 * runtime PM status. During probe, the device is set to
301301 * active and the usage count is incremented. If the driver
302− * supports runtime PM, it should call pm_runtime_put_noidle()
303− * in its probe routine and pm_runtime_get_noresume() in its
304− * remove routine.
302+ * supports runtime PM, it should call pm_runtime_put_noidle(),
303+ * or any other runtime PM helper function decrementing the usage
304+ * count, in its probe routine and pm_runtime_get_noresume() in
305+ * its remove routine.
305306 */
306307 pm_runtime_get_sync(dev);
307308 pci_dev->driver = pci_drv;
drivers/scsi/scsi_lib.c+1−1
@@ -1957,7 +1957,7 @@ static int scsi_mq_prep_fn(struct request *req) · 1956 unmodified lines
19571957 static void scsi_mq_done(struct scsi_cmnd *cmd)
19581958 {
19591959 trace_scsi_dispatch_cmd_done(cmd);
1960− blk_mq_complete_request(cmd->request);
1960+ blk_mq_complete_request(cmd->request, cmd->request->errors);
19611961 }
19621962
19631963 static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx,
drivers/thermal/power_allocator.c+10−0
@@ -144,6 +144,16 @@ static void estimate_pid_constants(struct thermal_zone_device *tz, · 143 unmodified lines
144144 switch_on_temp = 0;
145145
146146 temperature_threshold = control_temp - switch_on_temp;
147+ /*
148+ * estimate_pid_constants() tries to find appropriate default
149+ * values for thermal zones that don't provide them. If a
150+ * system integrator has configured a thermal zone with two
151+ * passive trip points at the same temperature, that person
152+ * hasn't put any effort to set up the thermal zone properly
153+ * so just give up.
154+ */
155+ if (!temperature_threshold)
156+ return;
147157
148158 if (!tz->tzp->k_po || force)
149159 tz->tzp->k_po = int_to_frac(sustainable_power) /
drivers/watchdog/Kconfig+2−1
@@ -817,8 +817,9 @@ config ITCO_WDT · 816 unmodified lines
817817 tristate "Intel TCO Timer/Watchdog"
818818 depends on (X86 || IA64) && PCI
819819 select WATCHDOG_CORE
820+ depends on I2C || I2C=n
820821 select LPC_ICH if !EXPERT
821− select I2C_I801 if !EXPERT
822+ select I2C_I801 if !EXPERT && I2C
822823 ---help---
823824 Hardware driver for the intel TCO timer based watchdog devices.
824825 These drivers are included in the Intel 82801 I/O Controller
drivers/watchdog/bcm2835_wdt.c+8−2
@@ -36,6 +36,13 @@ · 35 unmodified lines
3636 #define PM_RSTC_WRCFG_FULL_RESET 0x00000020
3737 #define PM_RSTC_RESET 0x00000102
3838
39+/*
40+ * The Raspberry Pi firmware uses the RSTS register to know which partiton
41+ * to boot from. The partiton value is spread into bits 0, 2, 4, 6, 8, 10.
42+ * Partiton 63 is a special partition used by the firmware to indicate halt.
43+ */
44+#define PM_RSTS_RASPBERRYPI_HALT 0x555
45+
3946 #define SECS_TO_WDOG_TICKS(x) ((x) << 16)
4047 #define WDOG_TICKS_TO_SECS(x) ((x) >> 16)
4148
@@ -151,8 +158,7 @@ static void bcm2835_power_off(void) · 109 unmodified lines
151158 * hard reset.
152159 */
153160 val = readl_relaxed(wdt->base + PM_RSTS);
154− val &= PM_RSTC_WRCFG_CLR;
155− val |= PM_PASSWORD | PM_RSTS_HADWRH_SET;
161+ val |= PM_PASSWORD | PM_RSTS_RASPBERRYPI_HALT;
156162 writel_relaxed(val, wdt->base + PM_RSTS);
157163
158164 /* Continue with normal reset mechanism */
drivers/watchdog/gef_wdt.c+1−0
@@ -303,6 +303,7 @@ static const struct of_device_id gef_wdt_ids[] = { · 302 unmodified lines
303303 },
304304 {},
305305 };
306+MODULE_DEVICE_TABLE(of, gef_wdt_ids);
306307
307308 static struct platform_driver gef_wdt_driver = {
308309 .driver = {
drivers/watchdog/mena21_wdt.c+1−0
@@ -253,6 +253,7 @@ static const struct of_device_id a21_wdt_ids[] = { · 252 unmodified lines
253253 { .compatible = "men,a021-wdt" },
254254 { },
255255 };
256+MODULE_DEVICE_TABLE(of, a21_wdt_ids);
256257
257258 static struct platform_driver a21_wdt_driver = {
258259 .probe = a21_wdt_probe,
drivers/watchdog/moxart_wdt.c+1−0
@@ -168,6 +168,7 @@ static const struct of_device_id moxart_watchdog_match[] = { · 167 unmodified lines
168168 { .compatible = "moxa,moxart-watchdog" },
169169 { },
170170 };
171+MODULE_DEVICE_TABLE(of, moxart_watchdog_match);
171172
172173 static struct platform_driver moxart_wdt_driver = {
173174 .probe = moxart_wdt_probe,
fs/dax.c+12−1
@@ -569,8 +569,20 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address, · 568 unmodified lines
569569 if (!buffer_size_valid(&bh) || bh.b_size < PMD_SIZE)
570570 goto fallback;
571571
572+ sector = bh.b_blocknr << (blkbits - 9);
573+
572574 if (buffer_unwritten(&bh) || buffer_new(&bh)) {
573575 int i;
576+
577+ length = bdev_direct_access(bh.b_bdev, sector, &kaddr, &pfn,
578+ bh.b_size);
579+ if (length < 0) {
580+ result = VM_FAULT_SIGBUS;
581+ goto out;
582+ }
583+ if ((length < PMD_SIZE) || (pfn & PG_PMD_COLOUR))
584+ goto fallback;
585+
574586 for (i = 0; i < PTRS_PER_PMD; i++)
575587 clear_pmem(kaddr + i * PAGE_SIZE, PAGE_SIZE);
576588 wmb_pmem();
@@ -623,7 +635,6 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address, · 46 unmodified lines
623635 result = VM_FAULT_NOPAGE;
624636 spin_unlock(ptl);
625637 } else {
626− sector = bh.b_blocknr << (blkbits - 9);
627638 length = bdev_direct_access(bh.b_bdev, sector, &kaddr, &pfn,
628639 bh.b_size);
629640 if (length < 0) {
fs/ubifs/xattr.c+0−3
@@ -652,11 +652,8 @@ int ubifs_init_security(struct inode *dentry, struct inode *inode, · 651 unmodified lines
652652 {
653653 int err;
654654
655− mutex_lock(&inode->i_mutex);
656655 err = security_inode_init_security(inode, dentry, qstr,
657656 &init_xattrs, 0);
658− mutex_unlock(&inode->i_mutex);
659−
660657 if (err) {
661658 struct ubifs_info *c = dentry->i_sb->s_fs_info;
662659 ubifs_err(c, "cannot initialize security for inode %lu, error %d",
include/asm-generic/word-at-a-time.h+72−8
@@ -1,15 +1,10 @@
11 #ifndef _ASM_WORD_AT_A_TIME_H
22 #define _ASM_WORD_AT_A_TIME_H
33
4−/*
5− * This says "generic", but it's actually big-endian only.
6− * Little-endian can use more efficient versions of these
7− * interfaces, see for example
8− * arch/x86/include/asm/word-at-a-time.h
9− * for those.
10− */
11−
124 #include <linux/kernel.h>
5+#include <asm/byteorder.h>
6+
7+#ifdef __BIG_ENDIAN
138
149 struct word_at_a_time {
1510 const unsigned long high_bits, low_bits;
@@ -53,4 +48,73 @@ static inline bool has_zero(unsigned long val, unsigned long *data, const struct · 37 unmodified lines
5348 #define zero_bytemask(mask) (~1ul << __fls(mask))
5449 #endif
5550
51+#else
52+
53+/*
54+ * The optimal byte mask counting is probably going to be something
55+ * that is architecture-specific. If you have a reliably fast
56+ * bit count instruction, that might be better than the multiply
57+ * and shift, for example.
58+ */
59+struct word_at_a_time {
60+ const unsigned long one_bits, high_bits;
61+};
62+
63+#define WORD_AT_A_TIME_CONSTANTS { REPEAT_BYTE(0x01), REPEAT_BYTE(0x80) }
64+
65+#ifdef CONFIG_64BIT
66+
67+/*
68+ * Jan Achrenius on G+: microoptimized version of
69+ * the simpler "(mask & ONEBYTES) * ONEBYTES >> 56"
70+ * that works for the bytemasks without having to
71+ * mask them first.
72+ */
73+static inline long count_masked_bytes(unsigned long mask)
74+{
75+ return mask*0x0001020304050608ul >> 56;
76+}
77+
78+#else /* 32-bit case */
79+
80+/* Carl Chatfield / Jan Achrenius G+ version for 32-bit */
81+static inline long count_masked_bytes(long mask)
82+{
83+ /* (000000 0000ff 00ffff ffffff) -> ( 1 1 2 3 ) */
84+ long a = (0x0ff0001+mask) >> 23;
85+ /* Fix the 1 for 00 case */
86+ return a & mask;
87+}
88+
89+#endif
90+
91+/* Return nonzero if it has a zero */
92+static inline unsigned long has_zero(unsigned long a, unsigned long *bits, const struct word_at_a_time *c)
93+{
94+ unsigned long mask = ((a - c->one_bits) & ~a) & c->high_bits;
95+ *bits = mask;
96+ return mask;
97+}
98+
99+static inline unsigned long prep_zero_mask(unsigned long a, unsigned long bits, const struct word_at_a_time *c)
100+{
101+ return bits;
102+}
103+
104+static inline unsigned long create_zero_mask(unsigned long bits)
105+{
106+ bits = (bits - 1) & ~bits;
107+ return bits >> 7;
108+}
109+
110+/* The mask we created is directly usable as a bytemask */
111+#define zero_bytemask(mask) (mask)
112+
113+static inline unsigned long find_zero(unsigned long mask)
114+{
115+ return count_masked_bytes(mask);
116+}
117+
118+#endif /* __BIG_ENDIAN */
119+
56120 #endif /* _ASM_WORD_AT_A_TIME_H */
include/drm/drm_crtc_helper.h+1−0
@@ -240,5 +240,6 @@ extern void drm_kms_helper_hotplug_event(struct drm_device *dev); · 239 unmodified lines
240240
241241 extern void drm_kms_helper_poll_disable(struct drm_device *dev);
242242 extern void drm_kms_helper_poll_enable(struct drm_device *dev);
243+extern void drm_kms_helper_poll_enable_locked(struct drm_device *dev);
243244
244245 #endif
include/drm/drm_dp_helper.h+4−0
@@ -568,6 +568,10 @@ · 567 unmodified lines
568568 #define MODE_I2C_READ 4
569569 #define MODE_I2C_STOP 8
570570
571+/* DP 1.2 MST PORTs - Section 2.5.1 v1.2a spec */
572+#define DP_MST_PHYSICAL_PORT_0 0
573+#define DP_MST_LOGICAL_PORT_0 8
574+
571575 #define DP_LINK_STATUS_SIZE 6
572576 bool drm_dp_channel_eq_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
573577 int lane_count);
include/drm/drm_dp_mst_helper.h+1−0
@@ -374,6 +374,7 @@ struct drm_dp_mst_topology_mgr; · 373 unmodified lines
374374 struct drm_dp_mst_topology_cbs {
375375 /* create a connector for a port */
376376 struct drm_connector *(*add_connector)(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, const char *path);
377+ void (*register_connector)(struct drm_connector *connector);
377378 void (*destroy_connector)(struct drm_dp_mst_topology_mgr *mgr,
378379 struct drm_connector *connector);
379380 void (*hotplug)(struct drm_dp_mst_topology_mgr *mgr);
include/linux/acpi.h+1−0
@@ -217,6 +217,7 @@ struct pci_dev; · 216 unmodified lines
217217
218218 int acpi_pci_irq_enable (struct pci_dev *dev);
219219 void acpi_penalize_isa_irq(int irq, int active);
220+bool acpi_isa_irq_available(int irq);
220221 void acpi_penalize_sci_irq(int irq, int trigger, int polarity);
221222 void acpi_pci_irq_disable (struct pci_dev *dev);
222223
include/linux/blk-mq.h+1−4
@@ -145,7 +145,6 @@ enum { · 144 unmodified lines
145145 BLK_MQ_F_SHOULD_MERGE = 1 << 0,
146146 BLK_MQ_F_TAG_SHARED = 1 << 1,
147147 BLK_MQ_F_SG_MERGE = 1 << 2,
148− BLK_MQ_F_SYSFS_UP = 1 << 3,
149148 BLK_MQ_F_DEFER_ISSUE = 1 << 4,
150149 BLK_MQ_F_ALLOC_POLICY_START_BIT = 8,
151150 BLK_MQ_F_ALLOC_POLICY_BITS = 1,
@@ -215,7 +214,7 @@ void blk_mq_add_to_requeue_list(struct request *rq, bool at_head); · 63 unmodified lines
215214 void blk_mq_cancel_requeue_work(struct request_queue *q);
216215 void blk_mq_kick_requeue_list(struct request_queue *q);
217216 void blk_mq_abort_requeue_list(struct request_queue *q);
218−void blk_mq_complete_request(struct request *rq);
217+void blk_mq_complete_request(struct request *rq, int error);
219218
220219 void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx);
221220 void blk_mq_start_hw_queue(struct blk_mq_hw_ctx *hctx);
@@ -224,8 +223,6 @@ void blk_mq_start_hw_queues(struct request_queue *q); · 2 unmodified lines
224223 void blk_mq_start_stopped_hw_queues(struct request_queue *q, bool async);
225224 void blk_mq_run_hw_queues(struct request_queue *q, bool async);
226225 void blk_mq_delay_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs);
227−void blk_mq_tag_busy_iter(struct blk_mq_hw_ctx *hctx, busy_iter_fn *fn,
228− void *priv);
229226 void blk_mq_all_tag_busy_iter(struct blk_mq_tags *tags, busy_tag_iter_fn *fn,
230227 void *priv);
231228 void blk_mq_freeze_queue(struct request_queue *q);
include/linux/blkdev.h+2−0
@@ -456,6 +456,8 @@ struct request_queue { · 455 unmodified lines
456456 struct blk_mq_tag_set *tag_set;
457457 struct list_head tag_set_list;
458458 struct bio_set *bio_split;
459+
460+ bool mq_sysfs_init_done;
459461 };
460462
461463 #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */
include/linux/memcontrol.h+0−1
@@ -242,7 +242,6 @@ struct mem_cgroup { · 241 unmodified lines
242242 * percpu counter.
243243 */
244244 struct mem_cgroup_stat_cpu __percpu *stat;
245− spinlock_t pcp_counter_lock;
246245
247246 #if defined(CONFIG_MEMCG_KMEM) && defined(CONFIG_INET)
248247 struct cg_proto tcp_mem;
include/linux/mlx5/device.h+0−11
@@ -402,17 +402,6 @@ struct mlx5_cmd_teardown_hca_mbox_out { · 401 unmodified lines
402402 u8 rsvd[8];
403403 };
404404
405−struct mlx5_cmd_query_special_contexts_mbox_in {
406− struct mlx5_inbox_hdr hdr;
407− u8 rsvd[8];
408−};
409−
410−struct mlx5_cmd_query_special_contexts_mbox_out {
411− struct mlx5_outbox_hdr hdr;
412− __be32 dump_fill_mkey;
413− __be32 resd_lkey;
414−};
415−
416405 struct mlx5_cmd_layout {
417406 u8 type;
418407 u8 rsvd0[3];
include/linux/mlx5/driver.h+0−1
@@ -845,7 +845,6 @@ void *mlx5_get_protocol_dev(struct mlx5_core_dev *mdev, int protocol); · 844 unmodified lines
845845 int mlx5_register_interface(struct mlx5_interface *intf);
846846 void mlx5_unregister_interface(struct mlx5_interface *intf);
847847 int mlx5_core_query_vendor_id(struct mlx5_core_dev *mdev, u32 *vendor_id);
848−int mlx5_core_query_special_context(struct mlx5_core_dev *dev, u32 *rsvd_lkey);
849848
850849 struct mlx5_profile {
851850 u64 mask;
include/linux/mm.h+21−0
@@ -905,6 +905,27 @@ static inline void set_page_links(struct page *page, enum zone_type zone, · 904 unmodified lines
905905 #endif
906906 }
907907
908+#ifdef CONFIG_MEMCG
909+static inline struct mem_cgroup *page_memcg(struct page *page)
910+{
911+ return page->mem_cgroup;
912+}
913+
914+static inline void set_page_memcg(struct page *page, struct mem_cgroup *memcg)
915+{
916+ page->mem_cgroup = memcg;
917+}
918+#else
919+static inline struct mem_cgroup *page_memcg(struct page *page)
920+{
921+ return NULL;
922+}
923+
924+static inline void set_page_memcg(struct page *page, struct mem_cgroup *memcg)
925+{
926+}
927+#endif
928+
908929 /*
909930 * Some inline functions in vmstat.h depend on page_zone()
910931 */
include/linux/rcupdate.h+5−6
@@ -230,12 +230,11 @@ void __wait_rcu_gp(bool checktiny, int n, call_rcu_func_t *crcu_array, · 229 unmodified lines
230230 struct rcu_synchronize *rs_array);
231231
232232 #define _wait_rcu_gp(checktiny, ...) \
233−do { \
234− call_rcu_func_t __crcu_array[] = { __VA_ARGS__ }; \
235− const int __n = ARRAY_SIZE(__crcu_array); \
236− struct rcu_synchronize __rs_array[__n]; \
237− \
238− __wait_rcu_gp(checktiny, __n, __crcu_array, __rs_array); \
233+do { \
234+ call_rcu_func_t __crcu_array[] = { __VA_ARGS__ }; \
235+ struct rcu_synchronize __rs_array[ARRAY_SIZE(__crcu_array)]; \
236+ __wait_rcu_gp(checktiny, ARRAY_SIZE(__crcu_array), \
237+ __crcu_array, __rs_array); \
239238 } while (0)
240239
241240 #define wait_rcu_gp(...) _wait_rcu_gp(false, __VA_ARGS__)
include/linux/skbuff.h+1−1
@@ -2708,7 +2708,7 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb, · 2707 unmodified lines
27082708 if (skb->ip_summed == CHECKSUM_COMPLETE)
27092709 skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0));
27102710 else if (skb->ip_summed == CHECKSUM_PARTIAL &&
2711− skb_checksum_start_offset(skb) <= len)
2711+ skb_checksum_start_offset(skb) < 0)
27122712 skb->ip_summed = CHECKSUM_NONE;
27132713 }
27142714
include/linux/string.h+3−0
@@ -25,6 +25,9 @@ extern char * strncpy(char *,const char *, __kernel_size_t); · 24 unmodified lines
2525 #ifndef __HAVE_ARCH_STRLCPY
2626 size_t strlcpy(char *, const char *, size_t);
2727 #endif
28+#ifndef __HAVE_ARCH_STRSCPY
29+ssize_t __must_check strscpy(char *, const char *, size_t);
30+#endif
2831 #ifndef __HAVE_ARCH_STRCAT
2932 extern char * strcat(char *, const char *);
3033 #endif
include/net/af_unix.h+5−1
@@ -63,7 +63,11 @@ struct unix_sock { · 62 unmodified lines
6363 #define UNIX_GC_MAYBE_CYCLE 1
6464 struct socket_wq peer_wq;
6565 };
66−#define unix_sk(__sk) ((struct unix_sock *)__sk)
66+
67+static inline struct unix_sock *unix_sk(struct sock *sk)
68+{
69+ return (struct unix_sock *)sk;
70+}
6771
6872 #define peer_wait peer_wq.wait
6973
include/uapi/linux/userfaultfd.h+0−2
@@ -11,8 +11,6 @@ · 10 unmodified lines
1111
1212 #include <linux/types.h>
1313
14−#include <linux/compiler.h>
15−
1614 #define UFFD_API ((__u64)0xAA)
1715 /*
1816 * After implementing the respective features it will become:
ipc/msg.c+7−7
@@ -137,13 +137,6 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params) · 136 unmodified lines
137137 return retval;
138138 }
139139
140− /* ipc_addid() locks msq upon success. */
141− id = ipc_addid(&msg_ids(ns), &msq->q_perm, ns->msg_ctlmni);
142− if (id < 0) {
143− ipc_rcu_putref(msq, msg_rcu_free);
144− return id;
145− }
146−
147140 msq->q_stime = msq->q_rtime = 0;
148141 msq->q_ctime = get_seconds();
149142 msq->q_cbytes = msq->q_qnum = 0;
@@ -153,6 +146,13 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params) · 3 unmodified lines
153146 INIT_LIST_HEAD(&msq->q_receivers);
154147 INIT_LIST_HEAD(&msq->q_senders);
155148
149+ /* ipc_addid() locks msq upon success. */
150+ id = ipc_addid(&msg_ids(ns), &msq->q_perm, ns->msg_ctlmni);
151+ if (id < 0) {
152+ ipc_rcu_putref(msq, msg_rcu_free);
153+ return id;
154+ }
155+
156156 ipc_unlock_object(&msq->q_perm);
157157 rcu_read_unlock();
158158
ipc/shm.c+7−6
@@ -551,12 +551,6 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) · 550 unmodified lines
551551 if (IS_ERR(file))
552552 goto no_file;
553553
554− id = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni);
555− if (id < 0) {
556− error = id;
557− goto no_id;
558− }
559−
560554 shp->shm_cprid = task_tgid_vnr(current);
561555 shp->shm_lprid = 0;
562556 shp->shm_atim = shp->shm_dtim = 0;
@@ -565,6 +559,13 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) · 2 unmodified lines
565559 shp->shm_nattch = 0;
566560 shp->shm_file = file;
567561 shp->shm_creator = current;
562+
563+ id = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni);
564+ if (id < 0) {
565+ error = id;
566+ goto no_id;
567+ }
568+
568569 list_add(&shp->shm_clist, &current->sysvshm.shm_clist);
569570
570571 /*
ipc/util.c+4−4
@@ -237,6 +237,10 @@ int ipc_addid(struct ipc_ids *ids, struct kern_ipc_perm *new, int size) · 236 unmodified lines
237237 rcu_read_lock();
238238 spin_lock(&new->lock);
239239
240+ current_euid_egid(&euid, &egid);
241+ new->cuid = new->uid = euid;
242+ new->gid = new->cgid = egid;
243+
240244 id = idr_alloc(&ids->ipcs_idr, new,
241245 (next_id < 0) ? 0 : ipcid_to_idx(next_id), 0,
242246 GFP_NOWAIT);
@@ -249,10 +253,6 @@ int ipc_addid(struct ipc_ids *ids, struct kern_ipc_perm *new, int size) · 6 unmodified lines
249253
250254 ids->in_use++;
251255
252− current_euid_egid(&euid, &egid);
253− new->cuid = new->uid = euid;
254− new->gid = new->cgid = egid;
255−
256256 if (next_id < 0) {
257257 new->seq = ids->seq++;
258258 if (ids->seq > IPCID_SEQ_MAX)
kernel/events/core.c+81−33
@@ -1243,11 +1243,7 @@ static inline void perf_event__state_init(struct perf_event *event) · 1242 unmodified lines
12431243 PERF_EVENT_STATE_INACTIVE;
12441244 }
12451245
1246−/*
1247− * Called at perf_event creation and when events are attached/detached from a
1248− * group.
1249− */
1250−static void perf_event__read_size(struct perf_event *event)
1246+static void __perf_event_read_size(struct perf_event *event, int nr_siblings)
12511247 {
12521248 int entry = sizeof(u64); /* value */
12531249 int size = 0;
@@ -1263,7 +1259,7 @@ static void perf_event__read_size(struct perf_event *event) · 9 unmodified lines
12631259 entry += sizeof(u64);
12641260
12651261 if (event->attr.read_format & PERF_FORMAT_GROUP) {
1266− nr += event->group_leader->nr_siblings;
1262+ nr += nr_siblings;
12671263 size += sizeof(u64);
12681264 }
12691265
@@ -1271,14 +1267,11 @@ static void perf_event__read_size(struct perf_event *event) · 1 unmodified line
12711267 event->read_size = size;
12721268 }
12731269
1274−static void perf_event__header_size(struct perf_event *event)
1270+static void __perf_event_header_size(struct perf_event *event, u64 sample_type)
12751271 {
12761272 struct perf_sample_data *data;
1277− u64 sample_type = event->attr.sample_type;
12781273 u16 size = 0;
12791274
1280− perf_event__read_size(event);
1281−
12821275 if (sample_type & PERF_SAMPLE_IP)
12831276 size += sizeof(data->ip);
12841277
@@ -1303,6 +1296,17 @@ static void perf_event__header_size(struct perf_event *event) · 18 unmodified lines
13031296 event->header_size = size;
13041297 }
13051298
1299+/*
1300+ * Called at perf_event creation and when events are attached/detached from a
1301+ * group.
1302+ */
1303+static void perf_event__header_size(struct perf_event *event)
1304+{
1305+ __perf_event_read_size(event,
1306+ event->group_leader->nr_siblings);
1307+ __perf_event_header_size(event, event->attr.sample_type);
1308+}
1309+
13061310 static void perf_event__id_header_size(struct perf_event *event)
13071311 {
13081312 struct perf_sample_data *data;
@@ -1330,6 +1334,27 @@ static void perf_event__id_header_size(struct perf_event *event) · 21 unmodified lines
13301334 event->id_header_size = size;
13311335 }
13321336
1337+static bool perf_event_validate_size(struct perf_event *event)
1338+{
1339+ /*
1340+ * The values computed here will be over-written when we actually
1341+ * attach the event.
1342+ */
1343+ __perf_event_read_size(event, event->group_leader->nr_siblings + 1);
1344+ __perf_event_header_size(event, event->attr.sample_type & ~PERF_SAMPLE_READ);
1345+ perf_event__id_header_size(event);
1346+
1347+ /*
1348+ * Sum the lot; should not exceed the 64k limit we have on records.
1349+ * Conservative limit to allow for callchains and other variable fields.
1350+ */
1351+ if (event->read_size + event->header_size +
1352+ event->id_header_size + sizeof(struct perf_event_header) >= 16*1024)
1353+ return false;
1354+
1355+ return true;
1356+}
1357+
13331358 static void perf_group_attach(struct perf_event *event)
13341359 {
13351360 struct perf_event *group_leader = event->group_leader, *pos;
@@ -8297,13 +8322,35 @@ SYSCALL_DEFINE5(perf_event_open, · 6961 unmodified lines
82978322
82988323 if (move_group) {
82998324 gctx = group_leader->ctx;
8325+ mutex_lock_double(&gctx->mutex, &ctx->mutex);
8326+ } else {
8327+ mutex_lock(&ctx->mutex);
8328+ }
83008329
8330+ if (!perf_event_validate_size(event)) {
8331+ err = -E2BIG;
8332+ goto err_locked;
8333+ }
8334+
8335+ /*
8336+ * Must be under the same ctx::mutex as perf_install_in_context(),
8337+ * because we need to serialize with concurrent event creation.
8338+ */
8339+ if (!exclusive_event_installable(event, ctx)) {
8340+ /* exclusive and group stuff are assumed mutually exclusive */
8341+ WARN_ON_ONCE(move_group);
8342+
8343+ err = -EBUSY;
8344+ goto err_locked;
8345+ }
8346+
8347+ WARN_ON_ONCE(ctx->parent_ctx);
8348+
8349+ if (move_group) {
83018350 /*
83028351 * See perf_event_ctx_lock() for comments on the details
83038352 * of swizzling perf_event::ctx.
83048353 */
8305− mutex_lock_double(&gctx->mutex, &ctx->mutex);
8306−
83078354 perf_remove_from_context(group_leader, false);
83088355
83098356 list_for_each_entry(sibling, &group_leader->sibling_list,
@@ -8311,13 +8358,7 @@ SYSCALL_DEFINE5(perf_event_open, · 1 unmodified line
83118358 perf_remove_from_context(sibling, false);
83128359 put_ctx(gctx);
83138360 }
8314− } else {
8315− mutex_lock(&ctx->mutex);
8316− }
83178361
8318− WARN_ON_ONCE(ctx->parent_ctx);
8319−
8320− if (move_group) {
83218362 /*
83228363 * Wait for everybody to stop referencing the events through
83238364 * the old lists, before installing it on new lists.
@@ -8349,22 +8390,29 @@ SYSCALL_DEFINE5(perf_event_open, · 25 unmodified lines
83498390 perf_event__state_init(group_leader);
83508391 perf_install_in_context(ctx, group_leader, group_leader->cpu);
83518392 get_ctx(ctx);
8352− }
83538393
8354− if (!exclusive_event_installable(event, ctx)) {
8355− err = -EBUSY;
8356− mutex_unlock(&ctx->mutex);
8357− fput(event_file);
8358− goto err_context;
8394+ /*
8395+ * Now that all events are installed in @ctx, nothing
8396+ * references @gctx anymore, so drop the last reference we have
8397+ * on it.
8398+ */
8399+ put_ctx(gctx);
83598400 }
83608401
8402+ /*
8403+ * Precalculate sample_data sizes; do while holding ctx::mutex such
8404+ * that we're serialized against further additions and before
8405+ * perf_install_in_context() which is the point the event is active and
8406+ * can use these values.
8407+ */
8408+ perf_event__header_size(event);
8409+ perf_event__id_header_size(event);
8410+
83618411 perf_install_in_context(ctx, event, event->cpu);
83628412 perf_unpin_context(ctx);
83638413
8364− if (move_group) {
8414+ if (move_group)
83658415 mutex_unlock(&gctx->mutex);
8366− put_ctx(gctx);
8367− }
83688416 mutex_unlock(&ctx->mutex);
83698417
83708418 put_online_cpus();
@@ -8375,12 +8423,6 @@ SYSCALL_DEFINE5(perf_event_open, · 4 unmodified lines
83758423 list_add_tail(&event->owner_entry, &current->perf_event_list);
83768424 mutex_unlock(&current->perf_event_mutex);
83778425
8378− /*
8379− * Precalculate sample_data sizes
8380− */
8381− perf_event__header_size(event);
8382− perf_event__id_header_size(event);
8383−
83848426 /*
83858427 * Drop the reference on the group_event after placing the
83868428 * new event on the sibling_list. This ensures destruction
@@ -8391,6 +8433,12 @@ SYSCALL_DEFINE5(perf_event_open, · 4 unmodified lines
83918433 fd_install(event_fd, event_file);
83928434 return event_fd;
83938435
8436+err_locked:
8437+ if (move_group)
8438+ mutex_unlock(&gctx->mutex);
8439+ mutex_unlock(&ctx->mutex);
8440+/* err_file: */
8441+ fput(event_file);
83948442 err_context:
83958443 perf_unpin_context(ctx);
83968444 put_ctx(ctx);
kernel/irq/proc.c+17−2
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/seq_file.h>
1313 #include <linux/interrupt.h>
1414 #include <linux/kernel_stat.h>
15+#include <linux/mutex.h>
1516
1617 #include "internals.h"
1718
@@ -323,18 +324,29 @@ void register_handler_proc(unsigned int irq, struct irqaction *action) · 305 unmodified lines
323324
324325 void register_irq_proc(unsigned int irq, struct irq_desc *desc)
325326 {
327+ static DEFINE_MUTEX(register_lock);
326328 char name [MAX_NAMELEN];
327329
328− if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip) || desc->dir)
330+ if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip))
329331 return;
330332
333+ /*
334+ * irq directories are registered only when a handler is
335+ * added, not when the descriptor is created, so multiple
336+ * tasks might try to register at the same time.
337+ */
338+ mutex_lock(&register_lock);
339+
340+ if (desc->dir)
341+ goto out_unlock;
342+
331343 memset(name, 0, MAX_NAMELEN);
332344 sprintf(name, "%d", irq);
333345
334346 /* create /proc/irq/1234 */
335347 desc->dir = proc_mkdir(name, root_irq_dir);
336348 if (!desc->dir)
337− return;
349+ goto out_unlock;
338350
339351 #ifdef CONFIG_SMP
340352 /* create /proc/irq/<irq>/smp_affinity */
@@ -355,6 +367,9 @@ void register_irq_proc(unsigned int irq, struct irq_desc *desc) · 14 unmodified lines
355367
356368 proc_create_data("spurious", 0444, desc->dir,
357369 &irq_spurious_proc_fops, (void *)(long)irq);
370+
371+out_unlock:
372+ mutex_unlock(&register_lock);
358373 }
359374
360375 void unregister_irq_proc(unsigned int irq, struct irq_desc *desc)
kernel/locking/lockdep.c+5−5
@@ -3068,7 +3068,7 @@ static int __lock_is_held(struct lockdep_map *lock); · 3067 unmodified lines
30683068 static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
30693069 int trylock, int read, int check, int hardirqs_off,
30703070 struct lockdep_map *nest_lock, unsigned long ip,
3071− int references)
3071+ int references, int pin_count)
30723072 {
30733073 struct task_struct *curr = current;
30743074 struct lock_class *class = NULL;
@@ -3157,7 +3157,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, · 82 unmodified lines
31573157 hlock->waittime_stamp = 0;
31583158 hlock->holdtime_stamp = lockstat_clock();
31593159 #endif
3160− hlock->pin_count = 0;
3160+ hlock->pin_count = pin_count;
31613161
31623162 if (check && !mark_irqflags(curr, hlock))
31633163 return 0;
@@ -3343,7 +3343,7 @@ found_it: · 179 unmodified lines
33433343 hlock_class(hlock)->subclass, hlock->trylock,
33443344 hlock->read, hlock->check, hlock->hardirqs_off,
33453345 hlock->nest_lock, hlock->acquire_ip,
3346− hlock->references))
3346+ hlock->references, hlock->pin_count))
33473347 return 0;
33483348 }
33493349
@@ -3433,7 +3433,7 @@ found_it: · 83 unmodified lines
34333433 hlock_class(hlock)->subclass, hlock->trylock,
34343434 hlock->read, hlock->check, hlock->hardirqs_off,
34353435 hlock->nest_lock, hlock->acquire_ip,
3436− hlock->references))
3436+ hlock->references, hlock->pin_count))
34373437 return 0;
34383438 }
34393439
@@ -3583,7 +3583,7 @@ void lock_acquire(struct lockdep_map *lock, unsigned int subclass, · 143 unmodified lines
35833583 current->lockdep_recursion = 1;
35843584 trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip);
35853585 __lock_acquire(lock, subclass, trylock, read, check,
3586− irqs_disabled_flags(flags), nest_lock, ip, 0);
3586+ irqs_disabled_flags(flags), nest_lock, ip, 0, 0);
35873587 current->lockdep_recursion = 0;
35883588 raw_local_irq_restore(flags);
35893589 }
kernel/rcu/tree.c+5−0
@@ -3868,6 +3868,7 @@ static void rcu_init_new_rnp(struct rcu_node *rnp_leaf) · 3867 unmodified lines
38683868 static void __init
38693869 rcu_boot_init_percpu_data(int cpu, struct rcu_state *rsp)
38703870 {
3871+ static struct lock_class_key rcu_exp_sched_rdp_class;
38713872 unsigned long flags;
38723873 struct rcu_data *rdp = per_cpu_ptr(rsp->rda, cpu);
38733874 struct rcu_node *rnp = rcu_get_root(rsp);
@@ -3883,6 +3884,10 @@ rcu_boot_init_percpu_data(int cpu, struct rcu_state *rsp) · 9 unmodified lines
38833884 mutex_init(&rdp->exp_funnel_mutex);
38843885 rcu_boot_init_nocb_percpu_data(rdp);
38853886 raw_spin_unlock_irqrestore(&rnp->lock, flags);
3887+ if (rsp == &rcu_sched_state)
3888+ lockdep_set_class_and_name(&rdp->exp_funnel_mutex,
3889+ &rcu_exp_sched_rdp_class,
3890+ "rcu_data_exp_sched");
38863891 }
38873892
38883893 /*
kernel/sched/core.c+11−3
@@ -4934,7 +4934,15 @@ void init_idle(struct task_struct *idle, int cpu) · 4933 unmodified lines
49344934 idle->state = TASK_RUNNING;
49354935 idle->se.exec_start = sched_clock();
49364936
4937− do_set_cpus_allowed(idle, cpumask_of(cpu));
4937+#ifdef CONFIG_SMP
4938+ /*
4939+ * Its possible that init_idle() gets called multiple times on a task,
4940+ * in that case do_set_cpus_allowed() will not do the right thing.
4941+ *
4942+ * And since this is boot we can forgo the serialization.
4943+ */
4944+ set_cpus_allowed_common(idle, cpumask_of(cpu));
4945+#endif
49384946 /*
49394947 * We're having a chicken and egg problem, even though we are
49404948 * holding rq->lock, the cpu isn't yet set to this cpu so the
@@ -4951,7 +4959,7 @@ void init_idle(struct task_struct *idle, int cpu) · 10 unmodified lines
49514959
49524960 rq->curr = rq->idle = idle;
49534961 idle->on_rq = TASK_ON_RQ_QUEUED;
4954−#if defined(CONFIG_SMP)
4962+#ifdef CONFIG_SMP
49554963 idle->on_cpu = 1;
49564964 #endif
49574965 raw_spin_unlock(&rq->lock);
@@ -4966,7 +4974,7 @@ void init_idle(struct task_struct *idle, int cpu) · 8 unmodified lines
49664974 idle->sched_class = &idle_sched_class;
49674975 ftrace_graph_init_idle_task(idle, cpu);
49684976 vtime_init_idle(idle, cpu);
4969−#if defined(CONFIG_SMP)
4977+#ifdef CONFIG_SMP
49704978 sprintf(idle->comm, "%s/%d", INIT_TASK_COMM, cpu);
49714979 #endif
49724980 }
kernel/time/clocksource.c+1−1
@@ -217,7 +217,7 @@ static void clocksource_watchdog(unsigned long data) · 216 unmodified lines
217217 continue;
218218
219219 /* Check the deviation from the watchdog clocksource. */
220− if ((abs(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD)) {
220+ if (abs64(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD) {
221221 pr_warn("timekeeping watchdog: Marking clocksource '%s' as unstable because the skew is too large:\n",
222222 cs->name);
223223 pr_warn(" '%s' wd_now: %llx wd_last: %llx mask: %llx\n",
lib/string.c+88−0
@@ -27,6 +27,10 @@ · 26 unmodified lines
2727 #include <linux/bug.h>
2828 #include <linux/errno.h>
2929
30+#include <asm/byteorder.h>
31+#include <asm/word-at-a-time.h>
32+#include <asm/page.h>
33+
3034 #ifndef __HAVE_ARCH_STRNCASECMP
3135 /**
3236 * strncasecmp - Case insensitive, length-limited string comparison
@@ -146,6 +150,90 @@ size_t strlcpy(char *dest, const char *src, size_t size) · 113 unmodified lines
146150 EXPORT_SYMBOL(strlcpy);
147151 #endif
148152
153+#ifndef __HAVE_ARCH_STRSCPY
154+/**
155+ * strscpy - Copy a C-string into a sized buffer
156+ * @dest: Where to copy the string to
157+ * @src: Where to copy the string from
158+ * @count: Size of destination buffer
159+ *
160+ * Copy the string, or as much of it as fits, into the dest buffer.
161+ * The routine returns the number of characters copied (not including
162+ * the trailing NUL) or -E2BIG if the destination buffer wasn't big enough.
163+ * The behavior is undefined if the string buffers overlap.
164+ * The destination buffer is always NUL terminated, unless it's zero-sized.
165+ *
166+ * Preferred to strlcpy() since the API doesn't require reading memory
167+ * from the src string beyond the specified "count" bytes, and since
168+ * the return value is easier to error-check than strlcpy()'s.
169+ * In addition, the implementation is robust to the string changing out
170+ * from underneath it, unlike the current strlcpy() implementation.
171+ *
172+ * Preferred to strncpy() since it always returns a valid string, and
173+ * doesn't unnecessarily force the tail of the destination buffer to be
174+ * zeroed. If the zeroing is desired, it's likely cleaner to use strscpy()
175+ * with an overflow test, then just memset() the tail of the dest buffer.
176+ */
177+ssize_t strscpy(char *dest, const char *src, size_t count)
178+{
179+ const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS;
180+ size_t max = count;
181+ long res = 0;
182+
183+ if (count == 0)
184+ return -E2BIG;
185+
186+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
187+ /*
188+ * If src is unaligned, don't cross a page boundary,
189+ * since we don't know if the next page is mapped.
190+ */
191+ if ((long)src & (sizeof(long) - 1)) {
192+ size_t limit = PAGE_SIZE - ((long)src & (PAGE_SIZE - 1));
193+ if (limit < max)
194+ max = limit;
195+ }
196+#else
197+ /* If src or dest is unaligned, don't do word-at-a-time. */
198+ if (((long) dest | (long) src) & (sizeof(long) - 1))
199+ max = 0;
200+#endif
201+
202+ while (max >= sizeof(unsigned long)) {
203+ unsigned long c, data;
204+
205+ c = *(unsigned long *)(src+res);
206+ *(unsigned long *)(dest+res) = c;
207+ if (has_zero(c, &data, &constants)) {
208+ data = prep_zero_mask(c, data, &constants);
209+ data = create_zero_mask(data);
210+ return res + find_zero(data);
211+ }
212+ res += sizeof(unsigned long);
213+ count -= sizeof(unsigned long);
214+ max -= sizeof(unsigned long);
215+ }
216+
217+ while (count) {
218+ char c;
219+
220+ c = src[res];
221+ dest[res] = c;
222+ if (!c)
223+ return res;
224+ res++;
225+ count--;
226+ }
227+
228+ /* Hit buffer length without finding a NUL; force NUL-termination. */
229+ if (res)
230+ dest[res-1] = '\0';
231+
232+ return -E2BIG;
233+}
234+EXPORT_SYMBOL(strscpy);
235+#endif
236+
149237 #ifndef __HAVE_ARCH_STRCAT
150238 /**
151239 * strcat - Append one %NUL-terminated string to another
mm/dmapool.c+1−1
@@ -394,7 +394,7 @@ static struct dma_page *pool_find_page(struct dma_pool *pool, dma_addr_t dma) · 393 unmodified lines
394394 list_for_each_entry(page, &pool->page_list, page_list) {
395395 if (dma < page->dma)
396396 continue;
397− if (dma < (page->dma + pool->allocation))
397+ if ((dma - page->dma) < pool->allocation)
398398 return page;
399399 }
400400 return NULL;
mm/hugetlb.c+8−0
@@ -3201,6 +3201,14 @@ static void unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma, · 3200 unmodified lines
32013201 if (iter_vma == vma)
32023202 continue;
32033203
3204+ /*
3205+ * Shared VMAs have their own reserves and do not affect
3206+ * MAP_PRIVATE accounting but it is possible that a shared
3207+ * VMA is using the same page so check and skip such VMAs.
3208+ */
3209+ if (iter_vma->vm_flags & VM_MAYSHARE)
3210+ continue;
3211+
32043212 /*
32053213 * Unmap the page from other VMAs without their own reserves.
32063214 * They get marked to be SIGKILLed if they fault in these
mm/memcontrol.c+18−13
@@ -644,12 +644,14 @@ mem_cgroup_largest_soft_limit_node(struct mem_cgroup_tree_per_zone *mctz) · 643 unmodified lines
644644 }
645645
646646 /*
647+ * Return page count for single (non recursive) @memcg.
648+ *
647649 * Implementation Note: reading percpu statistics for memcg.
648650 *
649651 * Both of vmstat[] and percpu_counter has threshold and do periodic
650652 * synchronization to implement "quick" read. There are trade-off between
651653 * reading cost and precision of value. Then, we may have a chance to implement
652− * a periodic synchronizion of counter in memcg's counter.
654+ * a periodic synchronization of counter in memcg's counter.
653655 *
654656 * But this _read() function is used for user interface now. The user accounts
655657 * memory usage by memory cgroup and he _always_ requires exact value because
@@ -659,17 +661,24 @@ mem_cgroup_largest_soft_limit_node(struct mem_cgroup_tree_per_zone *mctz) · 3 unmodified lines
659661 *
660662 * If there are kernel internal actions which can make use of some not-exact
661663 * value, and reading all cpu value can be performance bottleneck in some
662− * common workload, threashold and synchonization as vmstat[] should be
664+ * common workload, threshold and synchronization as vmstat[] should be
663665 * implemented.
664666 */
665−static long mem_cgroup_read_stat(struct mem_cgroup *memcg,
666− enum mem_cgroup_stat_index idx)
667+static unsigned long
668+mem_cgroup_read_stat(struct mem_cgroup *memcg, enum mem_cgroup_stat_index idx)
667669 {
668670 long val = 0;
669671 int cpu;
670672
673+ /* Per-cpu values can be negative, use a signed accumulator */
671674 for_each_possible_cpu(cpu)
672675 val += per_cpu(memcg->stat->count[idx], cpu);
676+ /*
677+ * Summing races with updates, so val may be negative. Avoid exposing
678+ * transient negative values.
679+ */
680+ if (val < 0)
681+ val = 0;
673682 return val;
674683 }
675684
@@ -1254,7 +1263,7 @@ void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p) · 578 unmodified lines
12541263 for (i = 0; i < MEM_CGROUP_STAT_NSTATS; i++) {
12551264 if (i == MEM_CGROUP_STAT_SWAP && !do_swap_account)
12561265 continue;
1257− pr_cont(" %s:%ldKB", mem_cgroup_stat_names[i],
1266+ pr_cont(" %s:%luKB", mem_cgroup_stat_names[i],
12581267 K(mem_cgroup_read_stat(iter, i)));
12591268 }
12601269
@@ -2819,14 +2828,11 @@ static unsigned long tree_stat(struct mem_cgroup *memcg, · 1558 unmodified lines
28192828 enum mem_cgroup_stat_index idx)
28202829 {
28212830 struct mem_cgroup *iter;
2822− long val = 0;
2831+ unsigned long val = 0;
28232832
2824− /* Per-cpu values can be negative, use a signed accumulator */
28252833 for_each_mem_cgroup_tree(iter, memcg)
28262834 val += mem_cgroup_read_stat(iter, idx);
28272835
2828− if (val < 0) /* race ? */
2829− val = 0;
28302836 return val;
28312837 }
28322838
@@ -3169,7 +3175,7 @@ static int memcg_stat_show(struct seq_file *m, void *v) · 336 unmodified lines
31693175 for (i = 0; i < MEM_CGROUP_STAT_NSTATS; i++) {
31703176 if (i == MEM_CGROUP_STAT_SWAP && !do_swap_account)
31713177 continue;
3172− seq_printf(m, "%s %ld\n", mem_cgroup_stat_names[i],
3178+ seq_printf(m, "%s %lu\n", mem_cgroup_stat_names[i],
31733179 mem_cgroup_read_stat(memcg, i) * PAGE_SIZE);
31743180 }
31753181
@@ -3194,13 +3200,13 @@ static int memcg_stat_show(struct seq_file *m, void *v) · 18 unmodified lines
31943200 (u64)memsw * PAGE_SIZE);
31953201
31963202 for (i = 0; i < MEM_CGROUP_STAT_NSTATS; i++) {
3197− long long val = 0;
3203+ unsigned long long val = 0;
31983204
31993205 if (i == MEM_CGROUP_STAT_SWAP && !do_swap_account)
32003206 continue;
32013207 for_each_mem_cgroup_tree(mi, memcg)
32023208 val += mem_cgroup_read_stat(mi, i) * PAGE_SIZE;
3203− seq_printf(m, "total_%s %lld\n", mem_cgroup_stat_names[i], val);
3209+ seq_printf(m, "total_%s %llu\n", mem_cgroup_stat_names[i], val);
32043210 }
32053211
32063212 for (i = 0; i < MEM_CGROUP_EVENTS_NSTATS; i++) {
@@ -4179,7 +4185,6 @@ static struct mem_cgroup *mem_cgroup_alloc(void) · 972 unmodified lines
41794185 if (memcg_wb_domain_init(memcg, GFP_KERNEL))
41804186 goto out_free_stat;
41814187
4182− spin_lock_init(&memcg->pcp_counter_lock);
41834188 return memcg;
41844189
41854190 out_free_stat:
mm/migrate.c+11−1
@@ -740,6 +740,15 @@ static int move_to_new_page(struct page *newpage, struct page *page, · 739 unmodified lines
740740 if (PageSwapBacked(page))
741741 SetPageSwapBacked(newpage);
742742
743+ /*
744+ * Indirectly called below, migrate_page_copy() copies PG_dirty and thus
745+ * needs newpage's memcg set to transfer memcg dirty page accounting.
746+ * So perform memcg migration in two steps:
747+ * 1. set newpage->mem_cgroup (here)
748+ * 2. clear page->mem_cgroup (below)
749+ */
750+ set_page_memcg(newpage, page_memcg(page));
751+
743752 mapping = page_mapping(page);
744753 if (!mapping)
745754 rc = migrate_page(mapping, newpage, page, mode);
@@ -756,9 +765,10 @@ static int move_to_new_page(struct page *newpage, struct page *page, · 10 unmodified lines
756765 rc = fallback_migrate_page(mapping, newpage, page, mode);
757766
758767 if (rc != MIGRATEPAGE_SUCCESS) {
768+ set_page_memcg(newpage, NULL);
759769 newpage->mapping = NULL;
760770 } else {
761− mem_cgroup_migrate(page, newpage, false);
771+ set_page_memcg(page, NULL);
762772 if (page_was_mapped)
763773 remove_migration_ptes(page, newpage);
764774 page->mapping = NULL;
mm/slab.c+10−3
@@ -2190,9 +2190,16 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags) · 2189 unmodified lines
21902190 size += BYTES_PER_WORD;
21912191 }
21922192 #if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC)
2193− if (size >= kmalloc_size(INDEX_NODE + 1)
2194− && cachep->object_size > cache_line_size()
2195− && ALIGN(size, cachep->align) < PAGE_SIZE) {
2193+ /*
2194+ * To activate debug pagealloc, off-slab management is necessary
2195+ * requirement. In early phase of initialization, small sized slab
2196+ * doesn't get initialized so it would not be possible. So, we need
2197+ * to check size >= 256. It guarantees that all necessary small
2198+ * sized slab is initialized in current slab initialization sequence.
2199+ */
2200+ if (!slab_early_init && size >= kmalloc_size(INDEX_NODE) &&
2201+ size >= 256 && cachep->object_size > cache_line_size() &&
2202+ ALIGN(size, cachep->align) < PAGE_SIZE) {
21962203 cachep->obj_offset += PAGE_SIZE - ALIGN(size, cachep->align);
21972204 size = PAGE_SIZE;
21982205 }
net/core/net-sysfs.c+1−2
@@ -31,7 +31,6 @@ · 30 unmodified lines
3131 static const char fmt_hex[] = "%#x\n";
3232 static const char fmt_long_hex[] = "%#lx\n";
3333 static const char fmt_dec[] = "%d\n";
34−static const char fmt_udec[] = "%u\n";
3534 static const char fmt_ulong[] = "%lu\n";
3635 static const char fmt_u64[] = "%llu\n";
3736
@@ -202,7 +201,7 @@ static ssize_t speed_show(struct device *dev, · 164 unmodified lines
202201 if (netif_running(netdev)) {
203202 struct ethtool_cmd cmd;
204203 if (!__ethtool_get_settings(netdev, &cmd))
205− ret = sprintf(buf, fmt_udec, ethtool_cmd_speed(&cmd));
204+ ret = sprintf(buf, fmt_dec, ethtool_cmd_speed(&cmd));
206205 }
207206 rtnl_unlock();
208207 return ret;
net/core/skbuff.c+5−4
@@ -2958,11 +2958,12 @@ EXPORT_SYMBOL_GPL(skb_append_pagefrags); · 2957 unmodified lines
29582958 */
29592959 unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len)
29602960 {
2961+ unsigned char *data = skb->data;
2962+
29612963 BUG_ON(len > skb->len);
2962− skb->len -= len;
2963− BUG_ON(skb->len < skb->data_len);
2964− skb_postpull_rcsum(skb, skb->data, len);
2965− return skb->data += len;
2964+ __skb_pull(skb, len);
2965+ skb_postpull_rcsum(skb, data, len);
2966+ return skb->data;
29662967 }
29672968 EXPORT_SYMBOL_GPL(skb_pull_rcsum);
29682969
net/dsa/slave.c+8−3
@@ -458,12 +458,17 @@ static int dsa_slave_stp_update(struct net_device *dev, u8 state) · 457 unmodified lines
458458 static int dsa_slave_port_attr_set(struct net_device *dev,
459459 struct switchdev_attr *attr)
460460 {
461− int ret = 0;
461+ struct dsa_slave_priv *p = netdev_priv(dev);
462+ struct dsa_switch *ds = p->parent;
463+ int ret;
462464
463465 switch (attr->id) {
464466 case SWITCHDEV_ATTR_PORT_STP_STATE:
465− if (attr->trans == SWITCHDEV_TRANS_COMMIT)
466− ret = dsa_slave_stp_update(dev, attr->u.stp_state);
467+ if (attr->trans == SWITCHDEV_TRANS_PREPARE)
468+ ret = ds->drv->port_stp_update ? 0 : -EOPNOTSUPP;
469+ else
470+ ret = ds->drv->port_stp_update(ds, p->port,
471+ attr->u.stp_state);
467472 break;
468473 default:
469474 ret = -EOPNOTSUPP;
net/ipv4/fib_frontend.c+1−0
@@ -340,6 +340,7 @@ static int __fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst, · 339 unmodified lines
340340 fl4.flowi4_tos = tos;
341341 fl4.flowi4_scope = RT_SCOPE_UNIVERSE;
342342 fl4.flowi4_tun_key.tun_id = 0;
343+ fl4.flowi4_flags = 0;
343344
344345 no_addr = idev->ifa_list == NULL;
345346
net/ipv4/route.c+1−0
@@ -1737,6 +1737,7 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr, · 1736 unmodified lines
17371737 fl4.flowi4_mark = skb->mark;
17381738 fl4.flowi4_tos = tos;
17391739 fl4.flowi4_scope = RT_SCOPE_UNIVERSE;
1740+ fl4.flowi4_flags = 0;
17401741 fl4.daddr = daddr;
17411742 fl4.saddr = saddr;
17421743 err = fib_lookup(net, &fl4, &res, 0);
net/ipv6/route.c+2−1
@@ -1193,7 +1193,8 @@ struct dst_entry *ip6_route_output(struct net *net, const struct sock *sk, · 1192 unmodified lines
11931193
11941194 fl6->flowi6_iif = LOOPBACK_IFINDEX;
11951195
1196− if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl6->daddr))
1196+ if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl6->daddr) ||
1197+ fl6->flowi6_oif)
11971198 flags |= RT6_LOOKUP_F_IFACE;
11981199
11991200 if (!ipv6_addr_any(&fl6->saddr))
net/l2tp/l2tp_core.c+9−2
@@ -1319,7 +1319,7 @@ static void l2tp_tunnel_del_work(struct work_struct *work) · 1318 unmodified lines
13191319 tunnel = container_of(work, struct l2tp_tunnel, del_work);
13201320 sk = l2tp_tunnel_sock_lookup(tunnel);
13211321 if (!sk)
1322− return;
1322+ goto out;
13231323
13241324 sock = sk->sk_socket;
13251325
@@ -1341,6 +1341,8 @@ static void l2tp_tunnel_del_work(struct work_struct *work) · 15 unmodified lines
13411341 }
13421342
13431343 l2tp_tunnel_sock_put(sk);
1344+out:
1345+ l2tp_tunnel_dec_refcount(tunnel);
13441346 }
13451347
13461348 /* Create a socket for the tunnel, if one isn't set up by
@@ -1636,8 +1638,13 @@ EXPORT_SYMBOL_GPL(l2tp_tunnel_create); · 289 unmodified lines
16361638 */
16371639 int l2tp_tunnel_delete(struct l2tp_tunnel *tunnel)
16381640 {
1641+ l2tp_tunnel_inc_refcount(tunnel);
16391642 l2tp_tunnel_closeall(tunnel);
1640− return (false == queue_work(l2tp_wq, &tunnel->del_work));
1643+ if (false == queue_work(l2tp_wq, &tunnel->del_work)) {
1644+ l2tp_tunnel_dec_refcount(tunnel);
1645+ return 1;
1646+ }
1647+ return 0;
16411648 }
16421649 EXPORT_SYMBOL_GPL(l2tp_tunnel_delete);
16431650
net/sctp/associola.c+11−9
@@ -1208,20 +1208,22 @@ void sctp_assoc_update(struct sctp_association *asoc, · 1207 unmodified lines
12081208 * within this document.
12091209 *
12101210 * Our basic strategy is to round-robin transports in priorities
1211− * according to sctp_state_prio_map[] e.g., if no such
1211+ * according to sctp_trans_score() e.g., if no such
12121212 * transport with state SCTP_ACTIVE exists, round-robin through
12131213 * SCTP_UNKNOWN, etc. You get the picture.
12141214 */
1215−static const u8 sctp_trans_state_to_prio_map[] = {
1216− [SCTP_ACTIVE] = 3, /* best case */
1217− [SCTP_UNKNOWN] = 2,
1218− [SCTP_PF] = 1,
1219− [SCTP_INACTIVE] = 0, /* worst case */
1220−};
1221−
12221215 static u8 sctp_trans_score(const struct sctp_transport *trans)
12231216 {
1224− return sctp_trans_state_to_prio_map[trans->state];
1217+ switch (trans->state) {
1218+ case SCTP_ACTIVE:
1219+ return 3; /* best case */
1220+ case SCTP_UNKNOWN:
1221+ return 2;
1222+ case SCTP_PF:
1223+ return 1;
1224+ default: /* case SCTP_INACTIVE */
1225+ return 0; /* worst case */
1226+ }
12251227 }
12261228
12271229 static struct sctp_transport *sctp_trans_elect_tie(struct sctp_transport *trans1,
net/sctp/sm_sideeffect.c+24−20
@@ -244,12 +244,13 @@ void sctp_generate_t3_rtx_event(unsigned long peer) · 243 unmodified lines
244244 int error;
245245 struct sctp_transport *transport = (struct sctp_transport *) peer;
246246 struct sctp_association *asoc = transport->asoc;
247− struct net *net = sock_net(asoc->base.sk);
247+ struct sock *sk = asoc->base.sk;
248+ struct net *net = sock_net(sk);
248249
249250 /* Check whether a task is in the sock. */
250251
251− bh_lock_sock(asoc->base.sk);
252− if (sock_owned_by_user(asoc->base.sk)) {
252+ bh_lock_sock(sk);
253+ if (sock_owned_by_user(sk)) {
253254 pr_debug("%s: sock is busy\n", __func__);
254255
255256 /* Try again later. */
@@ -272,10 +273,10 @@ void sctp_generate_t3_rtx_event(unsigned long peer) · 16 unmodified lines
272273 transport, GFP_ATOMIC);
273274
274275 if (error)
275− asoc->base.sk->sk_err = -error;
276+ sk->sk_err = -error;
276277
277278 out_unlock:
278− bh_unlock_sock(asoc->base.sk);
279+ bh_unlock_sock(sk);
279280 sctp_transport_put(transport);
280281 }
281282
@@ -285,11 +286,12 @@ out_unlock: · 3 unmodified lines
285286 static void sctp_generate_timeout_event(struct sctp_association *asoc,
286287 sctp_event_timeout_t timeout_type)
287288 {
288− struct net *net = sock_net(asoc->base.sk);
289+ struct sock *sk = asoc->base.sk;
290+ struct net *net = sock_net(sk);
289291 int error = 0;
290292
291− bh_lock_sock(asoc->base.sk);
292− if (sock_owned_by_user(asoc->base.sk)) {
293+ bh_lock_sock(sk);
294+ if (sock_owned_by_user(sk)) {
293295 pr_debug("%s: sock is busy: timer %d\n", __func__,
294296 timeout_type);
295297
@@ -312,10 +314,10 @@ static void sctp_generate_timeout_event(struct sctp_association *asoc, · 16 unmodified lines
312314 (void *)timeout_type, GFP_ATOMIC);
313315
314316 if (error)
315− asoc->base.sk->sk_err = -error;
317+ sk->sk_err = -error;
316318
317319 out_unlock:
318− bh_unlock_sock(asoc->base.sk);
320+ bh_unlock_sock(sk);
319321 sctp_association_put(asoc);
320322 }
321323
@@ -365,10 +367,11 @@ void sctp_generate_heartbeat_event(unsigned long data) · 43 unmodified lines
365367 int error = 0;
366368 struct sctp_transport *transport = (struct sctp_transport *) data;
367369 struct sctp_association *asoc = transport->asoc;
368− struct net *net = sock_net(asoc->base.sk);
370+ struct sock *sk = asoc->base.sk;
371+ struct net *net = sock_net(sk);
369372
370− bh_lock_sock(asoc->base.sk);
371− if (sock_owned_by_user(asoc->base.sk)) {
373+ bh_lock_sock(sk);
374+ if (sock_owned_by_user(sk)) {
372375 pr_debug("%s: sock is busy\n", __func__);
373376
374377 /* Try again later. */
@@ -388,11 +391,11 @@ void sctp_generate_heartbeat_event(unsigned long data) · 13 unmodified lines
388391 asoc->state, asoc->ep, asoc,
389392 transport, GFP_ATOMIC);
390393
391− if (error)
392− asoc->base.sk->sk_err = -error;
394+ if (error)
395+ sk->sk_err = -error;
393396
394397 out_unlock:
395− bh_unlock_sock(asoc->base.sk);
398+ bh_unlock_sock(sk);
396399 sctp_transport_put(transport);
397400 }
398401
@@ -403,10 +406,11 @@ void sctp_generate_proto_unreach_event(unsigned long data) · 4 unmodified lines
403406 {
404407 struct sctp_transport *transport = (struct sctp_transport *) data;
405408 struct sctp_association *asoc = transport->asoc;
406− struct net *net = sock_net(asoc->base.sk);
409+ struct sock *sk = asoc->base.sk;
410+ struct net *net = sock_net(sk);
407411
408− bh_lock_sock(asoc->base.sk);
409− if (sock_owned_by_user(asoc->base.sk)) {
412+ bh_lock_sock(sk);
413+ if (sock_owned_by_user(sk)) {
410414 pr_debug("%s: sock is busy\n", __func__);
411415
412416 /* Try again later. */
@@ -427,7 +431,7 @@ void sctp_generate_proto_unreach_event(unsigned long data) · 14 unmodified lines
427431 asoc->state, asoc->ep, asoc, transport, GFP_ATOMIC);
428432
429433 out_unlock:
430− bh_unlock_sock(asoc->base.sk);
434+ bh_unlock_sock(sk);
431435 sctp_association_put(asoc);
432436 }
433437
net/sunrpc/xprtrdma/fmr_ops.c+0−19
@@ -39,25 +39,6 @@ static int · 38 unmodified lines
3939 fmr_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep,
4040 struct rpcrdma_create_data_internal *cdata)
4141 {
42− struct ib_device_attr *devattr = &ia->ri_devattr;
43− struct ib_mr *mr;
44−
45− /* Obtain an lkey to use for the regbufs, which are
46− * protected from remote access.
47− */
48− if (devattr->device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY) {
49− ia->ri_dma_lkey = ia->ri_device->local_dma_lkey;
50− } else {
51− mr = ib_get_dma_mr(ia->ri_pd, IB_ACCESS_LOCAL_WRITE);
52− if (IS_ERR(mr)) {
53− pr_err("%s: ib_get_dma_mr for failed with %lX\n",
54− __func__, PTR_ERR(mr));
55− return -ENOMEM;
56− }
57− ia->ri_dma_lkey = ia->ri_dma_mr->lkey;
58− ia->ri_dma_mr = mr;
59− }
60−
6142 return 0;
6243 }
6344
net/sunrpc/xprtrdma/frwr_ops.c+0−5
@@ -189,11 +189,6 @@ frwr_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep, · 188 unmodified lines
189189 struct ib_device_attr *devattr = &ia->ri_devattr;
190190 int depth, delta;
191191
192− /* Obtain an lkey to use for the regbufs, which are
193− * protected from remote access.
194− */
195− ia->ri_dma_lkey = ia->ri_device->local_dma_lkey;
196−
197192 ia->ri_max_frmr_depth =
198193 min_t(unsigned int, RPCRDMA_MAX_DATA_SEGS,
199194 devattr->max_fast_reg_page_list_len);
net/sunrpc/xprtrdma/physical_ops.c+1−9
@@ -23,7 +23,6 @@ static int · 22 unmodified lines
2323 physical_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep,
2424 struct rpcrdma_create_data_internal *cdata)
2525 {
26− struct ib_device_attr *devattr = &ia->ri_devattr;
2726 struct ib_mr *mr;
2827
2928 /* Obtain an rkey to use for RPC data payloads.
@@ -37,15 +36,8 @@ physical_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep, · 7 unmodified lines
3736 __func__, PTR_ERR(mr));
3837 return -ENOMEM;
3938 }
40− ia->ri_dma_mr = mr;
41−
42− /* Obtain an lkey to use for regbufs.
43− */
44− if (devattr->device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY)
45− ia->ri_dma_lkey = ia->ri_device->local_dma_lkey;
46− else
47− ia->ri_dma_lkey = ia->ri_dma_mr->lkey;
4839
40+ ia->ri_dma_mr = mr;
4941 return 0;
5042 }
5143
net/sunrpc/xprtrdma/verbs.c+1−1
@@ -1252,7 +1252,7 @@ rpcrdma_alloc_regbuf(struct rpcrdma_ia *ia, size_t size, gfp_t flags) · 1251 unmodified lines
12521252 goto out_free;
12531253
12541254 iov->length = size;
1255− iov->lkey = ia->ri_dma_lkey;
1255+ iov->lkey = ia->ri_pd->local_dma_lkey;
12561256 rb->rg_size = size;
12571257 rb->rg_owner = NULL;
12581258 return rb;
net/sunrpc/xprtrdma/xprt_rdma.h+0−1
@@ -65,7 +65,6 @@ struct rpcrdma_ia { · 64 unmodified lines
6565 struct rdma_cm_id *ri_id;
6666 struct ib_pd *ri_pd;
6767 struct ib_mr *ri_dma_mr;
68− u32 ri_dma_lkey;
6968 struct completion ri_done;
7069 int ri_async_rc;
7170 unsigned int ri_max_frmr_depth;
net/unix/af_unix.c+14−1
@@ -2179,8 +2179,21 @@ unlock: · 2178 unmodified lines
21792179 if (UNIXCB(skb).fp)
21802180 scm.fp = scm_fp_dup(UNIXCB(skb).fp);
21812181
2182− sk_peek_offset_fwd(sk, chunk);
2182+ if (skip) {
2183+ sk_peek_offset_fwd(sk, chunk);
2184+ skip -= chunk;
2185+ }
21832186
2187+ if (UNIXCB(skb).fp)
2188+ break;
2189+
2190+ last = skb;
2191+ last_len = skb->len;
2192+ unix_state_lock(sk);
2193+ skb = skb_peek_next(skb, &sk->sk_receive_queue);
2194+ if (skb)
2195+ goto again;
2196+ unix_state_unlock(sk);
21842197 break;
21852198 }
21862199 } while (size);
samples/kprobes/jprobe_example.c+7−7
@@ -1,13 +1,13 @@
11 /*
22 * Here's a sample kernel module showing the use of jprobes to dump
3− * the arguments of do_fork().
3+ * the arguments of _do_fork().
44 *
55 * For more information on theory of operation of jprobes, see
66 * Documentation/kprobes.txt
77 *
88 * Build and insert the kernel module as done in the kprobe example.
99 * You will see the trace data in /var/log/messages and on the
10− * console whenever do_fork() is invoked to create a new process.
10+ * console whenever _do_fork() is invoked to create a new process.
1111 * (Some messages may be suppressed if syslogd is configured to
1212 * eliminate duplicate messages.)
1313 */
@@ -17,13 +17,13 @@ · 3 unmodified lines
1717 #include <linux/kprobes.h>
1818
1919 /*
20− * Jumper probe for do_fork.
20+ * Jumper probe for _do_fork.
2121 * Mirror principle enables access to arguments of the probed routine
2222 * from the probe handler.
2323 */
2424
25−/* Proxy routine having the same arguments as actual do_fork() routine */
26−static long jdo_fork(unsigned long clone_flags, unsigned long stack_start,
25+/* Proxy routine having the same arguments as actual _do_fork() routine */
26+static long j_do_fork(unsigned long clone_flags, unsigned long stack_start,
2727 unsigned long stack_size, int __user *parent_tidptr,
2828 int __user *child_tidptr)
2929 {
@@ -36,9 +36,9 @@ static long jdo_fork(unsigned long clone_flags, unsigned long stack_start, · 6 unmodified lines
3636 }
3737
3838 static struct jprobe my_jprobe = {
39− .entry = jdo_fork,
39+ .entry = j_do_fork,
4040 .kp = {
41− .symbol_name = "do_fork",
41+ .symbol_name = "_do_fork",
4242 },
4343 };
4444
samples/kprobes/kprobe_example.c+3−3
@@ -1,13 +1,13 @@
11 /*
22 * NOTE: This example is works on x86 and powerpc.
33 * Here's a sample kernel module showing the use of kprobes to dump a
4− * stack trace and selected registers when do_fork() is called.
4+ * stack trace and selected registers when _do_fork() is called.
55 *
66 * For more information on theory of operation of kprobes, see
77 * Documentation/kprobes.txt
88 *
99 * You will see the trace data in /var/log/messages and on the console
10− * whenever do_fork() is invoked to create a new process.
10+ * whenever _do_fork() is invoked to create a new process.
1111 */
1212
1313 #include <linux/kernel.h>
@@ -16,7 +16,7 @@ · 2 unmodified lines
1616
1717 /* For each probe you need to allocate a kprobe structure */
1818 static struct kprobe kp = {
19− .symbol_name = "do_fork",
19+ .symbol_name = "_do_fork",
2020 };
2121
2222 /* kprobe pre_handler: called just before the probed instruction is executed */
samples/kprobes/kretprobe_example.c+2−2
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 *
88 * usage: insmod kretprobe_example.ko func=<func_name>
99 *
10− * If no func_name is specified, do_fork is instrumented
10+ * If no func_name is specified, _do_fork is instrumented
1111 *
1212 * For more information on theory of operation of kretprobes, see
1313 * Documentation/kprobes.txt
@@ -25,7 +25,7 @@ · 11 unmodified lines
2525 #include <linux/limits.h>
2626 #include <linux/sched.h>
2727
28−static char func_name[NAME_MAX] = "do_fork";
28+static char func_name[NAME_MAX] = "_do_fork";
2929 module_param_string(func, func_name, NAME_MAX, S_IRUGO);
3030 MODULE_PARM_DESC(func, "Function to kretprobe; this module will report the"
3131 " function's execution time");
scripts/extract-cert.c+0−4
@@ -17,13 +17,9 @@ · 16 unmodified lines
1717 #include <stdint.h>
1818 #include <stdbool.h>
1919 #include <string.h>
20−#include <getopt.h>
2120 #include <err.h>
22−#include <arpa/inet.h>
2321 #include <openssl/bio.h>
24−#include <openssl/evp.h>
2522 #include <openssl/pem.h>
26−#include <openssl/pkcs7.h>
2723 #include <openssl/err.h>
2824 #include <openssl/engine.h>
2925
scripts/sign-file.c+77−17
@@ -20,13 +20,34 @@ · 19 unmodified lines
2020 #include <getopt.h>
2121 #include <err.h>
2222 #include <arpa/inet.h>
23+#include <openssl/opensslv.h>
2324 #include <openssl/bio.h>
2425 #include <openssl/evp.h>
2526 #include <openssl/pem.h>
26−#include <openssl/cms.h>
2727 #include <openssl/err.h>
2828 #include <openssl/engine.h>
2929
30+/*
31+ * Use CMS if we have openssl-1.0.0 or newer available - otherwise we have to
32+ * assume that it's not available and its header file is missing and that we
33+ * should use PKCS#7 instead. Switching to the older PKCS#7 format restricts
34+ * the options we have on specifying the X.509 certificate we want.
35+ *
36+ * Further, older versions of OpenSSL don't support manually adding signers to
37+ * the PKCS#7 message so have to accept that we get a certificate included in
38+ * the signature message. Nor do such older versions of OpenSSL support
39+ * signing with anything other than SHA1 - so we're stuck with that if such is
40+ * the case.
41+ */
42+#if OPENSSL_VERSION_NUMBER < 0x10000000L
43+#define USE_PKCS7
44+#endif
45+#ifndef USE_PKCS7
46+#include <openssl/cms.h>
47+#else
48+#include <openssl/pkcs7.h>
49+#endif
50+
3051 struct module_signature {
3152 uint8_t algo; /* Public-key crypto algorithm [0] */
3253 uint8_t hash; /* Digest algorithm [0] */
@@ -110,30 +131,42 @@ int main(int argc, char **argv) · 77 unmodified lines
110131 struct module_signature sig_info = { .id_type = PKEY_ID_PKCS7 };
111132 char *hash_algo = NULL;
112133 char *private_key_name, *x509_name, *module_name, *dest_name;
113− bool save_cms = false, replace_orig;
134+ bool save_sig = false, replace_orig;
114135 bool sign_only = false;
115136 unsigned char buf[4096];
116− unsigned long module_size, cms_size;
117− unsigned int use_keyid = 0, use_signed_attrs = CMS_NOATTR;
137+ unsigned long module_size, sig_size;
138+ unsigned int use_signed_attrs;
118139 const EVP_MD *digest_algo;
119140 EVP_PKEY *private_key;
141+#ifndef USE_PKCS7
120142 CMS_ContentInfo *cms;
143+ unsigned int use_keyid = 0;
144+#else
145+ PKCS7 *pkcs7;
146+#endif
121147 X509 *x509;
122148 BIO *b, *bd = NULL, *bm;
123149 int opt, n;
124−
125150 OpenSSL_add_all_algorithms();
126151 ERR_load_crypto_strings();
127152 ERR_clear_error();
128153
129154 key_pass = getenv("KBUILD_SIGN_PIN");
130155
156+#ifndef USE_PKCS7
157+ use_signed_attrs = CMS_NOATTR;
158+#else
159+ use_signed_attrs = PKCS7_NOATTR;
160+#endif
161+
131162 do {
132163 opt = getopt(argc, argv, "dpk");
133164 switch (opt) {
134− case 'p': save_cms = true; break;
135− case 'd': sign_only = true; save_cms = true; break;
165+ case 'p': save_sig = true; break;
166+ case 'd': sign_only = true; save_sig = true; break;
167+#ifndef USE_PKCS7
136168 case 'k': use_keyid = CMS_USE_KEYID; break;
169+#endif
137170 case -1: break;
138171 default: format();
139172 }
@@ -157,6 +190,14 @@ int main(int argc, char **argv) · 17 unmodified lines
157190 replace_orig = true;
158191 }
159192
193+#ifdef USE_PKCS7
194+ if (strcmp(hash_algo, "sha1") != 0) {
195+ fprintf(stderr, "sign-file: %s only supports SHA1 signing\n",
196+ OPENSSL_VERSION_TEXT);
197+ exit(3);
198+ }
199+#endif
200+
160201 /* Read the private key and the X.509 cert the PKCS#7 message
161202 * will point to.
162203 */
@@ -213,7 +254,8 @@ int main(int argc, char **argv) · 50 unmodified lines
213254 bm = BIO_new_file(module_name, "rb");
214255 ERR(!bm, "%s", module_name);
215256
216− /* Load the CMS message from the digest buffer. */
257+#ifndef USE_PKCS7
258+ /* Load the signature message from the digest buffer. */
217259 cms = CMS_sign(NULL, NULL, NULL, NULL,
218260 CMS_NOCERTS | CMS_PARTIAL | CMS_BINARY | CMS_DETACHED | CMS_STREAM);
219261 ERR(!cms, "CMS_sign");
@@ -221,17 +263,31 @@ int main(int argc, char **argv) · 1 unmodified line
221263 ERR(!CMS_add1_signer(cms, x509, private_key, digest_algo,
222264 CMS_NOCERTS | CMS_BINARY | CMS_NOSMIMECAP |
223265 use_keyid | use_signed_attrs),
224− "CMS_sign_add_signer");
266+ "CMS_add1_signer");
225267 ERR(CMS_final(cms, bm, NULL, CMS_NOCERTS | CMS_BINARY) < 0,
226268 "CMS_final");
227269
228− if (save_cms) {
229− char *cms_name;
270+#else
271+ pkcs7 = PKCS7_sign(x509, private_key, NULL, bm,
272+ PKCS7_NOCERTS | PKCS7_BINARY |
273+ PKCS7_DETACHED | use_signed_attrs);
274+ ERR(!pkcs7, "PKCS7_sign");
275+#endif
230276
231− ERR(asprintf(&cms_name, "%s.p7s", module_name) < 0, "asprintf");
232− b = BIO_new_file(cms_name, "wb");
233− ERR(!b, "%s", cms_name);
234− ERR(i2d_CMS_bio_stream(b, cms, NULL, 0) < 0, "%s", cms_name);
277+ if (save_sig) {
278+ char *sig_file_name;
279+
280+ ERR(asprintf(&sig_file_name, "%s.p7s", module_name) < 0,
281+ "asprintf");
282+ b = BIO_new_file(sig_file_name, "wb");
283+ ERR(!b, "%s", sig_file_name);
284+#ifndef USE_PKCS7
285+ ERR(i2d_CMS_bio_stream(b, cms, NULL, 0) < 0,
286+ "%s", sig_file_name);
287+#else
288+ ERR(i2d_PKCS7_bio(b, pkcs7) < 0,
289+ "%s", sig_file_name);
290+#endif
235291 BIO_free(b);
236292 }
237293
@@ -247,9 +303,13 @@ int main(int argc, char **argv) · 9 unmodified lines
247303 ERR(n < 0, "%s", module_name);
248304 module_size = BIO_number_written(bd);
249305
306+#ifndef USE_PKCS7
250307 ERR(i2d_CMS_bio_stream(bd, cms, NULL, 0) < 0, "%s", dest_name);
251− cms_size = BIO_number_written(bd) - module_size;
252− sig_info.sig_len = htonl(cms_size);
308+#else
309+ ERR(i2d_PKCS7_bio(bd, pkcs7) < 0, "%s", dest_name);
310+#endif
311+ sig_size = BIO_number_written(bd) - module_size;
312+ sig_info.sig_len = htonl(sig_size);
253313 ERR(BIO_write(bd, &sig_info, sizeof(sig_info)) < 0, "%s", dest_name);
254314 ERR(BIO_write(bd, magic_number, sizeof(magic_number) - 1) < 0, "%s", dest_name);
255315
security/keys/gc.c+4−4
@@ -134,6 +134,10 @@ static noinline void key_gc_unused_keys(struct list_head *keys) · 133 unmodified lines
134134 kdebug("- %u", key->serial);
135135 key_check(key);
136136
137+ /* Throw away the key data */
138+ if (key->type->destroy)
139+ key->type->destroy(key);
140+
137141 security_key_free(key);
138142
139143 /* deal with the user's key tracking and quota */
@@ -148,10 +152,6 @@ static noinline void key_gc_unused_keys(struct list_head *keys) · 8 unmodified lines
148152 if (test_bit(KEY_FLAG_INSTANTIATED, &key->flags))
149153 atomic_dec(&key->user->nikeys);
150154
151− /* now throw away the key memory */
152− if (key->type->destroy)
153− key->type->destroy(key);
154−
155155 key_user_put(key->user);
156156
157157 kfree(key->description);
tools/build/Makefile.feature+6−2
@@ -41,6 +41,7 @@ FEATURE_TESTS ?= \ · 40 unmodified lines
4141 libelf-getphdrnum \
4242 libelf-mmap \
4343 libnuma \
44+ numa_num_possible_cpus \
4445 libperl \
4546 libpython \
4647 libpython-version \
@@ -51,7 +52,8 @@ FEATURE_TESTS ?= \ · 4 unmodified lines
5152 timerfd \
5253 libdw-dwarf-unwind \
5354 zlib \
54− lzma
55+ lzma \
56+ get_cpuid
5557
5658 FEATURE_DISPLAY ?= \
5759 dwarf \
@@ -61,13 +63,15 @@ FEATURE_DISPLAY ?= \ · 3 unmodified lines
6163 libbfd \
6264 libelf \
6365 libnuma \
66+ numa_num_possible_cpus \
6467 libperl \
6568 libpython \
6669 libslang \
6770 libunwind \
6871 libdw-dwarf-unwind \
6972 zlib \
70− lzma
73+ lzma \
74+ get_cpuid
7175
7276 # Set FEATURE_CHECK_(C|LD)FLAGS-all for all FEATURE_TESTS features.
7377 # If in the future we need per-feature checks/flags for features not
tools/build/feature/Makefile+9−1
@@ -19,6 +19,7 @@ FILES= \ · 18 unmodified lines
1919 test-libelf-getphdrnum.bin \
2020 test-libelf-mmap.bin \
2121 test-libnuma.bin \
22+ test-numa_num_possible_cpus.bin \
2223 test-libperl.bin \
2324 test-libpython.bin \
2425 test-libpython-version.bin \
@@ -34,7 +35,8 @@ FILES= \ · 9 unmodified lines
3435 test-compile-x32.bin \
3536 test-zlib.bin \
3637 test-lzma.bin \
37− test-bpf.bin
38+ test-bpf.bin \
39+ test-get_cpuid.bin
3840
3941 CC := $(CROSS_COMPILE)gcc -MD
4042 PKG_CONFIG := $(CROSS_COMPILE)pkg-config
@@ -87,6 +89,9 @@ test-libelf-getphdrnum.bin: · 46 unmodified lines
8789 test-libnuma.bin:
8890 $(BUILD) -lnuma
8991
92+test-numa_num_possible_cpus.bin:
93+ $(BUILD) -lnuma
94+
9095 test-libunwind.bin:
9196 $(BUILD) -lelf
9297
@@ -162,6 +167,9 @@ test-zlib.bin: · 69 unmodified lines
162167 test-lzma.bin:
163168 $(BUILD) -llzma
164169
170+test-get_cpuid.bin:
171+ $(BUILD)
172+
165173 test-bpf.bin:
166174 $(BUILD)
167175
tools/build/feature/test-all.c+10−0
@@ -77,6 +77,10 @@ · 76 unmodified lines
7777 # include "test-libnuma.c"
7878 #undef main
7979
80+#define main main_test_numa_num_possible_cpus
81+# include "test-numa_num_possible_cpus.c"
82+#undef main
83+
8084 #define main main_test_timerfd
8185 # include "test-timerfd.c"
8286 #undef main
@@ -117,6 +121,10 @@ · 34 unmodified lines
117121 # include "test-lzma.c"
118122 #undef main
119123
124+#define main main_test_get_cpuid
125+# include "test-get_cpuid.c"
126+#undef main
127+
120128 int main(int argc, char *argv[])
121129 {
122130 main_test_libpython();
@@ -136,6 +144,7 @@ int main(int argc, char *argv[]) · 13 unmodified lines
136144 main_test_libbfd();
137145 main_test_backtrace();
138146 main_test_libnuma();
147+ main_test_numa_num_possible_cpus();
139148 main_test_timerfd();
140149 main_test_stackprotector_all();
141150 main_test_libdw_dwarf_unwind();
@@ -143,6 +152,7 @@ int main(int argc, char *argv[]) · 1 unmodified line
143152 main_test_zlib();
144153 main_test_pthread_attr_setaffinity_np();
145154 main_test_lzma();
155+ main_test_get_cpuid();
146156
147157 return 0;
148158 }
tools/build/feature/test-get_cpuid.c+7−0
@@ -0,0 +1,7 @@
1+#include <cpuid.h>
2+
3+int main(void)
4+{
5+ unsigned int eax = 0, ebx = 0, ecx = 0, edx = 0;
6+ return __get_cpuid(0x15, &eax, &ebx, &ecx, &edx);
7+}
tools/build/feature/test-numa_num_possible_cpus.c+6−0
@@ -0,0 +1,6 @@
1+#include <numa.h>
2+
3+int main(void)
4+{
5+ return numa_num_possible_cpus();
6+}
tools/lib/traceevent/event-parse.c+20−3
@@ -3795,7 +3795,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, · 3794 unmodified lines
37953795 struct format_field *field;
37963796 struct printk_map *printk;
37973797 long long val, fval;
3798− unsigned long addr;
3798+ unsigned long long addr;
37993799 char *str;
38003800 unsigned char *hex;
38013801 int print;
@@ -3828,13 +3828,30 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, · 26 unmodified lines
38283828 */
38293829 if (!(field->flags & FIELD_IS_ARRAY) &&
38303830 field->size == pevent->long_size) {
3831− addr = *(unsigned long *)(data + field->offset);
3831+
3832+ /* Handle heterogeneous recording and processing
3833+ * architectures
3834+ *
3835+ * CASE I:
3836+ * Traces recorded on 32-bit devices (32-bit
3837+ * addressing) and processed on 64-bit devices:
3838+ * In this case, only 32 bits should be read.
3839+ *
3840+ * CASE II:
3841+ * Traces recorded on 64 bit devices and processed
3842+ * on 32-bit devices:
3843+ * In this case, 64 bits must be read.
3844+ */
3845+ addr = (pevent->long_size == 8) ?
3846+ *(unsigned long long *)(data + field->offset) :
3847+ (unsigned long long)*(unsigned int *)(data + field->offset);
3848+
38323849 /* Check if it matches a print format */
38333850 printk = find_printk(pevent, addr);
38343851 if (printk)
38353852 trace_seq_puts(s, printk->printk);
38363853 else
3837− trace_seq_printf(s, "%lx", addr);
3854+ trace_seq_printf(s, "%llx", addr);
38383855 break;
38393856 }
38403857 str = malloc(len + 1);
tools/perf/Documentation/intel-pt.txt+0−15
@@ -364,21 +364,6 @@ cyc_thresh Specifies how frequently CYC packets are produced - see cyc · 363 unmodified lines
364364
365365 CYC packets are not requested by default.
366366
367−no_force_psb This is a driver option and is not in the IA32_RTIT_CTL MSR.
368−
369− It stops the driver resetting the byte count to zero whenever
370− enabling the trace (for example on context switches) which in
371− turn results in no PSB being forced. However some processors
372− will produce a PSB anyway.
373−
374− In any case, there is still a PSB when the trace is enabled for
375− the first time.
376−
377− no_force_psb can be used to slightly decrease the trace size but
378− may make it harder for the decoder to recover from errors.
379−
380− no_force_psb is not selected by default.
381−
382367
383368 new snapshot option
384369 -------------------
tools/perf/config/Makefile+15−5
@@ -573,9 +573,14 @@ ifndef NO_LIBNUMA · 572 unmodified lines
573573 msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev);
574574 NO_LIBNUMA := 1
575575 else
576− CFLAGS += -DHAVE_LIBNUMA_SUPPORT
577− EXTLIBS += -lnuma
578− $(call detected,CONFIG_NUMA)
576+ ifeq ($(feature-numa_num_possible_cpus), 0)
577+ msg := $(warning Old numa library found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev >= 2.0.8);
578+ NO_LIBNUMA := 1
579+ else
580+ CFLAGS += -DHAVE_LIBNUMA_SUPPORT
581+ EXTLIBS += -lnuma
582+ $(call detected,CONFIG_NUMA)
583+ endif
579584 endif
580585 endif
581586
@@ -621,8 +626,13 @@ ifdef LIBBABELTRACE · 39 unmodified lines
621626 endif
622627
623628 ifndef NO_AUXTRACE
624− $(call detected,CONFIG_AUXTRACE)
625− CFLAGS += -DHAVE_AUXTRACE_SUPPORT
629+ ifeq ($(feature-get_cpuid), 0)
630+ msg := $(warning Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc);
631+ NO_AUXTRACE := 1
632+ else
633+ $(call detected,CONFIG_AUXTRACE)
634+ CFLAGS += -DHAVE_AUXTRACE_SUPPORT
635+ endif
626636 endif
627637
628638 # Among the variables below, these:
tools/perf/util/probe-event.c+7−6
@@ -270,12 +270,13 @@ static int kernel_get_module_dso(const char *module, struct dso **pdso) · 269 unmodified lines
270270 int ret = 0;
271271
272272 if (module) {
273− list_for_each_entry(dso, &host_machine->dsos.head, node) {
274− if (!dso->kernel)
275− continue;
276− if (strncmp(dso->short_name + 1, module,
277− dso->short_name_len - 2) == 0)
278− goto found;
273+ char module_name[128];
274+
275+ snprintf(module_name, sizeof(module_name), "[%s]", module);
276+ map = map_groups__find_by_name(&host_machine->kmaps, MAP__FUNCTION, module_name);
277+ if (map) {
278+ dso = map->dso;
279+ goto found;
279280 }
280281 pr_debug("Failed to find module %s.\n", module);
281282 return -ENOENT;
tools/perf/util/session.c+4−1
@@ -1580,7 +1580,10 @@ static int __perf_session__process_events(struct perf_session *session, · 1579 unmodified lines
15801580 file_offset = page_offset;
15811581 head = data_offset - page_offset;
15821582
1583− if (data_size && (data_offset + data_size < file_size))
1583+ if (data_size == 0)
1584+ goto out;
1585+
1586+ if (data_offset + data_size < file_size)
15841587 file_size = data_offset + data_size;
15851588
15861589 ui_progress__init(&prog, file_size, "Processing events...");
tools/perf/util/stat.c+14−2
@@ -196,7 +196,8 @@ static void zero_per_pkg(struct perf_evsel *counter) · 195 unmodified lines
196196 memset(counter->per_pkg_mask, 0, MAX_NR_CPUS);
197197 }
198198
199−static int check_per_pkg(struct perf_evsel *counter, int cpu, bool *skip)
199+static int check_per_pkg(struct perf_evsel *counter,
200+ struct perf_counts_values *vals, int cpu, bool *skip)
200201 {
201202 unsigned long *mask = counter->per_pkg_mask;
202203 struct cpu_map *cpus = perf_evsel__cpus(counter);
@@ -218,6 +219,17 @@ static int check_per_pkg(struct perf_evsel *counter, int cpu, bool *skip) · 15 unmodified lines
218219 counter->per_pkg_mask = mask;
219220 }
220221
222+ /*
223+ * we do not consider an event that has not run as a good
224+ * instance to mark a package as used (skip=1). Otherwise
225+ * we may run into a situation where the first CPU in a package
226+ * is not running anything, yet the second is, and this function
227+ * would mark the package as used after the first CPU and would
228+ * not read the values from the second CPU.
229+ */
230+ if (!(vals->run && vals->ena))
231+ return 0;
232+
221233 s = cpu_map__get_socket(cpus, cpu);
222234 if (s < 0)
223235 return -1;
@@ -235,7 +247,7 @@ process_counter_values(struct perf_stat_config *config, struct perf_evsel *evsel · 11 unmodified lines
235247 static struct perf_counts_values zero;
236248 bool skip = false;
237249
238− if (check_per_pkg(evsel, cpu, &skip)) {
250+ if (check_per_pkg(evsel, count, cpu, &skip)) {
239251 pr_err("failed to read per-pkg counter\n");
240252 return -1;
241253 }
tools/perf/util/symbol-elf.c+14−23
@@ -38,7 +38,7 @@ static inline char *bfd_demangle(void __maybe_unused *v, · 37 unmodified lines
3838 #endif
3939
4040 #ifndef HAVE_ELF_GETPHDRNUM_SUPPORT
41−int elf_getphdrnum(Elf *elf, size_t *dst)
41+static int elf_getphdrnum(Elf *elf, size_t *dst)
4242 {
4343 GElf_Ehdr gehdr;
4444 GElf_Ehdr *ehdr;
@@ -1271,8 +1271,6 @@ out_close: · 1226 unmodified lines
12711271 static int kcore__init(struct kcore *kcore, char *filename, int elfclass,
12721272 bool temp)
12731273 {
1274− GElf_Ehdr *ehdr;
1275−
12761274 kcore->elfclass = elfclass;
12771275
12781276 if (temp)
@@ -1289,9 +1287,7 @@ static int kcore__init(struct kcore *kcore, char *filename, int elfclass, · 10 unmodified lines
12891287 if (!gelf_newehdr(kcore->elf, elfclass))
12901288 goto out_end;
12911289
1292− ehdr = gelf_getehdr(kcore->elf, &kcore->ehdr);
1293− if (!ehdr)
1294− goto out_end;
1290+ memset(&kcore->ehdr, 0, sizeof(GElf_Ehdr));
12951291
12961292 return 0;
12971293
@@ -1348,23 +1344,18 @@ static int kcore__copy_hdr(struct kcore *from, struct kcore *to, size_t count) · 50 unmodified lines
13481344 static int kcore__add_phdr(struct kcore *kcore, int idx, off_t offset,
13491345 u64 addr, u64 len)
13501346 {
1351− GElf_Phdr gphdr;
1352− GElf_Phdr *phdr;
1353−
1354− phdr = gelf_getphdr(kcore->elf, idx, &gphdr);
1355− if (!phdr)
1356− return -1;
1357−
1358− phdr->p_type = PT_LOAD;
1359− phdr->p_flags = PF_R | PF_W | PF_X;
1360− phdr->p_offset = offset;
1361− phdr->p_vaddr = addr;
1362− phdr->p_paddr = 0;
1363− phdr->p_filesz = len;
1364− phdr->p_memsz = len;
1365− phdr->p_align = page_size;
1366−
1367− if (!gelf_update_phdr(kcore->elf, idx, phdr))
1347+ GElf_Phdr phdr = {
1348+ .p_type = PT_LOAD,
1349+ .p_flags = PF_R | PF_W | PF_X,
1350+ .p_offset = offset,
1351+ .p_vaddr = addr,
1352+ .p_paddr = 0,
1353+ .p_filesz = len,
1354+ .p_memsz = len,
1355+ .p_align = page_size,
1356+ };
1357+
1358+ if (!gelf_update_phdr(kcore->elf, idx, &phdr))
13681359 return -1;
13691360
13701361 return 0;
tools/perf/util/util.c+1−1
@@ -709,7 +709,7 @@ bool find_process(const char *name) · 708 unmodified lines
709709
710710 dir = opendir(procfs__mountpoint());
711711 if (!dir)
712− return -1;
712+ return false;
713713
714714 /* Walk through the directory. */
715715 while (ret && (d = readdir(dir)) != NULL) {
tools/power/x86/turbostat/turbostat.c+34−5
@@ -71,8 +71,11 @@ unsigned int extra_msr_offset32; · 70 unmodified lines
7171 unsigned int extra_msr_offset64;
7272 unsigned int extra_delta_offset32;
7373 unsigned int extra_delta_offset64;
74+unsigned int aperf_mperf_multiplier = 1;
7475 int do_smi;
7576 double bclk;
77+double base_hz;
78+double tsc_tweak = 1.0;
7679 unsigned int show_pkg;
7780 unsigned int show_core;
7881 unsigned int show_cpu;
@@ -502,7 +505,7 @@ int format_counters(struct thread_data *t, struct core_data *c, · 423 unmodified lines
502505 /* %Busy */
503506 if (has_aperf) {
504507 if (!skip_c0)
505− outp += sprintf(outp, "%8.2f", 100.0 * t->mperf/t->tsc);
508+ outp += sprintf(outp, "%8.2f", 100.0 * t->mperf/t->tsc/tsc_tweak);
506509 else
507510 outp += sprintf(outp, "********");
508511 }
@@ -510,7 +513,7 @@ int format_counters(struct thread_data *t, struct core_data *c, · 1 unmodified line
510513 /* Bzy_MHz */
511514 if (has_aperf)
512515 outp += sprintf(outp, "%8.0f",
513− 1.0 * t->tsc / units * t->aperf / t->mperf / interval_float);
516+ 1.0 * t->tsc * tsc_tweak / units * t->aperf / t->mperf / interval_float);
514517
515518 /* TSC_MHz */
516519 outp += sprintf(outp, "%8.0f", 1.0 * t->tsc/units/interval_float);
@@ -984,6 +987,8 @@ int get_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p) · 467 unmodified lines
984987 return -3;
985988 if (get_msr(cpu, MSR_IA32_MPERF, &t->mperf))
986989 return -4;
990+ t->aperf = t->aperf * aperf_mperf_multiplier;
991+ t->mperf = t->mperf * aperf_mperf_multiplier;
987992 }
988993
989994 if (do_smi) {
@@ -1149,6 +1154,19 @@ int slv_pkg_cstate_limits[16] = {PCL__0, PCL__1, PCLRSV, PCLRSV, PCL__4, PCLRSV, · 159 unmodified lines
11491154 int amt_pkg_cstate_limits[16] = {PCL__0, PCL__1, PCL__2, PCLRSV, PCLRSV, PCLRSV, PCL__6, PCL__7, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV};
11501155 int phi_pkg_cstate_limits[16] = {PCL__0, PCL__2, PCL_6N, PCL_6R, PCLRSV, PCLRSV, PCLRSV, PCLUNL, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV};
11511156
1157+
1158+static void
1159+calculate_tsc_tweak()
1160+{
1161+ unsigned long long msr;
1162+ unsigned int base_ratio;
1163+
1164+ get_msr(base_cpu, MSR_NHM_PLATFORM_INFO, &msr);
1165+ base_ratio = (msr >> 8) & 0xFF;
1166+ base_hz = base_ratio * bclk * 1000000;
1167+ tsc_tweak = base_hz / tsc_hz;
1168+}
1169+
11521170 static void
11531171 dump_nhm_platform_info(void)
11541172 {
@@ -1926,8 +1944,6 @@ int has_config_tdp(unsigned int family, unsigned int model) · 771 unmodified lines
19261944
19271945 switch (model) {
19281946 case 0x3A: /* IVB */
1929− case 0x3E: /* IVB Xeon */
1930−
19311947 case 0x3C: /* HSW */
19321948 case 0x3F: /* HSX */
19331949 case 0x45: /* HSW */
@@ -2543,6 +2559,13 @@ int is_knl(unsigned int family, unsigned int model) · 609 unmodified lines
25432559 return 0;
25442560 }
25452561
2562+unsigned int get_aperf_mperf_multiplier(unsigned int family, unsigned int model)
2563+{
2564+ if (is_knl(family, model))
2565+ return 1024;
2566+ return 1;
2567+}
2568+
25462569 #define SLM_BCLK_FREQS 5
25472570 double slm_freq_table[SLM_BCLK_FREQS] = { 83.3, 100.0, 133.3, 116.7, 80.0};
25482571
@@ -2744,6 +2767,9 @@ void process_cpuid() · 195 unmodified lines
27442767 }
27452768 }
27462769
2770+ if (has_aperf)
2771+ aperf_mperf_multiplier = get_aperf_mperf_multiplier(family, model);
2772+
27472773 do_nhm_platform_info = do_nhm_cstates = do_smi = probe_nhm_msrs(family, model);
27482774 do_snb_cstates = has_snb_msrs(family, model);
27492775 do_pc2 = do_snb_cstates && (pkg_cstate_limit >= PCL__2);
@@ -2762,6 +2788,9 @@ void process_cpuid() · 12 unmodified lines
27622788 if (debug)
27632789 dump_cstate_pstate_config_info();
27642790
2791+ if (has_skl_msrs(family, model))
2792+ calculate_tsc_tweak();
2793+
27652794 return;
27662795 }
27672796
@@ -3090,7 +3119,7 @@ int get_and_dump_counters(void) · 322 unmodified lines
30903119 }
30913120
30923121 void print_version() {
3093− fprintf(stderr, "turbostat version 4.7 17-June, 2015"
3122+ fprintf(stderr, "turbostat version 4.8 26-Sep, 2015"
30943123 " - Len Brown <lenb@kernel.org>\n");
30953124 }
30963125

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t