History

Merge 4.3-rc7 into usb-next

We want the USB and other fixes in here as well.

Greg Kroah-Hartman committed 11 years ago

Commit 0bbc3672 parents ae416ba 32b8819359 files · +3012 −1577Browse files

Unified · Split

359 files
  1. .mailmap +1 −0
  2. Documentation/arm/OMAP/README +7 −0
  3. MAINTAINERS +28 −3
  4. Makefile +1 −1
  5. arch/arm/boot/dts/am57xx-beagle-x15.dts +2 −1
  6. arch/arm/boot/dts/armada-385-db-ap.dts +1 −1
  7. arch/arm/boot/dts/berlin2q.dtsi +3 −3
  8. arch/arm/boot/dts/exynos5420-peach-pit.dts +5 −0
  9. arch/arm/boot/dts/exynos5800-peach-pi.dts +5 −0
  10. arch/arm/boot/dts/imx7d.dtsi +2 −2
  11. arch/arm/boot/dts/logicpd-torpedo-37xx-devkit.dts +1 −1
  12. arch/arm/boot/dts/meson.dtsi +12 −11
  13. arch/arm/boot/dts/omap3-evm-37xx.dts +1 −1
  14. arch/arm/boot/dts/ste-hrefv60plus.dtsi +1 −1
  15. arch/arm/boot/dts/tegra114.dtsi +2 −0
  16. arch/arm/boot/dts/tegra124.dtsi +2 −0
  17. arch/arm/boot/dts/tegra20.dtsi +2 −0
  18. arch/arm/boot/dts/tegra30.dtsi +2 −0
  19. arch/arm/boot/dts/uniphier-ph1-ld6b-ref.dts +1 −1
  20. arch/arm/kvm/Kconfig +1 −0
  21. arch/arm/kvm/arm.c +1 −1
  22. arch/arm/mach-exynos/pm_domains.c +3 −5
  23. arch/arm/mach-omap2/Kconfig +2 −0
  24. arch/arm/mach-omap2/board-generic.c +10 −0
  25. arch/arm/mach-omap2/pdata-quirks.c +8 −1
  26. arch/arm/mach-pxa/pxa3xx.c +5 −4
  27. arch/arm/net/bpf_jit_32.c +1 −0
  28. arch/arm/plat-orion/common.c +1 −1
  29. arch/arm64/Makefile +1 −1
  30. arch/arm64/include/asm/unistd.h +1 −1
  31. arch/arm64/include/asm/unistd32.h +9 −0
  32. arch/arm64/include/uapi/asm/signal.h +3 −0
  33. arch/powerpc/configs/ppc64_defconfig +1 −1
  34. arch/powerpc/configs/pseries_defconfig +1 −1
  35. arch/powerpc/include/asm/cache.h +0 −7
  36. arch/powerpc/include/asm/kvm_host.h +0 −2
  37. arch/powerpc/include/asm/machdep.h +7 −2
  38. arch/powerpc/include/asm/ppc-opcode.h +0 −17
  39. arch/powerpc/include/asm/reg.h +0 −1
  40. arch/powerpc/kernel/rtas.c +3 −0
  41. arch/powerpc/kvm/book3s_hv.c +1 −54
  42. arch/powerpc/mm/hash_native_64.c +11 −12
  43. arch/powerpc/platforms/powernv/opal.c +5 −2
  44. arch/powerpc/platforms/powernv/smp.c +24 −5
  45. arch/powerpc/platforms/ps3/os-area.c +0 −5
  46. arch/sh/include/asm/page.h +1 −0
  47. arch/sparc/crypto/aes_glue.c +2 −0
  48. arch/sparc/crypto/camellia_glue.c +1 −0
  49. arch/sparc/crypto/des_glue.c +2 −0
  50. arch/um/Makefile +2 −2
  51. arch/um/kernel/trap.c +1 −1
  52. arch/um/os-Linux/helper.c +3 −3
  53. arch/x86/boot/compressed/eboot.c +6 −2
  54. arch/x86/crypto/camellia_aesni_avx_glue.c +5 −0
  55. arch/x86/include/asm/kvm_host.h +2 −4
  56. arch/x86/include/asm/string_64.h +2 −3
  57. arch/x86/kernel/apic/io_apic.c +4 −0
  58. arch/x86/kernel/process.c +3 −3
  59. arch/x86/kernel/setup.c +8 −0
  60. arch/x86/kernel/smpboot.c +11 −4
  61. arch/x86/kvm/emulate.c +7 −3
  62. arch/x86/kvm/vmx.c +6 −20
  63. arch/x86/kvm/x86.c +75 −60
  64. arch/x86/um/ldt.c +4 −1
  65. block/blk-core.c +1 −1
  66. block/blk-mq-tag.c +1 −0
  67. block/blk-mq.c +1 −3
  68. block/blk-sysfs.c +1 −0
  69. crypto/ahash.c +2 −1
  70. drivers/acpi/acpica/acglobal.h +1 −0
  71. drivers/acpi/acpica/actables.h +1 −3
  72. drivers/acpi/acpica/evxfevnt.c +1 −1
  73. drivers/acpi/acpica/tbfadt.c +5 −5
  74. drivers/acpi/acpica/tbutils.c +2 −24
  75. drivers/base/dma-contiguous.c +1 −1
  76. drivers/base/power/domain_governor.c +6 −16
  77. drivers/block/nbd.c +30 −6
  78. drivers/block/nvme-core.c +15 −9
  79. drivers/block/rbd.c +47 −32
  80. drivers/block/xen-blkfront.c +2 −1
  81. drivers/bus/arm-ccn.c +3 −2
  82. drivers/clk/mvebu/clk-cpu.c +3 −1
  83. drivers/cpufreq/intel_pstate.c +5 −0
  84. drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +6 −2
  85. drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +3 −3
  86. drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0 −2
  87. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +5 −5
  88. drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +16 −0
  89. drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +4 −1
  90. drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +1 −0
  91. drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +6 −2
  92. drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +3 −1
  93. drivers/gpu/drm/amd/amdgpu/ci_dpm.c +5 −3
  94. drivers/gpu/drm/amd/amdgpu/cik.c +3 −0
  95. drivers/gpu/drm/amd/amdgpu/cz_dpm.c +6 −4
  96. drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +28 −2
  97. drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +29 −3
  98. drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +28 −2
  99. drivers/gpu/drm/amd/amdgpu/kv_dpm.c +9 −3
  100. drivers/gpu/drm/amd/amdgpu/vi.c +3 −0
  101. drivers/gpu/drm/drm_dp_mst_topology.c +6 −4
  102. drivers/gpu/drm/drm_sysfs.c +3 −9
  103. drivers/gpu/drm/i915/i915_gem_shrinker.c +1 −1
  104. drivers/gpu/drm/i915/i915_gem_userptr.c +4 −1
  105. drivers/gpu/drm/i915/intel_display.c +67 −53
  106. drivers/gpu/drm/i915/intel_lrc.c +1 −0
  107. drivers/gpu/drm/i915/intel_ringbuffer.c +2 −0
  108. drivers/gpu/drm/nouveau/nouveau_display.c +5 −1
  109. drivers/gpu/drm/nouveau/nouveau_fbcon.c +24 −0
  110. drivers/gpu/drm/nouveau/nouveau_gem.c +3 −2
  111. drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c +6 −0
  112. drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h +3 −0
  113. drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c +18 −9
  114. drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c +15 −2
  115. drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.c +6 −2
  116. drivers/gpu/drm/qxl/qxl_display.c +9 −1
  117. drivers/gpu/drm/qxl/qxl_fb.c +11 −8
  118. drivers/gpu/drm/qxl/qxl_release.c +1 −3
  119. drivers/gpu/drm/radeon/radeon_display.c +2 −12
  120. drivers/gpu/drm/radeon/radeon_dp_mst.c +1 −0
  121. drivers/gpu/drm/radeon/radeon_fb.c +16 −0
  122. drivers/gpu/drm/radeon/radeon_kms.c +4 −1
  123. drivers/gpu/drm/radeon/radeon_mode.h +1 −0
  124. drivers/gpu/drm/radeon/radeon_pm.c +44 −27
  125. drivers/gpu/drm/radeon/si_dpm.c +1 −0
  126. drivers/gpu/drm/virtio/virtgpu_debugfs.c +2 −2
  127. drivers/gpu/drm/virtio/virtgpu_fence.c +1 −1
  128. drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +2 −1
  129. drivers/i2c/busses/i2c-designware-platdrv.c +27 −6
  130. drivers/i2c/busses/i2c-rcar.c +4 −3
  131. drivers/i2c/busses/i2c-s3c2410.c +5 −3
  132. drivers/i2c/i2c-core.c +6 −6
  133. drivers/iio/accel/st_accel_core.c +0 −6
  134. drivers/iio/adc/twl4030-madc.c +34 −0
  135. drivers/infiniband/core/cache.c +1 −1
  136. drivers/infiniband/core/cm.c +9 −1
  137. drivers/infiniband/core/cma.c +43 −17
  138. drivers/infiniband/core/roce_gid_mgmt.c +27 −8
  139. drivers/infiniband/core/ucma.c +6 −1
  140. drivers/infiniband/hw/usnic/usnic.h +18 −3
  141. drivers/infiniband/hw/usnic/usnic_abi.h +18 −3
  142. drivers/infiniband/hw/usnic/usnic_common_pkt_hdr.h +18 −3
  143. drivers/infiniband/hw/usnic/usnic_common_util.h +18 −3
  144. drivers/infiniband/hw/usnic/usnic_debugfs.c +18 −3
  145. drivers/infiniband/hw/usnic/usnic_debugfs.h +18 −3
  146. drivers/infiniband/hw/usnic/usnic_fwd.c +18 −3
  147. drivers/infiniband/hw/usnic/usnic_fwd.h +18 −3
  148. drivers/infiniband/hw/usnic/usnic_ib.h +18 −3
  149. drivers/infiniband/hw/usnic/usnic_ib_main.c +18 −3
  150. drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c +18 −3
  151. drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h +18 −3
  152. drivers/infiniband/hw/usnic/usnic_ib_sysfs.c +18 −3
  153. drivers/infiniband/hw/usnic/usnic_ib_sysfs.h +18 −3
  154. drivers/infiniband/hw/usnic/usnic_ib_verbs.c +18 −3
  155. drivers/infiniband/hw/usnic/usnic_ib_verbs.h +18 −3
  156. drivers/infiniband/hw/usnic/usnic_log.h +18 −3
  157. drivers/infiniband/hw/usnic/usnic_transport.c +18 −3
  158. drivers/infiniband/hw/usnic/usnic_transport.h +18 −3
  159. drivers/infiniband/hw/usnic/usnic_uiom.c +1 −1
  160. drivers/infiniband/hw/usnic/usnic_uiom.h +18 −3
  161. drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.c +18 −3
  162. drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.h +18 −3
  163. drivers/infiniband/hw/usnic/usnic_vnic.c +18 −3
  164. drivers/infiniband/hw/usnic/usnic_vnic.h +18 −3
  165. drivers/infiniband/ulp/ipoib/ipoib.h +1 −0
  166. drivers/infiniband/ulp/ipoib/ipoib_main.c +3 −1
  167. drivers/infiniband/ulp/ipoib/ipoib_multicast.c +1 −1
  168. drivers/input/mouse/cyapa_gen6.c +3 −7
  169. drivers/input/touchscreen/ads7846.c +6 −2
  170. drivers/iommu/Kconfig +1 −2
  171. drivers/iommu/amd_iommu.c +9 −0
  172. drivers/iommu/amd_iommu_init.c +3 −0
  173. drivers/iommu/arm-smmu-v3.c +15 −6
  174. drivers/iommu/intel-iommu.c +9 −4
  175. drivers/iommu/io-pgtable-arm.c +13 −11
  176. drivers/md/dm-cache-metadata.c +1 −1
  177. drivers/md/dm-snap-persistent.c +12 −3
  178. drivers/md/dm-thin.c +1 −1
  179. drivers/md/persistent-data/dm-btree-remove.c +11 −6
  180. drivers/md/persistent-data/dm-btree.c +1 −1
  181. drivers/media/dvb-frontends/horus3a.h +2 −2
  182. drivers/media/dvb-frontends/lnbh25.h +1 −1
  183. drivers/media/dvb-frontends/m88ds3103.c +47 −26
  184. drivers/media/dvb-frontends/si2168.c +4 −0
  185. drivers/media/pci/netup_unidvb/netup_unidvb_spi.c +4 −8
  186. drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +3 −4
  187. drivers/media/rc/ir-hix5hd2.c +1 −1
  188. drivers/media/tuners/si2157.c +4 −0
  189. drivers/media/usb/dvb-usb-v2/rtl28xxu.c +13 −2
  190. drivers/media/usb/dvb-usb-v2/rtl28xxu.h +1 −1
  191. drivers/media/v4l2-core/Kconfig +1 −1
  192. drivers/memory/Kconfig +9 −3
  193. drivers/memory/omap-gpmc.c +1 −1
  194. drivers/mfd/intel-lpss.h +2 −0
  195. drivers/mfd/max77843.c +1 −1
  196. drivers/misc/cxl/api.c +1 −0
  197. drivers/misc/cxl/context.c +3 −0
  198. drivers/misc/cxl/cxl.h +1 −0
  199. drivers/misc/cxl/file.c +10 −3
  200. drivers/misc/cxl/irq.c +1 −3
  201. drivers/misc/cxl/native.c +1 −1
  202. drivers/misc/cxl/pci.c +28 −0
  203. drivers/mmc/card/mmc_test.c +3 −6
  204. drivers/mmc/core/mmc.c +0 −7
  205. drivers/net/can/sja1000/peak_pci.c +1 −0
  206. drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c +4 −0
  207. drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +7 −0
  208. drivers/net/ethernet/broadcom/genet/bcmgenet.c +23 −9
  209. drivers/net/ethernet/emulex/benet/be.h +1 −0
  210. drivers/net/ethernet/emulex/benet/be_cmds.c +24 −7
  211. drivers/net/ethernet/emulex/benet/be_cmds.h +8 −2
  212. drivers/net/ethernet/emulex/benet/be_main.c +19 −9
  213. drivers/net/ethernet/freescale/fsl_pq_mdio.c +28 −6
  214. drivers/net/ethernet/intel/i40e/i40e_adminq.c +2 −2
  215. drivers/net/ethernet/intel/i40e/i40e_main.c +2 −0
  216. drivers/net/ethernet/intel/i40evf/i40e_adminq.c +2 −2
  217. drivers/net/ethernet/mellanox/mlx4/eq.c +4 −0
  218. drivers/net/ethernet/mellanox/mlx4/main.c +2 −8
  219. drivers/net/ethernet/mellanox/mlx5/core/en_flow_table.c +14 −2
  220. drivers/net/ethernet/mellanox/mlx5/core/port.c +1 −1
  221. drivers/net/ethernet/mellanox/mlxsw/core.c +9 −4
  222. drivers/net/ethernet/mellanox/mlxsw/item.h +3 −1
  223. drivers/net/ethernet/mellanox/mlxsw/pci.c +4 −4
  224. drivers/net/ethernet/mellanox/mlxsw/switchx2.c +1 −1
  225. drivers/net/ethernet/nxp/lpc_eth.c +6 −7
  226. drivers/net/ethernet/via/via-rhine.c +2 −1
  227. drivers/net/geneve.c +6 −6
  228. drivers/net/phy/Kconfig +0 −2
  229. drivers/net/ppp/pppoe.c +0 −1
  230. drivers/net/usb/Kconfig +1 −0
  231. drivers/net/usb/asix_common.c +3 −1
  232. drivers/net/usb/asix_devices.c +4 −0
  233. drivers/net/vxlan.c +3 −4
  234. drivers/net/wireless/ath/ath10k/hw.h +2 −2
  235. drivers/net/wireless/ath/ath9k/init.c +1 −0
  236. drivers/net/wireless/b43/main.c +1 −0
  237. drivers/net/wireless/iwlwifi/dvm/lib.c +1 −1
  238. drivers/net/wireless/iwlwifi/iwl-7000.c +1 −1
  239. drivers/net/wireless/iwlwifi/mvm/d3.c +11 −16
  240. drivers/net/wireless/iwlwifi/mvm/fw.c +2 −2
  241. drivers/net/wireless/iwlwifi/mvm/mac80211.c +1 −0
  242. drivers/net/wireless/iwlwifi/mvm/mvm.h +5 −0
  243. drivers/net/wireless/iwlwifi/mvm/ops.c +1 −0
  244. drivers/net/wireless/iwlwifi/pcie/drv.c +5 −0
  245. drivers/net/wireless/rt2x00/rt2800usb.c +1 −0
  246. drivers/net/wireless/rtlwifi/pci.h +2 −0
  247. drivers/net/wireless/rtlwifi/rtl8821ae/hw.c +17 −0
  248. drivers/net/wireless/rtlwifi/rtl8821ae/sw.c +5 −0
  249. drivers/net/wireless/rtlwifi/wifi.h +3 −0
  250. drivers/net/xen-netback/xenbus.c +6 −0
  251. drivers/pci/msi.c +4 −0
  252. drivers/perf/arm_pmu.c +8 −2
  253. drivers/pinctrl/freescale/pinctrl-imx25.c +3 −1
  254. drivers/pinctrl/sunxi/pinctrl-sun5i-a10s.c +1 −1
  255. drivers/pinctrl/uniphier/pinctrl-ph1-sld8.c +113 −113
  256. drivers/staging/iio/accel/sca3000_ring.c +1 −1
  257. drivers/staging/iio/adc/mxs-lradc.c +5 −4
  258. drivers/staging/lustre/lustre/llite/dir.c +1 −1
  259. drivers/thermal/samsung/exynos_tmu.c +1 −1
  260. drivers/tty/serial/8250/8250_dma.c +0 −4
  261. drivers/usb/host/xhci-pci.c +1 −0
  262. drivers/usb/host/xhci-ring.c +25 −5
  263. drivers/video/console/fbcon.c +1 −0
  264. fs/btrfs/backref.c +3 −5
  265. fs/btrfs/file.c +1 −1
  266. fs/btrfs/ioctl.c +8 −0
  267. fs/btrfs/volumes.h +8 −0
  268. fs/cifs/file.c +3 −3
  269. fs/dax.c +29 −41
  270. fs/ext4/Kconfig +1 −1
  271. fs/ext4/readpage.c +2 −2
  272. fs/fs-writeback.c +24 −11
  273. fs/mpage.c +9 −6
  274. fs/nfsd/blocklayout.c +0 −8
  275. fs/ocfs2/dlm/dlmmaster.c +2 −1
  276. fs/ocfs2/dlm/dlmrecovery.c +1 −1
  277. fs/ramfs/file-nommu.c +3 −2
  278. include/drm/drm_dp_mst_helper.h +2 −1
  279. include/linux/backing-dev-defs.h +3 −0
  280. include/linux/backing-dev.h +5 −64
  281. include/linux/cma.h +1 −1
  282. include/linux/compiler-gcc.h +13 −0
  283. include/linux/compiler.h +53 −13
  284. include/linux/dma-contiguous.h +2 −2
  285. include/linux/memcontrol.h +5 −3
  286. include/net/af_unix.h +1 −1
  287. include/net/inet_timewait_sock.h +2 −2
  288. include/net/sock.h +8 −0
  289. include/sound/soc.h +4 −2
  290. include/sound/wm8904.h +1 −1
  291. include/uapi/asm-generic/signal.h +2 −0
  292. include/uapi/linux/openvswitch.h +15 −21
  293. include/uapi/linux/rtnetlink.h +1 −1
  294. kernel/irq/msi.c +1 −5
  295. kernel/kmod.c +6 −2
  296. kernel/sched/core.c +8 −4
  297. kernel/sched/deadline.c +13 −4
  298. kernel/sched/fair.c +5 −4
  299. kernel/sched/idle.c +2 −0
  300. kernel/time/timekeeping.c +1 −1
  301. kernel/trace/trace_stack.c +11 −0
  302. kernel/workqueue.c +4 −4
  303. lib/Kconfig +1 −0
  304. lib/Kconfig.debug +1 −0
  305. lib/fault-inject.c +1 −1
  306. mm/backing-dev.c +30 −6
  307. mm/cma.c +2 −2
  308. mm/filemap.c +5 −4
  309. mm/huge_memory.c +2 −1
  310. mm/memcontrol.c +18 −18
  311. mm/memory.c +2 −0
  312. mm/page-writeback.c +32 −22
  313. mm/readahead.c +4 −4
  314. mm/vmstat.c +4 −3
  315. net/bluetooth/hci_conn.c +71 −28
  316. net/bluetooth/hci_core.c +0 −7
  317. net/bluetooth/hci_event.c +8 −3
  318. net/bluetooth/mgmt.c +20 −4
  319. net/ceph/osd_client.c +9 −4
  320. net/core/ethtool.c +1 −1
  321. net/core/filter.c +6 −1
  322. net/dsa/dsa.c +59 −11
  323. net/ipv4/arp.c +5 −3
  324. net/ipv4/inet_connection_sock.c +10 −9
  325. net/ipv6/addrconf.c +2 −0
  326. net/ipv6/ip6_output.c +3 −0
  327. net/ipv6/route.c +23 −26
  328. net/ipv6/xfrm6_policy.c +1 −0
  329. net/mac80211/debugfs.c +1 −1
  330. net/mac80211/status.c +1 −0
  331. net/mac80211/tx.c +5 −2
  332. net/netlink/af_netlink.c +22 −12
  333. net/openvswitch/actions.c +14 −5
  334. net/openvswitch/conntrack.c +44 −45
  335. net/openvswitch/conntrack.h +13 −1
  336. net/openvswitch/flow.h +1 −1
  337. net/openvswitch/flow_netlink.c +18 −12
  338. net/openvswitch/flow_table.c +2 −1
  339. net/openvswitch/vport.c +22 −29
  340. net/sched/act_mirred.c +14 −4
  341. net/sched/sch_hhf.c +10 −1
  342. net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +1 −1
  343. net/sunrpc/xprtrdma/verbs.c +3 −5
  344. net/switchdev/switchdev.c +3 −0
  345. net/tipc/msg.h +2 −2
  346. net/tipc/node.c +3 −3
  347. net/unix/af_unix.c +7 −5
  348. scripts/package/builddeb +2 −2
  349. security/keys/gc.c +4 −2
  350. security/keys/request_key.c +3 −0
  351. sound/hda/ext/hdac_ext_bus.c +1 −0
  352. sound/pci/hda/hda_codec.c +1 −3
  353. sound/pci/hda/patch_conexant.c +1 −0
  354. sound/soc/codecs/rt298.c +13 −13
  355. sound/soc/codecs/wm8962.c +2 −0
  356. sound/soc/soc-ops.c +28 −0
  357. tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c +9 −0
  358. virt/kvm/arm/arch_timer.c +19 −0
  359. virt/kvm/arm/vgic.c +55 −40
.mailmap+1−0
@@ -59,6 +59,7 @@ James Bottomley <jejb@mulgrave.(none)> · 58 unmodified lines
5959 James Bottomley <jejb@titanic.il.steeleye.com>
6060 James E Wilson <wilson@specifix.com>
6161 James Ketrenos <jketreno@io.(none)>
62+<javier@osg.samsung.com> <javier.martinez@collabora.co.uk>
6263 Jean Tourrilhes <jt@hpl.hp.com>
6364 Jeff Garzik <jgarzik@pretzel.yyz.us>
6465 Jens Axboe <axboe@suse.de>
Documentation/arm/OMAP/README+7−0
@@ -0,0 +1,7 @@
1+This file contains documentation for running mainline
2+kernel on omaps.
3+
4+KERNEL NEW DEPENDENCIES
5+v4.3+ Update is needed for custom .config files to make sure
6+ CONFIG_REGULATOR_PBIAS is enabled for MMC1 to work
7+ properly.
MAINTAINERS+28−3
@@ -894,11 +894,12 @@ M: Lennert Buytenhek <kernel@wantstofly.org> · 893 unmodified lines
894894 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
895895 S: Maintained
896896
897−ARM/Allwinner A1X SoC support
897+ARM/Allwinner sunXi SoC support
898898 M: Maxime Ripard <maxime.ripard@free-electrons.com>
899+M: Chen-Yu Tsai <wens@csie.org>
899900 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
900901 S: Maintained
901−N: sun[x4567]i
902+N: sun[x456789]i
902903
903904 ARM/Allwinner SoC Clock Support
904905 M: Emilio López <emilio@elopez.com.ar>
@@ -3598,6 +3599,13 @@ F: drivers/gpu/drm/i915/ · 2693 unmodified lines
35983599 F: include/drm/i915*
35993600 F: include/uapi/drm/i915*
36003601
3602+DRM DRIVERS FOR ATMEL HLCDC
3603+M: Boris Brezillon <boris.brezillon@free-electrons.com>
3604+L: dri-devel@lists.freedesktop.org
3605+S: Supported
3606+F: drivers/gpu/drm/atmel-hlcdc/
3607+F: Documentation/devicetree/bindings/drm/atmel/
3608+
36013609 DRM DRIVERS FOR EXYNOS
36023610 M: Inki Dae <inki.dae@samsung.com>
36033611 M: Joonyoung Shim <jy0922.shim@samsung.com>
@@ -3626,6 +3634,14 @@ S: Maintained · 22 unmodified lines
36263634 F: drivers/gpu/drm/imx/
36273635 F: Documentation/devicetree/bindings/drm/imx/
36283636
3637+DRM DRIVERS FOR GMA500 (Poulsbo, Moorestown and derivative chipsets)
3638+M: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
3639+L: dri-devel@lists.freedesktop.org
3640+T: git git://github.com/patjak/drm-gma500
3641+S: Maintained
3642+F: drivers/gpu/drm/gma500
3643+F: include/drm/gma500*
3644+
36293645 DRM DRIVERS FOR NVIDIA TEGRA
36303646 M: Thierry Reding <thierry.reding@gmail.com>
36313647 M: Terje Bergström <tbergstrom@nvidia.com>
@@ -6785,7 +6801,6 @@ F: drivers/scsi/megaraid/ · 3153 unmodified lines
67856801
67866802 MELLANOX ETHERNET DRIVER (mlx4_en)
67876803 M: Amir Vadai <amirv@mellanox.com>
6788−M: Ido Shamay <idos@mellanox.com>
67896804 L: netdev@vger.kernel.org
67906805 S: Supported
67916806 W: http://www.mellanox.com
@@ -9108,6 +9123,15 @@ S: Supported · 2316 unmodified lines
91089123 F: Documentation/devicetree/bindings/net/snps,dwc-qos-ethernet.txt
91099124 F: drivers/net/ethernet/synopsys/dwc_eth_qos.c
91109125
9126+SYNOPSYS DESIGNWARE I2C DRIVER
9127+M: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
9128+M: Jarkko Nikula <jarkko.nikula@linux.intel.com>
9129+M: Mika Westerberg <mika.westerberg@linux.intel.com>
9130+L: linux-i2c@vger.kernel.org
9131+S: Maintained
9132+F: drivers/i2c/busses/i2c-designware-*
9133+F: include/linux/platform_data/i2c-designware.h
9134+
91119135 SYNOPSYS DESIGNWARE MMC/SD/SDIO DRIVER
91129136 M: Seungwon Jeon <tgih.jun@samsung.com>
91139137 M: Jaehoon Chung <jh80.chung@samsung.com>
@@ -11658,6 +11682,7 @@ F: drivers/tty/serial/zs.* · 2544 unmodified lines
1165811682 ZSMALLOC COMPRESSED SLAB MEMORY ALLOCATOR
1165911683 M: Minchan Kim <minchan@kernel.org>
1166011684 M: Nitin Gupta <ngupta@vflare.org>
11685+R: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
1166111686 L: linux-mm@kvack.org
1166211687 S: Maintained
1166311688 F: mm/zsmalloc.c
Makefile+1−1
@@ -1,7 +1,7 @@
11 VERSION = 4
22 PATCHLEVEL = 3
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc5
4+EXTRAVERSION = -rc7
55 NAME = Blurry Fish Butt
66
77 # *DOCUMENTATION*
arch/arm/boot/dts/am57xx-beagle-x15.dts+2−1
@@ -402,11 +402,12 @@ · 401 unmodified lines
402402 /* SMPS9 unused */
403403
404404 ldo1_reg: ldo1 {
405− /* VDD_SD */
405+ /* VDD_SD / VDDSHV8 */
406406 regulator-name = "ldo1";
407407 regulator-min-microvolt = <1800000>;
408408 regulator-max-microvolt = <3300000>;
409409 regulator-boot-on;
410+ regulator-always-on;
410411 };
411412
412413 ldo2_reg: ldo2 {
arch/arm/boot/dts/armada-385-db-ap.dts+1−1
@@ -46,7 +46,7 @@ · 45 unmodified lines
4646
4747 / {
4848 model = "Marvell Armada 385 Access Point Development Board";
49− compatible = "marvell,a385-db-ap", "marvell,armada385", "marvell,armada38x";
49+ compatible = "marvell,a385-db-ap", "marvell,armada385", "marvell,armada380";
5050
5151 chosen {
5252 stdout-path = "serial1:115200n8";
arch/arm/boot/dts/berlin2q.dtsi+3−3
@@ -152,7 +152,7 @@ · 151 unmodified lines
152152 };
153153
154154 usb_phy2: phy@a2f400 {
155− compatible = "marvell,berlin2-usb-phy";
155+ compatible = "marvell,berlin2cd-usb-phy";
156156 reg = <0xa2f400 0x128>;
157157 #phy-cells = <0>;
158158 resets = <&chip_rst 0x104 14>;
@@ -170,7 +170,7 @@ · 11 unmodified lines
170170 };
171171
172172 usb_phy0: phy@b74000 {
173− compatible = "marvell,berlin2-usb-phy";
173+ compatible = "marvell,berlin2cd-usb-phy";
174174 reg = <0xb74000 0x128>;
175175 #phy-cells = <0>;
176176 resets = <&chip_rst 0x104 12>;
@@ -178,7 +178,7 @@ · 1 unmodified line
178178 };
179179
180180 usb_phy1: phy@b78000 {
181− compatible = "marvell,berlin2-usb-phy";
181+ compatible = "marvell,berlin2cd-usb-phy";
182182 reg = <0xb78000 0x128>;
183183 #phy-cells = <0>;
184184 resets = <&chip_rst 0x104 13>;
arch/arm/boot/dts/exynos5420-peach-pit.dts+5−0
@@ -915,6 +915,11 @@ · 914 unmodified lines
915915 };
916916 };
917917
918+&pmu_system_controller {
919+ assigned-clocks = <&pmu_system_controller 0>;
920+ assigned-clock-parents = <&clock CLK_FIN_PLL>;
921+};
922+
918923 &rtc {
919924 status = "okay";
920925 clocks = <&clock CLK_RTC>, <&max77802 MAX77802_CLK_32K_AP>;
arch/arm/boot/dts/exynos5800-peach-pi.dts+5−0
@@ -878,6 +878,11 @@ · 877 unmodified lines
878878 };
879879 };
880880
881+&pmu_system_controller {
882+ assigned-clocks = <&pmu_system_controller 0>;
883+ assigned-clock-parents = <&clock CLK_FIN_PLL>;
884+};
885+
881886 &rtc {
882887 status = "okay";
883888 clocks = <&clock CLK_RTC>, <&max77802 MAX77802_CLK_32K_AP>;
arch/arm/boot/dts/imx7d.dtsi+2−2
@@ -588,10 +588,10 @@ · 587 unmodified lines
588588 status = "disabled";
589589 };
590590
591− uart2: serial@30870000 {
591+ uart2: serial@30890000 {
592592 compatible = "fsl,imx7d-uart",
593593 "fsl,imx6q-uart";
594− reg = <0x30870000 0x10000>;
594+ reg = <0x30890000 0x10000>;
595595 interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
596596 clocks = <&clks IMX7D_UART2_ROOT_CLK>,
597597 <&clks IMX7D_UART2_ROOT_CLK>;
arch/arm/boot/dts/logicpd-torpedo-37xx-devkit.dts+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212
1313 / {
1414 model = "LogicPD Zoom DM3730 Torpedo Development Kit";
15− compatible = "logicpd,dm3730-torpedo-devkit", "ti,omap36xx";
15+ compatible = "logicpd,dm3730-torpedo-devkit", "ti,omap3630", "ti,omap3";
1616
1717 gpio_keys {
1818 compatible = "gpio-keys";
arch/arm/boot/dts/meson.dtsi+12−11
@@ -67,7 +67,7 @@ · 66 unmodified lines
6767
6868 timer@c1109940 {
6969 compatible = "amlogic,meson6-timer";
70− reg = <0xc1109940 0x14>;
70+ reg = <0xc1109940 0x18>;
7171 interrupts = <0 10 1>;
7272 };
7373
@@ -80,36 +80,37 @@ · 6 unmodified lines
8080 wdt: watchdog@c1109900 {
8181 compatible = "amlogic,meson6-wdt";
8282 reg = <0xc1109900 0x8>;
83+ interrupts = <0 0 1>;
8384 };
8485
8586 uart_AO: serial@c81004c0 {
8687 compatible = "amlogic,meson-uart";
87− reg = <0xc81004c0 0x14>;
88+ reg = <0xc81004c0 0x18>;
8889 interrupts = <0 90 1>;
8990 clocks = <&clk81>;
9091 status = "disabled";
9192 };
9293
93− uart_A: serial@c81084c0 {
94+ uart_A: serial@c11084c0 {
9495 compatible = "amlogic,meson-uart";
95− reg = <0xc81084c0 0x14>;
96− interrupts = <0 90 1>;
96+ reg = <0xc11084c0 0x18>;
97+ interrupts = <0 26 1>;
9798 clocks = <&clk81>;
9899 status = "disabled";
99100 };
100101
101− uart_B: serial@c81084dc {
102+ uart_B: serial@c11084dc {
102103 compatible = "amlogic,meson-uart";
103− reg = <0xc81084dc 0x14>;
104− interrupts = <0 90 1>;
104+ reg = <0xc11084dc 0x18>;
105+ interrupts = <0 75 1>;
105106 clocks = <&clk81>;
106107 status = "disabled";
107108 };
108109
109− uart_C: serial@c8108700 {
110+ uart_C: serial@c1108700 {
110111 compatible = "amlogic,meson-uart";
111− reg = <0xc8108700 0x14>;
112− interrupts = <0 90 1>;
112+ reg = <0xc1108700 0x18>;
113+ interrupts = <0 93 1>;
113114 clocks = <&clk81>;
114115 status = "disabled";
115116 };
arch/arm/boot/dts/omap3-evm-37xx.dts+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313
1414 / {
1515 model = "TI OMAP37XX EVM (TMDSEVM3730)";
16− compatible = "ti,omap3-evm-37xx", "ti,omap36xx";
16+ compatible = "ti,omap3-evm-37xx", "ti,omap3630", "ti,omap3";
1717
1818 memory {
1919 device_type = "memory";
arch/arm/boot/dts/ste-hrefv60plus.dtsi+1−1
@@ -56,7 +56,7 @@ · 55 unmodified lines
5656 /* VMMCI level-shifter enable */
5757 default_hrefv60_cfg2 {
5858 pins = "GPIO169_D22";
59− ste,config = <&gpio_out_lo>;
59+ ste,config = <&gpio_out_hi>;
6060 };
6161 /* VMMCI level-shifter voltage select */
6262 default_hrefv60_cfg3 {
arch/arm/boot/dts/tegra114.dtsi+2−0
@@ -234,7 +234,9 @@ · 233 unmodified lines
234234 gpio-controller;
235235 #interrupt-cells = <2>;
236236 interrupt-controller;
237+ /*
237238 gpio-ranges = <&pinmux 0 0 246>;
239+ */
238240 };
239241
240242 apbmisc@70000800 {
arch/arm/boot/dts/tegra124.dtsi+2−0
@@ -258,7 +258,9 @@ · 257 unmodified lines
258258 gpio-controller;
259259 #interrupt-cells = <2>;
260260 interrupt-controller;
261+ /*
261262 gpio-ranges = <&pinmux 0 0 251>;
263+ */
262264 };
263265
264266 apbdma: dma@0,60020000 {
arch/arm/boot/dts/tegra20.dtsi+2−0
@@ -244,7 +244,9 @@ · 243 unmodified lines
244244 gpio-controller;
245245 #interrupt-cells = <2>;
246246 interrupt-controller;
247+ /*
247248 gpio-ranges = <&pinmux 0 0 224>;
249+ */
248250 };
249251
250252 apbmisc@70000800 {
arch/arm/boot/dts/tegra30.dtsi+2−0
@@ -349,7 +349,9 @@ · 348 unmodified lines
349349 gpio-controller;
350350 #interrupt-cells = <2>;
351351 interrupt-controller;
352+ /*
352353 gpio-ranges = <&pinmux 0 0 248>;
354+ */
353355 };
354356
355357 apbmisc@70000800 {
arch/arm/boot/dts/uniphier-ph1-ld6b-ref.dts+1−1
@@ -85,7 +85,7 @@ · 84 unmodified lines
8585 };
8686
8787 &ethsc {
88− interrupts = <0 50 4>;
88+ interrupts = <0 52 4>;
8989 };
9090
9191 &serial0 {
arch/arm/kvm/Kconfig+1−0
@@ -21,6 +21,7 @@ config KVM · 20 unmodified lines
2121 depends on MMU && OF
2222 select PREEMPT_NOTIFIERS
2323 select ANON_INODES
24+ select ARM_GIC
2425 select HAVE_KVM_CPU_RELAX_INTERCEPT
2526 select HAVE_KVM_ARCH_TLB_FLUSH_ALL
2627 select KVM_MMIO
arch/arm/kvm/arm.c+1−1
@@ -1080,7 +1080,7 @@ static int init_hyp_mode(void) · 1079 unmodified lines
10801080 */
10811081 err = kvm_timer_hyp_init();
10821082 if (err)
1083− goto out_free_mappings;
1083+ goto out_free_context;
10841084
10851085 #ifndef CONFIG_HOTPLUG_CPU
10861086 free_boot_hyp_pgd();
arch/arm/mach-exynos/pm_domains.c+3−5
@@ -200,15 +200,15 @@ no_clk: · 199 unmodified lines
200200 args.args_count = 0;
201201 child_domain = of_genpd_get_from_provider(&args);
202202 if (IS_ERR(child_domain))
203− goto next_pd;
203+ continue;
204204
205205 if (of_parse_phandle_with_args(np, "power-domains",
206206 "#power-domain-cells", 0, &args) != 0)
207− goto next_pd;
207+ continue;
208208
209209 parent_domain = of_genpd_get_from_provider(&args);
210210 if (IS_ERR(parent_domain))
211− goto next_pd;
211+ continue;
212212
213213 if (pm_genpd_add_subdomain(parent_domain, child_domain))
214214 pr_warn("%s failed to add subdomain: %s\n",
@@ -216,8 +216,6 @@ no_clk: · 1 unmodified line
216216 else
217217 pr_info("%s has as child subdomain: %s.\n",
218218 parent_domain->name, child_domain->name);
219−next_pd:
220− of_node_put(np);
221219 }
222220
223221 return 0;
arch/arm/mach-omap2/Kconfig+2−0
@@ -49,6 +49,7 @@ config SOC_OMAP5 · 48 unmodified lines
4949 select OMAP_INTERCONNECT
5050 select OMAP_INTERCONNECT_BARRIER
5151 select PM_OPP if PM
52+ select ZONE_DMA if ARM_LPAE
5253
5354 config SOC_AM33XX
5455 bool "TI AM33XX"
@@ -78,6 +79,7 @@ config SOC_DRA7XX · 23 unmodified lines
7879 select OMAP_INTERCONNECT
7980 select OMAP_INTERCONNECT_BARRIER
8081 select PM_OPP if PM
82+ select ZONE_DMA if ARM_LPAE
8183
8284 config ARCH_OMAP2PLUS
8385 bool
arch/arm/mach-omap2/board-generic.c+10−0
@@ -106,6 +106,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)") · 105 unmodified lines
106106 MACHINE_END
107107
108108 static const char *const omap36xx_boards_compat[] __initconst = {
109+ "ti,omap3630",
109110 "ti,omap36xx",
110111 NULL,
111112 };
@@ -243,6 +244,9 @@ static const char *const omap5_boards_compat[] __initconst = { · 131 unmodified lines
243244 };
244245
245246 DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
247+#if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE)
248+ .dma_zone_size = SZ_2G,
249+#endif
246250 .reserve = omap_reserve,
247251 .smp = smp_ops(omap4_smp_ops),
248252 .map_io = omap5_map_io,
@@ -288,6 +292,9 @@ static const char *const dra74x_boards_compat[] __initconst = { · 39 unmodified lines
288292 };
289293
290294 DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)")
295+#if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE)
296+ .dma_zone_size = SZ_2G,
297+#endif
291298 .reserve = omap_reserve,
292299 .smp = smp_ops(omap4_smp_ops),
293300 .map_io = dra7xx_map_io,
@@ -308,6 +315,9 @@ static const char *const dra72x_boards_compat[] __initconst = { · 14 unmodified lines
308315 };
309316
310317 DT_MACHINE_START(DRA72X_DT, "Generic DRA72X (Flattened Device Tree)")
318+#if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE)
319+ .dma_zone_size = SZ_2G,
320+#endif
311321 .reserve = omap_reserve,
312322 .map_io = dra7xx_map_io,
313323 .init_early = dra7xx_init_early,
arch/arm/mach-omap2/pdata-quirks.c+8−1
@@ -559,7 +559,14 @@ static void pdata_quirks_check(struct pdata_init *quirks) · 558 unmodified lines
559559
560560 void __init pdata_quirks_init(const struct of_device_id *omap_dt_match_table)
561561 {
562− omap_sdrc_init(NULL, NULL);
562+ /*
563+ * We still need this for omap2420 and omap3 PM to work, others are
564+ * using drivers/misc/sram.c already.
565+ */
566+ if (of_machine_is_compatible("ti,omap2420") ||
567+ of_machine_is_compatible("ti,omap3"))
568+ omap_sdrc_init(NULL, NULL);
569+
563570 pdata_quirks_check(auxdata_quirks);
564571 of_platform_populate(NULL, omap_dt_match_table,
565572 omap_auxdata_lookup, NULL);
arch/arm/mach-pxa/pxa3xx.c+5−4
@@ -42,10 +42,6 @@ · 41 unmodified lines
4242 #define PECR_IS(n) ((1 << ((n) * 2)) << 29)
4343
4444 extern void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int));
45−#ifdef CONFIG_PM
46−
47−#define ISRAM_START 0x5c000000
48−#define ISRAM_SIZE SZ_256K
4945
5046 /*
5147 * NAND NFC: DFI bus arbitration subset
@@ -54,6 +50,11 @@ extern void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int)); · 2 unmodified lines
5450 #define NDCR_ND_ARB_EN (1 << 12)
5551 #define NDCR_ND_ARB_CNTL (1 << 19)
5652
53+#ifdef CONFIG_PM
54+
55+#define ISRAM_START 0x5c000000
56+#define ISRAM_SIZE SZ_256K
57+
5758 static void __iomem *sram;
5859 static unsigned long wakeup_src;
5960
arch/arm/net/bpf_jit_32.c+1−0
@@ -614,6 +614,7 @@ load_common: · 613 unmodified lines
614614 case BPF_LD | BPF_B | BPF_IND:
615615 load_order = 0;
616616 load_ind:
617+ update_on_xread(ctx);
617618 OP_IMM3(ARM_ADD, r_off, r_X, k, ctx);
618619 goto load_common;
619620 case BPF_LDX | BPF_IMM:
arch/arm/plat-orion/common.c+1−1
@@ -495,7 +495,7 @@ void __init orion_ge00_switch_init(struct dsa_platform_data *d, int irq) · 494 unmodified lines
495495
496496 d->netdev = &orion_ge00.dev;
497497 for (i = 0; i < d->nr_chips; i++)
498− d->chip[i].host_dev = &orion_ge00_shared.dev;
498+ d->chip[i].host_dev = &orion_ge_mvmdio.dev;
499499 orion_switch_device.dev.platform_data = d;
500500
501501 platform_device_register(&orion_switch_device);
arch/arm64/Makefile+1−1
@@ -42,7 +42,7 @@ endif · 41 unmodified lines
4242 CHECKFLAGS += -D__aarch64__
4343
4444 ifeq ($(CONFIG_ARM64_ERRATUM_843419), y)
45−CFLAGS_MODULE += -mcmodel=large
45+KBUILD_CFLAGS_MODULE += -mcmodel=large
4646 endif
4747
4848 # Default value
arch/arm64/include/asm/unistd.h+1−1
@@ -44,7 +44,7 @@ · 43 unmodified lines
4444 #define __ARM_NR_compat_cacheflush (__ARM_NR_COMPAT_BASE+2)
4545 #define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE+5)
4646
47−#define __NR_compat_syscalls 388
47+#define __NR_compat_syscalls 390
4848 #endif
4949
5050 #define __ARCH_WANT_SYS_CLONE
arch/arm64/include/asm/unistd32.h+9−0
@@ -797,3 +797,12 @@ __SYSCALL(__NR_memfd_create, sys_memfd_create) · 796 unmodified lines
797797 __SYSCALL(__NR_bpf, sys_bpf)
798798 #define __NR_execveat 387
799799 __SYSCALL(__NR_execveat, compat_sys_execveat)
800+#define __NR_userfaultfd 388
801+__SYSCALL(__NR_userfaultfd, sys_userfaultfd)
802+#define __NR_membarrier 389
803+__SYSCALL(__NR_membarrier, sys_membarrier)
804+
805+/*
806+ * Please add new compat syscalls above this comment and update
807+ * __NR_compat_syscalls in asm/unistd.h.
808+ */
arch/arm64/include/uapi/asm/signal.h+3−0
@@ -19,6 +19,9 @@ · 18 unmodified lines
1919 /* Required for AArch32 compatibility. */
2020 #define SA_RESTORER 0x04000000
2121
22+#define MINSIGSTKSZ 5120
23+#define SIGSTKSZ 16384
24+
2225 #include <asm-generic/signal.h>
2326
2427 #endif
arch/powerpc/configs/ppc64_defconfig+1−1
@@ -111,7 +111,7 @@ CONFIG_SCSI_QLA_FC=m · 110 unmodified lines
111111 CONFIG_SCSI_QLA_ISCSI=m
112112 CONFIG_SCSI_LPFC=m
113113 CONFIG_SCSI_VIRTIO=m
114−CONFIG_SCSI_DH=m
114+CONFIG_SCSI_DH=y
115115 CONFIG_SCSI_DH_RDAC=m
116116 CONFIG_SCSI_DH_ALUA=m
117117 CONFIG_ATA=y
arch/powerpc/configs/pseries_defconfig+1−1
@@ -114,7 +114,7 @@ CONFIG_SCSI_QLA_FC=m · 113 unmodified lines
114114 CONFIG_SCSI_QLA_ISCSI=m
115115 CONFIG_SCSI_LPFC=m
116116 CONFIG_SCSI_VIRTIO=m
117−CONFIG_SCSI_DH=m
117+CONFIG_SCSI_DH=y
118118 CONFIG_SCSI_DH_RDAC=m
119119 CONFIG_SCSI_DH_ALUA=m
120120 CONFIG_ATA=y
arch/powerpc/include/asm/cache.h+0−7
@@ -3,7 +3,6 @@ · 2 unmodified lines
33
44 #ifdef __KERNEL__
55
6−#include <asm/reg.h>
76
87 /* bytes per L1 cache line */
98 #if defined(CONFIG_8xx) || defined(CONFIG_403GCX)
@@ -40,12 +39,6 @@ struct ppc64_caches { · 30 unmodified lines
4039 };
4140
4241 extern struct ppc64_caches ppc64_caches;
43−
44−static inline void logmpp(u64 x)
45−{
46− asm volatile(PPC_LOGMPP(R1) : : "r" (x));
47−}
48−
4942 #endif /* __powerpc64__ && ! __ASSEMBLY__ */
5043
5144 #if defined(__ASSEMBLY__)
arch/powerpc/include/asm/kvm_host.h+0−2
@@ -297,8 +297,6 @@ struct kvmppc_vcore { · 296 unmodified lines
297297 u32 arch_compat;
298298 ulong pcr;
299299 ulong dpdes; /* doorbell state (POWER8) */
300− void *mpp_buffer; /* Micro Partition Prefetch buffer */
301− bool mpp_buffer_is_valid;
302300 ulong conferring_threads;
303301 };
304302
arch/powerpc/include/asm/machdep.h+7−2
@@ -61,8 +61,13 @@ struct machdep_calls { · 60 unmodified lines
6161 unsigned long addr,
6262 unsigned char *hpte_slot_array,
6363 int psize, int ssize, int local);
64− /* special for kexec, to be called in real mode, linear mapping is
65− * destroyed as well */
64+ /*
65+ * Special for kexec.
66+ * To be called in real mode with interrupts disabled. No locks are
67+ * taken as such, concurrent access on pre POWER5 hardware could result
68+ * in a deadlock.
69+ * The linear mapping is destroyed as well.
70+ */
6671 void (*hpte_clear_all)(void);
6772
6873 void __iomem * (*ioremap)(phys_addr_t addr, unsigned long size,
arch/powerpc/include/asm/ppc-opcode.h+0−17
@@ -141,7 +141,6 @@ · 140 unmodified lines
141141 #define PPC_INST_ISEL 0x7c00001e
142142 #define PPC_INST_ISEL_MASK 0xfc00003e
143143 #define PPC_INST_LDARX 0x7c0000a8
144−#define PPC_INST_LOGMPP 0x7c0007e4
145144 #define PPC_INST_LSWI 0x7c0004aa
146145 #define PPC_INST_LSWX 0x7c00042a
147146 #define PPC_INST_LWARX 0x7c000028
@@ -285,20 +284,6 @@ · 137 unmodified lines
285284 #define __PPC_EH(eh) 0
286285 #endif
287286
288−/* POWER8 Micro Partition Prefetch (MPP) parameters */
289−/* Address mask is common for LOGMPP instruction and MPPR SPR */
290−#define PPC_MPPE_ADDRESS_MASK 0xffffffffc000ULL
291−
292−/* Bits 60 and 61 of MPP SPR should be set to one of the following */
293−/* Aborting the fetch is indeed setting 00 in the table size bits */
294−#define PPC_MPPR_FETCH_ABORT (0x0ULL << 60)
295−#define PPC_MPPR_FETCH_WHOLE_TABLE (0x2ULL << 60)
296−
297−/* Bits 54 and 55 of register for LOGMPP instruction should be set to: */
298−#define PPC_LOGMPP_LOG_L2 (0x02ULL << 54)
299−#define PPC_LOGMPP_LOG_L2L3 (0x01ULL << 54)
300−#define PPC_LOGMPP_LOG_ABORT (0x03ULL << 54)
301−
302287 /* Deal with instructions that older assemblers aren't aware of */
303288 #define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \
304289 __PPC_RA(a) | __PPC_RB(b))
@@ -307,8 +292,6 @@ · 2 unmodified lines
307292 #define PPC_LDARX(t, a, b, eh) stringify_in_c(.long PPC_INST_LDARX | \
308293 ___PPC_RT(t) | ___PPC_RA(a) | \
309294 ___PPC_RB(b) | __PPC_EH(eh))
310−#define PPC_LOGMPP(b) stringify_in_c(.long PPC_INST_LOGMPP | \
311− __PPC_RB(b))
312295 #define PPC_LWARX(t, a, b, eh) stringify_in_c(.long PPC_INST_LWARX | \
313296 ___PPC_RT(t) | ___PPC_RA(a) | \
314297 ___PPC_RB(b) | __PPC_EH(eh))
arch/powerpc/include/asm/reg.h+0−1
@@ -226,7 +226,6 @@ · 225 unmodified lines
226226 #define CTRL_TE 0x00c00000 /* thread enable */
227227 #define CTRL_RUNLATCH 0x1
228228 #define SPRN_DAWR 0xB4
229−#define SPRN_MPPR 0xB8 /* Micro Partition Prefetch Register */
230229 #define SPRN_RPR 0xBA /* Relative Priority Register */
231230 #define SPRN_CIABR 0xBB
232231 #define CIABR_PRIV 0x3
arch/powerpc/kernel/rtas.c+3−0
@@ -1043,6 +1043,9 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs) · 1042 unmodified lines
10431043 if (!capable(CAP_SYS_ADMIN))
10441044 return -EPERM;
10451045
1046+ if (!rtas.entry)
1047+ return -EINVAL;
1048+
10461049 if (copy_from_user(&args, uargs, 3 * sizeof(u32)) != 0)
10471050 return -EFAULT;
10481051
arch/powerpc/kvm/book3s_hv.c+1−54
@@ -36,7 +36,6 @@ · 35 unmodified lines
3636
3737 #include <asm/reg.h>
3838 #include <asm/cputable.h>
39−#include <asm/cache.h>
4039 #include <asm/cacheflush.h>
4140 #include <asm/tlbflush.h>
4241 #include <asm/uaccess.h>
@@ -75,12 +74,6 @@ · 32 unmodified lines
7574
7675 static DECLARE_BITMAP(default_enabled_hcalls, MAX_HCALL_OPCODE/4 + 1);
7776
78−#if defined(CONFIG_PPC_64K_PAGES)
79−#define MPP_BUFFER_ORDER 0
80−#elif defined(CONFIG_PPC_4K_PAGES)
81−#define MPP_BUFFER_ORDER 3
82−#endif
83−
8477 static int dynamic_mt_modes = 6;
8578 module_param(dynamic_mt_modes, int, S_IRUGO | S_IWUSR);
8679 MODULE_PARM_DESC(dynamic_mt_modes, "Set of allowed dynamic micro-threading modes: 0 (= none), 2, 4, or 6 (= 2 or 4)");
@@ -1455,13 +1448,6 @@ static struct kvmppc_vcore *kvmppc_vcore_create(struct kvm *kvm, int core) · 1368 unmodified lines
14551448 vcore->kvm = kvm;
14561449 INIT_LIST_HEAD(&vcore->preempt_list);
14571450
1458− vcore->mpp_buffer_is_valid = false;
1459−
1460− if (cpu_has_feature(CPU_FTR_ARCH_207S))
1461− vcore->mpp_buffer = (void *)__get_free_pages(
1462− GFP_KERNEL|__GFP_ZERO,
1463− MPP_BUFFER_ORDER);
1464−
14651451 return vcore;
14661452 }
14671453
@@ -1894,33 +1880,6 @@ static int on_primary_thread(void) · 426 unmodified lines
18941880 return 1;
18951881 }
18961882
1897−static void kvmppc_start_saving_l2_cache(struct kvmppc_vcore *vc)
1898−{
1899− phys_addr_t phy_addr, mpp_addr;
1900−
1901− phy_addr = (phys_addr_t)virt_to_phys(vc->mpp_buffer);
1902− mpp_addr = phy_addr & PPC_MPPE_ADDRESS_MASK;
1903−
1904− mtspr(SPRN_MPPR, mpp_addr | PPC_MPPR_FETCH_ABORT);
1905− logmpp(mpp_addr | PPC_LOGMPP_LOG_L2);
1906−
1907− vc->mpp_buffer_is_valid = true;
1908−}
1909−
1910−static void kvmppc_start_restoring_l2_cache(const struct kvmppc_vcore *vc)
1911−{
1912− phys_addr_t phy_addr, mpp_addr;
1913−
1914− phy_addr = virt_to_phys(vc->mpp_buffer);
1915− mpp_addr = phy_addr & PPC_MPPE_ADDRESS_MASK;
1916−
1917− /* We must abort any in-progress save operations to ensure
1918− * the table is valid so that prefetch engine knows when to
1919− * stop prefetching. */
1920− logmpp(mpp_addr | PPC_LOGMPP_LOG_ABORT);
1921− mtspr(SPRN_MPPR, mpp_addr | PPC_MPPR_FETCH_WHOLE_TABLE);
1922−}
1923−
19241883 /*
19251884 * A list of virtual cores for each physical CPU.
19261885 * These are vcores that could run but their runner VCPU tasks are
@@ -2471,14 +2430,8 @@ static noinline void kvmppc_run_core(struct kvmppc_vcore *vc) · 544 unmodified lines
24712430
24722431 srcu_idx = srcu_read_lock(&vc->kvm->srcu);
24732432
2474− if (vc->mpp_buffer_is_valid)
2475− kvmppc_start_restoring_l2_cache(vc);
2476−
24772433 __kvmppc_vcore_entry();
24782434
2479− if (vc->mpp_buffer)
2480− kvmppc_start_saving_l2_cache(vc);
2481−
24822435 srcu_read_unlock(&vc->kvm->srcu, srcu_idx);
24832436
24842437 spin_lock(&vc->lock);
@@ -3073,14 +3026,8 @@ static void kvmppc_free_vcores(struct kvm *kvm) · 588 unmodified lines
30733026 {
30743027 long int i;
30753028
3076− for (i = 0; i < KVM_MAX_VCORES; ++i) {
3077− if (kvm->arch.vcores[i] && kvm->arch.vcores[i]->mpp_buffer) {
3078− struct kvmppc_vcore *vc = kvm->arch.vcores[i];
3079− free_pages((unsigned long)vc->mpp_buffer,
3080− MPP_BUFFER_ORDER);
3081− }
3029+ for (i = 0; i < KVM_MAX_VCORES; ++i)
30823030 kfree(kvm->arch.vcores[i]);
3083− }
30843031 kvm->arch.online_vcores = 0;
30853032 }
30863033
arch/powerpc/mm/hash_native_64.c+11−12
@@ -582,13 +582,21 @@ static void hpte_decode(struct hash_pte *hpte, unsigned long slot, · 581 unmodified lines
582582 * be when they isi), and we are the only one left. We rely on our kernel
583583 * mapping being 0xC0's and the hardware ignoring those two real bits.
584584 *
585+ * This must be called with interrupts disabled.
586+ *
587+ * Taking the native_tlbie_lock is unsafe here due to the possibility of
588+ * lockdep being on. On pre POWER5 hardware, not taking the lock could
589+ * cause deadlock. POWER5 and newer not taking the lock is fine. This only
590+ * gets called during boot before secondary CPUs have come up and during
591+ * crashdump and all bets are off anyway.
592+ *
585593 * TODO: add batching support when enabled. remember, no dynamic memory here,
586594 * athough there is the control page available...
587595 */
588596 static void native_hpte_clear(void)
589597 {
590598 unsigned long vpn = 0;
591− unsigned long slot, slots, flags;
599+ unsigned long slot, slots;
592600 struct hash_pte *hptep = htab_address;
593601 unsigned long hpte_v;
594602 unsigned long pteg_count;
@@ -596,13 +604,6 @@ static void native_hpte_clear(void) · 1 unmodified line
596604
597605 pteg_count = htab_hash_mask + 1;
598606
599− local_irq_save(flags);
600−
601− /* we take the tlbie lock and hold it. Some hardware will
602− * deadlock if we try to tlbie from two processors at once.
603− */
604− raw_spin_lock(&native_tlbie_lock);
605−
606607 slots = pteg_count * HPTES_PER_GROUP;
607608
608609 for (slot = 0; slot < slots; slot++, hptep++) {
@@ -614,8 +615,8 @@ static void native_hpte_clear(void) · 5 unmodified lines
614615 hpte_v = be64_to_cpu(hptep->v);
615616
616617 /*
617− * Call __tlbie() here rather than tlbie() since we
618− * already hold the native_tlbie_lock.
618+ * Call __tlbie() here rather than tlbie() since we can't take the
619+ * native_tlbie_lock.
619620 */
620621 if (hpte_v & HPTE_V_VALID) {
621622 hpte_decode(hptep, slot, &psize, &apsize, &ssize, &vpn);
@@ -625,8 +626,6 @@ static void native_hpte_clear(void) · 3 unmodified lines
625626 }
626627
627628 asm volatile("eieio; tlbsync; ptesync":::"memory");
628− raw_spin_unlock(&native_tlbie_lock);
629− local_irq_restore(flags);
630629 }
631630
632631 /*
arch/powerpc/platforms/powernv/opal.c+5−2
@@ -487,9 +487,12 @@ int opal_machine_check(struct pt_regs *regs) · 486 unmodified lines
487487 * PRD component would have already got notified about this
488488 * error through other channels.
489489 *
490− * In any case, let us just fall through. We anyway heading
491− * down to panic path.
490+ * If hardware marked this as an unrecoverable MCE, we are
491+ * going to panic anyway. Even if it didn't, it's not safe to
492+ * continue at this point, so we should explicitly panic.
492493 */
494+
495+ panic("PowerNV Unrecovered Machine Check");
493496 return 0;
494497 }
495498
arch/powerpc/platforms/powernv/smp.c+24−5
@@ -171,7 +171,26 @@ static void pnv_smp_cpu_kill_self(void) · 170 unmodified lines
171171 * so clear LPCR:PECE1. We keep PECE2 enabled.
172172 */
173173 mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1);
174+
175+ /*
176+ * Hard-disable interrupts, and then clear irq_happened flags
177+ * that we can safely ignore while off-line, since they
178+ * are for things for which we do no processing when off-line
179+ * (or in the case of HMI, all the processing we need to do
180+ * is done in lower-level real-mode code).
181+ */
182+ hard_irq_disable();
183+ local_paca->irq_happened &= ~(PACA_IRQ_DEC | PACA_IRQ_HMI);
184+
174185 while (!generic_check_cpu_restart(cpu)) {
186+ /*
187+ * Clear IPI flag, since we don't handle IPIs while
188+ * offline, except for those when changing micro-threading
189+ * mode, which are handled explicitly below, and those
190+ * for coming online, which are handled via
191+ * generic_check_cpu_restart() calls.
192+ */
193+ kvmppc_set_host_ipi(cpu, 0);
175194
176195 ppc64_runlatch_off();
177196
@@ -196,20 +215,20 @@ static void pnv_smp_cpu_kill_self(void) · 18 unmodified lines
196215 * having finished executing in a KVM guest, then srr1
197216 * contains 0.
198217 */
199− if ((srr1 & wmask) == SRR1_WAKEEE) {
218+ if (((srr1 & wmask) == SRR1_WAKEEE) ||
219+ (local_paca->irq_happened & PACA_IRQ_EE)) {
200220 icp_native_flush_interrupt();
201− local_paca->irq_happened &= PACA_IRQ_HARD_DIS;
202− smp_mb();
203221 } else if ((srr1 & wmask) == SRR1_WAKEHDBELL) {
204222 unsigned long msg = PPC_DBELL_TYPE(PPC_DBELL_SERVER);
205223 asm volatile(PPC_MSGCLR(%0) : : "r" (msg));
206− kvmppc_set_host_ipi(cpu, 0);
207224 }
225+ local_paca->irq_happened &= ~(PACA_IRQ_EE | PACA_IRQ_DBELL);
226+ smp_mb();
208227
209228 if (cpu_core_split_required())
210229 continue;
211230
212− if (!generic_check_cpu_restart(cpu))
231+ if (srr1 && !generic_check_cpu_restart(cpu))
213232 DBG("CPU%d Unexpected exit while offline !\n", cpu);
214233 }
215234 mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) | LPCR_PECE1);
arch/powerpc/platforms/ps3/os-area.c+0−5
@@ -194,11 +194,6 @@ static const struct os_area_db_id os_area_db_id_rtc_diff = { · 193 unmodified lines
194194 .key = OS_AREA_DB_KEY_RTC_DIFF
195195 };
196196
197−static const struct os_area_db_id os_area_db_id_video_mode = {
198− .owner = OS_AREA_DB_OWNER_LINUX,
199− .key = OS_AREA_DB_KEY_VIDEO_MODE
200−};
201−
202197 #define SECONDS_FROM_1970_TO_2000 946684800LL
203198
204199 /**
arch/sh/include/asm/page.h+1−0
@@ -59,6 +59,7 @@ pages_do_alias(unsigned long addr1, unsigned long addr2) · 58 unmodified lines
5959
6060 #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
6161 extern void copy_page(void *to, void *from);
62+#define copy_user_page(to, from, vaddr, pg) __copy_user(to, from, PAGE_SIZE)
6263
6364 struct page;
6465 struct vm_area_struct;
arch/sparc/crypto/aes_glue.c+2−0
@@ -433,6 +433,7 @@ static struct crypto_alg algs[] = { { · 432 unmodified lines
433433 .blkcipher = {
434434 .min_keysize = AES_MIN_KEY_SIZE,
435435 .max_keysize = AES_MAX_KEY_SIZE,
436+ .ivsize = AES_BLOCK_SIZE,
436437 .setkey = aes_set_key,
437438 .encrypt = cbc_encrypt,
438439 .decrypt = cbc_decrypt,
@@ -452,6 +453,7 @@ static struct crypto_alg algs[] = { { · 13 unmodified lines
452453 .blkcipher = {
453454 .min_keysize = AES_MIN_KEY_SIZE,
454455 .max_keysize = AES_MAX_KEY_SIZE,
456+ .ivsize = AES_BLOCK_SIZE,
455457 .setkey = aes_set_key,
456458 .encrypt = ctr_crypt,
457459 .decrypt = ctr_crypt,
arch/sparc/crypto/camellia_glue.c+1−0
@@ -274,6 +274,7 @@ static struct crypto_alg algs[] = { { · 273 unmodified lines
274274 .blkcipher = {
275275 .min_keysize = CAMELLIA_MIN_KEY_SIZE,
276276 .max_keysize = CAMELLIA_MAX_KEY_SIZE,
277+ .ivsize = CAMELLIA_BLOCK_SIZE,
277278 .setkey = camellia_set_key,
278279 .encrypt = cbc_encrypt,
279280 .decrypt = cbc_decrypt,
arch/sparc/crypto/des_glue.c+2−0
@@ -429,6 +429,7 @@ static struct crypto_alg algs[] = { { · 428 unmodified lines
429429 .blkcipher = {
430430 .min_keysize = DES_KEY_SIZE,
431431 .max_keysize = DES_KEY_SIZE,
432+ .ivsize = DES_BLOCK_SIZE,
432433 .setkey = des_set_key,
433434 .encrypt = cbc_encrypt,
434435 .decrypt = cbc_decrypt,
@@ -485,6 +486,7 @@ static struct crypto_alg algs[] = { { · 50 unmodified lines
485486 .blkcipher = {
486487 .min_keysize = DES3_EDE_KEY_SIZE,
487488 .max_keysize = DES3_EDE_KEY_SIZE,
489+ .ivsize = DES3_EDE_BLOCK_SIZE,
488490 .setkey = des3_ede_set_key,
489491 .encrypt = cbc3_encrypt,
490492 .decrypt = cbc3_decrypt,
arch/um/Makefile+2−2
@@ -70,8 +70,8 @@ KBUILD_AFLAGS += $(ARCH_INCLUDE) · 69 unmodified lines
7070
7171 USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \
7272 $(ARCH_INCLUDE) $(MODE_INCLUDE) $(filter -I%,$(CFLAGS)) \
73− -D_FILE_OFFSET_BITS=64 -idirafter include \
74− -D__KERNEL__ -D__UM_HOST__
73+ -D_FILE_OFFSET_BITS=64 -idirafter $(srctree)/include \
74+ -idirafter $(obj)/include -D__KERNEL__ -D__UM_HOST__
7575
7676 #This will adjust *FLAGS accordingly to the platform.
7777 include $(ARCH_DIR)/Makefile-os-$(OS)
arch/um/kernel/trap.c+1−1
@@ -220,7 +220,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user, · 219 unmodified lines
220220 show_regs(container_of(regs, struct pt_regs, regs));
221221 panic("Segfault with no mm");
222222 }
223− else if (!is_user && address < TASK_SIZE) {
223+ else if (!is_user && address > PAGE_SIZE && address < TASK_SIZE) {
224224 show_regs(container_of(regs, struct pt_regs, regs));
225225 panic("Kernel tried to access user memory at addr 0x%lx, ip 0x%lx",
226226 address, ip);
arch/um/os-Linux/helper.c+3−3
@@ -96,7 +96,7 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv) · 95 unmodified lines
9696 "ret = %d\n", -n);
9797 ret = n;
9898 }
99− CATCH_EINTR(waitpid(pid, NULL, __WCLONE));
99+ CATCH_EINTR(waitpid(pid, NULL, __WALL));
100100 }
101101
102102 out_free2:
@@ -129,7 +129,7 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags, · 26 unmodified lines
129129 return err;
130130 }
131131 if (stack_out == NULL) {
132− CATCH_EINTR(pid = waitpid(pid, &status, __WCLONE));
132+ CATCH_EINTR(pid = waitpid(pid, &status, __WALL));
133133 if (pid < 0) {
134134 err = -errno;
135135 printk(UM_KERN_ERR "run_helper_thread - wait failed, "
@@ -148,7 +148,7 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags, · 12 unmodified lines
148148 int helper_wait(int pid)
149149 {
150150 int ret, status;
151− int wflags = __WCLONE;
151+ int wflags = __WALL;
152152
153153 CATCH_EINTR(ret = waitpid(pid, &status, wflags));
154154 if (ret < 0) {
arch/x86/boot/compressed/eboot.c+6−2
@@ -667,6 +667,7 @@ setup_gop32(struct screen_info *si, efi_guid_t *proto, · 666 unmodified lines
667667 bool conout_found = false;
668668 void *dummy = NULL;
669669 u32 h = handles[i];
670+ u32 current_fb_base;
670671
671672 status = efi_call_early(handle_protocol, h,
672673 proto, (void **)&gop32);
@@ -678,7 +679,7 @@ setup_gop32(struct screen_info *si, efi_guid_t *proto, · 5 unmodified lines
678679 if (status == EFI_SUCCESS)
679680 conout_found = true;
680681
681− status = __gop_query32(gop32, &info, &size, &fb_base);
682+ status = __gop_query32(gop32, &info, &size, &current_fb_base);
682683 if (status == EFI_SUCCESS && (!first_gop || conout_found)) {
683684 /*
684685 * Systems that use the UEFI Console Splitter may
@@ -692,6 +693,7 @@ setup_gop32(struct screen_info *si, efi_guid_t *proto, · 7 unmodified lines
692693 pixel_format = info->pixel_format;
693694 pixel_info = info->pixel_information;
694695 pixels_per_scan_line = info->pixels_per_scan_line;
696+ fb_base = current_fb_base;
695697
696698 /*
697699 * Once we've found a GOP supporting ConOut,
@@ -770,6 +772,7 @@ setup_gop64(struct screen_info *si, efi_guid_t *proto, · 72 unmodified lines
770772 bool conout_found = false;
771773 void *dummy = NULL;
772774 u64 h = handles[i];
775+ u32 current_fb_base;
773776
774777 status = efi_call_early(handle_protocol, h,
775778 proto, (void **)&gop64);
@@ -781,7 +784,7 @@ setup_gop64(struct screen_info *si, efi_guid_t *proto, · 5 unmodified lines
781784 if (status == EFI_SUCCESS)
782785 conout_found = true;
783786
784− status = __gop_query64(gop64, &info, &size, &fb_base);
787+ status = __gop_query64(gop64, &info, &size, &current_fb_base);
785788 if (status == EFI_SUCCESS && (!first_gop || conout_found)) {
786789 /*
787790 * Systems that use the UEFI Console Splitter may
@@ -795,6 +798,7 @@ setup_gop64(struct screen_info *si, efi_guid_t *proto, · 7 unmodified lines
795798 pixel_format = info->pixel_format;
796799 pixel_info = info->pixel_information;
797800 pixels_per_scan_line = info->pixels_per_scan_line;
801+ fb_base = current_fb_base;
798802
799803 /*
800804 * Once we've found a GOP supporting ConOut,
arch/x86/crypto/camellia_aesni_avx_glue.c+5−0
@@ -554,6 +554,11 @@ static int __init camellia_aesni_init(void) · 553 unmodified lines
554554 {
555555 const char *feature_name;
556556
557+ if (!cpu_has_avx || !cpu_has_aes || !cpu_has_osxsave) {
558+ pr_info("AVX or AES-NI instructions are not detected.\n");
559+ return -ENODEV;
560+ }
561+
557562 if (!cpu_has_xfeatures(XSTATE_SSE | XSTATE_YMM, &feature_name)) {
558563 pr_info("CPU feature '%s' is not supported.\n", feature_name);
559564 return -ENODEV;
arch/x86/include/asm/kvm_host.h+2−4
@@ -1226,10 +1226,8 @@ void kvm_complete_insn_gp(struct kvm_vcpu *vcpu, int err); · 1225 unmodified lines
12261226
12271227 int kvm_is_in_guest(void);
12281228
1229−int __x86_set_memory_region(struct kvm *kvm,
1230− const struct kvm_userspace_memory_region *mem);
1231−int x86_set_memory_region(struct kvm *kvm,
1232− const struct kvm_userspace_memory_region *mem);
1229+int __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 size);
1230+int x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 size);
12331231 bool kvm_vcpu_is_reset_bsp(struct kvm_vcpu *vcpu);
12341232 bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu);
12351233
arch/x86/include/asm/string_64.h+2−3
@@ -27,12 +27,11 @@ static __always_inline void *__inline_memcpy(void *to, const void *from, size_t · 26 unmodified lines
2727 function. */
2828
2929 #define __HAVE_ARCH_MEMCPY 1
30+extern void *memcpy(void *to, const void *from, size_t len);
3031 extern void *__memcpy(void *to, const void *from, size_t len);
3132
3233 #ifndef CONFIG_KMEMCHECK
33−#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4
34−extern void *memcpy(void *to, const void *from, size_t len);
35−#else
34+#if (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || __GNUC__ < 4
3635 #define memcpy(dst, src, len) \
3736 ({ \
3837 size_t __len = (len); \
arch/x86/kernel/apic/io_apic.c+4−0
@@ -2907,6 +2907,7 @@ int mp_irqdomain_alloc(struct irq_domain *domain, unsigned int virq, · 2906 unmodified lines
29072907 struct irq_data *irq_data;
29082908 struct mp_chip_data *data;
29092909 struct irq_alloc_info *info = arg;
2910+ unsigned long flags;
29102911
29112912 if (!info || nr_irqs > 1)
29122913 return -EINVAL;
@@ -2939,11 +2940,14 @@ int mp_irqdomain_alloc(struct irq_domain *domain, unsigned int virq, · 26 unmodified lines
29392940
29402941 cfg = irqd_cfg(irq_data);
29412942 add_pin_to_irq_node(data, ioapic_alloc_attr_node(info), ioapic, pin);
2943+
2944+ local_irq_save(flags);
29422945 if (info->ioapic_entry)
29432946 mp_setup_entry(cfg, data, info->ioapic_entry);
29442947 mp_register_handler(virq, data->trigger);
29452948 if (virq < nr_legacy_irqs())
29462949 legacy_pic->mask(virq);
2950+ local_irq_restore(flags);
29472951
29482952 apic_printk(APIC_VERBOSE, KERN_DEBUG
29492953 "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> IRQ %d Mode:%i Active:%i Dest:%d)\n",
arch/x86/kernel/process.c+3−3
@@ -550,14 +550,14 @@ unsigned long get_wchan(struct task_struct *p) · 549 unmodified lines
550550 if (sp < bottom || sp > top)
551551 return 0;
552552
553− fp = READ_ONCE(*(unsigned long *)sp);
553+ fp = READ_ONCE_NOCHECK(*(unsigned long *)sp);
554554 do {
555555 if (fp < bottom || fp > top)
556556 return 0;
557− ip = READ_ONCE(*(unsigned long *)(fp + sizeof(unsigned long)));
557+ ip = READ_ONCE_NOCHECK(*(unsigned long *)(fp + sizeof(unsigned long)));
558558 if (!in_sched_functions(ip))
559559 return ip;
560− fp = READ_ONCE(*(unsigned long *)fp);
560+ fp = READ_ONCE_NOCHECK(*(unsigned long *)fp);
561561 } while (count++ < 16 && p->state != TASK_RUNNING);
562562 return 0;
563563 }
arch/x86/kernel/setup.c+8−0
@@ -1173,6 +1173,14 @@ void __init setup_arch(char **cmdline_p) · 1172 unmodified lines
11731173 clone_pgd_range(initial_page_table + KERNEL_PGD_BOUNDARY,
11741174 swapper_pg_dir + KERNEL_PGD_BOUNDARY,
11751175 KERNEL_PGD_PTRS);
1176+
1177+ /*
1178+ * sync back low identity map too. It is used for example
1179+ * in the 32-bit EFI stub.
1180+ */
1181+ clone_pgd_range(initial_page_table,
1182+ swapper_pg_dir + KERNEL_PGD_BOUNDARY,
1183+ KERNEL_PGD_PTRS);
11761184 #endif
11771185
11781186 tboot_probe();
arch/x86/kernel/smpboot.c+11−4
@@ -509,7 +509,7 @@ void __inquire_remote_apic(int apicid) · 508 unmodified lines
509509 */
510510 #define UDELAY_10MS_DEFAULT 10000
511511
512−static unsigned int init_udelay = UDELAY_10MS_DEFAULT;
512+static unsigned int init_udelay = INT_MAX;
513513
514514 static int __init cpu_init_udelay(char *str)
515515 {
@@ -522,13 +522,16 @@ early_param("cpu_init_udelay", cpu_init_udelay); · 6 unmodified lines
522522 static void __init smp_quirk_init_udelay(void)
523523 {
524524 /* if cmdline changed it from default, leave it alone */
525− if (init_udelay != UDELAY_10MS_DEFAULT)
525+ if (init_udelay != INT_MAX)
526526 return;
527527
528528 /* if modern processor, use no delay */
529529 if (((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && (boot_cpu_data.x86 == 6)) ||
530530 ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && (boot_cpu_data.x86 >= 0xF)))
531531 init_udelay = 0;
532+
533+ /* else, use legacy delay */
534+ init_udelay = UDELAY_10MS_DEFAULT;
532535 }
533536
534537 /*
@@ -657,7 +660,9 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip) · 122 unmodified lines
657660 /*
658661 * Give the other CPU some time to accept the IPI.
659662 */
660− if (init_udelay)
663+ if (init_udelay == 0)
664+ udelay(10);
665+ else
661666 udelay(300);
662667
663668 pr_debug("Startup point 1\n");
@@ -668,7 +673,9 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip) · 4 unmodified lines
668673 /*
669674 * Give the other CPU some time to accept the IPI.
670675 */
671− if (init_udelay)
676+ if (init_udelay == 0)
677+ udelay(10);
678+ else
672679 udelay(200);
673680
674681 if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */
arch/x86/kvm/emulate.c+7−3
@@ -2418,7 +2418,7 @@ static int rsm_load_state_64(struct x86_emulate_ctxt *ctxt, u64 smbase) · 2417 unmodified lines
24182418 u64 val, cr0, cr4;
24192419 u32 base3;
24202420 u16 selector;
2421− int i;
2421+ int i, r;
24222422
24232423 for (i = 0; i < 16; i++)
24242424 *reg_write(ctxt, i) = GET_SMSTATE(u64, smbase, 0x7ff8 - i * 8);
@@ -2460,13 +2460,17 @@ static int rsm_load_state_64(struct x86_emulate_ctxt *ctxt, u64 smbase) · 35 unmodified lines
24602460 dt.address = GET_SMSTATE(u64, smbase, 0x7e68);
24612461 ctxt->ops->set_gdt(ctxt, &dt);
24622462
2463+ r = rsm_enter_protected_mode(ctxt, cr0, cr4);
2464+ if (r != X86EMUL_CONTINUE)
2465+ return r;
2466+
24632467 for (i = 0; i < 6; i++) {
2464− int r = rsm_load_seg_64(ctxt, smbase, i);
2468+ r = rsm_load_seg_64(ctxt, smbase, i);
24652469 if (r != X86EMUL_CONTINUE)
24662470 return r;
24672471 }
24682472
2469− return rsm_enter_protected_mode(ctxt, cr0, cr4);
2473+ return X86EMUL_CONTINUE;
24702474 }
24712475
24722476 static int em_rsm(struct x86_emulate_ctxt *ctxt)
arch/x86/kvm/vmx.c+6−20
@@ -4105,17 +4105,13 @@ static void seg_setup(int seg) · 4104 unmodified lines
41054105 static int alloc_apic_access_page(struct kvm *kvm)
41064106 {
41074107 struct page *page;
4108− struct kvm_userspace_memory_region kvm_userspace_mem;
41094108 int r = 0;
41104109
41114110 mutex_lock(&kvm->slots_lock);
41124111 if (kvm->arch.apic_access_page_done)
41134112 goto out;
4114− kvm_userspace_mem.slot = APIC_ACCESS_PAGE_PRIVATE_MEMSLOT;
4115− kvm_userspace_mem.flags = 0;
4116− kvm_userspace_mem.guest_phys_addr = APIC_DEFAULT_PHYS_BASE;
4117− kvm_userspace_mem.memory_size = PAGE_SIZE;
4118− r = __x86_set_memory_region(kvm, &kvm_userspace_mem);
4113+ r = __x86_set_memory_region(kvm, APIC_ACCESS_PAGE_PRIVATE_MEMSLOT,
4114+ APIC_DEFAULT_PHYS_BASE, PAGE_SIZE);
41194115 if (r)
41204116 goto out;
41214117
@@ -4140,17 +4136,12 @@ static int alloc_identity_pagetable(struct kvm *kvm) · 18 unmodified lines
41404136 {
41414137 /* Called with kvm->slots_lock held. */
41424138
4143− struct kvm_userspace_memory_region kvm_userspace_mem;
41444139 int r = 0;
41454140
41464141 BUG_ON(kvm->arch.ept_identity_pagetable_done);
41474142
4148− kvm_userspace_mem.slot = IDENTITY_PAGETABLE_PRIVATE_MEMSLOT;
4149− kvm_userspace_mem.flags = 0;
4150− kvm_userspace_mem.guest_phys_addr =
4151− kvm->arch.ept_identity_map_addr;
4152− kvm_userspace_mem.memory_size = PAGE_SIZE;
4153− r = __x86_set_memory_region(kvm, &kvm_userspace_mem);
4143+ r = __x86_set_memory_region(kvm, IDENTITY_PAGETABLE_PRIVATE_MEMSLOT,
4144+ kvm->arch.ept_identity_map_addr, PAGE_SIZE);
41544145
41554146 return r;
41564147 }
@@ -4949,14 +4940,9 @@ static int vmx_interrupt_allowed(struct kvm_vcpu *vcpu) · 792 unmodified lines
49494940 static int vmx_set_tss_addr(struct kvm *kvm, unsigned int addr)
49504941 {
49514942 int ret;
4952− struct kvm_userspace_memory_region tss_mem = {
4953− .slot = TSS_PRIVATE_MEMSLOT,
4954− .guest_phys_addr = addr,
4955− .memory_size = PAGE_SIZE * 3,
4956− .flags = 0,
4957− };
49584943
4959− ret = x86_set_memory_region(kvm, &tss_mem);
4944+ ret = x86_set_memory_region(kvm, TSS_PRIVATE_MEMSLOT, addr,
4945+ PAGE_SIZE * 3);
49604946 if (ret)
49614947 return ret;
49624948 kvm->arch.tss_addr = addr;
arch/x86/kvm/x86.c+75−60
@@ -6453,6 +6453,12 @@ static inline int vcpu_block(struct kvm *kvm, struct kvm_vcpu *vcpu) · 6452 unmodified lines
64536453 return 1;
64546454 }
64556455
6456+static inline bool kvm_vcpu_running(struct kvm_vcpu *vcpu)
6457+{
6458+ return (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE &&
6459+ !vcpu->arch.apf.halted);
6460+}
6461+
64566462 static int vcpu_run(struct kvm_vcpu *vcpu)
64576463 {
64586464 int r;
@@ -6461,8 +6467,7 @@ static int vcpu_run(struct kvm_vcpu *vcpu) · 2 unmodified lines
64616467 vcpu->srcu_idx = srcu_read_lock(&kvm->srcu);
64626468
64636469 for (;;) {
6464− if (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE &&
6465− !vcpu->arch.apf.halted)
6470+ if (kvm_vcpu_running(vcpu))
64666471 r = vcpu_enter_guest(vcpu);
64676472 else
64686473 r = vcpu_block(kvm, vcpu);
@@ -7474,34 +7479,66 @@ void kvm_arch_sync_events(struct kvm *kvm) · 1005 unmodified lines
74747479 kvm_free_pit(kvm);
74757480 }
74767481
7477−int __x86_set_memory_region(struct kvm *kvm,
7478− const struct kvm_userspace_memory_region *mem)
7482+int __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 size)
74797483 {
74807484 int i, r;
7485+ unsigned long hva;
7486+ struct kvm_memslots *slots = kvm_memslots(kvm);
7487+ struct kvm_memory_slot *slot, old;
74817488
74827489 /* Called with kvm->slots_lock held. */
7483− BUG_ON(mem->slot >= KVM_MEM_SLOTS_NUM);
7490+ if (WARN_ON(id >= KVM_MEM_SLOTS_NUM))
7491+ return -EINVAL;
7492+
7493+ slot = id_to_memslot(slots, id);
7494+ if (size) {
7495+ if (WARN_ON(slot->npages))
7496+ return -EEXIST;
7497+
7498+ /*
7499+ * MAP_SHARED to prevent internal slot pages from being moved
7500+ * by fork()/COW.
7501+ */
7502+ hva = vm_mmap(NULL, 0, size, PROT_READ | PROT_WRITE,
7503+ MAP_SHARED | MAP_ANONYMOUS, 0);
7504+ if (IS_ERR((void *)hva))
7505+ return PTR_ERR((void *)hva);
7506+ } else {
7507+ if (!slot->npages)
7508+ return 0;
74847509
7510+ hva = 0;
7511+ }
7512+
7513+ old = *slot;
74857514 for (i = 0; i < KVM_ADDRESS_SPACE_NUM; i++) {
7486− struct kvm_userspace_memory_region m = *mem;
7515+ struct kvm_userspace_memory_region m;
74877516
7488− m.slot |= i << 16;
7517+ m.slot = id | (i << 16);
7518+ m.flags = 0;
7519+ m.guest_phys_addr = gpa;
7520+ m.userspace_addr = hva;
7521+ m.memory_size = size;
74897522 r = __kvm_set_memory_region(kvm, &m);
74907523 if (r < 0)
74917524 return r;
74927525 }
74937526
7527+ if (!size) {
7528+ r = vm_munmap(old.userspace_addr, old.npages * PAGE_SIZE);
7529+ WARN_ON(r < 0);
7530+ }
7531+
74947532 return 0;
74957533 }
74967534 EXPORT_SYMBOL_GPL(__x86_set_memory_region);
74977535
7498−int x86_set_memory_region(struct kvm *kvm,
7499− const struct kvm_userspace_memory_region *mem)
7536+int x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 size)
75007537 {
75017538 int r;
75027539
75037540 mutex_lock(&kvm->slots_lock);
7504− r = __x86_set_memory_region(kvm, mem);
7541+ r = __x86_set_memory_region(kvm, id, gpa, size);
75057542 mutex_unlock(&kvm->slots_lock);
75067543
75077544 return r;
@@ -7516,16 +7553,9 @@ void kvm_arch_destroy_vm(struct kvm *kvm) · 8 unmodified lines
75167553 * unless the the memory map has changed due to process exit
75177554 * or fd copying.
75187555 */
7519− struct kvm_userspace_memory_region mem;
7520− memset(&mem, 0, sizeof(mem));
7521− mem.slot = APIC_ACCESS_PAGE_PRIVATE_MEMSLOT;
7522− x86_set_memory_region(kvm, &mem);
7523−
7524− mem.slot = IDENTITY_PAGETABLE_PRIVATE_MEMSLOT;
7525− x86_set_memory_region(kvm, &mem);
7526−
7527− mem.slot = TSS_PRIVATE_MEMSLOT;
7528− x86_set_memory_region(kvm, &mem);
7556+ x86_set_memory_region(kvm, APIC_ACCESS_PAGE_PRIVATE_MEMSLOT, 0, 0);
7557+ x86_set_memory_region(kvm, IDENTITY_PAGETABLE_PRIVATE_MEMSLOT, 0, 0);
7558+ x86_set_memory_region(kvm, TSS_PRIVATE_MEMSLOT, 0, 0);
75297559 }
75307560 kvm_iommu_unmap_guest(kvm);
75317561 kfree(kvm->arch.vpic);
@@ -7628,27 +7658,6 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, · 96 unmodified lines
76287658 const struct kvm_userspace_memory_region *mem,
76297659 enum kvm_mr_change change)
76307660 {
7631− /*
7632− * Only private memory slots need to be mapped here since
7633− * KVM_SET_MEMORY_REGION ioctl is no longer supported.
7634− */
7635− if ((memslot->id >= KVM_USER_MEM_SLOTS) && (change == KVM_MR_CREATE)) {
7636− unsigned long userspace_addr;
7637−
7638− /*
7639− * MAP_SHARED to prevent internal slot pages from being moved
7640− * by fork()/COW.
7641− */
7642− userspace_addr = vm_mmap(NULL, 0, memslot->npages * PAGE_SIZE,
7643− PROT_READ | PROT_WRITE,
7644− MAP_SHARED | MAP_ANONYMOUS, 0);
7645−
7646− if (IS_ERR((void *)userspace_addr))
7647− return PTR_ERR((void *)userspace_addr);
7648−
7649− memslot->userspace_addr = userspace_addr;
7650− }
7651−
76527661 return 0;
76537662 }
76547663
@@ -7710,17 +7719,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm, · 55 unmodified lines
77107719 {
77117720 int nr_mmu_pages = 0;
77127721
7713− if (change == KVM_MR_DELETE && old->id >= KVM_USER_MEM_SLOTS) {
7714− int ret;
7715−
7716− ret = vm_munmap(old->userspace_addr,
7717− old->npages * PAGE_SIZE);
7718− if (ret < 0)
7719− printk(KERN_WARNING
7720− "kvm_vm_ioctl_set_memory_region: "
7721− "failed to munmap memory\n");
7722− }
7723−
77247722 if (!kvm->arch.n_requested_mmu_pages)
77257723 nr_mmu_pages = kvm_mmu_calculate_mmu_pages(kvm);
77267724
@@ -7769,19 +7767,36 @@ void kvm_arch_flush_shadow_memslot(struct kvm *kvm, · 42 unmodified lines
77697767 kvm_mmu_invalidate_zap_all_pages(kvm);
77707768 }
77717769
7770+static inline bool kvm_vcpu_has_events(struct kvm_vcpu *vcpu)
7771+{
7772+ if (!list_empty_careful(&vcpu->async_pf.done))
7773+ return true;
7774+
7775+ if (kvm_apic_has_events(vcpu))
7776+ return true;
7777+
7778+ if (vcpu->arch.pv.pv_unhalted)
7779+ return true;
7780+
7781+ if (atomic_read(&vcpu->arch.nmi_queued))
7782+ return true;
7783+
7784+ if (test_bit(KVM_REQ_SMI, &vcpu->requests))
7785+ return true;
7786+
7787+ if (kvm_arch_interrupt_allowed(vcpu) &&
7788+ kvm_cpu_has_interrupt(vcpu))
7789+ return true;
7790+
7791+ return false;
7792+}
7793+
77727794 int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
77737795 {
77747796 if (is_guest_mode(vcpu) && kvm_x86_ops->check_nested_events)
77757797 kvm_x86_ops->check_nested_events(vcpu, false);
77767798
7777− return (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE &&
7778− !vcpu->arch.apf.halted)
7779− || !list_empty_careful(&vcpu->async_pf.done)
7780− || kvm_apic_has_events(vcpu)
7781− || vcpu->arch.pv.pv_unhalted
7782− || atomic_read(&vcpu->arch.nmi_queued) ||
7783− (kvm_arch_interrupt_allowed(vcpu) &&
7784− kvm_cpu_has_interrupt(vcpu));
7799+ return kvm_vcpu_running(vcpu) || kvm_vcpu_has_events(vcpu);
77857800 }
77867801
77877802 int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu)
arch/x86/um/ldt.c+4−1
@@ -12,7 +12,10 @@ · 11 unmodified lines
1212 #include <skas.h>
1313 #include <sysdep/tls.h>
1414
15−extern int modify_ldt(int func, void *ptr, unsigned long bytecount);
15+static inline int modify_ldt (int func, void *ptr, unsigned long bytecount)
16+{
17+ return syscall(__NR_modify_ldt, func, ptr, bytecount);
18+}
1619
1720 static long write_ldt_entry(struct mm_id *mm_idp, int func,
1821 struct user_desc *desc, void **addr, int done)
block/blk-core.c+1−1
@@ -576,7 +576,7 @@ void blk_cleanup_queue(struct request_queue *q) · 575 unmodified lines
576576 q->queue_lock = &q->__queue_lock;
577577 spin_unlock_irq(lock);
578578
579− bdi_destroy(&q->backing_dev_info);
579+ bdi_unregister(&q->backing_dev_info);
580580
581581 /* @q is and will stay empty, shutdown and put */
582582 blk_put_queue(q);
block/blk-mq-tag.c+1−0
@@ -641,6 +641,7 @@ void blk_mq_free_tags(struct blk_mq_tags *tags) · 640 unmodified lines
641641 {
642642 bt_free(&tags->bitmap_tags);
643643 bt_free(&tags->breserved_tags);
644+ free_cpumask_var(tags->cpumask);
644645 kfree(tags);
645646 }
646647
block/blk-mq.c+1−3
@@ -2296,10 +2296,8 @@ void blk_mq_free_tag_set(struct blk_mq_tag_set *set) · 2295 unmodified lines
22962296 int i;
22972297
22982298 for (i = 0; i < set->nr_hw_queues; i++) {
2299− if (set->tags[i]) {
2299+ if (set->tags[i])
23002300 blk_mq_free_rq_map(set, set->tags[i], i);
2301− free_cpumask_var(set->tags[i]->cpumask);
2302− }
23032301 }
23042302
23052303 kfree(set->tags);
block/blk-sysfs.c+1−0
@@ -540,6 +540,7 @@ static void blk_release_queue(struct kobject *kobj) · 539 unmodified lines
540540 struct request_queue *q =
541541 container_of(kobj, struct request_queue, kobj);
542542
543+ bdi_exit(&q->backing_dev_info);
543544 blkcg_exit_queue(q);
544545
545546 if (q->elevator) {
crypto/ahash.c+2−1
@@ -544,7 +544,8 @@ static int ahash_prepare_alg(struct ahash_alg *alg) · 543 unmodified lines
544544 struct crypto_alg *base = &alg->halg.base;
545545
546546 if (alg->halg.digestsize > PAGE_SIZE / 8 ||
547− alg->halg.statesize > PAGE_SIZE / 8)
547+ alg->halg.statesize > PAGE_SIZE / 8 ||
548+ alg->halg.statesize == 0)
548549 return -EINVAL;
549550
550551 base->cra_type = &crypto_ahash_type;
drivers/acpi/acpica/acglobal.h+1−0
@@ -61,6 +61,7 @@ ACPI_GLOBAL(struct acpi_table_header, acpi_gbl_original_dsdt_header); · 60 unmodified lines
6161 ACPI_INIT_GLOBAL(u32, acpi_gbl_dsdt_index, ACPI_INVALID_TABLE_INDEX);
6262 ACPI_INIT_GLOBAL(u32, acpi_gbl_facs_index, ACPI_INVALID_TABLE_INDEX);
6363 ACPI_INIT_GLOBAL(u32, acpi_gbl_xfacs_index, ACPI_INVALID_TABLE_INDEX);
64+ACPI_INIT_GLOBAL(u32, acpi_gbl_fadt_index, ACPI_INVALID_TABLE_INDEX);
6465
6566 #if (!ACPI_REDUCED_HARDWARE)
6667 ACPI_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS);
drivers/acpi/acpica/actables.h+1−3
@@ -85,7 +85,7 @@ void acpi_tb_set_table_loaded_flag(u32 table_index, u8 is_loaded); · 84 unmodified lines
8585 /*
8686 * tbfadt - FADT parse/convert/validate
8787 */
88−void acpi_tb_parse_fadt(u32 table_index);
88+void acpi_tb_parse_fadt(void);
8989
9090 void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length);
9191
@@ -138,8 +138,6 @@ acpi_status acpi_tb_get_owner_id(u32 table_index, acpi_owner_id *owner_id); · 46 unmodified lines
138138 */
139139 acpi_status acpi_tb_initialize_facs(void);
140140
141−u8 acpi_tb_tables_loaded(void);
142−
143141 void
144142 acpi_tb_print_table_header(acpi_physical_address address,
145143 struct acpi_table_header *header);
drivers/acpi/acpica/evxfevnt.c+1−1
@@ -71,7 +71,7 @@ acpi_status acpi_enable(void) · 70 unmodified lines
7171
7272 /* ACPI tables must be present */
7373
74− if (!acpi_tb_tables_loaded()) {
74+ if (acpi_gbl_fadt_index == ACPI_INVALID_TABLE_INDEX) {
7575 return_ACPI_STATUS(AE_NO_ACPI_TABLES);
7676 }
7777
drivers/acpi/acpica/tbfadt.c+5−5
@@ -298,7 +298,7 @@ acpi_tb_select_address(char *register_name, u32 address32, u64 address64) · 297 unmodified lines
298298 *
299299 * FUNCTION: acpi_tb_parse_fadt
300300 *
301− * PARAMETERS: table_index - Index for the FADT
301+ * PARAMETERS: None
302302 *
303303 * RETURN: None
304304 *
@@ -307,7 +307,7 @@ acpi_tb_select_address(char *register_name, u32 address32, u64 address64) · 2 unmodified lines
307307 *
308308 ******************************************************************************/
309309
310−void acpi_tb_parse_fadt(u32 table_index)
310+void acpi_tb_parse_fadt(void)
311311 {
312312 u32 length;
313313 struct acpi_table_header *table;
@@ -319,11 +319,11 @@ void acpi_tb_parse_fadt(u32 table_index) · 5 unmodified lines
319319 * Get a local copy of the FADT and convert it to a common format
320320 * Map entire FADT, assumed to be smaller than one page.
321321 */
322− length = acpi_gbl_root_table_list.tables[table_index].length;
322+ length = acpi_gbl_root_table_list.tables[acpi_gbl_fadt_index].length;
323323
324324 table =
325− acpi_os_map_memory(acpi_gbl_root_table_list.tables[table_index].
326− address, length);
325+ acpi_os_map_memory(acpi_gbl_root_table_list.
326+ tables[acpi_gbl_fadt_index].address, length);
327327 if (!table) {
328328 return;
329329 }
drivers/acpi/acpica/tbutils.c+2−24
@@ -97,29 +97,6 @@ acpi_status acpi_tb_initialize_facs(void) · 96 unmodified lines
9797 }
9898 #endif /* !ACPI_REDUCED_HARDWARE */
9999
100−/*******************************************************************************
101− *
102− * FUNCTION: acpi_tb_tables_loaded
103− *
104− * PARAMETERS: None
105− *
106− * RETURN: TRUE if required ACPI tables are loaded
107− *
108− * DESCRIPTION: Determine if the minimum required ACPI tables are present
109− * (FADT, FACS, DSDT)
110− *
111− ******************************************************************************/
112−
113−u8 acpi_tb_tables_loaded(void)
114−{
115−
116− if (acpi_gbl_root_table_list.current_table_count >= 4) {
117− return (TRUE);
118− }
119−
120− return (FALSE);
121−}
122−
123100 /*******************************************************************************
124101 *
125102 * FUNCTION: acpi_tb_check_dsdt_header
@@ -392,7 +369,8 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) · 266 unmodified lines
392369 ACPI_COMPARE_NAME(&acpi_gbl_root_table_list.
393370 tables[table_index].signature,
394371 ACPI_SIG_FADT)) {
395− acpi_tb_parse_fadt(table_index);
372+ acpi_gbl_fadt_index = table_index;
373+ acpi_tb_parse_fadt();
396374 }
397375
398376 next_table:
drivers/base/dma-contiguous.c+1−1
@@ -187,7 +187,7 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base, · 186 unmodified lines
187187 * global one. Requires architecture specific dev_get_cma_area() helper
188188 * function.
189189 */
190−struct page *dma_alloc_from_contiguous(struct device *dev, int count,
190+struct page *dma_alloc_from_contiguous(struct device *dev, size_t count,
191191 unsigned int align)
192192 {
193193 if (align > CONFIG_CMA_ALIGNMENT)
drivers/base/power/domain_governor.c+6−16
@@ -77,13 +77,16 @@ static bool default_stop_ok(struct device *dev) · 76 unmodified lines
7777 dev_update_qos_constraint);
7878
7979 if (constraint_ns > 0) {
80− constraint_ns -= td->start_latency_ns;
80+ constraint_ns -= td->save_state_latency_ns +
81+ td->stop_latency_ns +
82+ td->start_latency_ns +
83+ td->restore_state_latency_ns;
8184 if (constraint_ns == 0)
8285 return false;
8386 }
8487 td->effective_constraint_ns = constraint_ns;
85− td->cached_stop_ok = constraint_ns > td->stop_latency_ns ||
86− constraint_ns == 0;
88+ td->cached_stop_ok = constraint_ns >= 0;
89+
8790 /*
8891 * The children have been suspended already, so we don't need to take
8992 * their stop latencies into account here.
@@ -126,18 +129,6 @@ static bool default_power_down_ok(struct dev_pm_domain *pd) · 36 unmodified lines
126129
127130 off_on_time_ns = genpd->power_off_latency_ns +
128131 genpd->power_on_latency_ns;
129− /*
130− * It doesn't make sense to remove power from the domain if saving
131− * the state of all devices in it and the power off/power on operations
132− * take too much time.
133− *
134− * All devices in this domain have been stopped already at this point.
135− */
136− list_for_each_entry(pdd, &genpd->dev_list, list_node) {
137− if (pdd->dev->driver)
138− off_on_time_ns +=
139− to_gpd_data(pdd)->td.save_state_latency_ns;
140− }
141132
142133 min_off_time_ns = -1;
143134 /*
@@ -193,7 +184,6 @@ static bool default_power_down_ok(struct dev_pm_domain *pd) · 49 unmodified lines
193184 * constraint_ns cannot be negative here, because the device has
194185 * been suspended.
195186 */
196− constraint_ns -= td->restore_state_latency_ns;
197187 if (constraint_ns <= off_on_time_ns)
198188 return false;
199189
drivers/block/nbd.c+30−6
@@ -60,6 +60,7 @@ struct nbd_device { · 59 unmodified lines
6060 bool disconnect; /* a disconnect has been requested by user */
6161
6262 struct timer_list timeout_timer;
63+ spinlock_t tasks_lock;
6364 struct task_struct *task_recv;
6465 struct task_struct *task_send;
6566
@@ -140,21 +141,23 @@ static void sock_shutdown(struct nbd_device *nbd) · 74 unmodified lines
140141 static void nbd_xmit_timeout(unsigned long arg)
141142 {
142143 struct nbd_device *nbd = (struct nbd_device *)arg;
143− struct task_struct *task;
144+ unsigned long flags;
144145
145146 if (list_empty(&nbd->queue_head))
146147 return;
147148
148149 nbd->disconnect = true;
149150
150− task = READ_ONCE(nbd->task_recv);
151− if (task)
152− force_sig(SIGKILL, task);
151+ spin_lock_irqsave(&nbd->tasks_lock, flags);
152+
153+ if (nbd->task_recv)
154+ force_sig(SIGKILL, nbd->task_recv);
153155
154− task = READ_ONCE(nbd->task_send);
155− if (task)
156+ if (nbd->task_send)
156157 force_sig(SIGKILL, nbd->task_send);
157158
159+ spin_unlock_irqrestore(&nbd->tasks_lock, flags);
160+
158161 dev_err(nbd_to_dev(nbd), "Connection timed out, killed receiver and sender, shutting down connection\n");
159162 }
160163
@@ -403,17 +406,24 @@ static int nbd_thread_recv(struct nbd_device *nbd) · 242 unmodified lines
403406 {
404407 struct request *req;
405408 int ret;
409+ unsigned long flags;
406410
407411 BUG_ON(nbd->magic != NBD_MAGIC);
408412
409413 sk_set_memalloc(nbd->sock->sk);
410414
415+ spin_lock_irqsave(&nbd->tasks_lock, flags);
411416 nbd->task_recv = current;
417+ spin_unlock_irqrestore(&nbd->tasks_lock, flags);
412418
413419 ret = device_create_file(disk_to_dev(nbd->disk), &pid_attr);
414420 if (ret) {
415421 dev_err(disk_to_dev(nbd->disk), "device_create_file failed!\n");
422+
423+ spin_lock_irqsave(&nbd->tasks_lock, flags);
416424 nbd->task_recv = NULL;
425+ spin_unlock_irqrestore(&nbd->tasks_lock, flags);
426+
417427 return ret;
418428 }
419429
@@ -429,7 +439,9 @@ static int nbd_thread_recv(struct nbd_device *nbd) · 9 unmodified lines
429439
430440 device_remove_file(disk_to_dev(nbd->disk), &pid_attr);
431441
442+ spin_lock_irqsave(&nbd->tasks_lock, flags);
432443 nbd->task_recv = NULL;
444+ spin_unlock_irqrestore(&nbd->tasks_lock, flags);
433445
434446 if (signal_pending(current)) {
435447 siginfo_t info;
@@ -534,8 +546,11 @@ static int nbd_thread_send(void *data) · 98 unmodified lines
534546 {
535547 struct nbd_device *nbd = data;
536548 struct request *req;
549+ unsigned long flags;
537550
551+ spin_lock_irqsave(&nbd->tasks_lock, flags);
538552 nbd->task_send = current;
553+ spin_unlock_irqrestore(&nbd->tasks_lock, flags);
539554
540555 set_user_nice(current, MIN_NICE);
541556 while (!kthread_should_stop() || !list_empty(&nbd->waiting_queue)) {
@@ -572,7 +587,15 @@ static int nbd_thread_send(void *data) · 30 unmodified lines
572587 nbd_handle_req(nbd, req);
573588 }
574589
590+ spin_lock_irqsave(&nbd->tasks_lock, flags);
575591 nbd->task_send = NULL;
592+ spin_unlock_irqrestore(&nbd->tasks_lock, flags);
593+
594+ /* Clear maybe pending signals */
595+ if (signal_pending(current)) {
596+ siginfo_t info;
597+ dequeue_signal_lock(current, &current->blocked, &info);
598+ }
576599
577600 return 0;
578601 }
@@ -1052,6 +1075,7 @@ static int __init nbd_init(void) · 473 unmodified lines
10521075 nbd_dev[i].magic = NBD_MAGIC;
10531076 INIT_LIST_HEAD(&nbd_dev[i].waiting_queue);
10541077 spin_lock_init(&nbd_dev[i].queue_lock);
1078+ spin_lock_init(&nbd_dev[i].tasks_lock);
10551079 INIT_LIST_HEAD(&nbd_dev[i].queue_head);
10561080 mutex_init(&nbd_dev[i].tx_lock);
10571081 init_timer(&nbd_dev[i].timeout_timer);
drivers/block/nvme-core.c+15−9
@@ -603,27 +603,31 @@ static void req_completion(struct nvme_queue *nvmeq, void *ctx, · 602 unmodified lines
603603 struct nvme_iod *iod = ctx;
604604 struct request *req = iod_get_private(iod);
605605 struct nvme_cmd_info *cmd_rq = blk_mq_rq_to_pdu(req);
606−
607606 u16 status = le16_to_cpup(&cqe->status) >> 1;
607+ bool requeue = false;
608+ int error = 0;
608609
609610 if (unlikely(status)) {
610611 if (!(status & NVME_SC_DNR || blk_noretry_request(req))
611612 && (jiffies - req->start_time) < req->timeout) {
612613 unsigned long flags;
613614
615+ requeue = true;
614616 blk_mq_requeue_request(req);
615617 spin_lock_irqsave(req->q->queue_lock, flags);
616618 if (!blk_queue_stopped(req->q))
617619 blk_mq_kick_requeue_list(req->q);
618620 spin_unlock_irqrestore(req->q->queue_lock, flags);
619− return;
621+ goto release_iod;
620622 }
621623
622624 if (req->cmd_type == REQ_TYPE_DRV_PRIV) {
623625 if (cmd_rq->ctx == CMD_CTX_CANCELLED)
624− status = -EINTR;
626+ error = -EINTR;
627+ else
628+ error = status;
625629 } else {
626− status = nvme_error_status(status);
630+ error = nvme_error_status(status);
627631 }
628632 }
629633
@@ -635,8 +639,9 @@ static void req_completion(struct nvme_queue *nvmeq, void *ctx, · 5 unmodified lines
635639 if (cmd_rq->aborted)
636640 dev_warn(nvmeq->dev->dev,
637641 "completing aborted command with status:%04x\n",
638− status);
642+ error);
639643
644+release_iod:
640645 if (iod->nents) {
641646 dma_unmap_sg(nvmeq->dev->dev, iod->sg, iod->nents,
642647 rq_data_dir(req) ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
@@ -649,7 +654,8 @@ static void req_completion(struct nvme_queue *nvmeq, void *ctx, · 6 unmodified lines
649654 }
650655 nvme_free_iod(nvmeq->dev, iod);
651656
652− blk_mq_complete_request(req, status);
657+ if (likely(!requeue))
658+ blk_mq_complete_request(req, error);
653659 }
654660
655661 /* length is in bytes. gfp flags indicates whether we may sleep. */
@@ -1804,7 +1810,7 @@ static int nvme_submit_io(struct nvme_ns *ns, struct nvme_user_io __user *uio) · 1148 unmodified lines
18041810
18051811 length = (io.nblocks + 1) << ns->lba_shift;
18061812 meta_len = (io.nblocks + 1) * ns->ms;
1807− metadata = (void __user *)(unsigned long)io.metadata;
1813+ metadata = (void __user *)(uintptr_t)io.metadata;
18081814 write = io.opcode & 1;
18091815
18101816 if (ns->ext) {
@@ -1844,7 +1850,7 @@ static int nvme_submit_io(struct nvme_ns *ns, struct nvme_user_io __user *uio) · 33 unmodified lines
18441850 c.rw.metadata = cpu_to_le64(meta_dma);
18451851
18461852 status = __nvme_submit_sync_cmd(ns->queue, &c, NULL,
1847− (void __user *)io.addr, length, NULL, 0);
1853+ (void __user *)(uintptr_t)io.addr, length, NULL, 0);
18481854 unmap:
18491855 if (meta) {
18501856 if (status == NVME_SC_SUCCESS && !write) {
@@ -1886,7 +1892,7 @@ static int nvme_user_cmd(struct nvme_dev *dev, struct nvme_ns *ns, · 35 unmodified lines
18861892 timeout = msecs_to_jiffies(cmd.timeout_ms);
18871893
18881894 status = __nvme_submit_sync_cmd(ns ? ns->queue : dev->admin_q, &c,
1889− NULL, (void __user *)cmd.addr, cmd.data_len,
1895+ NULL, (void __user *)(uintptr_t)cmd.addr, cmd.data_len,
18901896 &cmd.result, timeout);
18911897 if (status >= 0) {
18921898 if (put_user(cmd.result, &ucmd->result))
drivers/block/rbd.c+47−32
@@ -96,6 +96,8 @@ static int atomic_dec_return_safe(atomic_t *v) · 95 unmodified lines
9696 #define RBD_MINORS_PER_MAJOR 256
9797 #define RBD_SINGLE_MAJOR_PART_SHIFT 4
9898
99+#define RBD_MAX_PARENT_CHAIN_LEN 16
100+
99101 #define RBD_SNAP_DEV_NAME_PREFIX "snap_"
100102 #define RBD_MAX_SNAP_NAME_LEN \
101103 (NAME_MAX - (sizeof (RBD_SNAP_DEV_NAME_PREFIX) - 1))
@@ -426,7 +428,7 @@ static ssize_t rbd_add_single_major(struct bus_type *bus, const char *buf, · 324 unmodified lines
426428 size_t count);
427429 static ssize_t rbd_remove_single_major(struct bus_type *bus, const char *buf,
428430 size_t count);
429−static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping);
431+static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth);
430432 static void rbd_spec_put(struct rbd_spec *spec);
431433
432434 static int rbd_dev_id_to_minor(int dev_id)
@@ -1863,9 +1865,11 @@ static void rbd_osd_req_callback(struct ceph_osd_request *osd_req, · 1430 unmodified lines
18631865 rbd_osd_read_callback(obj_request);
18641866 break;
18651867 case CEPH_OSD_OP_SETALLOCHINT:
1866− rbd_assert(osd_req->r_ops[1].op == CEPH_OSD_OP_WRITE);
1868+ rbd_assert(osd_req->r_ops[1].op == CEPH_OSD_OP_WRITE ||
1869+ osd_req->r_ops[1].op == CEPH_OSD_OP_WRITEFULL);
18671870 /* fall through */
18681871 case CEPH_OSD_OP_WRITE:
1872+ case CEPH_OSD_OP_WRITEFULL:
18691873 rbd_osd_write_callback(obj_request);
18701874 break;
18711875 case CEPH_OSD_OP_STAT:
@@ -2401,7 +2405,10 @@ static void rbd_img_obj_request_fill(struct rbd_obj_request *obj_request, · 529 unmodified lines
24012405 opcode = CEPH_OSD_OP_ZERO;
24022406 }
24032407 } else if (op_type == OBJ_OP_WRITE) {
2404− opcode = CEPH_OSD_OP_WRITE;
2408+ if (!offset && length == object_size)
2409+ opcode = CEPH_OSD_OP_WRITEFULL;
2410+ else
2411+ opcode = CEPH_OSD_OP_WRITE;
24052412 osd_req_op_alloc_hint_init(osd_request, num_ops,
24062413 object_size, object_size);
24072414 num_ops++;
@@ -3760,6 +3767,7 @@ static int rbd_init_disk(struct rbd_device *rbd_dev) · 1352 unmodified lines
37603767 /* set io sizes to object size */
37613768 segment_size = rbd_obj_bytes(&rbd_dev->header);
37623769 blk_queue_max_hw_sectors(q, segment_size / SECTOR_SIZE);
3770+ q->limits.max_sectors = queue_max_hw_sectors(q);
37633771 blk_queue_max_segments(q, segment_size / SECTOR_SIZE);
37643772 blk_queue_max_segment_size(q, segment_size);
37653773 blk_queue_io_min(q, segment_size);
@@ -5125,44 +5133,51 @@ out_err: · 1359 unmodified lines
51255133 return ret;
51265134 }
51275135
5128−static int rbd_dev_probe_parent(struct rbd_device *rbd_dev)
5136+/*
5137+ * @depth is rbd_dev_image_probe() -> rbd_dev_probe_parent() ->
5138+ * rbd_dev_image_probe() recursion depth, which means it's also the
5139+ * length of the already discovered part of the parent chain.
5140+ */
5141+static int rbd_dev_probe_parent(struct rbd_device *rbd_dev, int depth)
51295142 {
51305143 struct rbd_device *parent = NULL;
5131− struct rbd_spec *parent_spec;
5132− struct rbd_client *rbdc;
51335144 int ret;
51345145
51355146 if (!rbd_dev->parent_spec)
51365147 return 0;
5137− /*
5138− * We need to pass a reference to the client and the parent
5139− * spec when creating the parent rbd_dev. Images related by
5140− * parent/child relationships always share both.
5141− */
5142− parent_spec = rbd_spec_get(rbd_dev->parent_spec);
5143− rbdc = __rbd_get_client(rbd_dev->rbd_client);
51445148
5145− ret = -ENOMEM;
5146− parent = rbd_dev_create(rbdc, parent_spec, NULL);
5147− if (!parent)
5149+ if (++depth > RBD_MAX_PARENT_CHAIN_LEN) {
5150+ pr_info("parent chain is too long (%d)\n", depth);
5151+ ret = -EINVAL;
51485152 goto out_err;
5153+ }
51495154
5150− ret = rbd_dev_image_probe(parent, false);
5155+ parent = rbd_dev_create(rbd_dev->rbd_client, rbd_dev->parent_spec,
5156+ NULL);
5157+ if (!parent) {
5158+ ret = -ENOMEM;
5159+ goto out_err;
5160+ }
5161+
5162+ /*
5163+ * Images related by parent/child relationships always share
5164+ * rbd_client and spec/parent_spec, so bump their refcounts.
5165+ */
5166+ __rbd_get_client(rbd_dev->rbd_client);
5167+ rbd_spec_get(rbd_dev->parent_spec);
5168+
5169+ ret = rbd_dev_image_probe(parent, depth);
51515170 if (ret < 0)
51525171 goto out_err;
5172+
51535173 rbd_dev->parent = parent;
51545174 atomic_set(&rbd_dev->parent_ref, 1);
5155−
51565175 return 0;
5176+
51575177 out_err:
5158− if (parent) {
5159− rbd_dev_unparent(rbd_dev);
5178+ rbd_dev_unparent(rbd_dev);
5179+ if (parent)
51605180 rbd_dev_destroy(parent);
5161− } else {
5162− rbd_put_client(rbdc);
5163− rbd_spec_put(parent_spec);
5164− }
5165−
51665181 return ret;
51675182 }
51685183
@@ -5280,7 +5295,7 @@ static void rbd_dev_image_release(struct rbd_device *rbd_dev) · 111 unmodified lines
52805295 * parent), initiate a watch on its header object before using that
52815296 * object to get detailed information about the rbd image.
52825297 */
5283−static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping)
5298+static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth)
52845299 {
52855300 int ret;
52865301
@@ -5298,7 +5313,7 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping) · 11 unmodified lines
52985313 if (ret)
52995314 goto err_out_format;
53005315
5301− if (mapping) {
5316+ if (!depth) {
53025317 ret = rbd_dev_header_watch_sync(rbd_dev);
53035318 if (ret) {
53045319 if (ret == -ENOENT)
@@ -5319,7 +5334,7 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping) · 14 unmodified lines
53195334 * Otherwise this is a parent image, identified by pool, image
53205335 * and snap ids - need to fill in names for those ids.
53215336 */
5322− if (mapping)
5337+ if (!depth)
53235338 ret = rbd_spec_fill_snap_id(rbd_dev);
53245339 else
53255340 ret = rbd_spec_fill_names(rbd_dev);
@@ -5341,12 +5356,12 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping) · 15 unmodified lines
53415356 * Need to warn users if this image is the one being
53425357 * mapped and has a parent.
53435358 */
5344− if (mapping && rbd_dev->parent_spec)
5359+ if (!depth && rbd_dev->parent_spec)
53455360 rbd_warn(rbd_dev,
53465361 "WARNING: kernel layering is EXPERIMENTAL!");
53475362 }
53485363
5349− ret = rbd_dev_probe_parent(rbd_dev);
5364+ ret = rbd_dev_probe_parent(rbd_dev, depth);
53505365 if (ret)
53515366 goto err_out_probe;
53525367
@@ -5357,7 +5372,7 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping) · 4 unmodified lines
53575372 err_out_probe:
53585373 rbd_dev_unprobe(rbd_dev);
53595374 err_out_watch:
5360− if (mapping)
5375+ if (!depth)
53615376 rbd_dev_header_unwatch_sync(rbd_dev);
53625377 out_header_name:
53635378 kfree(rbd_dev->header_name);
@@ -5420,7 +5435,7 @@ static ssize_t do_rbd_add(struct bus_type *bus, · 56 unmodified lines
54205435 spec = NULL; /* rbd_dev now owns this */
54215436 rbd_opts = NULL; /* rbd_dev now owns this */
54225437
5423− rc = rbd_dev_image_probe(rbd_dev, true);
5438+ rc = rbd_dev_image_probe(rbd_dev, 0);
54245439 if (rc < 0)
54255440 goto err_out_rbd_dev;
54265441
drivers/block/xen-blkfront.c+2−1
@@ -1956,7 +1956,8 @@ static void blkback_changed(struct xenbus_device *dev, · 1955 unmodified lines
19561956 break;
19571957 /* Missed the backend's Closing state -- fallthrough */
19581958 case XenbusStateClosing:
1959− blkfront_closing(info);
1959+ if (info)
1960+ blkfront_closing(info);
19601961 break;
19611962 }
19621963 }
drivers/bus/arm-ccn.c+3−2
@@ -1184,11 +1184,12 @@ static int arm_ccn_pmu_cpu_notifier(struct notifier_block *nb, · 1183 unmodified lines
11841184 if (!cpumask_test_and_clear_cpu(cpu, &dt->cpu))
11851185 break;
11861186 target = cpumask_any_but(cpu_online_mask, cpu);
1187− if (target < 0)
1187+ if (target >= nr_cpu_ids)
11881188 break;
11891189 perf_pmu_migrate_context(&dt->pmu, cpu, target);
11901190 cpumask_set_cpu(target, &dt->cpu);
1191− WARN_ON(irq_set_affinity(ccn->irq, &dt->cpu) != 0);
1191+ if (ccn->irq)
1192+ WARN_ON(irq_set_affinity(ccn->irq, &dt->cpu) != 0);
11921193 default:
11931194 break;
11941195 }
drivers/clk/mvebu/clk-cpu.c+3−1
@@ -197,6 +197,7 @@ static void __init of_cpu_clk_setup(struct device_node *node) · 196 unmodified lines
197197 for_each_node_by_type(dn, "cpu") {
198198 struct clk_init_data init;
199199 struct clk *clk;
200+ struct clk *parent_clk;
200201 char *clk_name = kzalloc(5, GFP_KERNEL);
201202 int cpu, err;
202203
@@ -208,8 +209,9 @@ static void __init of_cpu_clk_setup(struct device_node *node) · 5 unmodified lines
208209 goto bail_out;
209210
210211 sprintf(clk_name, "cpu%d", cpu);
212+ parent_clk = of_clk_get(node, 0);
211213
212− cpuclk[cpu].parent_name = of_clk_get_parent_name(node, 0);
214+ cpuclk[cpu].parent_name = __clk_get_name(parent_clk);
213215 cpuclk[cpu].clk_name = clk_name;
214216 cpuclk[cpu].cpu = cpu;
215217 cpuclk[cpu].reg_base = clock_complex_base;
drivers/cpufreq/intel_pstate.c+5−0
@@ -776,6 +776,11 @@ static inline void intel_pstate_sample(struct cpudata *cpu) · 775 unmodified lines
776776 local_irq_save(flags);
777777 rdmsrl(MSR_IA32_APERF, aperf);
778778 rdmsrl(MSR_IA32_MPERF, mperf);
779+ if (cpu->prev_mperf == mperf) {
780+ local_irq_restore(flags);
781+ return;
782+ }
783+
779784 tsc = rdtsc();
780785 local_irq_restore(flags);
781786
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c+6−2
@@ -672,8 +672,12 @@ int amdgpu_atombios_get_clock_info(struct amdgpu_device *adev) · 671 unmodified lines
672672 /* disp clock */
673673 adev->clock.default_dispclk =
674674 le32_to_cpu(firmware_info->info_21.ulDefaultDispEngineClkFreq);
675− if (adev->clock.default_dispclk == 0)
676− adev->clock.default_dispclk = 54000; /* 540 Mhz */
675+ /* set a reasonable default for DP */
676+ if (adev->clock.default_dispclk < 53900) {
677+ DRM_INFO("Changing default dispclk from %dMhz to 600Mhz\n",
678+ adev->clock.default_dispclk / 100);
679+ adev->clock.default_dispclk = 60000;
680+ }
677681 adev->clock.dp_extclk =
678682 le16_to_cpu(firmware_info->info_21.usUniphyDPModeExtClkFreq);
679683 adev->clock.current_dispclk = adev->clock.default_dispclk;
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c+3−3
@@ -177,7 +177,7 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) · 176 unmodified lines
177177
178178 /* get chunks */
179179 INIT_LIST_HEAD(&p->validated);
180− chunk_array_user = (uint64_t __user *)(cs->in.chunks);
180+ chunk_array_user = (uint64_t __user *)(unsigned long)(cs->in.chunks);
181181 if (copy_from_user(chunk_array, chunk_array_user,
182182 sizeof(uint64_t)*cs->in.num_chunks)) {
183183 ret = -EFAULT;
@@ -197,7 +197,7 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) · 13 unmodified lines
197197 struct drm_amdgpu_cs_chunk user_chunk;
198198 uint32_t __user *cdata;
199199
200− chunk_ptr = (void __user *)chunk_array[i];
200+ chunk_ptr = (void __user *)(unsigned long)chunk_array[i];
201201 if (copy_from_user(&user_chunk, chunk_ptr,
202202 sizeof(struct drm_amdgpu_cs_chunk))) {
203203 ret = -EFAULT;
@@ -208,7 +208,7 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) · 4 unmodified lines
208208 p->chunks[i].length_dw = user_chunk.length_dw;
209209
210210 size = p->chunks[i].length_dw;
211− cdata = (void __user *)user_chunk.chunk_data;
211+ cdata = (void __user *)(unsigned long)user_chunk.chunk_data;
212212 p->chunks[i].user_ptr = cdata;
213213
214214 p->chunks[i].kdata = drm_malloc_ab(size, sizeof(uint32_t));
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c+0−2
@@ -85,8 +85,6 @@ static void amdgpu_flip_work_func(struct work_struct *__work) · 84 unmodified lines
8585 /* We borrow the event spin lock for protecting flip_status */
8686 spin_lock_irqsave(&crtc->dev->event_lock, flags);
8787
88− /* set the proper interrupt */
89− amdgpu_irq_get(adev, &adev->pageflip_irq, work->crtc_id);
9088 /* do the flip (mmio) */
9189 adev->mode_info.funcs->page_flip(adev, work->crtc_id, work->base);
9290 /* set the flip status */
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c+5−5
@@ -242,11 +242,11 @@ static struct pci_device_id pciidlist[] = { · 241 unmodified lines
242242 {0x1002, 0x985F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_MULLINS|AMD_IS_MOBILITY|AMD_IS_APU},
243243 #endif
244244 /* topaz */
245− {0x1002, 0x6900, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ},
246− {0x1002, 0x6901, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ},
247− {0x1002, 0x6902, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ},
248− {0x1002, 0x6903, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ},
249− {0x1002, 0x6907, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ},
245+ {0x1002, 0x6900, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ|AMD_EXP_HW_SUPPORT},
246+ {0x1002, 0x6901, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ|AMD_EXP_HW_SUPPORT},
247+ {0x1002, 0x6902, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ|AMD_EXP_HW_SUPPORT},
248+ {0x1002, 0x6903, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ|AMD_EXP_HW_SUPPORT},
249+ {0x1002, 0x6907, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TOPAZ|AMD_EXP_HW_SUPPORT},
250250 /* tonga */
251251 {0x1002, 0x6920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA},
252252 {0x1002, 0x6921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA},
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c+16−0
@@ -402,3 +402,19 @@ bool amdgpu_fbdev_robj_is_fb(struct amdgpu_device *adev, struct amdgpu_bo *robj) · 401 unmodified lines
402402 return true;
403403 return false;
404404 }
405+
406+void amdgpu_fbdev_restore_mode(struct amdgpu_device *adev)
407+{
408+ struct amdgpu_fbdev *afbdev = adev->mode_info.rfbdev;
409+ struct drm_fb_helper *fb_helper;
410+ int ret;
411+
412+ if (!afbdev)
413+ return;
414+
415+ fb_helper = &afbdev->helper;
416+
417+ ret = drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper);
418+ if (ret)
419+ DRM_DEBUG("failed to restore crtc mode\n");
420+}
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c+4−1
@@ -485,7 +485,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file · 484 unmodified lines
485485 * Outdated mess for old drm with Xorg being in charge (void function now).
486486 */
487487 /**
488− * amdgpu_driver_firstopen_kms - drm callback for last close
488+ * amdgpu_driver_lastclose_kms - drm callback for last close
489489 *
490490 * @dev: drm dev pointer
491491 *
@@ -493,6 +493,9 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file · 1 unmodified line
493493 */
494494 void amdgpu_driver_lastclose_kms(struct drm_device *dev)
495495 {
496+ struct amdgpu_device *adev = dev->dev_private;
497+
498+ amdgpu_fbdev_restore_mode(adev);
496499 vga_switcheroo_process_delayed_switch();
497500 }
498501
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h+1−0
@@ -567,6 +567,7 @@ void amdgpu_fbdev_fini(struct amdgpu_device *adev); · 566 unmodified lines
567567 void amdgpu_fbdev_set_suspend(struct amdgpu_device *adev, int state);
568568 int amdgpu_fbdev_total_size(struct amdgpu_device *adev);
569569 bool amdgpu_fbdev_robj_is_fb(struct amdgpu_device *adev, struct amdgpu_bo *robj);
570+void amdgpu_fbdev_restore_mode(struct amdgpu_device *adev);
570571
571572 void amdgpu_fb_output_poll_changed(struct amdgpu_device *adev);
572573
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c+6−2
@@ -294,10 +294,14 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj, · 293 unmodified lines
294294 struct amdgpu_device *adev = dev_get_drvdata(dev);
295295 umode_t effective_mode = attr->mode;
296296
297− /* Skip limit attributes if DPM is not enabled */
297+ /* Skip attributes if DPM is not enabled */
298298 if (!adev->pm.dpm_enabled &&
299299 (attr == &sensor_dev_attr_temp1_crit.dev_attr.attr ||
300− attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr))
300+ attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr ||
301+ attr == &sensor_dev_attr_pwm1.dev_attr.attr ||
302+ attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr ||
303+ attr == &sensor_dev_attr_pwm1_max.dev_attr.attr ||
304+ attr == &sensor_dev_attr_pwm1_min.dev_attr.attr))
301305 return 0;
302306
303307 /* Skip fan attributes if fan is not present */
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c+3−1
@@ -455,8 +455,10 @@ int amdgpu_vm_update_page_directory(struct amdgpu_device *adev, · 454 unmodified lines
455455 return -ENOMEM;
456456
457457 r = amdgpu_ib_get(ring, NULL, ndw * 4, ib);
458− if (r)
458+ if (r) {
459+ kfree(ib);
459460 return r;
461+ }
460462 ib->length_dw = 0;
461463
462464 /* walk over the address space and update the page directory */
drivers/gpu/drm/amd/amdgpu/ci_dpm.c+5−3
@@ -6185,6 +6185,11 @@ static int ci_dpm_late_init(void *handle) · 6184 unmodified lines
61856185 if (!amdgpu_dpm)
61866186 return 0;
61876187
6188+ /* init the sysfs and debugfs files late */
6189+ ret = amdgpu_pm_sysfs_init(adev);
6190+ if (ret)
6191+ return ret;
6192+
61886193 ret = ci_set_temperature_range(adev);
61896194 if (ret)
61906195 return ret;
@@ -6232,9 +6237,6 @@ static int ci_dpm_sw_init(void *handle) · 41 unmodified lines
62326237 adev->pm.dpm.current_ps = adev->pm.dpm.requested_ps = adev->pm.dpm.boot_ps;
62336238 if (amdgpu_dpm == 1)
62346239 amdgpu_pm_print_power_states(adev);
6235− ret = amdgpu_pm_sysfs_init(adev);
6236− if (ret)
6237− goto dpm_failed;
62386240 mutex_unlock(&adev->pm.mutex);
62396241 DRM_INFO("amdgpu: dpm initialized\n");
62406242
drivers/gpu/drm/amd/amdgpu/cik.c+3−0
@@ -1567,6 +1567,9 @@ static void cik_pcie_gen3_enable(struct amdgpu_device *adev) · 1566 unmodified lines
15671567 int ret, i;
15681568 u16 tmp16;
15691569
1570+ if (pci_is_root_bus(adev->pdev->bus))
1571+ return;
1572+
15701573 if (amdgpu_pcie_gen2 == 0)
15711574 return;
15721575
drivers/gpu/drm/amd/amdgpu/cz_dpm.c+6−4
@@ -596,6 +596,12 @@ static int cz_dpm_late_init(void *handle) · 595 unmodified lines
596596 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
597597
598598 if (amdgpu_dpm) {
599+ int ret;
600+ /* init the sysfs and debugfs files late */
601+ ret = amdgpu_pm_sysfs_init(adev);
602+ if (ret)
603+ return ret;
604+
599605 /* powerdown unused blocks for now */
600606 cz_dpm_powergate_uvd(adev, true);
601607 cz_dpm_powergate_vce(adev, true);
@@ -632,10 +638,6 @@ static int cz_dpm_sw_init(void *handle) · 30 unmodified lines
632638 if (amdgpu_dpm == 1)
633639 amdgpu_pm_print_power_states(adev);
634640
635− ret = amdgpu_pm_sysfs_init(adev);
636− if (ret)
637− goto dpm_init_failed;
638−
639641 mutex_unlock(&adev->pm.mutex);
640642 DRM_INFO("amdgpu: dpm initialized\n");
641643
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c+28−2
@@ -255,6 +255,24 @@ static u32 dce_v10_0_vblank_get_counter(struct amdgpu_device *adev, int crtc) · 254 unmodified lines
255255 return RREG32(mmCRTC_STATUS_FRAME_COUNT + crtc_offsets[crtc]);
256256 }
257257
258+static void dce_v10_0_pageflip_interrupt_init(struct amdgpu_device *adev)
259+{
260+ unsigned i;
261+
262+ /* Enable pflip interrupts */
263+ for (i = 0; i < adev->mode_info.num_crtc; i++)
264+ amdgpu_irq_get(adev, &adev->pageflip_irq, i);
265+}
266+
267+static void dce_v10_0_pageflip_interrupt_fini(struct amdgpu_device *adev)
268+{
269+ unsigned i;
270+
271+ /* Disable pflip interrupts */
272+ for (i = 0; i < adev->mode_info.num_crtc; i++)
273+ amdgpu_irq_put(adev, &adev->pageflip_irq, i);
274+}
275+
258276 /**
259277 * dce_v10_0_page_flip - pageflip callback.
260278 *
@@ -2663,9 +2681,10 @@ static void dce_v10_0_crtc_dpms(struct drm_crtc *crtc, int mode) · 2402 unmodified lines
26632681 dce_v10_0_vga_enable(crtc, true);
26642682 amdgpu_atombios_crtc_blank(crtc, ATOM_DISABLE);
26652683 dce_v10_0_vga_enable(crtc, false);
2666− /* Make sure VBLANK interrupt is still enabled */
2684+ /* Make sure VBLANK and PFLIP interrupts are still enabled */
26672685 type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id);
26682686 amdgpu_irq_update(adev, &adev->crtc_irq, type);
2687+ amdgpu_irq_update(adev, &adev->pageflip_irq, type);
26692688 drm_vblank_post_modeset(dev, amdgpu_crtc->crtc_id);
26702689 dce_v10_0_crtc_load_lut(crtc);
26712690 break;
@@ -3025,6 +3044,8 @@ static int dce_v10_0_hw_init(void *handle) · 353 unmodified lines
30253044 dce_v10_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false);
30263045 }
30273046
3047+ dce_v10_0_pageflip_interrupt_init(adev);
3048+
30283049 return 0;
30293050 }
30303051
@@ -3039,6 +3060,8 @@ static int dce_v10_0_hw_fini(void *handle) · 8 unmodified lines
30393060 dce_v10_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false);
30403061 }
30413062
3063+ dce_v10_0_pageflip_interrupt_fini(adev);
3064+
30423065 return 0;
30433066 }
30443067
@@ -3050,6 +3073,8 @@ static int dce_v10_0_suspend(void *handle) · 5 unmodified lines
30503073
30513074 dce_v10_0_hpd_fini(adev);
30523075
3076+ dce_v10_0_pageflip_interrupt_fini(adev);
3077+
30533078 return 0;
30543079 }
30553080
@@ -3075,6 +3100,8 @@ static int dce_v10_0_resume(void *handle) · 19 unmodified lines
30753100 /* initialize hpd */
30763101 dce_v10_0_hpd_init(adev);
30773102
3103+ dce_v10_0_pageflip_interrupt_init(adev);
3104+
30783105 return 0;
30793106 }
30803107
@@ -3369,7 +3396,6 @@ static int dce_v10_0_pageflip_irq(struct amdgpu_device *adev, · 288 unmodified lines
33693396 spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
33703397
33713398 drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
3372− amdgpu_irq_put(adev, &adev->pageflip_irq, crtc_id);
33733399 queue_work(amdgpu_crtc->pflip_queue, &works->unpin_work);
33743400
33753401 return 0;
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c+29−3
@@ -233,6 +233,24 @@ static u32 dce_v11_0_vblank_get_counter(struct amdgpu_device *adev, int crtc) · 232 unmodified lines
233233 return RREG32(mmCRTC_STATUS_FRAME_COUNT + crtc_offsets[crtc]);
234234 }
235235
236+static void dce_v11_0_pageflip_interrupt_init(struct amdgpu_device *adev)
237+{
238+ unsigned i;
239+
240+ /* Enable pflip interrupts */
241+ for (i = 0; i < adev->mode_info.num_crtc; i++)
242+ amdgpu_irq_get(adev, &adev->pageflip_irq, i);
243+}
244+
245+static void dce_v11_0_pageflip_interrupt_fini(struct amdgpu_device *adev)
246+{
247+ unsigned i;
248+
249+ /* Disable pflip interrupts */
250+ for (i = 0; i < adev->mode_info.num_crtc; i++)
251+ amdgpu_irq_put(adev, &adev->pageflip_irq, i);
252+}
253+
236254 /**
237255 * dce_v11_0_page_flip - pageflip callback.
238256 *
@@ -2640,9 +2658,10 @@ static void dce_v11_0_crtc_dpms(struct drm_crtc *crtc, int mode) · 2401 unmodified lines
26402658 dce_v11_0_vga_enable(crtc, true);
26412659 amdgpu_atombios_crtc_blank(crtc, ATOM_DISABLE);
26422660 dce_v11_0_vga_enable(crtc, false);
2643− /* Make sure VBLANK interrupt is still enabled */
2661+ /* Make sure VBLANK and PFLIP interrupts are still enabled */
26442662 type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id);
26452663 amdgpu_irq_update(adev, &adev->crtc_irq, type);
2664+ amdgpu_irq_update(adev, &adev->pageflip_irq, type);
26462665 drm_vblank_post_modeset(dev, amdgpu_crtc->crtc_id);
26472666 dce_v11_0_crtc_load_lut(crtc);
26482667 break;
@@ -2888,7 +2907,7 @@ static int dce_v11_0_early_init(void *handle) · 239 unmodified lines
28882907
28892908 switch (adev->asic_type) {
28902909 case CHIP_CARRIZO:
2891− adev->mode_info.num_crtc = 4;
2910+ adev->mode_info.num_crtc = 3;
28922911 adev->mode_info.num_hpd = 6;
28932912 adev->mode_info.num_dig = 9;
28942913 break;
@@ -3000,6 +3019,8 @@ static int dce_v11_0_hw_init(void *handle) · 105 unmodified lines
30003019 dce_v11_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false);
30013020 }
30023021
3022+ dce_v11_0_pageflip_interrupt_init(adev);
3023+
30033024 return 0;
30043025 }
30053026
@@ -3014,6 +3035,8 @@ static int dce_v11_0_hw_fini(void *handle) · 8 unmodified lines
30143035 dce_v11_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false);
30153036 }
30163037
3038+ dce_v11_0_pageflip_interrupt_fini(adev);
3039+
30173040 return 0;
30183041 }
30193042
@@ -3025,6 +3048,8 @@ static int dce_v11_0_suspend(void *handle) · 5 unmodified lines
30253048
30263049 dce_v11_0_hpd_fini(adev);
30273050
3051+ dce_v11_0_pageflip_interrupt_fini(adev);
3052+
30283053 return 0;
30293054 }
30303055
@@ -3051,6 +3076,8 @@ static int dce_v11_0_resume(void *handle) · 20 unmodified lines
30513076 /* initialize hpd */
30523077 dce_v11_0_hpd_init(adev);
30533078
3079+ dce_v11_0_pageflip_interrupt_init(adev);
3080+
30543081 return 0;
30553082 }
30563083
@@ -3345,7 +3372,6 @@ static int dce_v11_0_pageflip_irq(struct amdgpu_device *adev, · 288 unmodified lines
33453372 spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
33463373
33473374 drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
3348− amdgpu_irq_put(adev, &adev->pageflip_irq, crtc_id);
33493375 queue_work(amdgpu_crtc->pflip_queue, &works->unpin_work);
33503376
33513377 return 0;
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c+28−2
@@ -204,6 +204,24 @@ static u32 dce_v8_0_vblank_get_counter(struct amdgpu_device *adev, int crtc) · 203 unmodified lines
204204 return RREG32(mmCRTC_STATUS_FRAME_COUNT + crtc_offsets[crtc]);
205205 }
206206
207+static void dce_v8_0_pageflip_interrupt_init(struct amdgpu_device *adev)
208+{
209+ unsigned i;
210+
211+ /* Enable pflip interrupts */
212+ for (i = 0; i < adev->mode_info.num_crtc; i++)
213+ amdgpu_irq_get(adev, &adev->pageflip_irq, i);
214+}
215+
216+static void dce_v8_0_pageflip_interrupt_fini(struct amdgpu_device *adev)
217+{
218+ unsigned i;
219+
220+ /* Disable pflip interrupts */
221+ for (i = 0; i < adev->mode_info.num_crtc; i++)
222+ amdgpu_irq_put(adev, &adev->pageflip_irq, i);
223+}
224+
207225 /**
208226 * dce_v8_0_page_flip - pageflip callback.
209227 *
@@ -2575,9 +2593,10 @@ static void dce_v8_0_crtc_dpms(struct drm_crtc *crtc, int mode) · 2365 unmodified lines
25752593 dce_v8_0_vga_enable(crtc, true);
25762594 amdgpu_atombios_crtc_blank(crtc, ATOM_DISABLE);
25772595 dce_v8_0_vga_enable(crtc, false);
2578− /* Make sure VBLANK interrupt is still enabled */
2596+ /* Make sure VBLANK and PFLIP interrupts are still enabled */
25792597 type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id);
25802598 amdgpu_irq_update(adev, &adev->crtc_irq, type);
2599+ amdgpu_irq_update(adev, &adev->pageflip_irq, type);
25812600 drm_vblank_post_modeset(dev, amdgpu_crtc->crtc_id);
25822601 dce_v8_0_crtc_load_lut(crtc);
25832602 break;
@@ -2933,6 +2952,8 @@ static int dce_v8_0_hw_init(void *handle) · 349 unmodified lines
29332952 dce_v8_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false);
29342953 }
29352954
2955+ dce_v8_0_pageflip_interrupt_init(adev);
2956+
29362957 return 0;
29372958 }
29382959
@@ -2947,6 +2968,8 @@ static int dce_v8_0_hw_fini(void *handle) · 8 unmodified lines
29472968 dce_v8_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false);
29482969 }
29492970
2971+ dce_v8_0_pageflip_interrupt_fini(adev);
2972+
29502973 return 0;
29512974 }
29522975
@@ -2958,6 +2981,8 @@ static int dce_v8_0_suspend(void *handle) · 5 unmodified lines
29582981
29592982 dce_v8_0_hpd_fini(adev);
29602983
2984+ dce_v8_0_pageflip_interrupt_fini(adev);
2985+
29612986 return 0;
29622987 }
29632988
@@ -2981,6 +3006,8 @@ static int dce_v8_0_resume(void *handle) · 17 unmodified lines
29813006 /* initialize hpd */
29823007 dce_v8_0_hpd_init(adev);
29833008
3009+ dce_v8_0_pageflip_interrupt_init(adev);
3010+
29843011 return 0;
29853012 }
29863013
@@ -3376,7 +3403,6 @@ static int dce_v8_0_pageflip_irq(struct amdgpu_device *adev, · 389 unmodified lines
33763403 spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
33773404
33783405 drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
3379− amdgpu_irq_put(adev, &adev->pageflip_irq, crtc_id);
33803406 queue_work(amdgpu_crtc->pflip_queue, &works->unpin_work);
33813407
33823408 return 0;
drivers/gpu/drm/amd/amdgpu/kv_dpm.c+9−3
@@ -2995,6 +2995,15 @@ static int kv_dpm_late_init(void *handle) · 2994 unmodified lines
29952995 {
29962996 /* powerdown unused blocks for now */
29972997 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
2998+ int ret;
2999+
3000+ if (!amdgpu_dpm)
3001+ return 0;
3002+
3003+ /* init the sysfs and debugfs files late */
3004+ ret = amdgpu_pm_sysfs_init(adev);
3005+ if (ret)
3006+ return ret;
29983007
29993008 kv_dpm_powergate_acp(adev, true);
30003009 kv_dpm_powergate_samu(adev, true);
@@ -3038,9 +3047,6 @@ static int kv_dpm_sw_init(void *handle) · 37 unmodified lines
30383047 adev->pm.dpm.current_ps = adev->pm.dpm.requested_ps = adev->pm.dpm.boot_ps;
30393048 if (amdgpu_dpm == 1)
30403049 amdgpu_pm_print_power_states(adev);
3041− ret = amdgpu_pm_sysfs_init(adev);
3042− if (ret)
3043− goto dpm_failed;
30443050 mutex_unlock(&adev->pm.mutex);
30453051 DRM_INFO("amdgpu: dpm initialized\n");
30463052
drivers/gpu/drm/amd/amdgpu/vi.c+3−0
@@ -1005,6 +1005,9 @@ static void vi_pcie_gen3_enable(struct amdgpu_device *adev) · 1004 unmodified lines
10051005 u32 mask;
10061006 int ret;
10071007
1008+ if (pci_is_root_bus(adev->pdev->bus))
1009+ return;
1010+
10081011 if (amdgpu_pcie_gen2 == 0)
10091012 return;
10101013
drivers/gpu/drm/drm_dp_mst_topology.c+6−4
@@ -1194,17 +1194,18 @@ static struct drm_dp_mst_branch *drm_dp_get_mst_branch_device(struct drm_dp_mst_ · 1193 unmodified lines
11941194
11951195 list_for_each_entry(port, &mstb->ports, next) {
11961196 if (port->port_num == port_num) {
1197− if (!port->mstb) {
1197+ mstb = port->mstb;
1198+ if (!mstb) {
11981199 DRM_ERROR("failed to lookup MSTB with lct %d, rad %02x\n", lct, rad[0]);
1199− return NULL;
1200+ goto out;
12001201 }
12011202
1202− mstb = port->mstb;
12031203 break;
12041204 }
12051205 }
12061206 }
12071207 kref_get(&mstb->kref);
1208+out:
12081209 mutex_unlock(&mgr->lock);
12091210 return mstb;
12101211 }
@@ -2801,12 +2802,13 @@ static int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs · 1590 unmodified lines
28012802 if (msgs[num - 1].flags & I2C_M_RD)
28022803 reading = true;
28032804
2804− if (!reading) {
2805+ if (!reading || (num - 1 > DP_REMOTE_I2C_READ_MAX_TRANSACTIONS)) {
28052806 DRM_DEBUG_KMS("Unsupported I2C transaction for MST device\n");
28062807 ret = -EIO;
28072808 goto out;
28082809 }
28092810
2811+ memset(&msg, 0, sizeof(msg));
28102812 msg.req_type = DP_REMOTE_I2C_READ;
28112813 msg.u.i2c_read.num_transactions = num - 1;
28122814 msg.u.i2c_read.port_number = port->port_num;
drivers/gpu/drm/drm_sysfs.c+3−9
@@ -235,18 +235,12 @@ static ssize_t dpms_show(struct device *device, · 234 unmodified lines
235235 char *buf)
236236 {
237237 struct drm_connector *connector = to_drm_connector(device);
238− struct drm_device *dev = connector->dev;
239− uint64_t dpms_status;
240− int ret;
238+ int dpms;
241239
242− ret = drm_object_property_get_value(&connector->base,
243− dev->mode_config.dpms_property,
244− &dpms_status);
245− if (ret)
246− return 0;
240+ dpms = READ_ONCE(connector->dpms);
247241
248242 return snprintf(buf, PAGE_SIZE, "%s\n",
249− drm_get_dpms_name((int)dpms_status));
243+ drm_get_dpms_name(dpms));
250244 }
251245
252246 static ssize_t enabled_show(struct device *device,
drivers/gpu/drm/i915/i915_gem_shrinker.c+1−1
@@ -143,7 +143,7 @@ i915_gem_shrink(struct drm_i915_private *dev_priv, · 142 unmodified lines
143143 }
144144
145145 /**
146− * i915_gem_shrink - Shrink buffer object caches completely
146+ * i915_gem_shrink_all - Shrink buffer object caches completely
147147 * @dev_priv: i915 device
148148 *
149149 * This is a simple wraper around i915_gem_shrink() to aggressively shrink all
drivers/gpu/drm/i915/i915_gem_userptr.c+4−1
@@ -804,7 +804,10 @@ static const struct drm_i915_gem_object_ops i915_gem_userptr_ops = { · 803 unmodified lines
804804 * Also note, that the object created here is not currently a "first class"
805805 * object, in that several ioctls are banned. These are the CPU access
806806 * ioctls: mmap(), pwrite and pread. In practice, you are expected to use
807− * direct access via your pointer rather than use those ioctls.
807+ * direct access via your pointer rather than use those ioctls. Another
808+ * restriction is that we do not allow userptr surfaces to be pinned to the
809+ * hardware and so we reject any attempt to create a framebuffer out of a
810+ * userptr.
808811 *
809812 * If you think this is a good interface to use to pass GPU memory between
810813 * drivers, please use dma-buf instead. In fact, wherever possible use
drivers/gpu/drm/i915/intel_display.c+67−53
@@ -1724,6 +1724,15 @@ static void i9xx_enable_pll(struct intel_crtc *crtc) · 1723 unmodified lines
17241724 I915_READ(DPLL(!crtc->pipe)) | DPLL_DVO_2X_MODE);
17251725 }
17261726
1727+ /*
1728+ * Apparently we need to have VGA mode enabled prior to changing
1729+ * the P1/P2 dividers. Otherwise the DPLL will keep using the old
1730+ * dividers, even though the register value does change.
1731+ */
1732+ I915_WRITE(reg, 0);
1733+
1734+ I915_WRITE(reg, dpll);
1735+
17271736 /* Wait for the clocks to stabilize. */
17281737 POSTING_READ(reg);
17291738 udelay(150);
@@ -14107,6 +14116,11 @@ static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb, · 12377 unmodified lines
1410714116 struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
1410814117 struct drm_i915_gem_object *obj = intel_fb->obj;
1410914118
14119+ if (obj->userptr.mm) {
14120+ DRM_DEBUG("attempting to use a userptr for a framebuffer, denied\n");
14121+ return -EINVAL;
14122+ }
14123+
1411014124 return drm_gem_handle_create(file, &obj->base, handle);
1411114125 }
1411214126
@@ -14897,9 +14911,19 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc) · 784 unmodified lines
1489714911 /* restore vblank interrupts to correct state */
1489814912 drm_crtc_vblank_reset(&crtc->base);
1489914913 if (crtc->active) {
14914+ struct intel_plane *plane;
14915+
1490014916 drm_calc_timestamping_constants(&crtc->base, &crtc->base.hwmode);
1490114917 update_scanline_offset(crtc);
1490214918 drm_crtc_vblank_on(&crtc->base);
14919+
14920+ /* Disable everything but the primary plane */
14921+ for_each_intel_plane_on_crtc(dev, crtc, plane) {
14922+ if (plane->base.type == DRM_PLANE_TYPE_PRIMARY)
14923+ continue;
14924+
14925+ plane->disable_plane(&plane->base, &crtc->base);
14926+ }
1490314927 }
1490414928
1490514929 /* We need to sanitize the plane -> pipe mapping first because this will
@@ -15067,38 +15091,25 @@ void i915_redisable_vga(struct drm_device *dev) · 161 unmodified lines
1506715091 i915_redisable_vga_power_on(dev);
1506815092 }
1506915093
15070−static bool primary_get_hw_state(struct intel_crtc *crtc)
15094+static bool primary_get_hw_state(struct intel_plane *plane)
1507115095 {
15072− struct drm_i915_private *dev_priv = crtc->base.dev->dev_private;
15096+ struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
1507315097
15074− return !!(I915_READ(DSPCNTR(crtc->plane)) & DISPLAY_PLANE_ENABLE);
15098+ return I915_READ(DSPCNTR(plane->plane)) & DISPLAY_PLANE_ENABLE;
1507515099 }
1507615100
15077−static void readout_plane_state(struct intel_crtc *crtc,
15078− struct intel_crtc_state *crtc_state)
15101+/* FIXME read out full plane state for all planes */
15102+static void readout_plane_state(struct intel_crtc *crtc)
1507915103 {
15080− struct intel_plane *p;
15081− struct intel_plane_state *plane_state;
15082− bool active = crtc_state->base.active;
15083−
15084− for_each_intel_plane(crtc->base.dev, p) {
15085− if (crtc->pipe != p->pipe)
15086− continue;
15087−
15088− plane_state = to_intel_plane_state(p->base.state);
15104+ struct drm_plane *primary = crtc->base.primary;
15105+ struct intel_plane_state *plane_state =
15106+ to_intel_plane_state(primary->state);
1508915107
15090− if (p->base.type == DRM_PLANE_TYPE_PRIMARY) {
15091− plane_state->visible = primary_get_hw_state(crtc);
15092− if (plane_state->visible)
15093− crtc->base.state->plane_mask |=
15094− 1 << drm_plane_index(&p->base);
15095− } else {
15096− if (active)
15097− p->disable_plane(&p->base, &crtc->base);
15108+ plane_state->visible =
15109+ primary_get_hw_state(to_intel_plane(primary));
1509815110
15099− plane_state->visible = false;
15100− }
15101− }
15111+ if (plane_state->visible)
15112+ crtc->base.state->plane_mask |= 1 << drm_plane_index(primary);
1510215113 }
1510315114
1510415115 static void intel_modeset_readout_hw_state(struct drm_device *dev)
@@ -15121,34 +15132,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) · 16 unmodified lines
1512115132 crtc->base.state->active = crtc->active;
1512215133 crtc->base.enabled = crtc->active;
1512315134
15124− memset(&crtc->base.mode, 0, sizeof(crtc->base.mode));
15125− if (crtc->base.state->active) {
15126− intel_mode_from_pipe_config(&crtc->base.mode, crtc->config);
15127− intel_mode_from_pipe_config(&crtc->base.state->adjusted_mode, crtc->config);
15128− WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, &crtc->base.mode));
15129−
15130− /*
15131− * The initial mode needs to be set in order to keep
15132− * the atomic core happy. It wants a valid mode if the
15133− * crtc's enabled, so we do the above call.
15134− *
15135− * At this point some state updated by the connectors
15136− * in their ->detect() callback has not run yet, so
15137− * no recalculation can be done yet.
15138− *
15139− * Even if we could do a recalculation and modeset
15140− * right now it would cause a double modeset if
15141− * fbdev or userspace chooses a different initial mode.
15142− *
15143− * If that happens, someone indicated they wanted a
15144− * mode change, which means it's safe to do a full
15145− * recalculation.
15146− */
15147− crtc->base.state->mode.private_flags = I915_MODE_FLAG_INHERITED;
15148− }
15149−
15150− crtc->base.hwmode = crtc->config->base.adjusted_mode;
15151− readout_plane_state(crtc, to_intel_crtc_state(crtc->base.state));
15135+ readout_plane_state(crtc);
1515215136
1515315137 DRM_DEBUG_KMS("[CRTC:%d] hw state readout: %s\n",
1515415138 crtc->base.base.id,
@@ -15207,6 +15191,36 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) · 52 unmodified lines
1520715191 connector->base.name,
1520815192 connector->base.encoder ? "enabled" : "disabled");
1520915193 }
15194+
15195+ for_each_intel_crtc(dev, crtc) {
15196+ crtc->base.hwmode = crtc->config->base.adjusted_mode;
15197+
15198+ memset(&crtc->base.mode, 0, sizeof(crtc->base.mode));
15199+ if (crtc->base.state->active) {
15200+ intel_mode_from_pipe_config(&crtc->base.mode, crtc->config);
15201+ intel_mode_from_pipe_config(&crtc->base.state->adjusted_mode, crtc->config);
15202+ WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, &crtc->base.mode));
15203+
15204+ /*
15205+ * The initial mode needs to be set in order to keep
15206+ * the atomic core happy. It wants a valid mode if the
15207+ * crtc's enabled, so we do the above call.
15208+ *
15209+ * At this point some state updated by the connectors
15210+ * in their ->detect() callback has not run yet, so
15211+ * no recalculation can be done yet.
15212+ *
15213+ * Even if we could do a recalculation and modeset
15214+ * right now it would cause a double modeset if
15215+ * fbdev or userspace chooses a different initial mode.
15216+ *
15217+ * If that happens, someone indicated they wanted a
15218+ * mode change, which means it's safe to do a full
15219+ * recalculation.
15220+ */
15221+ crtc->base.state->mode.private_flags = I915_MODE_FLAG_INHERITED;
15222+ }
15223+ }
1521015224 }
1521115225
1521215226 /* Scan out the current hw modeset state,
drivers/gpu/drm/i915/intel_lrc.c+1−0
@@ -1659,6 +1659,7 @@ static int gen8_emit_flush_render(struct drm_i915_gem_request *request, · 1658 unmodified lines
16591659 if (flush_domains) {
16601660 flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;
16611661 flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;
1662+ flags |= PIPE_CONTROL_FLUSH_ENABLE;
16621663 }
16631664
16641665 if (invalidate_domains) {
drivers/gpu/drm/i915/intel_ringbuffer.c+2−0
@@ -347,6 +347,7 @@ gen7_render_ring_flush(struct drm_i915_gem_request *req, · 346 unmodified lines
347347 if (flush_domains) {
348348 flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;
349349 flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;
350+ flags |= PIPE_CONTROL_FLUSH_ENABLE;
350351 }
351352 if (invalidate_domains) {
352353 flags |= PIPE_CONTROL_TLB_INVALIDATE;
@@ -418,6 +419,7 @@ gen8_render_ring_flush(struct drm_i915_gem_request *req, · 65 unmodified lines
418419 if (flush_domains) {
419420 flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;
420421 flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;
422+ flags |= PIPE_CONTROL_FLUSH_ENABLE;
421423 }
422424 if (invalidate_domains) {
423425 flags |= PIPE_CONTROL_TLB_INVALIDATE;
drivers/gpu/drm/nouveau/nouveau_display.c+5−1
@@ -469,9 +469,13 @@ nouveau_display_create(struct drm_device *dev) · 468 unmodified lines
469469 if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) {
470470 dev->mode_config.max_width = 4096;
471471 dev->mode_config.max_height = 4096;
472− } else {
472+ } else
473+ if (drm->device.info.family < NV_DEVICE_INFO_V0_FERMI) {
473474 dev->mode_config.max_width = 8192;
474475 dev->mode_config.max_height = 8192;
476+ } else {
477+ dev->mode_config.max_width = 16384;
478+ dev->mode_config.max_height = 16384;
475479 }
476480
477481 dev->mode_config.preferred_depth = 24;
drivers/gpu/drm/nouveau/nouveau_fbcon.c+24−0
@@ -178,8 +178,30 @@ nouveau_fbcon_sync(struct fb_info *info) · 177 unmodified lines
178178 return 0;
179179 }
180180
181+static int
182+nouveau_fbcon_open(struct fb_info *info, int user)
183+{
184+ struct nouveau_fbdev *fbcon = info->par;
185+ struct nouveau_drm *drm = nouveau_drm(fbcon->dev);
186+ int ret = pm_runtime_get_sync(drm->dev->dev);
187+ if (ret < 0 && ret != -EACCES)
188+ return ret;
189+ return 0;
190+}
191+
192+static int
193+nouveau_fbcon_release(struct fb_info *info, int user)
194+{
195+ struct nouveau_fbdev *fbcon = info->par;
196+ struct nouveau_drm *drm = nouveau_drm(fbcon->dev);
197+ pm_runtime_put(drm->dev->dev);
198+ return 0;
199+}
200+
181201 static struct fb_ops nouveau_fbcon_ops = {
182202 .owner = THIS_MODULE,
203+ .fb_open = nouveau_fbcon_open,
204+ .fb_release = nouveau_fbcon_release,
183205 .fb_check_var = drm_fb_helper_check_var,
184206 .fb_set_par = drm_fb_helper_set_par,
185207 .fb_fillrect = nouveau_fbcon_fillrect,
@@ -195,6 +217,8 @@ static struct fb_ops nouveau_fbcon_ops = { · 9 unmodified lines
195217
196218 static struct fb_ops nouveau_fbcon_sw_ops = {
197219 .owner = THIS_MODULE,
220+ .fb_open = nouveau_fbcon_open,
221+ .fb_release = nouveau_fbcon_release,
198222 .fb_check_var = drm_fb_helper_check_var,
199223 .fb_set_par = drm_fb_helper_set_par,
200224 .fb_fillrect = drm_fb_helper_cfb_fillrect,
drivers/gpu/drm/nouveau/nouveau_gem.c+3−2
@@ -227,11 +227,12 @@ nouveau_gem_info(struct drm_file *file_priv, struct drm_gem_object *gem, · 226 unmodified lines
227227 struct nouveau_bo *nvbo = nouveau_gem_object(gem);
228228 struct nvkm_vma *vma;
229229
230− if (nvbo->bo.mem.mem_type == TTM_PL_TT)
230+ if (is_power_of_2(nvbo->valid_domains))
231+ rep->domain = nvbo->valid_domains;
232+ else if (nvbo->bo.mem.mem_type == TTM_PL_TT)
231233 rep->domain = NOUVEAU_GEM_DOMAIN_GART;
232234 else
233235 rep->domain = NOUVEAU_GEM_DOMAIN_VRAM;
234−
235236 rep->offset = nvbo->bo.offset;
236237 if (cli->vm) {
237238 vma = nouveau_bo_vma_find(nvbo, cli->vm);
drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c+6−0
@@ -267,6 +267,12 @@ init_i2c(struct nvbios_init *init, int index) · 266 unmodified lines
267267 index = NVKM_I2C_BUS_PRI;
268268 if (init->outp && init->outp->i2c_upper_default)
269269 index = NVKM_I2C_BUS_SEC;
270+ } else
271+ if (index == 0x80) {
272+ index = NVKM_I2C_BUS_PRI;
273+ } else
274+ if (index == 0x81) {
275+ index = NVKM_I2C_BUS_SEC;
270276 }
271277
272278 bus = nvkm_i2c_bus_find(i2c, index);
drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h+3−0
@@ -8,7 +8,10 @@ struct nvbios_source { · 7 unmodified lines
88 void *(*init)(struct nvkm_bios *, const char *);
99 void (*fini)(void *);
1010 u32 (*read)(void *, u32 offset, u32 length, struct nvkm_bios *);
11+ u32 (*size)(void *);
1112 bool rw;
13+ bool ignore_checksum;
14+ bool no_pcir;
1215 };
1316
1417 int nvbios_extend(struct nvkm_bios *, u32 length);
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c+18−9
@@ -45,7 +45,7 @@ shadow_fetch(struct nvkm_bios *bios, struct shadow *mthd, u32 upto) · 44 unmodified lines
4545 u32 read = mthd->func->read(data, start, limit - start, bios);
4646 bios->size = start + read;
4747 }
48− return bios->size >= limit;
48+ return bios->size >= upto;
4949 }
5050
5151 static int
@@ -55,14 +55,22 @@ shadow_image(struct nvkm_bios *bios, int idx, u32 offset, struct shadow *mthd) · 3 unmodified lines
5555 struct nvbios_image image;
5656 int score = 1;
5757
58− if (!shadow_fetch(bios, mthd, offset + 0x1000)) {
59− nvkm_debug(subdev, "%08x: header fetch failed\n", offset);
60− return 0;
61− }
58+ if (mthd->func->no_pcir) {
59+ image.base = 0;
60+ image.type = 0;
61+ image.size = mthd->func->size(mthd->data);
62+ image.last = 1;
63+ } else {
64+ if (!shadow_fetch(bios, mthd, offset + 0x1000)) {
65+ nvkm_debug(subdev, "%08x: header fetch failed\n",
66+ offset);
67+ return 0;
68+ }
6269
63− if (!nvbios_image(bios, idx, &image)) {
64− nvkm_debug(subdev, "image %d invalid\n", idx);
65− return 0;
70+ if (!nvbios_image(bios, idx, &image)) {
71+ nvkm_debug(subdev, "image %d invalid\n", idx);
72+ return 0;
73+ }
6674 }
6775 nvkm_debug(subdev, "%08x: type %02x, %d bytes\n",
6876 image.base, image.type, image.size);
@@ -74,7 +82,8 @@ shadow_image(struct nvkm_bios *bios, int idx, u32 offset, struct shadow *mthd) · 5 unmodified lines
7482
7583 switch (image.type) {
7684 case 0x00:
77− if (nvbios_checksum(&bios->data[image.base], image.size)) {
85+ if (!mthd->func->ignore_checksum &&
86+ nvbios_checksum(&bios->data[image.base], image.size)) {
7887 nvkm_debug(subdev, "%08x: checksum failed\n",
7988 image.base);
8089 if (mthd->func->rw)
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c+15−2
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 *
2222 */
2323 #include "priv.h"
24+
2425 #include <core/pci.h>
2526
2627 #if defined(__powerpc__)
@@ -33,17 +34,26 @@ static u32 · 6 unmodified lines
3334 of_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
3435 {
3536 struct priv *priv = data;
36− if (offset + length <= priv->size) {
37+ if (offset < priv->size) {
38+ length = min_t(u32, length, priv->size - offset);
3739 memcpy_fromio(bios->data + offset, priv->data + offset, length);
3840 return length;
3941 }
4042 return 0;
4143 }
4244
45+static u32
46+of_size(void *data)
47+{
48+ struct priv *priv = data;
49+ return priv->size;
50+}
51+
4352 static void *
4453 of_init(struct nvkm_bios *bios, const char *name)
4554 {
46− struct pci_dev *pdev = bios->subdev.device->func->pci(bios->subdev.device)->pdev;
55+ struct nvkm_device *device = bios->subdev.device;
56+ struct pci_dev *pdev = device->func->pci(device)->pdev;
4757 struct device_node *dn;
4858 struct priv *priv;
4959 if (!(dn = pci_device_to_OF_node(pdev)))
@@ -62,7 +72,10 @@ nvbios_of = { · 12 unmodified lines
6272 .init = of_init,
6373 .fini = (void(*)(void *))kfree,
6474 .read = of_read,
75+ .size = of_size,
6576 .rw = false,
77+ .ignore_checksum = true,
78+ .no_pcir = true,
6679 };
6780 #else
6881 const struct nvbios_source
drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.c+6−2
@@ -35,6 +35,8 @@ static const struct nvkm_device_agp_quirk · 34 unmodified lines
3535 nvkm_device_agp_quirks[] = {
3636 /* VIA Apollo PRO133x / GeForce FX 5600 Ultra - fdo#20341 */
3737 { PCI_VENDOR_ID_VIA, 0x0691, PCI_VENDOR_ID_NVIDIA, 0x0311, 2 },
38+ /* SiS 761 does not support AGP cards, use PCI mode */
39+ { PCI_VENDOR_ID_SI, 0x0761, PCI_ANY_ID, PCI_ANY_ID, 0 },
3840 {},
3941 };
4042
@@ -137,8 +139,10 @@ nvkm_agp_ctor(struct nvkm_pci *pci) · 96 unmodified lines
137139 while (quirk->hostbridge_vendor) {
138140 if (info.device->vendor == quirk->hostbridge_vendor &&
139141 info.device->device == quirk->hostbridge_device &&
140− pci->pdev->vendor == quirk->chip_vendor &&
141− pci->pdev->device == quirk->chip_device) {
142+ (quirk->chip_vendor == (u16)PCI_ANY_ID ||
143+ pci->pdev->vendor == quirk->chip_vendor) &&
144+ (quirk->chip_device == (u16)PCI_ANY_ID ||
145+ pci->pdev->device == quirk->chip_device)) {
142146 nvkm_info(subdev, "forcing default agp mode to %dX, "
143147 "use NvAGP=<mode> to override\n",
144148 quirk->mode);
drivers/gpu/drm/qxl/qxl_display.c+9−1
@@ -242,6 +242,10 @@ static int qxl_crtc_page_flip(struct drm_crtc *crtc, · 241 unmodified lines
242242 bo->is_primary = true;
243243
244244 ret = qxl_bo_reserve(bo, false);
245+ if (ret)
246+ return ret;
247+ ret = qxl_bo_pin(bo, bo->type, NULL);
248+ qxl_bo_unreserve(bo);
245249 if (ret)
246250 return ret;
247251
@@ -257,7 +261,11 @@ static int qxl_crtc_page_flip(struct drm_crtc *crtc, · 9 unmodified lines
257261 }
258262 drm_vblank_put(dev, qcrtc->index);
259263
260− qxl_bo_unreserve(bo);
264+ ret = qxl_bo_reserve(bo, false);
265+ if (!ret) {
266+ qxl_bo_unpin(bo);
267+ qxl_bo_unreserve(bo);
268+ }
261269
262270 return 0;
263271 }
drivers/gpu/drm/qxl/qxl_fb.c+11−8
@@ -144,14 +144,17 @@ static void qxl_dirty_update(struct qxl_fbdev *qfbdev, · 143 unmodified lines
144144
145145 spin_lock_irqsave(&qfbdev->dirty.lock, flags);
146146
147− if (qfbdev->dirty.y1 < y)
148− y = qfbdev->dirty.y1;
149− if (qfbdev->dirty.y2 > y2)
150− y2 = qfbdev->dirty.y2;
151− if (qfbdev->dirty.x1 < x)
152− x = qfbdev->dirty.x1;
153− if (qfbdev->dirty.x2 > x2)
154− x2 = qfbdev->dirty.x2;
147+ if ((qfbdev->dirty.y2 - qfbdev->dirty.y1) &&
148+ (qfbdev->dirty.x2 - qfbdev->dirty.x1)) {
149+ if (qfbdev->dirty.y1 < y)
150+ y = qfbdev->dirty.y1;
151+ if (qfbdev->dirty.y2 > y2)
152+ y2 = qfbdev->dirty.y2;
153+ if (qfbdev->dirty.x1 < x)
154+ x = qfbdev->dirty.x1;
155+ if (qfbdev->dirty.x2 > x2)
156+ x2 = qfbdev->dirty.x2;
157+ }
155158
156159 qfbdev->dirty.x1 = x;
157160 qfbdev->dirty.x2 = x2;
drivers/gpu/drm/qxl/qxl_release.c+1−3
@@ -307,7 +307,7 @@ int qxl_alloc_surface_release_reserved(struct qxl_device *qdev, · 306 unmodified lines
307307 idr_ret = qxl_release_alloc(qdev, QXL_RELEASE_SURFACE_CMD, release);
308308 if (idr_ret < 0)
309309 return idr_ret;
310− bo = qxl_bo_ref(to_qxl_bo(entry->tv.bo));
310+ bo = to_qxl_bo(entry->tv.bo);
311311
312312 (*release)->release_offset = create_rel->release_offset + 64;
313313
@@ -316,8 +316,6 @@ int qxl_alloc_surface_release_reserved(struct qxl_device *qdev, · 2 unmodified lines
316316 info = qxl_release_map(qdev, *release);
317317 info->id = idr_ret;
318318 qxl_release_unmap(qdev, *release, info);
319−
320− qxl_bo_unref(&bo);
321319 return 0;
322320 }
323321
drivers/gpu/drm/radeon/radeon_display.c+2−12
@@ -1633,18 +1633,8 @@ int radeon_modeset_init(struct radeon_device *rdev) · 1632 unmodified lines
16331633 radeon_fbdev_init(rdev);
16341634 drm_kms_helper_poll_init(rdev->ddev);
16351635
1636− if (rdev->pm.dpm_enabled) {
1637− /* do dpm late init */
1638− ret = radeon_pm_late_init(rdev);
1639− if (ret) {
1640− rdev->pm.dpm_enabled = false;
1641− DRM_ERROR("radeon_pm_late_init failed, disabling dpm\n");
1642− }
1643− /* set the dpm state for PX since there won't be
1644− * a modeset to call this.
1645− */
1646− radeon_pm_compute_clocks(rdev);
1647− }
1636+ /* do pm late init */
1637+ ret = radeon_pm_late_init(rdev);
16481638
16491639 return 0;
16501640 }
drivers/gpu/drm/radeon/radeon_dp_mst.c+1−0
@@ -283,6 +283,7 @@ static struct drm_connector *radeon_dp_add_mst_connector(struct drm_dp_mst_topol · 282 unmodified lines
283283 radeon_connector->mst_encoder = radeon_dp_create_fake_mst_encoder(master);
284284
285285 drm_object_attach_property(&connector->base, dev->mode_config.path_property, 0);
286+ drm_object_attach_property(&connector->base, dev->mode_config.tile_property, 0);
286287 drm_mode_connector_set_path_property(connector, pathprop);
287288
288289 return connector;
drivers/gpu/drm/radeon/radeon_fb.c+16−0
@@ -397,3 +397,19 @@ void radeon_fb_remove_connector(struct radeon_device *rdev, struct drm_connector · 396 unmodified lines
397397 {
398398 drm_fb_helper_remove_one_connector(&rdev->mode_info.rfbdev->helper, connector);
399399 }
400+
401+void radeon_fbdev_restore_mode(struct radeon_device *rdev)
402+{
403+ struct radeon_fbdev *rfbdev = rdev->mode_info.rfbdev;
404+ struct drm_fb_helper *fb_helper;
405+ int ret;
406+
407+ if (!rfbdev)
408+ return;
409+
410+ fb_helper = &rfbdev->helper;
411+
412+ ret = drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper);
413+ if (ret)
414+ DRM_DEBUG("failed to restore crtc mode\n");
415+}
drivers/gpu/drm/radeon/radeon_kms.c+4−1
@@ -598,7 +598,7 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file · 597 unmodified lines
598598 * Outdated mess for old drm with Xorg being in charge (void function now).
599599 */
600600 /**
601− * radeon_driver_firstopen_kms - drm callback for last close
601+ * radeon_driver_lastclose_kms - drm callback for last close
602602 *
603603 * @dev: drm dev pointer
604604 *
@@ -606,6 +606,9 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file · 1 unmodified line
606606 */
607607 void radeon_driver_lastclose_kms(struct drm_device *dev)
608608 {
609+ struct radeon_device *rdev = dev->dev_private;
610+
611+ radeon_fbdev_restore_mode(rdev);
609612 vga_switcheroo_process_delayed_switch();
610613 }
611614
drivers/gpu/drm/radeon/radeon_mode.h+1−0
@@ -980,6 +980,7 @@ int radeon_fbdev_init(struct radeon_device *rdev); · 979 unmodified lines
980980 void radeon_fbdev_fini(struct radeon_device *rdev);
981981 void radeon_fbdev_set_suspend(struct radeon_device *rdev, int state);
982982 bool radeon_fbdev_robj_is_fb(struct radeon_device *rdev, struct radeon_bo *robj);
983+void radeon_fbdev_restore_mode(struct radeon_device *rdev);
983984
984985 void radeon_fb_output_poll_changed(struct radeon_device *rdev);
985986
drivers/gpu/drm/radeon/radeon_pm.c+44−27
@@ -717,10 +717,14 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj, · 716 unmodified lines
717717 struct radeon_device *rdev = dev_get_drvdata(dev);
718718 umode_t effective_mode = attr->mode;
719719
720− /* Skip limit attributes if DPM is not enabled */
720+ /* Skip attributes if DPM is not enabled */
721721 if (rdev->pm.pm_method != PM_METHOD_DPM &&
722722 (attr == &sensor_dev_attr_temp1_crit.dev_attr.attr ||
723− attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr))
723+ attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr ||
724+ attr == &sensor_dev_attr_pwm1.dev_attr.attr ||
725+ attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr ||
726+ attr == &sensor_dev_attr_pwm1_max.dev_attr.attr ||
727+ attr == &sensor_dev_attr_pwm1_min.dev_attr.attr))
724728 return 0;
725729
726730 /* Skip fan attributes if fan is not present */
@@ -1326,14 +1330,6 @@ static int radeon_pm_init_old(struct radeon_device *rdev) · 599 unmodified lines
13261330 INIT_DELAYED_WORK(&rdev->pm.dynpm_idle_work, radeon_dynpm_idle_work_handler);
13271331
13281332 if (rdev->pm.num_power_states > 1) {
1329− /* where's the best place to put these? */
1330− ret = device_create_file(rdev->dev, &dev_attr_power_profile);
1331− if (ret)
1332− DRM_ERROR("failed to create device file for power profile\n");
1333− ret = device_create_file(rdev->dev, &dev_attr_power_method);
1334− if (ret)
1335− DRM_ERROR("failed to create device file for power method\n");
1336−
13371333 if (radeon_debugfs_pm_init(rdev)) {
13381334 DRM_ERROR("Failed to register debugfs file for PM!\n");
13391335 }
@@ -1391,20 +1387,6 @@ static int radeon_pm_init_dpm(struct radeon_device *rdev) · 51 unmodified lines
13911387 goto dpm_failed;
13921388 rdev->pm.dpm_enabled = true;
13931389
1394− ret = device_create_file(rdev->dev, &dev_attr_power_dpm_state);
1395− if (ret)
1396− DRM_ERROR("failed to create device file for dpm state\n");
1397− ret = device_create_file(rdev->dev, &dev_attr_power_dpm_force_performance_level);
1398− if (ret)
1399− DRM_ERROR("failed to create device file for dpm state\n");
1400− /* XXX: these are noops for dpm but are here for backwards compat */
1401− ret = device_create_file(rdev->dev, &dev_attr_power_profile);
1402− if (ret)
1403− DRM_ERROR("failed to create device file for power profile\n");
1404− ret = device_create_file(rdev->dev, &dev_attr_power_method);
1405− if (ret)
1406− DRM_ERROR("failed to create device file for power method\n");
1407−
14081390 if (radeon_debugfs_pm_init(rdev)) {
14091391 DRM_ERROR("Failed to register debugfs file for dpm!\n");
14101392 }
@@ -1545,9 +1527,44 @@ int radeon_pm_late_init(struct radeon_device *rdev) · 134 unmodified lines
15451527 int ret = 0;
15461528
15471529 if (rdev->pm.pm_method == PM_METHOD_DPM) {
1548− mutex_lock(&rdev->pm.mutex);
1549− ret = radeon_dpm_late_enable(rdev);
1550− mutex_unlock(&rdev->pm.mutex);
1530+ if (rdev->pm.dpm_enabled) {
1531+ ret = device_create_file(rdev->dev, &dev_attr_power_dpm_state);
1532+ if (ret)
1533+ DRM_ERROR("failed to create device file for dpm state\n");
1534+ ret = device_create_file(rdev->dev, &dev_attr_power_dpm_force_performance_level);
1535+ if (ret)
1536+ DRM_ERROR("failed to create device file for dpm state\n");
1537+ /* XXX: these are noops for dpm but are here for backwards compat */
1538+ ret = device_create_file(rdev->dev, &dev_attr_power_profile);
1539+ if (ret)
1540+ DRM_ERROR("failed to create device file for power profile\n");
1541+ ret = device_create_file(rdev->dev, &dev_attr_power_method);
1542+ if (ret)
1543+ DRM_ERROR("failed to create device file for power method\n");
1544+
1545+ mutex_lock(&rdev->pm.mutex);
1546+ ret = radeon_dpm_late_enable(rdev);
1547+ mutex_unlock(&rdev->pm.mutex);
1548+ if (ret) {
1549+ rdev->pm.dpm_enabled = false;
1550+ DRM_ERROR("radeon_pm_late_init failed, disabling dpm\n");
1551+ } else {
1552+ /* set the dpm state for PX since there won't be
1553+ * a modeset to call this.
1554+ */
1555+ radeon_pm_compute_clocks(rdev);
1556+ }
1557+ }
1558+ } else {
1559+ if (rdev->pm.num_power_states > 1) {
1560+ /* where's the best place to put these? */
1561+ ret = device_create_file(rdev->dev, &dev_attr_power_profile);
1562+ if (ret)
1563+ DRM_ERROR("failed to create device file for power profile\n");
1564+ ret = device_create_file(rdev->dev, &dev_attr_power_method);
1565+ if (ret)
1566+ DRM_ERROR("failed to create device file for power method\n");
1567+ }
15511568 }
15521569 return ret;
15531570 }
drivers/gpu/drm/radeon/si_dpm.c+1−0
@@ -2928,6 +2928,7 @@ static struct si_dpm_quirk si_dpm_quirk_list[] = { · 2927 unmodified lines
29282928 { PCI_VENDOR_ID_ATI, 0x6811, 0x174b, 0xe271, 0, 120000 },
29292929 { PCI_VENDOR_ID_ATI, 0x6810, 0x174b, 0xe271, 85000, 90000 },
29302930 { PCI_VENDOR_ID_ATI, 0x6811, 0x1762, 0x2015, 0, 120000 },
2931+ { PCI_VENDOR_ID_ATI, 0x6811, 0x1043, 0x2015, 0, 120000 },
29312932 { 0, 0, 0, 0 },
29322933 };
29332934
drivers/gpu/drm/virtio/virtgpu_debugfs.c+2−2
@@ -34,8 +34,8 @@ virtio_gpu_debugfs_irq_info(struct seq_file *m, void *data) · 33 unmodified lines
3434 struct drm_info_node *node = (struct drm_info_node *) m->private;
3535 struct virtio_gpu_device *vgdev = node->minor->dev->dev_private;
3636
37− seq_printf(m, "fence %ld %lld\n",
38− atomic64_read(&vgdev->fence_drv.last_seq),
37+ seq_printf(m, "fence %llu %lld\n",
38+ (u64)atomic64_read(&vgdev->fence_drv.last_seq),
3939 vgdev->fence_drv.sync_seq);
4040 return 0;
4141 }
drivers/gpu/drm/virtio/virtgpu_fence.c+1−1
@@ -61,7 +61,7 @@ static void virtio_timeline_value_str(struct fence *f, char *str, int size) · 60 unmodified lines
6161 {
6262 struct virtio_gpu_fence *fence = to_virtio_fence(f);
6363
64− snprintf(str, size, "%lu", atomic64_read(&fence->drv->last_seq));
64+ snprintf(str, size, "%llu", (u64)atomic64_read(&fence->drv->last_seq));
6565 }
6666
6767 static const struct fence_ops virtio_fence_ops = {
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c+2−1
@@ -657,7 +657,8 @@ static void vmw_user_surface_base_release(struct ttm_base_object **p_base) · 656 unmodified lines
657657 struct vmw_resource *res = &user_srf->srf.res;
658658
659659 *p_base = NULL;
660− ttm_base_object_unref(&user_srf->backup_base);
660+ if (user_srf->backup_base)
661+ ttm_base_object_unref(&user_srf->backup_base);
661662 vmw_resource_unreference(&res);
662663 }
663664
drivers/i2c/busses/i2c-designware-platdrv.c+27−6
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 #include <linux/kernel.h>
2525 #include <linux/module.h>
2626 #include <linux/delay.h>
27+#include <linux/dmi.h>
2728 #include <linux/i2c.h>
2829 #include <linux/clk.h>
2930 #include <linux/clk-provider.h>
@@ -51,6 +52,22 @@ static u32 i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev) · 21 unmodified lines
5152 }
5253
5354 #ifdef CONFIG_ACPI
55+/*
56+ * The HCNT/LCNT information coming from ACPI should be the most accurate
57+ * for given platform. However, some systems get it wrong. On such systems
58+ * we get better results by calculating those based on the input clock.
59+ */
60+static const struct dmi_system_id dw_i2c_no_acpi_params[] = {
61+ {
62+ .ident = "Dell Inspiron 7348",
63+ .matches = {
64+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
65+ DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7348"),
66+ },
67+ },
68+ { }
69+};
70+
5471 static void dw_i2c_acpi_params(struct platform_device *pdev, char method[],
5572 u16 *hcnt, u16 *lcnt, u32 *sda_hold)
5673 {
@@ -58,6 +75,9 @@ static void dw_i2c_acpi_params(struct platform_device *pdev, char method[], · 1 unmodified line
5875 acpi_handle handle = ACPI_HANDLE(&pdev->dev);
5976 union acpi_object *obj;
6077
78+ if (dmi_check_system(dw_i2c_no_acpi_params))
79+ return;
80+
6181 if (ACPI_FAILURE(acpi_evaluate_object(handle, method, NULL, &buf)))
6282 return;
6383
@@ -253,12 +273,6 @@ static int dw_i2c_probe(struct platform_device *pdev) · 189 unmodified lines
253273 adap->dev.parent = &pdev->dev;
254274 adap->dev.of_node = pdev->dev.of_node;
255275
256− r = i2c_add_numbered_adapter(adap);
257− if (r) {
258− dev_err(&pdev->dev, "failure adding adapter\n");
259− return r;
260− }
261−
262276 if (dev->pm_runtime_disabled) {
263277 pm_runtime_forbid(&pdev->dev);
264278 } else {
@@ -268,6 +282,13 @@ static int dw_i2c_probe(struct platform_device *pdev) · 3 unmodified lines
268282 pm_runtime_enable(&pdev->dev);
269283 }
270284
285+ r = i2c_add_numbered_adapter(adap);
286+ if (r) {
287+ dev_err(&pdev->dev, "failure adding adapter\n");
288+ pm_runtime_disable(&pdev->dev);
289+ return r;
290+ }
291+
271292 return 0;
272293 }
273294
drivers/i2c/busses/i2c-rcar.c+4−3
@@ -690,15 +690,16 @@ static int rcar_i2c_probe(struct platform_device *pdev) · 689 unmodified lines
690690 return ret;
691691 }
692692
693+ pm_runtime_enable(dev);
694+ platform_set_drvdata(pdev, priv);
695+
693696 ret = i2c_add_numbered_adapter(adap);
694697 if (ret < 0) {
695698 dev_err(dev, "reg adap failed: %d\n", ret);
699+ pm_runtime_disable(dev);
696700 return ret;
697701 }
698702
699− pm_runtime_enable(dev);
700− platform_set_drvdata(pdev, priv);
701−
702703 dev_info(dev, "probed\n");
703704
704705 return 0;
drivers/i2c/busses/i2c-s3c2410.c+5−3
@@ -1243,17 +1243,19 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) · 1242 unmodified lines
12431243 i2c->adap.nr = i2c->pdata->bus_num;
12441244 i2c->adap.dev.of_node = pdev->dev.of_node;
12451245
1246+ platform_set_drvdata(pdev, i2c);
1247+
1248+ pm_runtime_enable(&pdev->dev);
1249+
12461250 ret = i2c_add_numbered_adapter(&i2c->adap);
12471251 if (ret < 0) {
12481252 dev_err(&pdev->dev, "failed to add bus to i2c core\n");
1253+ pm_runtime_disable(&pdev->dev);
12491254 s3c24xx_i2c_deregister_cpufreq(i2c);
12501255 clk_unprepare(i2c->clk);
12511256 return ret;
12521257 }
12531258
1254− platform_set_drvdata(pdev, i2c);
1255−
1256− pm_runtime_enable(&pdev->dev);
12571259 pm_runtime_enable(&i2c->adap.dev);
12581260
12591261 dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev));
drivers/i2c/i2c-core.c+6−6
@@ -694,12 +694,12 @@ static int i2c_device_probe(struct device *dev) · 693 unmodified lines
694694 goto err_clear_wakeup_irq;
695695
696696 status = dev_pm_domain_attach(&client->dev, true);
697− if (status != -EPROBE_DEFER) {
698− status = driver->probe(client, i2c_match_id(driver->id_table,
699− client));
700− if (status)
701− goto err_detach_pm_domain;
702− }
697+ if (status == -EPROBE_DEFER)
698+ goto err_clear_wakeup_irq;
699+
700+ status = driver->probe(client, i2c_match_id(driver->id_table, client));
701+ if (status)
702+ goto err_detach_pm_domain;
703703
704704 return 0;
705705
drivers/iio/accel/st_accel_core.c+0−6
@@ -149,8 +149,6 @@ · 148 unmodified lines
149149 #define ST_ACCEL_4_BDU_MASK 0x40
150150 #define ST_ACCEL_4_DRDY_IRQ_ADDR 0x21
151151 #define ST_ACCEL_4_DRDY_IRQ_INT1_MASK 0x04
152−#define ST_ACCEL_4_IG1_EN_ADDR 0x21
153−#define ST_ACCEL_4_IG1_EN_MASK 0x08
154152 #define ST_ACCEL_4_MULTIREAD_BIT true
155153
156154 /* CUSTOM VALUES FOR SENSOR 5 */
@@ -489,10 +487,6 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = { · 332 unmodified lines
489487 .drdy_irq = {
490488 .addr = ST_ACCEL_4_DRDY_IRQ_ADDR,
491489 .mask_int1 = ST_ACCEL_4_DRDY_IRQ_INT1_MASK,
492− .ig1 = {
493− .en_addr = ST_ACCEL_4_IG1_EN_ADDR,
494− .en_mask = ST_ACCEL_4_IG1_EN_MASK,
495− },
496490 },
497491 .multi_read_bit = ST_ACCEL_4_MULTIREAD_BIT,
498492 .bootime = 2, /* guess */
drivers/iio/adc/twl4030-madc.c+34−0
@@ -45,13 +45,18 @@ · 44 unmodified lines
4545 #include <linux/types.h>
4646 #include <linux/gfp.h>
4747 #include <linux/err.h>
48+#include <linux/regulator/consumer.h>
4849
4950 #include <linux/iio/iio.h>
5051
52+#define TWL4030_USB_SEL_MADC_MCPC (1<<3)
53+#define TWL4030_USB_CARKIT_ANA_CTRL 0xBB
54+
5155 /**
5256 * struct twl4030_madc_data - a container for madc info
5357 * @dev: Pointer to device structure for madc
5458 * @lock: Mutex protecting this data structure
59+ * @regulator: Pointer to bias regulator for madc
5560 * @requests: Array of request struct corresponding to SW1, SW2 and RT
5661 * @use_second_irq: IRQ selection (main or co-processor)
5762 * @imr: Interrupt mask register of MADC
@@ -60,6 +65,7 @@ · 2 unmodified lines
6065 struct twl4030_madc_data {
6166 struct device *dev;
6267 struct mutex lock; /* mutex protecting this data structure */
68+ struct regulator *usb3v1;
6369 struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS];
6470 bool use_second_irq;
6571 u8 imr;
@@ -841,6 +847,32 @@ static int twl4030_madc_probe(struct platform_device *pdev) · 775 unmodified lines
841847 }
842848 twl4030_madc = madc;
843849
850+ /* Configure MADC[3:6] */
851+ ret = twl_i2c_read_u8(TWL_MODULE_USB, &regval,
852+ TWL4030_USB_CARKIT_ANA_CTRL);
853+ if (ret) {
854+ dev_err(&pdev->dev, "unable to read reg CARKIT_ANA_CTRL 0x%X\n",
855+ TWL4030_USB_CARKIT_ANA_CTRL);
856+ goto err_i2c;
857+ }
858+ regval |= TWL4030_USB_SEL_MADC_MCPC;
859+ ret = twl_i2c_write_u8(TWL_MODULE_USB, regval,
860+ TWL4030_USB_CARKIT_ANA_CTRL);
861+ if (ret) {
862+ dev_err(&pdev->dev, "unable to write reg CARKIT_ANA_CTRL 0x%X\n",
863+ TWL4030_USB_CARKIT_ANA_CTRL);
864+ goto err_i2c;
865+ }
866+
867+ /* Enable 3v1 bias regulator for MADC[3:6] */
868+ madc->usb3v1 = devm_regulator_get(madc->dev, "vusb3v1");
869+ if (IS_ERR(madc->usb3v1))
870+ return -ENODEV;
871+
872+ ret = regulator_enable(madc->usb3v1);
873+ if (ret)
874+ dev_err(madc->dev, "could not enable 3v1 bias regulator\n");
875+
844876 ret = iio_device_register(iio_dev);
845877 if (ret) {
846878 dev_err(&pdev->dev, "could not register iio device\n");
@@ -866,6 +898,8 @@ static int twl4030_madc_remove(struct platform_device *pdev) · 19 unmodified lines
866898 twl4030_madc_set_current_generator(madc, 0, 0);
867899 twl4030_madc_set_power(madc, 0);
868900
901+ regulator_disable(madc->usb3v1);
902+
869903 return 0;
870904 }
871905
drivers/infiniband/core/cache.c+1−1
@@ -508,12 +508,12 @@ void ib_cache_gid_set_default_gid(struct ib_device *ib_dev, u8 port, · 507 unmodified lines
508508 memset(&gid_attr, 0, sizeof(gid_attr));
509509 gid_attr.ndev = ndev;
510510
511+ mutex_lock(&table->lock);
511512 ix = find_gid(table, NULL, NULL, true, GID_ATTR_FIND_MASK_DEFAULT);
512513
513514 /* Coudn't find default GID location */
514515 WARN_ON(ix < 0);
515516
516− mutex_lock(&table->lock);
517517 if (!__ib_cache_gid_get(ib_dev, port, ix,
518518 &current_gid, &current_gid_attr) &&
519519 mode == IB_CACHE_GID_DEFAULT_MODE_SET &&
drivers/infiniband/core/cm.c+9−1
@@ -835,6 +835,11 @@ retest: · 834 unmodified lines
835835 case IB_CM_SIDR_REQ_RCVD:
836836 spin_unlock_irq(&cm_id_priv->lock);
837837 cm_reject_sidr_req(cm_id_priv, IB_SIDR_REJECT);
838+ spin_lock_irq(&cm.lock);
839+ if (!RB_EMPTY_NODE(&cm_id_priv->sidr_id_node))
840+ rb_erase(&cm_id_priv->sidr_id_node,
841+ &cm.remote_sidr_table);
842+ spin_unlock_irq(&cm.lock);
838843 break;
839844 case IB_CM_REQ_SENT:
840845 case IB_CM_MRA_REQ_RCVD:
@@ -3172,7 +3177,10 @@ int ib_send_cm_sidr_rep(struct ib_cm_id *cm_id, · 2331 unmodified lines
31723177 spin_unlock_irqrestore(&cm_id_priv->lock, flags);
31733178
31743179 spin_lock_irqsave(&cm.lock, flags);
3175− rb_erase(&cm_id_priv->sidr_id_node, &cm.remote_sidr_table);
3180+ if (!RB_EMPTY_NODE(&cm_id_priv->sidr_id_node)) {
3181+ rb_erase(&cm_id_priv->sidr_id_node, &cm.remote_sidr_table);
3182+ RB_CLEAR_NODE(&cm_id_priv->sidr_id_node);
3183+ }
31763184 spin_unlock_irqrestore(&cm.lock, flags);
31773185 return 0;
31783186
drivers/infiniband/core/cma.c+43−17
@@ -1067,14 +1067,14 @@ static int cma_save_req_info(const struct ib_cm_event *ib_event, · 1066 unmodified lines
10671067 sizeof(req->local_gid));
10681068 req->has_gid = true;
10691069 req->service_id = req_param->primary_path->service_id;
1070− req->pkey = req_param->bth_pkey;
1070+ req->pkey = be16_to_cpu(req_param->primary_path->pkey);
10711071 break;
10721072 case IB_CM_SIDR_REQ_RECEIVED:
10731073 req->device = sidr_param->listen_id->device;
10741074 req->port = sidr_param->port;
10751075 req->has_gid = false;
10761076 req->service_id = sidr_param->service_id;
1077− req->pkey = sidr_param->bth_pkey;
1077+ req->pkey = sidr_param->pkey;
10781078 break;
10791079 default:
10801080 return -EINVAL;
@@ -1232,14 +1232,32 @@ static bool cma_match_private_data(struct rdma_id_private *id_priv, · 151 unmodified lines
12321232 return true;
12331233 }
12341234
1235+static bool cma_protocol_roce_dev_port(struct ib_device *device, int port_num)
1236+{
1237+ enum rdma_link_layer ll = rdma_port_get_link_layer(device, port_num);
1238+ enum rdma_transport_type transport =
1239+ rdma_node_get_transport(device->node_type);
1240+
1241+ return ll == IB_LINK_LAYER_ETHERNET && transport == RDMA_TRANSPORT_IB;
1242+}
1243+
1244+static bool cma_protocol_roce(const struct rdma_cm_id *id)
1245+{
1246+ struct ib_device *device = id->device;
1247+ const int port_num = id->port_num ?: rdma_start_port(device);
1248+
1249+ return cma_protocol_roce_dev_port(device, port_num);
1250+}
1251+
12351252 static bool cma_match_net_dev(const struct rdma_id_private *id_priv,
12361253 const struct net_device *net_dev)
12371254 {
12381255 const struct rdma_addr *addr = &id_priv->id.route.addr;
12391256
12401257 if (!net_dev)
1241− /* This request is an AF_IB request */
1242− return addr->src_addr.ss_family == AF_IB;
1258+ /* This request is an AF_IB request or a RoCE request */
1259+ return addr->src_addr.ss_family == AF_IB ||
1260+ cma_protocol_roce(&id_priv->id);
12431261
12441262 return !addr->dev_addr.bound_dev_if ||
12451263 (net_eq(dev_net(net_dev), &init_net) &&
@@ -1294,6 +1312,10 @@ static struct rdma_id_private *cma_id_from_event(struct ib_cm_id *cm_id, · 48 unmodified lines
12941312 if (PTR_ERR(*net_dev) == -EAFNOSUPPORT) {
12951313 /* Assuming the protocol is AF_IB */
12961314 *net_dev = NULL;
1315+ } else if (cma_protocol_roce_dev_port(req.device, req.port)) {
1316+ /* TODO find the net dev matching the request parameters
1317+ * through the RoCE GID table */
1318+ *net_dev = NULL;
12971319 } else {
12981320 return ERR_CAST(*net_dev);
12991321 }
@@ -1302,7 +1324,7 @@ static struct rdma_id_private *cma_id_from_event(struct ib_cm_id *cm_id, · 2 unmodified lines
13021324 bind_list = cma_ps_find(rdma_ps_from_service_id(req.service_id),
13031325 cma_port_from_service_id(req.service_id));
13041326 id_priv = cma_find_listener(bind_list, cm_id, ib_event, &req, *net_dev);
1305− if (IS_ERR(id_priv)) {
1327+ if (IS_ERR(id_priv) && *net_dev) {
13061328 dev_put(*net_dev);
13071329 *net_dev = NULL;
13081330 }
@@ -1593,11 +1615,16 @@ static struct rdma_id_private *cma_new_conn_id(struct rdma_cm_id *listen_id, · 284 unmodified lines
15931615 if (ret)
15941616 goto err;
15951617 } else {
1596− /* An AF_IB connection */
1597− WARN_ON_ONCE(ss_family != AF_IB);
1598−
1599− cma_translate_ib((struct sockaddr_ib *)cma_src_addr(id_priv),
1600− &rt->addr.dev_addr);
1618+ if (!cma_protocol_roce(listen_id) &&
1619+ cma_any_addr(cma_src_addr(id_priv))) {
1620+ rt->addr.dev_addr.dev_type = ARPHRD_INFINIBAND;
1621+ rdma_addr_set_sgid(&rt->addr.dev_addr, &rt->path_rec[0].sgid);
1622+ ib_addr_set_pkey(&rt->addr.dev_addr, be16_to_cpu(rt->path_rec[0].pkey));
1623+ } else if (!cma_any_addr(cma_src_addr(id_priv))) {
1624+ ret = cma_translate_addr(cma_src_addr(id_priv), &rt->addr.dev_addr);
1625+ if (ret)
1626+ goto err;
1627+ }
16011628 }
16021629 rdma_addr_set_dgid(&rt->addr.dev_addr, &rt->path_rec[0].dgid);
16031630
@@ -1635,13 +1662,12 @@ static struct rdma_id_private *cma_new_udp_id(struct rdma_cm_id *listen_id, · 31 unmodified lines
16351662 if (ret)
16361663 goto err;
16371664 } else {
1638− /* An AF_IB connection */
1639− WARN_ON_ONCE(ss_family != AF_IB);
1640−
1641− if (!cma_any_addr(cma_src_addr(id_priv)))
1642− cma_translate_ib((struct sockaddr_ib *)
1643− cma_src_addr(id_priv),
1644− &id->route.addr.dev_addr);
1665+ if (!cma_any_addr(cma_src_addr(id_priv))) {
1666+ ret = cma_translate_addr(cma_src_addr(id_priv),
1667+ &id->route.addr.dev_addr);
1668+ if (ret)
1669+ goto err;
1670+ }
16451671 }
16461672
16471673 id_priv->state = RDMA_CM_CONNECT;
drivers/infiniband/core/roce_gid_mgmt.c+27−8
@@ -250,25 +250,44 @@ static void enum_netdev_ipv4_ips(struct ib_device *ib_dev, · 249 unmodified lines
250250 u8 port, struct net_device *ndev)
251251 {
252252 struct in_device *in_dev;
253+ struct sin_list {
254+ struct list_head list;
255+ struct sockaddr_in ip;
256+ };
257+ struct sin_list *sin_iter;
258+ struct sin_list *sin_temp;
253259
260+ LIST_HEAD(sin_list);
254261 if (ndev->reg_state >= NETREG_UNREGISTERING)
255262 return;
256263
257− in_dev = in_dev_get(ndev);
258− if (!in_dev)
264+ rcu_read_lock();
265+ in_dev = __in_dev_get_rcu(ndev);
266+ if (!in_dev) {
267+ rcu_read_unlock();
259268 return;
269+ }
260270
261271 for_ifa(in_dev) {
262− struct sockaddr_in ip;
272+ struct sin_list *entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
263273
264− ip.sin_family = AF_INET;
265− ip.sin_addr.s_addr = ifa->ifa_address;
266− update_gid_ip(GID_ADD, ib_dev, port, ndev,
267− (struct sockaddr *)&ip);
274+ if (!entry) {
275+ pr_warn("roce_gid_mgmt: couldn't allocate entry for IPv4 update\n");
276+ continue;
277+ }
278+ entry->ip.sin_family = AF_INET;
279+ entry->ip.sin_addr.s_addr = ifa->ifa_address;
280+ list_add_tail(&entry->list, &sin_list);
268281 }
269282 endfor_ifa(in_dev);
283+ rcu_read_unlock();
270284
271− in_dev_put(in_dev);
285+ list_for_each_entry_safe(sin_iter, sin_temp, &sin_list, list) {
286+ update_gid_ip(GID_ADD, ib_dev, port, ndev,
287+ (struct sockaddr *)&sin_iter->ip);
288+ list_del(&sin_iter->list);
289+ kfree(sin_iter);
290+ }
272291 }
273292
274293 static void enum_netdev_ipv6_ips(struct ib_device *ib_dev,
drivers/infiniband/core/ucma.c+6−1
@@ -1624,11 +1624,16 @@ static int ucma_open(struct inode *inode, struct file *filp) · 1623 unmodified lines
16241624 if (!file)
16251625 return -ENOMEM;
16261626
1627+ file->close_wq = create_singlethread_workqueue("ucma_close_id");
1628+ if (!file->close_wq) {
1629+ kfree(file);
1630+ return -ENOMEM;
1631+ }
1632+
16271633 INIT_LIST_HEAD(&file->event_list);
16281634 INIT_LIST_HEAD(&file->ctx_list);
16291635 init_waitqueue_head(&file->poll_wait);
16301636 mutex_init(&file->mut);
1631− file->close_wq = create_singlethread_workqueue("ucma_close_id");
16321637
16331638 filp->private_data = file;
16341639 file->filp = filp;
drivers/infiniband/hw/usnic/usnic.h+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_abi.h+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_common_pkt_hdr.h+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_common_util.h+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_debugfs.c+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_debugfs.h+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_fwd.c+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_fwd.h+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_ib.h+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_ib_main.c+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_ib_sysfs.c+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_ib_sysfs.h+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_ib_verbs.c+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_ib_verbs.h+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_log.h+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_transport.c+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_transport.h+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_uiom.c+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 * licenses. You may choose to be licensed under the terms of the GNU
88 * General Public License (GPL) Version 2, available from the file
99 * COPYING in the main directory of this source tree, or the
10− * OpenIB.org BSD license below:
10+ * BSD license below:
1111 *
1212 * Redistribution and use in source and binary forms, with or
1313 * without modification, are permitted provided that the following
drivers/infiniband/hw/usnic/usnic_uiom.h+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.c+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2014, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.h+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_vnic.c+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/hw/usnic/usnic_vnic.h+18−3
@@ -1,9 +1,24 @@
11 /*
22 * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
33 *
4− * This program is free software; you may redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 2 of the License.
4+ * This software is available to you under a choice of one of two
5+ * licenses. You may choose to be licensed under the terms of the GNU
6+ * General Public License (GPL) Version 2, available from the file
7+ * COPYING in the main directory of this source tree, or the
8+ * BSD license below:
9+ *
10+ * Redistribution and use in source and binary forms, with or
11+ * without modification, are permitted provided that the following
12+ * conditions are met:
13+ *
14+ * - Redistributions of source code must retain the above
15+ * copyright notice, this list of conditions and the following
16+ * disclaimer.
17+ *
18+ * - Redistributions in binary form must reproduce the above
19+ * copyright notice, this list of conditions and the following
20+ * disclaimer in the documentation and/or other materials
21+ * provided with the distribution.
722 *
823 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
924 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
drivers/infiniband/ulp/ipoib/ipoib.h+1−0
@@ -495,6 +495,7 @@ void ipoib_dev_cleanup(struct net_device *dev); · 494 unmodified lines
495495 void ipoib_mcast_join_task(struct work_struct *work);
496496 void ipoib_mcast_carrier_on_task(struct work_struct *work);
497497 void ipoib_mcast_send(struct net_device *dev, u8 *daddr, struct sk_buff *skb);
498+void ipoib_mcast_free(struct ipoib_mcast *mc);
498499
499500 void ipoib_mcast_restart_task(struct work_struct *work);
500501 int ipoib_mcast_start_thread(struct net_device *dev);
drivers/infiniband/ulp/ipoib/ipoib_main.c+3−1
@@ -1207,8 +1207,10 @@ static void __ipoib_reap_neigh(struct ipoib_dev_priv *priv) · 1206 unmodified lines
12071207
12081208 out_unlock:
12091209 spin_unlock_irqrestore(&priv->lock, flags);
1210− list_for_each_entry_safe(mcast, tmcast, &remove_list, list)
1210+ list_for_each_entry_safe(mcast, tmcast, &remove_list, list) {
12111211 ipoib_mcast_leave(dev, mcast);
1212+ ipoib_mcast_free(mcast);
1213+ }
12121214 }
12131215
12141216 static void ipoib_reap_neigh(struct work_struct *work)
drivers/infiniband/ulp/ipoib/ipoib_multicast.c+1−1
@@ -106,7 +106,7 @@ static void __ipoib_mcast_schedule_join_thread(struct ipoib_dev_priv *priv, · 105 unmodified lines
106106 queue_delayed_work(priv->wq, &priv->mcast_task, 0);
107107 }
108108
109−static void ipoib_mcast_free(struct ipoib_mcast *mcast)
109+void ipoib_mcast_free(struct ipoib_mcast *mcast)
110110 {
111111 struct net_device *dev = mcast->dev;
112112 int tx_dropped = 0;
drivers/input/mouse/cyapa_gen6.c+3−7
@@ -241,14 +241,10 @@ static int cyapa_gen6_read_sys_info(struct cyapa *cyapa) · 240 unmodified lines
241241 memcpy(&cyapa->product_id[13], &resp_data[62], 2);
242242 cyapa->product_id[15] = '\0';
243243
244+ /* Get the number of Rx electrodes. */
244245 rotat_align = resp_data[68];
245− if (rotat_align) {
246− cyapa->electrodes_rx = cyapa->electrodes_y;
247− cyapa->electrodes_rx = cyapa->electrodes_y;
248− } else {
249− cyapa->electrodes_rx = cyapa->electrodes_x;
250− cyapa->electrodes_rx = cyapa->electrodes_y;
251− }
246+ cyapa->electrodes_rx =
247+ rotat_align ? cyapa->electrodes_y : cyapa->electrodes_x;
252248 cyapa->aligned_electrodes_rx = (cyapa->electrodes_rx + 3) & ~3u;
253249
254250 if (!cyapa->electrodes_x || !cyapa->electrodes_y ||
drivers/input/touchscreen/ads7846.c+6−2
@@ -668,18 +668,22 @@ static int ads7846_no_filter(void *ads, int data_idx, int *val) · 667 unmodified lines
668668
669669 static int ads7846_get_value(struct ads7846 *ts, struct spi_message *m)
670670 {
671+ int value;
671672 struct spi_transfer *t =
672673 list_entry(m->transfers.prev, struct spi_transfer, transfer_list);
673674
674675 if (ts->model == 7845) {
675− return be16_to_cpup((__be16 *)&(((char*)t->rx_buf)[1])) >> 3;
676+ value = be16_to_cpup((__be16 *)&(((char *)t->rx_buf)[1]));
676677 } else {
677678 /*
678679 * adjust: on-wire is a must-ignore bit, a BE12 value, then
679680 * padding; built from two 8 bit values written msb-first.
680681 */
681− return be16_to_cpup((__be16 *)t->rx_buf) >> 3;
682+ value = be16_to_cpup((__be16 *)t->rx_buf);
682683 }
684+
685+ /* enforce ADC output is 12 bits width */
686+ return (value >> 3) & 0xfff;
683687 }
684688
685689 static void ads7846_update_value(struct spi_message *m, int val)
drivers/iommu/Kconfig+1−2
@@ -23,8 +23,7 @@ config IOMMU_IO_PGTABLE · 22 unmodified lines
2323 config IOMMU_IO_PGTABLE_LPAE
2424 bool "ARMv7/v8 Long Descriptor Format"
2525 select IOMMU_IO_PGTABLE
26− # SWIOTLB guarantees a dma_to_phys() implementation
27− depends on ARM || ARM64 || (COMPILE_TEST && SWIOTLB)
26+ depends on HAS_DMA && (ARM || ARM64 || COMPILE_TEST)
2827 help
2928 Enable support for the ARM long descriptor pagetable format.
3029 This allocator supports 4K/2M/1G, 16K/32M and 64K/512M page
drivers/iommu/amd_iommu.c+9−0
@@ -2006,6 +2006,15 @@ static void do_detach(struct iommu_dev_data *dev_data) · 2005 unmodified lines
20062006 {
20072007 struct amd_iommu *iommu;
20082008
2009+ /*
2010+ * First check if the device is still attached. It might already
2011+ * be detached from its domain because the generic
2012+ * iommu_detach_group code detached it and we try again here in
2013+ * our alias handling.
2014+ */
2015+ if (!dev_data->domain)
2016+ return;
2017+
20092018 iommu = amd_iommu_rlookup_table[dev_data->devid];
20102019
20112020 /* decrease reference counters */
drivers/iommu/amd_iommu_init.c+3−0
@@ -1256,6 +1256,9 @@ static int iommu_init_pci(struct amd_iommu *iommu) · 1255 unmodified lines
12561256 if (!iommu->dev)
12571257 return -ENODEV;
12581258
1259+ /* Prevent binding other PCI device drivers to IOMMU devices */
1260+ iommu->dev->match_driver = false;
1261+
12591262 pci_read_config_dword(iommu->dev, cap_ptr + MMIO_CAP_HDR_OFFSET,
12601263 &iommu->cap);
12611264 pci_read_config_dword(iommu->dev, cap_ptr + MMIO_RANGE_OFFSET,
drivers/iommu/arm-smmu-v3.c+15−6
@@ -56,6 +56,7 @@ · 55 unmodified lines
5656 #define IDR0_TTF_SHIFT 2
5757 #define IDR0_TTF_MASK 0x3
5858 #define IDR0_TTF_AARCH64 (2 << IDR0_TTF_SHIFT)
59+#define IDR0_TTF_AARCH32_64 (3 << IDR0_TTF_SHIFT)
5960 #define IDR0_S1P (1 << 1)
6061 #define IDR0_S2P (1 << 0)
6162
@@ -342,7 +343,8 @@ · 280 unmodified lines
342343 #define CMDQ_TLBI_0_VMID_SHIFT 32
343344 #define CMDQ_TLBI_0_ASID_SHIFT 48
344345 #define CMDQ_TLBI_1_LEAF (1UL << 0)
345−#define CMDQ_TLBI_1_ADDR_MASK ~0xfffUL
346+#define CMDQ_TLBI_1_VA_MASK ~0xfffUL
347+#define CMDQ_TLBI_1_IPA_MASK 0xfffffffff000UL
346348
347349 #define CMDQ_PRI_0_SSID_SHIFT 12
348350 #define CMDQ_PRI_0_SSID_MASK 0xfffffUL
@@ -770,11 +772,13 @@ static int arm_smmu_cmdq_build_cmd(u64 *cmd, struct arm_smmu_cmdq_ent *ent) · 421 unmodified lines
770772 break;
771773 case CMDQ_OP_TLBI_NH_VA:
772774 cmd[0] |= (u64)ent->tlbi.asid << CMDQ_TLBI_0_ASID_SHIFT;
773− /* Fallthrough */
775+ cmd[1] |= ent->tlbi.leaf ? CMDQ_TLBI_1_LEAF : 0;
776+ cmd[1] |= ent->tlbi.addr & CMDQ_TLBI_1_VA_MASK;
777+ break;
774778 case CMDQ_OP_TLBI_S2_IPA:
775779 cmd[0] |= (u64)ent->tlbi.vmid << CMDQ_TLBI_0_VMID_SHIFT;
776780 cmd[1] |= ent->tlbi.leaf ? CMDQ_TLBI_1_LEAF : 0;
777− cmd[1] |= ent->tlbi.addr & CMDQ_TLBI_1_ADDR_MASK;
781+ cmd[1] |= ent->tlbi.addr & CMDQ_TLBI_1_IPA_MASK;
778782 break;
779783 case CMDQ_OP_TLBI_NH_ASID:
780784 cmd[0] |= (u64)ent->tlbi.asid << CMDQ_TLBI_0_ASID_SHIFT;
@@ -2460,7 +2464,13 @@ static int arm_smmu_device_probe(struct arm_smmu_device *smmu) · 1679 unmodified lines
24602464 }
24612465
24622466 /* We only support the AArch64 table format at present */
2463− if ((reg & IDR0_TTF_MASK << IDR0_TTF_SHIFT) < IDR0_TTF_AARCH64) {
2467+ switch (reg & IDR0_TTF_MASK << IDR0_TTF_SHIFT) {
2468+ case IDR0_TTF_AARCH32_64:
2469+ smmu->ias = 40;
2470+ /* Fallthrough */
2471+ case IDR0_TTF_AARCH64:
2472+ break;
2473+ default:
24642474 dev_err(smmu->dev, "AArch64 table format not supported!\n");
24652475 return -ENXIO;
24662476 }
@@ -2541,8 +2551,7 @@ static int arm_smmu_device_probe(struct arm_smmu_device *smmu) · 74 unmodified lines
25412551 dev_warn(smmu->dev,
25422552 "failed to set DMA mask for table walker\n");
25432553
2544− if (!smmu->ias)
2545− smmu->ias = smmu->oas;
2554+ smmu->ias = max(smmu->ias, smmu->oas);
25462555
25472556 dev_info(smmu->dev, "ias %lu-bit, oas %lu-bit (features 0x%08x)\n",
25482557 smmu->ias, smmu->oas, smmu->features);
drivers/iommu/intel-iommu.c+9−4
@@ -2115,15 +2115,19 @@ static int __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn, · 2114 unmodified lines
21152115 return -ENOMEM;
21162116 /* It is large page*/
21172117 if (largepage_lvl > 1) {
2118+ unsigned long nr_superpages, end_pfn;
2119+
21182120 pteval |= DMA_PTE_LARGE_PAGE;
21192121 lvl_pages = lvl_to_nr_pages(largepage_lvl);
2122+
2123+ nr_superpages = sg_res / lvl_pages;
2124+ end_pfn = iov_pfn + nr_superpages * lvl_pages - 1;
2125+
21202126 /*
21212127 * Ensure that old small page tables are
2122− * removed to make room for superpage,
2123− * if they exist.
2128+ * removed to make room for superpage(s).
21242129 */
2125− dma_pte_free_pagetable(domain, iov_pfn,
2126− iov_pfn + lvl_pages - 1);
2130+ dma_pte_free_pagetable(domain, iov_pfn, end_pfn);
21272131 } else {
21282132 pteval &= ~(uint64_t)DMA_PTE_LARGE_PAGE;
21292133 }
@@ -2301,6 +2305,7 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu, · 171 unmodified lines
23012305
23022306 if (ret) {
23032307 spin_unlock_irqrestore(&device_domain_lock, flags);
2308+ free_devinfo_mem(info);
23042309 return NULL;
23052310 }
23062311
drivers/iommu/io-pgtable-arm.c+13−11
@@ -202,9 +202,9 @@ typedef u64 arm_lpae_iopte; · 201 unmodified lines
202202
203203 static bool selftest_running = false;
204204
205−static dma_addr_t __arm_lpae_dma_addr(struct device *dev, void *pages)
205+static dma_addr_t __arm_lpae_dma_addr(void *pages)
206206 {
207− return phys_to_dma(dev, virt_to_phys(pages));
207+ return (dma_addr_t)virt_to_phys(pages);
208208 }
209209
210210 static void *__arm_lpae_alloc_pages(size_t size, gfp_t gfp,
@@ -223,10 +223,10 @@ static void *__arm_lpae_alloc_pages(size_t size, gfp_t gfp, · 12 unmodified lines
223223 goto out_free;
224224 /*
225225 * We depend on the IOMMU being able to work with any physical
226− * address directly, so if the DMA layer suggests it can't by
227− * giving us back some translation, that bodes very badly...
226+ * address directly, so if the DMA layer suggests otherwise by
227+ * translating or truncating them, that bodes very badly...
228228 */
229− if (dma != __arm_lpae_dma_addr(dev, pages))
229+ if (dma != virt_to_phys(pages))
230230 goto out_unmap;
231231 }
232232
@@ -243,10 +243,8 @@ out_free: · 10 unmodified lines
243243 static void __arm_lpae_free_pages(void *pages, size_t size,
244244 struct io_pgtable_cfg *cfg)
245245 {
246− struct device *dev = cfg->iommu_dev;
247−
248246 if (!selftest_running)
249− dma_unmap_single(dev, __arm_lpae_dma_addr(dev, pages),
247+ dma_unmap_single(cfg->iommu_dev, __arm_lpae_dma_addr(pages),
250248 size, DMA_TO_DEVICE);
251249 free_pages_exact(pages, size);
252250 }
@@ -254,12 +252,11 @@ static void __arm_lpae_free_pages(void *pages, size_t size, · 1 unmodified line
254252 static void __arm_lpae_set_pte(arm_lpae_iopte *ptep, arm_lpae_iopte pte,
255253 struct io_pgtable_cfg *cfg)
256254 {
257− struct device *dev = cfg->iommu_dev;
258−
259255 *ptep = pte;
260256
261257 if (!selftest_running)
262− dma_sync_single_for_device(dev, __arm_lpae_dma_addr(dev, ptep),
258+ dma_sync_single_for_device(cfg->iommu_dev,
259+ __arm_lpae_dma_addr(ptep),
263260 sizeof(pte), DMA_TO_DEVICE);
264261 }
265262
@@ -629,6 +626,11 @@ arm_lpae_alloc_pgtable(struct io_pgtable_cfg *cfg) · 363 unmodified lines
629626 if (cfg->oas > ARM_LPAE_MAX_ADDR_BITS)
630627 return NULL;
631628
629+ if (!selftest_running && cfg->iommu_dev->dma_pfn_offset) {
630+ dev_err(cfg->iommu_dev, "Cannot accommodate DMA offset for IOMMU page tables\n");
631+ return NULL;
632+ }
633+
632634 data = kmalloc(sizeof(*data), GFP_KERNEL);
633635 if (!data)
634636 return NULL;
drivers/md/dm-cache-metadata.c+1−1
@@ -634,10 +634,10 @@ static int __commit_transaction(struct dm_cache_metadata *cmd, · 633 unmodified lines
634634
635635 disk_super = dm_block_data(sblock);
636636
637+ disk_super->flags = cpu_to_le32(cmd->flags);
637638 if (mutator)
638639 update_flags(disk_super, mutator);
639640
640− disk_super->flags = cpu_to_le32(cmd->flags);
641641 disk_super->mapping_root = cpu_to_le64(cmd->root);
642642 disk_super->hint_root = cpu_to_le64(cmd->hint_root);
643643 disk_super->discard_root = cpu_to_le64(cmd->discard_root);
drivers/md/dm-snap-persistent.c+12−3
@@ -847,6 +847,7 @@ static void persistent_drop_snapshot(struct dm_exception_store *store) · 846 unmodified lines
847847 static int persistent_ctr(struct dm_exception_store *store, char *options)
848848 {
849849 struct pstore *ps;
850+ int r;
850851
851852 /* allocate the pstore */
852853 ps = kzalloc(sizeof(*ps), GFP_KERNEL);
@@ -868,9 +869,9 @@ static int persistent_ctr(struct dm_exception_store *store, char *options) · 15 unmodified lines
868869
869870 ps->metadata_wq = alloc_workqueue("ksnaphd", WQ_MEM_RECLAIM, 0);
870871 if (!ps->metadata_wq) {
871− kfree(ps);
872872 DMERR("couldn't start header metadata update thread");
873− return -ENOMEM;
873+ r = -ENOMEM;
874+ goto err_workqueue;
874875 }
875876
876877 if (options) {
@@ -879,13 +880,21 @@ static int persistent_ctr(struct dm_exception_store *store, char *options) · 2 unmodified lines
879880 store->userspace_supports_overflow = true;
880881 else {
881882 DMERR("Unsupported persistent store option: %s", options);
882− return -EINVAL;
883+ r = -EINVAL;
884+ goto err_options;
883885 }
884886 }
885887
886888 store->context = ps;
887889
888890 return 0;
891+
892+err_options:
893+ destroy_workqueue(ps->metadata_wq);
894+err_workqueue:
895+ kfree(ps);
896+
897+ return r;
889898 }
890899
891900 static unsigned persistent_status(struct dm_exception_store *store,
drivers/md/dm-thin.c+1−1
@@ -3201,7 +3201,7 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv) · 3200 unmodified lines
32013201 metadata_low_callback,
32023202 pool);
32033203 if (r)
3204− goto out_free_pt;
3204+ goto out_flags_changed;
32053205
32063206 pt->callbacks.congested_fn = pool_is_congested;
32073207 dm_table_add_target_callbacks(ti->table, &pt->callbacks);
drivers/md/persistent-data/dm-btree-remove.c+11−6
@@ -301,11 +301,16 @@ static void redistribute3(struct dm_btree_info *info, struct btree_node *parent, · 300 unmodified lines
301301 {
302302 int s;
303303 uint32_t max_entries = le32_to_cpu(left->header.max_entries);
304− unsigned target = (nr_left + nr_center + nr_right) / 3;
305− BUG_ON(target > max_entries);
304+ unsigned total = nr_left + nr_center + nr_right;
305+ unsigned target_right = total / 3;
306+ unsigned remainder = (target_right * 3) != total;
307+ unsigned target_left = target_right + remainder;
308+
309+ BUG_ON(target_left > max_entries);
310+ BUG_ON(target_right > max_entries);
306311
307312 if (nr_left < nr_right) {
308− s = nr_left - target;
313+ s = nr_left - target_left;
309314
310315 if (s < 0 && nr_center < -s) {
311316 /* not enough in central node */
@@ -316,10 +321,10 @@ static void redistribute3(struct dm_btree_info *info, struct btree_node *parent, · 4 unmodified lines
316321 } else
317322 shift(left, center, s);
318323
319− shift(center, right, target - nr_right);
324+ shift(center, right, target_right - nr_right);
320325
321326 } else {
322− s = target - nr_right;
327+ s = target_right - nr_right;
323328 if (s > 0 && nr_center < s) {
324329 /* not enough in central node */
325330 shift(center, right, nr_center);
@@ -329,7 +334,7 @@ static void redistribute3(struct dm_btree_info *info, struct btree_node *parent, · 3 unmodified lines
329334 } else
330335 shift(center, right, s);
331336
332− shift(left, center, nr_left - target);
337+ shift(left, center, nr_left - target_left);
333338 }
334339
335340 *key_ptr(parent, c->index) = center->keys[0];
drivers/md/persistent-data/dm-btree.c+1−1
@@ -523,7 +523,7 @@ static int btree_split_beneath(struct shadow_spine *s, uint64_t key) · 522 unmodified lines
523523
524524 r = new_block(s->info, &right);
525525 if (r < 0) {
526− /* FIXME: put left */
526+ unlock_block(s->info, left);
527527 return r;
528528 }
529529
drivers/media/dvb-frontends/horus3a.h+2−2
@@ -46,8 +46,8 @@ extern struct dvb_frontend *horus3a_attach(struct dvb_frontend *fe, · 45 unmodified lines
4646 const struct horus3a_config *config,
4747 struct i2c_adapter *i2c);
4848 #else
49−static inline struct dvb_frontend *horus3a_attach(
50− const struct cxd2820r_config *config,
49+static inline struct dvb_frontend *horus3a_attach(struct dvb_frontend *fe,
50+ const struct horus3a_config *config,
5151 struct i2c_adapter *i2c)
5252 {
5353 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
drivers/media/dvb-frontends/lnbh25.h+1−1
@@ -43,7 +43,7 @@ struct dvb_frontend *lnbh25_attach( · 42 unmodified lines
4343 struct lnbh25_config *cfg,
4444 struct i2c_adapter *i2c);
4545 #else
46−static inline dvb_frontend *lnbh25_attach(
46+static inline struct dvb_frontend *lnbh25_attach(
4747 struct dvb_frontend *fe,
4848 struct lnbh25_config *cfg,
4949 struct i2c_adapter *i2c)
drivers/media/dvb-frontends/m88ds3103.c+47−26
@@ -18,6 +18,27 @@ · 17 unmodified lines
1818
1919 static struct dvb_frontend_ops m88ds3103_ops;
2020
21+/* write single register with mask */
22+static int m88ds3103_update_bits(struct m88ds3103_dev *dev,
23+ u8 reg, u8 mask, u8 val)
24+{
25+ int ret;
26+ u8 tmp;
27+
28+ /* no need for read if whole reg is written */
29+ if (mask != 0xff) {
30+ ret = regmap_bulk_read(dev->regmap, reg, &tmp, 1);
31+ if (ret)
32+ return ret;
33+
34+ val &= mask;
35+ tmp &= ~mask;
36+ val |= tmp;
37+ }
38+
39+ return regmap_bulk_write(dev->regmap, reg, &val, 1);
40+}
41+
2142 /* write reg val table using reg addr auto increment */
2243 static int m88ds3103_wr_reg_val_tab(struct m88ds3103_dev *dev,
2344 const struct m88ds3103_reg_val *tab, int tab_len)
@@ -394,10 +415,10 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe) · 370 unmodified lines
394415 u8tmp2 = 0x00; /* 0b00 */
395416 break;
396417 }
397− ret = regmap_update_bits(dev->regmap, 0x22, 0xc0, u8tmp1 << 6);
418+ ret = m88ds3103_update_bits(dev, 0x22, 0xc0, u8tmp1 << 6);
398419 if (ret)
399420 goto err;
400− ret = regmap_update_bits(dev->regmap, 0x24, 0xc0, u8tmp2 << 6);
421+ ret = m88ds3103_update_bits(dev, 0x24, 0xc0, u8tmp2 << 6);
401422 if (ret)
402423 goto err;
403424 }
@@ -455,13 +476,13 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe) · 51 unmodified lines
455476 if (ret)
456477 goto err;
457478 }
458− ret = regmap_update_bits(dev->regmap, 0x9d, 0x08, 0x08);
479+ ret = m88ds3103_update_bits(dev, 0x9d, 0x08, 0x08);
459480 if (ret)
460481 goto err;
461482 ret = regmap_write(dev->regmap, 0xf1, 0x01);
462483 if (ret)
463484 goto err;
464− ret = regmap_update_bits(dev->regmap, 0x30, 0x80, 0x80);
485+ ret = m88ds3103_update_bits(dev, 0x30, 0x80, 0x80);
465486 if (ret)
466487 goto err;
467488 }
@@ -498,7 +519,7 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe) · 30 unmodified lines
498519 switch (dev->cfg->ts_mode) {
499520 case M88DS3103_TS_SERIAL:
500521 case M88DS3103_TS_SERIAL_D7:
501− ret = regmap_update_bits(dev->regmap, 0x29, 0x20, u8tmp1);
522+ ret = m88ds3103_update_bits(dev, 0x29, 0x20, u8tmp1);
502523 if (ret)
503524 goto err;
504525 u8tmp1 = 0;
@@ -567,11 +588,11 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe) · 62 unmodified lines
567588 if (ret)
568589 goto err;
569590
570− ret = regmap_update_bits(dev->regmap, 0x4d, 0x02, dev->cfg->spec_inv << 1);
591+ ret = m88ds3103_update_bits(dev, 0x4d, 0x02, dev->cfg->spec_inv << 1);
571592 if (ret)
572593 goto err;
573594
574− ret = regmap_update_bits(dev->regmap, 0x30, 0x10, dev->cfg->agc_inv << 4);
595+ ret = m88ds3103_update_bits(dev, 0x30, 0x10, dev->cfg->agc_inv << 4);
575596 if (ret)
576597 goto err;
577598
@@ -625,13 +646,13 @@ static int m88ds3103_init(struct dvb_frontend *fe) · 47 unmodified lines
625646 dev->warm = false;
626647
627648 /* wake up device from sleep */
628− ret = regmap_update_bits(dev->regmap, 0x08, 0x01, 0x01);
649+ ret = m88ds3103_update_bits(dev, 0x08, 0x01, 0x01);
629650 if (ret)
630651 goto err;
631− ret = regmap_update_bits(dev->regmap, 0x04, 0x01, 0x00);
652+ ret = m88ds3103_update_bits(dev, 0x04, 0x01, 0x00);
632653 if (ret)
633654 goto err;
634− ret = regmap_update_bits(dev->regmap, 0x23, 0x10, 0x00);
655+ ret = m88ds3103_update_bits(dev, 0x23, 0x10, 0x00);
635656 if (ret)
636657 goto err;
637658
@@ -749,18 +770,18 @@ static int m88ds3103_sleep(struct dvb_frontend *fe) · 111 unmodified lines
749770 utmp = 0x29;
750771 else
751772 utmp = 0x27;
752− ret = regmap_update_bits(dev->regmap, utmp, 0x01, 0x00);
773+ ret = m88ds3103_update_bits(dev, utmp, 0x01, 0x00);
753774 if (ret)
754775 goto err;
755776
756777 /* sleep */
757− ret = regmap_update_bits(dev->regmap, 0x08, 0x01, 0x00);
778+ ret = m88ds3103_update_bits(dev, 0x08, 0x01, 0x00);
758779 if (ret)
759780 goto err;
760− ret = regmap_update_bits(dev->regmap, 0x04, 0x01, 0x01);
781+ ret = m88ds3103_update_bits(dev, 0x04, 0x01, 0x01);
761782 if (ret)
762783 goto err;
763− ret = regmap_update_bits(dev->regmap, 0x23, 0x10, 0x10);
784+ ret = m88ds3103_update_bits(dev, 0x23, 0x10, 0x10);
764785 if (ret)
765786 goto err;
766787
@@ -992,12 +1013,12 @@ static int m88ds3103_set_tone(struct dvb_frontend *fe, · 225 unmodified lines
9921013 }
9931014
9941015 utmp = tone << 7 | dev->cfg->envelope_mode << 5;
995− ret = regmap_update_bits(dev->regmap, 0xa2, 0xe0, utmp);
1016+ ret = m88ds3103_update_bits(dev, 0xa2, 0xe0, utmp);
9961017 if (ret)
9971018 goto err;
9981019
9991020 utmp = 1 << 2;
1000− ret = regmap_update_bits(dev->regmap, 0xa1, reg_a1_mask, utmp);
1021+ ret = m88ds3103_update_bits(dev, 0xa1, reg_a1_mask, utmp);
10011022 if (ret)
10021023 goto err;
10031024
@@ -1047,7 +1068,7 @@ static int m88ds3103_set_voltage(struct dvb_frontend *fe, · 43 unmodified lines
10471068 voltage_dis ^= dev->cfg->lnb_en_pol;
10481069
10491070 utmp = voltage_dis << 1 | voltage_sel << 0;
1050− ret = regmap_update_bits(dev->regmap, 0xa2, 0x03, utmp);
1071+ ret = m88ds3103_update_bits(dev, 0xa2, 0x03, utmp);
10511072 if (ret)
10521073 goto err;
10531074
@@ -1080,7 +1101,7 @@ static int m88ds3103_diseqc_send_master_cmd(struct dvb_frontend *fe, · 26 unmodified lines
10801101 }
10811102
10821103 utmp = dev->cfg->envelope_mode << 5;
1083− ret = regmap_update_bits(dev->regmap, 0xa2, 0xe0, utmp);
1104+ ret = m88ds3103_update_bits(dev, 0xa2, 0xe0, utmp);
10841105 if (ret)
10851106 goto err;
10861107
@@ -1115,12 +1136,12 @@ static int m88ds3103_diseqc_send_master_cmd(struct dvb_frontend *fe, · 28 unmodified lines
11151136 } else {
11161137 dev_dbg(&client->dev, "diseqc tx timeout\n");
11171138
1118− ret = regmap_update_bits(dev->regmap, 0xa1, 0xc0, 0x40);
1139+ ret = m88ds3103_update_bits(dev, 0xa1, 0xc0, 0x40);
11191140 if (ret)
11201141 goto err;
11211142 }
11221143
1123− ret = regmap_update_bits(dev->regmap, 0xa2, 0xc0, 0x80);
1144+ ret = m88ds3103_update_bits(dev, 0xa2, 0xc0, 0x80);
11241145 if (ret)
11251146 goto err;
11261147
@@ -1152,7 +1173,7 @@ static int m88ds3103_diseqc_send_burst(struct dvb_frontend *fe, · 25 unmodified lines
11521173 }
11531174
11541175 utmp = dev->cfg->envelope_mode << 5;
1155− ret = regmap_update_bits(dev->regmap, 0xa2, 0xe0, utmp);
1176+ ret = m88ds3103_update_bits(dev, 0xa2, 0xe0, utmp);
11561177 if (ret)
11571178 goto err;
11581179
@@ -1194,12 +1215,12 @@ static int m88ds3103_diseqc_send_burst(struct dvb_frontend *fe, · 35 unmodified lines
11941215 } else {
11951216 dev_dbg(&client->dev, "diseqc tx timeout\n");
11961217
1197− ret = regmap_update_bits(dev->regmap, 0xa1, 0xc0, 0x40);
1218+ ret = m88ds3103_update_bits(dev, 0xa1, 0xc0, 0x40);
11981219 if (ret)
11991220 goto err;
12001221 }
12011222
1202− ret = regmap_update_bits(dev->regmap, 0xa2, 0xc0, 0x80);
1223+ ret = m88ds3103_update_bits(dev, 0xa2, 0xc0, 0x80);
12031224 if (ret)
12041225 goto err;
12051226
@@ -1435,13 +1456,13 @@ static int m88ds3103_probe(struct i2c_client *client, · 229 unmodified lines
14351456 goto err_kfree;
14361457
14371458 /* sleep */
1438− ret = regmap_update_bits(dev->regmap, 0x08, 0x01, 0x00);
1459+ ret = m88ds3103_update_bits(dev, 0x08, 0x01, 0x00);
14391460 if (ret)
14401461 goto err_kfree;
1441− ret = regmap_update_bits(dev->regmap, 0x04, 0x01, 0x01);
1462+ ret = m88ds3103_update_bits(dev, 0x04, 0x01, 0x01);
14421463 if (ret)
14431464 goto err_kfree;
1444− ret = regmap_update_bits(dev->regmap, 0x23, 0x10, 0x10);
1465+ ret = m88ds3103_update_bits(dev, 0x23, 0x10, 0x10);
14451466 if (ret)
14461467 goto err_kfree;
14471468
drivers/media/dvb-frontends/si2168.c+4−0
@@ -502,6 +502,10 @@ static int si2168_init(struct dvb_frontend *fe) · 501 unmodified lines
502502 /* firmware is in the new format */
503503 for (remaining = fw->size; remaining > 0; remaining -= 17) {
504504 len = fw->data[fw->size - remaining];
505+ if (len > SI2168_ARGLEN) {
506+ ret = -EINVAL;
507+ break;
508+ }
505509 memcpy(cmd.args, &fw->data[(fw->size - remaining) + 1], len);
506510 cmd.wlen = len;
507511 cmd.rlen = 1;
drivers/media/pci/netup_unidvb/netup_unidvb_spi.c+4−8
@@ -80,11 +80,9 @@ irqreturn_t netup_spi_interrupt(struct netup_spi *spi) · 79 unmodified lines
8080 u16 reg;
8181 unsigned long flags;
8282
83− if (!spi) {
84− dev_dbg(&spi->master->dev,
85− "%s(): SPI not initialized\n", __func__);
83+ if (!spi)
8684 return IRQ_NONE;
87− }
85+
8886 spin_lock_irqsave(&spi->lock, flags);
8987 reg = readw(&spi->regs->control_stat);
9088 if (!(reg & NETUP_SPI_CTRL_IRQ)) {
@@ -234,11 +232,9 @@ void netup_spi_release(struct netup_unidvb_dev *ndev) · 143 unmodified lines
234232 unsigned long flags;
235233 struct netup_spi *spi = ndev->spi;
236234
237− if (!spi) {
238− dev_dbg(&spi->master->dev,
239− "%s(): SPI not initialized\n", __func__);
235+ if (!spi)
240236 return;
241− }
237+
242238 spin_lock_irqsave(&spi->lock, flags);
243239 reg = readw(&spi->regs->control_stat);
244240 writew(reg | NETUP_SPI_CTRL_IRQ, &spi->regs->control_stat);
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c+3−4
@@ -1097,7 +1097,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context) · 1096 unmodified lines
10971097 Elf32_Ehdr *ehdr;
10981098 Elf32_Phdr *phdr;
10991099 u8 __iomem *dst;
1100− int err, i;
1100+ int err = 0, i;
11011101
11021102 if (!fw || !context)
11031103 return -EINVAL;
@@ -1106,7 +1106,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context) · 2 unmodified lines
11061106 phdr = (Elf32_Phdr *)(fw->data + ehdr->e_phoff);
11071107
11081108 /* go through the available ELF segments */
1109− for (i = 0; i < ehdr->e_phnum && !err; i++, phdr++) {
1109+ for (i = 0; i < ehdr->e_phnum; i++, phdr++) {
11101110
11111111 /* Only consider LOAD segments */
11121112 if (phdr->p_type != PT_LOAD)
@@ -1192,7 +1192,6 @@ err: · 79 unmodified lines
11921192
11931193 static int load_c8sectpfe_fw_step1(struct c8sectpfei *fei)
11941194 {
1195− int ret;
11961195 int err;
11971196
11981197 dev_info(fei->dev, "Loading firmware: %s\n", FIRMWARE_MEMDMA);
@@ -1207,7 +1206,7 @@ static int load_c8sectpfe_fw_step1(struct c8sectpfei *fei) · 8 unmodified lines
12071206 if (err) {
12081207 dev_err(fei->dev, "request_firmware_nowait err: %d.\n", err);
12091208 complete_all(&fei->fw_ack);
1210− return ret;
1209+ return err;
12111210 }
12121211
12131212 return 0;
drivers/media/rc/ir-hix5hd2.c+1−1
@@ -257,7 +257,7 @@ static int hix5hd2_ir_probe(struct platform_device *pdev) · 256 unmodified lines
257257 goto clkerr;
258258
259259 if (devm_request_irq(dev, priv->irq, hix5hd2_ir_rx_interrupt,
260− IRQF_NO_SUSPEND, pdev->name, priv) < 0) {
260+ 0, pdev->name, priv) < 0) {
261261 dev_err(dev, "IRQ %d register failed\n", priv->irq);
262262 ret = -EINVAL;
263263 goto regerr;
drivers/media/tuners/si2157.c+4−0
@@ -166,6 +166,10 @@ static int si2157_init(struct dvb_frontend *fe) · 165 unmodified lines
166166
167167 for (remaining = fw->size; remaining > 0; remaining -= 17) {
168168 len = fw->data[fw->size - remaining];
169+ if (len > SI2157_ARGLEN) {
170+ dev_err(&client->dev, "Bad firmware length\n");
171+ goto err_release_firmware;
172+ }
169173 memcpy(cmd.args, &fw->data[(fw->size - remaining) + 1], len);
170174 cmd.wlen = len;
171175 cmd.rlen = 1;
drivers/media/usb/dvb-usb-v2/rtl28xxu.c+13−2
@@ -34,6 +34,14 @@ static int rtl28xxu_ctrl_msg(struct dvb_usb_device *d, struct rtl28xxu_req *req) · 33 unmodified lines
3434 unsigned int pipe;
3535 u8 requesttype;
3636
37+ mutex_lock(&d->usb_mutex);
38+
39+ if (req->size > sizeof(dev->buf)) {
40+ dev_err(&d->intf->dev, "too large message %u\n", req->size);
41+ ret = -EINVAL;
42+ goto err_mutex_unlock;
43+ }
44+
3745 if (req->index & CMD_WR_FLAG) {
3846 /* write */
3947 memcpy(dev->buf, req->data, req->size);
@@ -50,14 +58,17 @@ static int rtl28xxu_ctrl_msg(struct dvb_usb_device *d, struct rtl28xxu_req *req) · 10 unmodified lines
5058 dvb_usb_dbg_usb_control_msg(d->udev, 0, requesttype, req->value,
5159 req->index, dev->buf, req->size);
5260 if (ret < 0)
53− goto err;
61+ goto err_mutex_unlock;
5462
5563 /* read request, copy returned data to return buf */
5664 if (requesttype == (USB_TYPE_VENDOR | USB_DIR_IN))
5765 memcpy(req->data, dev->buf, req->size);
5866
67+ mutex_unlock(&d->usb_mutex);
68+
5969 return 0;
60−err:
70+err_mutex_unlock:
71+ mutex_unlock(&d->usb_mutex);
6172 dev_dbg(&d->intf->dev, "failed=%d\n", ret);
6273 return ret;
6374 }
drivers/media/usb/dvb-usb-v2/rtl28xxu.h+1−1
@@ -71,7 +71,7 @@ · 70 unmodified lines
7171
7272
7373 struct rtl28xxu_dev {
74− u8 buf[28];
74+ u8 buf[128];
7575 u8 chip_id;
7676 u8 tuner;
7777 char *tuner_name;
drivers/media/v4l2-core/Kconfig+1−1
@@ -47,7 +47,7 @@ config V4L2_MEM2MEM_DEV · 46 unmodified lines
4747 # Used by LED subsystem flash drivers
4848 config V4L2_FLASH_LED_CLASS
4949 tristate "V4L2 flash API for LED flash class devices"
50− depends on VIDEO_V4L2_SUBDEV_API
50+ depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
5151 depends on LEDS_CLASS_FLASH
5252 ---help---
5353 Say Y here to enable V4L2 flash API support for LED flash
drivers/memory/Kconfig+9−3
@@ -58,12 +58,18 @@ config OMAP_GPMC · 57 unmodified lines
5858 memory drives like NOR, NAND, OneNAND, SRAM.
5959
6060 config OMAP_GPMC_DEBUG
61− bool
61+ bool "Enable GPMC debug output and skip reset of GPMC during init"
6262 depends on OMAP_GPMC
6363 help
6464 Enables verbose debugging mostly to decode the bootloader provided
65− timings. Enable this during development to configure devices
66− connected to the GPMC bus.
65+ timings. To preserve the bootloader provided timings, the reset
66+ of GPMC is skipped during init. Enable this during development to
67+ configure devices connected to the GPMC bus.
68+
69+ NOTE: In addition to matching the register setup with the bootloader
70+ you also need to match the GPMC FCLK frequency used by the
71+ bootloader or else the GPMC timings won't be identical with the
72+ bootloader timings.
6773
6874 config MVEBU_DEVBUS
6975 bool "Marvell EBU Device Bus Controller"
drivers/memory/omap-gpmc.c+1−1
@@ -696,7 +696,6 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t, · 695 unmodified lines
696696 int div;
697697 u32 l;
698698
699− gpmc_cs_show_timings(cs, "before gpmc_cs_set_timings");
700699 div = gpmc_calc_divider(t->sync_clk);
701700 if (div < 0)
702701 return div;
@@ -1988,6 +1987,7 @@ static int gpmc_probe_generic_child(struct platform_device *pdev, · 1285 unmodified lines
19881987 if (ret < 0)
19891988 goto err;
19901989
1990+ gpmc_cs_show_timings(cs, "before gpmc_cs_program_settings");
19911991 ret = gpmc_cs_program_settings(cs, &gpmc_s);
19921992 if (ret < 0)
19931993 goto err;
drivers/mfd/intel-lpss.h+2−0
@@ -42,6 +42,8 @@ int intel_lpss_resume(struct device *dev); · 41 unmodified lines
4242 .thaw = intel_lpss_resume, \
4343 .poweroff = intel_lpss_suspend, \
4444 .restore = intel_lpss_resume,
45+#else
46+#define INTEL_LPSS_SLEEP_PM_OPS
4547 #endif
4648
4749 #define INTEL_LPSS_RUNTIME_PM_OPS \
drivers/mfd/max77843.c+1−1
@@ -80,7 +80,7 @@ static int max77843_chg_init(struct max77693_dev *max77843) · 79 unmodified lines
8080 if (!max77843->i2c_chg) {
8181 dev_err(&max77843->i2c->dev,
8282 "Cannot allocate I2C device for Charger\n");
83− return PTR_ERR(max77843->i2c_chg);
83+ return -ENODEV;
8484 }
8585 i2c_set_clientdata(max77843->i2c_chg, max77843);
8686
drivers/misc/cxl/api.c+1−0
@@ -105,6 +105,7 @@ EXPORT_SYMBOL_GPL(cxl_allocate_afu_irqs); · 104 unmodified lines
105105
106106 void cxl_free_afu_irqs(struct cxl_context *ctx)
107107 {
108+ afu_irq_name_free(ctx);
108109 cxl_release_irq_ranges(&ctx->irqs, ctx->afu->adapter);
109110 }
110111 EXPORT_SYMBOL_GPL(cxl_free_afu_irqs);
drivers/misc/cxl/context.c+3−0
@@ -275,6 +275,9 @@ static void reclaim_ctx(struct rcu_head *rcu) · 274 unmodified lines
275275 if (ctx->kernelapi)
276276 kfree(ctx->mapping);
277277
278+ if (ctx->irq_bitmap)
279+ kfree(ctx->irq_bitmap);
280+
278281 kfree(ctx);
279282 }
280283
drivers/misc/cxl/cxl.h+1−0
@@ -677,6 +677,7 @@ int cxl_register_serr_irq(struct cxl_afu *afu); · 676 unmodified lines
677677 void cxl_release_serr_irq(struct cxl_afu *afu);
678678 int afu_register_irqs(struct cxl_context *ctx, u32 count);
679679 void afu_release_irqs(struct cxl_context *ctx, void *cookie);
680+void afu_irq_name_free(struct cxl_context *ctx);
680681 irqreturn_t cxl_slice_irq_err(int irq, void *data);
681682
682683 int cxl_debugfs_init(void);
drivers/misc/cxl/file.c+10−3
@@ -120,9 +120,16 @@ int afu_release(struct inode *inode, struct file *file) · 119 unmodified lines
120120 __func__, ctx->pe);
121121 cxl_context_detach(ctx);
122122
123− mutex_lock(&ctx->mapping_lock);
124− ctx->mapping = NULL;
125− mutex_unlock(&ctx->mapping_lock);
123+
124+ /*
125+ * Delete the context's mapping pointer, unless it's created by the
126+ * kernel API, in which case leave it so it can be freed by reclaim_ctx()
127+ */
128+ if (!ctx->kernelapi) {
129+ mutex_lock(&ctx->mapping_lock);
130+ ctx->mapping = NULL;
131+ mutex_unlock(&ctx->mapping_lock);
132+ }
126133
127134 put_device(&ctx->afu->dev);
128135
drivers/misc/cxl/irq.c+1−3
@@ -414,7 +414,7 @@ void cxl_release_psl_irq(struct cxl_afu *afu) · 413 unmodified lines
414414 kfree(afu->psl_irq_name);
415415 }
416416
417−static void afu_irq_name_free(struct cxl_context *ctx)
417+void afu_irq_name_free(struct cxl_context *ctx)
418418 {
419419 struct cxl_irq_name *irq_name, *tmp;
420420
@@ -524,7 +524,5 @@ void afu_release_irqs(struct cxl_context *ctx, void *cookie) · 103 unmodified lines
524524 afu_irq_name_free(ctx);
525525 cxl_release_irq_ranges(&ctx->irqs, ctx->afu->adapter);
526526
527− kfree(ctx->irq_bitmap);
528− ctx->irq_bitmap = NULL;
529527 ctx->irq_count = 0;
530528 }
drivers/misc/cxl/native.c+1−1
@@ -457,6 +457,7 @@ static int activate_afu_directed(struct cxl_afu *afu) · 456 unmodified lines
457457
458458 dev_info(&afu->dev, "Activating AFU directed mode\n");
459459
460+ afu->num_procs = afu->max_procs_virtualised;
460461 if (afu->spa == NULL) {
461462 if (cxl_alloc_spa(afu))
462463 return -ENOMEM;
@@ -468,7 +469,6 @@ static int activate_afu_directed(struct cxl_afu *afu) · 5 unmodified lines
468469 cxl_p1n_write(afu, CXL_PSL_ID_An, CXL_PSL_ID_An_F | CXL_PSL_ID_An_L);
469470
470471 afu->current_mode = CXL_MODE_DIRECTED;
471− afu->num_procs = afu->max_procs_virtualised;
472472
473473 if ((rc = cxl_chardev_m_afu_add(afu)))
474474 return rc;
drivers/misc/cxl/pci.c+28−0
@@ -1035,6 +1035,32 @@ static int cxl_read_vsec(struct cxl *adapter, struct pci_dev *dev) · 1034 unmodified lines
10351035 return 0;
10361036 }
10371037
1038+/*
1039+ * Workaround a PCIe Host Bridge defect on some cards, that can cause
1040+ * malformed Transaction Layer Packet (TLP) errors to be erroneously
1041+ * reported. Mask this error in the Uncorrectable Error Mask Register.
1042+ *
1043+ * The upper nibble of the PSL revision is used to distinguish between
1044+ * different cards. The affected ones have it set to 0.
1045+ */
1046+static void cxl_fixup_malformed_tlp(struct cxl *adapter, struct pci_dev *dev)
1047+{
1048+ int aer;
1049+ u32 data;
1050+
1051+ if (adapter->psl_rev & 0xf000)
1052+ return;
1053+ if (!(aer = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR)))
1054+ return;
1055+ pci_read_config_dword(dev, aer + PCI_ERR_UNCOR_MASK, &data);
1056+ if (data & PCI_ERR_UNC_MALF_TLP)
1057+ if (data & PCI_ERR_UNC_INTN)
1058+ return;
1059+ data |= PCI_ERR_UNC_MALF_TLP;
1060+ data |= PCI_ERR_UNC_INTN;
1061+ pci_write_config_dword(dev, aer + PCI_ERR_UNCOR_MASK, data);
1062+}
1063+
10381064 static int cxl_vsec_looks_ok(struct cxl *adapter, struct pci_dev *dev)
10391065 {
10401066 if (adapter->vsec_status & CXL_STATUS_SECOND_PORT)
@@ -1134,6 +1160,8 @@ static int cxl_configure_adapter(struct cxl *adapter, struct pci_dev *dev) · 93 unmodified lines
11341160 if ((rc = cxl_vsec_looks_ok(adapter, dev)))
11351161 return rc;
11361162
1163+ cxl_fixup_malformed_tlp(adapter, dev);
1164+
11371165 if ((rc = setup_cxl_bars(dev)))
11381166 return rc;
11391167
drivers/mmc/card/mmc_test.c+3−6
@@ -2263,15 +2263,12 @@ static int mmc_test_profile_sglen_r_nonblock_perf(struct mmc_test_card *test) · 2262 unmodified lines
22632263 /*
22642264 * eMMC hardware reset.
22652265 */
2266−static int mmc_test_hw_reset(struct mmc_test_card *test)
2266+static int mmc_test_reset(struct mmc_test_card *test)
22672267 {
22682268 struct mmc_card *card = test->card;
22692269 struct mmc_host *host = card->host;
22702270 int err;
22712271
2272− if (!mmc_card_mmc(card) || !mmc_can_reset(card))
2273− return RESULT_UNSUP_CARD;
2274−
22752272 err = mmc_hw_reset(host);
22762273 if (!err)
22772274 return RESULT_OK;
@@ -2605,8 +2602,8 @@ static const struct mmc_test_case mmc_test_cases[] = { · 327 unmodified lines
26052602 },
26062603
26072604 {
2608− .name = "eMMC hardware reset",
2609− .run = mmc_test_hw_reset,
2605+ .name = "Reset test",
2606+ .run = mmc_test_reset,
26102607 },
26112608 };
26122609
drivers/mmc/core/mmc.c+0−7
@@ -1924,7 +1924,6 @@ EXPORT_SYMBOL(mmc_can_reset); · 1923 unmodified lines
19241924 static int mmc_reset(struct mmc_host *host)
19251925 {
19261926 struct mmc_card *card = host->card;
1927− u32 status;
19281927
19291928 if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset)
19301929 return -EOPNOTSUPP;
@@ -1937,12 +1936,6 @@ static int mmc_reset(struct mmc_host *host) · 6 unmodified lines
19371936
19381937 host->ops->hw_reset(host);
19391938
1940− /* If the reset has happened, then a status command will fail */
1941− if (!mmc_send_status(card, &status)) {
1942− mmc_host_clk_release(host);
1943− return -ENOSYS;
1944− }
1945−
19461939 /* Set initial state and call mmc_set_ios */
19471940 mmc_set_initial_state(host);
19481941 mmc_host_clk_release(host);
drivers/net/can/sja1000/peak_pci.c+1−0
@@ -87,6 +87,7 @@ static const struct pci_device_id peak_pci_tbl[] = { · 86 unmodified lines
8787 {PEAK_PCI_VENDOR_ID, PEAK_PC_104P_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
8888 {PEAK_PCI_VENDOR_ID, PEAK_PCI_104E_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
8989 {PEAK_PCI_VENDOR_ID, PEAK_CPCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
90+ {PEAK_PCI_VENDOR_ID, PEAK_PCIE_OEM_ID, PCI_ANY_ID, PCI_ANY_ID,},
9091 #ifdef CONFIG_CAN_PEAK_PCIEC
9192 {PEAK_PCI_VENDOR_ID, PEAK_PCIEC_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
9293 {PEAK_PCI_VENDOR_ID, PEAK_PCIEC34_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c+4−0
@@ -327,9 +327,13 @@ void xgbe_debugfs_init(struct xgbe_prv_data *pdata) · 326 unmodified lines
327327 pdata->debugfs_xpcs_reg = 0;
328328
329329 buf = kasprintf(GFP_KERNEL, "amd-xgbe-%s", pdata->netdev->name);
330+ if (!buf)
331+ return;
332+
330333 pdata->xgbe_debugfs = debugfs_create_dir(buf, NULL);
331334 if (!pdata->xgbe_debugfs) {
332335 netdev_err(pdata->netdev, "debugfs_create_dir failed\n");
336+ kfree(buf);
333337 return;
334338 }
335339
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c+7−0
@@ -3351,6 +3351,13 @@ static int bnx2x_set_rss_flags(struct bnx2x *bp, struct ethtool_rxnfc *info) · 3350 unmodified lines
33513351 udp_rss_requested = 0;
33523352 else
33533353 return -EINVAL;
3354+
3355+ if (CHIP_IS_E1x(bp) && udp_rss_requested) {
3356+ DP(BNX2X_MSG_ETHTOOL,
3357+ "57710, 57711 boards don't support RSS according to UDP 4-tuple\n");
3358+ return -EINVAL;
3359+ }
3360+
33543361 if ((info->flow_type == UDP_V4_FLOW) &&
33553362 (bp->rss_conf_obj.udp_rss_v4 != udp_rss_requested)) {
33563363 bp->rss_conf_obj.udp_rss_v4 = udp_rss_requested;
drivers/net/ethernet/broadcom/genet/bcmgenet.c+23−9
@@ -1683,6 +1683,24 @@ static void bcmgenet_intr_disable(struct bcmgenet_priv *priv) · 1682 unmodified lines
16831683 bcmgenet_intrl2_1_writel(priv, 0, INTRL2_CPU_MASK_CLEAR);
16841684 }
16851685
1686+static void bcmgenet_link_intr_enable(struct bcmgenet_priv *priv)
1687+{
1688+ u32 int0_enable = 0;
1689+
1690+ /* Monitor cable plug/unplugged event for internal PHY, external PHY
1691+ * and MoCA PHY
1692+ */
1693+ if (priv->internal_phy) {
1694+ int0_enable |= UMAC_IRQ_LINK_EVENT;
1695+ } else if (priv->ext_phy) {
1696+ int0_enable |= UMAC_IRQ_LINK_EVENT;
1697+ } else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) {
1698+ if (priv->hw_params->flags & GENET_HAS_MOCA_LINK_DET)
1699+ int0_enable |= UMAC_IRQ_LINK_EVENT;
1700+ }
1701+ bcmgenet_intrl2_0_writel(priv, int0_enable, INTRL2_CPU_MASK_CLEAR);
1702+}
1703+
16861704 static int init_umac(struct bcmgenet_priv *priv)
16871705 {
16881706 struct device *kdev = &priv->pdev->dev;
@@ -1723,15 +1741,8 @@ static int init_umac(struct bcmgenet_priv *priv) · 34 unmodified lines
17231741 /* Enable Tx default queue 16 interrupts */
17241742 int0_enable |= UMAC_IRQ_TXDMA_DONE;
17251743
1726− /* Monitor cable plug/unplugged event for internal PHY */
1727− if (priv->internal_phy) {
1728− int0_enable |= UMAC_IRQ_LINK_EVENT;
1729− } else if (priv->ext_phy) {
1730− int0_enable |= UMAC_IRQ_LINK_EVENT;
1731− } else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) {
1732− if (priv->hw_params->flags & GENET_HAS_MOCA_LINK_DET)
1733− int0_enable |= UMAC_IRQ_LINK_EVENT;
1734−
1744+ /* Configure backpressure vectors for MoCA */
1745+ if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) {
17351746 reg = bcmgenet_bp_mc_get(priv);
17361747 reg |= BIT(priv->hw_params->bp_in_en_shift);
17371748
@@ -2645,6 +2656,9 @@ static void bcmgenet_netif_start(struct net_device *dev) · 907 unmodified lines
26452656
26462657 netif_tx_start_all_queues(dev);
26472658
2659+ /* Monitor link interrupts now */
2660+ bcmgenet_link_intr_enable(priv);
2661+
26482662 phy_start(priv->phydev);
26492663 }
26502664
drivers/net/ethernet/emulex/benet/be.h+1−0
@@ -592,6 +592,7 @@ struct be_adapter { · 591 unmodified lines
592592 int be_get_temp_freq;
593593 struct be_hwmon hwmon_info;
594594 u8 pf_number;
595+ u8 pci_func_num;
595596 struct rss_info rss_info;
596597 /* Filters for packets that need to be sent to BMC */
597598 u32 bmc_filt_mask;
drivers/net/ethernet/emulex/benet/be_cmds.c+24−7
@@ -851,8 +851,10 @@ static int be_cmd_notify_wait(struct be_adapter *adapter, · 850 unmodified lines
851851 return status;
852852
853853 dest_wrb = be_cmd_copy(adapter, wrb);
854− if (!dest_wrb)
855− return -EBUSY;
854+ if (!dest_wrb) {
855+ status = -EBUSY;
856+ goto unlock;
857+ }
856858
857859 if (use_mcc(adapter))
858860 status = be_mcc_notify_wait(adapter);
@@ -862,6 +864,7 @@ static int be_cmd_notify_wait(struct be_adapter *adapter, · 3 unmodified lines
862864 if (!status)
863865 memcpy(wrb, dest_wrb, sizeof(*wrb));
864866
867+unlock:
865868 be_cmd_unlock(adapter);
866869 return status;
867870 }
@@ -1984,6 +1987,8 @@ int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 value) · 1116 unmodified lines
19841987 be_if_cap_flags(adapter));
19851988 }
19861989 flags &= be_if_cap_flags(adapter);
1990+ if (!flags)
1991+ return -ENOTSUPP;
19871992
19881993 return __be_cmd_rx_filter(adapter, flags, value);
19891994 }
@@ -2887,6 +2892,7 @@ int be_cmd_get_cntl_attributes(struct be_adapter *adapter) · 897 unmodified lines
28872892 if (!status) {
28882893 attribs = attribs_cmd.va + sizeof(struct be_cmd_resp_hdr);
28892894 adapter->hba_port_num = attribs->hba_attribs.phy_port;
2895+ adapter->pci_func_num = attribs->pci_func_num;
28902896 serial_num = attribs->hba_attribs.controller_serial_number;
28912897 for (i = 0; i < CNTL_SERIAL_NUM_WORDS; i++)
28922898 adapter->serial_num[i] = le32_to_cpu(serial_num[i]) &
@@ -3709,7 +3715,6 @@ int be_cmd_get_func_config(struct be_adapter *adapter, struct be_resources *res) · 816 unmodified lines
37093715 status = -EINVAL;
37103716 goto err;
37113717 }
3712−
37133718 adapter->pf_number = desc->pf_num;
37143719 be_copy_nic_desc(res, desc);
37153720 }
@@ -3721,7 +3726,10 @@ err: · 5 unmodified lines
37213726 return status;
37223727 }
37233728
3724−/* Will use MBOX only if MCCQ has not been created */
3729+/* Will use MBOX only if MCCQ has not been created
3730+ * non-zero domain => a PF is querying this on behalf of a VF
3731+ * zero domain => a PF or a VF is querying this for itself
3732+ */
37253733 int be_cmd_get_profile_config(struct be_adapter *adapter,
37263734 struct be_resources *res, u8 query, u8 domain)
37273735 {
@@ -3748,10 +3756,15 @@ int be_cmd_get_profile_config(struct be_adapter *adapter, · 20 unmodified lines
37483756 OPCODE_COMMON_GET_PROFILE_CONFIG,
37493757 cmd.size, &wrb, &cmd);
37503758
3751− req->hdr.domain = domain;
37523759 if (!lancer_chip(adapter))
37533760 req->hdr.version = 1;
37543761 req->type = ACTIVE_PROFILE_TYPE;
3762+ /* When a function is querying profile information relating to
3763+ * itself hdr.pf_number must be set to it's pci_func_num + 1
3764+ */
3765+ req->hdr.domain = domain;
3766+ if (domain == 0)
3767+ req->hdr.pf_num = adapter->pci_func_num + 1;
37553768
37563769 /* When QUERY_MODIFIABLE_FIELDS_TYPE bit is set, cmd returns the
37573770 * descriptors with all bits set to "1" for the fields which can be
@@ -3921,12 +3934,16 @@ static void be_fill_vf_res_template(struct be_adapter *adapter, · 163 unmodified lines
39213934 vf_if_cap_flags &= ~(BE_IF_FLAGS_RSS |
39223935 BE_IF_FLAGS_DEFQ_RSS);
39233936 }
3924−
3925− nic_vft->cap_flags = cpu_to_le32(vf_if_cap_flags);
39263937 } else {
39273938 num_vf_qs = 1;
39283939 }
39293940
3941+ if (res_mod.vf_if_cap_flags & BE_IF_FLAGS_VLAN_PROMISCUOUS) {
3942+ nic_vft->flags |= BIT(IF_CAPS_FLAGS_VALID_SHIFT);
3943+ vf_if_cap_flags &= ~BE_IF_FLAGS_VLAN_PROMISCUOUS;
3944+ }
3945+
3946+ nic_vft->cap_flags = cpu_to_le32(vf_if_cap_flags);
39303947 nic_vft->rq_count = cpu_to_le16(num_vf_qs);
39313948 nic_vft->txq_count = cpu_to_le16(num_vf_qs);
39323949 nic_vft->rssq_count = cpu_to_le16(num_vf_qs);
drivers/net/ethernet/emulex/benet/be_cmds.h+8−2
@@ -289,7 +289,9 @@ struct be_cmd_req_hdr { · 288 unmodified lines
289289 u32 timeout; /* dword 1 */
290290 u32 request_length; /* dword 2 */
291291 u8 version; /* dword 3 */
292− u8 rsvd[3]; /* dword 3 */
292+ u8 rsvd1; /* dword 3 */
293+ u8 pf_num; /* dword 3 */
294+ u8 rsvd2; /* dword 3 */
293295 };
294296
295297 #define RESP_HDR_INFO_OPCODE_SHIFT 0 /* bits 0 - 7 */
@@ -1652,7 +1654,11 @@ struct mgmt_hba_attribs { · 1356 unmodified lines
16521654
16531655 struct mgmt_controller_attrib {
16541656 struct mgmt_hba_attribs hba_attribs;
1655− u32 rsvd0[10];
1657+ u32 rsvd0[2];
1658+ u16 rsvd1;
1659+ u8 pci_func_num;
1660+ u8 rsvd2;
1661+ u32 rsvd3[7];
16561662 } __packed;
16571663
16581664 struct be_cmd_req_cntl_attribs {
drivers/net/ethernet/emulex/benet/be_main.c+19−9
@@ -1123,11 +1123,12 @@ static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter, · 1122 unmodified lines
11231123 struct sk_buff *skb,
11241124 struct be_wrb_params *wrb_params)
11251125 {
1126− /* Lancer, SH-R ASICs have a bug wherein Packets that are 32 bytes or
1127− * less may cause a transmit stall on that port. So the work-around is
1128− * to pad short packets (<= 32 bytes) to a 36-byte length.
1126+ /* Lancer, SH and BE3 in SRIOV mode have a bug wherein
1127+ * packets that are 32b or less may cause a transmit stall
1128+ * on that port. The workaround is to pad such packets
1129+ * (len <= 32 bytes) to a minimum length of 36b.
11291130 */
1130− if (unlikely(!BEx_chip(adapter) && skb->len <= 32)) {
1131+ if (skb->len <= 32) {
11311132 if (skb_put_padto(skb, 36))
11321133 return NULL;
11331134 }
@@ -4205,10 +4206,6 @@ static int be_get_config(struct be_adapter *adapter) · 3071 unmodified lines
42054206 int status, level;
42064207 u16 profile_id;
42074208
4208− status = be_cmd_get_cntl_attributes(adapter);
4209− if (status)
4210− return status;
4211−
42124209 status = be_cmd_query_fw_cfg(adapter);
42134210 if (status)
42144211 return status;
@@ -4407,6 +4404,11 @@ static int be_setup(struct be_adapter *adapter) · 192 unmodified lines
44074404 if (!lancer_chip(adapter))
44084405 be_cmd_req_native_mode(adapter);
44094406
4407+ /* Need to invoke this cmd first to get the PCI Function Number */
4408+ status = be_cmd_get_cntl_attributes(adapter);
4409+ if (status)
4410+ return status;
4411+
44104412 if (!BE2_chip(adapter) && be_physfn(adapter))
44114413 be_alloc_sriov_res(adapter);
44124414
@@ -4999,7 +5001,15 @@ static bool be_check_ufi_compatibility(struct be_adapter *adapter, · 586 unmodified lines
49995001 return false;
50005002 }
50015003
5002− return (fhdr->asic_type_rev >= adapter->asic_rev);
5004+ /* In BE3 FW images the "asic_type_rev" field doesn't track the
5005+ * asic_rev of the chips it is compatible with.
5006+ * When asic_type_rev is 0 the image is compatible only with
5007+ * pre-BE3-R chips (asic_rev < 0x10)
5008+ */
5009+ if (BEx_chip(adapter) && fhdr->asic_type_rev == 0)
5010+ return adapter->asic_rev < 0x10;
5011+ else
5012+ return (fhdr->asic_type_rev >= adapter->asic_rev);
50035013 }
50045014
50055015 static int be_fw_download(struct be_adapter *adapter, const struct firmware* fw)
drivers/net/ethernet/freescale/fsl_pq_mdio.c+28−6
@@ -198,17 +198,28 @@ static int fsl_pq_mdio_reset(struct mii_bus *bus) · 197 unmodified lines
198198
199199 #if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
200200 /*
201+ * Return the TBIPA address, starting from the address
202+ * of the mapped GFAR MDIO registers (struct gfar)
201203 * This is mildly evil, but so is our hardware for doing this.
202204 * Also, we have to cast back to struct gfar because of
203205 * definition weirdness done in gianfar.h.
204206 */
205−static uint32_t __iomem *get_gfar_tbipa(void __iomem *p)
207+static uint32_t __iomem *get_gfar_tbipa_from_mdio(void __iomem *p)
206208 {
207209 struct gfar __iomem *enet_regs = p;
208210
209211 return &enet_regs->tbipa;
210212 }
211213
214+/*
215+ * Return the TBIPA address, starting from the address
216+ * of the mapped GFAR MII registers (gfar_mii_regs[] within struct gfar)
217+ */
218+static uint32_t __iomem *get_gfar_tbipa_from_mii(void __iomem *p)
219+{
220+ return get_gfar_tbipa_from_mdio(container_of(p, struct gfar, gfar_mii_regs));
221+}
222+
212223 /*
213224 * Return the TBIPAR address for an eTSEC2 node
214225 */
@@ -220,11 +231,12 @@ static uint32_t __iomem *get_etsec_tbipa(void __iomem *p) · 5 unmodified lines
220231
221232 #if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)
222233 /*
223− * Return the TBIPAR address for a QE MDIO node
234+ * Return the TBIPAR address for a QE MDIO node, starting from the address
235+ * of the mapped MII registers (struct fsl_pq_mii)
224236 */
225237 static uint32_t __iomem *get_ucc_tbipa(void __iomem *p)
226238 {
227− struct fsl_pq_mdio __iomem *mdio = p;
239+ struct fsl_pq_mdio __iomem *mdio = container_of(p, struct fsl_pq_mdio, mii);
228240
229241 return &mdio->utbipar;
230242 }
@@ -300,14 +312,14 @@ static const struct of_device_id fsl_pq_mdio_match[] = { · 69 unmodified lines
300312 .compatible = "fsl,gianfar-tbi",
301313 .data = &(struct fsl_pq_mdio_data) {
302314 .mii_offset = 0,
303− .get_tbipa = get_gfar_tbipa,
315+ .get_tbipa = get_gfar_tbipa_from_mii,
304316 },
305317 },
306318 {
307319 .compatible = "fsl,gianfar-mdio",
308320 .data = &(struct fsl_pq_mdio_data) {
309321 .mii_offset = 0,
310− .get_tbipa = get_gfar_tbipa,
322+ .get_tbipa = get_gfar_tbipa_from_mii,
311323 },
312324 },
313325 {
@@ -315,7 +327,7 @@ static const struct of_device_id fsl_pq_mdio_match[] = { · 1 unmodified line
315327 .compatible = "gianfar",
316328 .data = &(struct fsl_pq_mdio_data) {
317329 .mii_offset = offsetof(struct fsl_pq_mdio, mii),
318− .get_tbipa = get_gfar_tbipa,
330+ .get_tbipa = get_gfar_tbipa_from_mdio,
319331 },
320332 },
321333 {
@@ -445,6 +457,16 @@ static int fsl_pq_mdio_probe(struct platform_device *pdev) · 123 unmodified lines
445457
446458 tbipa = data->get_tbipa(priv->map);
447459
460+ /*
461+ * Add consistency check to make sure TBI is contained
462+ * within the mapped range (not because we would get a
463+ * segfault, rather to catch bugs in computing TBI
464+ * address). Print error message but continue anyway.
465+ */
466+ if ((void *)tbipa > priv->map + resource_size(&res) - 4)
467+ dev_err(&pdev->dev, "invalid register map (should be at least 0x%04x to contain TBI address)\n",
468+ ((void *)tbipa - priv->map) + 4);
469+
448470 iowrite32be(be32_to_cpup(prop), tbipa);
449471 }
450472 }
drivers/net/ethernet/intel/i40e/i40e_adminq.c+2−2
@@ -386,7 +386,6 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw) · 385 unmodified lines
386386
387387 hw->aq.asq.next_to_use = 0;
388388 hw->aq.asq.next_to_clean = 0;
389− hw->aq.asq.count = hw->aq.num_asq_entries;
390389
391390 /* allocate the ring memory */
392391 ret_code = i40e_alloc_adminq_asq_ring(hw);
@@ -404,6 +403,7 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw) · 11 unmodified lines
404403 goto init_adminq_free_rings;
405404
406405 /* success! */
406+ hw->aq.asq.count = hw->aq.num_asq_entries;
407407 goto init_adminq_exit;
408408
409409 init_adminq_free_rings:
@@ -445,7 +445,6 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw) · 35 unmodified lines
445445
446446 hw->aq.arq.next_to_use = 0;
447447 hw->aq.arq.next_to_clean = 0;
448− hw->aq.arq.count = hw->aq.num_arq_entries;
449448
450449 /* allocate the ring memory */
451450 ret_code = i40e_alloc_adminq_arq_ring(hw);
@@ -463,6 +462,7 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw) · 11 unmodified lines
463462 goto init_adminq_free_rings;
464463
465464 /* success! */
465+ hw->aq.arq.count = hw->aq.num_arq_entries;
466466 goto init_adminq_exit;
467467
468468 init_adminq_free_rings:
drivers/net/ethernet/intel/i40e/i40e_main.c+2−0
@@ -8389,6 +8389,7 @@ static int i40e_config_netdev(struct i40e_vsi *vsi) · 8388 unmodified lines
83898389
83908390 netdev->hw_enc_features |= NETIF_F_IP_CSUM |
83918391 NETIF_F_GSO_UDP_TUNNEL |
8392+ NETIF_F_GSO_GRE |
83928393 NETIF_F_TSO;
83938394
83948395 netdev->features = NETIF_F_SG |
@@ -8396,6 +8397,7 @@ static int i40e_config_netdev(struct i40e_vsi *vsi) · 1 unmodified line
83968397 NETIF_F_SCTP_CSUM |
83978398 NETIF_F_HIGHDMA |
83988399 NETIF_F_GSO_UDP_TUNNEL |
8400+ NETIF_F_GSO_GRE |
83998401 NETIF_F_HW_VLAN_CTAG_TX |
84008402 NETIF_F_HW_VLAN_CTAG_RX |
84018403 NETIF_F_HW_VLAN_CTAG_FILTER |
drivers/net/ethernet/intel/i40evf/i40e_adminq.c+2−2
@@ -373,7 +373,6 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw) · 372 unmodified lines
373373
374374 hw->aq.asq.next_to_use = 0;
375375 hw->aq.asq.next_to_clean = 0;
376− hw->aq.asq.count = hw->aq.num_asq_entries;
377376
378377 /* allocate the ring memory */
379378 ret_code = i40e_alloc_adminq_asq_ring(hw);
@@ -391,6 +390,7 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw) · 11 unmodified lines
391390 goto init_adminq_free_rings;
392391
393392 /* success! */
393+ hw->aq.asq.count = hw->aq.num_asq_entries;
394394 goto init_adminq_exit;
395395
396396 init_adminq_free_rings:
@@ -432,7 +432,6 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw) · 35 unmodified lines
432432
433433 hw->aq.arq.next_to_use = 0;
434434 hw->aq.arq.next_to_clean = 0;
435− hw->aq.arq.count = hw->aq.num_arq_entries;
436435
437436 /* allocate the ring memory */
438437 ret_code = i40e_alloc_adminq_arq_ring(hw);
@@ -450,6 +449,7 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw) · 11 unmodified lines
450449 goto init_adminq_free_rings;
451450
452451 /* success! */
452+ hw->aq.arq.count = hw->aq.num_arq_entries;
453453 goto init_adminq_exit;
454454
455455 init_adminq_free_rings:
drivers/net/ethernet/mellanox/mlx4/eq.c+4−0
@@ -1364,6 +1364,10 @@ int mlx4_test_interrupts(struct mlx4_dev *dev) · 1363 unmodified lines
13641364 * and performing a NOP command
13651365 */
13661366 for(i = 0; !err && (i < dev->caps.num_comp_vectors); ++i) {
1367+ /* Make sure request_irq was called */
1368+ if (!priv->eq_table.eq[i].have_irq)
1369+ continue;
1370+
13671371 /* Temporary use polling for command completions */
13681372 mlx4_cmd_use_polling(dev);
13691373
drivers/net/ethernet/mellanox/mlx4/main.c+2−8
@@ -2669,14 +2669,11 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev) · 2668 unmodified lines
26692669
26702670 if (msi_x) {
26712671 int nreq = dev->caps.num_ports * num_online_cpus() + 1;
2672− bool shared_ports = false;
26732672
26742673 nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs,
26752674 nreq);
2676− if (nreq > MAX_MSIX) {
2675+ if (nreq > MAX_MSIX)
26772676 nreq = MAX_MSIX;
2678− shared_ports = true;
2679− }
26802677
26812678 entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL);
26822679 if (!entries)
@@ -2699,9 +2696,6 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev) · 16 unmodified lines
26992696 bitmap_zero(priv->eq_table.eq[MLX4_EQ_ASYNC].actv_ports.ports,
27002697 dev->caps.num_ports);
27012698
2702− if (MLX4_IS_LEGACY_EQ_MODE(dev->caps))
2703− shared_ports = true;
2704−
27052699 for (i = 0; i < dev->caps.num_comp_vectors + 1; i++) {
27062700 if (i == MLX4_EQ_ASYNC)
27072701 continue;
@@ -2709,7 +2703,7 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev) · 1 unmodified line
27092703 priv->eq_table.eq[i].irq =
27102704 entries[i + 1 - !!(i > MLX4_EQ_ASYNC)].vector;
27112705
2712− if (shared_ports) {
2706+ if (MLX4_IS_LEGACY_EQ_MODE(dev->caps)) {
27132707 bitmap_fill(priv->eq_table.eq[i].actv_ports.ports,
27142708 dev->caps.num_ports);
27152709 /* We don't set affinity hint when there
drivers/net/ethernet/mellanox/mlx5/core/en_flow_table.c+14−2
@@ -598,6 +598,8 @@ void mlx5e_enable_vlan_filter(struct mlx5e_priv *priv) · 597 unmodified lines
598598 return;
599599
600600 priv->vlan.filter_disabled = false;
601+ if (priv->netdev->flags & IFF_PROMISC)
602+ return;
601603 mlx5e_del_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_VID, 0);
602604 }
603605
@@ -607,6 +609,8 @@ void mlx5e_disable_vlan_filter(struct mlx5e_priv *priv) · 3 unmodified lines
607609 return;
608610
609611 priv->vlan.filter_disabled = true;
612+ if (priv->netdev->flags & IFF_PROMISC)
613+ return;
610614 mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_VID, 0);
611615 }
612616
@@ -717,8 +721,12 @@ void mlx5e_set_rx_mode_work(struct work_struct *work) · 104 unmodified lines
717721 bool enable_broadcast = !ea->broadcast_enabled && broadcast_enabled;
718722 bool disable_broadcast = ea->broadcast_enabled && !broadcast_enabled;
719723
720− if (enable_promisc)
724+ if (enable_promisc) {
721725 mlx5e_add_eth_addr_rule(priv, &ea->promisc, MLX5E_PROMISC);
726+ if (!priv->vlan.filter_disabled)
727+ mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_VID,
728+ 0);
729+ }
722730 if (enable_allmulti)
723731 mlx5e_add_eth_addr_rule(priv, &ea->allmulti, MLX5E_ALLMULTI);
724732 if (enable_broadcast)
@@ -730,8 +738,12 @@ void mlx5e_set_rx_mode_work(struct work_struct *work) · 5 unmodified lines
730738 mlx5e_del_eth_addr_from_flow_table(priv, &ea->broadcast);
731739 if (disable_allmulti)
732740 mlx5e_del_eth_addr_from_flow_table(priv, &ea->allmulti);
733− if (disable_promisc)
741+ if (disable_promisc) {
742+ if (!priv->vlan.filter_disabled)
743+ mlx5e_del_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_VID,
744+ 0);
734745 mlx5e_del_eth_addr_from_flow_table(priv, &ea->promisc);
746+ }
735747
736748 ea->promisc_enabled = promisc_enabled;
737749 ea->allmulti_enabled = allmulti_enabled;
drivers/net/ethernet/mellanox/mlx5/core/port.c+1−1
@@ -311,7 +311,7 @@ static int mlx5_query_port_pvlc(struct mlx5_core_dev *dev, u32 *pvlc, · 310 unmodified lines
311311 int err;
312312
313313 memset(in, 0, sizeof(in));
314− MLX5_SET(ptys_reg, in, local_port, local_port);
314+ MLX5_SET(pvlc_reg, in, local_port, local_port);
315315
316316 err = mlx5_core_access_reg(dev, in, sizeof(in), pvlc,
317317 pvlc_size, MLX5_REG_PVLC, 0, 0);
drivers/net/ethernet/mellanox/mlxsw/core.c+9−4
@@ -374,26 +374,31 @@ static int __mlxsw_emad_transmit(struct mlxsw_core *mlxsw_core, · 373 unmodified lines
374374 int err;
375375 int ret;
376376
377+ mlxsw_core->emad.trans_active = true;
378+
377379 err = mlxsw_core_skb_transmit(mlxsw_core->driver_priv, skb, tx_info);
378380 if (err) {
379381 dev_err(mlxsw_core->bus_info->dev, "Failed to transmit EMAD (tid=%llx)\n",
380382 mlxsw_core->emad.tid);
381383 dev_kfree_skb(skb);
382− return err;
384+ goto trans_inactive_out;
383385 }
384386
385− mlxsw_core->emad.trans_active = true;
386387 ret = wait_event_timeout(mlxsw_core->emad.wait,
387388 !(mlxsw_core->emad.trans_active),
388389 msecs_to_jiffies(MLXSW_EMAD_TIMEOUT_MS));
389390 if (!ret) {
390391 dev_warn(mlxsw_core->bus_info->dev, "EMAD timed-out (tid=%llx)\n",
391392 mlxsw_core->emad.tid);
392− mlxsw_core->emad.trans_active = false;
393− return -EIO;
393+ err = -EIO;
394+ goto trans_inactive_out;
394395 }
395396
396397 return 0;
398+
399+trans_inactive_out:
400+ mlxsw_core->emad.trans_active = false;
401+ return err;
397402 }
398403
399404 static int mlxsw_emad_process_status(struct mlxsw_core *mlxsw_core,
drivers/net/ethernet/mellanox/mlxsw/item.h+3−1
@@ -187,6 +187,7 @@ __mlxsw_item_bit_array_offset(struct mlxsw_item *item, u16 index, u8 *shift) · 186 unmodified lines
187187 {
188188 u16 max_index, be_index;
189189 u16 offset; /* byte offset inside the array */
190+ u8 in_byte_index;
190191
191192 BUG_ON(index && !item->element_size);
192193 if (item->offset % sizeof(u32) != 0 ||
@@ -199,7 +200,8 @@ __mlxsw_item_bit_array_offset(struct mlxsw_item *item, u16 index, u8 *shift) · 6 unmodified lines
199200 max_index = (item->size.bytes << 3) / item->element_size - 1;
200201 be_index = max_index - index;
201202 offset = be_index * item->element_size >> 3;
202− *shift = index % (BITS_PER_BYTE / item->element_size) << 1;
203+ in_byte_index = index % (BITS_PER_BYTE / item->element_size);
204+ *shift = in_byte_index * item->element_size;
203205
204206 return item->offset + offset;
205207 }
drivers/net/ethernet/mellanox/mlxsw/pci.c+4−4
@@ -1582,11 +1582,11 @@ static int mlxsw_pci_cmd_exec(void *bus_priv, u16 opcode, u8 opcode_mod, · 1581 unmodified lines
15821582
15831583 if (in_mbox)
15841584 memcpy(mlxsw_pci->cmd.in_mbox.buf, in_mbox, in_mbox_size);
1585− mlxsw_pci_write32(mlxsw_pci, CIR_IN_PARAM_HI, in_mapaddr >> 32);
1586− mlxsw_pci_write32(mlxsw_pci, CIR_IN_PARAM_LO, in_mapaddr);
1585+ mlxsw_pci_write32(mlxsw_pci, CIR_IN_PARAM_HI, upper_32_bits(in_mapaddr));
1586+ mlxsw_pci_write32(mlxsw_pci, CIR_IN_PARAM_LO, lower_32_bits(in_mapaddr));
15871587
1588− mlxsw_pci_write32(mlxsw_pci, CIR_OUT_PARAM_HI, out_mapaddr >> 32);
1589− mlxsw_pci_write32(mlxsw_pci, CIR_OUT_PARAM_LO, out_mapaddr);
1588+ mlxsw_pci_write32(mlxsw_pci, CIR_OUT_PARAM_HI, upper_32_bits(out_mapaddr));
1589+ mlxsw_pci_write32(mlxsw_pci, CIR_OUT_PARAM_LO, lower_32_bits(out_mapaddr));
15901590
15911591 mlxsw_pci_write32(mlxsw_pci, CIR_IN_MODIFIER, in_mod);
15921592 mlxsw_pci_write32(mlxsw_pci, CIR_TOKEN, 0);
drivers/net/ethernet/mellanox/mlxsw/switchx2.c+1−1
@@ -1069,9 +1069,9 @@ static int mlxsw_sx_port_create(struct mlxsw_sx *mlxsw_sx, u8 local_port) · 1068 unmodified lines
10691069 return 0;
10701070
10711071 err_register_netdev:
1072−err_port_admin_status_set:
10731072 err_port_mac_learning_mode_set:
10741073 err_port_stp_state_set:
1074+err_port_admin_status_set:
10751075 err_port_mtu_set:
10761076 err_port_speed_set:
10771077 err_port_swid_set:
drivers/net/ethernet/nxp/lpc_eth.c+6−7
@@ -476,13 +476,12 @@ static void __lpc_get_mac(struct netdata_local *pldat, u8 *mac) · 475 unmodified lines
476476 mac[5] = tmp >> 8;
477477 }
478478
479−static void __lpc_eth_clock_enable(struct netdata_local *pldat,
480− bool enable)
479+static void __lpc_eth_clock_enable(struct netdata_local *pldat, bool enable)
481480 {
482481 if (enable)
483− clk_enable(pldat->clk);
482+ clk_prepare_enable(pldat->clk);
484483 else
485− clk_disable(pldat->clk);
484+ clk_disable_unprepare(pldat->clk);
486485 }
487486
488487 static void __lpc_params_setup(struct netdata_local *pldat)
@@ -1494,7 +1493,7 @@ err_out_free_irq: · 1005 unmodified lines
14941493 err_out_iounmap:
14951494 iounmap(pldat->net_base);
14961495 err_out_disable_clocks:
1497− clk_disable(pldat->clk);
1496+ clk_disable_unprepare(pldat->clk);
14981497 clk_put(pldat->clk);
14991498 err_out_free_dev:
15001499 free_netdev(ndev);
@@ -1519,7 +1518,7 @@ static int lpc_eth_drv_remove(struct platform_device *pdev) · 18 unmodified lines
15191518 iounmap(pldat->net_base);
15201519 mdiobus_unregister(pldat->mii_bus);
15211520 mdiobus_free(pldat->mii_bus);
1522− clk_disable(pldat->clk);
1521+ clk_disable_unprepare(pldat->clk);
15231522 clk_put(pldat->clk);
15241523 free_netdev(ndev);
15251524
@@ -1540,7 +1539,7 @@ static int lpc_eth_drv_suspend(struct platform_device *pdev, · 14 unmodified lines
15401539 if (netif_running(ndev)) {
15411540 netif_device_detach(ndev);
15421541 __lpc_eth_shutdown(pldat);
1543− clk_disable(pldat->clk);
1542+ clk_disable_unprepare(pldat->clk);
15441543
15451544 /*
15461545 * Reset again now clock is disable to be sure
drivers/net/ethernet/via/via-rhine.c+2−1
@@ -2134,10 +2134,11 @@ static int rhine_rx(struct net_device *dev, int limit) · 2133 unmodified lines
21342134 }
21352135
21362136 skb_put(skb, pkt_len);
2137− skb->protocol = eth_type_trans(skb, dev);
21382137
21392138 rhine_rx_vlan_tag(skb, desc, data_size);
21402139
2140+ skb->protocol = eth_type_trans(skb, dev);
2141+
21412142 netif_receive_skb(skb);
21422143
21432144 u64_stats_update_begin(&rp->rx_stats.syncp);
drivers/net/geneve.c+6−6
@@ -870,14 +870,14 @@ static int geneve_newlink(struct net *net, struct net_device *dev, · 869 unmodified lines
870870 __be16 dst_port = htons(GENEVE_UDP_PORT);
871871 __u8 ttl = 0, tos = 0;
872872 bool metadata = false;
873− __be32 rem_addr;
874− __u32 vni;
873+ __be32 rem_addr = 0;
874+ __u32 vni = 0;
875875
876− if (!data[IFLA_GENEVE_ID] || !data[IFLA_GENEVE_REMOTE])
877− return -EINVAL;
876+ if (data[IFLA_GENEVE_ID])
877+ vni = nla_get_u32(data[IFLA_GENEVE_ID]);
878878
879− vni = nla_get_u32(data[IFLA_GENEVE_ID]);
880− rem_addr = nla_get_in_addr(data[IFLA_GENEVE_REMOTE]);
879+ if (data[IFLA_GENEVE_REMOTE])
880+ rem_addr = nla_get_in_addr(data[IFLA_GENEVE_REMOTE]);
881881
882882 if (data[IFLA_GENEVE_TTL])
883883 ttl = nla_get_u8(data[IFLA_GENEVE_TTL]);
drivers/net/phy/Kconfig+0−2
@@ -168,8 +168,6 @@ config MDIO_OCTEON · 167 unmodified lines
168168 busses. It is required by the Octeon and ThunderX ethernet device
169169 drivers.
170170
171− If in doubt, say Y.
172−
173171 config MDIO_SUN4I
174172 tristate "Allwinner sun4i MDIO interface support"
175173 depends on ARCH_SUNXI
drivers/net/ppp/pppoe.c+0−1
@@ -313,7 +313,6 @@ static void pppoe_flush_dev(struct net_device *dev) · 312 unmodified lines
313313 if (po->pppoe_dev == dev &&
314314 sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND | PPPOX_ZOMBIE)) {
315315 pppox_unbind_sock(sk);
316− sk->sk_state = PPPOX_ZOMBIE;
317316 sk->sk_state_change(sk);
318317 po->pppoe_dev = NULL;
319318 dev_put(dev);
drivers/net/usb/Kconfig+1−0
@@ -164,6 +164,7 @@ config USB_NET_AX8817X · 163 unmodified lines
164164 * Aten UC210T
165165 * ASIX AX88172
166166 * Billionton Systems, USB2AR
167+ * Billionton Systems, GUSB2AM-1G-B
167168 * Buffalo LUA-U2-KTX
168169 * Corega FEther USB2-TX
169170 * D-Link DUB-E100
drivers/net/usb/asix_common.c+3−1
@@ -91,8 +91,10 @@ int asix_rx_fixup_internal(struct usbnet *dev, struct sk_buff *skb, · 90 unmodified lines
9191 }
9292 rx->ax_skb = netdev_alloc_skb_ip_align(dev->net,
9393 rx->size);
94− if (!rx->ax_skb)
94+ if (!rx->ax_skb) {
95+ rx->size = 0;
9596 return 0;
97+ }
9698 }
9799
98100 if (rx->size > dev->net->mtu + ETH_HLEN + VLAN_HLEN) {
drivers/net/usb/asix_devices.c+4−0
@@ -958,6 +958,10 @@ static const struct usb_device_id products [] = { · 957 unmodified lines
958958 // Billionton Systems, USB2AR
959959 USB_DEVICE (0x08dd, 0x90ff),
960960 .driver_info = (unsigned long) &ax8817x_info,
961+}, {
962+ // Billionton Systems, GUSB2AM-1G-B
963+ USB_DEVICE(0x08dd, 0x0114),
964+ .driver_info = (unsigned long) &ax88178_info,
961965 }, {
962966 // ATEN UC210T
963967 USB_DEVICE (0x0557, 0x2009),
drivers/net/vxlan.c+3−4
@@ -2745,11 +2745,10 @@ static int vxlan_newlink(struct net *src_net, struct net_device *dev, · 2744 unmodified lines
27452745 struct vxlan_config conf;
27462746 int err;
27472747
2748− if (!data[IFLA_VXLAN_ID])
2749− return -EINVAL;
2750−
27512748 memset(&conf, 0, sizeof(conf));
2752− conf.vni = nla_get_u32(data[IFLA_VXLAN_ID]);
2749+
2750+ if (data[IFLA_VXLAN_ID])
2751+ conf.vni = nla_get_u32(data[IFLA_VXLAN_ID]);
27532752
27542753 if (data[IFLA_VXLAN_GROUP]) {
27552754 conf.remote_ip.sin.sin_addr.s_addr = nla_get_in_addr(data[IFLA_VXLAN_GROUP]);
drivers/net/wireless/ath/ath10k/hw.h+2−2
@@ -337,7 +337,7 @@ enum ath10k_hw_rate_cck { · 336 unmodified lines
337337 #define TARGET_10X_MAX_FRAG_ENTRIES 0
338338
339339 /* 10.2 parameters */
340−#define TARGET_10_2_DMA_BURST_SIZE 1
340+#define TARGET_10_2_DMA_BURST_SIZE 0
341341
342342 /* Target specific defines for WMI-TLV firmware */
343343 #define TARGET_TLV_NUM_VDEVS 4
@@ -391,7 +391,7 @@ enum ath10k_hw_rate_cck { · 47 unmodified lines
391391
392392 #define TARGET_10_4_TX_DBG_LOG_SIZE 1024
393393 #define TARGET_10_4_NUM_WDS_ENTRIES 32
394−#define TARGET_10_4_DMA_BURST_SIZE 1
394+#define TARGET_10_4_DMA_BURST_SIZE 0
395395 #define TARGET_10_4_MAC_AGGR_DELIM 0
396396 #define TARGET_10_4_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 1
397397 #define TARGET_10_4_VOW_CONFIG 0
drivers/net/wireless/ath/ath9k/init.c+1−0
@@ -880,6 +880,7 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) · 879 unmodified lines
880880 hw->max_rate_tries = 10;
881881 hw->sta_data_size = sizeof(struct ath_node);
882882 hw->vif_data_size = sizeof(struct ath_vif);
883+ hw->extra_tx_headroom = 4;
883884
884885 hw->wiphy->available_antennas_rx = BIT(ah->caps.max_rxchains) - 1;
885886 hw->wiphy->available_antennas_tx = BIT(ah->caps.max_txchains) - 1;
drivers/net/wireless/b43/main.c+1−0
@@ -120,6 +120,7 @@ MODULE_PARM_DESC(allhwsupport, "Enable support for all hardware (even it if over · 119 unmodified lines
120120 #ifdef CONFIG_B43_BCMA
121121 static const struct bcma_device_id b43_bcma_tbl[] = {
122122 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x11, BCMA_ANY_CLASS),
123+ BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x15, BCMA_ANY_CLASS),
123124 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x17, BCMA_ANY_CLASS),
124125 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x18, BCMA_ANY_CLASS),
125126 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x1C, BCMA_ANY_CLASS),
drivers/net/wireless/iwlwifi/dvm/lib.c+1−1
@@ -1020,7 +1020,7 @@ static void iwlagn_wowlan_program_keys(struct ieee80211_hw *hw, · 1019 unmodified lines
10201020 u8 *pn = seq.ccmp.pn;
10211021
10221022 ieee80211_get_key_rx_seq(key, i, &seq);
1023− aes_sc->pn = cpu_to_le64(
1023+ aes_sc[i].pn = cpu_to_le64(
10241024 (u64)pn[5] |
10251025 ((u64)pn[4] << 8) |
10261026 ((u64)pn[3] << 16) |
drivers/net/wireless/iwlwifi/iwl-7000.c+1−1
@@ -348,6 +348,6 @@ const struct iwl_cfg iwl7265d_n_cfg = { · 347 unmodified lines
348348 };
349349
350350 MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
351−MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL3160_UCODE_API_OK));
351+MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
352352 MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
353353 MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
drivers/net/wireless/iwlwifi/mvm/d3.c+11−16
@@ -274,18 +274,13 @@ static void iwl_mvm_wowlan_program_keys(struct ieee80211_hw *hw, · 273 unmodified lines
274274 break;
275275 case WLAN_CIPHER_SUITE_CCMP:
276276 if (sta) {
277− u8 *pn = seq.ccmp.pn;
277+ u64 pn64;
278278
279279 aes_sc = data->rsc_tsc->all_tsc_rsc.aes.unicast_rsc;
280280 aes_tx_sc = &data->rsc_tsc->all_tsc_rsc.aes.tsc;
281281
282− ieee80211_get_key_tx_seq(key, &seq);
283− aes_tx_sc->pn = cpu_to_le64((u64)pn[5] |
284− ((u64)pn[4] << 8) |
285− ((u64)pn[3] << 16) |
286− ((u64)pn[2] << 24) |
287− ((u64)pn[1] << 32) |
288− ((u64)pn[0] << 40));
282+ pn64 = atomic64_read(&key->tx_pn);
283+ aes_tx_sc->pn = cpu_to_le64(pn64);
289284 } else {
290285 aes_sc = data->rsc_tsc->all_tsc_rsc.aes.multicast_rsc;
291286 }
@@ -298,12 +293,12 @@ static void iwl_mvm_wowlan_program_keys(struct ieee80211_hw *hw, · 6 unmodified lines
298293 u8 *pn = seq.ccmp.pn;
299294
300295 ieee80211_get_key_rx_seq(key, i, &seq);
301− aes_sc->pn = cpu_to_le64((u64)pn[5] |
302− ((u64)pn[4] << 8) |
303− ((u64)pn[3] << 16) |
304− ((u64)pn[2] << 24) |
305− ((u64)pn[1] << 32) |
306− ((u64)pn[0] << 40));
296+ aes_sc[i].pn = cpu_to_le64((u64)pn[5] |
297+ ((u64)pn[4] << 8) |
298+ ((u64)pn[3] << 16) |
299+ ((u64)pn[2] << 24) |
300+ ((u64)pn[1] << 32) |
301+ ((u64)pn[0] << 40));
307302 }
308303 data->use_rsc_tsc = true;
309304 break;
@@ -1453,15 +1448,15 @@ static void iwl_mvm_d3_update_gtks(struct ieee80211_hw *hw, · 1143 unmodified lines
14531448
14541449 switch (key->cipher) {
14551450 case WLAN_CIPHER_SUITE_CCMP:
1456− iwl_mvm_aes_sc_to_seq(&sc->aes.tsc, &seq);
14571451 iwl_mvm_set_aes_rx_seq(sc->aes.unicast_rsc, key);
1452+ atomic64_set(&key->tx_pn, le64_to_cpu(sc->aes.tsc.pn));
14581453 break;
14591454 case WLAN_CIPHER_SUITE_TKIP:
14601455 iwl_mvm_tkip_sc_to_seq(&sc->tkip.tsc, &seq);
14611456 iwl_mvm_set_tkip_rx_seq(sc->tkip.unicast_rsc, key);
1457+ ieee80211_set_key_tx_seq(key, &seq);
14621458 break;
14631459 }
1464− ieee80211_set_key_tx_seq(key, &seq);
14651460
14661461 /* that's it for this key */
14671462 return;
drivers/net/wireless/iwlwifi/mvm/fw.c+2−2
@@ -703,7 +703,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm) · 702 unmodified lines
703703 * abort after reading the nvm in case RF Kill is on, we will complete
704704 * the init seq later when RF kill will switch to off
705705 */
706− if (iwl_mvm_is_radio_killed(mvm)) {
706+ if (iwl_mvm_is_radio_hw_killed(mvm)) {
707707 IWL_DEBUG_RF_KILL(mvm,
708708 "jump over all phy activities due to RF kill\n");
709709 iwl_remove_notification(&mvm->notif_wait, &calib_wait);
@@ -736,7 +736,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm) · 26 unmodified lines
736736 ret = iwl_wait_notification(&mvm->notif_wait, &calib_wait,
737737 MVM_UCODE_CALIB_TIMEOUT);
738738
739− if (ret && iwl_mvm_is_radio_killed(mvm)) {
739+ if (ret && iwl_mvm_is_radio_hw_killed(mvm)) {
740740 IWL_DEBUG_RF_KILL(mvm, "RFKILL while calibrating.\n");
741741 ret = 1;
742742 }
drivers/net/wireless/iwlwifi/mvm/mac80211.c+1−0
@@ -2388,6 +2388,7 @@ static void iwl_mvm_stop_ap_ibss(struct ieee80211_hw *hw, · 2387 unmodified lines
23882388 iwl_mvm_remove_time_event(mvm, mvmvif,
23892389 &mvmvif->time_event_data);
23902390 RCU_INIT_POINTER(mvm->csa_vif, NULL);
2391+ mvmvif->csa_countdown = false;
23912392 }
23922393
23932394 if (rcu_access_pointer(mvm->csa_tx_blocked_vif) == vif) {
drivers/net/wireless/iwlwifi/mvm/mvm.h+5−0
@@ -860,6 +860,11 @@ static inline bool iwl_mvm_is_radio_killed(struct iwl_mvm *mvm) · 859 unmodified lines
860860 test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status);
861861 }
862862
863+static inline bool iwl_mvm_is_radio_hw_killed(struct iwl_mvm *mvm)
864+{
865+ return test_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status);
866+}
867+
863868 /* Must be called with rcu_read_lock() held and it can only be
864869 * released when mvmsta is not needed anymore.
865870 */
drivers/net/wireless/iwlwifi/mvm/ops.c+1−0
@@ -590,6 +590,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, · 589 unmodified lines
590590 ieee80211_unregister_hw(mvm->hw);
591591 iwl_mvm_leds_exit(mvm);
592592 out_free:
593+ flush_delayed_work(&mvm->fw_dump_wk);
593594 iwl_phy_db_free(mvm->phy_db);
594595 kfree(mvm->scan_cmd);
595596 if (!cfg->no_power_up_nic_in_init || !mvm->nvm_file_name)
drivers/net/wireless/iwlwifi/pcie/drv.c+5−0
@@ -414,6 +414,11 @@ static const struct pci_device_id iwl_hw_card_ids[] = { · 413 unmodified lines
414414 {IWL_PCI_DEVICE(0x095A, 0x5590, iwl7265_2ac_cfg)},
415415 {IWL_PCI_DEVICE(0x095B, 0x5290, iwl7265_2ac_cfg)},
416416 {IWL_PCI_DEVICE(0x095A, 0x5490, iwl7265_2ac_cfg)},
417+ {IWL_PCI_DEVICE(0x095A, 0x5F10, iwl7265_2ac_cfg)},
418+ {IWL_PCI_DEVICE(0x095B, 0x5212, iwl7265_2ac_cfg)},
419+ {IWL_PCI_DEVICE(0x095B, 0x520A, iwl7265_2ac_cfg)},
420+ {IWL_PCI_DEVICE(0x095A, 0x9000, iwl7265_2ac_cfg)},
421+ {IWL_PCI_DEVICE(0x095A, 0x9400, iwl7265_2ac_cfg)},
417422
418423 /* 8000 Series */
419424 {IWL_PCI_DEVICE(0x24F3, 0x0010, iwl8260_2ac_cfg)},
drivers/net/wireless/rt2x00/rt2800usb.c+1−0
@@ -1114,6 +1114,7 @@ static struct usb_device_id rt2800usb_device_table[] = { · 1113 unmodified lines
11141114 { USB_DEVICE(0x0db0, 0x871c) },
11151115 { USB_DEVICE(0x0db0, 0x899a) },
11161116 /* Ovislink */
1117+ { USB_DEVICE(0x1b75, 0x3070) },
11171118 { USB_DEVICE(0x1b75, 0x3071) },
11181119 { USB_DEVICE(0x1b75, 0x3072) },
11191120 { USB_DEVICE(0x1b75, 0xa200) },
drivers/net/wireless/rtlwifi/pci.h+2−0
@@ -247,6 +247,8 @@ struct rtl_pci { · 246 unmodified lines
247247 /* MSI support */
248248 bool msi_support;
249249 bool using_msi;
250+ /* interrupt clear before set */
251+ bool int_clear;
250252 };
251253
252254 struct mp_adapter {
drivers/net/wireless/rtlwifi/rtl8821ae/hw.c+17−0
@@ -2253,11 +2253,28 @@ void rtl8821ae_set_qos(struct ieee80211_hw *hw, int aci) · 2252 unmodified lines
22532253 }
22542254 }
22552255
2256+static void rtl8821ae_clear_interrupt(struct ieee80211_hw *hw)
2257+{
2258+ struct rtl_priv *rtlpriv = rtl_priv(hw);
2259+ u32 tmp = rtl_read_dword(rtlpriv, REG_HISR);
2260+
2261+ rtl_write_dword(rtlpriv, REG_HISR, tmp);
2262+
2263+ tmp = rtl_read_dword(rtlpriv, REG_HISRE);
2264+ rtl_write_dword(rtlpriv, REG_HISRE, tmp);
2265+
2266+ tmp = rtl_read_dword(rtlpriv, REG_HSISR);
2267+ rtl_write_dword(rtlpriv, REG_HSISR, tmp);
2268+}
2269+
22562270 void rtl8821ae_enable_interrupt(struct ieee80211_hw *hw)
22572271 {
22582272 struct rtl_priv *rtlpriv = rtl_priv(hw);
22592273 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
22602274
2275+ if (!rtlpci->int_clear)
2276+ rtl8821ae_clear_interrupt(hw);/*clear it here first*/
2277+
22612278 rtl_write_dword(rtlpriv, REG_HIMR, rtlpci->irq_mask[0] & 0xFFFFFFFF);
22622279 rtl_write_dword(rtlpriv, REG_HIMRE, rtlpci->irq_mask[1] & 0xFFFFFFFF);
22632280 rtlpci->irq_enabled = true;
drivers/net/wireless/rtlwifi/rtl8821ae/sw.c+5−0
@@ -96,6 +96,7 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw) · 95 unmodified lines
9696
9797 rtl8821ae_bt_reg_init(hw);
9898 rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
99+ rtlpci->int_clear = rtlpriv->cfg->mod_params->int_clear;
99100 rtlpriv->btcoexist.btc_ops = rtl_btc_get_ops_pointer();
100101
101102 rtlpriv->dm.dm_initialgain_enable = 1;
@@ -167,6 +168,7 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw) · 65 unmodified lines
167168 rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
168169 rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps;
169170 rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
171+ rtlpci->msi_support = rtlpriv->cfg->mod_params->int_clear;
170172 if (rtlpriv->cfg->mod_params->disable_watchdog)
171173 pr_info("watchdog disabled\n");
172174 rtlpriv->psc.reg_fwctrl_lps = 3;
@@ -308,6 +310,7 @@ static struct rtl_mod_params rtl8821ae_mod_params = { · 135 unmodified lines
308310 .swctrl_lps = false,
309311 .fwctrl_lps = true,
310312 .msi_support = true,
313+ .int_clear = true,
311314 .debug = DBG_EMERG,
312315 .disable_watchdog = 0,
313316 };
@@ -437,6 +440,7 @@ module_param_named(fwlps, rtl8821ae_mod_params.fwctrl_lps, bool, 0444); · 123 unmodified lines
437440 module_param_named(msi, rtl8821ae_mod_params.msi_support, bool, 0444);
438441 module_param_named(disable_watchdog, rtl8821ae_mod_params.disable_watchdog,
439442 bool, 0444);
443+module_param_named(int_clear, rtl8821ae_mod_params.int_clear, bool, 0444);
440444 MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");
441445 MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
442446 MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
@@ -444,6 +448,7 @@ MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); · 1 unmodified line
444448 MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 1)\n");
445449 MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
446450 MODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n");
451+MODULE_PARM_DESC(int_clear, "Set to 1 to disable interrupt clear before set (default 0)\n");
447452
448453 static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);
449454
drivers/net/wireless/rtlwifi/wifi.h+3−0
@@ -2249,6 +2249,9 @@ struct rtl_mod_params { · 2248 unmodified lines
22492249
22502250 /* default 0: 1 means disable */
22512251 bool disable_watchdog;
2252+
2253+ /* default 0: 1 means do not disable interrupts */
2254+ bool int_clear;
22522255 };
22532256
22542257 struct rtl_hal_usbint_cfg {
drivers/net/xen-netback/xenbus.c+6−0
@@ -788,6 +788,12 @@ static void connect(struct backend_info *be) · 787 unmodified lines
788788 /* Use the number of queues requested by the frontend */
789789 be->vif->queues = vzalloc(requested_num_queues *
790790 sizeof(struct xenvif_queue));
791+ if (!be->vif->queues) {
792+ xenbus_dev_fatal(dev, -ENOMEM,
793+ "allocating queues");
794+ return;
795+ }
796+
791797 be->vif->num_queues = requested_num_queues;
792798 be->vif->stalled_queues = requested_num_queues;
793799
drivers/pci/msi.c+4−0
@@ -1243,6 +1243,10 @@ static void pci_msi_domain_update_chip_ops(struct msi_domain_info *info) · 1242 unmodified lines
12431243 BUG_ON(!chip);
12441244 if (!chip->irq_write_msi_msg)
12451245 chip->irq_write_msi_msg = pci_msi_domain_write_msg;
1246+ if (!chip->irq_mask)
1247+ chip->irq_mask = pci_msi_mask_irq;
1248+ if (!chip->irq_unmask)
1249+ chip->irq_unmask = pci_msi_unmask_irq;
12461250 }
12471251
12481252 /**
drivers/perf/arm_pmu.c+8−2
@@ -823,9 +823,15 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu) · 822 unmodified lines
823823 }
824824
825825 /* Now look up the logical CPU number */
826− for_each_possible_cpu(cpu)
827− if (dn == of_cpu_device_node_get(cpu))
826+ for_each_possible_cpu(cpu) {
827+ struct device_node *cpu_dn;
828+
829+ cpu_dn = of_cpu_device_node_get(cpu);
830+ of_node_put(cpu_dn);
831+
832+ if (dn == cpu_dn)
828833 break;
834+ }
829835
830836 if (cpu >= nr_cpu_ids) {
831837 pr_warn("Failed to find logical CPU for %s\n",
drivers/pinctrl/freescale/pinctrl-imx25.c+3−1
@@ -26,7 +26,8 @@ · 25 unmodified lines
2626 #include "pinctrl-imx.h"
2727
2828 enum imx25_pads {
29− MX25_PAD_RESERVE0 = 1,
29+ MX25_PAD_RESERVE0 = 0,
30+ MX25_PAD_RESERVE1 = 1,
3031 MX25_PAD_A10 = 2,
3132 MX25_PAD_A13 = 3,
3233 MX25_PAD_A14 = 4,
@@ -169,6 +170,7 @@ enum imx25_pads { · 136 unmodified lines
169170 /* Pad names for the pinmux subsystem */
170171 static const struct pinctrl_pin_desc imx25_pinctrl_pads[] = {
171172 IMX_PINCTRL_PIN(MX25_PAD_RESERVE0),
173+ IMX_PINCTRL_PIN(MX25_PAD_RESERVE1),
172174 IMX_PINCTRL_PIN(MX25_PAD_A10),
173175 IMX_PINCTRL_PIN(MX25_PAD_A13),
174176 IMX_PINCTRL_PIN(MX25_PAD_A14),
drivers/pinctrl/sunxi/pinctrl-sun5i-a10s.c+1−1
@@ -653,7 +653,7 @@ static const struct sunxi_desc_pin sun5i_a10s_pins[] = { · 652 unmodified lines
653653 SUNXI_FUNCTION(0x0, "gpio_in"),
654654 SUNXI_FUNCTION(0x1, "gpio_out"),
655655 SUNXI_FUNCTION(0x2, "spi1"), /* CS1 */
656− SUNXI_FUNCTION(0x3, "uart3"), /* PWM1 */
656+ SUNXI_FUNCTION(0x3, "pwm"), /* PWM1 */
657657 SUNXI_FUNCTION(0x5, "uart2"), /* CTS */
658658 SUNXI_FUNCTION_IRQ(0x6, 13)), /* EINT13 */
659659 };
drivers/pinctrl/uniphier/pinctrl-ph1-sld8.c+113−113
@@ -22,49 +22,49 @@ · 21 unmodified lines
2222 #define DRIVER_NAME "ph1-sld8-pinctrl"
2323
2424 static const struct pinctrl_pin_desc ph1_sld8_pins[] = {
25− UNIPHIER_PINCTRL_PIN(0, "PCA00", UNIPHIER_PIN_IECTRL_NONE,
25+ UNIPHIER_PINCTRL_PIN(0, "PCA00", 0,
2626 15, UNIPHIER_PIN_DRV_4_8,
2727 15, UNIPHIER_PIN_PULL_DOWN),
28− UNIPHIER_PINCTRL_PIN(1, "PCA01", UNIPHIER_PIN_IECTRL_NONE,
28+ UNIPHIER_PINCTRL_PIN(1, "PCA01", 0,
2929 16, UNIPHIER_PIN_DRV_4_8,
3030 16, UNIPHIER_PIN_PULL_DOWN),
31− UNIPHIER_PINCTRL_PIN(2, "PCA02", UNIPHIER_PIN_IECTRL_NONE,
31+ UNIPHIER_PINCTRL_PIN(2, "PCA02", 0,
3232 17, UNIPHIER_PIN_DRV_4_8,
3333 17, UNIPHIER_PIN_PULL_DOWN),
34− UNIPHIER_PINCTRL_PIN(3, "PCA03", UNIPHIER_PIN_IECTRL_NONE,
34+ UNIPHIER_PINCTRL_PIN(3, "PCA03", 0,
3535 18, UNIPHIER_PIN_DRV_4_8,
3636 18, UNIPHIER_PIN_PULL_DOWN),
37− UNIPHIER_PINCTRL_PIN(4, "PCA04", UNIPHIER_PIN_IECTRL_NONE,
37+ UNIPHIER_PINCTRL_PIN(4, "PCA04", 0,
3838 19, UNIPHIER_PIN_DRV_4_8,
3939 19, UNIPHIER_PIN_PULL_DOWN),
40− UNIPHIER_PINCTRL_PIN(5, "PCA05", UNIPHIER_PIN_IECTRL_NONE,
40+ UNIPHIER_PINCTRL_PIN(5, "PCA05", 0,
4141 20, UNIPHIER_PIN_DRV_4_8,
4242 20, UNIPHIER_PIN_PULL_DOWN),
43− UNIPHIER_PINCTRL_PIN(6, "PCA06", UNIPHIER_PIN_IECTRL_NONE,
43+ UNIPHIER_PINCTRL_PIN(6, "PCA06", 0,
4444 21, UNIPHIER_PIN_DRV_4_8,
4545 21, UNIPHIER_PIN_PULL_DOWN),
46− UNIPHIER_PINCTRL_PIN(7, "PCA07", UNIPHIER_PIN_IECTRL_NONE,
46+ UNIPHIER_PINCTRL_PIN(7, "PCA07", 0,
4747 22, UNIPHIER_PIN_DRV_4_8,
4848 22, UNIPHIER_PIN_PULL_DOWN),
49− UNIPHIER_PINCTRL_PIN(8, "PCA08", UNIPHIER_PIN_IECTRL_NONE,
49+ UNIPHIER_PINCTRL_PIN(8, "PCA08", 0,
5050 23, UNIPHIER_PIN_DRV_4_8,
5151 23, UNIPHIER_PIN_PULL_DOWN),
52− UNIPHIER_PINCTRL_PIN(9, "PCA09", UNIPHIER_PIN_IECTRL_NONE,
52+ UNIPHIER_PINCTRL_PIN(9, "PCA09", 0,
5353 24, UNIPHIER_PIN_DRV_4_8,
5454 24, UNIPHIER_PIN_PULL_DOWN),
55− UNIPHIER_PINCTRL_PIN(10, "PCA10", UNIPHIER_PIN_IECTRL_NONE,
55+ UNIPHIER_PINCTRL_PIN(10, "PCA10", 0,
5656 25, UNIPHIER_PIN_DRV_4_8,
5757 25, UNIPHIER_PIN_PULL_DOWN),
58− UNIPHIER_PINCTRL_PIN(11, "PCA11", UNIPHIER_PIN_IECTRL_NONE,
58+ UNIPHIER_PINCTRL_PIN(11, "PCA11", 0,
5959 26, UNIPHIER_PIN_DRV_4_8,
6060 26, UNIPHIER_PIN_PULL_DOWN),
61− UNIPHIER_PINCTRL_PIN(12, "PCA12", UNIPHIER_PIN_IECTRL_NONE,
61+ UNIPHIER_PINCTRL_PIN(12, "PCA12", 0,
6262 27, UNIPHIER_PIN_DRV_4_8,
6363 27, UNIPHIER_PIN_PULL_DOWN),
64− UNIPHIER_PINCTRL_PIN(13, "PCA13", UNIPHIER_PIN_IECTRL_NONE,
64+ UNIPHIER_PINCTRL_PIN(13, "PCA13", 0,
6565 28, UNIPHIER_PIN_DRV_4_8,
6666 28, UNIPHIER_PIN_PULL_DOWN),
67− UNIPHIER_PINCTRL_PIN(14, "PCA14", UNIPHIER_PIN_IECTRL_NONE,
67+ UNIPHIER_PINCTRL_PIN(14, "PCA14", 0,
6868 29, UNIPHIER_PIN_DRV_4_8,
6969 29, UNIPHIER_PIN_PULL_DOWN),
7070 UNIPHIER_PINCTRL_PIN(15, "XNFRE_GB", UNIPHIER_PIN_IECTRL_NONE,
@@ -118,199 +118,199 @@ static const struct pinctrl_pin_desc ph1_sld8_pins[] = { · 47 unmodified lines
118118 UNIPHIER_PINCTRL_PIN(31, "NFD7_GB", UNIPHIER_PIN_IECTRL_NONE,
119119 36, UNIPHIER_PIN_DRV_8_12_16_20,
120120 128, UNIPHIER_PIN_PULL_UP),
121− UNIPHIER_PINCTRL_PIN(32, "SDCLK", UNIPHIER_PIN_IECTRL_NONE,
121+ UNIPHIER_PINCTRL_PIN(32, "SDCLK", 8,
122122 40, UNIPHIER_PIN_DRV_8_12_16_20,
123123 -1, UNIPHIER_PIN_PULL_NONE),
124− UNIPHIER_PINCTRL_PIN(33, "SDCMD", UNIPHIER_PIN_IECTRL_NONE,
124+ UNIPHIER_PINCTRL_PIN(33, "SDCMD", 8,
125125 44, UNIPHIER_PIN_DRV_8_12_16_20,
126126 -1, UNIPHIER_PIN_PULL_NONE),
127− UNIPHIER_PINCTRL_PIN(34, "SDDAT0", UNIPHIER_PIN_IECTRL_NONE,
127+ UNIPHIER_PINCTRL_PIN(34, "SDDAT0", 8,
128128 48, UNIPHIER_PIN_DRV_8_12_16_20,
129129 -1, UNIPHIER_PIN_PULL_NONE),
130− UNIPHIER_PINCTRL_PIN(35, "SDDAT1", UNIPHIER_PIN_IECTRL_NONE,
130+ UNIPHIER_PINCTRL_PIN(35, "SDDAT1", 8,
131131 52, UNIPHIER_PIN_DRV_8_12_16_20,
132132 -1, UNIPHIER_PIN_PULL_NONE),
133− UNIPHIER_PINCTRL_PIN(36, "SDDAT2", UNIPHIER_PIN_IECTRL_NONE,
133+ UNIPHIER_PINCTRL_PIN(36, "SDDAT2", 8,
134134 56, UNIPHIER_PIN_DRV_8_12_16_20,
135135 -1, UNIPHIER_PIN_PULL_NONE),
136− UNIPHIER_PINCTRL_PIN(37, "SDDAT3", UNIPHIER_PIN_IECTRL_NONE,
136+ UNIPHIER_PINCTRL_PIN(37, "SDDAT3", 8,
137137 60, UNIPHIER_PIN_DRV_8_12_16_20,
138138 -1, UNIPHIER_PIN_PULL_NONE),
139− UNIPHIER_PINCTRL_PIN(38, "SDCD", UNIPHIER_PIN_IECTRL_NONE,
139+ UNIPHIER_PINCTRL_PIN(38, "SDCD", 8,
140140 -1, UNIPHIER_PIN_DRV_FIXED_4,
141141 129, UNIPHIER_PIN_PULL_DOWN),
142− UNIPHIER_PINCTRL_PIN(39, "SDWP", UNIPHIER_PIN_IECTRL_NONE,
142+ UNIPHIER_PINCTRL_PIN(39, "SDWP", 8,
143143 -1, UNIPHIER_PIN_DRV_FIXED_4,
144144 130, UNIPHIER_PIN_PULL_DOWN),
145− UNIPHIER_PINCTRL_PIN(40, "SDVOLC", UNIPHIER_PIN_IECTRL_NONE,
145+ UNIPHIER_PINCTRL_PIN(40, "SDVOLC", 9,
146146 -1, UNIPHIER_PIN_DRV_FIXED_4,
147147 131, UNIPHIER_PIN_PULL_DOWN),
148− UNIPHIER_PINCTRL_PIN(41, "USB0VBUS", UNIPHIER_PIN_IECTRL_NONE,
148+ UNIPHIER_PINCTRL_PIN(41, "USB0VBUS", 0,
149149 37, UNIPHIER_PIN_DRV_4_8,
150150 37, UNIPHIER_PIN_PULL_DOWN),
151− UNIPHIER_PINCTRL_PIN(42, "USB0OD", UNIPHIER_PIN_IECTRL_NONE,
151+ UNIPHIER_PINCTRL_PIN(42, "USB0OD", 0,
152152 38, UNIPHIER_PIN_DRV_4_8,
153153 38, UNIPHIER_PIN_PULL_DOWN),
154− UNIPHIER_PINCTRL_PIN(43, "USB1VBUS", UNIPHIER_PIN_IECTRL_NONE,
154+ UNIPHIER_PINCTRL_PIN(43, "USB1VBUS", 0,
155155 39, UNIPHIER_PIN_DRV_4_8,
156156 39, UNIPHIER_PIN_PULL_DOWN),
157− UNIPHIER_PINCTRL_PIN(44, "USB1OD", UNIPHIER_PIN_IECTRL_NONE,
157+ UNIPHIER_PINCTRL_PIN(44, "USB1OD", 0,
158158 40, UNIPHIER_PIN_DRV_4_8,
159159 40, UNIPHIER_PIN_PULL_DOWN),
160− UNIPHIER_PINCTRL_PIN(45, "PCRESET", UNIPHIER_PIN_IECTRL_NONE,
160+ UNIPHIER_PINCTRL_PIN(45, "PCRESET", 0,
161161 41, UNIPHIER_PIN_DRV_4_8,
162162 41, UNIPHIER_PIN_PULL_DOWN),
163− UNIPHIER_PINCTRL_PIN(46, "PCREG", UNIPHIER_PIN_IECTRL_NONE,
163+ UNIPHIER_PINCTRL_PIN(46, "PCREG", 0,
164164 42, UNIPHIER_PIN_DRV_4_8,
165165 42, UNIPHIER_PIN_PULL_DOWN),
166− UNIPHIER_PINCTRL_PIN(47, "PCCE2", UNIPHIER_PIN_IECTRL_NONE,
166+ UNIPHIER_PINCTRL_PIN(47, "PCCE2", 0,
167167 43, UNIPHIER_PIN_DRV_4_8,
168168 43, UNIPHIER_PIN_PULL_DOWN),
169− UNIPHIER_PINCTRL_PIN(48, "PCVS1", UNIPHIER_PIN_IECTRL_NONE,
169+ UNIPHIER_PINCTRL_PIN(48, "PCVS1", 0,
170170 44, UNIPHIER_PIN_DRV_4_8,
171171 44, UNIPHIER_PIN_PULL_DOWN),
172− UNIPHIER_PINCTRL_PIN(49, "PCCD2", UNIPHIER_PIN_IECTRL_NONE,
172+ UNIPHIER_PINCTRL_PIN(49, "PCCD2", 0,
173173 45, UNIPHIER_PIN_DRV_4_8,
174174 45, UNIPHIER_PIN_PULL_DOWN),
175− UNIPHIER_PINCTRL_PIN(50, "PCCD1", UNIPHIER_PIN_IECTRL_NONE,
175+ UNIPHIER_PINCTRL_PIN(50, "PCCD1", 0,
176176 46, UNIPHIER_PIN_DRV_4_8,
177177 46, UNIPHIER_PIN_PULL_DOWN),
178− UNIPHIER_PINCTRL_PIN(51, "PCREADY", UNIPHIER_PIN_IECTRL_NONE,
178+ UNIPHIER_PINCTRL_PIN(51, "PCREADY", 0,
179179 47, UNIPHIER_PIN_DRV_4_8,
180180 47, UNIPHIER_PIN_PULL_DOWN),
181− UNIPHIER_PINCTRL_PIN(52, "PCDOE", UNIPHIER_PIN_IECTRL_NONE,
181+ UNIPHIER_PINCTRL_PIN(52, "PCDOE", 0,
182182 48, UNIPHIER_PIN_DRV_4_8,
183183 48, UNIPHIER_PIN_PULL_DOWN),
184− UNIPHIER_PINCTRL_PIN(53, "PCCE1", UNIPHIER_PIN_IECTRL_NONE,
184+ UNIPHIER_PINCTRL_PIN(53, "PCCE1", 0,
185185 49, UNIPHIER_PIN_DRV_4_8,
186186 49, UNIPHIER_PIN_PULL_DOWN),
187− UNIPHIER_PINCTRL_PIN(54, "PCWE", UNIPHIER_PIN_IECTRL_NONE,
187+ UNIPHIER_PINCTRL_PIN(54, "PCWE", 0,
188188 50, UNIPHIER_PIN_DRV_4_8,
189189 50, UNIPHIER_PIN_PULL_DOWN),
190− UNIPHIER_PINCTRL_PIN(55, "PCOE", UNIPHIER_PIN_IECTRL_NONE,
190+ UNIPHIER_PINCTRL_PIN(55, "PCOE", 0,
191191 51, UNIPHIER_PIN_DRV_4_8,
192192 51, UNIPHIER_PIN_PULL_DOWN),
193− UNIPHIER_PINCTRL_PIN(56, "PCWAIT", UNIPHIER_PIN_IECTRL_NONE,
193+ UNIPHIER_PINCTRL_PIN(56, "PCWAIT", 0,
194194 52, UNIPHIER_PIN_DRV_4_8,
195195 52, UNIPHIER_PIN_PULL_DOWN),
196− UNIPHIER_PINCTRL_PIN(57, "PCIOWR", UNIPHIER_PIN_IECTRL_NONE,
196+ UNIPHIER_PINCTRL_PIN(57, "PCIOWR", 0,
197197 53, UNIPHIER_PIN_DRV_4_8,
198198 53, UNIPHIER_PIN_PULL_DOWN),
199− UNIPHIER_PINCTRL_PIN(58, "PCIORD", UNIPHIER_PIN_IECTRL_NONE,
199+ UNIPHIER_PINCTRL_PIN(58, "PCIORD", 0,
200200 54, UNIPHIER_PIN_DRV_4_8,
201201 54, UNIPHIER_PIN_PULL_DOWN),
202− UNIPHIER_PINCTRL_PIN(59, "HS0DIN0", UNIPHIER_PIN_IECTRL_NONE,
202+ UNIPHIER_PINCTRL_PIN(59, "HS0DIN0", 0,
203203 55, UNIPHIER_PIN_DRV_4_8,
204204 55, UNIPHIER_PIN_PULL_DOWN),
205− UNIPHIER_PINCTRL_PIN(60, "HS0DIN1", UNIPHIER_PIN_IECTRL_NONE,
205+ UNIPHIER_PINCTRL_PIN(60, "HS0DIN1", 0,
206206 56, UNIPHIER_PIN_DRV_4_8,
207207 56, UNIPHIER_PIN_PULL_DOWN),
208− UNIPHIER_PINCTRL_PIN(61, "HS0DIN2", UNIPHIER_PIN_IECTRL_NONE,
208+ UNIPHIER_PINCTRL_PIN(61, "HS0DIN2", 0,
209209 57, UNIPHIER_PIN_DRV_4_8,
210210 57, UNIPHIER_PIN_PULL_DOWN),
211− UNIPHIER_PINCTRL_PIN(62, "HS0DIN3", UNIPHIER_PIN_IECTRL_NONE,
211+ UNIPHIER_PINCTRL_PIN(62, "HS0DIN3", 0,
212212 58, UNIPHIER_PIN_DRV_4_8,
213213 58, UNIPHIER_PIN_PULL_DOWN),
214− UNIPHIER_PINCTRL_PIN(63, "HS0DIN4", UNIPHIER_PIN_IECTRL_NONE,
214+ UNIPHIER_PINCTRL_PIN(63, "HS0DIN4", 0,
215215 59, UNIPHIER_PIN_DRV_4_8,
216216 59, UNIPHIER_PIN_PULL_DOWN),
217− UNIPHIER_PINCTRL_PIN(64, "HS0DIN5", UNIPHIER_PIN_IECTRL_NONE,
217+ UNIPHIER_PINCTRL_PIN(64, "HS0DIN5", 0,
218218 60, UNIPHIER_PIN_DRV_4_8,
219219 60, UNIPHIER_PIN_PULL_DOWN),
220− UNIPHIER_PINCTRL_PIN(65, "HS0DIN6", UNIPHIER_PIN_IECTRL_NONE,
220+ UNIPHIER_PINCTRL_PIN(65, "HS0DIN6", 0,
221221 61, UNIPHIER_PIN_DRV_4_8,
222222 61, UNIPHIER_PIN_PULL_DOWN),
223− UNIPHIER_PINCTRL_PIN(66, "HS0DIN7", UNIPHIER_PIN_IECTRL_NONE,
223+ UNIPHIER_PINCTRL_PIN(66, "HS0DIN7", 0,
224224 62, UNIPHIER_PIN_DRV_4_8,
225225 62, UNIPHIER_PIN_PULL_DOWN),
226− UNIPHIER_PINCTRL_PIN(67, "HS0BCLKIN", UNIPHIER_PIN_IECTRL_NONE,
226+ UNIPHIER_PINCTRL_PIN(67, "HS0BCLKIN", 0,
227227 63, UNIPHIER_PIN_DRV_4_8,
228228 63, UNIPHIER_PIN_PULL_DOWN),
229− UNIPHIER_PINCTRL_PIN(68, "HS0VALIN", UNIPHIER_PIN_IECTRL_NONE,
229+ UNIPHIER_PINCTRL_PIN(68, "HS0VALIN", 0,
230230 64, UNIPHIER_PIN_DRV_4_8,
231231 64, UNIPHIER_PIN_PULL_DOWN),
232− UNIPHIER_PINCTRL_PIN(69, "HS0SYNCIN", UNIPHIER_PIN_IECTRL_NONE,
232+ UNIPHIER_PINCTRL_PIN(69, "HS0SYNCIN", 0,
233233 65, UNIPHIER_PIN_DRV_4_8,
234234 65, UNIPHIER_PIN_PULL_DOWN),
235− UNIPHIER_PINCTRL_PIN(70, "HSDOUT0", UNIPHIER_PIN_IECTRL_NONE,
235+ UNIPHIER_PINCTRL_PIN(70, "HSDOUT0", 0,
236236 66, UNIPHIER_PIN_DRV_4_8,
237237 66, UNIPHIER_PIN_PULL_DOWN),
238− UNIPHIER_PINCTRL_PIN(71, "HSDOUT1", UNIPHIER_PIN_IECTRL_NONE,
238+ UNIPHIER_PINCTRL_PIN(71, "HSDOUT1", 0,
239239 67, UNIPHIER_PIN_DRV_4_8,
240240 67, UNIPHIER_PIN_PULL_DOWN),
241− UNIPHIER_PINCTRL_PIN(72, "HSDOUT2", UNIPHIER_PIN_IECTRL_NONE,
241+ UNIPHIER_PINCTRL_PIN(72, "HSDOUT2", 0,
242242 68, UNIPHIER_PIN_DRV_4_8,
243243 68, UNIPHIER_PIN_PULL_DOWN),
244− UNIPHIER_PINCTRL_PIN(73, "HSDOUT3", UNIPHIER_PIN_IECTRL_NONE,
244+ UNIPHIER_PINCTRL_PIN(73, "HSDOUT3", 0,
245245 69, UNIPHIER_PIN_DRV_4_8,
246246 69, UNIPHIER_PIN_PULL_DOWN),
247− UNIPHIER_PINCTRL_PIN(74, "HSDOUT4", UNIPHIER_PIN_IECTRL_NONE,
247+ UNIPHIER_PINCTRL_PIN(74, "HSDOUT4", 0,
248248 70, UNIPHIER_PIN_DRV_4_8,
249249 70, UNIPHIER_PIN_PULL_DOWN),
250− UNIPHIER_PINCTRL_PIN(75, "HSDOUT5", UNIPHIER_PIN_IECTRL_NONE,
250+ UNIPHIER_PINCTRL_PIN(75, "HSDOUT5", 0,
251251 71, UNIPHIER_PIN_DRV_4_8,
252252 71, UNIPHIER_PIN_PULL_DOWN),
253− UNIPHIER_PINCTRL_PIN(76, "HSDOUT6", UNIPHIER_PIN_IECTRL_NONE,
253+ UNIPHIER_PINCTRL_PIN(76, "HSDOUT6", 0,
254254 72, UNIPHIER_PIN_DRV_4_8,
255255 72, UNIPHIER_PIN_PULL_DOWN),
256− UNIPHIER_PINCTRL_PIN(77, "HSDOUT7", UNIPHIER_PIN_IECTRL_NONE,
256+ UNIPHIER_PINCTRL_PIN(77, "HSDOUT7", 0,
257257 73, UNIPHIER_PIN_DRV_4_8,
258258 73, UNIPHIER_PIN_PULL_DOWN),
259− UNIPHIER_PINCTRL_PIN(78, "HSBCLKOUT", UNIPHIER_PIN_IECTRL_NONE,
259+ UNIPHIER_PINCTRL_PIN(78, "HSBCLKOUT", 0,
260260 74, UNIPHIER_PIN_DRV_4_8,
261261 74, UNIPHIER_PIN_PULL_DOWN),
262− UNIPHIER_PINCTRL_PIN(79, "HSVALOUT", UNIPHIER_PIN_IECTRL_NONE,
262+ UNIPHIER_PINCTRL_PIN(79, "HSVALOUT", 0,
263263 75, UNIPHIER_PIN_DRV_4_8,
264264 75, UNIPHIER_PIN_PULL_DOWN),
265− UNIPHIER_PINCTRL_PIN(80, "HSSYNCOUT", UNIPHIER_PIN_IECTRL_NONE,
265+ UNIPHIER_PINCTRL_PIN(80, "HSSYNCOUT", 0,
266266 76, UNIPHIER_PIN_DRV_4_8,
267267 76, UNIPHIER_PIN_PULL_DOWN),
268− UNIPHIER_PINCTRL_PIN(81, "HS1DIN0", UNIPHIER_PIN_IECTRL_NONE,
268+ UNIPHIER_PINCTRL_PIN(81, "HS1DIN0", 0,
269269 77, UNIPHIER_PIN_DRV_4_8,
270270 77, UNIPHIER_PIN_PULL_DOWN),
271− UNIPHIER_PINCTRL_PIN(82, "HS1DIN1", UNIPHIER_PIN_IECTRL_NONE,
271+ UNIPHIER_PINCTRL_PIN(82, "HS1DIN1", 0,
272272 78, UNIPHIER_PIN_DRV_4_8,
273273 78, UNIPHIER_PIN_PULL_DOWN),
274− UNIPHIER_PINCTRL_PIN(83, "HS1DIN2", UNIPHIER_PIN_IECTRL_NONE,
274+ UNIPHIER_PINCTRL_PIN(83, "HS1DIN2", 0,
275275 79, UNIPHIER_PIN_DRV_4_8,
276276 79, UNIPHIER_PIN_PULL_DOWN),
277− UNIPHIER_PINCTRL_PIN(84, "HS1DIN3", UNIPHIER_PIN_IECTRL_NONE,
277+ UNIPHIER_PINCTRL_PIN(84, "HS1DIN3", 0,
278278 80, UNIPHIER_PIN_DRV_4_8,
279279 80, UNIPHIER_PIN_PULL_DOWN),
280− UNIPHIER_PINCTRL_PIN(85, "HS1DIN4", UNIPHIER_PIN_IECTRL_NONE,
280+ UNIPHIER_PINCTRL_PIN(85, "HS1DIN4", 0,
281281 81, UNIPHIER_PIN_DRV_4_8,
282282 81, UNIPHIER_PIN_PULL_DOWN),
283− UNIPHIER_PINCTRL_PIN(86, "HS1DIN5", UNIPHIER_PIN_IECTRL_NONE,
283+ UNIPHIER_PINCTRL_PIN(86, "HS1DIN5", 0,
284284 82, UNIPHIER_PIN_DRV_4_8,
285285 82, UNIPHIER_PIN_PULL_DOWN),
286− UNIPHIER_PINCTRL_PIN(87, "HS1DIN6", UNIPHIER_PIN_IECTRL_NONE,
286+ UNIPHIER_PINCTRL_PIN(87, "HS1DIN6", 0,
287287 83, UNIPHIER_PIN_DRV_4_8,
288288 83, UNIPHIER_PIN_PULL_DOWN),
289− UNIPHIER_PINCTRL_PIN(88, "HS1DIN7", UNIPHIER_PIN_IECTRL_NONE,
289+ UNIPHIER_PINCTRL_PIN(88, "HS1DIN7", 0,
290290 84, UNIPHIER_PIN_DRV_4_8,
291291 84, UNIPHIER_PIN_PULL_DOWN),
292− UNIPHIER_PINCTRL_PIN(89, "HS1BCLKIN", UNIPHIER_PIN_IECTRL_NONE,
292+ UNIPHIER_PINCTRL_PIN(89, "HS1BCLKIN", 0,
293293 85, UNIPHIER_PIN_DRV_4_8,
294294 85, UNIPHIER_PIN_PULL_DOWN),
295− UNIPHIER_PINCTRL_PIN(90, "HS1VALIN", UNIPHIER_PIN_IECTRL_NONE,
295+ UNIPHIER_PINCTRL_PIN(90, "HS1VALIN", 0,
296296 86, UNIPHIER_PIN_DRV_4_8,
297297 86, UNIPHIER_PIN_PULL_DOWN),
298− UNIPHIER_PINCTRL_PIN(91, "HS1SYNCIN", UNIPHIER_PIN_IECTRL_NONE,
298+ UNIPHIER_PINCTRL_PIN(91, "HS1SYNCIN", 0,
299299 87, UNIPHIER_PIN_DRV_4_8,
300300 87, UNIPHIER_PIN_PULL_DOWN),
301− UNIPHIER_PINCTRL_PIN(92, "AGCI", UNIPHIER_PIN_IECTRL_NONE,
301+ UNIPHIER_PINCTRL_PIN(92, "AGCI", 3,
302302 -1, UNIPHIER_PIN_DRV_FIXED_4,
303303 132, UNIPHIER_PIN_PULL_DOWN),
304− UNIPHIER_PINCTRL_PIN(93, "AGCR", UNIPHIER_PIN_IECTRL_NONE,
304+ UNIPHIER_PINCTRL_PIN(93, "AGCR", 4,
305305 -1, UNIPHIER_PIN_DRV_FIXED_4,
306306 133, UNIPHIER_PIN_PULL_DOWN),
307− UNIPHIER_PINCTRL_PIN(94, "AGCBS", UNIPHIER_PIN_IECTRL_NONE,
307+ UNIPHIER_PINCTRL_PIN(94, "AGCBS", 5,
308308 -1, UNIPHIER_PIN_DRV_FIXED_4,
309309 134, UNIPHIER_PIN_PULL_DOWN),
310− UNIPHIER_PINCTRL_PIN(95, "IECOUT", UNIPHIER_PIN_IECTRL_NONE,
310+ UNIPHIER_PINCTRL_PIN(95, "IECOUT", 0,
311311 88, UNIPHIER_PIN_DRV_4_8,
312312 88, UNIPHIER_PIN_PULL_DOWN),
313− UNIPHIER_PINCTRL_PIN(96, "ASMCK", UNIPHIER_PIN_IECTRL_NONE,
313+ UNIPHIER_PINCTRL_PIN(96, "ASMCK", 0,
314314 89, UNIPHIER_PIN_DRV_4_8,
315315 89, UNIPHIER_PIN_PULL_DOWN),
316316 UNIPHIER_PINCTRL_PIN(97, "ABCKO", UNIPHIER_PIN_IECTRL_NONE,
@@ -325,31 +325,31 @@ static const struct pinctrl_pin_desc ph1_sld8_pins[] = { · 8 unmodified lines
325325 UNIPHIER_PINCTRL_PIN(100, "ASDOUT1", UNIPHIER_PIN_IECTRL_NONE,
326326 93, UNIPHIER_PIN_DRV_4_8,
327327 93, UNIPHIER_PIN_PULL_UP),
328− UNIPHIER_PINCTRL_PIN(101, "ARCOUT", UNIPHIER_PIN_IECTRL_NONE,
328+ UNIPHIER_PINCTRL_PIN(101, "ARCOUT", 0,
329329 94, UNIPHIER_PIN_DRV_4_8,
330330 94, UNIPHIER_PIN_PULL_DOWN),
331− UNIPHIER_PINCTRL_PIN(102, "SDA0", UNIPHIER_PIN_IECTRL_NONE,
331+ UNIPHIER_PINCTRL_PIN(102, "SDA0", 10,
332332 -1, UNIPHIER_PIN_DRV_FIXED_4,
333333 -1, UNIPHIER_PIN_PULL_NONE),
334− UNIPHIER_PINCTRL_PIN(103, "SCL0", UNIPHIER_PIN_IECTRL_NONE,
334+ UNIPHIER_PINCTRL_PIN(103, "SCL0", 10,
335335 -1, UNIPHIER_PIN_DRV_FIXED_4,
336336 -1, UNIPHIER_PIN_PULL_NONE),
337− UNIPHIER_PINCTRL_PIN(104, "SDA1", UNIPHIER_PIN_IECTRL_NONE,
337+ UNIPHIER_PINCTRL_PIN(104, "SDA1", 11,
338338 -1, UNIPHIER_PIN_DRV_FIXED_4,
339339 -1, UNIPHIER_PIN_PULL_NONE),
340− UNIPHIER_PINCTRL_PIN(105, "SCL1", UNIPHIER_PIN_IECTRL_NONE,
340+ UNIPHIER_PINCTRL_PIN(105, "SCL1", 11,
341341 -1, UNIPHIER_PIN_DRV_FIXED_4,
342342 -1, UNIPHIER_PIN_PULL_NONE),
343− UNIPHIER_PINCTRL_PIN(106, "DMDSDA0", UNIPHIER_PIN_IECTRL_NONE,
343+ UNIPHIER_PINCTRL_PIN(106, "DMDSDA0", 12,
344344 -1, UNIPHIER_PIN_DRV_FIXED_4,
345345 -1, UNIPHIER_PIN_PULL_NONE),
346− UNIPHIER_PINCTRL_PIN(107, "DMDSCL0", UNIPHIER_PIN_IECTRL_NONE,
346+ UNIPHIER_PINCTRL_PIN(107, "DMDSCL0", 12,
347347 -1, UNIPHIER_PIN_DRV_FIXED_4,
348348 -1, UNIPHIER_PIN_PULL_NONE),
349− UNIPHIER_PINCTRL_PIN(108, "DMDSDA1", UNIPHIER_PIN_IECTRL_NONE,
349+ UNIPHIER_PINCTRL_PIN(108, "DMDSDA1", 13,
350350 -1, UNIPHIER_PIN_DRV_FIXED_4,
351351 -1, UNIPHIER_PIN_PULL_NONE),
352− UNIPHIER_PINCTRL_PIN(109, "DMDSCL1", UNIPHIER_PIN_IECTRL_NONE,
352+ UNIPHIER_PINCTRL_PIN(109, "DMDSCL1", 13,
353353 -1, UNIPHIER_PIN_DRV_FIXED_4,
354354 -1, UNIPHIER_PIN_PULL_NONE),
355355 UNIPHIER_PINCTRL_PIN(110, "SBO0", UNIPHIER_PIN_IECTRL_NONE,
@@ -358,76 +358,76 @@ static const struct pinctrl_pin_desc ph1_sld8_pins[] = { · 2 unmodified lines
358358 UNIPHIER_PINCTRL_PIN(111, "SBI0", UNIPHIER_PIN_IECTRL_NONE,
359359 96, UNIPHIER_PIN_DRV_4_8,
360360 96, UNIPHIER_PIN_PULL_UP),
361− UNIPHIER_PINCTRL_PIN(112, "SBO1", UNIPHIER_PIN_IECTRL_NONE,
361+ UNIPHIER_PINCTRL_PIN(112, "SBO1", 0,
362362 97, UNIPHIER_PIN_DRV_4_8,
363363 97, UNIPHIER_PIN_PULL_UP),
364− UNIPHIER_PINCTRL_PIN(113, "SBI1", UNIPHIER_PIN_IECTRL_NONE,
364+ UNIPHIER_PINCTRL_PIN(113, "SBI1", 0,
365365 98, UNIPHIER_PIN_DRV_4_8,
366366 98, UNIPHIER_PIN_PULL_UP),
367− UNIPHIER_PINCTRL_PIN(114, "TXD1", UNIPHIER_PIN_IECTRL_NONE,
367+ UNIPHIER_PINCTRL_PIN(114, "TXD1", 0,
368368 99, UNIPHIER_PIN_DRV_4_8,
369369 99, UNIPHIER_PIN_PULL_UP),
370− UNIPHIER_PINCTRL_PIN(115, "RXD1", UNIPHIER_PIN_IECTRL_NONE,
370+ UNIPHIER_PINCTRL_PIN(115, "RXD1", 0,
371371 100, UNIPHIER_PIN_DRV_4_8,
372372 100, UNIPHIER_PIN_PULL_UP),
373− UNIPHIER_PINCTRL_PIN(116, "HIN", UNIPHIER_PIN_IECTRL_NONE,
373+ UNIPHIER_PINCTRL_PIN(116, "HIN", 1,
374374 -1, UNIPHIER_PIN_DRV_FIXED_5,
375375 -1, UNIPHIER_PIN_PULL_NONE),
376− UNIPHIER_PINCTRL_PIN(117, "VIN", UNIPHIER_PIN_IECTRL_NONE,
376+ UNIPHIER_PINCTRL_PIN(117, "VIN", 2,
377377 -1, UNIPHIER_PIN_DRV_FIXED_5,
378378 -1, UNIPHIER_PIN_PULL_NONE),
379− UNIPHIER_PINCTRL_PIN(118, "TCON0", UNIPHIER_PIN_IECTRL_NONE,
379+ UNIPHIER_PINCTRL_PIN(118, "TCON0", 0,
380380 101, UNIPHIER_PIN_DRV_4_8,
381381 101, UNIPHIER_PIN_PULL_DOWN),
382− UNIPHIER_PINCTRL_PIN(119, "TCON1", UNIPHIER_PIN_IECTRL_NONE,
382+ UNIPHIER_PINCTRL_PIN(119, "TCON1", 0,
383383 102, UNIPHIER_PIN_DRV_4_8,
384384 102, UNIPHIER_PIN_PULL_DOWN),
385− UNIPHIER_PINCTRL_PIN(120, "TCON2", UNIPHIER_PIN_IECTRL_NONE,
385+ UNIPHIER_PINCTRL_PIN(120, "TCON2", 0,
386386 103, UNIPHIER_PIN_DRV_4_8,
387387 103, UNIPHIER_PIN_PULL_DOWN),
388− UNIPHIER_PINCTRL_PIN(121, "TCON3", UNIPHIER_PIN_IECTRL_NONE,
388+ UNIPHIER_PINCTRL_PIN(121, "TCON3", 0,
389389 104, UNIPHIER_PIN_DRV_4_8,
390390 104, UNIPHIER_PIN_PULL_DOWN),
391− UNIPHIER_PINCTRL_PIN(122, "TCON4", UNIPHIER_PIN_IECTRL_NONE,
391+ UNIPHIER_PINCTRL_PIN(122, "TCON4", 0,
392392 105, UNIPHIER_PIN_DRV_4_8,
393393 105, UNIPHIER_PIN_PULL_DOWN),
394− UNIPHIER_PINCTRL_PIN(123, "TCON5", UNIPHIER_PIN_IECTRL_NONE,
394+ UNIPHIER_PINCTRL_PIN(123, "TCON5", 0,
395395 106, UNIPHIER_PIN_DRV_4_8,
396396 106, UNIPHIER_PIN_PULL_DOWN),
397− UNIPHIER_PINCTRL_PIN(124, "TCON6", UNIPHIER_PIN_IECTRL_NONE,
397+ UNIPHIER_PINCTRL_PIN(124, "TCON6", 0,
398398 107, UNIPHIER_PIN_DRV_4_8,
399399 107, UNIPHIER_PIN_PULL_DOWN),
400− UNIPHIER_PINCTRL_PIN(125, "TCON7", UNIPHIER_PIN_IECTRL_NONE,
400+ UNIPHIER_PINCTRL_PIN(125, "TCON7", 0,
401401 108, UNIPHIER_PIN_DRV_4_8,
402402 108, UNIPHIER_PIN_PULL_DOWN),
403− UNIPHIER_PINCTRL_PIN(126, "TCON8", UNIPHIER_PIN_IECTRL_NONE,
403+ UNIPHIER_PINCTRL_PIN(126, "TCON8", 0,
404404 109, UNIPHIER_PIN_DRV_4_8,
405405 109, UNIPHIER_PIN_PULL_DOWN),
406− UNIPHIER_PINCTRL_PIN(127, "PWMA", UNIPHIER_PIN_IECTRL_NONE,
406+ UNIPHIER_PINCTRL_PIN(127, "PWMA", 0,
407407 110, UNIPHIER_PIN_DRV_4_8,
408408 110, UNIPHIER_PIN_PULL_DOWN),
409− UNIPHIER_PINCTRL_PIN(128, "XIRQ0", UNIPHIER_PIN_IECTRL_NONE,
409+ UNIPHIER_PINCTRL_PIN(128, "XIRQ0", 0,
410410 111, UNIPHIER_PIN_DRV_4_8,
411411 111, UNIPHIER_PIN_PULL_DOWN),
412− UNIPHIER_PINCTRL_PIN(129, "XIRQ1", UNIPHIER_PIN_IECTRL_NONE,
412+ UNIPHIER_PINCTRL_PIN(129, "XIRQ1", 0,
413413 112, UNIPHIER_PIN_DRV_4_8,
414414 112, UNIPHIER_PIN_PULL_DOWN),
415− UNIPHIER_PINCTRL_PIN(130, "XIRQ2", UNIPHIER_PIN_IECTRL_NONE,
415+ UNIPHIER_PINCTRL_PIN(130, "XIRQ2", 0,
416416 113, UNIPHIER_PIN_DRV_4_8,
417417 113, UNIPHIER_PIN_PULL_DOWN),
418− UNIPHIER_PINCTRL_PIN(131, "XIRQ3", UNIPHIER_PIN_IECTRL_NONE,
418+ UNIPHIER_PINCTRL_PIN(131, "XIRQ3", 0,
419419 114, UNIPHIER_PIN_DRV_4_8,
420420 114, UNIPHIER_PIN_PULL_DOWN),
421− UNIPHIER_PINCTRL_PIN(132, "XIRQ4", UNIPHIER_PIN_IECTRL_NONE,
421+ UNIPHIER_PINCTRL_PIN(132, "XIRQ4", 0,
422422 115, UNIPHIER_PIN_DRV_4_8,
423423 115, UNIPHIER_PIN_PULL_DOWN),
424− UNIPHIER_PINCTRL_PIN(133, "XIRQ5", UNIPHIER_PIN_IECTRL_NONE,
424+ UNIPHIER_PINCTRL_PIN(133, "XIRQ5", 0,
425425 116, UNIPHIER_PIN_DRV_4_8,
426426 116, UNIPHIER_PIN_PULL_DOWN),
427− UNIPHIER_PINCTRL_PIN(134, "XIRQ6", UNIPHIER_PIN_IECTRL_NONE,
427+ UNIPHIER_PINCTRL_PIN(134, "XIRQ6", 0,
428428 117, UNIPHIER_PIN_DRV_4_8,
429429 117, UNIPHIER_PIN_PULL_DOWN),
430− UNIPHIER_PINCTRL_PIN(135, "XIRQ7", UNIPHIER_PIN_IECTRL_NONE,
430+ UNIPHIER_PINCTRL_PIN(135, "XIRQ7", 0,
431431 118, UNIPHIER_PIN_DRV_4_8,
432432 118, UNIPHIER_PIN_PULL_DOWN),
433433 };
drivers/staging/iio/accel/sca3000_ring.c+1−1
@@ -116,7 +116,7 @@ static int sca3000_read_first_n_hw_rb(struct iio_buffer *r, · 115 unmodified lines
116116 if (ret)
117117 goto error_ret;
118118
119− for (i = 0; i < num_read; i++)
119+ for (i = 0; i < num_read / sizeof(u16); i++)
120120 *(((u16 *)rx) + i) = be16_to_cpup((__be16 *)rx + i);
121121
122122 if (copy_to_user(buf, rx, num_read))
drivers/staging/iio/adc/mxs-lradc.c+5−4
@@ -915,11 +915,12 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev, · 914 unmodified lines
915915 case IIO_CHAN_INFO_OFFSET:
916916 if (chan->type == IIO_TEMP) {
917917 /* The calculated value from the ADC is in Kelvin, we
918− * want Celsius for hwmon so the offset is
919− * -272.15 * scale
918+ * want Celsius for hwmon so the offset is -273.15
919+ * The offset is applied before scaling so it is
920+ * actually -213.15 * 4 / 1.012 = -1079.644268
920921 */
921− *val = -1075;
922− *val2 = 691699;
922+ *val = -1079;
923+ *val2 = 644268;
923924
924925 return IIO_VAL_INT_PLUS_MICRO;
925926 }
drivers/staging/lustre/lustre/llite/dir.c+1−1
@@ -224,7 +224,7 @@ static int ll_dir_filler(void *_hash, struct page *page0) · 223 unmodified lines
224224
225225 prefetchw(&page->flags);
226226 ret = add_to_page_cache_lru(page, inode->i_mapping, offset,
227− GFP_KERNEL);
227+ GFP_NOFS);
228228 if (ret == 0) {
229229 unlock_page(page);
230230 } else {
drivers/thermal/samsung/exynos_tmu.c+1−1
@@ -932,7 +932,7 @@ static void exynos4412_tmu_set_emulation(struct exynos_tmu_data *data, · 931 unmodified lines
932932
933933 if (data->soc == SOC_ARCH_EXYNOS5260)
934934 emul_con = EXYNOS5260_EMUL_CON;
935− if (data->soc == SOC_ARCH_EXYNOS5433)
935+ else if (data->soc == SOC_ARCH_EXYNOS5433)
936936 emul_con = EXYNOS5433_TMU_EMUL_CON;
937937 else if (data->soc == SOC_ARCH_EXYNOS7)
938938 emul_con = EXYNOS7_TMU_REG_EMUL_CON;
drivers/tty/serial/8250/8250_dma.c+0−4
@@ -80,10 +80,6 @@ int serial8250_tx_dma(struct uart_8250_port *p) · 79 unmodified lines
8080 return 0;
8181
8282 dma->tx_size = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);
83− if (dma->tx_size < p->port.fifosize) {
84− ret = -EINVAL;
85− goto err;
86− }
8783
8884 desc = dmaengine_prep_slave_single(dma->txchan,
8985 dma->tx_addr + xmit->tail,
drivers/usb/host/xhci-pci.c+1−0
@@ -147,6 +147,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) · 146 unmodified lines
147147 if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
148148 pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI) {
149149 xhci->quirks |= XHCI_SPURIOUS_REBOOT;
150+ xhci->quirks |= XHCI_SPURIOUS_WAKEUP;
150151 }
151152 if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
152153 (pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI ||
drivers/usb/host/xhci-ring.c+25−5
@@ -2191,6 +2191,10 @@ static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td, · 2190 unmodified lines
21912191 }
21922192 /* Fast path - was this the last TRB in the TD for this URB? */
21932193 } else if (event_trb == td->last_trb) {
2194+ if (td->urb_length_set && trb_comp_code == COMP_SHORT_TX)
2195+ return finish_td(xhci, td, event_trb, event, ep,
2196+ status, false);
2197+
21942198 if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) {
21952199 td->urb->actual_length =
21962200 td->urb->transfer_buffer_length -
@@ -2242,6 +2246,12 @@ static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td, · 45 unmodified lines
22422246 td->urb->actual_length +=
22432247 TRB_LEN(le32_to_cpu(cur_trb->generic.field[2])) -
22442248 EVENT_TRB_LEN(le32_to_cpu(event->transfer_len));
2249+
2250+ if (trb_comp_code == COMP_SHORT_TX) {
2251+ xhci_dbg(xhci, "mid bulk/intr SP, wait for last TRB event\n");
2252+ td->urb_length_set = true;
2253+ return 0;
2254+ }
22452255 }
22462256
22472257 return finish_td(xhci, td, event_trb, event, ep, status, false);
@@ -2274,6 +2284,7 @@ static int handle_tx_event(struct xhci_hcd *xhci, · 26 unmodified lines
22742284 u32 trb_comp_code;
22752285 int ret = 0;
22762286 int td_num = 0;
2287+ bool handling_skipped_tds = false;
22772288
22782289 slot_id = TRB_TO_SLOT_ID(le32_to_cpu(event->flags));
22792290 xdev = xhci->devs[slot_id];
@@ -2410,6 +2421,10 @@ static int handle_tx_event(struct xhci_hcd *xhci, · 130 unmodified lines
24102421 ep->skip = true;
24112422 xhci_dbg(xhci, "Miss service interval error, set skip flag\n");
24122423 goto cleanup;
2424+ case COMP_PING_ERR:
2425+ ep->skip = true;
2426+ xhci_dbg(xhci, "No Ping response error, Skip one Isoc TD\n");
2427+ goto cleanup;
24132428 default:
24142429 if (xhci_is_vendor_info_code(xhci, trb_comp_code)) {
24152430 status = 0;
@@ -2546,13 +2561,18 @@ static int handle_tx_event(struct xhci_hcd *xhci, · 130 unmodified lines
25462561 ep, &status);
25472562
25482563 cleanup:
2564+
2565+
2566+ handling_skipped_tds = ep->skip &&
2567+ trb_comp_code != COMP_MISSED_INT &&
2568+ trb_comp_code != COMP_PING_ERR;
2569+
25492570 /*
2550− * Do not update event ring dequeue pointer if ep->skip is set.
2551− * Will roll back to continue process missed tds.
2571+ * Do not update event ring dequeue pointer if we're in a loop
2572+ * processing missed tds.
25522573 */
2553− if (trb_comp_code == COMP_MISSED_INT || !ep->skip) {
2574+ if (!handling_skipped_tds)
25542575 inc_deq(xhci, xhci->event_ring);
2555− }
25562576
25572577 if (ret) {
25582578 urb = td->urb;
@@ -2587,7 +2607,7 @@ cleanup: · 28 unmodified lines
25872607 * Process them as short transfer until reach the td pointed by
25882608 * the event.
25892609 */
2590− } while (ep->skip && trb_comp_code != COMP_MISSED_INT);
2610+ } while (handling_skipped_tds);
25912611
25922612 return 0;
25932613 }
drivers/video/console/fbcon.c+1−0
@@ -1093,6 +1093,7 @@ static void fbcon_init(struct vc_data *vc, int init) · 1092 unmodified lines
10931093 con_copy_unimap(vc, svc);
10941094
10951095 ops = info->fbcon_par;
1096+ ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);
10961097 p->con_rotate = initial_rotation;
10971098 set_blitting_type(vc, info);
10981099
fs/btrfs/backref.c+3−5
@@ -1828,7 +1828,6 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root, · 1827 unmodified lines
18281828 int found = 0;
18291829 struct extent_buffer *eb;
18301830 struct btrfs_inode_extref *extref;
1831− struct extent_buffer *leaf;
18321831 u32 item_size;
18331832 u32 cur_offset;
18341833 unsigned long ptr;
@@ -1856,9 +1855,8 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root, · 21 unmodified lines
18561855 btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
18571856 btrfs_release_path(path);
18581857
1859− leaf = path->nodes[0];
1860− item_size = btrfs_item_size_nr(leaf, slot);
1861− ptr = btrfs_item_ptr_offset(leaf, slot);
1858+ item_size = btrfs_item_size_nr(eb, slot);
1859+ ptr = btrfs_item_ptr_offset(eb, slot);
18621860 cur_offset = 0;
18631861
18641862 while (cur_offset < item_size) {
@@ -1872,7 +1870,7 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root, · 7 unmodified lines
18721870 if (ret)
18731871 break;
18741872
1875− cur_offset += btrfs_inode_extref_name_len(leaf, extref);
1873+ cur_offset += btrfs_inode_extref_name_len(eb, extref);
18761874 cur_offset += sizeof(*extref);
18771875 }
18781876 btrfs_tree_read_unlock_blocking(eb);
fs/btrfs/file.c+1−1
@@ -2584,7 +2584,7 @@ static long btrfs_fallocate(struct file *file, int mode, · 2583 unmodified lines
25842584 alloc_start);
25852585 if (ret)
25862586 goto out;
2587− } else {
2587+ } else if (offset + len > inode->i_size) {
25882588 /*
25892589 * If we are fallocating from the end of the file onward we
25902590 * need to zero out the end of the page if i_size lands in the
fs/btrfs/ioctl.c+8−0
@@ -4639,6 +4639,11 @@ locked: · 4638 unmodified lines
46394639 bctl->flags |= BTRFS_BALANCE_TYPE_MASK;
46404640 }
46414641
4642+ if (bctl->flags & ~(BTRFS_BALANCE_ARGS_MASK | BTRFS_BALANCE_TYPE_MASK)) {
4643+ ret = -EINVAL;
4644+ goto out_bctl;
4645+ }
4646+
46424647 do_balance:
46434648 /*
46444649 * Ownership of bctl and mutually_exclusive_operation_running
@@ -4650,12 +4655,15 @@ do_balance: · 5 unmodified lines
46504655 need_unlock = false;
46514656
46524657 ret = btrfs_balance(bctl, bargs);
4658+ bctl = NULL;
46534659
46544660 if (arg) {
46554661 if (copy_to_user(arg, bargs, sizeof(*bargs)))
46564662 ret = -EFAULT;
46574663 }
46584664
4665+out_bctl:
4666+ kfree(bctl);
46594667 out_bargs:
46604668 kfree(bargs);
46614669 out_unlock:
fs/btrfs/volumes.h+8−0
@@ -376,6 +376,14 @@ struct map_lookup { · 375 unmodified lines
376376 #define BTRFS_BALANCE_ARGS_VRANGE (1ULL << 4)
377377 #define BTRFS_BALANCE_ARGS_LIMIT (1ULL << 5)
378378
379+#define BTRFS_BALANCE_ARGS_MASK \
380+ (BTRFS_BALANCE_ARGS_PROFILES | \
381+ BTRFS_BALANCE_ARGS_USAGE | \
382+ BTRFS_BALANCE_ARGS_DEVID | \
383+ BTRFS_BALANCE_ARGS_DRANGE | \
384+ BTRFS_BALANCE_ARGS_VRANGE | \
385+ BTRFS_BALANCE_ARGS_LIMIT)
386+
379387 /*
380388 * Profile changing flags. When SOFT is set we won't relocate chunk if
381389 * it already has the target profile (even though it may be
fs/cifs/file.c+3−3
@@ -3380,6 +3380,7 @@ readpages_get_pages(struct address_space *mapping, struct list_head *page_list, · 3379 unmodified lines
33803380 struct page *page, *tpage;
33813381 unsigned int expected_index;
33823382 int rc;
3383+ gfp_t gfp = GFP_KERNEL & mapping_gfp_mask(mapping);
33833384
33843385 INIT_LIST_HEAD(tmplist);
33853386
@@ -3392,7 +3393,7 @@ readpages_get_pages(struct address_space *mapping, struct list_head *page_list, · 6 unmodified lines
33923393 */
33933394 __set_page_locked(page);
33943395 rc = add_to_page_cache_locked(page, mapping,
3395− page->index, GFP_KERNEL);
3396+ page->index, gfp);
33963397
33973398 /* give up if we can't stick it in the cache */
33983399 if (rc) {
@@ -3418,8 +3419,7 @@ readpages_get_pages(struct address_space *mapping, struct list_head *page_list, · 19 unmodified lines
34183419 break;
34193420
34203421 __set_page_locked(page);
3421− if (add_to_page_cache_locked(page, mapping, page->index,
3422− GFP_KERNEL)) {
3422+ if (add_to_page_cache_locked(page, mapping, page->index, gfp)) {
34233423 __clear_page_locked(page);
34243424 break;
34253425 }
fs/dax.c+29−41
@@ -285,6 +285,7 @@ static int copy_user_bh(struct page *to, struct buffer_head *bh, · 284 unmodified lines
285285 static int dax_insert_mapping(struct inode *inode, struct buffer_head *bh,
286286 struct vm_area_struct *vma, struct vm_fault *vmf)
287287 {
288+ struct address_space *mapping = inode->i_mapping;
288289 sector_t sector = bh->b_blocknr << (inode->i_blkbits - 9);
289290 unsigned long vaddr = (unsigned long)vmf->virtual_address;
290291 void __pmem *addr;
@@ -292,6 +293,8 @@ static int dax_insert_mapping(struct inode *inode, struct buffer_head *bh, · 1 unmodified line
292293 pgoff_t size;
293294 int error;
294295
296+ i_mmap_lock_read(mapping);
297+
295298 /*
296299 * Check truncate didn't happen while we were allocating a block.
297300 * If it did, this block may or may not be still allocated to the
@@ -321,6 +324,8 @@ static int dax_insert_mapping(struct inode *inode, struct buffer_head *bh, · 23 unmodified lines
321324 error = vm_insert_mixed(vma, vaddr, pfn);
322325
323326 out:
327+ i_mmap_unlock_read(mapping);
328+
324329 return error;
325330 }
326331
@@ -382,17 +387,15 @@ int __dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf, · 55 unmodified lines
382387 * from a read fault and we've raced with a truncate
383388 */
384389 error = -EIO;
385− goto unlock;
390+ goto unlock_page;
386391 }
387− } else {
388− i_mmap_lock_write(mapping);
389392 }
390393
391394 error = get_block(inode, block, &bh, 0);
392395 if (!error && (bh.b_size < PAGE_SIZE))
393396 error = -EIO; /* fs corruption? */
394397 if (error)
395− goto unlock;
398+ goto unlock_page;
396399
397400 if (!buffer_mapped(&bh) && !buffer_unwritten(&bh) && !vmf->cow_page) {
398401 if (vmf->flags & FAULT_FLAG_WRITE) {
@@ -403,9 +406,8 @@ int __dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf, · 4 unmodified lines
403406 if (!error && (bh.b_size < PAGE_SIZE))
404407 error = -EIO;
405408 if (error)
406− goto unlock;
409+ goto unlock_page;
407410 } else {
408− i_mmap_unlock_write(mapping);
409411 return dax_load_hole(mapping, page, vmf);
410412 }
411413 }
@@ -417,15 +419,17 @@ int __dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf, · 5 unmodified lines
417419 else
418420 clear_user_highpage(new_page, vaddr);
419421 if (error)
420− goto unlock;
422+ goto unlock_page;
421423 vmf->page = page;
422424 if (!page) {
425+ i_mmap_lock_read(mapping);
423426 /* Check we didn't race with truncate */
424427 size = (i_size_read(inode) + PAGE_SIZE - 1) >>
425428 PAGE_SHIFT;
426429 if (vmf->pgoff >= size) {
430+ i_mmap_unlock_read(mapping);
427431 error = -EIO;
428− goto unlock;
432+ goto out;
429433 }
430434 }
431435 return VM_FAULT_LOCKED;
@@ -461,8 +465,6 @@ int __dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf, · 29 unmodified lines
461465 WARN_ON_ONCE(!(vmf->flags & FAULT_FLAG_WRITE));
462466 }
463467
464− if (!page)
465− i_mmap_unlock_write(mapping);
466468 out:
467469 if (error == -ENOMEM)
468470 return VM_FAULT_OOM | major;
@@ -471,14 +473,11 @@ int __dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf, · 2 unmodified lines
471473 return VM_FAULT_SIGBUS | major;
472474 return VM_FAULT_NOPAGE | major;
473475
474− unlock:
476+ unlock_page:
475477 if (page) {
476478 unlock_page(page);
477479 page_cache_release(page);
478− } else {
479− i_mmap_unlock_write(mapping);
480480 }
481−
482481 goto out;
483482 }
484483 EXPORT_SYMBOL(__dax_fault);
@@ -556,10 +555,10 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address, · 71 unmodified lines
556555 block = (sector_t)pgoff << (PAGE_SHIFT - blkbits);
557556
558557 bh.b_size = PMD_SIZE;
559− i_mmap_lock_write(mapping);
560558 length = get_block(inode, block, &bh, write);
561559 if (length)
562560 return VM_FAULT_SIGBUS;
561+ i_mmap_lock_read(mapping);
563562
564563 /*
565564 * If the filesystem isn't willing to tell us the length of a hole,
@@ -569,36 +568,14 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address, · 3 unmodified lines
569568 if (!buffer_size_valid(&bh) || bh.b_size < PMD_SIZE)
570569 goto fallback;
571570
572− sector = bh.b_blocknr << (blkbits - 9);
573−
574− if (buffer_unwritten(&bh) || buffer_new(&bh)) {
575− 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−
586− for (i = 0; i < PTRS_PER_PMD; i++)
587− clear_pmem(kaddr + i * PAGE_SIZE, PAGE_SIZE);
588− wmb_pmem();
589− count_vm_event(PGMAJFAULT);
590− mem_cgroup_count_vm_event(vma->vm_mm, PGMAJFAULT);
591− result |= VM_FAULT_MAJOR;
592− }
593−
594571 /*
595572 * If we allocated new storage, make sure no process has any
596573 * zero pages covering this hole
597574 */
598575 if (buffer_new(&bh)) {
599− i_mmap_unlock_write(mapping);
576+ i_mmap_unlock_read(mapping);
600577 unmap_mapping_range(mapping, pgoff << PAGE_SHIFT, PMD_SIZE, 0);
601− i_mmap_lock_write(mapping);
578+ i_mmap_lock_read(mapping);
602579 }
603580
604581 /*
@@ -635,6 +612,7 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address, · 30 unmodified lines
635612 result = VM_FAULT_NOPAGE;
636613 spin_unlock(ptl);
637614 } else {
615+ sector = bh.b_blocknr << (blkbits - 9);
638616 length = bdev_direct_access(bh.b_bdev, sector, &kaddr, &pfn,
639617 bh.b_size);
640618 if (length < 0) {
@@ -644,15 +622,25 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address, · 3 unmodified lines
644622 if ((length < PMD_SIZE) || (pfn & PG_PMD_COLOUR))
645623 goto fallback;
646624
625+ if (buffer_unwritten(&bh) || buffer_new(&bh)) {
626+ int i;
627+ for (i = 0; i < PTRS_PER_PMD; i++)
628+ clear_pmem(kaddr + i * PAGE_SIZE, PAGE_SIZE);
629+ wmb_pmem();
630+ count_vm_event(PGMAJFAULT);
631+ mem_cgroup_count_vm_event(vma->vm_mm, PGMAJFAULT);
632+ result |= VM_FAULT_MAJOR;
633+ }
634+
647635 result |= vmf_insert_pfn_pmd(vma, address, pmd, pfn, write);
648636 }
649637
650638 out:
639+ i_mmap_unlock_read(mapping);
640+
651641 if (buffer_unwritten(&bh))
652642 complete_unwritten(&bh, !(result & VM_FAULT_ERROR));
653643
654− i_mmap_unlock_write(mapping);
655−
656644 return result;
657645
658646 fallback:
fs/ext4/Kconfig+1−1
@@ -63,7 +63,7 @@ config EXT4_FS · 62 unmodified lines
6363 If unsure, say N.
6464
6565 config EXT4_USE_FOR_EXT2
66− bool "Use ext4 for ext2/ext3 file systems"
66+ bool "Use ext4 for ext2 file systems"
6767 depends on EXT4_FS
6868 depends on EXT2_FS=n
6969 default y
fs/ext4/readpage.c+2−2
@@ -165,8 +165,8 @@ int ext4_mpage_readpages(struct address_space *mapping, · 164 unmodified lines
165165 if (pages) {
166166 page = list_entry(pages->prev, struct page, lru);
167167 list_del(&page->lru);
168− if (add_to_page_cache_lru(page, mapping,
169− page->index, GFP_KERNEL))
168+ if (add_to_page_cache_lru(page, mapping, page->index,
169+ GFP_KERNEL & mapping_gfp_mask(mapping)))
170170 goto next_page;
171171 }
172172
fs/fs-writeback.c+24−11
@@ -778,19 +778,24 @@ static void bdi_split_work_to_wbs(struct backing_dev_info *bdi, · 777 unmodified lines
778778 struct wb_writeback_work *base_work,
779779 bool skip_if_busy)
780780 {
781− int next_memcg_id = 0;
782− struct bdi_writeback *wb;
783− struct wb_iter iter;
781+ struct bdi_writeback *last_wb = NULL;
782+ struct bdi_writeback *wb = list_entry_rcu(&bdi->wb_list,
783+ struct bdi_writeback, bdi_node);
784784
785785 might_sleep();
786786 restart:
787787 rcu_read_lock();
788− bdi_for_each_wb(wb, bdi, &iter, next_memcg_id) {
788+ list_for_each_entry_continue_rcu(wb, &bdi->wb_list, bdi_node) {
789789 DEFINE_WB_COMPLETION_ONSTACK(fallback_work_done);
790790 struct wb_writeback_work fallback_work;
791791 struct wb_writeback_work *work;
792792 long nr_pages;
793793
794+ if (last_wb) {
795+ wb_put(last_wb);
796+ last_wb = NULL;
797+ }
798+
794799 /* SYNC_ALL writes out I_DIRTY_TIME too */
795800 if (!wb_has_dirty_io(wb) &&
796801 (base_work->sync_mode == WB_SYNC_NONE ||
@@ -819,12 +824,22 @@ restart: · 22 unmodified lines
819824
820825 wb_queue_work(wb, work);
821826
822− next_memcg_id = wb->memcg_css->id + 1;
827+ /*
828+ * Pin @wb so that it stays on @bdi->wb_list. This allows
829+ * continuing iteration from @wb after dropping and
830+ * regrabbing rcu read lock.
831+ */
832+ wb_get(wb);
833+ last_wb = wb;
834+
823835 rcu_read_unlock();
824836 wb_wait_for_completion(bdi, &fallback_work_done);
825837 goto restart;
826838 }
827839 rcu_read_unlock();
840+
841+ if (last_wb)
842+ wb_put(last_wb);
828843 }
829844
830845 #else /* CONFIG_CGROUP_WRITEBACK */
@@ -1857,12 +1872,11 @@ void wakeup_flusher_threads(long nr_pages, enum wb_reason reason) · 1026 unmodified lines
18571872 rcu_read_lock();
18581873 list_for_each_entry_rcu(bdi, &bdi_list, bdi_list) {
18591874 struct bdi_writeback *wb;
1860− struct wb_iter iter;
18611875
18621876 if (!bdi_has_dirty_io(bdi))
18631877 continue;
18641878
1865− bdi_for_each_wb(wb, bdi, &iter, 0)
1879+ list_for_each_entry_rcu(wb, &bdi->wb_list, bdi_node)
18661880 wb_start_writeback(wb, wb_split_bdi_pages(wb, nr_pages),
18671881 false, reason);
18681882 }
@@ -1894,11 +1908,10 @@ static void wakeup_dirtytime_writeback(struct work_struct *w) · 25 unmodified lines
18941908 rcu_read_lock();
18951909 list_for_each_entry_rcu(bdi, &bdi_list, bdi_list) {
18961910 struct bdi_writeback *wb;
1897− struct wb_iter iter;
18981911
1899− bdi_for_each_wb(wb, bdi, &iter, 0)
1900− if (!list_empty(&bdi->wb.b_dirty_time))
1901− wb_wakeup(&bdi->wb);
1912+ list_for_each_entry_rcu(wb, &bdi->wb_list, bdi_node)
1913+ if (!list_empty(&wb->b_dirty_time))
1914+ wb_wakeup(wb);
19021915 }
19031916 rcu_read_unlock();
19041917 schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);
fs/mpage.c+9−6
@@ -139,7 +139,8 @@ map_buffer_to_page(struct page *page, struct buffer_head *bh, int page_block) · 138 unmodified lines
139139 static struct bio *
140140 do_mpage_readpage(struct bio *bio, struct page *page, unsigned nr_pages,
141141 sector_t *last_block_in_bio, struct buffer_head *map_bh,
142− unsigned long *first_logical_block, get_block_t get_block)
142+ unsigned long *first_logical_block, get_block_t get_block,
143+ gfp_t gfp)
143144 {
144145 struct inode *inode = page->mapping->host;
145146 const unsigned blkbits = inode->i_blkbits;
@@ -277,8 +278,7 @@ alloc_new: · 131 unmodified lines
277278 goto out;
278279 }
279280 bio = mpage_alloc(bdev, blocks[0] << (blkbits - 9),
280− min_t(int, nr_pages, BIO_MAX_PAGES),
281− GFP_KERNEL);
281+ min_t(int, nr_pages, BIO_MAX_PAGES), gfp);
282282 if (bio == NULL)
283283 goto confused;
284284 }
@@ -361,6 +361,7 @@ mpage_readpages(struct address_space *mapping, struct list_head *pages, · 76 unmodified lines
361361 sector_t last_block_in_bio = 0;
362362 struct buffer_head map_bh;
363363 unsigned long first_logical_block = 0;
364+ gfp_t gfp = GFP_KERNEL & mapping_gfp_mask(mapping);
364365
365366 map_bh.b_state = 0;
366367 map_bh.b_size = 0;
@@ -370,12 +371,13 @@ mpage_readpages(struct address_space *mapping, struct list_head *pages, · 3 unmodified lines
370371 prefetchw(&page->flags);
371372 list_del(&page->lru);
372373 if (!add_to_page_cache_lru(page, mapping,
373− page->index, GFP_KERNEL)) {
374+ page->index,
375+ gfp)) {
374376 bio = do_mpage_readpage(bio, page,
375377 nr_pages - page_idx,
376378 &last_block_in_bio, &map_bh,
377379 &first_logical_block,
378− get_block);
380+ get_block, gfp);
379381 }
380382 page_cache_release(page);
381383 }
@@ -395,11 +397,12 @@ int mpage_readpage(struct page *page, get_block_t get_block) · 13 unmodified lines
395397 sector_t last_block_in_bio = 0;
396398 struct buffer_head map_bh;
397399 unsigned long first_logical_block = 0;
400+ gfp_t gfp = GFP_KERNEL & mapping_gfp_mask(page->mapping);
398401
399402 map_bh.b_state = 0;
400403 map_bh.b_size = 0;
401404 bio = do_mpage_readpage(bio, page, 1, &last_block_in_bio,
402− &map_bh, &first_logical_block, get_block);
405+ &map_bh, &first_logical_block, get_block, gfp);
403406 if (bio)
404407 mpage_bio_submit(READ, bio);
405408 return 0;
fs/nfsd/blocklayout.c+0−8
@@ -56,14 +56,6 @@ nfsd4_block_proc_layoutget(struct inode *inode, const struct svc_fh *fhp, · 55 unmodified lines
5656 u32 device_generation = 0;
5757 int error;
5858
59− /*
60− * We do not attempt to support I/O smaller than the fs block size,
61− * or not aligned to it.
62− */
63− if (args->lg_minlength < block_size) {
64− dprintk("pnfsd: I/O too small\n");
65− goto out_layoutunavailable;
66− }
6759 if (seg->offset & (block_size - 1)) {
6860 dprintk("pnfsd: I/O misaligned\n");
6961 goto out_layoutunavailable;
fs/ocfs2/dlm/dlmmaster.c+2−1
@@ -1658,12 +1658,13 @@ send_response: · 1657 unmodified lines
16581658 if (ret < 0) {
16591659 mlog(ML_ERROR, "failed to dispatch assert master work\n");
16601660 response = DLM_MASTER_RESP_ERROR;
1661+ spin_unlock(&res->spinlock);
16611662 dlm_lockres_put(res);
16621663 } else {
16631664 dispatched = 1;
16641665 __dlm_lockres_grab_inflight_worker(dlm, res);
1666+ spin_unlock(&res->spinlock);
16651667 }
1666− spin_unlock(&res->spinlock);
16671668 } else {
16681669 if (res)
16691670 dlm_lockres_put(res);
fs/ocfs2/dlm/dlmrecovery.c+1−1
@@ -1723,8 +1723,8 @@ int dlm_master_requery_handler(struct o2net_msg *msg, u32 len, void *data, · 1722 unmodified lines
17231723 } else {
17241724 dispatched = 1;
17251725 __dlm_lockres_grab_inflight_worker(dlm, res);
1726+ spin_unlock(&res->spinlock);
17261727 }
1727− spin_unlock(&res->spinlock);
17281728 } else {
17291729 /* put.. incase we are not the master */
17301730 spin_unlock(&res->spinlock);
fs/ramfs/file-nommu.c+3−2
@@ -70,6 +70,7 @@ int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) · 69 unmodified lines
7070 unsigned order;
7171 void *data;
7272 int ret;
73+ gfp_t gfp = mapping_gfp_mask(inode->i_mapping);
7374
7475 /* make various checks */
7576 order = get_order(newsize);
@@ -84,7 +85,7 @@ int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) · 8 unmodified lines
8485
8586 /* allocate enough contiguous pages to be able to satisfy the
8687 * request */
87− pages = alloc_pages(mapping_gfp_mask(inode->i_mapping), order);
88+ pages = alloc_pages(gfp, order);
8889 if (!pages)
8990 return -ENOMEM;
9091
@@ -108,7 +109,7 @@ int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) · 17 unmodified lines
108109 struct page *page = pages + loop;
109110
110111 ret = add_to_page_cache_lru(page, inode->i_mapping, loop,
111− GFP_KERNEL);
112+ gfp);
112113 if (ret < 0)
113114 goto add_error;
114115
include/drm/drm_dp_mst_helper.h+2−1
@@ -253,6 +253,7 @@ struct drm_dp_remote_dpcd_write { · 252 unmodified lines
253253 u8 *bytes;
254254 };
255255
256+#define DP_REMOTE_I2C_READ_MAX_TRANSACTIONS 4
256257 struct drm_dp_remote_i2c_read {
257258 u8 num_transactions;
258259 u8 port_number;
@@ -262,7 +263,7 @@ struct drm_dp_remote_i2c_read { · 3 unmodified lines
262263 u8 *bytes;
263264 u8 no_stop_bit;
264265 u8 i2c_transaction_delay;
265− } transactions[4];
266+ } transactions[DP_REMOTE_I2C_READ_MAX_TRANSACTIONS];
266267 u8 read_i2c_device_id;
267268 u8 num_bytes_read;
268269 };
include/linux/backing-dev-defs.h+3−0
@@ -116,6 +116,8 @@ struct bdi_writeback { · 115 unmodified lines
116116 struct list_head work_list;
117117 struct delayed_work dwork; /* work item used for writeback */
118118
119+ struct list_head bdi_node; /* anchored at bdi->wb_list */
120+
119121 #ifdef CONFIG_CGROUP_WRITEBACK
120122 struct percpu_ref refcnt; /* used only for !root wb's */
121123 struct fprop_local_percpu memcg_completions;
@@ -150,6 +152,7 @@ struct backing_dev_info { · 28 unmodified lines
150152 atomic_long_t tot_write_bandwidth;
151153
152154 struct bdi_writeback wb; /* the root writeback info for this bdi */
155+ struct list_head wb_list; /* list of all wbs */
153156 #ifdef CONFIG_CGROUP_WRITEBACK
154157 struct radix_tree_root cgwb_tree; /* radix tree of active cgroup wbs */
155158 struct rb_root cgwb_congested_tree; /* their congested states */
include/linux/backing-dev.h+5−64
@@ -19,13 +19,17 @@ · 18 unmodified lines
1919 #include <linux/slab.h>
2020
2121 int __must_check bdi_init(struct backing_dev_info *bdi);
22−void bdi_destroy(struct backing_dev_info *bdi);
22+void bdi_exit(struct backing_dev_info *bdi);
2323
2424 __printf(3, 4)
2525 int bdi_register(struct backing_dev_info *bdi, struct device *parent,
2626 const char *fmt, ...);
2727 int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);
28+void bdi_unregister(struct backing_dev_info *bdi);
29+
2830 int __must_check bdi_setup_and_register(struct backing_dev_info *, char *);
31+void bdi_destroy(struct backing_dev_info *bdi);
32+
2933 void wb_start_writeback(struct bdi_writeback *wb, long nr_pages,
3034 bool range_cyclic, enum wb_reason reason);
3135 void wb_start_background_writeback(struct bdi_writeback *wb);
@@ -408,61 +412,6 @@ static inline void unlocked_inode_to_wb_end(struct inode *inode, bool locked) · 376 unmodified lines
408412 rcu_read_unlock();
409413 }
410414
411−struct wb_iter {
412− int start_memcg_id;
413− struct radix_tree_iter tree_iter;
414− void **slot;
415−};
416−
417−static inline struct bdi_writeback *__wb_iter_next(struct wb_iter *iter,
418− struct backing_dev_info *bdi)
419−{
420− struct radix_tree_iter *titer = &iter->tree_iter;
421−
422− WARN_ON_ONCE(!rcu_read_lock_held());
423−
424− if (iter->start_memcg_id >= 0) {
425− iter->slot = radix_tree_iter_init(titer, iter->start_memcg_id);
426− iter->start_memcg_id = -1;
427− } else {
428− iter->slot = radix_tree_next_slot(iter->slot, titer, 0);
429− }
430−
431− if (!iter->slot)
432− iter->slot = radix_tree_next_chunk(&bdi->cgwb_tree, titer, 0);
433− if (iter->slot)
434− return *iter->slot;
435− return NULL;
436−}
437−
438−static inline struct bdi_writeback *__wb_iter_init(struct wb_iter *iter,
439− struct backing_dev_info *bdi,
440− int start_memcg_id)
441−{
442− iter->start_memcg_id = start_memcg_id;
443−
444− if (start_memcg_id)
445− return __wb_iter_next(iter, bdi);
446− else
447− return &bdi->wb;
448−}
449−
450−/**
451− * bdi_for_each_wb - walk all wb's of a bdi in ascending memcg ID order
452− * @wb_cur: cursor struct bdi_writeback pointer
453− * @bdi: bdi to walk wb's of
454− * @iter: pointer to struct wb_iter to be used as iteration buffer
455− * @start_memcg_id: memcg ID to start iteration from
456− *
457− * Iterate @wb_cur through the wb's (bdi_writeback's) of @bdi in ascending
458− * memcg ID order starting from @start_memcg_id. @iter is struct wb_iter
459− * to be used as temp storage during iteration. rcu_read_lock() must be
460− * held throughout iteration.
461− */
462−#define bdi_for_each_wb(wb_cur, bdi, iter, start_memcg_id) \
463− for ((wb_cur) = __wb_iter_init(iter, bdi, start_memcg_id); \
464− (wb_cur); (wb_cur) = __wb_iter_next(iter, bdi))
465−
466415 #else /* CONFIG_CGROUP_WRITEBACK */
467416
468417 static inline bool inode_cgwb_enabled(struct inode *inode)
@@ -522,14 +471,6 @@ static inline void wb_blkcg_offline(struct blkcg *blkcg) · 53 unmodified lines
522471 {
523472 }
524473
525−struct wb_iter {
526− int next_id;
527−};
528−
529−#define bdi_for_each_wb(wb_cur, bdi, iter, start_blkcg_id) \
530− for ((iter)->next_id = (start_blkcg_id); \
531− ({ (wb_cur) = !(iter)->next_id++ ? &(bdi)->wb : NULL; }); )
532−
533474 static inline int inode_congested(struct inode *inode, int cong_bits)
534475 {
535476 return wb_congested(&inode_to_bdi(inode)->wb, cong_bits);
include/linux/cma.h+1−1
@@ -26,6 +26,6 @@ extern int __init cma_declare_contiguous(phys_addr_t base, · 25 unmodified lines
2626 extern int cma_init_reserved_mem(phys_addr_t base, phys_addr_t size,
2727 unsigned int order_per_bit,
2828 struct cma **res_cma);
29−extern struct page *cma_alloc(struct cma *cma, unsigned int count, unsigned int align);
29+extern struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align);
3030 extern bool cma_release(struct cma *cma, const struct page *pages, unsigned int count);
3131 #endif
include/linux/compiler-gcc.h+13−0
@@ -237,12 +237,25 @@ · 236 unmodified lines
237237 #define KASAN_ABI_VERSION 3
238238 #endif
239239
240+#if GCC_VERSION >= 40902
241+/*
242+ * Tell the compiler that address safety instrumentation (KASAN)
243+ * should not be applied to that function.
244+ * Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
245+ */
246+#define __no_sanitize_address __attribute__((no_sanitize_address))
247+#endif
248+
240249 #endif /* gcc version >= 40000 specific checks */
241250
242251 #if !defined(__noclone)
243252 #define __noclone /* not needed */
244253 #endif
245254
255+#if !defined(__no_sanitize_address)
256+#define __no_sanitize_address
257+#endif
258+
246259 /*
247260 * A trick to suppress uninitialized variable warning without generating any
248261 * code
include/linux/compiler.h+53−13
@@ -198,19 +198,45 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); · 197 unmodified lines
198198
199199 #include <uapi/linux/types.h>
200200
201−static __always_inline void __read_once_size(const volatile void *p, void *res, int size)
201+#define __READ_ONCE_SIZE \
202+({ \
203+ switch (size) { \
204+ case 1: *(__u8 *)res = *(volatile __u8 *)p; break; \
205+ case 2: *(__u16 *)res = *(volatile __u16 *)p; break; \
206+ case 4: *(__u32 *)res = *(volatile __u32 *)p; break; \
207+ case 8: *(__u64 *)res = *(volatile __u64 *)p; break; \
208+ default: \
209+ barrier(); \
210+ __builtin_memcpy((void *)res, (const void *)p, size); \
211+ barrier(); \
212+ } \
213+})
214+
215+static __always_inline
216+void __read_once_size(const volatile void *p, void *res, int size)
202217 {
203− switch (size) {
204− case 1: *(__u8 *)res = *(volatile __u8 *)p; break;
205− case 2: *(__u16 *)res = *(volatile __u16 *)p; break;
206− case 4: *(__u32 *)res = *(volatile __u32 *)p; break;
207− case 8: *(__u64 *)res = *(volatile __u64 *)p; break;
208− default:
209− barrier();
210− __builtin_memcpy((void *)res, (const void *)p, size);
211− barrier();
212− }
218+ __READ_ONCE_SIZE;
219+}
220+
221+#ifdef CONFIG_KASAN
222+/*
223+ * This function is not 'inline' because __no_sanitize_address confilcts
224+ * with inlining. Attempt to inline it may cause a build failure.
225+ * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
226+ * '__maybe_unused' allows us to avoid defined-but-not-used warnings.
227+ */
228+static __no_sanitize_address __maybe_unused
229+void __read_once_size_nocheck(const volatile void *p, void *res, int size)
230+{
231+ __READ_ONCE_SIZE;
232+}
233+#else
234+static __always_inline
235+void __read_once_size_nocheck(const volatile void *p, void *res, int size)
236+{
237+ __READ_ONCE_SIZE;
213238 }
239+#endif
214240
215241 static __always_inline void __write_once_size(volatile void *p, void *res, int size)
216242 {
@@ -248,8 +274,22 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s · 31 unmodified lines
248274 * required ordering.
249275 */
250276
251−#define READ_ONCE(x) \
252− ({ union { typeof(x) __val; char __c[1]; } __u; __read_once_size(&(x), __u.__c, sizeof(x)); __u.__val; })
277+#define __READ_ONCE(x, check) \
278+({ \
279+ union { typeof(x) __val; char __c[1]; } __u; \
280+ if (check) \
281+ __read_once_size(&(x), __u.__c, sizeof(x)); \
282+ else \
283+ __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
284+ __u.__val; \
285+})
286+#define READ_ONCE(x) __READ_ONCE(x, 1)
287+
288+/*
289+ * Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need
290+ * to hide memory access from KASAN.
291+ */
292+#define READ_ONCE_NOCHECK(x) __READ_ONCE(x, 0)
253293
254294 #define WRITE_ONCE(x, val) \
255295 ({ \
include/linux/dma-contiguous.h+2−2
@@ -111,7 +111,7 @@ static inline int dma_declare_contiguous(struct device *dev, phys_addr_t size, · 110 unmodified lines
111111 return ret;
112112 }
113113
114−struct page *dma_alloc_from_contiguous(struct device *dev, int count,
114+struct page *dma_alloc_from_contiguous(struct device *dev, size_t count,
115115 unsigned int order);
116116 bool dma_release_from_contiguous(struct device *dev, struct page *pages,
117117 int count);
@@ -144,7 +144,7 @@ int dma_declare_contiguous(struct device *dev, phys_addr_t size, · 26 unmodified lines
144144 }
145145
146146 static inline
147−struct page *dma_alloc_from_contiguous(struct device *dev, int count,
147+struct page *dma_alloc_from_contiguous(struct device *dev, size_t count,
148148 unsigned int order)
149149 {
150150 return NULL;
include/linux/memcontrol.h+5−3
@@ -676,8 +676,9 @@ enum { · 675 unmodified lines
676676
677677 struct list_head *mem_cgroup_cgwb_list(struct mem_cgroup *memcg);
678678 struct wb_domain *mem_cgroup_wb_domain(struct bdi_writeback *wb);
679−void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pavail,
680− unsigned long *pdirty, unsigned long *pwriteback);
679+void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pfilepages,
680+ unsigned long *pheadroom, unsigned long *pdirty,
681+ unsigned long *pwriteback);
681682
682683 #else /* CONFIG_CGROUP_WRITEBACK */
683684
@@ -687,7 +688,8 @@ static inline struct wb_domain *mem_cgroup_wb_domain(struct bdi_writeback *wb) · 3 unmodified lines
687688 }
688689
689690 static inline void mem_cgroup_wb_stats(struct bdi_writeback *wb,
690− unsigned long *pavail,
691+ unsigned long *pfilepages,
692+ unsigned long *pheadroom,
691693 unsigned long *pdirty,
692694 unsigned long *pwriteback)
693695 {
include/net/af_unix.h+1−1
@@ -64,7 +64,7 @@ struct unix_sock { · 63 unmodified lines
6464 struct socket_wq peer_wq;
6565 };
6666
67−static inline struct unix_sock *unix_sk(struct sock *sk)
67+static inline struct unix_sock *unix_sk(const struct sock *sk)
6868 {
6969 return (struct unix_sock *)sk;
7070 }
include/net/inet_timewait_sock.h+2−2
@@ -113,12 +113,12 @@ void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk, · 112 unmodified lines
113113 void __inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo,
114114 bool rearm);
115115
116−static void inline inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo)
116+static inline void inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo)
117117 {
118118 __inet_twsk_schedule(tw, timeo, false);
119119 }
120120
121−static void inline inet_twsk_reschedule(struct inet_timewait_sock *tw, int timeo)
121+static inline void inet_twsk_reschedule(struct inet_timewait_sock *tw, int timeo)
122122 {
123123 __inet_twsk_schedule(tw, timeo, true);
124124 }
include/net/sock.h+8−0
@@ -828,6 +828,14 @@ static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *s · 827 unmodified lines
828828 if (sk_rcvqueues_full(sk, limit))
829829 return -ENOBUFS;
830830
831+ /*
832+ * If the skb was allocated from pfmemalloc reserves, only
833+ * allow SOCK_MEMALLOC sockets to use it as this socket is
834+ * helping free memory
835+ */
836+ if (skb_pfmemalloc(skb) && !sock_flag(sk, SOCK_MEMALLOC))
837+ return -ENOMEM;
838+
831839 __sk_add_backlog(sk, skb);
832840 sk->sk_backlog.len += skb->truesize;
833841 return 0;
include/sound/soc.h+4−2
@@ -86,7 +86,7 @@ · 85 unmodified lines
8686 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
8787 SNDRV_CTL_ELEM_ACCESS_READWRITE, \
8888 .tlv.p = (tlv_array),\
89− .info = snd_soc_info_volsw, \
89+ .info = snd_soc_info_volsw_sx, \
9090 .get = snd_soc_get_volsw_sx,\
9191 .put = snd_soc_put_volsw_sx, \
9292 .private_value = (unsigned long)&(struct soc_mixer_control) \
@@ -156,7 +156,7 @@ · 63 unmodified lines
156156 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
157157 SNDRV_CTL_ELEM_ACCESS_READWRITE, \
158158 .tlv.p = (tlv_array), \
159− .info = snd_soc_info_volsw, \
159+ .info = snd_soc_info_volsw_sx, \
160160 .get = snd_soc_get_volsw_sx, \
161161 .put = snd_soc_put_volsw_sx, \
162162 .private_value = (unsigned long)&(struct soc_mixer_control) \
@@ -574,6 +574,8 @@ int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol, · 411 unmodified lines
574574 struct snd_ctl_elem_value *ucontrol);
575575 int snd_soc_info_volsw(struct snd_kcontrol *kcontrol,
576576 struct snd_ctl_elem_info *uinfo);
577+int snd_soc_info_volsw_sx(struct snd_kcontrol *kcontrol,
578+ struct snd_ctl_elem_info *uinfo);
577579 #define snd_soc_info_bool_ext snd_ctl_boolean_mono_info
578580 int snd_soc_get_volsw(struct snd_kcontrol *kcontrol,
579581 struct snd_ctl_elem_value *ucontrol);
include/sound/wm8904.h+1−1
@@ -119,7 +119,7 @@ · 118 unmodified lines
119119 #define WM8904_MIC_REGS 2
120120 #define WM8904_GPIO_REGS 4
121121 #define WM8904_DRC_REGS 4
122−#define WM8904_EQ_REGS 25
122+#define WM8904_EQ_REGS 24
123123
124124 /**
125125 * DRC configurations are specified with a label and a set of register
include/uapi/asm-generic/signal.h+2−0
@@ -80,8 +80,10 @@ · 79 unmodified lines
8080 * SA_RESTORER 0x04000000
8181 */
8282
83+#if !defined MINSIGSTKSZ || !defined SIGSTKSZ
8384 #define MINSIGSTKSZ 2048
8485 #define SIGSTKSZ 8192
86+#endif
8587
8688 #ifndef __ASSEMBLY__
8789 typedef struct {
include/uapi/linux/openvswitch.h+15−21
@@ -323,10 +323,10 @@ enum ovs_key_attr { · 322 unmodified lines
323323 OVS_KEY_ATTR_MPLS, /* array of struct ovs_key_mpls.
324324 * The implementation may restrict
325325 * the accepted length of the array. */
326− OVS_KEY_ATTR_CT_STATE, /* u8 bitmask of OVS_CS_F_* */
326+ OVS_KEY_ATTR_CT_STATE, /* u32 bitmask of OVS_CS_F_* */
327327 OVS_KEY_ATTR_CT_ZONE, /* u16 connection tracking zone. */
328328 OVS_KEY_ATTR_CT_MARK, /* u32 connection tracking mark */
329− OVS_KEY_ATTR_CT_LABEL, /* 16-octet connection tracking label */
329+ OVS_KEY_ATTR_CT_LABELS, /* 16-octet connection tracking label */
330330
331331 #ifdef __KERNEL__
332332 OVS_KEY_ATTR_TUNNEL_INFO, /* struct ip_tunnel_info */
@@ -439,9 +439,9 @@ struct ovs_key_nd { · 106 unmodified lines
439439 __u8 nd_tll[ETH_ALEN];
440440 };
441441
442−#define OVS_CT_LABEL_LEN 16
443−struct ovs_key_ct_label {
444− __u8 ct_label[OVS_CT_LABEL_LEN];
442+#define OVS_CT_LABELS_LEN 16
443+struct ovs_key_ct_labels {
444+ __u8 ct_labels[OVS_CT_LABELS_LEN];
445445 };
446446
447447 /* OVS_KEY_ATTR_CT_STATE flags */
@@ -449,9 +449,9 @@ struct ovs_key_ct_label { · 1 unmodified line
449449 #define OVS_CS_F_ESTABLISHED 0x02 /* Part of an existing connection. */
450450 #define OVS_CS_F_RELATED 0x04 /* Related to an established
451451 * connection. */
452−#define OVS_CS_F_INVALID 0x20 /* Could not track connection. */
453−#define OVS_CS_F_REPLY_DIR 0x40 /* Flow is in the reply direction. */
454−#define OVS_CS_F_TRACKED 0x80 /* Conntrack has occurred. */
452+#define OVS_CS_F_REPLY_DIR 0x08 /* Flow is in the reply direction. */
453+#define OVS_CS_F_INVALID 0x10 /* Could not track connection. */
454+#define OVS_CS_F_TRACKED 0x20 /* Conntrack has occurred. */
455455
456456 /**
457457 * enum ovs_flow_attr - attributes for %OVS_FLOW_* commands.
@@ -618,22 +618,24 @@ struct ovs_action_hash { · 160 unmodified lines
618618
619619 /**
620620 * enum ovs_ct_attr - Attributes for %OVS_ACTION_ATTR_CT action.
621− * @OVS_CT_ATTR_FLAGS: u32 connection tracking flags.
621+ * @OVS_CT_ATTR_COMMIT: If present, commits the connection to the conntrack
622+ * table. This allows future packets for the same connection to be identified
623+ * as 'established' or 'related'.
622624 * @OVS_CT_ATTR_ZONE: u16 connection tracking zone.
623625 * @OVS_CT_ATTR_MARK: u32 value followed by u32 mask. For each bit set in the
624626 * mask, the corresponding bit in the value is copied to the connection
625627 * tracking mark field in the connection.
626− * @OVS_CT_ATTR_LABEL: %OVS_CT_LABEL_LEN value followed by %OVS_CT_LABEL_LEN
628+ * @OVS_CT_ATTR_LABEL: %OVS_CT_LABELS_LEN value followed by %OVS_CT_LABELS_LEN
627629 * mask. For each bit set in the mask, the corresponding bit in the value is
628630 * copied to the connection tracking label field in the connection.
629631 * @OVS_CT_ATTR_HELPER: variable length string defining conntrack ALG.
630632 */
631633 enum ovs_ct_attr {
632634 OVS_CT_ATTR_UNSPEC,
633− OVS_CT_ATTR_FLAGS, /* u8 bitmask of OVS_CT_F_*. */
635+ OVS_CT_ATTR_COMMIT, /* No argument, commits connection. */
634636 OVS_CT_ATTR_ZONE, /* u16 zone id. */
635637 OVS_CT_ATTR_MARK, /* mark to associate with this connection. */
636− OVS_CT_ATTR_LABEL, /* label to associate with this connection. */
638+ OVS_CT_ATTR_LABELS, /* labels to associate with this connection. */
637639 OVS_CT_ATTR_HELPER, /* netlink helper to assist detection of
638640 related connections. */
639641 __OVS_CT_ATTR_MAX
@@ -641,14 +643,6 @@ enum ovs_ct_attr { · 1 unmodified line
641643
642644 #define OVS_CT_ATTR_MAX (__OVS_CT_ATTR_MAX - 1)
643645
644−/*
645− * OVS_CT_ATTR_FLAGS flags - bitmask of %OVS_CT_F_*
646− * @OVS_CT_F_COMMIT: Commits the flow to the conntrack table. This allows
647− * future packets for the same connection to be identified as 'established'
648− * or 'related'.
649− */
650−#define OVS_CT_F_COMMIT 0x01
651−
652646 /**
653647 * enum ovs_action_attr - Action types.
654648 *
@@ -705,7 +699,7 @@ enum ovs_action_attr { · 50 unmodified lines
705699 * data immediately followed by a mask.
706700 * The data must be zero for the unmasked
707701 * bits. */
708− OVS_ACTION_ATTR_CT, /* One nested OVS_CT_ATTR_* . */
702+ OVS_ACTION_ATTR_CT, /* Nested OVS_CT_ATTR_* . */
709703
710704 __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted
711705 * from userspace. */
include/uapi/linux/rtnetlink.h+1−1
@@ -160,7 +160,7 @@ struct rtattr { · 159 unmodified lines
160160
161161 /* Macros to handle rtattributes */
162162
163−#define RTA_ALIGNTO 4
163+#define RTA_ALIGNTO 4U
164164 #define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) )
165165 #define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \
166166 (rta)->rta_len >= sizeof(struct rtattr) && \
kernel/irq/msi.c+1−5
@@ -228,11 +228,7 @@ static void msi_domain_update_chip_ops(struct msi_domain_info *info) · 227 unmodified lines
228228 {
229229 struct irq_chip *chip = info->chip;
230230
231− BUG_ON(!chip);
232− if (!chip->irq_mask)
233− chip->irq_mask = pci_msi_mask_irq;
234− if (!chip->irq_unmask)
235− chip->irq_unmask = pci_msi_unmask_irq;
231+ BUG_ON(!chip || !chip->irq_mask || !chip->irq_unmask);
236232 if (!chip->irq_set_affinity)
237233 chip->irq_set_affinity = msi_domain_set_affinity;
238234 }
kernel/kmod.c+6−2
@@ -327,9 +327,13 @@ static void call_usermodehelper_exec_work(struct work_struct *work) · 326 unmodified lines
327327 call_usermodehelper_exec_sync(sub_info);
328328 } else {
329329 pid_t pid;
330−
330+ /*
331+ * Use CLONE_PARENT to reparent it to kthreadd; we do not
332+ * want to pollute current->children, and we need a parent
333+ * that always ignores SIGCHLD to ensure auto-reaping.
334+ */
331335 pid = kernel_thread(call_usermodehelper_exec_async, sub_info,
332− SIGCHLD);
336+ CLONE_PARENT | SIGCHLD);
333337 if (pid < 0) {
334338 sub_info->retval = pid;
335339 umh_complete(sub_info);
kernel/sched/core.c+8−4
@@ -2366,8 +2366,15 @@ void wake_up_new_task(struct task_struct *p) · 2365 unmodified lines
23662366 trace_sched_wakeup_new(p);
23672367 check_preempt_curr(rq, p, WF_FORK);
23682368 #ifdef CONFIG_SMP
2369− if (p->sched_class->task_woken)
2369+ if (p->sched_class->task_woken) {
2370+ /*
2371+ * Nothing relies on rq->lock after this, so its fine to
2372+ * drop it.
2373+ */
2374+ lockdep_unpin_lock(&rq->lock);
23702375 p->sched_class->task_woken(rq, p);
2376+ lockdep_pin_lock(&rq->lock);
2377+ }
23712378 #endif
23722379 task_rq_unlock(rq, p, &flags);
23732380 }
@@ -7238,9 +7245,6 @@ void __init sched_init_smp(void) · 4864 unmodified lines
72387245 alloc_cpumask_var(&non_isolated_cpus, GFP_KERNEL);
72397246 alloc_cpumask_var(&fallback_doms, GFP_KERNEL);
72407247
7241− /* nohz_full won't take effect without isolating the cpus. */
7242− tick_nohz_full_add_cpus_to(cpu_isolated_map);
7243−
72447248 sched_init_numa();
72457249
72467250 /*
kernel/sched/deadline.c+13−4
@@ -668,8 +668,15 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer) · 667 unmodified lines
668668 * Queueing this task back might have overloaded rq, check if we need
669669 * to kick someone away.
670670 */
671− if (has_pushable_dl_tasks(rq))
671+ if (has_pushable_dl_tasks(rq)) {
672+ /*
673+ * Nothing relies on rq->lock after this, so its safe to drop
674+ * rq->lock.
675+ */
676+ lockdep_unpin_lock(&rq->lock);
672677 push_dl_task(rq);
678+ lockdep_pin_lock(&rq->lock);
679+ }
673680 #endif
674681
675682 unlock:
@@ -1066,8 +1073,9 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags) · 390 unmodified lines
10661073 int target = find_later_rq(p);
10671074
10681075 if (target != -1 &&
1069− dl_time_before(p->dl.deadline,
1070− cpu_rq(target)->dl.earliest_dl.curr))
1076+ (dl_time_before(p->dl.deadline,
1077+ cpu_rq(target)->dl.earliest_dl.curr) ||
1078+ (cpu_rq(target)->dl.dl_nr_running == 0)))
10711079 cpu = target;
10721080 }
10731081 rcu_read_unlock();
@@ -1417,7 +1425,8 @@ static struct rq *find_lock_later_rq(struct task_struct *task, struct rq *rq) · 343 unmodified lines
14171425
14181426 later_rq = cpu_rq(cpu);
14191427
1420− if (!dl_time_before(task->dl.deadline,
1428+ if (later_rq->dl.dl_nr_running &&
1429+ !dl_time_before(task->dl.deadline,
14211430 later_rq->dl.earliest_dl.curr)) {
14221431 /*
14231432 * Target rq has tasks of equal or earlier deadline,
kernel/sched/fair.c+5−4
@@ -2363,7 +2363,7 @@ static inline long calc_tg_weight(struct task_group *tg, struct cfs_rq *cfs_rq) · 2362 unmodified lines
23632363 */
23642364 tg_weight = atomic_long_read(&tg->load_avg);
23652365 tg_weight -= cfs_rq->tg_load_avg_contrib;
2366− tg_weight += cfs_rq_load_avg(cfs_rq);
2366+ tg_weight += cfs_rq->load.weight;
23672367
23682368 return tg_weight;
23692369 }
@@ -2373,7 +2373,7 @@ static long calc_cfs_shares(struct cfs_rq *cfs_rq, struct task_group *tg) · 3 unmodified lines
23732373 long tg_weight, load, shares;
23742374
23752375 tg_weight = calc_tg_weight(tg, cfs_rq);
2376− load = cfs_rq_load_avg(cfs_rq);
2376+ load = cfs_rq->load.weight;
23772377
23782378 shares = (tg->shares * load);
23792379 if (tg_weight)
@@ -2664,13 +2664,14 @@ static inline u64 cfs_rq_clock_task(struct cfs_rq *cfs_rq); · 284 unmodified lines
26642664 /* Group cfs_rq's load_avg is used for task_h_load and update_cfs_share */
26652665 static inline int update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq)
26662666 {
2667− int decayed;
26682667 struct sched_avg *sa = &cfs_rq->avg;
2668+ int decayed, removed = 0;
26692669
26702670 if (atomic_long_read(&cfs_rq->removed_load_avg)) {
26712671 long r = atomic_long_xchg(&cfs_rq->removed_load_avg, 0);
26722672 sa->load_avg = max_t(long, sa->load_avg - r, 0);
26732673 sa->load_sum = max_t(s64, sa->load_sum - r * LOAD_AVG_MAX, 0);
2674+ removed = 1;
26742675 }
26752676
26762677 if (atomic_long_read(&cfs_rq->removed_util_avg)) {
@@ -2688,7 +2689,7 @@ static inline int update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq) · 11 unmodified lines
26882689 cfs_rq->load_last_update_time_copy = sa->last_update_time;
26892690 #endif
26902691
2691− return decayed;
2692+ return decayed || removed;
26922693 }
26932694
26942695 /* Update task and its cfs_rq load average */
kernel/sched/idle.c+2−0
@@ -57,9 +57,11 @@ static inline int cpu_idle_poll(void) · 56 unmodified lines
5757 rcu_idle_enter();
5858 trace_cpu_idle_rcuidle(0, smp_processor_id());
5959 local_irq_enable();
60+ stop_critical_timings();
6061 while (!tif_need_resched() &&
6162 (cpu_idle_force_poll || tick_check_broadcast_expired()))
6263 cpu_relax();
64+ start_critical_timings();
6365 trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
6466 rcu_idle_exit();
6567 return 1;
kernel/time/timekeeping.c+1−1
@@ -1251,7 +1251,7 @@ void __init timekeeping_init(void) · 1250 unmodified lines
12511251 set_normalized_timespec64(&tmp, -boot.tv_sec, -boot.tv_nsec);
12521252 tk_set_wall_to_mono(tk, tmp);
12531253
1254− timekeeping_update(tk, TK_MIRROR);
1254+ timekeeping_update(tk, TK_MIRROR | TK_CLOCK_WAS_SET);
12551255
12561256 write_seqcount_end(&tk_core.seq);
12571257 raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
kernel/trace/trace_stack.c+11−0
@@ -85,9 +85,19 @@ check_stack(unsigned long ip, unsigned long *stack) · 84 unmodified lines
8585 if (!object_is_on_stack(stack))
8686 return;
8787
88+ /* Can't do this from NMI context (can cause deadlocks) */
89+ if (in_nmi())
90+ return;
91+
8892 local_irq_save(flags);
8993 arch_spin_lock(&max_stack_lock);
9094
95+ /*
96+ * RCU may not be watching, make it see us.
97+ * The stack trace code uses rcu_sched.
98+ */
99+ rcu_irq_enter();
100+
91101 /* In case another CPU set the tracer_frame on us */
92102 if (unlikely(!frame_size))
93103 this_size -= tracer_frame;
@@ -169,6 +179,7 @@ check_stack(unsigned long ip, unsigned long *stack) · 75 unmodified lines
169179 }
170180
171181 out:
182+ rcu_irq_exit();
172183 arch_spin_unlock(&max_stack_lock);
173184 local_irq_restore(flags);
174185 }
kernel/workqueue.c+4−4
@@ -1458,13 +1458,13 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct *wq, · 1457 unmodified lines
14581458 timer_stats_timer_set_start_info(&dwork->timer);
14591459
14601460 dwork->wq = wq;
1461+ /* timer isn't guaranteed to run in this cpu, record earlier */
1462+ if (cpu == WORK_CPU_UNBOUND)
1463+ cpu = raw_smp_processor_id();
14611464 dwork->cpu = cpu;
14621465 timer->expires = jiffies + delay;
14631466
1464− if (unlikely(cpu != WORK_CPU_UNBOUND))
1465− add_timer_on(timer, cpu);
1466− else
1467− add_timer(timer);
1467+ add_timer_on(timer, cpu);
14681468 }
14691469
14701470 /**
lib/Kconfig+1−0
@@ -220,6 +220,7 @@ config ZLIB_INFLATE · 219 unmodified lines
220220
221221 config ZLIB_DEFLATE
222222 tristate
223+ select BITREVERSE
223224
224225 config LZO_COMPRESS
225226 tristate
lib/Kconfig.debug+1−0
@@ -197,6 +197,7 @@ config ENABLE_MUST_CHECK · 196 unmodified lines
197197 config FRAME_WARN
198198 int "Warn for stack frames larger than (needs gcc 4.4)"
199199 range 0 8192
200+ default 0 if KASAN
200201 default 1024 if !64BIT
201202 default 2048 if 64BIT
202203 help
lib/fault-inject.c+1−1
@@ -44,7 +44,7 @@ static void fail_dump(struct fault_attr *attr) · 43 unmodified lines
4444 printk(KERN_NOTICE "FAULT_INJECTION: forcing a failure.\n"
4545 "name %pd, interval %lu, probability %lu, "
4646 "space %d, times %d\n", attr->dname,
47− attr->probability, attr->interval,
47+ attr->interval, attr->probability,
4848 atomic_read(&attr->space),
4949 atomic_read(&attr->times));
5050 if (attr->verbose > 1)
mm/backing-dev.c+30−6
@@ -480,6 +480,10 @@ static void cgwb_release_workfn(struct work_struct *work) · 479 unmodified lines
480480 release_work);
481481 struct backing_dev_info *bdi = wb->bdi;
482482
483+ spin_lock_irq(&cgwb_lock);
484+ list_del_rcu(&wb->bdi_node);
485+ spin_unlock_irq(&cgwb_lock);
486+
483487 wb_shutdown(wb);
484488
485489 css_put(wb->memcg_css);
@@ -575,6 +579,7 @@ static int cgwb_create(struct backing_dev_info *bdi, · 89 unmodified lines
575579 ret = radix_tree_insert(&bdi->cgwb_tree, memcg_css->id, wb);
576580 if (!ret) {
577581 atomic_inc(&bdi->usage_cnt);
582+ list_add_tail_rcu(&wb->bdi_node, &bdi->wb_list);
578583 list_add(&wb->memcg_node, memcg_cgwb_list);
579584 list_add(&wb->blkcg_node, blkcg_cgwb_list);
580585 css_get(memcg_css);
@@ -676,7 +681,7 @@ static int cgwb_bdi_init(struct backing_dev_info *bdi) · 95 unmodified lines
676681 static void cgwb_bdi_destroy(struct backing_dev_info *bdi)
677682 {
678683 struct radix_tree_iter iter;
679− struct bdi_writeback_congested *congested, *congested_n;
684+ struct rb_node *rbn;
680685 void **slot;
681686
682687 WARN_ON(test_bit(WB_registered, &bdi->wb.state));
@@ -686,9 +691,11 @@ static void cgwb_bdi_destroy(struct backing_dev_info *bdi) · 3 unmodified lines
686691 radix_tree_for_each_slot(slot, &bdi->cgwb_tree, &iter, 0)
687692 cgwb_kill(*slot);
688693
689− rbtree_postorder_for_each_entry_safe(congested, congested_n,
690− &bdi->cgwb_congested_tree, rb_node) {
691− rb_erase(&congested->rb_node, &bdi->cgwb_congested_tree);
694+ while ((rbn = rb_first(&bdi->cgwb_congested_tree))) {
695+ struct bdi_writeback_congested *congested =
696+ rb_entry(rbn, struct bdi_writeback_congested, rb_node);
697+
698+ rb_erase(rbn, &bdi->cgwb_congested_tree);
692699 congested->bdi = NULL; /* mark @congested unlinked */
693700 }
694701
@@ -764,15 +771,22 @@ static void cgwb_bdi_destroy(struct backing_dev_info *bdi) { } · 69 unmodified lines
764771
765772 int bdi_init(struct backing_dev_info *bdi)
766773 {
774+ int ret;
775+
767776 bdi->dev = NULL;
768777
769778 bdi->min_ratio = 0;
770779 bdi->max_ratio = 100;
771780 bdi->max_prop_frac = FPROP_FRAC_BASE;
772781 INIT_LIST_HEAD(&bdi->bdi_list);
782+ INIT_LIST_HEAD(&bdi->wb_list);
773783 init_waitqueue_head(&bdi->wb_waitq);
774784
775− return cgwb_bdi_init(bdi);
785+ ret = cgwb_bdi_init(bdi);
786+
787+ list_add_tail_rcu(&bdi->wb.bdi_node, &bdi->wb_list);
788+
789+ return ret;
776790 }
777791 EXPORT_SYMBOL(bdi_init);
778792
@@ -823,7 +837,7 @@ static void bdi_remove_from_list(struct backing_dev_info *bdi) · 44 unmodified lines
823837 synchronize_rcu_expedited();
824838 }
825839
826−void bdi_destroy(struct backing_dev_info *bdi)
840+void bdi_unregister(struct backing_dev_info *bdi)
827841 {
828842 /* make sure nobody finds us on the bdi_list anymore */
829843 bdi_remove_from_list(bdi);
@@ -835,9 +849,19 @@ void bdi_destroy(struct backing_dev_info *bdi) · 5 unmodified lines
835849 device_unregister(bdi->dev);
836850 bdi->dev = NULL;
837851 }
852+}
838853
854+void bdi_exit(struct backing_dev_info *bdi)
855+{
856+ WARN_ON_ONCE(bdi->dev);
839857 wb_exit(&bdi->wb);
840858 }
859+
860+void bdi_destroy(struct backing_dev_info *bdi)
861+{
862+ bdi_unregister(bdi);
863+ bdi_exit(bdi);
864+}
841865 EXPORT_SYMBOL(bdi_destroy);
842866
843867 /*
mm/cma.c+2−2
@@ -361,7 +361,7 @@ err: · 360 unmodified lines
361361 * This function allocates part of contiguous memory on specific
362362 * contiguous memory area.
363363 */
364−struct page *cma_alloc(struct cma *cma, unsigned int count, unsigned int align)
364+struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align)
365365 {
366366 unsigned long mask, offset, pfn, start = 0;
367367 unsigned long bitmap_maxno, bitmap_no, bitmap_count;
@@ -371,7 +371,7 @@ struct page *cma_alloc(struct cma *cma, unsigned int count, unsigned int align) · 3 unmodified lines
371371 if (!cma || !cma->count)
372372 return NULL;
373373
374− pr_debug("%s(cma %p, count %d, align %d)\n", __func__, (void *)cma,
374+ pr_debug("%s(cma %p, count %zu, align %d)\n", __func__, (void *)cma,
375375 count, align);
376376
377377 if (!count)
mm/filemap.c+5−4
@@ -2488,6 +2488,11 @@ again: · 2487 unmodified lines
24882488 break;
24892489 }
24902490
2491+ if (fatal_signal_pending(current)) {
2492+ status = -EINTR;
2493+ break;
2494+ }
2495+
24912496 status = a_ops->write_begin(file, mapping, pos, bytes, flags,
24922497 &page, &fsdata);
24932498 if (unlikely(status < 0))
@@ -2525,10 +2530,6 @@ again: · 31 unmodified lines
25252530 written += copied;
25262531
25272532 balance_dirty_pages_ratelimited(mapping);
2528− if (fatal_signal_pending(current)) {
2529− status = -EINTR;
2530− break;
2531− }
25322533 } while (iov_iter_count(i));
25332534
25342535 return written ? written : status;
mm/huge_memory.c+2−1
@@ -2206,7 +2206,8 @@ static int __collapse_huge_page_isolate(struct vm_area_struct *vma, · 2205 unmodified lines
22062206 for (_pte = pte; _pte < pte+HPAGE_PMD_NR;
22072207 _pte++, address += PAGE_SIZE) {
22082208 pte_t pteval = *_pte;
2209− if (pte_none(pteval) || is_zero_pfn(pte_pfn(pteval))) {
2209+ if (pte_none(pteval) || (pte_present(pteval) &&
2210+ is_zero_pfn(pte_pfn(pteval)))) {
22102211 if (!userfaultfd_armed(vma) &&
22112212 ++none_or_zero <= khugepaged_max_ptes_none)
22122213 continue;
mm/memcontrol.c+18−18
@@ -3387,6 +3387,7 @@ static int __mem_cgroup_usage_register_event(struct mem_cgroup *memcg, · 3386 unmodified lines
33873387 ret = page_counter_memparse(args, "-1", &threshold);
33883388 if (ret)
33893389 return ret;
3390+ threshold <<= PAGE_SHIFT;
33903391
33913392 mutex_lock(&memcg->thresholds_lock);
33923393
@@ -3740,44 +3741,43 @@ struct wb_domain *mem_cgroup_wb_domain(struct bdi_writeback *wb) · 347 unmodified lines
37403741 /**
37413742 * mem_cgroup_wb_stats - retrieve writeback related stats from its memcg
37423743 * @wb: bdi_writeback in question
3743− * @pavail: out parameter for number of available pages
3744+ * @pfilepages: out parameter for number of file pages
3745+ * @pheadroom: out parameter for number of allocatable pages according to memcg
37443746 * @pdirty: out parameter for number of dirty pages
37453747 * @pwriteback: out parameter for number of pages under writeback
37463748 *
3747− * Determine the numbers of available, dirty, and writeback pages in @wb's
3748− * memcg. Dirty and writeback are self-explanatory. Available is a bit
3749− * more involved.
3749+ * Determine the numbers of file, headroom, dirty, and writeback pages in
3750+ * @wb's memcg. File, dirty and writeback are self-explanatory. Headroom
3751+ * is a bit more involved.
37503752 *
3751− * A memcg's headroom is "min(max, high) - used". The available memory is
3752− * calculated as the lowest headroom of itself and the ancestors plus the
3753− * number of pages already being used for file pages. Note that this
3754− * doesn't consider the actual amount of available memory in the system.
3755− * The caller should further cap *@pavail accordingly.
3753+ * A memcg's headroom is "min(max, high) - used". In the hierarchy, the
3754+ * headroom is calculated as the lowest headroom of itself and the
3755+ * ancestors. Note that this doesn't consider the actual amount of
3756+ * available memory in the system. The caller should further cap
3757+ * *@pheadroom accordingly.
37563758 */
3757−void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pavail,
3758− unsigned long *pdirty, unsigned long *pwriteback)
3759+void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pfilepages,
3760+ unsigned long *pheadroom, unsigned long *pdirty,
3761+ unsigned long *pwriteback)
37593762 {
37603763 struct mem_cgroup *memcg = mem_cgroup_from_css(wb->memcg_css);
37613764 struct mem_cgroup *parent;
3762− unsigned long head_room = PAGE_COUNTER_MAX;
3763− unsigned long file_pages;
37643765
37653766 *pdirty = mem_cgroup_read_stat(memcg, MEM_CGROUP_STAT_DIRTY);
37663767
37673768 /* this should eventually include NR_UNSTABLE_NFS */
37683769 *pwriteback = mem_cgroup_read_stat(memcg, MEM_CGROUP_STAT_WRITEBACK);
3770+ *pfilepages = mem_cgroup_nr_lru_pages(memcg, (1 << LRU_INACTIVE_FILE) |
3771+ (1 << LRU_ACTIVE_FILE));
3772+ *pheadroom = PAGE_COUNTER_MAX;
37693773
3770− file_pages = mem_cgroup_nr_lru_pages(memcg, (1 << LRU_INACTIVE_FILE) |
3771− (1 << LRU_ACTIVE_FILE));
37723774 while ((parent = parent_mem_cgroup(memcg))) {
37733775 unsigned long ceiling = min(memcg->memory.limit, memcg->high);
37743776 unsigned long used = page_counter_read(&memcg->memory);
37753777
3776− head_room = min(head_room, ceiling - min(ceiling, used));
3778+ *pheadroom = min(*pheadroom, ceiling - min(ceiling, used));
37773779 memcg = parent;
37783780 }
3779−
3780− *pavail = file_pages + head_room;
37813781 }
37823782
37833783 #else /* CONFIG_CGROUP_WRITEBACK */
mm/memory.c+2−0
@@ -2426,6 +2426,8 @@ void unmap_mapping_range(struct address_space *mapping, · 2425 unmodified lines
24262426 if (details.last_index < details.first_index)
24272427 details.last_index = ULONG_MAX;
24282428
2429+
2430+ /* DAX uses i_mmap_lock to serialise file truncate vs page fault */
24292431 i_mmap_lock_write(mapping);
24302432 if (unlikely(!RB_EMPTY_ROOT(&mapping->i_mmap)))
24312433 unmap_mapping_range_tree(&mapping->i_mmap, &details);
mm/page-writeback.c+32−22
@@ -145,9 +145,6 @@ struct dirty_throttle_control { · 144 unmodified lines
145145 unsigned long pos_ratio;
146146 };
147147
148−#define DTC_INIT_COMMON(__wb) .wb = (__wb), \
149− .wb_completions = &(__wb)->completions
150−
151148 /*
152149 * Length of period for aging writeout fractions of bdis. This is an
153150 * arbitrarily chosen number. The longer the period, the slower fractions will
@@ -157,12 +154,16 @@ struct dirty_throttle_control { · 3 unmodified lines
157154
158155 #ifdef CONFIG_CGROUP_WRITEBACK
159156
160−#define GDTC_INIT(__wb) .dom = &global_wb_domain, \
161− DTC_INIT_COMMON(__wb)
157+#define GDTC_INIT(__wb) .wb = (__wb), \
158+ .dom = &global_wb_domain, \
159+ .wb_completions = &(__wb)->completions
160+
162161 #define GDTC_INIT_NO_WB .dom = &global_wb_domain
163−#define MDTC_INIT(__wb, __gdtc) .dom = mem_cgroup_wb_domain(__wb), \
164− .gdtc = __gdtc, \
165− DTC_INIT_COMMON(__wb)
162+
163+#define MDTC_INIT(__wb, __gdtc) .wb = (__wb), \
164+ .dom = mem_cgroup_wb_domain(__wb), \
165+ .wb_completions = &(__wb)->memcg_completions, \
166+ .gdtc = __gdtc
166167
167168 static bool mdtc_valid(struct dirty_throttle_control *dtc)
168169 {
@@ -213,7 +214,8 @@ static void wb_min_max_ratio(struct bdi_writeback *wb, · 44 unmodified lines
213214
214215 #else /* CONFIG_CGROUP_WRITEBACK */
215216
216−#define GDTC_INIT(__wb) DTC_INIT_COMMON(__wb)
217+#define GDTC_INIT(__wb) .wb = (__wb), \
218+ .wb_completions = &(__wb)->completions
217219 #define GDTC_INIT_NO_WB
218220 #define MDTC_INIT(__wb, __gdtc)
219221
@@ -682,13 +684,19 @@ static unsigned long hard_dirty_limit(struct wb_domain *dom, · 462 unmodified lines
682684 return max(thresh, dom->dirty_limit);
683685 }
684686
685−/* memory available to a memcg domain is capped by system-wide clean memory */
686−static void mdtc_cap_avail(struct dirty_throttle_control *mdtc)
687+/*
688+ * Memory which can be further allocated to a memcg domain is capped by
689+ * system-wide clean memory excluding the amount being used in the domain.
690+ */
691+static void mdtc_calc_avail(struct dirty_throttle_control *mdtc,
692+ unsigned long filepages, unsigned long headroom)
687693 {
688694 struct dirty_throttle_control *gdtc = mdtc_gdtc(mdtc);
689− unsigned long clean = gdtc->avail - min(gdtc->avail, gdtc->dirty);
695+ unsigned long clean = filepages - min(filepages, mdtc->dirty);
696+ unsigned long global_clean = gdtc->avail - min(gdtc->avail, gdtc->dirty);
697+ unsigned long other_clean = global_clean - min(global_clean, clean);
690698
691− mdtc->avail = min(mdtc->avail, clean);
699+ mdtc->avail = filepages + min(headroom, other_clean);
692700 }
693701
694702 /**
@@ -1562,16 +1570,16 @@ static void balance_dirty_pages(struct address_space *mapping, · 867 unmodified lines
15621570 }
15631571
15641572 if (mdtc) {
1565− unsigned long writeback;
1573+ unsigned long filepages, headroom, writeback;
15661574
15671575 /*
15681576 * If @wb belongs to !root memcg, repeat the same
15691577 * basic calculations for the memcg domain.
15701578 */
1571− mem_cgroup_wb_stats(wb, &mdtc->avail, &mdtc->dirty,
1572− &writeback);
1573− mdtc_cap_avail(mdtc);
1579+ mem_cgroup_wb_stats(wb, &filepages, &headroom,
1580+ &mdtc->dirty, &writeback);
15741581 mdtc->dirty += writeback;
1582+ mdtc_calc_avail(mdtc, filepages, headroom);
15751583
15761584 domain_dirty_limits(mdtc);
15771585
@@ -1893,10 +1901,11 @@ bool wb_over_bg_thresh(struct bdi_writeback *wb) · 315 unmodified lines
18931901 return true;
18941902
18951903 if (mdtc) {
1896− unsigned long writeback;
1904+ unsigned long filepages, headroom, writeback;
18971905
1898− mem_cgroup_wb_stats(wb, &mdtc->avail, &mdtc->dirty, &writeback);
1899− mdtc_cap_avail(mdtc);
1906+ mem_cgroup_wb_stats(wb, &filepages, &headroom, &mdtc->dirty,
1907+ &writeback);
1908+ mdtc_calc_avail(mdtc, filepages, headroom);
19001909 domain_dirty_limits(mdtc); /* ditto, ignore writeback */
19011910
19021911 if (mdtc->dirty > mdtc->bg_thresh)
@@ -1956,7 +1965,6 @@ void laptop_mode_timer_fn(unsigned long data) · 53 unmodified lines
19561965 int nr_pages = global_page_state(NR_FILE_DIRTY) +
19571966 global_page_state(NR_UNSTABLE_NFS);
19581967 struct bdi_writeback *wb;
1959− struct wb_iter iter;
19601968
19611969 /*
19621970 * We want to write everything out, not just down to the dirty
@@ -1965,10 +1973,12 @@ void laptop_mode_timer_fn(unsigned long data) · 2 unmodified lines
19651973 if (!bdi_has_dirty_io(&q->backing_dev_info))
19661974 return;
19671975
1968− bdi_for_each_wb(wb, &q->backing_dev_info, &iter, 0)
1976+ rcu_read_lock();
1977+ list_for_each_entry_rcu(wb, &q->backing_dev_info.wb_list, bdi_node)
19691978 if (wb_has_dirty_io(wb))
19701979 wb_start_writeback(wb, nr_pages, true,
19711980 WB_REASON_LAPTOP_TIMER);
1981+ rcu_read_unlock();
19721982 }
19731983
19741984 /*
mm/readahead.c+4−4
@@ -89,8 +89,8 @@ int read_cache_pages(struct address_space *mapping, struct list_head *pages, · 88 unmodified lines
8989 while (!list_empty(pages)) {
9090 page = list_to_page(pages);
9191 list_del(&page->lru);
92− if (add_to_page_cache_lru(page, mapping,
93− page->index, GFP_KERNEL)) {
92+ if (add_to_page_cache_lru(page, mapping, page->index,
93+ GFP_KERNEL & mapping_gfp_mask(mapping))) {
9494 read_cache_pages_invalidate_page(mapping, page);
9595 continue;
9696 }
@@ -127,8 +127,8 @@ static int read_pages(struct address_space *mapping, struct file *filp, · 30 unmodified lines
127127 for (page_idx = 0; page_idx < nr_pages; page_idx++) {
128128 struct page *page = list_to_page(pages);
129129 list_del(&page->lru);
130− if (!add_to_page_cache_lru(page, mapping,
131− page->index, GFP_KERNEL)) {
130+ if (!add_to_page_cache_lru(page, mapping, page->index,
131+ GFP_KERNEL & mapping_gfp_mask(mapping))) {
132132 mapping->a_ops->readpage(filp, page);
133133 }
134134 page_cache_release(page);
mm/vmstat.c+4−3
@@ -1363,15 +1363,16 @@ static cpumask_var_t cpu_stat_off; · 1362 unmodified lines
13631363
13641364 static void vmstat_update(struct work_struct *w)
13651365 {
1366− if (refresh_cpu_vm_stats())
1366+ if (refresh_cpu_vm_stats()) {
13671367 /*
13681368 * Counters were updated so we expect more updates
13691369 * to occur in the future. Keep on running the
13701370 * update worker thread.
13711371 */
1372− schedule_delayed_work(this_cpu_ptr(&vmstat_work),
1372+ schedule_delayed_work_on(smp_processor_id(),
1373+ this_cpu_ptr(&vmstat_work),
13731374 round_jiffies_relative(sysctl_stat_interval));
1374− else {
1375+ } else {
13751376 /*
13761377 * We did not update any counters so the app may be in
13771378 * a mode where it does not cause counter updates.
net/bluetooth/hci_conn.c+71−28
@@ -91,10 +91,50 @@ static void hci_connect_le_scan_cleanup(struct hci_conn *conn) · 90 unmodified lines
9191 * autoconnect action, remove them completely. If they are, just unmark
9292 * them as waiting for connection, by clearing explicit_connect field.
9393 */
94− if (params->auto_connect == HCI_AUTO_CONN_EXPLICIT)
94+ params->explicit_connect = false;
95+
96+ list_del_init(&params->action);
97+
98+ switch (params->auto_connect) {
99+ case HCI_AUTO_CONN_EXPLICIT:
95100 hci_conn_params_del(conn->hdev, bdaddr, bdaddr_type);
96− else
97− params->explicit_connect = false;
101+ /* return instead of break to avoid duplicate scan update */
102+ return;
103+ case HCI_AUTO_CONN_DIRECT:
104+ case HCI_AUTO_CONN_ALWAYS:
105+ list_add(&params->action, &conn->hdev->pend_le_conns);
106+ break;
107+ case HCI_AUTO_CONN_REPORT:
108+ list_add(&params->action, &conn->hdev->pend_le_reports);
109+ break;
110+ default:
111+ break;
112+ }
113+
114+ hci_update_background_scan(conn->hdev);
115+}
116+
117+static void hci_conn_cleanup(struct hci_conn *conn)
118+{
119+ struct hci_dev *hdev = conn->hdev;
120+
121+ if (test_bit(HCI_CONN_PARAM_REMOVAL_PEND, &conn->flags))
122+ hci_conn_params_del(conn->hdev, &conn->dst, conn->dst_type);
123+
124+ hci_chan_list_flush(conn);
125+
126+ hci_conn_hash_del(hdev, conn);
127+
128+ if (hdev->notify)
129+ hdev->notify(hdev, HCI_NOTIFY_CONN_DEL);
130+
131+ hci_conn_del_sysfs(conn);
132+
133+ debugfs_remove_recursive(conn->debugfs);
134+
135+ hci_dev_put(hdev);
136+
137+ hci_conn_put(conn);
98138 }
99139
100140 /* This function requires the caller holds hdev->lock */
@@ -102,8 +142,13 @@ static void hci_connect_le_scan_remove(struct hci_conn *conn) · 1 unmodified line
102142 {
103143 hci_connect_le_scan_cleanup(conn);
104144
105− hci_conn_hash_del(conn->hdev, conn);
106− hci_update_background_scan(conn->hdev);
145+ /* We can't call hci_conn_del here since that would deadlock
146+ * with trying to call cancel_delayed_work_sync(&conn->disc_work).
147+ * Instead, call just hci_conn_cleanup() which contains the bare
148+ * minimum cleanup operations needed for a connection in this
149+ * state.
150+ */
151+ hci_conn_cleanup(conn);
107152 }
108153
109154 static void hci_acl_create_connection(struct hci_conn *conn)
@@ -581,27 +626,17 @@ int hci_conn_del(struct hci_conn *conn) · 471 unmodified lines
581626 }
582627 }
583628
584− hci_chan_list_flush(conn);
585−
586629 if (conn->amp_mgr)
587630 amp_mgr_put(conn->amp_mgr);
588631
589− hci_conn_hash_del(hdev, conn);
590− if (hdev->notify)
591− hdev->notify(hdev, HCI_NOTIFY_CONN_DEL);
592−
593632 skb_queue_purge(&conn->data_q);
594633
595− hci_conn_del_sysfs(conn);
596−
597− debugfs_remove_recursive(conn->debugfs);
598−
599− if (test_bit(HCI_CONN_PARAM_REMOVAL_PEND, &conn->flags))
600− hci_conn_params_del(conn->hdev, &conn->dst, conn->dst_type);
601−
602− hci_dev_put(hdev);
603−
604− hci_conn_put(conn);
634+ /* Remove the connection from the list and cleanup its remaining
635+ * state. This is a separate function since for some cases like
636+ * BT_CONNECT_SCAN we *only* want the cleanup part without the
637+ * rest of hci_conn_del.
638+ */
639+ hci_conn_cleanup(conn);
605640
606641 return 0;
607642 }
@@ -973,15 +1008,23 @@ static int hci_explicit_conn_params_set(struct hci_request *req, · 365 unmodified lines
9731008 if (is_connected(hdev, addr, addr_type))
9741009 return -EISCONN;
9751010
976− params = hci_conn_params_add(hdev, addr, addr_type);
977− if (!params)
978− return -EIO;
1011+ params = hci_conn_params_lookup(hdev, addr, addr_type);
1012+ if (!params) {
1013+ params = hci_conn_params_add(hdev, addr, addr_type);
1014+ if (!params)
1015+ return -ENOMEM;
9791016
980− /* If we created new params, or existing params were marked as disabled,
981− * mark them to be used just once to connect.
982− */
983− if (params->auto_connect == HCI_AUTO_CONN_DISABLED) {
1017+ /* If we created new params, mark them to be deleted in
1018+ * hci_connect_le_scan_cleanup. It's different case than
1019+ * existing disabled params, those will stay after cleanup.
1020+ */
9841021 params->auto_connect = HCI_AUTO_CONN_EXPLICIT;
1022+ }
1023+
1024+ /* We're trying to connect, so make sure params are at pend_le_conns */
1025+ if (params->auto_connect == HCI_AUTO_CONN_DISABLED ||
1026+ params->auto_connect == HCI_AUTO_CONN_REPORT ||
1027+ params->auto_connect == HCI_AUTO_CONN_EXPLICIT) {
9851028 list_del_init(&params->action);
9861029 list_add(&params->action, &hdev->pend_le_conns);
9871030 }
net/bluetooth/hci_core.c+0−7
@@ -2861,13 +2861,6 @@ struct hci_conn_params *hci_explicit_connect_lookup(struct hci_dev *hdev, · 2860 unmodified lines
28612861 return param;
28622862 }
28632863
2864− list_for_each_entry(param, &hdev->pend_le_reports, action) {
2865− if (bacmp(&param->addr, addr) == 0 &&
2866− param->addr_type == addr_type &&
2867− param->explicit_connect)
2868− return param;
2869− }
2870−
28712864 return NULL;
28722865 }
28732866
net/bluetooth/hci_event.c+8−3
@@ -55,7 +55,12 @@ static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb) · 54 unmodified lines
5555 wake_up_bit(&hdev->flags, HCI_INQUIRY);
5656
5757 hci_dev_lock(hdev);
58− hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
58+ /* Set discovery state to stopped if we're not doing LE active
59+ * scanning.
60+ */
61+ if (!hci_dev_test_flag(hdev, HCI_LE_SCAN) ||
62+ hdev->le_scan_type != LE_SCAN_ACTIVE)
63+ hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
5964 hci_dev_unlock(hdev);
6065
6166 hci_conn_check_pending(hdev);
@@ -4648,8 +4653,8 @@ static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev, · 4586 unmodified lines
46484653 /* If we're not connectable only connect devices that we have in
46494654 * our pend_le_conns list.
46504655 */
4651− params = hci_explicit_connect_lookup(hdev, addr, addr_type);
4652−
4656+ params = hci_pend_le_action_lookup(&hdev->pend_le_conns, addr,
4657+ addr_type);
46534658 if (!params)
46544659 return NULL;
46554660
net/bluetooth/mgmt.c+20−4
@@ -3545,6 +3545,7 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data, · 3544 unmodified lines
35453545 auth_type);
35463546 } else {
35473547 u8 addr_type;
3548+ struct hci_conn_params *p;
35483549
35493550 /* Convert from L2CAP channel address type to HCI address type
35503551 */
@@ -3562,7 +3563,10 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data, · 11 unmodified lines
35623563 * If connection parameters already exist, then they
35633564 * will be kept and this function does nothing.
35643565 */
3565− hci_conn_params_add(hdev, &cp->addr.bdaddr, addr_type);
3566+ p = hci_conn_params_add(hdev, &cp->addr.bdaddr, addr_type);
3567+
3568+ if (p->auto_connect == HCI_AUTO_CONN_EXPLICIT)
3569+ p->auto_connect = HCI_AUTO_CONN_DISABLED;
35663570
35673571 conn = hci_connect_le_scan(hdev, &cp->addr.bdaddr,
35683572 addr_type, sec_level,
@@ -6117,14 +6121,21 @@ static int hci_conn_params_set(struct hci_request *req, bdaddr_t *addr, · 2548 unmodified lines
61176121 __hci_update_background_scan(req);
61186122 break;
61196123 case HCI_AUTO_CONN_REPORT:
6120− list_add(&params->action, &hdev->pend_le_reports);
6124+ if (params->explicit_connect)
6125+ list_add(&params->action, &hdev->pend_le_conns);
6126+ else
6127+ list_add(&params->action, &hdev->pend_le_reports);
61216128 __hci_update_background_scan(req);
61226129 break;
61236130 case HCI_AUTO_CONN_DIRECT:
61246131 case HCI_AUTO_CONN_ALWAYS:
61256132 if (!is_connected(hdev, addr, addr_type)) {
61266133 list_add(&params->action, &hdev->pend_le_conns);
6127− __hci_update_background_scan(req);
6134+ /* If we are in scan phase of connecting, we were
6135+ * already added to pend_le_conns and scanning.
6136+ */
6137+ if (params->auto_connect != HCI_AUTO_CONN_EXPLICIT)
6138+ __hci_update_background_scan(req);
61286139 }
61296140 break;
61306141 }
@@ -6379,7 +6390,8 @@ static int remove_device(struct sock *sk, struct hci_dev *hdev, · 248 unmodified lines
63796390 goto unlock;
63806391 }
63816392
6382− if (params->auto_connect == HCI_AUTO_CONN_DISABLED) {
6393+ if (params->auto_connect == HCI_AUTO_CONN_DISABLED ||
6394+ params->auto_connect == HCI_AUTO_CONN_EXPLICIT) {
63836395 err = cmd->cmd_complete(cmd,
63846396 MGMT_STATUS_INVALID_PARAMS);
63856397 mgmt_pending_remove(cmd);
@@ -6415,6 +6427,10 @@ static int remove_device(struct sock *sk, struct hci_dev *hdev, · 29 unmodified lines
64156427 if (p->auto_connect == HCI_AUTO_CONN_DISABLED)
64166428 continue;
64176429 device_removed(sk, hdev, &p->addr, p->addr_type);
6430+ if (p->explicit_connect) {
6431+ p->auto_connect = HCI_AUTO_CONN_EXPLICIT;
6432+ continue;
6433+ }
64186434 list_del(&p->action);
64196435 list_del(&p->list);
64206436 kfree(p);
net/ceph/osd_client.c+9−4
@@ -285,6 +285,7 @@ static void osd_req_op_data_release(struct ceph_osd_request *osd_req, · 284 unmodified lines
285285 switch (op->op) {
286286 case CEPH_OSD_OP_READ:
287287 case CEPH_OSD_OP_WRITE:
288+ case CEPH_OSD_OP_WRITEFULL:
288289 ceph_osd_data_release(&op->extent.osd_data);
289290 break;
290291 case CEPH_OSD_OP_CALL:
@@ -485,13 +486,14 @@ void osd_req_op_extent_init(struct ceph_osd_request *osd_req, · 194 unmodified lines
485486 size_t payload_len = 0;
486487
487488 BUG_ON(opcode != CEPH_OSD_OP_READ && opcode != CEPH_OSD_OP_WRITE &&
488− opcode != CEPH_OSD_OP_ZERO && opcode != CEPH_OSD_OP_TRUNCATE);
489+ opcode != CEPH_OSD_OP_WRITEFULL && opcode != CEPH_OSD_OP_ZERO &&
490+ opcode != CEPH_OSD_OP_TRUNCATE);
489491
490492 op->extent.offset = offset;
491493 op->extent.length = length;
492494 op->extent.truncate_size = truncate_size;
493495 op->extent.truncate_seq = truncate_seq;
494− if (opcode == CEPH_OSD_OP_WRITE)
496+ if (opcode == CEPH_OSD_OP_WRITE || opcode == CEPH_OSD_OP_WRITEFULL)
495497 payload_len += length;
496498
497499 op->payload_len = payload_len;
@@ -670,9 +672,11 @@ static u64 osd_req_encode_op(struct ceph_osd_request *req, · 172 unmodified lines
670672 break;
671673 case CEPH_OSD_OP_READ:
672674 case CEPH_OSD_OP_WRITE:
675+ case CEPH_OSD_OP_WRITEFULL:
673676 case CEPH_OSD_OP_ZERO:
674677 case CEPH_OSD_OP_TRUNCATE:
675− if (src->op == CEPH_OSD_OP_WRITE)
678+ if (src->op == CEPH_OSD_OP_WRITE ||
679+ src->op == CEPH_OSD_OP_WRITEFULL)
676680 request_data_len = src->extent.length;
677681 dst->extent.offset = cpu_to_le64(src->extent.offset);
678682 dst->extent.length = cpu_to_le64(src->extent.length);
@@ -681,7 +685,8 @@ static u64 osd_req_encode_op(struct ceph_osd_request *req, · 2 unmodified lines
681685 dst->extent.truncate_seq =
682686 cpu_to_le32(src->extent.truncate_seq);
683687 osd_data = &src->extent.osd_data;
684− if (src->op == CEPH_OSD_OP_WRITE)
688+ if (src->op == CEPH_OSD_OP_WRITE ||
689+ src->op == CEPH_OSD_OP_WRITEFULL)
685690 ceph_osdc_msg_data_add(req->r_request, osd_data);
686691 else
687692 ceph_osdc_msg_data_add(req->r_reply, osd_data);
net/core/ethtool.c+1−1
@@ -1284,7 +1284,7 @@ static int ethtool_get_strings(struct net_device *dev, void __user *useraddr) · 1283 unmodified lines
12841284
12851285 gstrings.len = ret;
12861286
1287− data = kmalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER);
1287+ data = kcalloc(gstrings.len, ETH_GSTRING_LEN, GFP_USER);
12881288 if (!data)
12891289 return -ENOMEM;
12901290
net/core/filter.c+6−1
@@ -1415,6 +1415,7 @@ static u64 bpf_clone_redirect(u64 r1, u64 ifindex, u64 flags, u64 r4, u64 r5) · 1414 unmodified lines
14151415 return dev_forward_skb(dev, skb2);
14161416
14171417 skb2->dev = dev;
1418+ skb_sender_cpu_clear(skb2);
14181419 return dev_queue_xmit(skb2);
14191420 }
14201421
@@ -1854,9 +1855,13 @@ int sk_get_filter(struct sock *sk, struct sock_filter __user *ubuf, · 433 unmodified lines
18541855 goto out;
18551856
18561857 /* We're copying the filter that has been originally attached,
1857− * so no conversion/decode needed anymore.
1858+ * so no conversion/decode needed anymore. eBPF programs that
1859+ * have no original program cannot be dumped through this.
18581860 */
1861+ ret = -EACCES;
18591862 fprog = filter->prog->orig_prog;
1863+ if (!fprog)
1864+ goto out;
18601865
18611866 ret = fprog->len;
18621867 if (!len)
net/dsa/dsa.c+59−11
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <linux/of_platform.h>
2323 #include <linux/of_net.h>
2424 #include <linux/sysfs.h>
25+#include <linux/phy_fixed.h>
2526 #include "dsa_priv.h"
2627
2728 char dsa_driver_version[] = "0.1";
@@ -305,7 +306,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent) · 277 unmodified lines
305306 if (ret < 0)
306307 goto out;
307308
308− ds->slave_mii_bus = mdiobus_alloc();
309+ ds->slave_mii_bus = devm_mdiobus_alloc(parent);
309310 if (ds->slave_mii_bus == NULL) {
310311 ret = -ENOMEM;
311312 goto out;
@@ -314,7 +315,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent) · 2 unmodified lines
314315
315316 ret = mdiobus_register(ds->slave_mii_bus);
316317 if (ret < 0)
317− goto out_free;
318+ goto out;
318319
319320
320321 /*
@@ -367,10 +368,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent) · 46 unmodified lines
367368
368369 return ret;
369370
370−out_free:
371− mdiobus_free(ds->slave_mii_bus);
372371 out:
373− kfree(ds);
374372 return ret;
375373 }
376374
@@ -400,7 +398,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, · 23 unmodified lines
400398 /*
401399 * Allocate and initialise switch state.
402400 */
403− ds = kzalloc(sizeof(*ds) + drv->priv_size, GFP_KERNEL);
401+ ds = devm_kzalloc(parent, sizeof(*ds) + drv->priv_size, GFP_KERNEL);
404402 if (ds == NULL)
405403 return ERR_PTR(-ENOMEM);
406404
@@ -420,10 +418,47 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, · 13 unmodified lines
420418
421419 static void dsa_switch_destroy(struct dsa_switch *ds)
422420 {
421+ struct device_node *port_dn;
422+ struct phy_device *phydev;
423+ struct dsa_chip_data *cd = ds->pd;
424+ int port;
425+
423426 #ifdef CONFIG_NET_DSA_HWMON
424427 if (ds->hwmon_dev)
425428 hwmon_device_unregister(ds->hwmon_dev);
426429 #endif
430+
431+ /* Disable configuration of the CPU and DSA ports */
432+ for (port = 0; port < DSA_MAX_PORTS; port++) {
433+ if (!(dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port)))
434+ continue;
435+
436+ port_dn = cd->port_dn[port];
437+ if (of_phy_is_fixed_link(port_dn)) {
438+ phydev = of_phy_find_device(port_dn);
439+ if (phydev) {
440+ int addr = phydev->addr;
441+
442+ phy_device_free(phydev);
443+ of_node_put(port_dn);
444+ fixed_phy_del(addr);
445+ }
446+ }
447+ }
448+
449+ /* Destroy network devices for physical switch ports. */
450+ for (port = 0; port < DSA_MAX_PORTS; port++) {
451+ if (!(ds->phys_port_mask & (1 << port)))
452+ continue;
453+
454+ if (!ds->ports[port])
455+ continue;
456+
457+ unregister_netdev(ds->ports[port]);
458+ free_netdev(ds->ports[port]);
459+ }
460+
461+ mdiobus_unregister(ds->slave_mii_bus);
427462 }
428463
429464 #ifdef CONFIG_PM_SLEEP
@@ -802,10 +837,11 @@ static inline void dsa_of_remove(struct device *dev) · 372 unmodified lines
802837 }
803838 #endif
804839
805−static void dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev,
806− struct device *parent, struct dsa_platform_data *pd)
840+static int dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev,
841+ struct device *parent, struct dsa_platform_data *pd)
807842 {
808843 int i;
844+ unsigned configured = 0;
809845
810846 dst->pd = pd;
811847 dst->master_netdev = dev;
@@ -825,8 +861,16 @@ static void dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev, · 13 unmodified lines
825861 dst->ds[i] = ds;
826862 if (ds->drv->poll_link != NULL)
827863 dst->link_poll_needed = 1;
864+
865+ ++configured;
828866 }
829867
868+ /*
869+ * If no switch was found, exit cleanly
870+ */
871+ if (!configured)
872+ return -EPROBE_DEFER;
873+
830874 /*
831875 * If we use a tagging format that doesn't have an ethertype
832876 * field, make sure that all packets from this point on get
@@ -843,6 +887,8 @@ static void dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev, · 10 unmodified lines
843887 dst->link_poll_timer.expires = round_jiffies(jiffies + HZ);
844888 add_timer(&dst->link_poll_timer);
845889 }
890+
891+ return 0;
846892 }
847893
848894 static int dsa_probe(struct platform_device *pdev)
@@ -883,7 +929,7 @@ static int dsa_probe(struct platform_device *pdev) · 34 unmodified lines
883929 goto out;
884930 }
885931
886− dst = kzalloc(sizeof(*dst), GFP_KERNEL);
932+ dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL);
887933 if (dst == NULL) {
888934 dev_put(dev);
889935 ret = -ENOMEM;
@@ -892,7 +938,9 @@ static int dsa_probe(struct platform_device *pdev) · 2 unmodified lines
892938
893939 platform_set_drvdata(pdev, dst);
894940
895− dsa_setup_dst(dst, dev, &pdev->dev, pd);
941+ ret = dsa_setup_dst(dst, dev, &pdev->dev, pd);
942+ if (ret)
943+ goto out;
896944
897945 return 0;
898946
@@ -914,7 +962,7 @@ static void dsa_remove_dst(struct dsa_switch_tree *dst) · 15 unmodified lines
914962 for (i = 0; i < dst->pd->nr_chips; i++) {
915963 struct dsa_switch *ds = dst->ds[i];
916964
917− if (ds != NULL)
965+ if (ds)
918966 dsa_switch_destroy(ds);
919967 }
920968 }
net/ipv4/arp.c+5−3
@@ -312,7 +312,7 @@ static void arp_send_dst(int type, int ptype, __be32 dest_ip, · 311 unmodified lines
312312 if (!skb)
313313 return;
314314
315− skb_dst_set(skb, dst);
315+ skb_dst_set(skb, dst_clone(dst));
316316 arp_xmit(skb);
317317 }
318318
@@ -384,7 +384,7 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb) · 65 unmodified lines
384384 }
385385
386386 if (skb && !(dev->priv_flags & IFF_XMIT_DST_RELEASE))
387− dst = dst_clone(skb_dst(skb));
387+ dst = skb_dst(skb);
388388 arp_send_dst(ARPOP_REQUEST, ETH_P_ARP, target, dev, saddr,
389389 dst_hw, dev->dev_addr, NULL, dst);
390390 }
@@ -811,7 +811,7 @@ static int arp_process(struct sock *sk, struct sk_buff *skb) · 420 unmodified lines
811811 } else {
812812 pneigh_enqueue(&arp_tbl,
813813 in_dev->arp_parms, skb);
814− return 0;
814+ goto out_free_dst;
815815 }
816816 goto out;
817817 }
@@ -865,6 +865,8 @@ static int arp_process(struct sock *sk, struct sk_buff *skb) · 47 unmodified lines
865865
866866 out:
867867 consume_skb(skb);
868+out_free_dst:
869+ dst_release(reply_dst);
868870 return 0;
869871 }
870872
net/ipv4/inet_connection_sock.c+10−9
@@ -577,21 +577,22 @@ EXPORT_SYMBOL(inet_rtx_syn_ack); · 576 unmodified lines
577577 static bool reqsk_queue_unlink(struct request_sock_queue *queue,
578578 struct request_sock *req)
579579 {
580− struct listen_sock *lopt = queue->listen_opt;
581580 struct request_sock **prev;
581+ struct listen_sock *lopt;
582582 bool found = false;
583583
584584 spin_lock(&queue->syn_wait_lock);
585−
586− for (prev = &lopt->syn_table[req->rsk_hash]; *prev != NULL;
587− prev = &(*prev)->dl_next) {
588− if (*prev == req) {
589− *prev = req->dl_next;
590− found = true;
591− break;
585+ lopt = queue->listen_opt;
586+ if (lopt) {
587+ for (prev = &lopt->syn_table[req->rsk_hash]; *prev != NULL;
588+ prev = &(*prev)->dl_next) {
589+ if (*prev == req) {
590+ *prev = req->dl_next;
591+ found = true;
592+ break;
593+ }
592594 }
593595 }
594−
595596 spin_unlock(&queue->syn_wait_lock);
596597 if (timer_pending(&req->rsk_timer) && del_timer_sync(&req->rsk_timer))
597598 reqsk_put(req);
net/ipv6/addrconf.c+2−0
@@ -3119,6 +3119,8 @@ static void addrconf_gre_config(struct net_device *dev) · 3118 unmodified lines
31193119 }
31203120
31213121 addrconf_addr_gen(idev, true);
3122+ if (dev->flags & IFF_POINTOPOINT)
3123+ addrconf_add_mroute(dev);
31223124 }
31233125 #endif
31243126
net/ipv6/ip6_output.c+3−0
@@ -376,6 +376,9 @@ int ip6_forward(struct sk_buff *skb) · 375 unmodified lines
376376 if (skb->pkt_type != PACKET_HOST)
377377 goto drop;
378378
379+ if (unlikely(skb->sk))
380+ goto drop;
381+
379382 if (skb_warn_if_lro(skb))
380383 goto drop;
381384
net/ipv6/route.c+23−26
@@ -142,6 +142,9 @@ static void rt6_uncached_list_flush_dev(struct net *net, struct net_device *dev) · 141 unmodified lines
142142 struct net_device *loopback_dev = net->loopback_dev;
143143 int cpu;
144144
145+ if (dev == loopback_dev)
146+ return;
147+
145148 for_each_possible_cpu(cpu) {
146149 struct uncached_list *ul = per_cpu_ptr(&rt6_uncached_list, cpu);
147150 struct rt6_info *rt;
@@ -151,14 +154,12 @@ static void rt6_uncached_list_flush_dev(struct net *net, struct net_device *dev) · 3 unmodified lines
151154 struct inet6_dev *rt_idev = rt->rt6i_idev;
152155 struct net_device *rt_dev = rt->dst.dev;
153156
154− if (rt_idev && (rt_idev->dev == dev || !dev) &&
155− rt_idev->dev != loopback_dev) {
157+ if (rt_idev->dev == dev) {
156158 rt->rt6i_idev = in6_dev_get(loopback_dev);
157159 in6_dev_put(rt_idev);
158160 }
159161
160− if (rt_dev && (rt_dev == dev || !dev) &&
161− rt_dev != loopback_dev) {
162+ if (rt_dev == dev) {
162163 rt->dst.dev = loopback_dev;
163164 dev_hold(rt->dst.dev);
164165 dev_put(rt_dev);
@@ -247,12 +248,6 @@ static void ip6_rt_blackhole_redirect(struct dst_entry *dst, struct sock *sk, · 82 unmodified lines
247248 {
248249 }
249250
250−static u32 *ip6_rt_blackhole_cow_metrics(struct dst_entry *dst,
251− unsigned long old)
252−{
253− return NULL;
254−}
255−
256251 static struct dst_ops ip6_dst_blackhole_ops = {
257252 .family = AF_INET6,
258253 .destroy = ip6_dst_destroy,
@@ -261,7 +256,7 @@ static struct dst_ops ip6_dst_blackhole_ops = { · 2 unmodified lines
261256 .default_advmss = ip6_default_advmss,
262257 .update_pmtu = ip6_rt_blackhole_update_pmtu,
263258 .redirect = ip6_rt_blackhole_redirect,
264− .cow_metrics = ip6_rt_blackhole_cow_metrics,
259+ .cow_metrics = dst_cow_metrics_generic,
265260 .neigh_lookup = ip6_neigh_lookup,
266261 };
267262
@@ -318,6 +313,15 @@ static const struct rt6_info ip6_blk_hole_entry_template = { · 50 unmodified lines
318313
319314 #endif
320315
316+static void rt6_info_init(struct rt6_info *rt)
317+{
318+ struct dst_entry *dst = &rt->dst;
319+
320+ memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst));
321+ INIT_LIST_HEAD(&rt->rt6i_siblings);
322+ INIT_LIST_HEAD(&rt->rt6i_uncached);
323+}
324+
321325 /* allocate dst with ip6_dst_ops */
322326 static struct rt6_info *__ip6_dst_alloc(struct net *net,
323327 struct net_device *dev,
@@ -326,13 +330,9 @@ static struct rt6_info *__ip6_dst_alloc(struct net *net, · 2 unmodified lines
326330 struct rt6_info *rt = dst_alloc(&net->ipv6.ip6_dst_ops, dev,
327331 0, DST_OBSOLETE_FORCE_CHK, flags);
328332
329− if (rt) {
330− struct dst_entry *dst = &rt->dst;
333+ if (rt)
334+ rt6_info_init(rt);
331335
332− memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst));
333− INIT_LIST_HEAD(&rt->rt6i_siblings);
334− INIT_LIST_HEAD(&rt->rt6i_uncached);
335− }
336336 return rt;
337337 }
338338
@@ -1213,24 +1213,20 @@ struct dst_entry *ip6_blackhole_route(struct net *net, struct dst_entry *dst_ori · 874 unmodified lines
12131213
12141214 rt = dst_alloc(&ip6_dst_blackhole_ops, ort->dst.dev, 1, DST_OBSOLETE_NONE, 0);
12151215 if (rt) {
1216− new = &rt->dst;
1217−
1218− memset(new + 1, 0, sizeof(*rt) - sizeof(*new));
1216+ rt6_info_init(rt);
12191217
1218+ new = &rt->dst;
12201219 new->__use = 1;
12211220 new->input = dst_discard;
12221221 new->output = dst_discard_sk;
12231222
1224− if (dst_metrics_read_only(&ort->dst))
1225− new->_metrics = ort->dst._metrics;
1226− else
1227− dst_copy_metrics(new, &ort->dst);
1223+ dst_copy_metrics(new, &ort->dst);
12281224 rt->rt6i_idev = ort->rt6i_idev;
12291225 if (rt->rt6i_idev)
12301226 in6_dev_hold(rt->rt6i_idev);
12311227
12321228 rt->rt6i_gateway = ort->rt6i_gateway;
1233− rt->rt6i_flags = ort->rt6i_flags;
1229+ rt->rt6i_flags = ort->rt6i_flags & ~RTF_PCPU;
12341230 rt->rt6i_metric = 0;
12351231
12361232 memcpy(&rt->rt6i_dst, &ort->rt6i_dst, sizeof(struct rt6key));
@@ -2622,7 +2618,8 @@ void rt6_ifdown(struct net *net, struct net_device *dev) · 1385 unmodified lines
26222618
26232619 fib6_clean_all(net, fib6_ifdown, &adn);
26242620 icmp6_clean_all(fib6_ifdown, &adn);
2625− rt6_uncached_list_flush_dev(net, dev);
2621+ if (dev)
2622+ rt6_uncached_list_flush_dev(net, dev);
26262623 }
26272624
26282625 struct rt6_mtu_change_arg {
net/ipv6/xfrm6_policy.c+1−0
@@ -37,6 +37,7 @@ static struct dst_entry *xfrm6_dst_lookup(struct net *net, int tos, int oif, · 36 unmodified lines
3737
3838 memset(&fl6, 0, sizeof(fl6));
3939 fl6.flowi6_oif = oif;
40+ fl6.flowi6_flags = FLOWI_FLAG_SKIP_NH_OIF;
4041 memcpy(&fl6.daddr, daddr, sizeof(fl6.daddr));
4142 if (saddr)
4243 memcpy(&fl6.saddr, saddr, sizeof(fl6.saddr));
net/mac80211/debugfs.c+1−1
@@ -149,7 +149,7 @@ static ssize_t hwflags_read(struct file *file, char __user *user_buf, · 148 unmodified lines
149149
150150 for (i = 0; i < NUM_IEEE80211_HW_FLAGS; i++) {
151151 if (test_bit(i, local->hw.flags))
152− pos += scnprintf(pos, end - pos, "%s",
152+ pos += scnprintf(pos, end - pos, "%s\n",
153153 hw_flag_names[i]);
154154 }
155155
net/mac80211/status.c+1−0
@@ -101,6 +101,7 @@ static void ieee80211_handle_filtered_frame(struct ieee80211_local *local, · 100 unmodified lines
101101 * when it wakes up for the next time.
102102 */
103103 set_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT);
104+ ieee80211_clear_fast_xmit(sta);
104105
105106 /*
106107 * This code races in the following way:
net/mac80211/tx.c+5−2
@@ -1218,8 +1218,10 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, · 1217 unmodified lines
12181218
12191219 if (!tx->sta)
12201220 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
1221− else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT))
1221+ else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) {
12221222 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
1223+ ieee80211_check_fast_xmit(tx->sta);
1224+ }
12231225
12241226 info->flags |= IEEE80211_TX_CTL_FIRST_FRAGMENT;
12251227
@@ -2451,7 +2453,8 @@ void ieee80211_check_fast_xmit(struct sta_info *sta) · 1225 unmodified lines
24512453
24522454 if (test_sta_flag(sta, WLAN_STA_PS_STA) ||
24532455 test_sta_flag(sta, WLAN_STA_PS_DRIVER) ||
2454− test_sta_flag(sta, WLAN_STA_PS_DELIVER))
2456+ test_sta_flag(sta, WLAN_STA_PS_DELIVER) ||
2457+ test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT))
24552458 goto out;
24562459
24572460 if (sdata->noack_map)
net/netlink/af_netlink.c+22−12
@@ -2785,6 +2785,7 @@ static int netlink_dump(struct sock *sk) · 2784 unmodified lines
27852785 struct sk_buff *skb = NULL;
27862786 struct nlmsghdr *nlh;
27872787 int len, err = -ENOBUFS;
2788+ int alloc_min_size;
27882789 int alloc_size;
27892790
27902791 mutex_lock(nlk->cb_mutex);
@@ -2793,9 +2794,6 @@ static int netlink_dump(struct sock *sk) · 2 unmodified lines
27932794 goto errout_skb;
27942795 }
27952796
2796− cb = &nlk->cb;
2797− alloc_size = max_t(int, cb->min_dump_alloc, NLMSG_GOODSIZE);
2798−
27992797 if (!netlink_rx_is_mmaped(sk) &&
28002798 atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)
28012799 goto errout_skb;
@@ -2805,23 +2803,35 @@ static int netlink_dump(struct sock *sk) · 3 unmodified lines
28052803 * to reduce number of system calls on dump operations, if user
28062804 * ever provided a big enough buffer.
28072805 */
2808− if (alloc_size < nlk->max_recvmsg_len) {
2809− skb = netlink_alloc_skb(sk,
2810− nlk->max_recvmsg_len,
2811− nlk->portid,
2806+ cb = &nlk->cb;
2807+ alloc_min_size = max_t(int, cb->min_dump_alloc, NLMSG_GOODSIZE);
2808+
2809+ if (alloc_min_size < nlk->max_recvmsg_len) {
2810+ alloc_size = nlk->max_recvmsg_len;
2811+ skb = netlink_alloc_skb(sk, alloc_size, nlk->portid,
28122812 GFP_KERNEL |
28132813 __GFP_NOWARN |
28142814 __GFP_NORETRY);
2815− /* available room should be exact amount to avoid MSG_TRUNC */
2816− if (skb)
2817− skb_reserve(skb, skb_tailroom(skb) -
2818− nlk->max_recvmsg_len);
28192815 }
2820− if (!skb)
2816+ if (!skb) {
2817+ alloc_size = alloc_min_size;
28212818 skb = netlink_alloc_skb(sk, alloc_size, nlk->portid,
28222819 GFP_KERNEL);
2820+ }
28232821 if (!skb)
28242822 goto errout_skb;
2823+
2824+ /* Trim skb to allocated size. User is expected to provide buffer as
2825+ * large as max(min_dump_alloc, 16KiB (mac_recvmsg_len capped at
2826+ * netlink_recvmsg())). dump will pack as many smaller messages as
2827+ * could fit within the allocated skb. skb is typically allocated
2828+ * with larger space than required (could be as much as near 2x the
2829+ * requested size with align to next power of 2 approach). Allowing
2830+ * dump to use the excess space makes it difficult for a user to have a
2831+ * reasonable static buffer based on the expected largest dump of a
2832+ * single netdev. The outcome is MSG_TRUNC error.
2833+ */
2834+ skb_reserve(skb, skb_tailroom(skb) - alloc_size);
28252835 netlink_skb_set_owner_r(skb, sk);
28262836
28272837 len = cb->dump(skb, cb);
net/openvswitch/actions.c+14−5
@@ -684,7 +684,7 @@ static void ovs_fragment(struct vport *vport, struct sk_buff *skb, u16 mru, · 683 unmodified lines
684684 {
685685 if (skb_network_offset(skb) > MAX_L2_LEN) {
686686 OVS_NLERR(1, "L2 header too long to fragment");
687− return;
687+ goto err;
688688 }
689689
690690 if (ethertype == htons(ETH_P_IP)) {
@@ -708,8 +708,7 @@ static void ovs_fragment(struct vport *vport, struct sk_buff *skb, u16 mru, · 17 unmodified lines
708708 struct rt6_info ovs_rt;
709709
710710 if (!v6ops) {
711− kfree_skb(skb);
712− return;
711+ goto err;
713712 }
714713
715714 prepare_frag(vport, skb);
@@ -728,8 +727,12 @@ static void ovs_fragment(struct vport *vport, struct sk_buff *skb, u16 mru, · 12 unmodified lines
728727 WARN_ONCE(1, "Failed fragment ->%s: eth=%04x, MRU=%d, MTU=%d.",
729728 ovs_vport_name(vport), ntohs(ethertype), mru,
730729 vport->dev->mtu);
731− kfree_skb(skb);
730+ goto err;
732731 }
732+
733+ return;
734+err:
735+ kfree_skb(skb);
733736 }
734737
735738 static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port,
@@ -968,7 +971,7 @@ static int execute_masked_set_action(struct sk_buff *skb, · 232 unmodified lines
968971 case OVS_KEY_ATTR_CT_STATE:
969972 case OVS_KEY_ATTR_CT_ZONE:
970973 case OVS_KEY_ATTR_CT_MARK:
971− case OVS_KEY_ATTR_CT_LABEL:
974+ case OVS_KEY_ATTR_CT_LABELS:
972975 err = -EINVAL;
973976 break;
974977 }
@@ -1099,6 +1102,12 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb, · 124 unmodified lines
10991102 break;
11001103
11011104 case OVS_ACTION_ATTR_CT:
1105+ if (!is_flow_key_valid(key)) {
1106+ err = ovs_flow_key_update(skb, key);
1107+ if (err)
1108+ return err;
1109+ }
1110+
11021111 err = ovs_ct_execute(ovs_dp_get_net(dp), skb, key,
11031112 nla_data(a));
11041113
net/openvswitch/conntrack.c+44−45
@@ -37,9 +37,9 @@ struct md_mark { · 36 unmodified lines
3737 };
3838
3939 /* Metadata label for masked write to conntrack label. */
40−struct md_label {
41− struct ovs_key_ct_label value;
42− struct ovs_key_ct_label mask;
40+struct md_labels {
41+ struct ovs_key_ct_labels value;
42+ struct ovs_key_ct_labels mask;
4343 };
4444
4545 /* Conntrack action context for execution. */
@@ -47,10 +47,10 @@ struct ovs_conntrack_info { · 1 unmodified line
4747 struct nf_conntrack_helper *helper;
4848 struct nf_conntrack_zone zone;
4949 struct nf_conn *ct;
50− u32 flags;
50+ u8 commit : 1;
5151 u16 family;
5252 struct md_mark mark;
53− struct md_label label;
53+ struct md_labels labels;
5454 };
5555
5656 static u16 key_to_nfproto(const struct sw_flow_key *key)
@@ -109,21 +109,21 @@ static u32 ovs_ct_get_mark(const struct nf_conn *ct) · 52 unmodified lines
109109 #endif
110110 }
111111
112−static void ovs_ct_get_label(const struct nf_conn *ct,
113− struct ovs_key_ct_label *label)
112+static void ovs_ct_get_labels(const struct nf_conn *ct,
113+ struct ovs_key_ct_labels *labels)
114114 {
115115 struct nf_conn_labels *cl = ct ? nf_ct_labels_find(ct) : NULL;
116116
117117 if (cl) {
118118 size_t len = cl->words * sizeof(long);
119119
120− if (len > OVS_CT_LABEL_LEN)
121− len = OVS_CT_LABEL_LEN;
122− else if (len < OVS_CT_LABEL_LEN)
123− memset(label, 0, OVS_CT_LABEL_LEN);
124− memcpy(label, cl->bits, len);
120+ if (len > OVS_CT_LABELS_LEN)
121+ len = OVS_CT_LABELS_LEN;
122+ else if (len < OVS_CT_LABELS_LEN)
123+ memset(labels, 0, OVS_CT_LABELS_LEN);
124+ memcpy(labels, cl->bits, len);
125125 } else {
126− memset(label, 0, OVS_CT_LABEL_LEN);
126+ memset(labels, 0, OVS_CT_LABELS_LEN);
127127 }
128128 }
129129
@@ -134,7 +134,7 @@ static void __ovs_ct_update_key(struct sw_flow_key *key, u8 state, · 4 unmodified lines
134134 key->ct.state = state;
135135 key->ct.zone = zone->id;
136136 key->ct.mark = ovs_ct_get_mark(ct);
137− ovs_ct_get_label(ct, &key->ct.label);
137+ ovs_ct_get_labels(ct, &key->ct.labels);
138138 }
139139
140140 /* Update 'key' based on skb->nfct. If 'post_ct' is true, then OVS has
@@ -167,7 +167,7 @@ void ovs_ct_fill_key(const struct sk_buff *skb, struct sw_flow_key *key) · 26 unmodified lines
167167
168168 int ovs_ct_put_key(const struct sw_flow_key *key, struct sk_buff *skb)
169169 {
170− if (nla_put_u8(skb, OVS_KEY_ATTR_CT_STATE, key->ct.state))
170+ if (nla_put_u32(skb, OVS_KEY_ATTR_CT_STATE, key->ct.state))
171171 return -EMSGSIZE;
172172
173173 if (IS_ENABLED(CONFIG_NF_CONNTRACK_ZONES) &&
@@ -179,8 +179,8 @@ int ovs_ct_put_key(const struct sw_flow_key *key, struct sk_buff *skb) · 5 unmodified lines
179179 return -EMSGSIZE;
180180
181181 if (IS_ENABLED(CONFIG_NF_CONNTRACK_LABELS) &&
182− nla_put(skb, OVS_KEY_ATTR_CT_LABEL, sizeof(key->ct.label),
183− &key->ct.label))
182+ nla_put(skb, OVS_KEY_ATTR_CT_LABELS, sizeof(key->ct.labels),
183+ &key->ct.labels))
184184 return -EMSGSIZE;
185185
186186 return 0;
@@ -213,9 +213,9 @@ static int ovs_ct_set_mark(struct sk_buff *skb, struct sw_flow_key *key, · 26 unmodified lines
213213 #endif
214214 }
215215
216−static int ovs_ct_set_label(struct sk_buff *skb, struct sw_flow_key *key,
217− const struct ovs_key_ct_label *label,
218− const struct ovs_key_ct_label *mask)
216+static int ovs_ct_set_labels(struct sk_buff *skb, struct sw_flow_key *key,
217+ const struct ovs_key_ct_labels *labels,
218+ const struct ovs_key_ct_labels *mask)
219219 {
220220 enum ip_conntrack_info ctinfo;
221221 struct nf_conn_labels *cl;
@@ -235,15 +235,15 @@ static int ovs_ct_set_label(struct sk_buff *skb, struct sw_flow_key *key, · 13 unmodified lines
235235 nf_ct_labels_ext_add(ct);
236236 cl = nf_ct_labels_find(ct);
237237 }
238− if (!cl || cl->words * sizeof(long) < OVS_CT_LABEL_LEN)
238+ if (!cl || cl->words * sizeof(long) < OVS_CT_LABELS_LEN)
239239 return -ENOSPC;
240240
241− err = nf_connlabels_replace(ct, (u32 *)label, (u32 *)mask,
242− OVS_CT_LABEL_LEN / sizeof(u32));
241+ err = nf_connlabels_replace(ct, (u32 *)labels, (u32 *)mask,
242+ OVS_CT_LABELS_LEN / sizeof(u32));
243243 if (err)
244244 return err;
245245
246− ovs_ct_get_label(ct, &key->ct.label);
246+ ovs_ct_get_labels(ct, &key->ct.labels);
247247 return 0;
248248 }
249249
@@ -465,12 +465,12 @@ static int ovs_ct_commit(struct net *net, struct sw_flow_key *key, · 215 unmodified lines
465465 return 0;
466466 }
467467
468−static bool label_nonzero(const struct ovs_key_ct_label *label)
468+static bool labels_nonzero(const struct ovs_key_ct_labels *labels)
469469 {
470470 size_t i;
471471
472− for (i = 0; i < sizeof(*label); i++)
473− if (label->ct_label[i])
472+ for (i = 0; i < sizeof(*labels); i++)
473+ if (labels->ct_labels[i])
474474 return true;
475475
476476 return false;
@@ -493,7 +493,7 @@ int ovs_ct_execute(struct net *net, struct sk_buff *skb, · 16 unmodified lines
493493 return err;
494494 }
495495
496− if (info->flags & OVS_CT_F_COMMIT)
496+ if (info->commit)
497497 err = ovs_ct_commit(net, key, info, skb);
498498 else
499499 err = ovs_ct_lookup(net, key, info, skb);
@@ -506,9 +506,9 @@ int ovs_ct_execute(struct net *net, struct sk_buff *skb, · 6 unmodified lines
506506 if (err)
507507 goto err;
508508 }
509− if (label_nonzero(&info->label.mask))
510− err = ovs_ct_set_label(skb, key, &info->label.value,
511− &info->label.mask);
509+ if (labels_nonzero(&info->labels.mask))
510+ err = ovs_ct_set_labels(skb, key, &info->labels.value,
511+ &info->labels.mask);
512512 err:
513513 skb_push(skb, nh_ofs);
514514 return err;
@@ -539,14 +539,13 @@ static int ovs_ct_add_helper(struct ovs_conntrack_info *info, const char *name, · 24 unmodified lines
539539 }
540540
541541 static const struct ovs_ct_len_tbl ovs_ct_attr_lens[OVS_CT_ATTR_MAX + 1] = {
542− [OVS_CT_ATTR_FLAGS] = { .minlen = sizeof(u32),
543− .maxlen = sizeof(u32) },
542+ [OVS_CT_ATTR_COMMIT] = { .minlen = 0, .maxlen = 0 },
544543 [OVS_CT_ATTR_ZONE] = { .minlen = sizeof(u16),
545544 .maxlen = sizeof(u16) },
546545 [OVS_CT_ATTR_MARK] = { .minlen = sizeof(struct md_mark),
547546 .maxlen = sizeof(struct md_mark) },
548− [OVS_CT_ATTR_LABEL] = { .minlen = sizeof(struct md_label),
549− .maxlen = sizeof(struct md_label) },
547+ [OVS_CT_ATTR_LABELS] = { .minlen = sizeof(struct md_labels),
548+ .maxlen = sizeof(struct md_labels) },
550549 [OVS_CT_ATTR_HELPER] = { .minlen = 1,
551550 .maxlen = NF_CT_HELPER_NAME_LEN }
552551 };
@@ -576,8 +575,8 @@ static int parse_ct(const struct nlattr *attr, struct ovs_conntrack_info *info, · 23 unmodified lines
576575 }
577576
578577 switch (type) {
579− case OVS_CT_ATTR_FLAGS:
580− info->flags = nla_get_u32(a);
578+ case OVS_CT_ATTR_COMMIT:
579+ info->commit = true;
581580 break;
582581 #ifdef CONFIG_NF_CONNTRACK_ZONES
583582 case OVS_CT_ATTR_ZONE:
@@ -593,10 +592,10 @@ static int parse_ct(const struct nlattr *attr, struct ovs_conntrack_info *info, · 9 unmodified lines
593592 }
594593 #endif
595594 #ifdef CONFIG_NF_CONNTRACK_LABELS
596− case OVS_CT_ATTR_LABEL: {
597− struct md_label *label = nla_data(a);
595+ case OVS_CT_ATTR_LABELS: {
596+ struct md_labels *labels = nla_data(a);
598597
599− info->label = *label;
598+ info->labels = *labels;
600599 break;
601600 }
602601 #endif
@@ -633,7 +632,7 @@ bool ovs_ct_verify(struct net *net, enum ovs_key_attr attr) · 30 unmodified lines
633632 attr == OVS_KEY_ATTR_CT_MARK)
634633 return true;
635634 if (IS_ENABLED(CONFIG_NF_CONNTRACK_LABELS) &&
636− attr == OVS_KEY_ATTR_CT_LABEL) {
635+ attr == OVS_KEY_ATTR_CT_LABELS) {
637636 struct ovs_net *ovs_net = net_generic(net, ovs_net_id);
638637
639638 return ovs_net->xt_label;
@@ -701,7 +700,7 @@ int ovs_ct_action_to_attr(const struct ovs_conntrack_info *ct_info, · 61 unmodified lines
701700 if (!start)
702701 return -EMSGSIZE;
703702
704− if (nla_put_u32(skb, OVS_CT_ATTR_FLAGS, ct_info->flags))
703+ if (ct_info->commit && nla_put_flag(skb, OVS_CT_ATTR_COMMIT))
705704 return -EMSGSIZE;
706705 if (IS_ENABLED(CONFIG_NF_CONNTRACK_ZONES) &&
707706 nla_put_u16(skb, OVS_CT_ATTR_ZONE, ct_info->zone.id))
@@ -711,8 +710,8 @@ int ovs_ct_action_to_attr(const struct ovs_conntrack_info *ct_info, · 3 unmodified lines
711710 &ct_info->mark))
712711 return -EMSGSIZE;
713712 if (IS_ENABLED(CONFIG_NF_CONNTRACK_LABELS) &&
714− nla_put(skb, OVS_CT_ATTR_LABEL, sizeof(ct_info->label),
715− &ct_info->label))
713+ nla_put(skb, OVS_CT_ATTR_LABELS, sizeof(ct_info->labels),
714+ &ct_info->labels))
716715 return -EMSGSIZE;
717716 if (ct_info->helper) {
718717 if (nla_put_string(skb, OVS_CT_ATTR_HELPER,
@@ -737,7 +736,7 @@ void ovs_ct_free_action(const struct nlattr *a) · 18 unmodified lines
737736
738737 void ovs_ct_init(struct net *net)
739738 {
740− unsigned int n_bits = sizeof(struct ovs_key_ct_label) * BITS_PER_BYTE;
739+ unsigned int n_bits = sizeof(struct ovs_key_ct_labels) * BITS_PER_BYTE;
741740 struct ovs_net *ovs_net = net_generic(net, ovs_net_id);
742741
743742 if (nf_connlabels_get(net, n_bits)) {
net/openvswitch/conntrack.h+13−1
@@ -34,6 +34,13 @@ int ovs_ct_execute(struct net *, struct sk_buff *, struct sw_flow_key *, · 33 unmodified lines
3434 void ovs_ct_fill_key(const struct sk_buff *skb, struct sw_flow_key *key);
3535 int ovs_ct_put_key(const struct sw_flow_key *key, struct sk_buff *skb);
3636 void ovs_ct_free_action(const struct nlattr *a);
37+
38+static inline bool ovs_ct_state_supported(u32 state)
39+{
40+ return !(state & ~(OVS_CS_F_NEW | OVS_CS_F_ESTABLISHED |
41+ OVS_CS_F_RELATED | OVS_CS_F_REPLY_DIR |
42+ OVS_CS_F_INVALID | OVS_CS_F_TRACKED));
43+}
3744 #else
3845 #include <linux/errno.h>
3946
@@ -46,6 +53,11 @@ static inline bool ovs_ct_verify(struct net *net, int attr) · 6 unmodified lines
4653 return false;
4754 }
4855
56+static inline bool ovs_ct_state_supported(u32 state)
57+{
58+ return false;
59+}
60+
4961 static inline int ovs_ct_copy_action(struct net *net, const struct nlattr *nla,
5062 const struct sw_flow_key *key,
5163 struct sw_flow_actions **acts, bool log)
@@ -72,7 +84,7 @@ static inline void ovs_ct_fill_key(const struct sk_buff *skb, · 20 unmodified lines
7284 key->ct.state = 0;
7385 key->ct.zone = 0;
7486 key->ct.mark = 0;
75− memset(&key->ct.label, 0, sizeof(key->ct.label));
87+ memset(&key->ct.labels, 0, sizeof(key->ct.labels));
7688 }
7789
7890 static inline int ovs_ct_put_key(const struct sw_flow_key *key,
net/openvswitch/flow.h+1−1
@@ -116,7 +116,7 @@ struct sw_flow_key { · 115 unmodified lines
116116 u16 zone;
117117 u32 mark;
118118 u8 state;
119− struct ovs_key_ct_label label;
119+ struct ovs_key_ct_labels labels;
120120 } ct;
121121
122122 } __aligned(BITS_PER_LONG/8); /* Ensure that we can do comparisons as longs. */
net/openvswitch/flow_netlink.c+18−12
@@ -291,10 +291,10 @@ size_t ovs_key_attr_size(void) · 290 unmodified lines
291291 + nla_total_size(4) /* OVS_KEY_ATTR_SKB_MARK */
292292 + nla_total_size(4) /* OVS_KEY_ATTR_DP_HASH */
293293 + nla_total_size(4) /* OVS_KEY_ATTR_RECIRC_ID */
294− + nla_total_size(1) /* OVS_KEY_ATTR_CT_STATE */
294+ + nla_total_size(4) /* OVS_KEY_ATTR_CT_STATE */
295295 + nla_total_size(2) /* OVS_KEY_ATTR_CT_ZONE */
296296 + nla_total_size(4) /* OVS_KEY_ATTR_CT_MARK */
297− + nla_total_size(16) /* OVS_KEY_ATTR_CT_LABEL */
297+ + nla_total_size(16) /* OVS_KEY_ATTR_CT_LABELS */
298298 + nla_total_size(12) /* OVS_KEY_ATTR_ETHERNET */
299299 + nla_total_size(2) /* OVS_KEY_ATTR_ETHERTYPE */
300300 + nla_total_size(4) /* OVS_KEY_ATTR_VLAN */
@@ -349,10 +349,10 @@ static const struct ovs_len_tbl ovs_key_lens[OVS_KEY_ATTR_MAX + 1] = { · 48 unmodified lines
349349 [OVS_KEY_ATTR_TUNNEL] = { .len = OVS_ATTR_NESTED,
350350 .next = ovs_tunnel_key_lens, },
351351 [OVS_KEY_ATTR_MPLS] = { .len = sizeof(struct ovs_key_mpls) },
352− [OVS_KEY_ATTR_CT_STATE] = { .len = sizeof(u8) },
352+ [OVS_KEY_ATTR_CT_STATE] = { .len = sizeof(u32) },
353353 [OVS_KEY_ATTR_CT_ZONE] = { .len = sizeof(u16) },
354354 [OVS_KEY_ATTR_CT_MARK] = { .len = sizeof(u32) },
355− [OVS_KEY_ATTR_CT_LABEL] = { .len = sizeof(struct ovs_key_ct_label) },
355+ [OVS_KEY_ATTR_CT_LABELS] = { .len = sizeof(struct ovs_key_ct_labels) },
356356 };
357357
358358 static bool check_attr_len(unsigned int attr_len, unsigned int expected_len)
@@ -814,7 +814,13 @@ static int metadata_from_nlattrs(struct net *net, struct sw_flow_match *match, · 455 unmodified lines
814814
815815 if (*attrs & (1 << OVS_KEY_ATTR_CT_STATE) &&
816816 ovs_ct_verify(net, OVS_KEY_ATTR_CT_STATE)) {
817− u8 ct_state = nla_get_u8(a[OVS_KEY_ATTR_CT_STATE]);
817+ u32 ct_state = nla_get_u32(a[OVS_KEY_ATTR_CT_STATE]);
818+
819+ if (!is_mask && !ovs_ct_state_supported(ct_state)) {
820+ OVS_NLERR(log, "ct_state flags %08x unsupported",
821+ ct_state);
822+ return -EINVAL;
823+ }
818824
819825 SW_FLOW_KEY_PUT(match, ct.state, ct_state, is_mask);
820826 *attrs &= ~(1ULL << OVS_KEY_ATTR_CT_STATE);
@@ -833,14 +839,14 @@ static int metadata_from_nlattrs(struct net *net, struct sw_flow_match *match, · 12 unmodified lines
833839 SW_FLOW_KEY_PUT(match, ct.mark, mark, is_mask);
834840 *attrs &= ~(1ULL << OVS_KEY_ATTR_CT_MARK);
835841 }
836− if (*attrs & (1 << OVS_KEY_ATTR_CT_LABEL) &&
837− ovs_ct_verify(net, OVS_KEY_ATTR_CT_LABEL)) {
838− const struct ovs_key_ct_label *cl;
842+ if (*attrs & (1 << OVS_KEY_ATTR_CT_LABELS) &&
843+ ovs_ct_verify(net, OVS_KEY_ATTR_CT_LABELS)) {
844+ const struct ovs_key_ct_labels *cl;
839845
840− cl = nla_data(a[OVS_KEY_ATTR_CT_LABEL]);
841− SW_FLOW_KEY_MEMCPY(match, ct.label, cl->ct_label,
846+ cl = nla_data(a[OVS_KEY_ATTR_CT_LABELS]);
847+ SW_FLOW_KEY_MEMCPY(match, ct.labels, cl->ct_labels,
842848 sizeof(*cl), is_mask);
843− *attrs &= ~(1ULL << OVS_KEY_ATTR_CT_LABEL);
849+ *attrs &= ~(1ULL << OVS_KEY_ATTR_CT_LABELS);
844850 }
845851 return 0;
846852 }
@@ -1973,7 +1979,7 @@ static int validate_set(const struct nlattr *a, · 1126 unmodified lines
19731979 case OVS_KEY_ATTR_PRIORITY:
19741980 case OVS_KEY_ATTR_SKB_MARK:
19751981 case OVS_KEY_ATTR_CT_MARK:
1976− case OVS_KEY_ATTR_CT_LABEL:
1982+ case OVS_KEY_ATTR_CT_LABELS:
19771983 case OVS_KEY_ATTR_ETHERNET:
19781984 break;
19791985
net/openvswitch/flow_table.c+2−1
@@ -93,7 +93,8 @@ struct sw_flow *ovs_flow_alloc(void) · 92 unmodified lines
9393
9494 /* Initialize the default stat node. */
9595 stats = kmem_cache_alloc_node(flow_stats_cache,
96− GFP_KERNEL | __GFP_ZERO, 0);
96+ GFP_KERNEL | __GFP_ZERO,
97+ node_online(0) ? 0 : NUMA_NO_NODE);
9798 if (!stats)
9899 goto err;
99100
net/openvswitch/vport.c+22−29
@@ -280,35 +280,19 @@ void ovs_vport_del(struct vport *vport) · 279 unmodified lines
280280 */
281281 void ovs_vport_get_stats(struct vport *vport, struct ovs_vport_stats *stats)
282282 {
283− struct net_device *dev = vport->dev;
284− int i;
285−
286− memset(stats, 0, sizeof(*stats));
287− stats->rx_errors = dev->stats.rx_errors;
288− stats->tx_errors = dev->stats.tx_errors;
289− stats->tx_dropped = dev->stats.tx_dropped;
290− stats->rx_dropped = dev->stats.rx_dropped;
291−
292− stats->rx_dropped += atomic_long_read(&dev->rx_dropped);
293− stats->tx_dropped += atomic_long_read(&dev->tx_dropped);
294−
295− for_each_possible_cpu(i) {
296− const struct pcpu_sw_netstats *percpu_stats;
297− struct pcpu_sw_netstats local_stats;
298− unsigned int start;
299−
300− percpu_stats = per_cpu_ptr(dev->tstats, i);
301−
302− do {
303− start = u64_stats_fetch_begin_irq(&percpu_stats->syncp);
304− local_stats = *percpu_stats;
305− } while (u64_stats_fetch_retry_irq(&percpu_stats->syncp, start));
306−
307− stats->rx_bytes += local_stats.rx_bytes;
308− stats->rx_packets += local_stats.rx_packets;
309− stats->tx_bytes += local_stats.tx_bytes;
310− stats->tx_packets += local_stats.tx_packets;
311− }
283+ const struct rtnl_link_stats64 *dev_stats;
284+ struct rtnl_link_stats64 temp;
285+
286+ dev_stats = dev_get_stats(vport->dev, &temp);
287+ stats->rx_errors = dev_stats->rx_errors;
288+ stats->tx_errors = dev_stats->tx_errors;
289+ stats->tx_dropped = dev_stats->tx_dropped;
290+ stats->rx_dropped = dev_stats->rx_dropped;
291+
292+ stats->rx_bytes = dev_stats->rx_bytes;
293+ stats->rx_packets = dev_stats->rx_packets;
294+ stats->tx_bytes = dev_stats->tx_bytes;
295+ stats->tx_packets = dev_stats->tx_packets;
312296 }
313297
314298 /**
@@ -460,6 +444,15 @@ int ovs_vport_receive(struct vport *vport, struct sk_buff *skb, · 145 unmodified lines
460444
461445 OVS_CB(skb)->input_vport = vport;
462446 OVS_CB(skb)->mru = 0;
447+ if (unlikely(dev_net(skb->dev) != ovs_dp_get_net(vport->dp))) {
448+ u32 mark;
449+
450+ mark = skb->mark;
451+ skb_scrub_packet(skb, true);
452+ skb->mark = mark;
453+ tun_info = NULL;
454+ }
455+
463456 /* Extract flow from 'skb' into 'key'. */
464457 error = ovs_flow_key_extract(tun_info, skb, &key);
465458 if (unlikely(error)) {
net/sched/act_mirred.c+14−4
@@ -31,13 +31,17 @@ · 30 unmodified lines
3131
3232 #define MIRRED_TAB_MASK 7
3333 static LIST_HEAD(mirred_list);
34+static DEFINE_SPINLOCK(mirred_list_lock);
3435
3536 static void tcf_mirred_release(struct tc_action *a, int bind)
3637 {
3738 struct tcf_mirred *m = to_mirred(a);
3839 struct net_device *dev = rcu_dereference_protected(m->tcfm_dev, 1);
3940
41+ /* We could be called either in a RCU callback or with RTNL lock held. */
42+ spin_lock_bh(&mirred_list_lock);
4043 list_del(&m->tcfm_list);
44+ spin_unlock_bh(&mirred_list_lock);
4145 if (dev)
4246 dev_put(dev);
4347 }
@@ -103,10 +107,10 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla, · 59 unmodified lines
103107 } else {
104108 if (bind)
105109 return 0;
106− if (!ovr) {
107− tcf_hash_release(a, bind);
110+
111+ tcf_hash_release(a, bind);
112+ if (!ovr)
108113 return -EEXIST;
109− }
110114 }
111115 m = to_mirred(a);
112116
@@ -123,7 +127,9 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla, · 10 unmodified lines
123127 }
124128
125129 if (ret == ACT_P_CREATED) {
130+ spin_lock_bh(&mirred_list_lock);
126131 list_add(&m->tcfm_list, &mirred_list);
132+ spin_unlock_bh(&mirred_list_lock);
127133 tcf_hash_insert(a);
128134 }
129135
@@ -173,6 +179,7 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a, · 43 unmodified lines
173179
174180 skb2->skb_iif = skb->dev->ifindex;
175181 skb2->dev = dev;
182+ skb_sender_cpu_clear(skb2);
176183 err = dev_queue_xmit(skb2);
177184
178185 if (err) {
@@ -221,7 +228,8 @@ static int mirred_device_event(struct notifier_block *unused, · 42 unmodified lines
221228 struct tcf_mirred *m;
222229
223230 ASSERT_RTNL();
224− if (event == NETDEV_UNREGISTER)
231+ if (event == NETDEV_UNREGISTER) {
232+ spin_lock_bh(&mirred_list_lock);
225233 list_for_each_entry(m, &mirred_list, tcfm_list) {
226234 if (rcu_access_pointer(m->tcfm_dev) == dev) {
227235 dev_put(dev);
@@ -231,6 +239,8 @@ static int mirred_device_event(struct notifier_block *unused, · 3 unmodified lines
231239 RCU_INIT_POINTER(m->tcfm_dev, NULL);
232240 }
233241 }
242+ spin_unlock_bh(&mirred_list_lock);
243+ }
234244
235245 return NOTIFY_DONE;
236246 }
net/sched/sch_hhf.c+10−1
@@ -368,6 +368,15 @@ static unsigned int hhf_drop(struct Qdisc *sch) · 367 unmodified lines
368368 return bucket - q->buckets;
369369 }
370370
371+static unsigned int hhf_qdisc_drop(struct Qdisc *sch)
372+{
373+ unsigned int prev_backlog;
374+
375+ prev_backlog = sch->qstats.backlog;
376+ hhf_drop(sch);
377+ return prev_backlog - sch->qstats.backlog;
378+}
379+
371380 static int hhf_enqueue(struct sk_buff *skb, struct Qdisc *sch)
372381 {
373382 struct hhf_sched_data *q = qdisc_priv(sch);
@@ -696,7 +705,7 @@ static struct Qdisc_ops hhf_qdisc_ops __read_mostly = { · 322 unmodified lines
696705 .enqueue = hhf_enqueue,
697706 .dequeue = hhf_dequeue,
698707 .peek = qdisc_peek_dequeued,
699− .drop = hhf_drop,
708+ .drop = hhf_qdisc_drop,
700709 .init = hhf_init,
701710 .reset = hhf_reset,
702711 .destroy = hhf_destroy,
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c+1−1
@@ -533,7 +533,7 @@ static int rdma_read_complete(struct svc_rqst *rqstp, · 532 unmodified lines
533533 rqstp->rq_arg.page_base = head->arg.page_base;
534534
535535 /* rq_respages starts after the last arg page */
536− rqstp->rq_respages = &rqstp->rq_arg.pages[page_no];
536+ rqstp->rq_respages = &rqstp->rq_pages[page_no];
537537 rqstp->rq_next_page = rqstp->rq_respages + 1;
538538
539539 /* Rebuild rq_arg head and tail. */
net/sunrpc/xprtrdma/verbs.c+3−5
@@ -543,11 +543,8 @@ rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg) · 542 unmodified lines
543543 }
544544
545545 if (memreg == RPCRDMA_FRMR) {
546− /* Requires both frmr reg and local dma lkey */
547− if (((devattr->device_cap_flags &
548− (IB_DEVICE_MEM_MGT_EXTENSIONS|IB_DEVICE_LOCAL_DMA_LKEY)) !=
549− (IB_DEVICE_MEM_MGT_EXTENSIONS|IB_DEVICE_LOCAL_DMA_LKEY)) ||
550− (devattr->max_fast_reg_page_list_len == 0)) {
546+ if (!(devattr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) ||
547+ (devattr->max_fast_reg_page_list_len == 0)) {
551548 dprintk("RPC: %s: FRMR registration "
552549 "not supported by HCA\n", __func__);
553550 memreg = RPCRDMA_MTHCAFMR;
@@ -557,6 +554,7 @@ rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg) · 3 unmodified lines
557554 if (!ia->ri_device->alloc_fmr) {
558555 dprintk("RPC: %s: MTHCAFMR registration "
559556 "not supported by HCA\n", __func__);
557+ rc = -EINVAL;
560558 goto out3;
561559 }
562560 }
net/switchdev/switchdev.c+3−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/notifier.h>
1717 #include <linux/netdevice.h>
1818 #include <linux/if_bridge.h>
19+#include <linux/if_vlan.h>
1920 #include <net/ip_fib.h>
2021 #include <net/switchdev.h>
2122
@@ -634,6 +635,8 @@ static int switchdev_port_br_afspec(struct net_device *dev, · 612 unmodified lines
634635 if (nla_len(attr) != sizeof(struct bridge_vlan_info))
635636 return -EINVAL;
636637 vinfo = nla_data(attr);
638+ if (!vinfo->vid || vinfo->vid >= VLAN_VID_MASK)
639+ return -EINVAL;
637640 vlan->flags = vinfo->flags;
638641 if (vinfo->flags & BRIDGE_VLAN_INFO_RANGE_BEGIN) {
639642 if (vlan->vid_begin)
net/tipc/msg.h+2−2
@@ -357,7 +357,7 @@ static inline u32 msg_importance(struct tipc_msg *m) · 356 unmodified lines
357357 if (likely((usr <= TIPC_CRITICAL_IMPORTANCE) && !msg_errcode(m)))
358358 return usr;
359359 if ((usr == MSG_FRAGMENTER) || (usr == MSG_BUNDLER))
360− return msg_bits(m, 5, 13, 0x7);
360+ return msg_bits(m, 9, 0, 0x7);
361361 return TIPC_SYSTEM_IMPORTANCE;
362362 }
363363
@@ -366,7 +366,7 @@ static inline void msg_set_importance(struct tipc_msg *m, u32 i) · 2 unmodified lines
366366 int usr = msg_user(m);
367367
368368 if (likely((usr == MSG_FRAGMENTER) || (usr == MSG_BUNDLER)))
369− msg_set_bits(m, 5, 13, 0x7, i);
369+ msg_set_bits(m, 9, 0, 0x7, i);
370370 else if (i < TIPC_SYSTEM_IMPORTANCE)
371371 msg_set_user(m, i);
372372 else
net/tipc/node.c+3−3
@@ -1116,7 +1116,7 @@ static bool tipc_node_check_state(struct tipc_node *n, struct sk_buff *skb, · 1115 unmodified lines
11161116 }
11171117
11181118 /* Ignore duplicate packets */
1119− if (less(oseqno, rcv_nxt))
1119+ if ((usr != LINK_PROTOCOL) && less(oseqno, rcv_nxt))
11201120 return true;
11211121
11221122 /* Initiate or update failover mode if applicable */
@@ -1146,8 +1146,8 @@ static bool tipc_node_check_state(struct tipc_node *n, struct sk_buff *skb, · 23 unmodified lines
11461146 if (!pl || !tipc_link_is_up(pl))
11471147 return true;
11481148
1149− /* Initiate or update synch mode if applicable */
1150− if ((usr == TUNNEL_PROTOCOL) && (mtyp == SYNCH_MSG)) {
1149+ /* Initiate synch mode if applicable */
1150+ if ((usr == TUNNEL_PROTOCOL) && (mtyp == SYNCH_MSG) && (oseqno == 1)) {
11511151 syncpt = iseqno + exp_pkts - 1;
11521152 if (!tipc_link_is_up(l)) {
11531153 tipc_link_fsm_evt(l, LINK_ESTABLISH_EVT);
net/unix/af_unix.c+7−5
@@ -2064,6 +2064,11 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state) · 2063 unmodified lines
20642064 goto out;
20652065 }
20662066
2067+ if (flags & MSG_PEEK)
2068+ skip = sk_peek_offset(sk, flags);
2069+ else
2070+ skip = 0;
2071+
20672072 do {
20682073 int chunk;
20692074 struct sk_buff *skb, *last;
@@ -2112,7 +2117,6 @@ unlock: · 42 unmodified lines
21122117 break;
21132118 }
21142119
2115− skip = sk_peek_offset(sk, flags);
21162120 while (skip >= unix_skb_len(skb)) {
21172121 skip -= unix_skb_len(skb);
21182122 last = skb;
@@ -2179,14 +2183,12 @@ unlock: · 60 unmodified lines
21792183 if (UNIXCB(skb).fp)
21802184 scm.fp = scm_fp_dup(UNIXCB(skb).fp);
21812185
2182− if (skip) {
2183− sk_peek_offset_fwd(sk, chunk);
2184− skip -= chunk;
2185− }
2186+ sk_peek_offset_fwd(sk, chunk);
21862187
21872188 if (UNIXCB(skb).fp)
21882189 break;
21892190
2191+ skip = 0;
21902192 last = skb;
21912193 last_len = skb->len;
21922194 unix_state_lock(sk);
scripts/package/builddeb+2−2
@@ -115,7 +115,7 @@ esac · 114 unmodified lines
115115 BUILD_DEBUG="$(grep -s '^CONFIG_DEBUG_INFO=y' $KCONFIG_CONFIG || true)"
116116
117117 # Setup the directory structure
118−rm -rf "$tmpdir" "$fwdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir"
118+rm -rf "$tmpdir" "$fwdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" $objtree/debian/files
119119 mkdir -m 755 -p "$tmpdir/DEBIAN"
120120 mkdir -p "$tmpdir/lib" "$tmpdir/boot"
121121 mkdir -p "$fwdir/lib/firmware/$version/"
@@ -408,7 +408,7 @@ binary-arch: · 286 unmodified lines
408408 \$(MAKE) KDEB_SOURCENAME=${sourcename} KDEB_PKGVERSION=${packageversion} bindeb-pkg
409409
410410 clean:
411− rm -rf debian/*tmp
411+ rm -rf debian/*tmp debian/files
412412 mv debian/ debian.backup # debian/ might be cleaned away
413413 \$(MAKE) clean
414414 mv debian.backup debian
security/keys/gc.c+4−2
@@ -134,8 +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)
137+ /* Throw away the key data if the key is instantiated */
138+ if (test_bit(KEY_FLAG_INSTANTIATED, &key->flags) &&
139+ !test_bit(KEY_FLAG_NEGATIVE, &key->flags) &&
140+ key->type->destroy)
139141 key->type->destroy(key);
140142
141143 security_key_free(key);
security/keys/request_key.c+3−0
@@ -440,6 +440,9 @@ static struct key *construct_key_and_link(struct keyring_search_context *ctx, · 439 unmodified lines
440440
441441 kenter("");
442442
443+ if (ctx->index_key.type == &key_type_keyring)
444+ return ERR_PTR(-EPERM);
445+
443446 user = key_user_lookup(current_fsuid());
444447 if (!user)
445448 return ERR_PTR(-ENOMEM);
sound/hda/ext/hdac_ext_bus.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919
2020 #include <linux/module.h>
2121 #include <linux/slab.h>
22+#include <linux/io.h>
2223 #include <sound/hdaudio_ext.h>
2324
2425 MODULE_DESCRIPTION("HDA extended core");
sound/pci/hda/hda_codec.c+1−3
@@ -3367,10 +3367,8 @@ int snd_hda_codec_build_pcms(struct hda_codec *codec) · 3366 unmodified lines
33673367 int dev, err;
33683368
33693369 err = snd_hda_codec_parse_pcms(codec);
3370− if (err < 0) {
3371− snd_hda_codec_reset(codec);
3370+ if (err < 0)
33723371 return err;
3373− }
33743372
33753373 /* attach a new PCM streams */
33763374 list_for_each_entry(cpcm, &codec->pcm_list_head, list) {
sound/pci/hda/patch_conexant.c+1−0
@@ -819,6 +819,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = { · 818 unmodified lines
819819 SND_PCI_QUIRK(0x17aa, 0x21da, "Lenovo X220", CXT_PINCFG_LENOVO_TP410),
820820 SND_PCI_QUIRK(0x17aa, 0x21db, "Lenovo X220-tablet", CXT_PINCFG_LENOVO_TP410),
821821 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo IdeaPad Z560", CXT_FIXUP_MUTE_LED_EAPD),
822+ SND_PCI_QUIRK(0x17aa, 0x390b, "Lenovo G50-80", CXT_FIXUP_STEREO_DMIC),
822823 SND_PCI_QUIRK(0x17aa, 0x3975, "Lenovo U300s", CXT_FIXUP_STEREO_DMIC),
823824 SND_PCI_QUIRK(0x17aa, 0x3977, "Lenovo IdeaPad U310", CXT_FIXUP_STEREO_DMIC),
824825 SND_PCI_QUIRK(0x17aa, 0x397b, "Lenovo S205", CXT_FIXUP_STEREO_DMIC),
sound/soc/codecs/rt298.c+13−13
@@ -50,24 +50,24 @@ struct rt298_priv { · 49 unmodified lines
5050 };
5151
5252 static struct reg_default rt298_index_def[] = {
53− { 0x01, 0xaaaa },
54− { 0x02, 0x8aaa },
53+ { 0x01, 0xa5a8 },
54+ { 0x02, 0x8e95 },
5555 { 0x03, 0x0002 },
56− { 0x04, 0xaf01 },
57− { 0x08, 0x000d },
58− { 0x09, 0xd810 },
59− { 0x0a, 0x0120 },
56+ { 0x04, 0xaf67 },
57+ { 0x08, 0x200f },
58+ { 0x09, 0xd010 },
59+ { 0x0a, 0x0100 },
6060 { 0x0b, 0x0000 },
6161 { 0x0d, 0x2800 },
62− { 0x0f, 0x0000 },
63− { 0x19, 0x0a17 },
62+ { 0x0f, 0x0022 },
63+ { 0x19, 0x0217 },
6464 { 0x20, 0x0020 },
6565 { 0x33, 0x0208 },
6666 { 0x46, 0x0300 },
67− { 0x49, 0x0004 },
68− { 0x4f, 0x50e9 },
69− { 0x50, 0x2000 },
70− { 0x63, 0x2902 },
67+ { 0x49, 0x4004 },
68+ { 0x4f, 0x50c9 },
69+ { 0x50, 0x3000 },
70+ { 0x63, 0x1b02 },
7171 { 0x67, 0x1111 },
7272 { 0x68, 0x1016 },
7373 { 0x69, 0x273f },
@@ -1214,7 +1214,7 @@ static int rt298_i2c_probe(struct i2c_client *i2c, · 1140 unmodified lines
12141214 mdelay(10);
12151215
12161216 if (!rt298->pdata.gpio2_en)
1217− regmap_write(rt298->regmap, RT298_SET_DMIC2_DEFAULT, 0x4000);
1217+ regmap_write(rt298->regmap, RT298_SET_DMIC2_DEFAULT, 0x40);
12181218 else
12191219 regmap_write(rt298->regmap, RT298_SET_DMIC2_DEFAULT, 0);
12201220
sound/soc/codecs/wm8962.c+2−0
@@ -3808,6 +3808,8 @@ static int wm8962_runtime_resume(struct device *dev) · 3807 unmodified lines
38083808
38093809 wm8962_reset(wm8962);
38103810
3811+ regcache_mark_dirty(wm8962->regmap);
3812+
38113813 /* SYSCLK defaults to on; make sure it is off so we can safely
38123814 * write to registers if the device is declocked.
38133815 */
sound/soc/soc-ops.c+28−0
@@ -206,6 +206,34 @@ int snd_soc_info_volsw(struct snd_kcontrol *kcontrol, · 205 unmodified lines
206206 }
207207 EXPORT_SYMBOL_GPL(snd_soc_info_volsw);
208208
209+/**
210+ * snd_soc_info_volsw_sx - Mixer info callback for SX TLV controls
211+ * @kcontrol: mixer control
212+ * @uinfo: control element information
213+ *
214+ * Callback to provide information about a single mixer control, or a double
215+ * mixer control that spans 2 registers of the SX TLV type. SX TLV controls
216+ * have a range that represents both positive and negative values either side
217+ * of zero but without a sign bit.
218+ *
219+ * Returns 0 for success.
220+ */
221+int snd_soc_info_volsw_sx(struct snd_kcontrol *kcontrol,
222+ struct snd_ctl_elem_info *uinfo)
223+{
224+ struct soc_mixer_control *mc =
225+ (struct soc_mixer_control *)kcontrol->private_value;
226+
227+ snd_soc_info_volsw(kcontrol, uinfo);
228+ /* Max represents the number of levels in an SX control not the
229+ * maximum value, so add the minimum value back on
230+ */
231+ uinfo->value.integer.max += mc->min;
232+
233+ return 0;
234+}
235+EXPORT_SYMBOL_GPL(snd_soc_info_volsw_sx);
236+
209237 /**
210238 * snd_soc_get_volsw - single mixer get callback
211239 * @kcontrol: mixer control
tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c+9−0
@@ -25,10 +25,19 @@ · 24 unmodified lines
2525
2626 #define FIXUP_SECTION ".ex_fixup"
2727
28+static inline unsigned long __fls(unsigned long x);
29+
2830 #include "word-at-a-time.h"
2931
3032 #include "utils.h"
3133
34+static inline unsigned long __fls(unsigned long x)
35+{
36+ int lz;
37+
38+ asm (PPC_CNTLZL "%0,%1" : "=r" (lz) : "r" (x));
39+ return sizeof(unsigned long) - 1 - lz;
40+}
3241
3342 static int page_size;
3443 static char *mem_region;
virt/kvm/arm/arch_timer.c+19−0
@@ -137,6 +137,8 @@ bool kvm_timer_should_fire(struct kvm_vcpu *vcpu) · 136 unmodified lines
137137 void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu)
138138 {
139139 struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
140+ bool phys_active;
141+ int ret;
140142
141143 /*
142144 * We're about to run this vcpu again, so there is no need to
@@ -151,6 +153,23 @@ void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu) · 8 unmodified lines
151153 */
152154 if (kvm_timer_should_fire(vcpu))
153155 kvm_timer_inject_irq(vcpu);
156+
157+ /*
158+ * We keep track of whether the edge-triggered interrupt has been
159+ * signalled to the vgic/guest, and if so, we mask the interrupt and
160+ * the physical distributor to prevent the timer from raising a
161+ * physical interrupt whenever we run a guest, preventing forward
162+ * VCPU progress.
163+ */
164+ if (kvm_vgic_get_phys_irq_active(timer->map))
165+ phys_active = true;
166+ else
167+ phys_active = false;
168+
169+ ret = irq_set_irqchip_state(timer->map->irq,
170+ IRQCHIP_STATE_ACTIVE,
171+ phys_active);
172+ WARN_ON(ret);
154173 }
155174
156175 /**
virt/kvm/arm/vgic.c+55−40
@@ -531,6 +531,34 @@ bool vgic_handle_set_pending_reg(struct kvm *kvm, · 530 unmodified lines
531531 return false;
532532 }
533533
534+/*
535+ * If a mapped interrupt's state has been modified by the guest such that it
536+ * is no longer active or pending, without it have gone through the sync path,
537+ * then the map->active field must be cleared so the interrupt can be taken
538+ * again.
539+ */
540+static void vgic_handle_clear_mapped_irq(struct kvm_vcpu *vcpu)
541+{
542+ struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
543+ struct list_head *root;
544+ struct irq_phys_map_entry *entry;
545+ struct irq_phys_map *map;
546+
547+ rcu_read_lock();
548+
549+ /* Check for PPIs */
550+ root = &vgic_cpu->irq_phys_map_list;
551+ list_for_each_entry_rcu(entry, root, entry) {
552+ map = &entry->map;
553+
554+ if (!vgic_dist_irq_is_pending(vcpu, map->virt_irq) &&
555+ !vgic_irq_is_active(vcpu, map->virt_irq))
556+ map->active = false;
557+ }
558+
559+ rcu_read_unlock();
560+}
561+
534562 bool vgic_handle_clear_pending_reg(struct kvm *kvm,
535563 struct kvm_exit_mmio *mmio,
536564 phys_addr_t offset, int vcpu_id)
@@ -561,6 +589,7 @@ bool vgic_handle_clear_pending_reg(struct kvm *kvm, · 24 unmodified lines
561589 vcpu_id, offset);
562590 vgic_reg_access(mmio, reg, offset, mode);
563591
592+ vgic_handle_clear_mapped_irq(kvm_get_vcpu(kvm, vcpu_id));
564593 vgic_update_state(kvm);
565594 return true;
566595 }
@@ -598,6 +627,7 @@ bool vgic_handle_clear_active_reg(struct kvm *kvm, · 31 unmodified lines
598627 ACCESS_READ_VALUE | ACCESS_WRITE_CLEARBIT);
599628
600629 if (mmio->is_write) {
630+ vgic_handle_clear_mapped_irq(kvm_get_vcpu(kvm, vcpu_id));
601631 vgic_update_state(kvm);
602632 return true;
603633 }
@@ -982,6 +1012,12 @@ static int compute_pending_for_cpu(struct kvm_vcpu *vcpu) · 378 unmodified lines
9821012 pend_percpu = vcpu->arch.vgic_cpu.pending_percpu;
9831013 pend_shared = vcpu->arch.vgic_cpu.pending_shared;
9841014
1015+ if (!dist->enabled) {
1016+ bitmap_zero(pend_percpu, VGIC_NR_PRIVATE_IRQS);
1017+ bitmap_zero(pend_shared, nr_shared);
1018+ return 0;
1019+ }
1020+
9851021 pending = vgic_bitmap_get_cpu_map(&dist->irq_pending, vcpu_id);
9861022 enabled = vgic_bitmap_get_cpu_map(&dist->irq_enabled, vcpu_id);
9871023 bitmap_and(pend_percpu, pending, enabled, VGIC_NR_PRIVATE_IRQS);
@@ -1009,11 +1045,6 @@ void vgic_update_state(struct kvm *kvm) · 21 unmodified lines
10091045 struct kvm_vcpu *vcpu;
10101046 int c;
10111047
1012− if (!dist->enabled) {
1013− set_bit(0, dist->irq_pending_on_cpu);
1014− return;
1015− }
1016−
10171048 kvm_for_each_vcpu(c, vcpu, kvm) {
10181049 if (compute_pending_for_cpu(vcpu))
10191050 set_bit(c, dist->irq_pending_on_cpu);
@@ -1092,6 +1123,15 @@ static void vgic_retire_lr(int lr_nr, int irq, struct kvm_vcpu *vcpu) · 72 unmodified lines
10921123 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
10931124 struct vgic_lr vlr = vgic_get_lr(vcpu, lr_nr);
10941125
1126+ /*
1127+ * We must transfer the pending state back to the distributor before
1128+ * retiring the LR, otherwise we may loose edge-triggered interrupts.
1129+ */
1130+ if (vlr.state & LR_STATE_PENDING) {
1131+ vgic_dist_irq_set_pending(vcpu, irq);
1132+ vlr.hwirq = 0;
1133+ }
1134+
10951135 vlr.state = 0;
10961136 vgic_set_lr(vcpu, lr_nr, vlr);
10971137 clear_bit(lr_nr, vgic_cpu->lr_used);
@@ -1132,7 +1172,8 @@ static void vgic_queue_irq_to_lr(struct kvm_vcpu *vcpu, int irq, · 34 unmodified lines
11321172 kvm_debug("Set active, clear distributor: 0x%x\n", vlr.state);
11331173 vgic_irq_clear_active(vcpu, irq);
11341174 vgic_update_state(vcpu->kvm);
1135− } else if (vgic_dist_irq_is_pending(vcpu, irq)) {
1175+ } else {
1176+ WARN_ON(!vgic_dist_irq_is_pending(vcpu, irq));
11361177 vlr.state |= LR_STATE_PENDING;
11371178 kvm_debug("Set pending: 0x%x\n", vlr.state);
11381179 }
@@ -1240,7 +1281,7 @@ static void __kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu) · 101 unmodified lines
12401281 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
12411282 struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
12421283 unsigned long *pa_percpu, *pa_shared;
1243− int i, vcpu_id, lr, ret;
1284+ int i, vcpu_id;
12441285 int overflow = 0;
12451286 int nr_shared = vgic_nr_shared_irqs(dist);
12461287
@@ -1295,31 +1336,6 @@ epilog: · 48 unmodified lines
12951336 */
12961337 clear_bit(vcpu_id, dist->irq_pending_on_cpu);
12971338 }
1298−
1299− for (lr = 0; lr < vgic->nr_lr; lr++) {
1300− struct vgic_lr vlr;
1301−
1302− if (!test_bit(lr, vgic_cpu->lr_used))
1303− continue;
1304−
1305− vlr = vgic_get_lr(vcpu, lr);
1306−
1307− /*
1308− * If we have a mapping, and the virtual interrupt is
1309− * presented to the guest (as pending or active), then we must
1310− * set the state to active in the physical world. See
1311− * Documentation/virtual/kvm/arm/vgic-mapped-irqs.txt.
1312− */
1313− if (vlr.state & LR_HW) {
1314− struct irq_phys_map *map;
1315− map = vgic_irq_map_search(vcpu, vlr.irq);
1316−
1317− ret = irq_set_irqchip_state(map->irq,
1318− IRQCHIP_STATE_ACTIVE,
1319− true);
1320− WARN_ON(ret);
1321− }
1322− }
13231339 }
13241340
13251341 static bool vgic_process_maintenance(struct kvm_vcpu *vcpu)
@@ -1421,7 +1437,7 @@ static int vgic_sync_hwirq(struct kvm_vcpu *vcpu, struct vgic_lr vlr) · 95 unmodified lines
14211437 return 0;
14221438
14231439 map = vgic_irq_map_search(vcpu, vlr.irq);
1424− BUG_ON(!map || !map->active);
1440+ BUG_ON(!map);
14251441
14261442 ret = irq_get_irqchip_state(map->irq,
14271443 IRQCHIP_STATE_ACTIVE,
@@ -1429,13 +1445,8 @@ static int vgic_sync_hwirq(struct kvm_vcpu *vcpu, struct vgic_lr vlr) · 1 unmodified line
14291445
14301446 WARN_ON(ret);
14311447
1432− if (map->active) {
1433− ret = irq_set_irqchip_state(map->irq,
1434− IRQCHIP_STATE_ACTIVE,
1435− false);
1436− WARN_ON(ret);
1448+ if (map->active)
14371449 return 0;
1438− }
14391450
14401451 return 1;
14411452 }
@@ -1607,8 +1618,12 @@ static int vgic_update_irq_pending(struct kvm *kvm, int cpuid, · 165 unmodified lines
16071618 } else {
16081619 if (level_triggered) {
16091620 vgic_dist_irq_clear_level(vcpu, irq_num);
1610− if (!vgic_dist_irq_soft_pend(vcpu, irq_num))
1621+ if (!vgic_dist_irq_soft_pend(vcpu, irq_num)) {
16111622 vgic_dist_irq_clear_pending(vcpu, irq_num);
1623+ vgic_cpu_irq_clear(vcpu, irq_num);
1624+ if (!compute_pending_for_cpu(vcpu))
1625+ clear_bit(cpuid, dist->irq_pending_on_cpu);
1626+ }
16121627 }
16131628
16141629 ret = false;